diff --git a/.gitignore b/.gitignore index 11cfefed5f2..740e43525b5 100644 --- a/.gitignore +++ b/.gitignore @@ -32,8 +32,12 @@ build.json tests/webhost/*.d.ts tests/webhost/webtsc.js tests/*.js +tests/*.js.map tests/*.d.ts *.config scripts/debug.bat scripts/run.bat +scripts/word2md.js +scripts/ior.js +scripts/*.js.map coverage/ diff --git a/.travis.yml b/.travis.yml index 11396be5892..305fad1e4a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,14 @@ language: node_js node_js: -- '0.10' + - '0.10' + +sudo: false before_script: npm install -g codeclimate-test-reporter after_script: -- cat coverage/lcov.info | codeclimate + - cat coverage/lcov.info | codeclimate addons: code_climate: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6ab80a408d..a30b2154133 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ Design changes will not be accepted at this time. If you have a design change pr ## Legal You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. -Please submit a Contributor License Agreement (CLA) before submitting a pull request. Download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190)), sign, scan, and email it back to . Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. Please note that we're currently only accepting pull requests of bug fixes rather than new features. +Please submit a Contributor License Agreement (CLA) before submitting a pull request. Download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to . Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. Please note that we're currently only accepting pull requests of bug fixes rather than new features. ## Housekeeping Your pull request should: @@ -26,6 +26,7 @@ Your pull request should: * Include baseline changes with your change * All changed code must have 100% code coverage * Follow the code conventions descriped in [Coding guidlines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidlines) +* To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your git configuration ## Running the Tests To run all tests, invoke the runtests target using jake: diff --git a/Jakefile b/Jakefile index 79907e8a63a..0a34de4182b 100644 --- a/Jakefile +++ b/Jakefile @@ -2,6 +2,7 @@ var fs = require("fs"); var path = require("path"); +var child_process = require("child_process"); // Variables var compilerDirectory = "src/compiler/"; @@ -9,6 +10,8 @@ var servicesDirectory = "src/services/"; var harnessDirectory = "src/harness/"; var libraryDirectory = "src/lib/"; var scriptsDirectory = "scripts/"; +var unittestsDirectory = "tests/cases/unittests/"; +var docDirectory = "doc/"; var builtDirectory = "built/"; var builtLocalDirectory = "built/local/"; @@ -52,8 +55,13 @@ var servicesSources = [ ].map(function (f) { return path.join(compilerDirectory, f); }).concat([ + "breakpoints.ts", "services.ts", "shims.ts", + "signatureHelp.ts", + "utilities.ts", + "navigationBar.ts", + "outliningElementsCollector.ts" ].map(function (f) { return path.join(servicesDirectory, f); })); @@ -63,19 +71,23 @@ var harnessSources = [ "sourceMapRecorder.ts", "harnessLanguageService.ts", "fourslash.ts", - "external/json2.ts", "runnerbase.ts", "compilerRunner.ts", "typeWriter.ts", "fourslashRunner.ts", "projectsRunner.ts", - "unittestrunner.ts", "loggedIO.ts", "rwcRunner.ts", "runner.ts" ].map(function (f) { return path.join(harnessDirectory, f); -}); +}).concat([ + "services/colorization.ts", + "services/documentRegistry.ts", + "services/preProcessFile.ts" +].map(function (f) { + return path.join(unittestsDirectory, f); +})); var librarySourceMap = [ { target: "lib.core.d.ts", sources: ["core.d.ts"] }, @@ -122,7 +134,8 @@ function concatenateFiles(destinationFile, sourceFiles) { fs.renameSync(temp, destinationFile); } -var useDebugMode = false; +var useDebugMode = true; +var generateDeclarations = false; var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node"); var compilerFilename = "tsc.js"; /* Compiles a file from a list of sources @@ -136,12 +149,16 @@ var compilerFilename = "tsc.js"; function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile) { file(outFile, prereqs, function() { var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory; - var options = "-removeComments --module commonjs -noImplicitAny "; //" -propagateEnumConstants " + var options = "-removeComments --module commonjs -noImplicitAny "; + if (generateDeclarations) { + options += "--declaration "; + } + + if (useDebugMode) { + options += "--preserveConstEnums "; + } var cmd = host + " " + dir + compilerFilename + " " + options + " "; - if (useDebugMode) { - cmd = cmd + " " + path.join(harnessDirectory, "external/es5compat.ts") + " " + path.join(harnessDirectory, "external/json2.ts") + " "; - } cmd = cmd + sources.join(" ") + (!noOutFile ? " -out " + outFile : ""); if (useDebugMode) { cmd = cmd + " -sourcemap -mapRoot file:///" + path.resolve(path.dirname(outFile)); @@ -243,12 +260,11 @@ task("local", ["generate-diagnostics", "lib", tscFile, servicesFile]); // Local target to build the compiler and services -desc("Emit debug mode files with sourcemaps"); -task("debug", function() { - useDebugMode = true; +desc("Sets release mode flag"); +task("release", function() { + useDebugMode = false; }); - // Set the default task to "local" task("default", ["local"]); @@ -259,9 +275,45 @@ task("clean", function() { jake.rmRf(builtDirectory); }); +// generate declarations for compiler and services +desc("Generate declarations for compiler and services"); +task("declaration", function() { + generateDeclarations = true; +}); + +// Generate Markdown spec +var word2mdJs = path.join(scriptsDirectory, "word2md.js"); +var word2mdTs = path.join(scriptsDirectory, "word2md.ts"); +var specWord = path.join(docDirectory, "TypeScript Language Specification.docx"); +var specMd = path.join(docDirectory, "spec.md"); + +file(word2mdTs); + +// word2md script +compileFile(word2mdJs, + [word2mdTs], + [word2mdTs], + [], + false); + +// The generated spec.md; built for the 'generate-spec' task +file(specMd, [word2mdJs, specWord], function () { + var specWordFullPath = path.resolve(specWord); + var cmd = "cscript //nologo " + word2mdJs + ' "' + specWordFullPath + '" ' + specMd; + console.log(cmd); + child_process.exec(cmd, function () { + complete(); + }); +}, {async: true}) + + +desc("Generates a Markdown version of the Language Specification"); +task("generate-spec", [specMd]) + + // Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory desc("Makes a new LKG out of the built js files"); -task("LKG", libraryTargets, function() { +task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() { var expectedFiles = [tscFile, servicesFile].concat(libraryTargets); var missingFiles = expectedFiles.filter(function (f) { return !fs.existsSync(f); @@ -318,7 +370,7 @@ function exec(cmd, completeHandler) { complete(); }) try{ - ex.run(); + ex.run(); } catch(e) { console.log('Exception: ' + e) } @@ -342,7 +394,7 @@ function cleanTestDirs() { function writeTestConfigFile(tests, testConfigFile) { console.log('Running test(s): ' + tests); var testConfigContents = '{\n' + '\ttest: [\'' + tests + '\']\n}'; - fs.writeFileSync('test.config', testConfigContents); + fs.writeFileSync('test.config', testConfigContents); } function deleteTemporaryProjectOutput() { @@ -385,7 +437,7 @@ desc("Generates code coverage data via instanbul") task("generate-code-coverage", ["tests", builtLocalDirectory], function () { var cmd = 'istanbul cover node_modules/mocha/bin/_mocha -- -R min -t ' + testTimeout + ' ' + run; console.log(cmd); - exec(cmd); + exec(cmd); }, { async: true }); // Browser tests diff --git a/README.md b/README.md index c87c8ce5ee9..f7e55d2dffe 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +[![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript) +[![Issue Stats](http://issuestats.com/github/Microsoft/TypeScript/badge/pr)](http://issuestats.com/github/microsoft/typescript) +[![Issue Stats](http://issuestats.com/github/Microsoft/TypeScript/badge/issue)](http://issuestats.com/github/microsoft/typescript) + # TypeScript [TypeScript](http://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](http://www.typescriptlang.org/Playground), and stay up to date via [our blog](http://blogs.msdn.com/typescript) and [twitter account](https://twitter.com/typescriptlang). @@ -18,7 +22,7 @@ There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob * [Quick tutorial](http://www.typescriptlang.org/Tutorial) * [Programming handbook](http://www.typescriptlang.org/Handbook) -* [Language specification](http://go.microsoft.com/fwlink/?LinkId=267238) +* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md) * [Homepage](http://www.typescriptlang.org/) ## Building @@ -47,16 +51,18 @@ npm install Use one of the following to build and test: ``` -jake local # Build the compiler into built/local -jake clean # Delete the built compiler -jake LKG # Replace the last known good with the built one. - # Bootstrapping step to be executed when the built compiler reaches a stable state. -jake tests # Build the test infrastructure using the built compiler. -jake runtests # Run tests using the built compiler and test infrastructure. - # You can override the host or specify a test for this command. - # Use host= or tests=. -jake baseline-accept # This replaces the baseline test results with the results obtained from jake runtests. -jake -T # List the above commands. +jake local # Build the compiler into built/local +jake clean # Delete the built compiler +jake LKG # Replace the last known good with the built one. + # Bootstrapping step to be executed when the built compiler reaches a stable state. +jake tests # Build the test infrastructure using the built compiler. +jake runtests # Run tests using the built compiler and test infrastructure. + # You can override the host or specify a test for this command. + # Use host= or tests=. +jake runtests-browser # Runs the tests using the built run.js file. Syntax is jake runtests. Optional + parameters 'host=', 'tests=[regex], reporter=[list|spec|json|]'. +jake baseline-accept # This replaces the baseline test results with the results obtained from jake runtests. +jake -T # List the above commands. ``` diff --git a/ThirdPartyNoticeText.txt b/ThirdPartyNoticeText.txt index 93c3e4fcb3f..6fbb7e4a0ce 100644 --- a/ThirdPartyNoticeText.txt +++ b/ThirdPartyNoticeText.txt @@ -19,67 +19,6 @@ limitations under the License. --------------------------------------------- Third Party Code Components -------------------------------------------- ----- Mozilla Developer Code--------- -The following Mozilla Developer Code is under Public Domain as updated after Aug. 20, 2012, see, https://developer.mozilla.org/en-US/docs/Project:Copyrights -1. Array filter Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/filter -Any copyright is dedicated to the Public Domain. - -2. Array forEach Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach -Any copyright is dedicated to the Public Domain. - -3. Array indexOf Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf -Any copyright is dedicated to the Public Domain. - -4. Array map Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map -Any copyright is dedicated to the Public Domain. - -5. Array Reduce Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/Reduce -Any copyright is dedicated to the Public Domain. - -6. String Trim Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim -Any copyright is dedicated to the Public Domain. - -7. Date now Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/now -Any copyright is dedicated to the Public Domain. - -------------JSON2 Script------------------------ -json2.js 2012-10-08 -Public Domain. -NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. -See, http://www.JSON.org/js.html - ---------------r.js---------------------- -Copyright (c) 2010-2011 Dojo Foundation. All Rights Reserved. -Originally License under MIT License -------------------------------------------------------------------------- -Provided for Informational Purposes Only -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------- DefinitelyTyped -------------------- This file is based on or incorporates material from the projects listed below (collectively ?Third Party Code?). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. diff --git a/bin/lib.core.d.ts b/bin/lib.core.d.ts index 1d3ed6dca4c..00dc83fa80a 100644 --- a/bin/lib.core.d.ts +++ b/bin/lib.core.d.ts @@ -499,6 +499,10 @@ declare var Number: { POSITIVE_INFINITY: number; } +interface TemplateStringsArray extends Array { + raw: string[]; +} + interface Math { /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ E: number; diff --git a/bin/lib.d.ts b/bin/lib.d.ts index a3081f2c8d7..8890fab4284 100644 --- a/bin/lib.d.ts +++ b/bin/lib.d.ts @@ -499,6 +499,10 @@ declare var Number: { POSITIVE_INFINITY: number; } +interface TemplateStringsArray extends Array { + raw: string[]; +} + interface Math { /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ E: number; @@ -1182,14 +1186,14 @@ interface Int8Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int8Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -1240,14 +1244,14 @@ interface Uint8Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint8Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -1298,14 +1302,14 @@ interface Int16Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int16Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -1356,14 +1360,14 @@ interface Uint16Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint16Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -1414,14 +1418,14 @@ interface Int32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -1472,14 +1476,14 @@ interface Uint32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -1530,14 +1534,14 @@ interface Float32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Float32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -1588,14 +1592,14 @@ interface Float64Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Float64Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -3807,30 +3811,42 @@ declare var Window: { new(): Window; } -interface FormData { - append(name: any, value: any, blobName?: string): void; +interface HTMLCollection extends MSHTMLCollectionExtensions { + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Retrieves an object from various collections. + */ + item(nameOrIndex?: any, optionalIndex?: any): Element; + /** + * Retrieves a select object or an object from an options collection. + */ + namedItem(name: string): Element; + // [name: string]: Element; + [index: number]: Element; } -declare var FormData: { - prototype: FormData; - new (form?: HTMLFormElement): FormData; +declare var HTMLCollection: { + prototype: HTMLCollection; + new(): HTMLCollection; } -interface SourceBuffer extends EventTarget { - updating: boolean; - appendWindowStart: number; - appendWindowEnd: number; - buffered: TimeRanges; - timestampOffset: number; - audioTracks: AudioTrackList; - appendBuffer(data: ArrayBufferView): void; - appendBuffer(data: ArrayBuffer): void; - remove(start: number, end: number): void; - abort(): void; - appendStream(stream: MSStream, maxSize?: number): void; +interface BlobPropertyBag { + type?: string; + endings?: string; } -declare var SourceBuffer: { - prototype: SourceBuffer; - new(): SourceBuffer; + +interface Blob { + type: string; + size: number; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; + msClose(): void; +} +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; } interface NavigatorID { @@ -5739,26 +5755,6 @@ declare var MSCSSProperties: { new(): MSCSSProperties; } -interface HTMLCollection extends MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Retrieves an object from various collections. - */ - item(nameOrIndex?: any, optionalIndex?: any): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - // [name: string]: Element; -} -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - interface SVGExternalResourcesRequired { externalResourcesRequired: SVGAnimatedBoolean; } @@ -11994,18 +11990,6 @@ declare var FileReader: { new(): FileReader; } -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new(): Blob; -} - interface ApplicationCache extends EventTarget { status: number; ondownloading: (ev: Event) => any; @@ -12164,6 +12148,14 @@ declare var MSManipulationEvent: { MS_MANIPULATION_STATE_CANCELLED: number; } +interface FormData { + append(name: any, value: any, blobName?: string): void; +} +declare var FormData: { + prototype: FormData; + new(): FormData; +} + interface HTMLDataListElement extends HTMLElement { options: HTMLCollection; } @@ -12582,6 +12574,23 @@ interface RandomSource { getRandomValues(array: ArrayBufferView): ArrayBufferView; } +interface SourceBuffer extends EventTarget { + updating: boolean; + appendWindowStart: number; + appendWindowEnd: number; + buffered: TimeRanges; + timestampOffset: number; + audioTracks: AudioTrackList; + appendBuffer(data: ArrayBuffer): void; + remove(start: number, end: number): void; + abort(): void; + appendStream(stream: MSStream, maxSize?: number): void; +} +declare var SourceBuffer: { + prototype: SourceBuffer; + new(): SourceBuffer; +} + interface MSInputMethodContext extends EventTarget { oncandidatewindowshow: (ev: any) => any; target: HTMLElement; diff --git a/bin/lib.dom.d.ts b/bin/lib.dom.d.ts index c0aceb3fc11..26d30d3a027 100644 --- a/bin/lib.dom.d.ts +++ b/bin/lib.dom.d.ts @@ -79,14 +79,14 @@ interface Int8Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int8Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -137,14 +137,14 @@ interface Uint8Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint8Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -195,14 +195,14 @@ interface Int16Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int16Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -253,14 +253,14 @@ interface Uint16Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint16Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -311,14 +311,14 @@ interface Int32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -369,14 +369,14 @@ interface Uint32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -427,14 +427,14 @@ interface Float32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Float32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -485,14 +485,14 @@ interface Float64Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Float64Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -2704,30 +2704,42 @@ declare var Window: { new(): Window; } -interface FormData { - append(name: any, value: any, blobName?: string): void; +interface HTMLCollection extends MSHTMLCollectionExtensions { + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Retrieves an object from various collections. + */ + item(nameOrIndex?: any, optionalIndex?: any): Element; + /** + * Retrieves a select object or an object from an options collection. + */ + namedItem(name: string): Element; + // [name: string]: Element; + [index: number]: Element; } -declare var FormData: { - prototype: FormData; - new (form?: HTMLFormElement): FormData; +declare var HTMLCollection: { + prototype: HTMLCollection; + new(): HTMLCollection; } -interface SourceBuffer extends EventTarget { - updating: boolean; - appendWindowStart: number; - appendWindowEnd: number; - buffered: TimeRanges; - timestampOffset: number; - audioTracks: AudioTrackList; - appendBuffer(data: ArrayBufferView): void; - appendBuffer(data: ArrayBuffer): void; - remove(start: number, end: number): void; - abort(): void; - appendStream(stream: MSStream, maxSize?: number): void; +interface BlobPropertyBag { + type?: string; + endings?: string; } -declare var SourceBuffer: { - prototype: SourceBuffer; - new(): SourceBuffer; + +interface Blob { + type: string; + size: number; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; + msClose(): void; +} +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; } interface NavigatorID { @@ -4636,26 +4648,6 @@ declare var MSCSSProperties: { new(): MSCSSProperties; } -interface HTMLCollection extends MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Retrieves an object from various collections. - */ - item(nameOrIndex?: any, optionalIndex?: any): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - // [name: string]: Element; -} -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - interface SVGExternalResourcesRequired { externalResourcesRequired: SVGAnimatedBoolean; } @@ -10891,18 +10883,6 @@ declare var FileReader: { new(): FileReader; } -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new(): Blob; -} - interface ApplicationCache extends EventTarget { status: number; ondownloading: (ev: Event) => any; @@ -11061,6 +11041,14 @@ declare var MSManipulationEvent: { MS_MANIPULATION_STATE_CANCELLED: number; } +interface FormData { + append(name: any, value: any, blobName?: string): void; +} +declare var FormData: { + prototype: FormData; + new(): FormData; +} + interface HTMLDataListElement extends HTMLElement { options: HTMLCollection; } @@ -11479,6 +11467,23 @@ interface RandomSource { getRandomValues(array: ArrayBufferView): ArrayBufferView; } +interface SourceBuffer extends EventTarget { + updating: boolean; + appendWindowStart: number; + appendWindowEnd: number; + buffered: TimeRanges; + timestampOffset: number; + audioTracks: AudioTrackList; + appendBuffer(data: ArrayBuffer): void; + remove(start: number, end: number): void; + abort(): void; + appendStream(stream: MSStream, maxSize?: number): void; +} +declare var SourceBuffer: { + prototype: SourceBuffer; + new(): SourceBuffer; +} + interface MSInputMethodContext extends EventTarget { oncandidatewindowshow: (ev: any) => any; target: HTMLElement; diff --git a/bin/lib.webworker.d.ts b/bin/lib.webworker.d.ts index 654d75b0aa9..8675d267aa4 100644 --- a/bin/lib.webworker.d.ts +++ b/bin/lib.webworker.d.ts @@ -79,14 +79,14 @@ interface Int8Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int8Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -137,14 +137,14 @@ interface Uint8Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint8Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -195,14 +195,14 @@ interface Int16Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int16Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -253,14 +253,14 @@ interface Uint16Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint16Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -311,14 +311,14 @@ interface Int32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -369,14 +369,14 @@ interface Uint32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -427,14 +427,14 @@ interface Float32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Float32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -485,14 +485,14 @@ interface Float64Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Float64Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -1453,6 +1453,11 @@ declare var FileReader: { new(): FileReader; } +interface BlobPropertyBag { + type?: string; + endings?: string; +} + interface Blob { type: string; size: number; @@ -1462,7 +1467,7 @@ interface Blob { } declare var Blob: { prototype: Blob; - new(): Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; } interface MSStream { diff --git a/bin/tsc.js b/bin/tsc.js index 5efd7065d8e..7818785929e 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -15,1758 +15,21 @@ and limitations under the License. var ts; (function (ts) { - ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, - Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, - Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, - A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, - A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1 /* Error */, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1 /* Error */, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1 /* Error */, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1 /* Error */, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1 /* Error */, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, - catch_or_finally_expected: { code: 1143, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, - Block_or_expected: { code: 1144, category: 1 /* Error */, key: "Block or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, - Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1 /* Error */, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1 /* Error */, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1 /* Error */, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1 /* Error */, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, - Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, - Type_0_is_not_assignable_to_type_1: { code: 2323, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, - Private_property_0_cannot_be_reimplemented: { code: 2325, category: 1 /* Error */, key: "Private property '{0}' cannot be reimplemented." }, - Types_of_property_0_are_incompatible_Colon: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, - Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2327, category: 1 /* Error */, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible:" }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_inaccessible: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is inaccessible." }, - An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - No_best_common_type_exists_between_0_1_and_2: { code: 2366, category: 1 /* Error */, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, - No_best_common_type_exists_between_0_and_1: { code: 2367, category: 1 /* Error */, key: "No best common type exists between '{0}' and '{1}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1 /* Error */, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1 /* Error */, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_or_private: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public or private." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1 /* Error */, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1 /* Error */, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1 /* Error */, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1 /* Error */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1 /* Error */, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1 /* Error */, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1 /* Error */, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1 /* Error */, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1 /* Error */, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1 /* Error */, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2 /* Message */, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2 /* Message */, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2 /* Message */, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, - Syntax_Colon_0: { code: 6023, category: 2 /* Message */, key: "Syntax: {0}" }, - options: { code: 6024, category: 2 /* Message */, key: "options" }, - file: { code: 6025, category: 2 /* Message */, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2 /* Message */, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2 /* Message */, key: "Options:" }, - Version_0: { code: 6029, category: 2 /* Message */, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2 /* Message */, key: "Insert command line options and files from a file." }, - File_change_detected_Compiling: { code: 6032, category: 2 /* Message */, key: "File change detected. Compiling..." }, - KIND: { code: 6034, category: 2 /* Message */, key: "KIND" }, - FILE: { code: 6035, category: 2 /* Message */, key: "FILE" }, - VERSION: { code: 6036, category: 2 /* Message */, key: "VERSION" }, - LOCATION: { code: 6037, category: 2 /* Message */, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2 /* Message */, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2 /* Message */, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2 /* Message */, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1 /* Error */, key: "Corrupted locale file {0}." }, - Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1 /* Error */, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1 /* Error */, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - You_cannot_rename_this_element: { code: 8000, category: 1 /* Error */, key: "You cannot rename this element." } - }; -})(ts || (ts = {})); -var ts; -(function (ts) { - var textToToken = { - "any": 101 /* AnyKeyword */, - "boolean": 102 /* BooleanKeyword */, - "break": 56 /* BreakKeyword */, - "case": 57 /* CaseKeyword */, - "catch": 58 /* CatchKeyword */, - "class": 59 /* ClassKeyword */, - "continue": 61 /* ContinueKeyword */, - "const": 60 /* ConstKeyword */, - "constructor": 103 /* ConstructorKeyword */, - "debugger": 62 /* DebuggerKeyword */, - "declare": 104 /* DeclareKeyword */, - "default": 63 /* DefaultKeyword */, - "delete": 64 /* DeleteKeyword */, - "do": 65 /* DoKeyword */, - "else": 66 /* ElseKeyword */, - "enum": 67 /* EnumKeyword */, - "export": 68 /* ExportKeyword */, - "extends": 69 /* ExtendsKeyword */, - "false": 70 /* FalseKeyword */, - "finally": 71 /* FinallyKeyword */, - "for": 72 /* ForKeyword */, - "function": 73 /* FunctionKeyword */, - "get": 105 /* GetKeyword */, - "if": 74 /* IfKeyword */, - "implements": 92 /* ImplementsKeyword */, - "import": 75 /* ImportKeyword */, - "in": 76 /* InKeyword */, - "instanceof": 77 /* InstanceOfKeyword */, - "interface": 93 /* InterfaceKeyword */, - "let": 94 /* LetKeyword */, - "module": 106 /* ModuleKeyword */, - "new": 78 /* NewKeyword */, - "null": 79 /* NullKeyword */, - "number": 108 /* NumberKeyword */, - "package": 95 /* PackageKeyword */, - "private": 96 /* PrivateKeyword */, - "protected": 97 /* ProtectedKeyword */, - "public": 98 /* PublicKeyword */, - "require": 107 /* RequireKeyword */, - "return": 80 /* ReturnKeyword */, - "set": 109 /* SetKeyword */, - "static": 99 /* StaticKeyword */, - "string": 110 /* StringKeyword */, - "super": 81 /* SuperKeyword */, - "switch": 82 /* SwitchKeyword */, - "this": 83 /* ThisKeyword */, - "throw": 84 /* ThrowKeyword */, - "true": 85 /* TrueKeyword */, - "try": 86 /* TryKeyword */, - "typeof": 87 /* TypeOfKeyword */, - "var": 88 /* VarKeyword */, - "void": 89 /* VoidKeyword */, - "while": 90 /* WhileKeyword */, - "with": 91 /* WithKeyword */, - "yield": 100 /* YieldKeyword */, - "{": 5 /* OpenBraceToken */, - "}": 6 /* CloseBraceToken */, - "(": 7 /* OpenParenToken */, - ")": 8 /* CloseParenToken */, - "[": 9 /* OpenBracketToken */, - "]": 10 /* CloseBracketToken */, - ".": 11 /* DotToken */, - "...": 12 /* DotDotDotToken */, - ";": 13 /* SemicolonToken */, - ",": 14 /* CommaToken */, - "<": 15 /* LessThanToken */, - ">": 16 /* GreaterThanToken */, - "<=": 17 /* LessThanEqualsToken */, - ">=": 18 /* GreaterThanEqualsToken */, - "==": 19 /* EqualsEqualsToken */, - "!=": 20 /* ExclamationEqualsToken */, - "===": 21 /* EqualsEqualsEqualsToken */, - "!==": 22 /* ExclamationEqualsEqualsToken */, - "=>": 23 /* EqualsGreaterThanToken */, - "+": 24 /* PlusToken */, - "-": 25 /* MinusToken */, - "*": 26 /* AsteriskToken */, - "/": 27 /* SlashToken */, - "%": 28 /* PercentToken */, - "++": 29 /* PlusPlusToken */, - "--": 30 /* MinusMinusToken */, - "<<": 31 /* LessThanLessThanToken */, - ">>": 32 /* GreaterThanGreaterThanToken */, - ">>>": 33 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 34 /* AmpersandToken */, - "|": 35 /* BarToken */, - "^": 36 /* CaretToken */, - "!": 37 /* ExclamationToken */, - "~": 38 /* TildeToken */, - "&&": 39 /* AmpersandAmpersandToken */, - "||": 40 /* BarBarToken */, - "?": 41 /* QuestionToken */, - ":": 42 /* ColonToken */, - "=": 43 /* EqualsToken */, - "+=": 44 /* PlusEqualsToken */, - "-=": 45 /* MinusEqualsToken */, - "*=": 46 /* AsteriskEqualsToken */, - "/=": 47 /* SlashEqualsToken */, - "%=": 48 /* PercentEqualsToken */, - "<<=": 49 /* LessThanLessThanEqualsToken */, - ">>=": 50 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 52 /* AmpersandEqualsToken */, - "|=": 53 /* BarEqualsToken */, - "^=": 54 /* CaretEqualsToken */ - }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - function lookupInUnicodeMap(code, map) { - if (code < map[0]) { - return false; - } - var lo = 0; - var hi = map.length; - var mid; - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - if (code < map[mid]) { - hi = mid; - } - else { - lo = mid + 2; - } - } - return false; - } - function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); - } - function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); - } - function makeReverseMap(source) { - var result = []; - for (var name in source) { - if (source.hasOwnProperty(name)) { - result[source[name]] = name; - } - } - return result; - } - var tokenStrings = makeReverseMap(textToToken); - function tokenToString(t) { - return tokenStrings[t]; - } - ts.tokenToString = tokenToString; - function getLineStarts(text) { - var result = new Array(); - var pos = 0; - var lineStart = 0; - while (pos < text.length) { - switch (text.charCodeAt(pos++)) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - result.push(lineStart); - lineStart = pos; - break; - } - } - result.push(lineStart); - return result; - } - ts.getLineStarts = getLineStarts; - function getPositionFromLineAndCharacter(lineStarts, line, character) { - ts.Debug.assert(line > 0); - return lineStarts[line - 1] + character - 1; - } - ts.getPositionFromLineAndCharacter = getPositionFromLineAndCharacter; - function getLineAndCharacterOfPosition(lineStarts, position) { - var lineNumber = ts.binarySearch(lineStarts, position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - return { - line: lineNumber + 1, - character: position - lineStarts[lineNumber] + 1 - }; - } - ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - function positionToLineAndCharacter(text, pos) { - var lineStarts = getLineStarts(text); - return getLineAndCharacterOfPosition(lineStarts, pos); - } - ts.positionToLineAndCharacter = positionToLineAndCharacter; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function isWhiteSpace(ch) { - return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; - } - ts.isWhiteSpace = isWhiteSpace; - function isLineBreak(ch) { - return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */; - } - ts.isLineBreak = isLineBreak; - function isDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; - } - function isOctalDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; - } - ts.isOctalDigit = isOctalDigit; - function skipTrivia(text, pos, stopAfterLineBreak) { - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) - pos++; - case 10 /* lineFeed */: - pos++; - if (stopAfterLineBreak) - return pos; - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - continue; - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - pos++; - continue; - } - break; - } - return pos; - } - } - ts.skipTrivia = skipTrivia; - function getCommentRanges(text, pos, trailing) { - var result; - var collecting = trailing || pos === 0; - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) - pos++; - case 10 /* lineFeed */: - pos++; - if (trailing) { - return result; - } - collecting = true; - if (result && result.length) { - result[result.length - 1].hasTrailingNewLine = true; - } - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - var nextChar = text.charCodeAt(pos + 1); - var hasTrailingNewLine = false; - if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { - var startPos = pos; - pos += 2; - if (nextChar === 47 /* slash */) { - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - hasTrailingNewLine = true; - break; - } - pos++; - } - } - else { - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - } - if (collecting) { - if (!result) - result = []; - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - if (result && result.length && isLineBreak(ch)) { - result[result.length - 1].hasTrailingNewLine = true; - } - pos++; - continue; - } - break; - } - return result; - } - } - function getLeadingComments(text, pos) { - return getCommentRanges(text, pos, false); - } - ts.getLeadingComments = getLeadingComments; - function getTrailingComments(text, pos) { - return getCommentRanges(text, pos, true); - } - ts.getTrailingComments = getTrailingComments; - function createScanner(languageVersion, text, onError, onComment) { - var pos; - var len; - var startPos; - var tokenPos; - var token; - var tokenValue; - var precedingLineBreak; - function error(message) { - if (onError) { - onError(message); - } - } - function isIdentifierStart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - function isIdentifierPart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - function scanNumber() { - var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; - if (text.charCodeAt(pos) === 46 /* dot */) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - } - var end = pos; - if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { - pos++; - if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) - pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { - error(ts.Diagnostics.Digit_expected); - } - } - return +(text.substring(start, end)); - } - function scanOctalDigits() { - var start = pos; - while (isOctalDigit(text.charCodeAt(pos))) { - pos++; - } - return +(text.substring(start, pos)); - } - function scanHexDigits(count, exact) { - var digits = 0; - var value = 0; - while (digits < count || !exact) { - var ch = text.charCodeAt(pos); - if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { - value = value * 16 + ch - 48 /* _0 */; - } - else if (ch >= 65 /* A */ && ch <= 70 /* F */) { - value = value * 16 + ch - 65 /* A */ + 10; - } - else if (ch >= 97 /* a */ && ch <= 102 /* f */) { - value = value * 16 + ch - 97 /* a */ + 10; - } - else { - break; - } - pos++; - digits++; - } - if (digits < count) { - value = -1; - } - return value; - } - function scanString() { - var quote = text.charCodeAt(pos++); - var result = ""; - var start = pos; - while (true) { - if (pos >= len) { - result += text.substring(start, pos); - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - var ch = text.charCodeAt(pos); - if (ch === quote) { - result += text.substring(start, pos); - pos++; - break; - } - if (ch === 92 /* backslash */) { - result += text.substring(start, pos); - pos++; - if (pos >= len) { - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - result += "\0"; - break; - case 98 /* b */: - result += "\b"; - break; - case 116 /* t */: - result += "\t"; - break; - case 110 /* n */: - result += "\n"; - break; - case 118 /* v */: - result += "\v"; - break; - case 102 /* f */: - result += "\f"; - break; - case 114 /* r */: - result += "\r"; - break; - case 39 /* singleQuote */: - result += "\'"; - break; - case 34 /* doubleQuote */: - result += "\""; - break; - case 120 /* x */: - case 117 /* u */: - var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); - if (ch >= 0) { - result += String.fromCharCode(ch); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - } - break; - case 13 /* carriageReturn */: - if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) - pos++; - break; - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - break; - default: - result += String.fromCharCode(ch); - } - start = pos; - continue; - } - if (isLineBreak(ch)) { - result += text.substring(start, pos); - error(ts.Diagnostics.Unterminated_string_literal); - break; - } - pos++; - } - return result; - } - function peekUnicodeEscape() { - if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { - var start = pos; - pos += 2; - var value = scanHexDigits(4, true); - pos = start; - return value; - } - return -1; - } - function scanIdentifierParts() { - var result = ""; - var start = pos; - while (pos < len) { - var ch = text.charCodeAt(pos); - if (isIdentifierPart(ch)) { - pos++; - } - else if (ch === 92 /* backslash */) { - ch = peekUnicodeEscape(); - if (!(ch >= 0 && isIdentifierPart(ch))) { - break; - } - result += text.substring(start, pos); - result += String.fromCharCode(ch); - pos += 6; - start = pos; - } - else { - break; - } - } - result += text.substring(start, pos); - return result; - } - function getIdentifierToken() { - var len = tokenValue.length; - if (len >= 2 && len <= 11) { - var ch = tokenValue.charCodeAt(0); - if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; - } - } - return token = 55 /* Identifier */; - } - function scan() { - startPos = pos; - precedingLineBreak = false; - while (true) { - tokenPos = pos; - if (pos >= len) { - return token = 1 /* EndOfFileToken */; - } - var ch = text.charCodeAt(pos); - switch (ch) { - case 10 /* lineFeed */: - case 13 /* carriageReturn */: - precedingLineBreak = true; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 33 /* exclamation */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 22 /* ExclamationEqualsEqualsToken */; - } - return pos += 2, token = 20 /* ExclamationEqualsToken */; - } - return pos++, token = 37 /* ExclamationToken */; - case 34 /* doubleQuote */: - case 39 /* singleQuote */: - tokenValue = scanString(); - return token = 3 /* StringLiteral */; - case 37 /* percent */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 48 /* PercentEqualsToken */; - } - return pos++, token = 28 /* PercentToken */; - case 38 /* ampersand */: - if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 39 /* AmpersandAmpersandToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 52 /* AmpersandEqualsToken */; - } - return pos++, token = 34 /* AmpersandToken */; - case 40 /* openParen */: - return pos++, token = 7 /* OpenParenToken */; - case 41 /* closeParen */: - return pos++, token = 8 /* CloseParenToken */; - case 42 /* asterisk */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 46 /* AsteriskEqualsToken */; - } - return pos++, token = 26 /* AsteriskToken */; - case 43 /* plus */: - if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 29 /* PlusPlusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 44 /* PlusEqualsToken */; - } - return pos++, token = 24 /* PlusToken */; - case 44 /* comma */: - return pos++, token = 14 /* CommaToken */; - case 45 /* minus */: - if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 30 /* MinusMinusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 45 /* MinusEqualsToken */; - } - return pos++, token = 25 /* MinusToken */; - case 46 /* dot */: - if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); - return token = 2 /* NumericLiteral */; - } - if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { - return pos += 3, token = 12 /* DotDotDotToken */; - } - return pos++, token = 11 /* DotToken */; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < len) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - if (onComment) { - onComment(tokenPos, pos); - } - continue; - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - var commentClosed = false; - while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - commentClosed = true; - break; - } - if (isLineBreak(ch)) { - precedingLineBreak = true; - } - pos++; - } - if (!commentClosed) { - error(ts.Diagnostics.Asterisk_Slash_expected); - } - if (onComment) { - onComment(tokenPos, pos); - } - continue; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 47 /* SlashEqualsToken */; - } - return pos++, token = 27 /* SlashToken */; - case 48 /* _0 */: - if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { - pos += 2; - var value = scanHexDigits(1, false); - if (value < 0) { - error(ts.Diagnostics.Hexadecimal_digit_expected); - value = 0; - } - tokenValue = "" + value; - return 2 /* NumericLiteral */; - } - if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanOctalDigits(); - return 2 /* NumericLiteral */; - } - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - tokenValue = "" + scanNumber(); - return token = 2 /* NumericLiteral */; - case 58 /* colon */: - return pos++, token = 42 /* ColonToken */; - case 59 /* semicolon */: - return pos++, token = 13 /* SemicolonToken */; - case 60 /* lessThan */: - if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 49 /* LessThanLessThanEqualsToken */; - } - return pos += 2, token = 31 /* LessThanLessThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 17 /* LessThanEqualsToken */; - } - return pos++, token = 15 /* LessThanToken */; - case 61 /* equals */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 21 /* EqualsEqualsEqualsToken */; - } - return pos += 2, token = 19 /* EqualsEqualsToken */; - } - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 23 /* EqualsGreaterThanToken */; - } - return pos++, token = 43 /* EqualsToken */; - case 62 /* greaterThan */: - return pos++, token = 16 /* GreaterThanToken */; - case 63 /* question */: - return pos++, token = 41 /* QuestionToken */; - case 91 /* openBracket */: - return pos++, token = 9 /* OpenBracketToken */; - case 93 /* closeBracket */: - return pos++, token = 10 /* CloseBracketToken */; - case 94 /* caret */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* CaretEqualsToken */; - } - return pos++, token = 36 /* CaretToken */; - case 123 /* openBrace */: - return pos++, token = 5 /* OpenBraceToken */; - case 124 /* bar */: - if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 40 /* BarBarToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 53 /* BarEqualsToken */; - } - return pos++, token = 35 /* BarToken */; - case 125 /* closeBrace */: - return pos++, token = 6 /* CloseBraceToken */; - case 126 /* tilde */: - return pos++, token = 38 /* TildeToken */; - case 92 /* backslash */: - var ch = peekUnicodeEscape(); - if (ch >= 0 && isIdentifierStart(ch)) { - pos += 6; - tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); - return token = getIdentifierToken(); - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - default: - if (isIdentifierStart(ch)) { - pos++; - while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) - pos++; - tokenValue = text.substring(tokenPos, pos); - if (ch === 92 /* backslash */) { - tokenValue += scanIdentifierParts(); - } - return token = getIdentifierToken(); - } - else if (isWhiteSpace(ch)) { - pos++; - continue; - } - else if (isLineBreak(ch)) { - precedingLineBreak = true; - pos++; - continue; - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - } - } - } - function reScanGreaterToken() { - if (token === 16 /* GreaterThanToken */) { - if (text.charCodeAt(pos) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - } - return pos += 2, token = 33 /* GreaterThanGreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 50 /* GreaterThanGreaterThanEqualsToken */; - } - return pos++, token = 32 /* GreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 18 /* GreaterThanEqualsToken */; - } - } - return token; - } - function reScanSlashToken() { - if (token === 27 /* SlashToken */ || token === 47 /* SlashEqualsToken */) { - var p = tokenPos + 1; - var inEscape = false; - var inCharacterClass = false; - while (true) { - if (p >= len) { - return token; - } - var ch = text.charCodeAt(p); - if (isLineBreak(ch)) { - return token; - } - if (inEscape) { - inEscape = false; - } - else if (ch === 47 /* slash */ && !inCharacterClass) { - break; - } - else if (ch === 91 /* openBracket */) { - inCharacterClass = true; - } - else if (ch === 92 /* backslash */) { - inEscape = true; - } - else if (ch === 93 /* closeBracket */) { - inCharacterClass = false; - } - p++; - } - p++; - while (isIdentifierPart(text.charCodeAt(p))) { - p++; - } - pos = p; - tokenValue = text.substring(tokenPos, pos); - token = 4 /* RegularExpressionLiteral */; - } - return token; - } - function tryScan(callback) { - var savePos = pos; - var saveStartPos = startPos; - var saveTokenPos = tokenPos; - var saveToken = token; - var saveTokenValue = tokenValue; - var savePrecedingLineBreak = precedingLineBreak; - var result = callback(); - if (!result) { - pos = savePos; - startPos = saveStartPos; - tokenPos = saveTokenPos; - token = saveToken; - tokenValue = saveTokenValue; - precedingLineBreak = savePrecedingLineBreak; - } - return result; - } - function setText(newText) { - text = newText || ""; - len = text.length; - setTextPos(0); - } - function setTextPos(textPos) { - pos = textPos; - startPos = textPos; - tokenPos = textPos; - token = 0 /* Unknown */; - precedingLineBreak = false; - } - setText(text); - return { - getStartPos: function () { return startPos; }, - getTextPos: function () { return pos; }, - getToken: function () { return token; }, - getTokenPos: function () { return tokenPos; }, - getTokenText: function () { return text.substring(tokenPos, pos); }, - getTokenValue: function () { return tokenValue; }, - hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 55 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; }, - isReservedWord: function () { return token >= ts.SyntaxKind.FirstReservedWord && token <= ts.SyntaxKind.LastReservedWord; }, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan - }; - } - ts.createScanner = createScanner; -})(ts || (ts = {})); -var ts; -(function (ts) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 2] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 3] = "StringLiteral"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 4] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 5] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 6] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 7] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 8] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 9] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 10] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 11] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 12] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 13] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 14] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 15] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 16] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 17] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 18] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 19] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 20] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 21] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 22] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 23] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 24] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 25] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 26] = "AsteriskToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 27] = "SlashToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 28] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 29] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 30] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 31] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 32] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 33] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 34] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 35] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 36] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 37] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 38] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 39] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 40] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 41] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 42] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 43] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 44] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 45] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 46] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 47] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 48] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 49] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 50] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 51] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 52] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 53] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 54] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["Identifier"] = 55] = "Identifier"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 56] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 57] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 58] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 59] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 60] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 61] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 62] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 63] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 64] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 65] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 66] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 67] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 68] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 69] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 70] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 71] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 72] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 73] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 74] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 75] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 76] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 77] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 78] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 79] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 80] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 81] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 82] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 83] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 84] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 85] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 86] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 87] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 88] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 89] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 90] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 91] = "WithKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 92] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 93] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 94] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 95] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 96] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 97] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 98] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 99] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 100] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 101] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 102] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 103] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 104] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 105] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 106] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 107] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 108] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 109] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 110] = "StringKeyword"; - SyntaxKind[SyntaxKind["Missing"] = 111] = "Missing"; - SyntaxKind[SyntaxKind["QualifiedName"] = 112] = "QualifiedName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 113] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 114] = "Parameter"; - SyntaxKind[SyntaxKind["Property"] = 115] = "Property"; - SyntaxKind[SyntaxKind["Method"] = 116] = "Method"; - SyntaxKind[SyntaxKind["Constructor"] = 117] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 118] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 119] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 120] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 121] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 122] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 123] = "TypeReference"; - SyntaxKind[SyntaxKind["TypeQuery"] = 124] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 125] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 126] = "ArrayType"; - SyntaxKind[SyntaxKind["ArrayLiteral"] = 127] = "ArrayLiteral"; - SyntaxKind[SyntaxKind["ObjectLiteral"] = 128] = "ObjectLiteral"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 129] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["PropertyAccess"] = 130] = "PropertyAccess"; - SyntaxKind[SyntaxKind["IndexedAccess"] = 131] = "IndexedAccess"; - SyntaxKind[SyntaxKind["CallExpression"] = 132] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 133] = "NewExpression"; - SyntaxKind[SyntaxKind["TypeAssertion"] = 134] = "TypeAssertion"; - SyntaxKind[SyntaxKind["ParenExpression"] = 135] = "ParenExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 136] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 137] = "ArrowFunction"; - SyntaxKind[SyntaxKind["PrefixOperator"] = 138] = "PrefixOperator"; - SyntaxKind[SyntaxKind["PostfixOperator"] = 139] = "PostfixOperator"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 140] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 141] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 142] = "OmittedExpression"; - SyntaxKind[SyntaxKind["Block"] = 143] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 144] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 145] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 146] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 147] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 148] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 149] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 150] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 151] = "ForInStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 152] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 153] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 154] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 155] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 156] = "SwitchStatement"; - SyntaxKind[SyntaxKind["CaseClause"] = 157] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 158] = "DefaultClause"; - SyntaxKind[SyntaxKind["LabelledStatement"] = 159] = "LabelledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 160] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 161] = "TryStatement"; - SyntaxKind[SyntaxKind["TryBlock"] = 162] = "TryBlock"; - SyntaxKind[SyntaxKind["CatchBlock"] = 163] = "CatchBlock"; - SyntaxKind[SyntaxKind["FinallyBlock"] = 164] = "FinallyBlock"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 165] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 166] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 167] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["FunctionBlock"] = 168] = "FunctionBlock"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 169] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 170] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 171] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 172] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 173] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 174] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 175] = "ExportAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 176] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 177] = "SourceFile"; - SyntaxKind[SyntaxKind["Program"] = 178] = "Program"; - SyntaxKind[SyntaxKind["SyntaxList"] = 179] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 180] = "Count"; - SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.BreakKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.StringKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = SyntaxKind.TypeReference] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = SyntaxKind.ArrayType] = "LastTypeNode"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; - })(ts.SyntaxKind || (ts.SyntaxKind = {})); - var SyntaxKind = ts.SyntaxKind; - (function (NodeFlags) { - NodeFlags[NodeFlags["Export"] = 0x00000001] = "Export"; - NodeFlags[NodeFlags["Ambient"] = 0x00000002] = "Ambient"; - NodeFlags[NodeFlags["QuestionMark"] = 0x00000004] = "QuestionMark"; - NodeFlags[NodeFlags["Rest"] = 0x00000008] = "Rest"; - NodeFlags[NodeFlags["Public"] = 0x00000010] = "Public"; - NodeFlags[NodeFlags["Private"] = 0x00000020] = "Private"; - NodeFlags[NodeFlags["Static"] = 0x00000040] = "Static"; - NodeFlags[NodeFlags["MultiLine"] = 0x00000080] = "MultiLine"; - NodeFlags[NodeFlags["Synthetic"] = 0x00000100] = "Synthetic"; - NodeFlags[NodeFlags["DeclarationFile"] = 0x00000200] = "DeclarationFile"; - NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Static] = "Modifier"; - })(ts.NodeFlags || (ts.NodeFlags = {})); - var NodeFlags = ts.NodeFlags; - (function (TypeFormatFlags) { - TypeFormatFlags[TypeFormatFlags["None"] = 0x00000000] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 0x00000001] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 0x00000002] = "UseTypeOfFunction"; - })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); - var TypeFormatFlags = ts.TypeFormatFlags; - (function (SymbolAccessibility) { - SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; - SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; - SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; - })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); - var SymbolAccessibility = ts.SymbolAccessibility; - (function (SymbolFlags) { - SymbolFlags[SymbolFlags["Variable"] = 0x00000001] = "Variable"; - SymbolFlags[SymbolFlags["Property"] = 0x00000002] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 0x00000004] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 0x00000008] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 0x00000010] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 0x00000020] = "Interface"; - SymbolFlags[SymbolFlags["Enum"] = 0x00000040] = "Enum"; - SymbolFlags[SymbolFlags["ValueModule"] = 0x00000080] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000100] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000200] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000400] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 0x00000800] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 0x00001000] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 0x00002000] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 0x00004000] = "SetAccessor"; - SymbolFlags[SymbolFlags["CallSignature"] = 0x00008000] = "CallSignature"; - SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00010000] = "ConstructSignature"; - SymbolFlags[SymbolFlags["IndexSignature"] = 0x00020000] = "IndexSignature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 0x00040000] = "TypeParameter"; - SymbolFlags[SymbolFlags["ExportValue"] = 0x00080000] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 0x00100000] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00200000] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Import"] = 0x00400000] = "Import"; - SymbolFlags[SymbolFlags["Instantiated"] = 0x00800000] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 0x01000000] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 0x02000000] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 0x04000000] = "Prototype"; - SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; - SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter] = "Type"; - SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; - SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; - SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; - SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["VariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.Variable] = "VariableExcludes"; - SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~SymbolFlags.ValueModule] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = SymbolFlags.Type & ~SymbolFlags.Interface] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["EnumExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~(SymbolFlags.Enum | SymbolFlags.ValueModule)] = "EnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)] = "ValueModuleExcludes"; - SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = SymbolFlags.Value & ~SymbolFlags.Method] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.Import] = "ModuleMember"; - SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; - SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; - SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; - SymbolFlags[SymbolFlags["HasMembers"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral] = "HasMembers"; - SymbolFlags[SymbolFlags["IsContainer"] = SymbolFlags.HasLocals | SymbolFlags.HasExports | SymbolFlags.HasMembers] = "IsContainer"; - SymbolFlags[SymbolFlags["PropertyOrAccessor"] = SymbolFlags.Property | SymbolFlags.Accessor] = "PropertyOrAccessor"; - SymbolFlags[SymbolFlags["Export"] = SymbolFlags.ExportNamespace | SymbolFlags.ExportType | SymbolFlags.ExportValue] = "Export"; - })(ts.SymbolFlags || (ts.SymbolFlags = {})); - var SymbolFlags = ts.SymbolFlags; - (function (NodeCheckFlags) { - NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 0x00000001] = "TypeChecked"; - NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 0x00000002] = "LexicalThis"; - NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 0x00000004] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 0x00000008] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 0x00000010] = "SuperInstance"; - NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 0x00000020] = "SuperStatic"; - NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 0x00000040] = "ContextChecked"; - })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); - var NodeCheckFlags = ts.NodeCheckFlags; - (function (TypeFlags) { - TypeFlags[TypeFlags["Any"] = 0x00000001] = "Any"; - TypeFlags[TypeFlags["String"] = 0x00000002] = "String"; - TypeFlags[TypeFlags["Number"] = 0x00000004] = "Number"; - TypeFlags[TypeFlags["Boolean"] = 0x00000008] = "Boolean"; - TypeFlags[TypeFlags["Void"] = 0x00000010] = "Void"; - TypeFlags[TypeFlags["Undefined"] = 0x00000020] = "Undefined"; - TypeFlags[TypeFlags["Null"] = 0x00000040] = "Null"; - TypeFlags[TypeFlags["Enum"] = 0x00000080] = "Enum"; - TypeFlags[TypeFlags["StringLiteral"] = 0x00000100] = "StringLiteral"; - TypeFlags[TypeFlags["TypeParameter"] = 0x00000200] = "TypeParameter"; - TypeFlags[TypeFlags["Class"] = 0x00000400] = "Class"; - TypeFlags[TypeFlags["Interface"] = 0x00000800] = "Interface"; - TypeFlags[TypeFlags["Reference"] = 0x00001000] = "Reference"; - TypeFlags[TypeFlags["Anonymous"] = 0x00002000] = "Anonymous"; - TypeFlags[TypeFlags["FromSignature"] = 0x00004000] = "FromSignature"; - TypeFlags[TypeFlags["Intrinsic"] = TypeFlags.Any | TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null] = "Intrinsic"; - TypeFlags[TypeFlags["StringLike"] = TypeFlags.String | TypeFlags.StringLiteral] = "StringLike"; - TypeFlags[TypeFlags["NumberLike"] = TypeFlags.Number | TypeFlags.Enum] = "NumberLike"; - TypeFlags[TypeFlags["ObjectType"] = TypeFlags.Class | TypeFlags.Interface | TypeFlags.Reference | TypeFlags.Anonymous] = "ObjectType"; - })(ts.TypeFlags || (ts.TypeFlags = {})); - var TypeFlags = ts.TypeFlags; - (function (SignatureKind) { - SignatureKind[SignatureKind["Call"] = 0] = "Call"; - SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; - })(ts.SignatureKind || (ts.SignatureKind = {})); - var SignatureKind = ts.SignatureKind; - (function (IndexKind) { - IndexKind[IndexKind["String"] = 0] = "String"; - IndexKind[IndexKind["Number"] = 1] = "Number"; - })(ts.IndexKind || (ts.IndexKind = {})); - var IndexKind = ts.IndexKind; + (function (EmitReturnStatus) { + EmitReturnStatus[EmitReturnStatus["Succeeded"] = 0] = "Succeeded"; + EmitReturnStatus[EmitReturnStatus["AllOutputGenerationSkipped"] = 1] = "AllOutputGenerationSkipped"; + EmitReturnStatus[EmitReturnStatus["JSGeneratedWithSemanticErrors"] = 2] = "JSGeneratedWithSemanticErrors"; + EmitReturnStatus[EmitReturnStatus["DeclarationGenerationSkipped"] = 3] = "DeclarationGenerationSkipped"; + EmitReturnStatus[EmitReturnStatus["EmitErrorsEncountered"] = 4] = "EmitErrorsEncountered"; + EmitReturnStatus[EmitReturnStatus["CompilerOptionsErrors"] = 5] = "CompilerOptionsErrors"; + })(ts.EmitReturnStatus || (ts.EmitReturnStatus = {})); + var EmitReturnStatus = ts.EmitReturnStatus; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); var DiagnosticCategory = ts.DiagnosticCategory; - (function (ModuleKind) { - ModuleKind[ModuleKind["None"] = 0] = "None"; - ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; - ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; - })(ts.ModuleKind || (ts.ModuleKind = {})); - var ModuleKind = ts.ModuleKind; - (function (ScriptTarget) { - ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; - ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; - })(ts.ScriptTarget || (ts.ScriptTarget = {})); - var ScriptTarget = ts.ScriptTarget; - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 0x7F] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 0x0A] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 0x0D] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - CharacterCodes[CharacterCodes["mathematicalSpace"] = 0x205F] = "mathematicalSpace"; - CharacterCodes[CharacterCodes["ogham"] = 0x1680] = "ogham"; - CharacterCodes[CharacterCodes["_"] = 0x5F] = "_"; - CharacterCodes[CharacterCodes["$"] = 0x24] = "$"; - CharacterCodes[CharacterCodes["_0"] = 0x30] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 0x31] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 0x32] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 0x33] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 0x34] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 0x35] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 0x36] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 0x37] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 0x38] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 0x39] = "_9"; - CharacterCodes[CharacterCodes["a"] = 0x61] = "a"; - CharacterCodes[CharacterCodes["b"] = 0x62] = "b"; - CharacterCodes[CharacterCodes["c"] = 0x63] = "c"; - CharacterCodes[CharacterCodes["d"] = 0x64] = "d"; - CharacterCodes[CharacterCodes["e"] = 0x65] = "e"; - CharacterCodes[CharacterCodes["f"] = 0x66] = "f"; - CharacterCodes[CharacterCodes["g"] = 0x67] = "g"; - CharacterCodes[CharacterCodes["h"] = 0x68] = "h"; - CharacterCodes[CharacterCodes["i"] = 0x69] = "i"; - CharacterCodes[CharacterCodes["j"] = 0x6A] = "j"; - CharacterCodes[CharacterCodes["k"] = 0x6B] = "k"; - CharacterCodes[CharacterCodes["l"] = 0x6C] = "l"; - CharacterCodes[CharacterCodes["m"] = 0x6D] = "m"; - CharacterCodes[CharacterCodes["n"] = 0x6E] = "n"; - CharacterCodes[CharacterCodes["o"] = 0x6F] = "o"; - CharacterCodes[CharacterCodes["p"] = 0x70] = "p"; - CharacterCodes[CharacterCodes["q"] = 0x71] = "q"; - CharacterCodes[CharacterCodes["r"] = 0x72] = "r"; - CharacterCodes[CharacterCodes["s"] = 0x73] = "s"; - CharacterCodes[CharacterCodes["t"] = 0x74] = "t"; - CharacterCodes[CharacterCodes["u"] = 0x75] = "u"; - CharacterCodes[CharacterCodes["v"] = 0x76] = "v"; - CharacterCodes[CharacterCodes["w"] = 0x77] = "w"; - CharacterCodes[CharacterCodes["x"] = 0x78] = "x"; - CharacterCodes[CharacterCodes["y"] = 0x79] = "y"; - CharacterCodes[CharacterCodes["z"] = 0x7A] = "z"; - CharacterCodes[CharacterCodes["A"] = 0x41] = "A"; - CharacterCodes[CharacterCodes["B"] = 0x42] = "B"; - CharacterCodes[CharacterCodes["C"] = 0x43] = "C"; - CharacterCodes[CharacterCodes["D"] = 0x44] = "D"; - CharacterCodes[CharacterCodes["E"] = 0x45] = "E"; - CharacterCodes[CharacterCodes["F"] = 0x46] = "F"; - CharacterCodes[CharacterCodes["G"] = 0x47] = "G"; - CharacterCodes[CharacterCodes["H"] = 0x48] = "H"; - CharacterCodes[CharacterCodes["I"] = 0x49] = "I"; - CharacterCodes[CharacterCodes["J"] = 0x4A] = "J"; - CharacterCodes[CharacterCodes["K"] = 0x4B] = "K"; - CharacterCodes[CharacterCodes["L"] = 0x4C] = "L"; - CharacterCodes[CharacterCodes["M"] = 0x4D] = "M"; - CharacterCodes[CharacterCodes["N"] = 0x4E] = "N"; - CharacterCodes[CharacterCodes["O"] = 0x4F] = "O"; - CharacterCodes[CharacterCodes["P"] = 0x50] = "P"; - CharacterCodes[CharacterCodes["Q"] = 0x51] = "Q"; - CharacterCodes[CharacterCodes["R"] = 0x52] = "R"; - CharacterCodes[CharacterCodes["S"] = 0x53] = "S"; - CharacterCodes[CharacterCodes["T"] = 0x54] = "T"; - CharacterCodes[CharacterCodes["U"] = 0x55] = "U"; - CharacterCodes[CharacterCodes["V"] = 0x56] = "V"; - CharacterCodes[CharacterCodes["W"] = 0x57] = "W"; - CharacterCodes[CharacterCodes["X"] = 0x58] = "X"; - CharacterCodes[CharacterCodes["Y"] = 0x59] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 0x5a] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 0x26] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 0x2A] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 0x40] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 0x5C] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 0x7C] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 0x5E] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 0x7D] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 0x5D] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 0x29] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 0x3A] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 0x2C] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 0x2E] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 0x22] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 0x3D] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 0x21] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 0x3E] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 0x3C] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 0x2D] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 0x7B] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 0x5B] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 0x28] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 0x25] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 0x2B] = "plus"; - CharacterCodes[CharacterCodes["question"] = 0x3F] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 0x3B] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 0x27] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 0x2F] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 0x7E] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 0x08] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 0x0C] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 0x09] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 0x0B] = "verticalTab"; - })(ts.CharacterCodes || (ts.CharacterCodes = {})); - var CharacterCodes = ts.CharacterCodes; })(ts || (ts = {})); var ts; (function (ts) { @@ -1774,8 +37,9 @@ var ts; var result; if (array) { for (var i = 0, len = array.length; i < len; i++) { - if (result = callback(array[i])) + if (result = callback(array[i])) { break; + } } } return result; @@ -1783,8 +47,7 @@ var ts; ts.forEach = forEach; function contains(array, value) { if (array) { - var len = array.length; - for (var i = 0; i < len; i++) { + for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return true; } @@ -1795,8 +58,7 @@ var ts; ts.contains = contains; function indexOf(array, value) { if (array) { - var len = array.length; - for (var i = 0; i < len; i++) { + for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return i; } @@ -1805,10 +67,21 @@ var ts; return -1; } ts.indexOf = indexOf; - function filter(array, f) { - var result; + function countWhere(array, predicate) { + var count = 0; if (array) { - result = []; + for (var i = 0, len = array.length; i < len; i++) { + if (predicate(array[i])) { + count++; + } + } + } + return count; + } + ts.countWhere = countWhere; + function filter(array, f) { + if (array) { + var result = []; for (var i = 0, len = array.length; i < len; i++) { var item = array[i]; if (f(item)) { @@ -1820,11 +93,9 @@ var ts; } ts.filter = filter; function map(array, f) { - var result; if (array) { - result = []; - var len = array.length; - for (var i = 0; i < len; i++) { + var result = []; + for (var i = 0, len = array.length; i < len; i++) { result.push(f(array[i])); } } @@ -1839,6 +110,18 @@ var ts; return array1.concat(array2); } ts.concatenate = concatenate; + function deduplicate(array) { + if (array) { + var result = []; + for (var i = 0, len = array.length; i < len; i++) { + var item = array[i]; + if (!contains(result, item)) + result.push(item); + } + } + return result; + } + ts.deduplicate = deduplicate; function sum(array, prop) { var result = 0; for (var i = 0; i < array.length; i++) { @@ -1847,6 +130,13 @@ var ts; return result; } ts.sum = sum; + function lastOrUndefined(array) { + if (array.length === 0) { + return undefined; + } + return array[array.length - 1]; + } + ts.lastOrUndefined = lastOrUndefined; function binarySearch(array, value) { var low = 0; var high = array.length - 1; @@ -1936,13 +226,12 @@ var ts; } ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { - if (ts.localizedDiagnosticMessages) { - message = ts.localizedDiagnosticMessages[message]; - } - return message; + return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] ? ts.localizedDiagnosticMessages[message] : message; } ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { + Debug.assert(start >= 0, "start must be non-negative, is " + start); + Debug.assert(length >= 0, "length must be non-negative, is " + length); var text = getLocaleSpecificMessage(message.key); if (arguments.length > 4) { text = formatStringFromArgs(text, arguments, 4); @@ -1953,7 +242,8 @@ var ts; length: length, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } ts.createFileDiagnostic = createFileDiagnostic; @@ -1968,7 +258,8 @@ var ts; length: undefined, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } ts.createCompilerDiagnostic = createCompilerDiagnostic; @@ -1985,7 +276,15 @@ var ts; }; } ts.chainDiagnosticMessages = chainDiagnosticMessages; + function concatenateDiagnosticMessageChains(headChain, tailChain) { + Debug.assert(!headChain.next); + headChain.next = tailChain; + return headChain; + } + ts.concatenateDiagnosticMessageChains = concatenateDiagnosticMessageChains; function flattenDiagnosticChain(file, start, length, diagnosticChain, newLine) { + Debug.assert(start >= 0, "start must be non-negative, is " + start); + Debug.assert(length >= 0, "length must be non-negative, is " + length); var code = diagnosticChain.code; var category = diagnosticChain.category; var messageText = ""; @@ -2013,12 +312,12 @@ var ts; ts.flattenDiagnosticChain = flattenDiagnosticChain; function compareValues(a, b) { if (a === b) - return 0; + return 0 /* EqualTo */; if (a === undefined) - return -1; + return -1 /* LessThan */; if (b === undefined) - return 1; - return a < b ? -1 : 1; + return 1 /* GreaterThan */; + return a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; } ts.compareValues = compareValues; function getDiagnosticFilename(diagnostic) { @@ -2036,7 +335,7 @@ var ts; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0 /* EqualTo */; if (!isDupe) { newDiagnostics.push(currentDiagnostic); previousDiagnostic = currentDiagnostic; @@ -2119,12 +418,12 @@ var ts; return normalizedPathComponents(path, rootLength); } ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedPathFromPathCompoments(pathComponents) { + function getNormalizedPathFromPathComponents(pathComponents) { if (pathComponents && pathComponents.length) { return pathComponents[0] + pathComponents.slice(1).join(ts.directorySeparator); } } - ts.getNormalizedPathFromPathCompoments = getNormalizedPathFromPathCompoments; + ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; function getNormalizedPathComponentsOfUrl(url) { var urlLength = url.length; var rootLength = url.indexOf("://") + "://".length; @@ -2156,14 +455,14 @@ var ts; return getNormalizedPathComponents(pathOrUrl, currentDirectory); } } - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, isAbsolutePathAnUrl) { + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { directoryComponents.length--; } for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { - if (directoryComponents[joinStartIndex] !== pathComponents[joinStartIndex]) { + if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } } @@ -2177,7 +476,7 @@ var ts; } return relativePath + relativePathComponents.join(ts.directorySeparator); } - var absolutePath = getNormalizedPathFromPathCompoments(pathComponents); + var absolutePath = getNormalizedPathFromPathComponents(pathComponents); if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { absolutePath = "file:///" + absolutePath; } @@ -2207,6 +506,37 @@ var ts; return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; } ts.fileExtensionIs = fileExtensionIs; + var supportedExtensions = [".d.ts", ".ts", ".js"]; + function removeFileExtension(path) { + for (var i = 0; i < supportedExtensions.length; i++) { + var ext = supportedExtensions[i]; + if (fileExtensionIs(path, ext)) { + return path.substr(0, path.length - ext.length); + } + } + return path; + } + ts.removeFileExtension = removeFileExtension; + var escapedCharsRegExp = /[\t\v\f\b\0\r\n\"\\\u2028\u2029\u0085]/g; + var escapedCharsMap = { + "\t": "\\t", + "\v": "\\v", + "\f": "\\f", + "\b": "\\b", + "\0": "\\0", + "\r": "\\r", + "\n": "\\n", + "\"": "\\\"", + "\u2028": "\\u2028", + "\u2029": "\\u2029", + "\u0085": "\\u0085" + }; + function escapeString(s) { + return escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, function (c) { + return escapedCharsMap[c] || c; + }) : s; + } + ts.escapeString = escapeString; function Symbol(flags, name) { this.flags = flags; this.name = name; @@ -2234,13 +564,7 @@ var ts; getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } }; - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(ts.AssertionLevel || (ts.AssertionLevel = {})); - var AssertionLevel = ts.AssertionLevel; + var Debug; (function (Debug) { var currentAssertionLevel = 0 /* None */; function shouldAssert(level) { @@ -2261,8 +585,7 @@ var ts; Debug.assert(false, message); } Debug.fail = fail; - })(ts.Debug || (ts.Debug = {})); - var Debug = ts.Debug; + })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); var sys = (function () { function getWScriptSystem() { @@ -2295,7 +618,7 @@ var sys = (function () { return fileStream.ReadText(); } catch (e) { - throw e.number === -2147024809 ? new Error(ts.Diagnostics.Unsupported_file_encoding.key) : e; + throw e; } finally { fileStream.Close(); @@ -2461,7 +784,1429 @@ var sys = (function () { })(); var ts; (function (ts) { - var nodeConstructors = new Array(180 /* Count */); + ts.Diagnostics = { + Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, + Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, + _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, + A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1 /* Error */, key: "A file cannot have a reference to itself." }, + Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, + Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, + Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, + Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, + A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, + Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, + A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, + An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, + An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, + An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, + An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, + An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, + An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, + An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, + A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, + A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, + Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, + _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, + _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, + _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, + An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, + super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, + Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, + Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, + A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, + Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, + _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, + A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, + A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, + A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, + A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, + A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, + A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, + A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, + Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, + An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, + Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, + Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, + A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, + Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, + _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, + An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, + A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, + An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, + _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, + Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, + Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, + Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, + with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, + Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, + A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, + Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, + Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, + A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, + A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, + Duplicate_label_0: { code: 1114, category: 1 /* Error */, key: "Duplicate label '{0}'" }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1 /* Error */, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1 /* Error */, key: "A 'break' statement can only jump to a label of an enclosing statement." }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1 /* Error */, key: "An object literal cannot have multiple properties with the same name in strict mode." }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1 /* Error */, key: "An object literal cannot have multiple get/set accessors with the same name." }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, + An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, + Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, + A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1 /* Error */, key: "A tuple type element list cannot be empty." }, + Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, + Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, + Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, + Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, + Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, + case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, + Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, + Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, + Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, + Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, + Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, + String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, + Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, + catch_or_finally_expected: { code: 1143, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, + Block_or_expected: { code: 1144, category: 1 /* Error */, key: "Block or ';' expected." }, + Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, + Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, + var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, + Invalid_template_literal_expected: { code: 1158, category: 1 /* Error */, key: "Invalid template literal; expected '}'" }, + Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: 1 /* Error */, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, + Unterminated_template_literal: { code: 1160, category: 1 /* Error */, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1161, category: 1 /* Error */, key: "Unterminated regular expression literal." }, + An_object_member_cannot_be_declared_optional: { code: 1162, category: 1 /* Error */, key: "An object member cannot be declared optional." }, + Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, + Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, + Circular_definition_of_import_alias_0: { code: 2303, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, + Cannot_find_name_0: { code: 2304, category: 1 /* Error */, key: "Cannot find name '{0}'." }, + Module_0_has_no_exported_member_1: { code: 2305, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, + File_0_is_not_an_external_module: { code: 2306, category: 1 /* Error */, key: "File '{0}' is not an external module." }, + Cannot_find_external_module_0: { code: 2307, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, + A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, + Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, + A_class_may_only_extend_another_class: { code: 2311, category: 1 /* Error */, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 2315, category: 1 /* Error */, key: "Type '{0}' is not generic." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, + Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, + Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, + Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, + Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1 /* Error */, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, + Types_of_property_0_are_incompatible: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible." }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1 /* Error */, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, + Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible." }, + Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, + Index_signatures_are_incompatible: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible." }, + this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, + this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, + this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, + super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is private and only accessible within class '{1}'." }, + An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, + A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + Duplicate_string_index_signature: { code: 2374, category: 1 /* Error */, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2375, category: 1 /* Error */, key: "Duplicate number index signature." }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, + get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public, private or protected." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, + Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, + Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, + Function_implementation_name_must_be_0: { code: 2389, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, + Constructor_implementation_is_missing: { code: 2390, category: 1 /* Error */, key: "Constructor implementation is missing." }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, + Duplicate_function_implementation: { code: 2393, category: 1 /* Error */, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, + Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, + Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + Setters_cannot_return_a_value: { code: 2408, category: 1 /* Error */, key: "Setters cannot return a value." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, + Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, + A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1 /* Error */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, + Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, + Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, + A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, + A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, + Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, + Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1 /* Error */, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, + Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1 /* Error */, key: "Types have separate declarations of a private property '{0}'." }, + Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1 /* Error */, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, + Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1 /* Error */, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1 /* Error */, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1 /* Error */, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1 /* Error */, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1 /* Error */, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1 /* Error */, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1 /* Error */, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: 1 /* Error */, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: 1 /* Error */, key: "Type alias name cannot be '{0}'" }, + An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1 /* Error */, key: "An AMD module cannot have multiple name assignments." }, + Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1 /* Error */, key: "Exported variable '{0}' has or is using private name '{1}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using private name '{0}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1 /* Error */, key: "Return type of public method from exported class has or is using private name '{0}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1 /* Error */, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1 /* Error */, key: "Return type of method from exported interface has or is using private name '{0}'." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1 /* Error */, key: "Return type of exported function has or is using private name '{0}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: 1 /* Error */, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: 1 /* Error */, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 4084, category: 1 /* Error */, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + Index_expression_arguments_in_const_enums_must_be_of_type_string: { code: 4085, category: 1 /* Error */, key: "Index expression arguments in 'const' enums must be of type 'string'." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 4086, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 4087, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, + The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, + Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, + Unsupported_file_encoding: { code: 5013, category: 1 /* Error */, key: "Unsupported file encoding." }, + Unknown_compiler_option_0: { code: 5023, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, + Could_not_write_file_0_Colon_1: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}': {1}" }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, + Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2 /* Message */, key: "Concatenate and emit output to single file." }, + Generates_corresponding_d_ts_file: { code: 6002, category: 2 /* Message */, key: "Generates corresponding '.d.ts' file." }, + Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2 /* Message */, key: "Specifies the location where debugger should locate map files instead of generated locations." }, + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, + Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, + Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2 /* Message */, key: "Do not erase const enum declarations in generated code." }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2 /* Message */, key: "Do not emit outputs if any type checking errors were reported." }, + Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, + Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, + Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, + Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, + Syntax_Colon_0: { code: 6023, category: 2 /* Message */, key: "Syntax: {0}" }, + options: { code: 6024, category: 2 /* Message */, key: "options" }, + file: { code: 6025, category: 2 /* Message */, key: "file" }, + Examples_Colon_0: { code: 6026, category: 2 /* Message */, key: "Examples: {0}" }, + Options_Colon: { code: 6027, category: 2 /* Message */, key: "Options:" }, + Version_0: { code: 6029, category: 2 /* Message */, key: "Version {0}" }, + Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2 /* Message */, key: "Insert command line options and files from a file." }, + File_change_detected_Compiling: { code: 6032, category: 2 /* Message */, key: "File change detected. Compiling..." }, + KIND: { code: 6034, category: 2 /* Message */, key: "KIND" }, + FILE: { code: 6035, category: 2 /* Message */, key: "FILE" }, + VERSION: { code: 6036, category: 2 /* Message */, key: "VERSION" }, + LOCATION: { code: 6037, category: 2 /* Message */, key: "LOCATION" }, + DIRECTORY: { code: 6038, category: 2 /* Message */, key: "DIRECTORY" }, + Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2 /* Message */, key: "Compilation complete. Watching for file changes." }, + Generates_corresponding_map_file: { code: 6043, category: 2 /* Message */, key: "Generates corresponding '.map' file." }, + Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, + Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, + Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, + Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, + Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, + Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, + Corrupted_locale_file_0: { code: 6051, category: 1 /* Error */, key: "Corrupted locale file {0}." }, + Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, + File_0_not_found: { code: 6053, category: 1 /* Error */, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, + Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, + Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, + Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1 /* Error */, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, + Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, + Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, + Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, + _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, + _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: 1 /* Error */, key: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, + Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: 1 /* Error */, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, + You_cannot_rename_this_element: { code: 8000, category: 1 /* Error */, key: "You cannot rename this element." } + }; +})(ts || (ts = {})); +var ts; +(function (ts) { + var textToToken = { + "any": 109 /* AnyKeyword */, + "boolean": 110 /* BooleanKeyword */, + "break": 64 /* BreakKeyword */, + "case": 65 /* CaseKeyword */, + "catch": 66 /* CatchKeyword */, + "class": 67 /* ClassKeyword */, + "continue": 69 /* ContinueKeyword */, + "const": 68 /* ConstKeyword */, + "constructor": 111 /* ConstructorKeyword */, + "debugger": 70 /* DebuggerKeyword */, + "declare": 112 /* DeclareKeyword */, + "default": 71 /* DefaultKeyword */, + "delete": 72 /* DeleteKeyword */, + "do": 73 /* DoKeyword */, + "else": 74 /* ElseKeyword */, + "enum": 75 /* EnumKeyword */, + "export": 76 /* ExportKeyword */, + "extends": 77 /* ExtendsKeyword */, + "false": 78 /* FalseKeyword */, + "finally": 79 /* FinallyKeyword */, + "for": 80 /* ForKeyword */, + "function": 81 /* FunctionKeyword */, + "get": 113 /* GetKeyword */, + "if": 82 /* IfKeyword */, + "implements": 100 /* ImplementsKeyword */, + "import": 83 /* ImportKeyword */, + "in": 84 /* InKeyword */, + "instanceof": 85 /* InstanceOfKeyword */, + "interface": 101 /* InterfaceKeyword */, + "let": 102 /* LetKeyword */, + "module": 114 /* ModuleKeyword */, + "new": 86 /* NewKeyword */, + "null": 87 /* NullKeyword */, + "number": 116 /* NumberKeyword */, + "package": 103 /* PackageKeyword */, + "private": 104 /* PrivateKeyword */, + "protected": 105 /* ProtectedKeyword */, + "public": 106 /* PublicKeyword */, + "require": 115 /* RequireKeyword */, + "return": 88 /* ReturnKeyword */, + "set": 117 /* SetKeyword */, + "static": 107 /* StaticKeyword */, + "string": 118 /* StringKeyword */, + "super": 89 /* SuperKeyword */, + "switch": 90 /* SwitchKeyword */, + "this": 91 /* ThisKeyword */, + "throw": 92 /* ThrowKeyword */, + "true": 93 /* TrueKeyword */, + "try": 94 /* TryKeyword */, + "type": 119 /* TypeKeyword */, + "typeof": 95 /* TypeOfKeyword */, + "var": 96 /* VarKeyword */, + "void": 97 /* VoidKeyword */, + "while": 98 /* WhileKeyword */, + "with": 99 /* WithKeyword */, + "yield": 108 /* YieldKeyword */, + "{": 13 /* OpenBraceToken */, + "}": 14 /* CloseBraceToken */, + "(": 15 /* OpenParenToken */, + ")": 16 /* CloseParenToken */, + "[": 17 /* OpenBracketToken */, + "]": 18 /* CloseBracketToken */, + ".": 19 /* DotToken */, + "...": 20 /* DotDotDotToken */, + ";": 21 /* SemicolonToken */, + ",": 22 /* CommaToken */, + "<": 23 /* LessThanToken */, + ">": 24 /* GreaterThanToken */, + "<=": 25 /* LessThanEqualsToken */, + ">=": 26 /* GreaterThanEqualsToken */, + "==": 27 /* EqualsEqualsToken */, + "!=": 28 /* ExclamationEqualsToken */, + "===": 29 /* EqualsEqualsEqualsToken */, + "!==": 30 /* ExclamationEqualsEqualsToken */, + "=>": 31 /* EqualsGreaterThanToken */, + "+": 32 /* PlusToken */, + "-": 33 /* MinusToken */, + "*": 34 /* AsteriskToken */, + "/": 35 /* SlashToken */, + "%": 36 /* PercentToken */, + "++": 37 /* PlusPlusToken */, + "--": 38 /* MinusMinusToken */, + "<<": 39 /* LessThanLessThanToken */, + ">>": 40 /* GreaterThanGreaterThanToken */, + ">>>": 41 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 42 /* AmpersandToken */, + "|": 43 /* BarToken */, + "^": 44 /* CaretToken */, + "!": 45 /* ExclamationToken */, + "~": 46 /* TildeToken */, + "&&": 47 /* AmpersandAmpersandToken */, + "||": 48 /* BarBarToken */, + "?": 49 /* QuestionToken */, + ":": 50 /* ColonToken */, + "=": 51 /* EqualsToken */, + "+=": 52 /* PlusEqualsToken */, + "-=": 53 /* MinusEqualsToken */, + "*=": 54 /* AsteriskEqualsToken */, + "/=": 55 /* SlashEqualsToken */, + "%=": 56 /* PercentEqualsToken */, + "<<=": 57 /* LessThanLessThanEqualsToken */, + ">>=": 58 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 60 /* AmpersandEqualsToken */, + "|=": 61 /* BarEqualsToken */, + "^=": 62 /* CaretEqualsToken */ + }; + var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + function lookupInUnicodeMap(code, map) { + if (code < map[0]) { + return false; + } + var lo = 0; + var hi = map.length; + var mid; + while (lo + 1 < hi) { + mid = lo + (hi - lo) / 2; + mid -= mid % 2; + if (map[mid] <= code && code <= map[mid + 1]) { + return true; + } + if (code < map[mid]) { + hi = mid; + } + else { + lo = mid + 2; + } + } + return false; + } + function isUnicodeIdentifierStart(code, languageVersion) { + return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); + } + function isUnicodeIdentifierPart(code, languageVersion) { + return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); + } + function makeReverseMap(source) { + var result = []; + for (var name in source) { + if (source.hasOwnProperty(name)) { + result[source[name]] = name; + } + } + return result; + } + var tokenStrings = makeReverseMap(textToToken); + function tokenToString(t) { + return tokenStrings[t]; + } + ts.tokenToString = tokenToString; + function computeLineStarts(text) { + var result = new Array(); + var pos = 0; + var lineStart = 0; + while (pos < text.length) { + var ch = text.charCodeAt(pos++); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + result.push(lineStart); + lineStart = pos; + break; + default: + if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { + result.push(lineStart); + lineStart = pos; + } + break; + } + } + result.push(lineStart); + return result; + } + ts.computeLineStarts = computeLineStarts; + function getPositionFromLineAndCharacter(lineStarts, line, character) { + ts.Debug.assert(line > 0); + return lineStarts[line - 1] + character - 1; + } + ts.getPositionFromLineAndCharacter = getPositionFromLineAndCharacter; + function getLineAndCharacterOfPosition(lineStarts, position) { + var lineNumber = ts.binarySearch(lineStarts, position); + if (lineNumber < 0) { + lineNumber = (~lineNumber) - 1; + } + return { + line: lineNumber + 1, + character: position - lineStarts[lineNumber] + 1 + }; + } + ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; + function positionToLineAndCharacter(text, pos) { + var lineStarts = computeLineStarts(text); + return getLineAndCharacterOfPosition(lineStarts, pos); + } + ts.positionToLineAndCharacter = positionToLineAndCharacter; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function isWhiteSpace(ch) { + return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; + } + ts.isWhiteSpace = isWhiteSpace; + function isLineBreak(ch) { + return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */ || ch === 133 /* nextLine */; + } + ts.isLineBreak = isLineBreak; + function isDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; + } + function isOctalDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; + } + ts.isOctalDigit = isOctalDigit; + function skipTrivia(text, pos, stopAfterLineBreak) { + while (true) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) + pos++; + case 10 /* lineFeed */: + pos++; + if (stopAfterLineBreak) + return pos; + continue; + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + pos++; + continue; + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < text.length) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + continue; + } + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + break; + } + pos++; + } + continue; + } + break; + default: + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { + pos++; + continue; + } + break; + } + return pos; + } + } + ts.skipTrivia = skipTrivia; + function getCommentRanges(text, pos, trailing) { + var result; + var collecting = trailing || pos === 0; + while (true) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) + pos++; + case 10 /* lineFeed */: + pos++; + if (trailing) { + return result; + } + collecting = true; + if (result && result.length) { + result[result.length - 1].hasTrailingNewLine = true; + } + continue; + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + pos++; + continue; + case 47 /* slash */: + var nextChar = text.charCodeAt(pos + 1); + var hasTrailingNewLine = false; + if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { + var startPos = pos; + pos += 2; + if (nextChar === 47 /* slash */) { + while (pos < text.length) { + if (isLineBreak(text.charCodeAt(pos))) { + hasTrailingNewLine = true; + break; + } + pos++; + } + } + else { + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + break; + } + pos++; + } + } + if (collecting) { + if (!result) + result = []; + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + } + continue; + } + break; + default: + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { + if (result && result.length && isLineBreak(ch)) { + result[result.length - 1].hasTrailingNewLine = true; + } + pos++; + continue; + } + break; + } + return result; + } + } + function getLeadingCommentRanges(text, pos) { + return getCommentRanges(text, pos, false); + } + ts.getLeadingCommentRanges = getLeadingCommentRanges; + function getTrailingCommentRanges(text, pos) { + return getCommentRanges(text, pos, true); + } + ts.getTrailingCommentRanges = getTrailingCommentRanges; + function isIdentifierStart(ch, languageVersion) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); + } + ts.isIdentifierStart = isIdentifierStart; + function isIdentifierPart(ch, languageVersion) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); + } + ts.isIdentifierPart = isIdentifierPart; + function createScanner(languageVersion, skipTrivia, text, onError, onComment) { + var pos; + var len; + var startPos; + var tokenPos; + var token; + var tokenValue; + var precedingLineBreak; + function error(message) { + if (onError) { + onError(message); + } + } + function isIdentifierStart(ch) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); + } + function isIdentifierPart(ch) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); + } + function scanNumber() { + var start = pos; + while (isDigit(text.charCodeAt(pos))) + pos++; + if (text.charCodeAt(pos) === 46 /* dot */) { + pos++; + while (isDigit(text.charCodeAt(pos))) + pos++; + } + var end = pos; + if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { + pos++; + if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) + pos++; + if (isDigit(text.charCodeAt(pos))) { + pos++; + while (isDigit(text.charCodeAt(pos))) + pos++; + end = pos; + } + else { + error(ts.Diagnostics.Digit_expected); + } + } + return +(text.substring(start, end)); + } + function scanOctalDigits() { + var start = pos; + while (isOctalDigit(text.charCodeAt(pos))) { + pos++; + } + return +(text.substring(start, pos)); + } + function scanHexDigits(count, mustMatchCount) { + var digits = 0; + var value = 0; + while (digits < count || !mustMatchCount) { + var ch = text.charCodeAt(pos); + if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { + value = value * 16 + ch - 48 /* _0 */; + } + else if (ch >= 65 /* A */ && ch <= 70 /* F */) { + value = value * 16 + ch - 65 /* A */ + 10; + } + else if (ch >= 97 /* a */ && ch <= 102 /* f */) { + value = value * 16 + ch - 97 /* a */ + 10; + } + else { + break; + } + pos++; + digits++; + } + if (digits < count) { + value = -1; + } + return value; + } + function scanString() { + var quote = text.charCodeAt(pos++); + var result = ""; + var start = pos; + while (true) { + if (pos >= len) { + result += text.substring(start, pos); + error(ts.Diagnostics.Unterminated_string_literal); + break; + } + var ch = text.charCodeAt(pos); + if (ch === quote) { + result += text.substring(start, pos); + pos++; + break; + } + if (ch === 92 /* backslash */) { + result += text.substring(start, pos); + result += scanEscapeSequence(); + start = pos; + continue; + } + if (isLineBreak(ch)) { + result += text.substring(start, pos); + error(ts.Diagnostics.Unterminated_string_literal); + break; + } + pos++; + } + return result; + } + function scanTemplateAndSetTokenValue() { + var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; + pos++; + var start = pos; + var contents = ""; + var resultingToken; + while (true) { + if (pos >= len) { + contents += text.substring(start, pos); + error(ts.Diagnostics.Unterminated_template_literal); + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + var currChar = text.charCodeAt(pos); + if (currChar === 96 /* backtick */) { + contents += text.substring(start, pos); + pos++; + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + if (currChar === 36 /* $ */ && pos + 1 < len && text.charCodeAt(pos + 1) === 123 /* openBrace */) { + contents += text.substring(start, pos); + pos += 2; + resultingToken = startedWithBacktick ? 10 /* TemplateHead */ : 11 /* TemplateMiddle */; + break; + } + if (currChar === 92 /* backslash */) { + contents += text.substring(start, pos); + contents += scanEscapeSequence(); + start = pos; + continue; + } + if (currChar === 13 /* carriageReturn */) { + contents += text.substring(start, pos); + if (pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + pos++; + } + pos++; + contents += "\n"; + start = pos; + continue; + } + pos++; + } + ts.Debug.assert(resultingToken !== undefined); + tokenValue = contents; + return resultingToken; + } + function scanEscapeSequence() { + pos++; + if (pos >= len) { + error(ts.Diagnostics.Unexpected_end_of_text); + return ""; + } + var ch = text.charCodeAt(pos++); + switch (ch) { + case 48 /* _0 */: + return "\0"; + case 98 /* b */: + return "\b"; + case 116 /* t */: + return "\t"; + case 110 /* n */: + return "\n"; + case 118 /* v */: + return "\v"; + case 102 /* f */: + return "\f"; + case 114 /* r */: + return "\r"; + case 39 /* singleQuote */: + return "\'"; + case 34 /* doubleQuote */: + return "\""; + case 120 /* x */: + case 117 /* u */: + var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); + if (ch >= 0) { + return String.fromCharCode(ch); + } + else { + error(ts.Diagnostics.Hexadecimal_digit_expected); + return ""; + } + case 13 /* carriageReturn */: + if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + case 8232 /* lineSeparator */: + case 8233 /* paragraphSeparator */: + return ""; + default: + return String.fromCharCode(ch); + } + } + function peekUnicodeEscape() { + if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { + var start = pos; + pos += 2; + var value = scanHexDigits(4, true); + pos = start; + return value; + } + return -1; + } + function scanIdentifierParts() { + var result = ""; + var start = pos; + while (pos < len) { + var ch = text.charCodeAt(pos); + if (isIdentifierPart(ch)) { + pos++; + } + else if (ch === 92 /* backslash */) { + ch = peekUnicodeEscape(); + if (!(ch >= 0 && isIdentifierPart(ch))) { + break; + } + result += text.substring(start, pos); + result += String.fromCharCode(ch); + pos += 6; + start = pos; + } + else { + break; + } + } + result += text.substring(start, pos); + return result; + } + function getIdentifierToken() { + var len = tokenValue.length; + if (len >= 2 && len <= 11) { + var ch = tokenValue.charCodeAt(0); + if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { + return token = textToToken[tokenValue]; + } + } + return token = 63 /* Identifier */; + } + function scan() { + startPos = pos; + precedingLineBreak = false; + while (true) { + tokenPos = pos; + if (pos >= len) { + return token = 1 /* EndOfFileToken */; + } + var ch = text.charCodeAt(pos); + switch (ch) { + case 10 /* lineFeed */: + case 13 /* carriageReturn */: + precedingLineBreak = true; + if (skipTrivia) { + pos++; + continue; + } + else { + if (ch === 13 /* carriageReturn */ && pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + pos += 2; + } + else { + pos++; + } + return token = 4 /* NewLineTrivia */; + } + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + if (skipTrivia) { + pos++; + continue; + } + else { + while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { + pos++; + } + return token = 5 /* WhitespaceTrivia */; + } + case 33 /* exclamation */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 30 /* ExclamationEqualsEqualsToken */; + } + return pos += 2, token = 28 /* ExclamationEqualsToken */; + } + return pos++, token = 45 /* ExclamationToken */; + case 34 /* doubleQuote */: + case 39 /* singleQuote */: + tokenValue = scanString(); + return token = 7 /* StringLiteral */; + case 96 /* backtick */: + return token = scanTemplateAndSetTokenValue(); + case 37 /* percent */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 56 /* PercentEqualsToken */; + } + return pos++, token = 36 /* PercentToken */; + case 38 /* ampersand */: + if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { + return pos += 2, token = 47 /* AmpersandAmpersandToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 60 /* AmpersandEqualsToken */; + } + return pos++, token = 42 /* AmpersandToken */; + case 40 /* openParen */: + return pos++, token = 15 /* OpenParenToken */; + case 41 /* closeParen */: + return pos++, token = 16 /* CloseParenToken */; + case 42 /* asterisk */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 54 /* AsteriskEqualsToken */; + } + return pos++, token = 34 /* AsteriskToken */; + case 43 /* plus */: + if (text.charCodeAt(pos + 1) === 43 /* plus */) { + return pos += 2, token = 37 /* PlusPlusToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 52 /* PlusEqualsToken */; + } + return pos++, token = 32 /* PlusToken */; + case 44 /* comma */: + return pos++, token = 22 /* CommaToken */; + case 45 /* minus */: + if (text.charCodeAt(pos + 1) === 45 /* minus */) { + return pos += 2, token = 38 /* MinusMinusToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 53 /* MinusEqualsToken */; + } + return pos++, token = 33 /* MinusToken */; + case 46 /* dot */: + if (isDigit(text.charCodeAt(pos + 1))) { + tokenValue = "" + scanNumber(); + return token = 6 /* NumericLiteral */; + } + if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { + return pos += 3, token = 20 /* DotDotDotToken */; + } + return pos++, token = 19 /* DotToken */; + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < len) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + if (onComment) { + onComment(tokenPos, pos); + } + if (skipTrivia) { + continue; + } + else { + return token = 2 /* SingleLineCommentTrivia */; + } + } + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + var commentClosed = false; + while (pos < len) { + var ch = text.charCodeAt(pos); + if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + commentClosed = true; + break; + } + if (isLineBreak(ch)) { + precedingLineBreak = true; + } + pos++; + } + if (!commentClosed) { + error(ts.Diagnostics.Asterisk_Slash_expected); + } + if (onComment) { + onComment(tokenPos, pos); + } + if (skipTrivia) { + continue; + } + else { + return token = 3 /* MultiLineCommentTrivia */; + } + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 55 /* SlashEqualsToken */; + } + return pos++, token = 35 /* SlashToken */; + case 48 /* _0 */: + if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { + pos += 2; + var value = scanHexDigits(1, false); + if (value < 0) { + error(ts.Diagnostics.Hexadecimal_digit_expected); + value = 0; + } + tokenValue = "" + value; + return token = 6 /* NumericLiteral */; + } + if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { + tokenValue = "" + scanOctalDigits(); + return token = 6 /* NumericLiteral */; + } + case 49 /* _1 */: + case 50 /* _2 */: + case 51 /* _3 */: + case 52 /* _4 */: + case 53 /* _5 */: + case 54 /* _6 */: + case 55 /* _7 */: + case 56 /* _8 */: + case 57 /* _9 */: + tokenValue = "" + scanNumber(); + return token = 6 /* NumericLiteral */; + case 58 /* colon */: + return pos++, token = 50 /* ColonToken */; + case 59 /* semicolon */: + return pos++, token = 21 /* SemicolonToken */; + case 60 /* lessThan */: + if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 57 /* LessThanLessThanEqualsToken */; + } + return pos += 2, token = 39 /* LessThanLessThanToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 25 /* LessThanEqualsToken */; + } + return pos++, token = 23 /* LessThanToken */; + case 61 /* equals */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 29 /* EqualsEqualsEqualsToken */; + } + return pos += 2, token = 27 /* EqualsEqualsToken */; + } + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + return pos += 2, token = 31 /* EqualsGreaterThanToken */; + } + return pos++, token = 51 /* EqualsToken */; + case 62 /* greaterThan */: + return pos++, token = 24 /* GreaterThanToken */; + case 63 /* question */: + return pos++, token = 49 /* QuestionToken */; + case 91 /* openBracket */: + return pos++, token = 17 /* OpenBracketToken */; + case 93 /* closeBracket */: + return pos++, token = 18 /* CloseBracketToken */; + case 94 /* caret */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 62 /* CaretEqualsToken */; + } + return pos++, token = 44 /* CaretToken */; + case 123 /* openBrace */: + return pos++, token = 13 /* OpenBraceToken */; + case 124 /* bar */: + if (text.charCodeAt(pos + 1) === 124 /* bar */) { + return pos += 2, token = 48 /* BarBarToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 61 /* BarEqualsToken */; + } + return pos++, token = 43 /* BarToken */; + case 125 /* closeBrace */: + return pos++, token = 14 /* CloseBraceToken */; + case 126 /* tilde */: + return pos++, token = 46 /* TildeToken */; + case 92 /* backslash */: + var ch = peekUnicodeEscape(); + if (ch >= 0 && isIdentifierStart(ch)) { + pos += 6; + tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); + return token = getIdentifierToken(); + } + error(ts.Diagnostics.Invalid_character); + return pos++, token = 0 /* Unknown */; + default: + if (isIdentifierStart(ch)) { + pos++; + while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) + pos++; + tokenValue = text.substring(tokenPos, pos); + if (ch === 92 /* backslash */) { + tokenValue += scanIdentifierParts(); + } + return token = getIdentifierToken(); + } + else if (isWhiteSpace(ch)) { + pos++; + continue; + } + else if (isLineBreak(ch)) { + precedingLineBreak = true; + pos++; + continue; + } + error(ts.Diagnostics.Invalid_character); + return pos++, token = 0 /* Unknown */; + } + } + } + function reScanGreaterToken() { + if (token === 24 /* GreaterThanToken */) { + if (text.charCodeAt(pos) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + } + return pos += 2, token = 41 /* GreaterThanGreaterThanGreaterThanToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 58 /* GreaterThanGreaterThanEqualsToken */; + } + return pos++, token = 40 /* GreaterThanGreaterThanToken */; + } + if (text.charCodeAt(pos) === 61 /* equals */) { + return pos++, token = 26 /* GreaterThanEqualsToken */; + } + } + return token; + } + function reScanSlashToken() { + if (token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) { + var p = tokenPos + 1; + var inEscape = false; + var inCharacterClass = false; + while (true) { + if (p >= len) { + error(ts.Diagnostics.Unterminated_regular_expression_literal); + break; + } + var ch = text.charCodeAt(p); + if (isLineBreak(ch)) { + error(ts.Diagnostics.Unterminated_regular_expression_literal); + break; + } + if (inEscape) { + inEscape = false; + } + else if (ch === 47 /* slash */ && !inCharacterClass) { + p++; + break; + } + else if (ch === 91 /* openBracket */) { + inCharacterClass = true; + } + else if (ch === 92 /* backslash */) { + inEscape = true; + } + else if (ch === 93 /* closeBracket */) { + inCharacterClass = false; + } + p++; + } + while (p < len && isIdentifierPart(text.charCodeAt(p))) { + p++; + } + pos = p; + tokenValue = text.substring(tokenPos, pos); + token = 8 /* RegularExpressionLiteral */; + } + return token; + } + function reScanTemplateToken() { + ts.Debug.assert(token === 14 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); + pos = tokenPos; + return token = scanTemplateAndSetTokenValue(); + } + function tryScan(callback) { + var savePos = pos; + var saveStartPos = startPos; + var saveTokenPos = tokenPos; + var saveToken = token; + var saveTokenValue = tokenValue; + var savePrecedingLineBreak = precedingLineBreak; + var result = callback(); + if (!result) { + pos = savePos; + startPos = saveStartPos; + tokenPos = saveTokenPos; + token = saveToken; + tokenValue = saveTokenValue; + precedingLineBreak = savePrecedingLineBreak; + } + return result; + } + function setText(newText) { + text = newText || ""; + len = text.length; + setTextPos(0); + } + function setTextPos(textPos) { + pos = textPos; + startPos = textPos; + tokenPos = textPos; + token = 0 /* Unknown */; + precedingLineBreak = false; + } + setText(text); + return { + getStartPos: function () { return startPos; }, + getTextPos: function () { return pos; }, + getToken: function () { return token; }, + getTokenPos: function () { return tokenPos; }, + getTokenText: function () { return text.substring(tokenPos, pos); }, + getTokenValue: function () { return tokenValue; }, + hasPrecedingLineBreak: function () { return precedingLineBreak; }, + isIdentifier: function () { return token === 63 /* Identifier */ || token > 99 /* LastReservedWord */; }, + isReservedWord: function () { return token >= 64 /* FirstReservedWord */ && token <= 99 /* LastReservedWord */; }, + reScanGreaterToken: reScanGreaterToken, + reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, + scan: scan, + setText: setText, + setTextPos: setTextPos, + tryScan: tryScan + }; + } + ts.createScanner = createScanner; +})(ts || (ts = {})); +var ts; +(function (ts) { + var nodeConstructors = new Array(199 /* Count */); function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -2473,19 +2218,8 @@ var ts; node.flags = flags; return node; } - var moduleExtensions = [".d.ts", ".ts", ".js"]; - function getModuleNameFromFilename(filename) { - for (var i = 0; i < moduleExtensions.length; i++) { - var ext = moduleExtensions[i]; - var len = filename.length - ext.length; - if (len > 0 && filename.substr(len) === ext) - return filename.substr(0, len); - } - return filename; - } - ts.getModuleNameFromFilename = getModuleNameFromFilename; function getSourceFileOfNode(node) { - while (node && node.kind !== 177 /* SourceFile */) + while (node && node.kind !== 196 /* SourceFile */) node = node.parent; return node; } @@ -2500,19 +2234,22 @@ var ts; return node.pos; } ts.getStartPosOfNode = getStartPosOfNode; - function getTokenPosOfNode(node) { - return ts.skipTrivia(getSourceFileOfNode(node).text, node.pos); + function getTokenPosOfNode(node, sourceFile) { + if (node.pos === node.end) { + return node.pos; + } + return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; - function getSourceTextOfNodeFromSourceText(sourceText, node) { + function getTextOfNodeFromSourceText(sourceText, node) { return sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); } - ts.getSourceTextOfNodeFromSourceText = getSourceTextOfNodeFromSourceText; - function getSourceTextOfNode(node) { + ts.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText; + function getTextOfNode(node) { var text = getSourceFileOfNode(node).text; return text.substring(ts.skipTrivia(text, node.pos), node.end); } - ts.getSourceTextOfNode = getSourceTextOfNode; + ts.getTextOfNode = getTextOfNode; function escapeIdentifier(identifier) { return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; } @@ -2521,14 +2258,14 @@ var ts; return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; } ts.unescapeIdentifier = unescapeIdentifier; - function identifierToString(identifier) { - return identifier.kind === 111 /* Missing */ ? "(Missing)" : getSourceTextOfNode(identifier); + function declarationNameToString(name) { + return name.kind === 120 /* Missing */ ? "(Missing)" : getTextOfNode(name); } - ts.identifierToString = identifierToString; + ts.declarationNameToString = declarationNameToString; function createDiagnosticForNode(node, message, arg0, arg1, arg2) { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); - var start = ts.skipTrivia(file.text, node.pos); + var start = node.kind === 120 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); var length = node.end - start; return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); } @@ -2544,12 +2281,12 @@ var ts; function getErrorSpanForNode(node) { var errorSpan; switch (node.kind) { - case 166 /* VariableDeclaration */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 172 /* ModuleDeclaration */: - case 171 /* EnumDeclaration */: - case 176 /* EnumMember */: + case 184 /* VariableDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 191 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + case 195 /* EnumMember */: errorSpan = node.name; break; } @@ -2560,28 +2297,37 @@ var ts; return file.externalModuleIndicator !== undefined; } ts.isExternalModule = isExternalModule; + function isDeclarationFile(file) { + return (file.flags & 1024 /* DeclarationFile */) !== 0; + } + ts.isDeclarationFile = isDeclarationFile; + function isConstEnumDeclaration(node) { + return (node.flags & 4096 /* Const */) !== 0; + } + ts.isConstEnumDeclaration = isConstEnumDeclaration; function isPrologueDirective(node) { - return node.kind === 146 /* ExpressionStatement */ && node.expression.kind === 3 /* StringLiteral */; + return node.kind === 164 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 55 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); + return node.kind === 63 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); } function isUseStrictPrologueDirective(node) { ts.Debug.assert(isPrologueDirective(node)); return node.expression.text === "use strict"; } - function getLeadingCommentsOfNode(node, sourceFileOfNode) { - if (node.kind === 114 /* Parameter */ || node.kind === 113 /* TypeParameter */) { - return ts.concatenate(ts.getTrailingComments(sourceFileOfNode.text, node.pos), ts.getLeadingComments(sourceFileOfNode.text, node.pos)); + function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { + sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); + if (node.kind === 123 /* Parameter */ || node.kind === 122 /* TypeParameter */) { + return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { - return ts.getLeadingComments(sourceFileOfNode.text, node.pos); + return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); } } - ts.getLeadingCommentsOfNode = getLeadingCommentsOfNode; + ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJsDocComments(node, sourceFileOfNode) { - return ts.filter(getLeadingCommentsOfNode(node, sourceFileOfNode), function (comment) { return isJsDocComment(comment); }); + return ts.filter(getLeadingCommentRangesOfNode(node, sourceFileOfNode), function (comment) { return isJsDocComment(comment); }); function isJsDocComment(comment) { return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47 /* slash */; } @@ -2608,218 +2354,519 @@ var ts; if (!node) return; switch (node.kind) { - case 112 /* QualifiedName */: + case 121 /* QualifiedName */: return child(node.left) || child(node.right); - case 113 /* TypeParameter */: + case 122 /* TypeParameter */: return child(node.name) || child(node.constraint); - case 114 /* Parameter */: + case 123 /* Parameter */: return child(node.name) || child(node.type) || child(node.initializer); - case 115 /* Property */: - case 129 /* PropertyAssignment */: + case 124 /* Property */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: return child(node.name) || child(node.type) || child(node.initializer); - case 120 /* CallSignature */: - case 121 /* ConstructSignature */: - case 122 /* IndexSignature */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return children(node.typeParameters) || children(node.parameters) || child(node.type); - case 116 /* Method */: - case 117 /* Constructor */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 136 /* FunctionExpression */: - case 167 /* FunctionDeclaration */: - case 137 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); - case 123 /* TypeReference */: + case 132 /* TypeReference */: return child(node.typeName) || children(node.typeArguments); - case 124 /* TypeQuery */: + case 135 /* TypeQuery */: return child(node.exprName); - case 125 /* TypeLiteral */: + case 136 /* TypeLiteral */: return children(node.members); - case 126 /* ArrayType */: + case 137 /* ArrayType */: return child(node.elementType); - case 127 /* ArrayLiteral */: + case 138 /* TupleType */: + return children(node.elementTypes); + case 139 /* UnionType */: + return children(node.types); + case 140 /* ParenType */: + return child(node.type); + case 141 /* ArrayLiteral */: return children(node.elements); - case 128 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return children(node.properties); - case 130 /* PropertyAccess */: + case 145 /* PropertyAccess */: return child(node.left) || child(node.right); - case 131 /* IndexedAccess */: + case 146 /* IndexedAccess */: return child(node.object) || child(node.index); - case 132 /* CallExpression */: - case 133 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 134 /* TypeAssertion */: + case 149 /* TaggedTemplateExpression */: + return child(node.tag) || child(node.template); + case 150 /* TypeAssertion */: return child(node.type) || child(node.operand); - case 135 /* ParenExpression */: + case 151 /* ParenExpression */: return child(node.expression); - case 138 /* PrefixOperator */: - case 139 /* PostfixOperator */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: return child(node.operand); - case 140 /* BinaryExpression */: + case 156 /* BinaryExpression */: return child(node.left) || child(node.right); - case 141 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 143 /* Block */: - case 162 /* TryBlock */: - case 164 /* FinallyBlock */: - case 168 /* FunctionBlock */: - case 173 /* ModuleBlock */: - case 177 /* SourceFile */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 196 /* SourceFile */: return children(node.statements); - case 144 /* VariableStatement */: + case 162 /* VariableStatement */: return children(node.declarations); - case 146 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return child(node.expression); - case 147 /* IfStatement */: + case 165 /* IfStatement */: return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 148 /* DoStatement */: + case 166 /* DoStatement */: return child(node.statement) || child(node.expression); - case 149 /* WhileStatement */: + case 167 /* WhileStatement */: return child(node.expression) || child(node.statement); - case 150 /* ForStatement */: + case 168 /* ForStatement */: return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 151 /* ForInStatement */: - return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 152 /* ContinueStatement */: - case 153 /* BreakStatement */: + case 169 /* ForInStatement */: + return children(node.declarations) || child(node.variable) || child(node.expression) || child(node.statement); + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return child(node.label); - case 154 /* ReturnStatement */: + case 172 /* ReturnStatement */: return child(node.expression); - case 155 /* WithStatement */: + case 173 /* WithStatement */: return child(node.expression) || child(node.statement); - case 156 /* SwitchStatement */: + case 174 /* SwitchStatement */: return child(node.expression) || children(node.clauses); - case 157 /* CaseClause */: - case 158 /* DefaultClause */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: return child(node.expression) || children(node.statements); - case 159 /* LabelledStatement */: + case 177 /* LabeledStatement */: return child(node.label) || child(node.statement); - case 160 /* ThrowStatement */: + case 178 /* ThrowStatement */: return child(node.expression); - case 161 /* TryStatement */: + case 179 /* TryStatement */: return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 163 /* CatchBlock */: + case 181 /* CatchBlock */: return child(node.variable) || children(node.statements); - case 166 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return child(node.name) || child(node.type) || child(node.initializer); - case 169 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 170 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 171 /* EnumDeclaration */: + case 189 /* TypeAliasDeclaration */: + return child(node.name) || child(node.type); + case 190 /* EnumDeclaration */: return child(node.name) || children(node.members); - case 176 /* EnumMember */: + case 195 /* EnumMember */: return child(node.name) || child(node.initializer); - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return child(node.name) || child(node.body); - case 174 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 175 /* ExportAssignment */: + case 194 /* ExportAssignment */: return child(node.exportName); + case 158 /* TemplateExpression */: + return child(node.head) || children(node.templateSpans); + case 159 /* TemplateSpan */: + return child(node.expression) || child(node.literal); } } ts.forEachChild = forEachChild; + function forEachReturnStatement(body, visitor) { + return traverse(body); + function traverse(node) { + switch (node.kind) { + case 172 /* ReturnStatement */: + return visitor(node); + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + return forEachChild(node, traverse); + } + } + } + ts.forEachReturnStatement = forEachReturnStatement; + function isAnyFunction(node) { + if (node) { + switch (node.kind) { + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + return true; + } + } + return false; + } + ts.isAnyFunction = isAnyFunction; + function getContainingFunction(node) { + while (true) { + node = node.parent; + if (!node || isAnyFunction(node)) { + return node; + } + } + } + ts.getContainingFunction = getContainingFunction; + function getThisContainer(node, includeArrowFunctions) { + while (true) { + node = node.parent; + if (!node) { + return undefined; + } + switch (node.kind) { + case 153 /* ArrowFunction */: + if (!includeArrowFunctions) { + continue; + } + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 191 /* ModuleDeclaration */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 190 /* EnumDeclaration */: + case 196 /* SourceFile */: + return node; + } + } + } + ts.getThisContainer = getThisContainer; + function getSuperContainer(node) { + while (true) { + node = node.parent; + if (!node) { + return undefined; + } + switch (node.kind) { + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + return node; + } + } + } + ts.getSuperContainer = getSuperContainer; + function isExpression(node) { + switch (node.kind) { + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: + case 8 /* RegularExpressionLiteral */: + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 149 /* TaggedTemplateExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 156 /* BinaryExpression */: + case 157 /* ConditionalExpression */: + case 158 /* TemplateExpression */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 160 /* OmittedExpression */: + return true; + case 121 /* QualifiedName */: + while (node.parent.kind === 121 /* QualifiedName */) + node = node.parent; + return node.parent.kind === 135 /* TypeQuery */; + case 63 /* Identifier */: + if (node.parent.kind === 135 /* TypeQuery */) { + return true; + } + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + var parent = node.parent; + switch (parent.kind) { + case 184 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: + case 195 /* EnumMember */: + case 143 /* PropertyAssignment */: + return parent.initializer === node; + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 178 /* ThrowStatement */: + case 174 /* SwitchStatement */: + return parent.expression === node; + case 168 /* ForStatement */: + return parent.initializer === node || parent.condition === node || parent.iterator === node; + case 169 /* ForInStatement */: + return parent.variable === node || parent.expression === node; + case 150 /* TypeAssertion */: + return node === parent.operand; + case 159 /* TemplateSpan */: + return node === parent.expression; + default: + if (isExpression(parent)) { + return true; + } + } + } + return false; + } + ts.isExpression = isExpression; function hasRestParameters(s) { return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & 8 /* Rest */) !== 0; } ts.hasRestParameters = hasRestParameters; + function isLiteralKind(kind) { + return 6 /* FirstLiteralToken */ <= kind && kind <= 9 /* LastLiteralToken */; + } + ts.isLiteralKind = isLiteralKind; + function isTextualLiteralKind(kind) { + return kind === 7 /* StringLiteral */ || kind === 9 /* NoSubstitutionTemplateLiteral */; + } + ts.isTextualLiteralKind = isTextualLiteralKind; + function isTemplateLiteralKind(kind) { + return 9 /* FirstTemplateToken */ <= kind && kind <= 12 /* LastTemplateToken */; + } + ts.isTemplateLiteralKind = isTemplateLiteralKind; function isInAmbientContext(node) { while (node) { - if (node.flags & (2 /* Ambient */ | 512 /* DeclarationFile */)) + if (node.flags & (2 /* Ambient */ | 1024 /* DeclarationFile */)) return true; node = node.parent; } return false; } ts.isInAmbientContext = isInAmbientContext; - var ParsingContext; - (function (ParsingContext) { - ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; - ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; - ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; - ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; - ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; - ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; - ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; - ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["BaseTypeReferences"] = 8] = "BaseTypeReferences"; - ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; - ParsingContext[ParsingContext["ArgumentExpressions"] = 10] = "ArgumentExpressions"; - ParsingContext[ParsingContext["ObjectLiteralMembers"] = 11] = "ObjectLiteralMembers"; - ParsingContext[ParsingContext["ArrayLiteralMembers"] = 12] = "ArrayLiteralMembers"; - ParsingContext[ParsingContext["Parameters"] = 13] = "Parameters"; - ParsingContext[ParsingContext["TypeParameters"] = 14] = "TypeParameters"; - ParsingContext[ParsingContext["TypeArguments"] = 15] = "TypeArguments"; - ParsingContext[ParsingContext["Count"] = 16] = "Count"; - })(ParsingContext || (ParsingContext = {})); - var Tristate; - (function (Tristate) { - Tristate[Tristate["False"] = 0] = "False"; - Tristate[Tristate["True"] = 1] = "True"; - Tristate[Tristate["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); + function isDeclaration(node) { + switch (node.kind) { + case 122 /* TypeParameter */: + case 123 /* Parameter */: + case 184 /* VariableDeclaration */: + case 124 /* Property */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + case 195 /* EnumMember */: + case 125 /* Method */: + case 185 /* FunctionDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: + return true; + } + return false; + } + ts.isDeclaration = isDeclaration; + function isStatement(n) { + switch (n.kind) { + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 183 /* DebuggerStatement */: + case 166 /* DoStatement */: + case 164 /* ExpressionStatement */: + case 163 /* EmptyStatement */: + case 169 /* ForInStatement */: + case 168 /* ForStatement */: + case 165 /* IfStatement */: + case 177 /* LabeledStatement */: + case 172 /* ReturnStatement */: + case 174 /* SwitchStatement */: + case 92 /* ThrowKeyword */: + case 179 /* TryStatement */: + case 162 /* VariableStatement */: + case 167 /* WhileStatement */: + case 173 /* WithStatement */: + case 194 /* ExportAssignment */: + return true; + default: + return false; + } + } + ts.isStatement = isStatement; + function isDeclarationOrFunctionExpressionOrCatchVariableName(name) { + if (name.kind !== 63 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { + return false; + } + var parent = name.parent; + if (isDeclaration(parent) || parent.kind === 152 /* FunctionExpression */) { + return parent.name === name; + } + if (parent.kind === 181 /* CatchBlock */) { + return parent.variable === name; + } + return false; + } + ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; + function getAncestor(node, kind) { + switch (kind) { + case 187 /* ClassDeclaration */: + while (node) { + switch (node.kind) { + case 187 /* ClassDeclaration */: + return node; + case 190 /* EnumDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: + return undefined; + default: + node = node.parent; + continue; + } + } + break; + default: + while (node) { + if (node.kind === kind) { + return node; + } + node = node.parent; + } + break; + } + return undefined; + } + ts.getAncestor = getAncestor; function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 1 /* ModuleElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 2 /* BlockStatements */: - return ts.Diagnostics.Statement_expected; - case 3 /* SwitchClauses */: - return ts.Diagnostics.case_or_default_expected; - case 4 /* SwitchClauseStatements */: - return ts.Diagnostics.Statement_expected; - case 5 /* TypeMembers */: - return ts.Diagnostics.Property_or_signature_expected; - case 6 /* ClassMembers */: - return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7 /* EnumMembers */: - return ts.Diagnostics.Enum_member_expected; - case 8 /* BaseTypeReferences */: - return ts.Diagnostics.Type_reference_expected; - case 9 /* VariableDeclarations */: - return ts.Diagnostics.Variable_declaration_expected; - case 10 /* ArgumentExpressions */: - return ts.Diagnostics.Argument_expression_expected; - case 11 /* ObjectLiteralMembers */: - return ts.Diagnostics.Property_assignment_expected; - case 12 /* ArrayLiteralMembers */: - return ts.Diagnostics.Expression_or_comma_expected; - case 13 /* Parameters */: - return ts.Diagnostics.Parameter_declaration_expected; - case 14 /* TypeParameters */: - return ts.Diagnostics.Type_parameter_declaration_expected; - case 15 /* TypeArguments */: - return ts.Diagnostics.Type_argument_expected; + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* ModuleElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* BlockStatements */: return ts.Diagnostics.Statement_expected; + case 3 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 4 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; + case 5 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 6 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 7 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 8 /* BaseTypeReferences */: return ts.Diagnostics.Type_reference_expected; + case 9 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 10 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 11 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 12 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 13 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 14 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 15 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 16 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; } } ; - var LookAheadMode; - (function (LookAheadMode) { - LookAheadMode[LookAheadMode["NotLookingAhead"] = 0] = "NotLookingAhead"; - LookAheadMode[LookAheadMode["NoErrorYet"] = 1] = "NoErrorYet"; - LookAheadMode[LookAheadMode["Error"] = 2] = "Error"; - })(LookAheadMode || (LookAheadMode = {})); - var ModifierContext; - (function (ModifierContext) { - ModifierContext[ModifierContext["SourceElements"] = 0] = "SourceElements"; - ModifierContext[ModifierContext["ModuleElements"] = 1] = "ModuleElements"; - ModifierContext[ModifierContext["ClassMembers"] = 2] = "ClassMembers"; - ModifierContext[ModifierContext["Parameters"] = 3] = "Parameters"; - })(ModifierContext || (ModifierContext = {})); - var TrailingCommaBehavior; - (function (TrailingCommaBehavior) { - TrailingCommaBehavior[TrailingCommaBehavior["Disallow"] = 0] = "Disallow"; - TrailingCommaBehavior[TrailingCommaBehavior["Allow"] = 1] = "Allow"; - TrailingCommaBehavior[TrailingCommaBehavior["Preserve"] = 2] = "Preserve"; - })(TrailingCommaBehavior || (TrailingCommaBehavior = {})); - var ControlBlockContext; - (function (ControlBlockContext) { - ControlBlockContext[ControlBlockContext["NotNested"] = 0] = "NotNested"; - ControlBlockContext[ControlBlockContext["Nested"] = 1] = "Nested"; - ControlBlockContext[ControlBlockContext["CrossingFunctionBoundary"] = 2] = "CrossingFunctionBoundary"; - })(ControlBlockContext || (ControlBlockContext = {})); + function getFileReferenceFromReferencePath(comment, commentRange) { + var simpleReferenceRegEx = /^\/\/\/\s*/gim; + if (simpleReferenceRegEx.exec(comment)) { + if (isNoDefaultLibRegEx.exec(comment)) { + return { + isNoDefaultLib: true + }; + } + else { + var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); + if (matchResult) { + var start = commentRange.pos; + var end = commentRange.end; + return { + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, + isNoDefaultLib: false + }; + } + else { + return { + diagnostic: ts.Diagnostics.Invalid_reference_directive_syntax, + isNoDefaultLib: false + }; + } + } + } + return undefined; + } + ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; + function isKeyword(token) { + return 64 /* FirstKeyword */ <= token && token <= 119 /* LastKeyword */; + } + ts.isKeyword = isKeyword; + function isTrivia(token) { + return 2 /* FirstTriviaToken */ <= token && token <= 5 /* LastTriviaToken */; + } + ts.isTrivia = isTrivia; + function isUnterminatedTemplateEnd(node) { + ts.Debug.assert(node.kind === 9 /* NoSubstitutionTemplateLiteral */ || node.kind === 12 /* TemplateTail */); + var sourceText = getSourceFileOfNode(node).text; + if (node.end !== sourceText.length) { + return false; + } + return sourceText.charCodeAt(node.end - 1) !== 96 /* backtick */ || node.text.length === 0; + } + ts.isUnterminatedTemplateEnd = isUnterminatedTemplateEnd; + function isModifier(token) { + switch (token) { + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + case 76 /* ExportKeyword */: + case 112 /* DeclareKeyword */: + return true; + } + return false; + } + ts.isModifier = isModifier; + function modifierToFlag(token) { + switch (token) { + case 107 /* StaticKeyword */: return 128 /* Static */; + case 106 /* PublicKeyword */: return 16 /* Public */; + case 105 /* ProtectedKeyword */: return 64 /* Protected */; + case 104 /* PrivateKeyword */: return 32 /* Private */; + case 76 /* ExportKeyword */: return 1 /* Export */; + case 112 /* DeclareKeyword */: return 2 /* Ambient */; + } + return 0; + } function createSourceFile(filename, sourceText, languageVersion, version, isOpen) { if (isOpen === void 0) { isOpen = false; } var file; @@ -2833,118 +2880,26 @@ var ts; var lineStarts; var isInStrictMode = false; var lookAheadMode = 0 /* NotLookingAhead */; - var inAmbientContext = false; - var inFunctionBody = false; - var inSwitchStatement = 0 /* NotNested */; - var inIterationStatement = 0 /* NotNested */; - var labelledStatementInfo = (function () { - var functionBoundarySentinel; - var currentLabelSet; - var labelSetStack; - var isIterationStack; - function addLabel(label) { - if (!currentLabelSet) { - currentLabelSet = {}; - } - currentLabelSet[label.text] = true; - } - function pushCurrentLabelSet(isIterationStatement) { - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - ts.Debug.assert(currentLabelSet !== undefined); - labelSetStack.push(currentLabelSet); - isIterationStack.push(isIterationStatement); - currentLabelSet = undefined; - } - function pushFunctionBoundary() { - if (!functionBoundarySentinel) { - functionBoundarySentinel = {}; - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - } - ts.Debug.assert(currentLabelSet === undefined); - labelSetStack.push(functionBoundarySentinel); - isIterationStack.push(false); - } - function pop() { - ts.Debug.assert(labelSetStack.length && isIterationStack.length && currentLabelSet === undefined); - labelSetStack.pop(); - isIterationStack.pop(); - } - function nodeIsNestedInLabel(label, requireIterationStatement, stopAtFunctionBoundary) { - if (!requireIterationStatement && currentLabelSet && ts.hasProperty(currentLabelSet, label.text)) { - return 1 /* Nested */; - } - if (!labelSetStack) { - return 0 /* NotNested */; - } - var crossedFunctionBoundary = false; - for (var i = labelSetStack.length - 1; i >= 0; i--) { - var labelSet = labelSetStack[i]; - if (labelSet === functionBoundarySentinel) { - if (stopAtFunctionBoundary) { - break; - } - else { - crossedFunctionBoundary = true; - continue; - } - } - if (requireIterationStatement && isIterationStack[i] === false) { - continue; - } - if (ts.hasProperty(labelSet, label.text)) { - return crossedFunctionBoundary ? 2 /* CrossingFunctionBoundary */ : 1 /* Nested */; - } - } - return 0 /* NotNested */; - } - return { - addLabel: addLabel, - pushCurrentLabelSet: pushCurrentLabelSet, - pushFunctionBoundary: pushFunctionBoundary, - pop: pop, - nodeIsNestedInLabel: nodeIsNestedInLabel - }; - })(); - function getLineAndCharacterlFromSourcePosition(position) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getLineAndCharacterOfPosition(lineStarts, position); + function getLineStarts() { + return lineStarts || (lineStarts = ts.computeLineStarts(sourceText)); + } + function getLineAndCharacterFromSourcePosition(position) { + return ts.getLineAndCharacterOfPosition(getLineStarts(), position); } function getPositionFromSourceLineAndCharacter(line, character) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getPositionFromLineAndCharacter(lineStarts, line, character); + return ts.getPositionFromLineAndCharacter(getLineStarts(), line, character); } function error(message, arg0, arg1, arg2) { var start = scanner.getTokenPos(); var length = scanner.getTextPos() - start; errorAtPos(start, length, message, arg0, arg1, arg2); } - function grammarErrorOnNode(node, message, arg0, arg1, arg2) { - var span = getErrorSpanForNode(node); - var start = ts.skipTrivia(file.text, span.pos); - var length = span.end - start; - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function reportInvalidUseInStrictMode(node) { - var name = sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); - grammarErrorOnNode(node, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, name); - } - function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } function errorAtPos(start, length, message, arg0, arg1, arg2) { - var lastErrorPos = file.syntacticErrors.length ? file.syntacticErrors[file.syntacticErrors.length - 1].start : -1; + var lastErrorPos = file.parseDiagnostics.length ? file.parseDiagnostics[file.parseDiagnostics.length - 1].start : -1; if (start !== lastErrorPos) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + var diagnostic = ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); + diagnostic.isParseError = true; + file.parseDiagnostics.push(diagnostic); } if (lookAheadMode === 1 /* NoErrorYet */) { lookAheadMode = 2 /* Error */; @@ -2976,9 +2931,12 @@ var ts; function reScanSlashToken() { return token = scanner.reScanSlashToken(); } + function reScanTemplateToken() { + return token = scanner.reScanTemplateToken(); + } function lookAheadHelper(callback, alwaysResetState) { var saveToken = token; - var saveSyntacticErrorsLength = file.syntacticErrors.length; + var saveSyntacticErrorsLength = file.parseDiagnostics.length; var saveLookAheadMode = lookAheadMode; lookAheadMode = 1 /* NoErrorYet */; var result = callback(); @@ -2989,7 +2947,7 @@ var ts; lookAheadMode = saveLookAheadMode; if (!result || alwaysResetState) { token = saveToken; - file.syntacticErrors.length = saveSyntacticErrorsLength; + file.parseDiagnostics.length = saveSyntacticErrorsLength; } return result; } @@ -3005,7 +2963,7 @@ var ts; return scanner.tryScan(function () { return lookAheadHelper(callback, false); }); } function isIdentifier() { - return token === 55 /* Identifier */ || (isInStrictMode ? token > ts.SyntaxKind.LastFutureReservedWord : token > ts.SyntaxKind.LastReservedWord); + return token === 63 /* Identifier */ || (isInStrictMode ? token > 108 /* LastFutureReservedWord */ : token > 99 /* LastReservedWord */); } function parseExpected(t) { if (token === t) { @@ -3023,14 +2981,14 @@ var ts; return false; } function canParseSemicolon() { - if (token === 13 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { return true; } - return token === 6 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); + return token === 14 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); } function parseSemicolon() { if (canParseSemicolon()) { - if (token === 13 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { nextToken(); } } @@ -3041,70 +2999,65 @@ var ts; function createNode(kind, pos) { nodeCount++; var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(); - if (!(pos >= 0)) + if (!(pos >= 0)) { pos = scanner.getStartPos(); + } node.pos = pos; node.end = pos; return node; } function finishNode(node) { node.end = scanner.getStartPos(); + if (isInStrictMode) { + node.flags |= 8192 /* ParsedInStrictMode */; + } return node; } - function createMissingNode() { - return createNode(111 /* Missing */); + function createMissingNode(pos) { + return createNode(120 /* Missing */, pos); + } + function internIdentifier(text) { + text = escapeIdentifier(text); + return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); } function createIdentifier(isIdentifier) { identifierCount++; if (isIdentifier) { - var node = createNode(55 /* Identifier */); - var text = escapeIdentifier(scanner.getTokenValue()); - node.text = ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); + var node = createNode(63 /* Identifier */); + node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } error(ts.Diagnostics.Identifier_expected); - return createMissingNode(); + var node = createMissingNode(); + node.text = ""; + return node; } function parseIdentifier() { return createIdentifier(isIdentifier()); } function parseIdentifierName() { - return createIdentifier(token >= 55 /* Identifier */); + return createIdentifier(token >= 63 /* Identifier */); } function isPropertyName() { - return token >= 55 /* Identifier */ || token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */; + return token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; } function parsePropertyName() { - if (token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */) { - return parsePrimaryExpression(); + if (token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { + return parseLiteralNode(true); } return parseIdentifierName(); } - function isKeyword(token) { - return ts.SyntaxKind.FirstKeyword <= token && token <= ts.SyntaxKind.LastKeyword; - } - function isModifier(token) { - switch (token) { - case 98 /* PublicKeyword */: - case 96 /* PrivateKeyword */: - case 99 /* StaticKeyword */: - case 68 /* ExportKeyword */: - case 104 /* DeclareKeyword */: - return true; - } - return false; - } function parseContextualModifier(t) { return token === t && tryParse(function () { nextToken(); - return token === 9 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function parseAnyContextualModifier() { return isModifier(token) && tryParse(function () { nextToken(); - return token === 9 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function isListElement(kind, inErrorRecovery) { @@ -3116,27 +3069,28 @@ var ts; case 4 /* SwitchClauseStatements */: return isStatement(inErrorRecovery); case 3 /* SwitchClauses */: - return token === 57 /* CaseKeyword */ || token === 63 /* DefaultKeyword */; + return token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 5 /* TypeMembers */: - return isTypeMember(); + return isStartOfTypeMember(); case 6 /* ClassMembers */: return lookAhead(isClassMemberStart); case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: return isPropertyName(); case 8 /* BaseTypeReferences */: - return isIdentifier() && ((token !== 69 /* ExtendsKeyword */ && token !== 92 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); + return isIdentifier() && ((token !== 77 /* ExtendsKeyword */ && token !== 100 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); case 9 /* VariableDeclarations */: case 14 /* TypeParameters */: return isIdentifier(); case 10 /* ArgumentExpressions */: - return isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 12 /* ArrayLiteralMembers */: - return token === 14 /* CommaToken */ || isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 13 /* Parameters */: - return isParameter(); + return isStartOfParameter(); case 15 /* TypeArguments */: - return isType(); + case 16 /* TupleElementTypes */: + return token === 22 /* CommaToken */ || isStartOfType(); } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } @@ -3152,39 +3106,40 @@ var ts; case 6 /* ClassMembers */: case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: - return token === 6 /* CloseBraceToken */; + return token === 14 /* CloseBraceToken */; case 4 /* SwitchClauseStatements */: - return token === 6 /* CloseBraceToken */ || token === 57 /* CaseKeyword */ || token === 63 /* DefaultKeyword */; + return token === 14 /* CloseBraceToken */ || token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 8 /* BaseTypeReferences */: - return token === 5 /* OpenBraceToken */ || token === 69 /* ExtendsKeyword */ || token === 92 /* ImplementsKeyword */; + return token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 9 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); case 14 /* TypeParameters */: - return token === 16 /* GreaterThanToken */ || token === 7 /* OpenParenToken */ || token === 5 /* OpenBraceToken */ || token === 69 /* ExtendsKeyword */ || token === 92 /* ImplementsKeyword */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */ || token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 10 /* ArgumentExpressions */: - return token === 8 /* CloseParenToken */ || token === 13 /* SemicolonToken */; + return token === 16 /* CloseParenToken */ || token === 21 /* SemicolonToken */; case 12 /* ArrayLiteralMembers */: - return token === 10 /* CloseBracketToken */; + case 16 /* TupleElementTypes */: + return token === 18 /* CloseBracketToken */; case 13 /* Parameters */: - return token === 8 /* CloseParenToken */ || token === 10 /* CloseBracketToken */ || token === 5 /* OpenBraceToken */; + return token === 16 /* CloseParenToken */ || token === 18 /* CloseBracketToken */ || token === 13 /* OpenBraceToken */; case 15 /* TypeArguments */: - return token === 16 /* GreaterThanToken */ || token === 7 /* OpenParenToken */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */; } } function isVariableDeclaratorListTerminator() { if (canParseSemicolon()) { return true; } - if (token === 76 /* InKeyword */) { + if (token === 84 /* InKeyword */) { return true; } - if (token === 23 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return true; } return false; } function isInSomeParsingContext() { - for (var kind = 0; kind < 16 /* Count */; kind++) { + for (var kind = 0; kind < 17 /* Count */; kind++) { if (parsingContext & (1 << kind)) { if (isListElement(kind, true) || isListTerminator(kind)) { return true; @@ -3228,18 +3183,17 @@ var ts; parsingContext = saveParsingContext; return result; } - function parseDelimitedList(kind, parseElement, trailingCommaBehavior) { + function parseDelimitedList(kind, parseElement) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; var result = []; result.pos = getNodePos(); - var errorCountBeforeParsingList = file.syntacticErrors.length; var commaStart = -1; while (true) { if (isListElement(kind, false)) { result.push(parseElement()); commaStart = scanner.getTokenPos(); - if (parseOptional(14 /* CommaToken */)) { + if (parseOptional(22 /* CommaToken */)) { continue; } commaStart = -1; @@ -3249,16 +3203,6 @@ var ts; error(ts.Diagnostics._0_expected, ","); } else if (isListTerminator(kind)) { - if (commaStart >= 0) { - if (trailingCommaBehavior === 0 /* Disallow */) { - if (file.syntacticErrors.length === errorCountBeforeParsingList) { - grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, ts.Diagnostics.Trailing_comma_not_allowed); - } - } - else if (trailingCommaBehavior === 2 /* Preserve */) { - result.push(createNode(142 /* OmittedExpression */)); - } - } break; } else { @@ -3269,6 +3213,9 @@ var ts; nextToken(); } } + if (commaStart >= 0) { + result.hasTrailingComma = true; + } result.end = getNodeEnd(); parsingContext = saveParsingContext; return result; @@ -3288,7 +3235,7 @@ var ts; } function parseBracketedList(kind, parseElement, startToken, endToken) { if (parseExpected(startToken)) { - var result = parseDelimitedList(kind, parseElement, 0 /* Disallow */); + var result = parseDelimitedList(kind, parseElement); parseExpected(endToken); return result; } @@ -3296,8 +3243,8 @@ var ts; } function parseEntityName(allowReservedWords) { var entity = parseIdentifier(); - while (parseOptional(11 /* DotToken */)) { - var node = createNode(112 /* QualifiedName */, entity.pos); + while (parseOptional(19 /* DotToken */)) { + var node = createNode(121 /* QualifiedName */, entity.pos); node.left = entity; node.right = allowReservedWords ? parseIdentifierName() : parseIdentifier(); entity = finishNode(node); @@ -3309,100 +3256,131 @@ var ts; nextToken(); return finishNode(node); } - function parseLiteralNode() { + function parseTemplateExpression() { + var template = createNode(158 /* TemplateExpression */); + template.head = parseLiteralNode(); + ts.Debug.assert(template.head.kind === 10 /* TemplateHead */, "Template head has wrong token kind"); + var templateSpans = []; + templateSpans.pos = getNodePos(); + do { + templateSpans.push(parseTemplateSpan()); + } while (templateSpans[templateSpans.length - 1].literal.kind === 11 /* TemplateMiddle */); + templateSpans.end = getNodeEnd(); + template.templateSpans = templateSpans; + return finishNode(template); + } + function parseTemplateSpan() { + var span = createNode(159 /* TemplateSpan */); + span.expression = parseExpression(false); + var literal; + if (token === 14 /* CloseBraceToken */) { + reScanTemplateToken(); + literal = parseLiteralNode(); + } + else { + error(ts.Diagnostics.Invalid_template_literal_expected); + literal = createMissingNode(); + literal.text = ""; + } + span.literal = literal; + return finishNode(span); + } + function parseLiteralNode(internName) { var node = createNode(token); - node.text = scanner.getTokenValue(); + var text = scanner.getTokenValue(); + node.text = internName ? internIdentifier(text) : text; var tokenPos = scanner.getTokenPos(); nextToken(); finishNode(node); - if (node.kind === 2 /* NumericLiteral */ && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - if (isInStrictMode) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= 1 /* ES5 */) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } + if (node.kind === 6 /* NumericLiteral */ && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { + node.flags |= 16384 /* OctalLiteral */; } return node; } function parseStringLiteral() { - if (token === 3 /* StringLiteral */) - return parseLiteralNode(); + if (token === 7 /* StringLiteral */) { + return parseLiteralNode(true); + } error(ts.Diagnostics.String_literal_expected); return createMissingNode(); } function parseTypeReference() { - var node = createNode(123 /* TypeReference */); + var node = createNode(132 /* TypeReference */); node.typeName = parseEntityName(false); - if (!scanner.hasPrecedingLineBreak() && token === 15 /* LessThanToken */) { + if (!scanner.hasPrecedingLineBreak() && token === 23 /* LessThanToken */) { node.typeArguments = parseTypeArguments(); } return finishNode(node); } function parseTypeQuery() { - var node = createNode(124 /* TypeQuery */); - parseExpected(87 /* TypeOfKeyword */); + var node = createNode(135 /* TypeQuery */); + parseExpected(95 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(113 /* TypeParameter */); + var node = createNode(122 /* TypeParameter */); node.name = parseIdentifier(); - if (parseOptional(69 /* ExtendsKeyword */)) { - if (isType() || !isExpression()) { + if (parseOptional(77 /* ExtendsKeyword */)) { + if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } else { - var expr = parseUnaryExpression(); - grammarErrorOnNode(expr, ts.Diagnostics.Type_expected); + node.expression = parseUnaryExpression(); } } return finishNode(node); } function parseTypeParameters() { - if (token === 15 /* LessThanToken */) { - var pos = getNodePos(); - var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 15 /* LessThanToken */, 16 /* GreaterThanToken */); - if (!result.length) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Type_parameter_list_cannot_be_empty); - } - return result; + if (token === 23 /* LessThanToken */) { + return parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 23 /* LessThanToken */, 24 /* GreaterThanToken */); } } function parseParameterType() { - return parseOptional(42 /* ColonToken */) ? token === 3 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; + return parseOptional(50 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; } - function isParameter() { - return token === 12 /* DotDotDotToken */ || isIdentifier() || isModifier(token); + function isStartOfParameter() { + return token === 20 /* DotDotDotToken */ || isIdentifier() || isModifier(token); + } + function setModifiers(node, modifiers) { + if (modifiers) { + node.flags |= modifiers.flags; + node.modifiers = modifiers; + } } function parseParameter(flags) { if (flags === void 0) { flags = 0; } - var node = createNode(114 /* Parameter */); - node.flags |= parseAndCheckModifiers(3 /* Parameters */); - if (parseOptional(12 /* DotDotDotToken */)) { + var node = createNode(123 /* Parameter */); + var modifiers = parseModifiers(3 /* Parameters */); + setModifiers(node, modifiers); + if (parseOptional(20 /* DotDotDotToken */)) { node.flags |= 8 /* Rest */; } node.name = parseIdentifier(); - if (node.name.kind === 111 /* Missing */ && node.flags === 0 && isModifier(token)) { + if (node.name.kind === 120 /* Missing */ && node.flags === 0 && isModifier(token)) { nextToken(); } - if (parseOptional(41 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } node.type = parseParameterType(); node.initializer = parseInitializer(true); return finishNode(node); } - function parseSignature(kind, returnToken) { - if (kind === 121 /* ConstructSignature */) { - parseExpected(78 /* NewKeyword */); + function parseSignature(kind, returnToken, returnTokenRequired) { + if (kind === 130 /* ConstructSignature */) { + parseExpected(86 /* NewKeyword */); } var typeParameters = parseTypeParameters(); - var parameters = parseParameterList(7 /* OpenParenToken */, 8 /* CloseParenToken */); - checkParameterList(parameters); - var type = parseOptional(returnToken) ? parseType() : undefined; + var parameters = parseParameterList(15 /* OpenParenToken */, 16 /* CloseParenToken */); + var type; + if (returnTokenRequired) { + parseExpected(returnToken); + type = parseType(); + } + else if (parseOptional(returnToken)) { + type = parseType(); + } return { typeParameters: typeParameters, parameters: parameters, @@ -3412,201 +3390,126 @@ var ts; function parseParameterList(startDelimiter, endDelimiter) { return parseBracketedList(13 /* Parameters */, parseParameter, startDelimiter, endDelimiter); } - function checkParameterList(parameters) { - var seenOptionalParameter = false; - var parameterCount = parameters.length; - for (var i = 0; i < parameterCount; i++) { - var parameter = parameters[i]; - if (isInStrictMode && isEvalOrArgumentsIdentifier(parameter.name)) { - reportInvalidUseInStrictMode(parameter.name); - return; - } - else if (parameter.flags & 8 /* Rest */) { - if (i !== (parameterCount - 1)) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - return; - } - if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); - return; - } - if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); - return; - } - } - else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { - seenOptionalParameter = true; - if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - return; - } - } - else { - if (seenOptionalParameter) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - return; - } - } - } - } function parseSignatureMember(kind, returnToken) { var node = createNode(kind); - var sig = parseSignature(kind, returnToken); + var sig = parseSignature(kind, returnToken, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; parseSemicolon(); return finishNode(node); } - function parseIndexSignatureMember() { - var node = createNode(122 /* IndexSignature */); - var errorCountBeforeIndexSignature = file.syntacticErrors.length; - var indexerStart = scanner.getTokenPos(); - node.parameters = parseParameterList(9 /* OpenBracketToken */, 10 /* CloseBracketToken */); - var indexerLength = scanner.getStartPos() - indexerStart; + function parseIndexSignatureMember(modifiers, pos) { + var node = createNode(131 /* IndexSignature */, pos); + setModifiers(node, modifiers); + node.parameters = parseParameterList(17 /* OpenBracketToken */, 18 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseSemicolon(); - if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { - checkIndexSignature(node, indexerStart, indexerLength); - } return finishNode(node); } - function checkIndexSignature(node, indexerStart, indexerLength) { - var parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - var arityDiagnostic = ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter; - if (parameter) { - grammarErrorOnNode(parameter.name, arityDiagnostic); - } - else { - grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); - } - return; - } - else if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - return; - } - else if (parameter.flags & ts.NodeFlags.Modifier) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - return; - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - return; - } - else if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - return; - } - else if (!parameter.type) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - return; - } - else if (parameter.type.kind !== 110 /* StringKeyword */ && parameter.type.kind !== 108 /* NumberKeyword */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); - return; - } - else if (!node.type) { - grammarErrorAtPos(indexerStart, indexerLength, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); - return; - } - } function parsePropertyOrMethod() { var node = createNode(0 /* Unknown */); node.name = parsePropertyName(); - if (parseOptional(41 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } - if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { - node.kind = 116 /* Method */; - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + node.kind = 125 /* Method */; + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; } else { - node.kind = 115 /* Property */; + node.kind = 124 /* Property */; node.type = parseTypeAnnotation(); } parseSemicolon(); return finishNode(node); } - function isTypeMember() { + function isStartOfTypeMember() { switch (token) { - case 7 /* OpenParenToken */: - case 15 /* LessThanToken */: - case 9 /* OpenBracketToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 17 /* OpenBracketToken */: return true; default: - return isPropertyName() && lookAhead(function () { return nextToken() === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */ || token === 41 /* QuestionToken */ || token === 42 /* ColonToken */ || canParseSemicolon(); }); + return isPropertyName() && lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */ || token === 49 /* QuestionToken */ || token === 50 /* ColonToken */ || canParseSemicolon(); }); } } function parseTypeMember() { switch (token) { - case 7 /* OpenParenToken */: - case 15 /* LessThanToken */: - return parseSignatureMember(120 /* CallSignature */, 42 /* ColonToken */); - case 9 /* OpenBracketToken */: - return parseIndexSignatureMember(); - case 78 /* NewKeyword */: - if (lookAhead(function () { return nextToken() === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */; })) { - return parseSignatureMember(121 /* ConstructSignature */, 42 /* ColonToken */); + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + return parseSignatureMember(129 /* CallSignature */, 50 /* ColonToken */); + case 17 /* OpenBracketToken */: + return parseIndexSignatureMember(undefined); + case 86 /* NewKeyword */: + if (lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */; })) { + return parseSignatureMember(130 /* ConstructSignature */, 50 /* ColonToken */); } - case 3 /* StringLiteral */: - case 2 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 6 /* NumericLiteral */: return parsePropertyOrMethod(); default: - if (token >= 55 /* Identifier */) { + if (token >= 63 /* Identifier */) { return parsePropertyOrMethod(); } } } function parseTypeLiteral() { - var node = createNode(125 /* TypeLiteral */); - if (parseExpected(5 /* OpenBraceToken */)) { + var node = createNode(136 /* TypeLiteral */); + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); - parseExpected(6 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); } return finishNode(node); } - function parseFunctionType(signatureKind) { - var node = createNode(125 /* TypeLiteral */); - var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, 23 /* EqualsGreaterThanToken */); + function parseTupleType() { + var node = createNode(138 /* TupleType */); + node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 17 /* OpenBracketToken */, 18 /* CloseBracketToken */); + return finishNode(node); + } + function parseParenType() { + var node = createNode(140 /* ParenType */); + parseExpected(15 /* OpenParenToken */); + node.type = parseType(); + parseExpected(16 /* CloseParenToken */); + return finishNode(node); + } + function parseFunctionType(typeKind) { + var member = createNode(typeKind); + var sig = parseSignature(typeKind === 133 /* FunctionType */ ? 129 /* CallSignature */ : 130 /* ConstructSignature */, 31 /* EqualsGreaterThanToken */, true); member.typeParameters = sig.typeParameters; member.parameters = sig.parameters; member.type = sig.type; finishNode(member); - node.members = createNodeArray(member); - return finishNode(node); + return member; } function parseKeywordAndNoDot() { var node = parseTokenNode(); - return token === 11 /* DotToken */ ? undefined : node; + return token === 19 /* DotToken */ ? undefined : node; } function parseNonArrayType() { switch (token) { - case 101 /* AnyKeyword */: - case 110 /* StringKeyword */: - case 108 /* NumberKeyword */: - case 102 /* BooleanKeyword */: - case 89 /* VoidKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 87 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return parseTypeQuery(); - case 5 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseTypeLiteral(); - case 7 /* OpenParenToken */: - case 15 /* LessThanToken */: - return parseFunctionType(120 /* CallSignature */); - case 78 /* NewKeyword */: - return parseFunctionType(121 /* ConstructSignature */); + case 17 /* OpenBracketToken */: + return parseTupleType(); + case 15 /* OpenParenToken */: + return parseParenType(); default: if (isIdentifier()) { return parseTypeReference(); @@ -3615,89 +3518,137 @@ var ts; error(ts.Diagnostics.Type_expected); return createMissingNode(); } - function isType() { + function isStartOfType() { switch (token) { - case 101 /* AnyKeyword */: - case 110 /* StringKeyword */: - case 108 /* NumberKeyword */: - case 102 /* BooleanKeyword */: - case 89 /* VoidKeyword */: - case 87 /* TypeOfKeyword */: - case 5 /* OpenBraceToken */: - case 15 /* LessThanToken */: - case 78 /* NewKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: + case 95 /* TypeOfKeyword */: + case 13 /* OpenBraceToken */: + case 17 /* OpenBracketToken */: + case 23 /* LessThanToken */: + case 86 /* NewKeyword */: return true; - case 7 /* OpenParenToken */: + case 15 /* OpenParenToken */: return lookAhead(function () { nextToken(); - return token === 8 /* CloseParenToken */ || isParameter(); + return token === 16 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); }); default: return isIdentifier(); } } - function parseType() { + function parsePrimaryType() { var type = parseNonArrayType(); - while (type && !scanner.hasPrecedingLineBreak() && parseOptional(9 /* OpenBracketToken */)) { - parseExpected(10 /* CloseBracketToken */); - var node = createNode(126 /* ArrayType */, type.pos); + while (!scanner.hasPrecedingLineBreak() && parseOptional(17 /* OpenBracketToken */)) { + parseExpected(18 /* CloseBracketToken */); + var node = createNode(137 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } return type; } - function parseTypeAnnotation() { - return parseOptional(42 /* ColonToken */) ? parseType() : undefined; + function parseUnionType() { + var type = parsePrimaryType(); + if (token === 43 /* BarToken */) { + var types = [type]; + types.pos = type.pos; + while (parseOptional(43 /* BarToken */)) { + types.push(parsePrimaryType()); + } + types.end = getNodeEnd(); + var node = createNode(139 /* UnionType */, type.pos); + node.types = types; + type = finishNode(node); + } + return type; } - function isExpression() { + function isStartOfFunctionType() { + return token === 23 /* LessThanToken */ || token === 15 /* OpenParenToken */ && lookAhead(function () { + nextToken(); + if (token === 16 /* CloseParenToken */ || token === 20 /* DotDotDotToken */) { + return true; + } + if (isIdentifier() || isModifier(token)) { + nextToken(); + if (token === 50 /* ColonToken */ || token === 22 /* CommaToken */ || token === 49 /* QuestionToken */ || token === 51 /* EqualsToken */ || isIdentifier() || isModifier(token)) { + return true; + } + if (token === 16 /* CloseParenToken */) { + nextToken(); + if (token === 31 /* EqualsGreaterThanToken */) { + return true; + } + } + } + return false; + }); + } + function parseType() { + if (isStartOfFunctionType()) { + return parseFunctionType(133 /* FunctionType */); + } + if (token === 86 /* NewKeyword */) { + return parseFunctionType(134 /* ConstructorType */); + } + return parseUnionType(); + } + function parseTypeAnnotation() { + return parseOptional(50 /* ColonToken */) ? parseType() : undefined; + } + function isStartOfExpression() { switch (token) { - case 83 /* ThisKeyword */: - case 81 /* SuperKeyword */: - case 79 /* NullKeyword */: - case 85 /* TrueKeyword */: - case 70 /* FalseKeyword */: - case 2 /* NumericLiteral */: - case 3 /* StringLiteral */: - case 7 /* OpenParenToken */: - case 9 /* OpenBracketToken */: - case 5 /* OpenBraceToken */: - case 73 /* FunctionKeyword */: - case 78 /* NewKeyword */: - case 27 /* SlashToken */: - case 47 /* SlashEqualsToken */: - case 24 /* PlusToken */: - case 25 /* MinusToken */: - case 38 /* TildeToken */: - case 37 /* ExclamationToken */: - case 64 /* DeleteKeyword */: - case 87 /* TypeOfKeyword */: - case 89 /* VoidKeyword */: - case 29 /* PlusPlusToken */: - case 30 /* MinusMinusToken */: - case 15 /* LessThanToken */: - case 55 /* Identifier */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 15 /* OpenParenToken */: + case 17 /* OpenBracketToken */: + case 13 /* OpenBraceToken */: + case 81 /* FunctionKeyword */: + case 86 /* NewKeyword */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: + case 23 /* LessThanToken */: + case 63 /* Identifier */: return true; default: return isIdentifier(); } } - function isExpressionStatement() { - return token !== 5 /* OpenBraceToken */ && token !== 73 /* FunctionKeyword */ && isExpression(); + function isStartOfExpressionStatement() { + return token !== 13 /* OpenBraceToken */ && token !== 81 /* FunctionKeyword */ && isStartOfExpression(); } function parseExpression(noIn) { var expr = parseAssignmentExpression(noIn); - while (parseOptional(14 /* CommaToken */)) { - expr = makeBinaryExpression(expr, 14 /* CommaToken */, parseAssignmentExpression(noIn)); + while (parseOptional(22 /* CommaToken */)) { + expr = makeBinaryExpression(expr, 22 /* CommaToken */, parseAssignmentExpression(noIn)); } return expr; } function parseInitializer(inParameter, noIn) { - if (token !== 43 /* EqualsToken */) { - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 5 /* OpenBraceToken */) || !isExpression()) { + if (token !== 51 /* EqualsToken */) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token === 13 /* OpenBraceToken */) || !isStartOfExpression()) { return undefined; } } - parseExpected(43 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); return parseAssignmentExpression(noIn); } function parseAssignmentExpression(noIn) { @@ -3706,49 +3657,20 @@ var ts; return arrowExpression; } var expr = parseConditionalExpression(noIn); - if (expr.kind === 55 /* Identifier */ && token === 23 /* EqualsGreaterThanToken */) { + if (expr.kind === 63 /* Identifier */ && token === 31 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } - if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } + if (isLeftHandSideExpression(expr) && isAssignmentOperator(token)) { var operator = token; nextToken(); return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); } return expr; } - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 130 /* PropertyAccess */: - case 131 /* IndexedAccess */: - case 133 /* NewExpression */: - case 132 /* CallExpression */: - case 127 /* ArrayLiteral */: - case 135 /* ParenExpression */: - case 128 /* ObjectLiteral */: - case 136 /* FunctionExpression */: - case 55 /* Identifier */: - case 111 /* Missing */: - case 4 /* RegularExpressionLiteral */: - case 2 /* NumericLiteral */: - case 3 /* StringLiteral */: - case 70 /* FalseKeyword */: - case 79 /* NullKeyword */: - case 83 /* ThisKeyword */: - case 85 /* TrueKeyword */: - case 81 /* SuperKeyword */: - return true; - } - } - return false; - } function parseSimpleArrowFunctionExpression(identifier) { - ts.Debug.assert(token === 23 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - parseExpected(23 /* EqualsGreaterThanToken */); - var parameter = createNode(114 /* Parameter */, identifier.pos); + ts.Debug.assert(token === 31 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + parseExpected(31 /* EqualsGreaterThanToken */); + var parameter = createNode(123 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); var parameters = []; @@ -3765,17 +3687,17 @@ var ts; } var pos = getNodePos(); if (triState === 1 /* True */) { - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); - if (parseExpected(23 /* EqualsGreaterThanToken */) || token === 5 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (parseExpected(31 /* EqualsGreaterThanToken */) || token === 13 /* OpenBraceToken */) { return parseArrowExpressionTail(pos, sig, false); } else { - return makeFunctionExpression(137 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); + return makeFunctionExpression(153 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); } } var sig = tryParseSignatureIfArrowOrBraceFollows(); if (sig) { - parseExpected(23 /* EqualsGreaterThanToken */); + parseExpected(31 /* EqualsGreaterThanToken */); return parseArrowExpressionTail(pos, sig, false); } else { @@ -3783,35 +3705,35 @@ var ts; } } function isParenthesizedArrowFunctionExpression() { - if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { return lookAhead(function () { var first = token; var second = nextToken(); - if (first === 7 /* OpenParenToken */) { - if (second === 8 /* CloseParenToken */) { + if (first === 15 /* OpenParenToken */) { + if (second === 16 /* CloseParenToken */) { var third = nextToken(); switch (third) { - case 23 /* EqualsGreaterThanToken */: - case 42 /* ColonToken */: - case 5 /* OpenBraceToken */: + case 31 /* EqualsGreaterThanToken */: + case 50 /* ColonToken */: + case 13 /* OpenBraceToken */: return 1 /* True */; default: return 0 /* False */; } } - if (second === 12 /* DotDotDotToken */) { + if (second === 20 /* DotDotDotToken */) { return 1 /* True */; } if (!isIdentifier()) { return 0 /* False */; } - if (nextToken() === 42 /* ColonToken */) { + if (nextToken() === 50 /* ColonToken */) { return 1 /* True */; } return 2 /* Unknown */; } else { - ts.Debug.assert(first === 15 /* LessThanToken */); + ts.Debug.assert(first === 23 /* LessThanToken */); if (!isIdentifier()) { return 0 /* False */; } @@ -3819,15 +3741,15 @@ var ts; } }); } - if (token === 23 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return 1 /* True */; } return 0 /* False */; } function tryParseSignatureIfArrowOrBraceFollows() { return tryParse(function () { - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); - if (token === 23 /* EqualsGreaterThanToken */ || token === 5 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (token === 31 /* EqualsGreaterThanToken */ || token === 13 /* OpenBraceToken */) { return sig; } return undefined; @@ -3835,27 +3757,24 @@ var ts; } function parseArrowExpressionTail(pos, sig, noIn) { var body; - if (token === 5 /* OpenBraceToken */) { - body = parseBody(false); + if (token === 13 /* OpenBraceToken */) { + body = parseFunctionBlock(false); } - else if (isStatement(true) && !isExpressionStatement() && token !== 73 /* FunctionKeyword */) { - body = parseBody(true); + else if (isStatement(true) && !isStartOfExpressionStatement() && token !== 81 /* FunctionKeyword */) { + body = parseFunctionBlock(true); } else { body = parseAssignmentExpression(noIn); } - return makeFunctionExpression(137 /* ArrowFunction */, pos, undefined, sig, body); - } - function isAssignmentOperator() { - return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; + return makeFunctionExpression(153 /* ArrowFunction */, pos, undefined, sig, body); } function parseConditionalExpression(noIn) { var expr = parseBinaryExpression(noIn); - while (parseOptional(41 /* QuestionToken */)) { - var node = createNode(141 /* ConditionalExpression */, expr.pos); + while (parseOptional(49 /* QuestionToken */)) { + var node = createNode(157 /* ConditionalExpression */, expr.pos); node.condition = expr; node.whenTrue = parseAssignmentExpression(false); - parseExpected(42 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.whenFalse = parseAssignmentExpression(noIn); expr = finishNode(node); } @@ -3868,7 +3787,7 @@ var ts; while (true) { reScanGreaterToken(); var precedence = getOperatorPrecedence(); - if (precedence && precedence > minPrecedence && (!noIn || token !== 76 /* InKeyword */)) { + if (precedence && precedence > minPrecedence && (!noIn || token !== 84 /* InKeyword */)) { var operator = token; nextToken(); expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); @@ -3879,44 +3798,44 @@ var ts; } function getOperatorPrecedence() { switch (token) { - case 40 /* BarBarToken */: + case 48 /* BarBarToken */: return 1; - case 39 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return 2; - case 35 /* BarToken */: + case 43 /* BarToken */: return 3; - case 36 /* CaretToken */: + case 44 /* CaretToken */: return 4; - case 34 /* AmpersandToken */: + case 42 /* AmpersandToken */: return 5; - case 19 /* EqualsEqualsToken */: - case 20 /* ExclamationEqualsToken */: - case 21 /* EqualsEqualsEqualsToken */: - case 22 /* ExclamationEqualsEqualsToken */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: return 6; - case 15 /* LessThanToken */: - case 16 /* GreaterThanToken */: - case 17 /* LessThanEqualsToken */: - case 18 /* GreaterThanEqualsToken */: - case 77 /* InstanceOfKeyword */: - case 76 /* InKeyword */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + case 85 /* InstanceOfKeyword */: + case 84 /* InKeyword */: return 7; - case 31 /* LessThanLessThanToken */: - case 32 /* GreaterThanGreaterThanToken */: - case 33 /* GreaterThanGreaterThanGreaterThanToken */: + case 39 /* LessThanLessThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return 8; - case 24 /* PlusToken */: - case 25 /* MinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: return 9; - case 26 /* AsteriskToken */: - case 27 /* SlashToken */: - case 28 /* PercentToken */: + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: return 10; } return undefined; } function makeBinaryExpression(left, operator, right) { - var node = createNode(140 /* BinaryExpression */, left.pos); + var node = createNode(156 /* BinaryExpression */, left.pos); node.left = left; node.operator = operator; node.right = right; @@ -3925,52 +3844,40 @@ var ts; function parseUnaryExpression() { var pos = getNodePos(); switch (token) { - case 24 /* PlusToken */: - case 25 /* MinusToken */: - case 38 /* TildeToken */: - case 37 /* ExclamationToken */: - case 64 /* DeleteKeyword */: - case 87 /* TypeOfKeyword */: - case 89 /* VoidKeyword */: - case 29 /* PlusPlusToken */: - case 30 /* MinusMinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var operator = token; nextToken(); - var operand = parseUnaryExpression(); - if (isInStrictMode) { - if ((token === 29 /* PlusPlusToken */ || token === 30 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { - reportInvalidUseInStrictMode(operand); - } - else if (token === 64 /* DeleteKeyword */ && operand.kind === 55 /* Identifier */) { - grammarErrorOnNode(operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); - } - } - return makeUnaryExpression(138 /* PrefixOperator */, pos, operator, operand); - case 15 /* LessThanToken */: + return makeUnaryExpression(154 /* PrefixOperator */, pos, operator, parseUnaryExpression()); + case 23 /* LessThanToken */: return parseTypeAssertion(); } var primaryExpression = parsePrimaryExpression(); - var illegalUsageOfSuperKeyword = primaryExpression.kind === 81 /* SuperKeyword */ && token !== 7 /* OpenParenToken */ && token !== 11 /* DotToken */; + var illegalUsageOfSuperKeyword = primaryExpression.kind === 89 /* SuperKeyword */ && token !== 15 /* OpenParenToken */ && token !== 19 /* DotToken */; if (illegalUsageOfSuperKeyword) { error(ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); } var expr = parseCallAndAccess(primaryExpression, false); ts.Debug.assert(isLeftHandSideExpression(expr)); - if ((token === 29 /* PlusPlusToken */ || token === 30 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } + if ((token === 37 /* PlusPlusToken */ || token === 38 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { var operator = token; nextToken(); - expr = makeUnaryExpression(139 /* PostfixOperator */, expr.pos, operator, expr); + expr = makeUnaryExpression(155 /* PostfixOperator */, expr.pos, operator, expr); } return expr; } function parseTypeAssertion() { - var node = createNode(134 /* TypeAssertion */); - parseExpected(15 /* LessThanToken */); + var node = createNode(150 /* TypeAssertion */); + parseExpected(23 /* LessThanToken */); node.type = parseType(); - parseExpected(16 /* GreaterThanToken */); + parseExpected(24 /* GreaterThanToken */); node.operand = parseUnaryExpression(); return finishNode(node); } @@ -3982,87 +3889,111 @@ var ts; } function parseCallAndAccess(expr, inNewExpression) { while (true) { - if (parseOptional(11 /* DotToken */)) { - var propertyAccess = createNode(130 /* PropertyAccess */, expr.pos); + var dotOrBracketStart = scanner.getTokenPos(); + if (parseOptional(19 /* DotToken */)) { + var propertyAccess = createNode(145 /* PropertyAccess */, expr.pos); + var id; + if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { + var matchesPattern = lookAhead(function () { + nextToken(); + return !scanner.hasPrecedingLineBreak() && (scanner.isIdentifier() || scanner.isReservedWord); + }); + if (matchesPattern) { + errorAtPos(dotOrBracketStart + 1, 0, ts.Diagnostics.Identifier_expected); + id = createMissingNode(); + } + } propertyAccess.left = expr; - propertyAccess.right = parseIdentifierName(); + propertyAccess.right = id || parseIdentifierName(); expr = finishNode(propertyAccess); continue; } - var bracketStart = scanner.getTokenPos(); - if (parseOptional(9 /* OpenBracketToken */)) { - var indexedAccess = createNode(131 /* IndexedAccess */, expr.pos); + if (parseOptional(17 /* OpenBracketToken */)) { + var indexedAccess = createNode(146 /* IndexedAccess */, expr.pos); indexedAccess.object = expr; - if (inNewExpression && parseOptional(10 /* CloseBracketToken */)) { + if (inNewExpression && parseOptional(18 /* CloseBracketToken */)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { indexedAccess.index = parseExpression(); - parseExpected(10 /* CloseBracketToken */); + if (indexedAccess.index.kind === 7 /* StringLiteral */ || indexedAccess.index.kind === 6 /* NumericLiteral */) { + var literal = indexedAccess.index; + literal.text = internIdentifier(literal.text); + } + parseExpected(18 /* CloseBracketToken */); } expr = finishNode(indexedAccess); continue; } - if ((token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(132 /* CallExpression */, expr.pos); + if ((token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) && !inNewExpression) { + var callExpr = createNode(147 /* CallExpression */, expr.pos); callExpr.func = expr; - if (token === 15 /* LessThanToken */) { + if (token === 23 /* LessThanToken */) { if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) return expr; } else { - parseExpected(7 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); } - callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseAssignmentExpression, 0 /* Disallow */); - parseExpected(8 /* CloseParenToken */); + callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression); + parseExpected(16 /* CloseParenToken */); expr = finishNode(callExpr); continue; } + if (token === 9 /* NoSubstitutionTemplateLiteral */ || token === 10 /* TemplateHead */) { + var tagExpression = createNode(149 /* TaggedTemplateExpression */, expr.pos); + tagExpression.tag = expr; + tagExpression.template = token === 9 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() : parseTemplateExpression(); + expr = finishNode(tagExpression); + continue; + } return expr; } } function parseTypeArgumentsAndOpenParen() { var result = parseTypeArguments(); - parseExpected(7 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); return result; } function parseTypeArguments() { - var typeArgumentListStart = scanner.getTokenPos(); - var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(15 /* TypeArguments */, parseType, 15 /* LessThanToken */, 16 /* GreaterThanToken */); - if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { - grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, ts.Diagnostics.Type_argument_list_cannot_be_empty); + return parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 23 /* LessThanToken */, 24 /* GreaterThanToken */); + } + function parseSingleTypeArgument() { + if (token === 22 /* CommaToken */) { + return createNode(120 /* Missing */); } - return result; + return parseType(); } function parsePrimaryExpression() { switch (token) { - case 83 /* ThisKeyword */: - case 81 /* SuperKeyword */: - case 79 /* NullKeyword */: - case 85 /* TrueKeyword */: - case 70 /* FalseKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return parseTokenNode(); - case 2 /* NumericLiteral */: - case 3 /* StringLiteral */: + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return parseLiteralNode(); - case 7 /* OpenParenToken */: + case 15 /* OpenParenToken */: return parseParenExpression(); - case 9 /* OpenBracketToken */: + case 17 /* OpenBracketToken */: return parseArrayLiteral(); - case 5 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseObjectLiteral(); - case 73 /* FunctionKeyword */: + case 81 /* FunctionKeyword */: return parseFunctionExpression(); - case 78 /* NewKeyword */: + case 86 /* NewKeyword */: return parseNewExpression(); - case 27 /* SlashToken */: - case 47 /* SlashEqualsToken */: - if (reScanSlashToken() === 4 /* RegularExpressionLiteral */) { + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + if (reScanSlashToken() === 8 /* RegularExpressionLiteral */) { return parseLiteralNode(); } break; + case 10 /* TemplateHead */: + return parseTemplateExpression(); default: if (isIdentifier()) { return parseIdentifier(); @@ -4072,113 +4003,88 @@ var ts; return createMissingNode(); } function parseParenExpression() { - var node = createNode(135 /* ParenExpression */); - parseExpected(7 /* OpenParenToken */); + var node = createNode(151 /* ParenExpression */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); return finishNode(node); } + function parseAssignmentExpressionOrOmittedExpression() { + return token === 22 /* CommaToken */ ? createNode(160 /* OmittedExpression */) : parseAssignmentExpression(); + } function parseArrayLiteralElement() { - return token === 14 /* CommaToken */ ? createNode(142 /* OmittedExpression */) : parseAssignmentExpression(); + return parseAssignmentExpressionOrOmittedExpression(); + } + function parseArgumentExpression() { + return parseAssignmentExpressionOrOmittedExpression(); } function parseArrayLiteral() { - var node = createNode(127 /* ArrayLiteral */); - parseExpected(9 /* OpenBracketToken */); + var node = createNode(141 /* ArrayLiteral */); + parseExpected(17 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) - node.flags |= 128 /* MultiLine */; - node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, 2 /* Preserve */); - parseExpected(10 /* CloseBracketToken */); + node.flags |= 256 /* MultiLine */; + node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement); + parseExpected(18 /* CloseBracketToken */); return finishNode(node); } function parsePropertyAssignment() { - var node = createNode(129 /* PropertyAssignment */); - node.name = parsePropertyName(); - if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); - var body = parseBody(false); - node.initializer = makeFunctionExpression(136 /* FunctionExpression */, node.pos, undefined, sig, body); + var nodePos = scanner.getStartPos(); + var tokenIsIdentifier = isIdentifier(); + var nameToken = token; + var propertyName = parsePropertyName(); + var node; + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + node = createNode(143 /* PropertyAssignment */, nodePos); + node.name = propertyName; + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + var body = parseFunctionBlock(false); + node.initializer = makeFunctionExpression(152 /* FunctionExpression */, node.pos, undefined, sig, body); + return finishNode(node); + } + var flags = 0; + if (token === 49 /* QuestionToken */) { + flags |= 4 /* QuestionMark */; + nextToken(); + } + if ((token === 22 /* CommaToken */ || token === 14 /* CloseBraceToken */) && tokenIsIdentifier) { + node = createNode(144 /* ShorthandPropertyAssignment */, nodePos); + node.name = propertyName; } else { - parseExpected(42 /* ColonToken */); + node = createNode(143 /* PropertyAssignment */, nodePos); + node.name = propertyName; + parseExpected(50 /* ColonToken */); node.initializer = parseAssignmentExpression(false); } + node.flags = flags; return finishNode(node); } function parseObjectLiteralMember() { var initialPos = getNodePos(); var initialToken = token; - if (parseContextualModifier(105 /* GetKeyword */) || parseContextualModifier(109 /* SetKeyword */)) { - var kind = initialToken === 105 /* GetKeyword */ ? 118 /* GetAccessor */ : 119 /* SetAccessor */; - return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); + if (parseContextualModifier(113 /* GetKeyword */) || parseContextualModifier(117 /* SetKeyword */)) { + var kind = initialToken === 113 /* GetKeyword */ ? 127 /* GetAccessor */ : 128 /* SetAccessor */; + return parseMemberAccessorDeclaration(kind, initialPos, undefined); } return parsePropertyAssignment(); } function parseObjectLiteral() { - var node = createNode(128 /* ObjectLiteral */); - parseExpected(5 /* OpenBraceToken */); + var node = createNode(142 /* ObjectLiteral */); + parseExpected(13 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { - node.flags |= 128 /* MultiLine */; + node.flags |= 256 /* MultiLine */; } - var trailingCommaBehavior = languageVersion === 0 /* ES3 */ ? 1 /* Allow */ : 2 /* Preserve */; - node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, trailingCommaBehavior); - parseExpected(6 /* CloseBraceToken */); - var seen = {}; - var Property = 1; - var GetAccessor = 2; - var SetAccesor = 4; - var GetOrSetAccessor = GetAccessor | SetAccesor; - ts.forEach(node.properties, function (p) { - if (p.kind === 142 /* OmittedExpression */) { - return; - } - var currentKind; - if (p.kind === 129 /* PropertyAssignment */) { - currentKind = Property; - } - else if (p.kind === 118 /* GetAccessor */) { - currentKind = GetAccessor; - } - else if (p.kind === 119 /* SetAccessor */) { - currentKind = SetAccesor; - } - else { - ts.Debug.fail("Unexpected syntax kind:" + ts.SyntaxKind[p.kind]); - } - if (!ts.hasProperty(seen, p.name.text)) { - seen[p.name.text] = currentKind; - } - else { - var existingKind = seen[p.name.text]; - if (currentKind === Property && existingKind === Property) { - if (isInStrictMode) { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); - } - } - else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { - if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[p.name.text] = currentKind | existingKind; - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - }); + node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember); + parseExpected(14 /* CloseBraceToken */); return finishNode(node); } function parseFunctionExpression() { var pos = getNodePos(); - parseExpected(73 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); - var body = parseBody(false); - if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { - reportInvalidUseInStrictMode(name); - } - return makeFunctionExpression(136 /* FunctionExpression */, pos, name, sig, body); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + var body = parseFunctionBlock(false); + return makeFunctionExpression(152 /* FunctionExpression */, pos, name, sig, body); } function makeFunctionExpression(kind, pos, name, sig, body) { var node = createNode(kind, pos); @@ -4190,274 +4096,180 @@ var ts; return finishNode(node); } function parseNewExpression() { - var node = createNode(133 /* NewExpression */); - parseExpected(78 /* NewKeyword */); + var node = createNode(148 /* NewExpression */); + parseExpected(86 /* NewKeyword */); node.func = parseCallAndAccess(parsePrimaryExpression(), true); - if (parseOptional(7 /* OpenParenToken */) || token === 15 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { - node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseAssignmentExpression, 0 /* Disallow */); - parseExpected(8 /* CloseParenToken */); + if (parseOptional(15 /* OpenParenToken */) || token === 23 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { + node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression); + parseExpected(16 /* CloseParenToken */); } return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(143 /* Block */); - if (parseExpected(5 /* OpenBraceToken */) || ignoreMissingOpenBrace) { + var node = createNode(161 /* Block */); + if (parseExpected(13 /* OpenBraceToken */) || ignoreMissingOpenBrace) { node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); - parseExpected(6 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); } return finishNode(node); } - function parseBody(ignoreMissingOpenBrace) { - var saveInFunctionBody = inFunctionBody; - var saveInSwitchStatement = inSwitchStatement; - var saveInIterationStatement = inIterationStatement; - inFunctionBody = true; - if (inSwitchStatement === 1 /* Nested */) { - inSwitchStatement = 2 /* CrossingFunctionBoundary */; - } - if (inIterationStatement === 1 /* Nested */) { - inIterationStatement = 2 /* CrossingFunctionBoundary */; - } - labelledStatementInfo.pushFunctionBoundary(); + function parseFunctionBlock(ignoreMissingOpenBrace) { var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 168 /* FunctionBlock */; - labelledStatementInfo.pop(); - inFunctionBody = saveInFunctionBody; - inSwitchStatement = saveInSwitchStatement; - inIterationStatement = saveInIterationStatement; + block.kind = 186 /* FunctionBlock */; return block; } function parseEmptyStatement() { - var node = createNode(145 /* EmptyStatement */); - parseExpected(13 /* SemicolonToken */); + var node = createNode(163 /* EmptyStatement */); + parseExpected(21 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(147 /* IfStatement */); - parseExpected(74 /* IfKeyword */); - parseExpected(7 /* OpenParenToken */); + var node = createNode(165 /* IfStatement */); + parseExpected(82 /* IfKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(66 /* ElseKeyword */) ? parseStatement() : undefined; + node.elseStatement = parseOptional(74 /* ElseKeyword */) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(148 /* DoStatement */); - parseExpected(65 /* DoKeyword */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; + var node = createNode(166 /* DoStatement */); + parseExpected(73 /* DoKeyword */); node.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; - parseExpected(90 /* WhileKeyword */); - parseExpected(7 /* OpenParenToken */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); - parseOptional(13 /* SemicolonToken */); + parseExpected(16 /* CloseParenToken */); + parseOptional(21 /* SemicolonToken */); return finishNode(node); } function parseWhileStatement() { - var node = createNode(149 /* WhileStatement */); - parseExpected(90 /* WhileKeyword */); - parseExpected(7 /* OpenParenToken */); + var node = createNode(167 /* WhileStatement */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; + parseExpected(16 /* CloseParenToken */); node.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; return finishNode(node); } function parseForOrForInStatement() { var pos = getNodePos(); - parseExpected(72 /* ForKeyword */); - parseExpected(7 /* OpenParenToken */); - if (token !== 13 /* SemicolonToken */) { - if (parseOptional(88 /* VarKeyword */)) { + parseExpected(80 /* ForKeyword */); + parseExpected(15 /* OpenParenToken */); + if (token !== 21 /* SemicolonToken */) { + if (parseOptional(96 /* VarKeyword */)) { var declarations = parseVariableDeclarationList(0, true); - if (!declarations.length) { - error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } + } + else if (parseOptional(102 /* LetKeyword */)) { + var declarations = parseVariableDeclarationList(2048 /* Let */, true); + } + else if (parseOptional(68 /* ConstKeyword */)) { + var declarations = parseVariableDeclarationList(4096 /* Const */, true); } else { var varOrInit = parseExpression(true); } } var forOrForInStatement; - if (parseOptional(76 /* InKeyword */)) { - var forInStatement = createNode(151 /* ForInStatement */, pos); + if (parseOptional(84 /* InKeyword */)) { + var forInStatement = createNode(169 /* ForInStatement */, pos); if (declarations) { - if (declarations.length > 1) { - error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - } - forInStatement.declaration = declarations[0]; + forInStatement.declarations = declarations; } else { forInStatement.variable = varOrInit; } forInStatement.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forInStatement; } else { - var forStatement = createNode(150 /* ForStatement */, pos); - if (declarations) + var forStatement = createNode(168 /* ForStatement */, pos); + if (declarations) { forStatement.declarations = declarations; - if (varOrInit) + } + if (varOrInit) { forStatement.initializer = varOrInit; - parseExpected(13 /* SemicolonToken */); - if (token !== 13 /* SemicolonToken */ && token !== 8 /* CloseParenToken */) { + } + parseExpected(21 /* SemicolonToken */); + if (token !== 21 /* SemicolonToken */ && token !== 16 /* CloseParenToken */) { forStatement.condition = parseExpression(); } - parseExpected(13 /* SemicolonToken */); - if (token !== 8 /* CloseParenToken */) { + parseExpected(21 /* SemicolonToken */); + if (token !== 16 /* CloseParenToken */) { forStatement.iterator = parseExpression(); } - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forStatement; } - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; forOrForInStatement.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; return finishNode(forOrForInStatement); } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 153 /* BreakStatement */ ? 56 /* BreakKeyword */ : 61 /* ContinueKeyword */); - if (!canParseSemicolon()) + parseExpected(kind === 171 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */); + if (!canParseSemicolon()) { node.label = parseIdentifier(); + } parseSemicolon(); - finishNode(node); - if (!inAmbientContext && errorCountBeforeStatement === file.syntacticErrors.length) { - if (node.label) { - checkBreakOrContinueStatementWithLabel(node); - } - else { - checkBareBreakOrContinueStatement(node); - } - } - return node; - } - function checkBareBreakOrContinueStatement(node) { - if (node.kind === 153 /* BreakStatement */) { - if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */ && inSwitchStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - return; - } - } - else if (node.kind === 152 /* ContinueStatement */) { - if (inIterationStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - return; - } - } - else { - ts.Debug.fail("checkAnonymousBreakOrContinueStatement"); - } - ts.Debug.assert(inIterationStatement === 2 /* CrossingFunctionBoundary */ || inSwitchStatement === 2 /* CrossingFunctionBoundary */); - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - } - function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 152 /* ContinueStatement */, false); - if (nodeIsNestedInLabel === 1 /* Nested */) { - return; - } - if (nodeIsNestedInLabel === 2 /* CrossingFunctionBoundary */) { - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - return; - } - if (node.kind === 152 /* ContinueStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - else if (node.kind === 153 /* BreakStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); - } - else { - ts.Debug.fail("checkBreakOrContinueStatementWithLabel"); - } + return finishNode(node); } function parseReturnStatement() { - var node = createNode(154 /* ReturnStatement */); - var errorCountBeforeReturnStatement = file.syntacticErrors.length; + var node = createNode(172 /* ReturnStatement */); var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; - parseExpected(80 /* ReturnKeyword */); - if (!canParseSemicolon()) + parseExpected(88 /* ReturnKeyword */); + if (!canParseSemicolon()) { node.expression = parseExpression(); - parseSemicolon(); - if (!inFunctionBody && !inAmbientContext && errorCountBeforeReturnStatement === file.syntacticErrors.length) { - grammarErrorAtPos(returnTokenStart, returnTokenLength, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); } + parseSemicolon(); return finishNode(node); } function parseWithStatement() { - var node = createNode(155 /* WithStatement */); - var startPos = scanner.getTokenPos(); - parseExpected(91 /* WithKeyword */); - var endPos = scanner.getStartPos(); - parseExpected(7 /* OpenParenToken */); + var node = createNode(173 /* WithStatement */); + parseExpected(99 /* WithKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); node.statement = parseStatement(); - node = finishNode(node); - if (isInStrictMode) { - grammarErrorAtPos(startPos, endPos - startPos, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - return node; + return finishNode(node); } function parseCaseClause() { - var node = createNode(157 /* CaseClause */); - parseExpected(57 /* CaseKeyword */); + var node = createNode(175 /* CaseClause */); + parseExpected(65 /* CaseKeyword */); node.expression = parseExpression(); - parseExpected(42 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(158 /* DefaultClause */); - parseExpected(63 /* DefaultKeyword */); - parseExpected(42 /* ColonToken */); + var node = createNode(176 /* DefaultClause */); + parseExpected(71 /* DefaultKeyword */); + parseExpected(50 /* ColonToken */); node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 57 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); + return token === 65 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(156 /* SwitchStatement */); - parseExpected(82 /* SwitchKeyword */); - parseExpected(7 /* OpenParenToken */); + var node = createNode(174 /* SwitchStatement */); + parseExpected(90 /* SwitchKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); - parseExpected(5 /* OpenBraceToken */); - var saveInSwitchStatement = inSwitchStatement; - inSwitchStatement = 1 /* Nested */; + parseExpected(16 /* CloseParenToken */); + parseExpected(13 /* OpenBraceToken */); node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); - inSwitchStatement = saveInSwitchStatement; - parseExpected(6 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 158 /* DefaultClause */; }); - for (var i = 1, n = defaultClauses.length; i < n; i++) { - var clause = defaultClauses[i]; - var start = ts.skipTrivia(file.text, clause.pos); - var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; - grammarErrorAtPos(start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - } + parseExpected(14 /* CloseBraceToken */); return finishNode(node); } function parseThrowStatement() { - var node = createNode(160 /* ThrowStatement */); - parseExpected(84 /* ThrowKeyword */); + var node = createNode(178 /* ThrowStatement */); + parseExpected(92 /* ThrowKeyword */); if (scanner.hasPrecedingLineBreak()) { error(ts.Diagnostics.Line_break_not_permitted_here); } @@ -4466,13 +4278,13 @@ var ts; return finishNode(node); } function parseTryStatement() { - var node = createNode(161 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(86 /* TryKeyword */, 162 /* TryBlock */); - if (token === 58 /* CatchKeyword */) { + var node = createNode(179 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(94 /* TryKeyword */, 180 /* TryBlock */); + if (token === 66 /* CatchKeyword */) { node.catchBlock = parseCatchBlock(); } - if (token === 71 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(71 /* FinallyKeyword */, 164 /* FinallyBlock */); + if (token === 79 /* FinallyKeyword */) { + node.finallyBlock = parseTokenAndBlock(79 /* FinallyKeyword */, 182 /* FinallyBlock */); } if (!(node.catchBlock || node.finallyBlock)) { error(ts.Diagnostics.catch_or_finally_expected); @@ -4489,155 +4301,133 @@ var ts; } function parseCatchBlock() { var pos = getNodePos(); - parseExpected(58 /* CatchKeyword */); - parseExpected(7 /* OpenParenToken */); + parseExpected(66 /* CatchKeyword */); + parseExpected(15 /* OpenParenToken */); var variable = parseIdentifier(); - var typeAnnotationColonStart = scanner.getTokenPos(); - var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; var typeAnnotation = parseTypeAnnotation(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); var result = parseBlock(false, false); - result.kind = 163 /* CatchBlock */; + result.kind = 181 /* CatchBlock */; result.pos = pos; result.variable = variable; - if (typeAnnotation) { - errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(variable)) { - reportInvalidUseInStrictMode(variable); - } + result.type = typeAnnotation; return result; } function parseDebuggerStatement() { - var node = createNode(165 /* DebuggerStatement */); - parseExpected(62 /* DebuggerKeyword */); + var node = createNode(183 /* DebuggerStatement */); + parseExpected(70 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); } function isIterationStatementStart() { - return token === 90 /* WhileKeyword */ || token === 65 /* DoKeyword */ || token === 72 /* ForKeyword */; - } - function parseStatementWithLabelSet() { - labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(); - labelledStatementInfo.pop(); - return statement; + return token === 98 /* WhileKeyword */ || token === 73 /* DoKeyword */ || token === 80 /* ForKeyword */; } function isLabel() { - return isIdentifier() && lookAhead(function () { return nextToken() === 42 /* ColonToken */; }); + return isIdentifier() && lookAhead(function () { return nextToken() === 50 /* ColonToken */; }); } - function parseLabelledStatement() { - var node = createNode(159 /* LabelledStatement */); + function parseLabeledStatement() { + var node = createNode(177 /* LabeledStatement */); node.label = parseIdentifier(); - parseExpected(42 /* ColonToken */); - if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { - grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getSourceTextOfNodeFromSourceText(sourceText, node.label)); - } - labelledStatementInfo.addLabel(node.label); - node.statement = isLabel() ? parseLabelledStatement() : parseStatementWithLabelSet(); + parseExpected(50 /* ColonToken */); + node.statement = isLabel() ? parseLabeledStatement() : parseStatement(); return finishNode(node); } function parseExpressionStatement() { - var node = createNode(146 /* ExpressionStatement */); + var node = createNode(164 /* ExpressionStatement */); node.expression = parseExpression(); parseSemicolon(); return finishNode(node); } function isStatement(inErrorRecovery) { switch (token) { - case 13 /* SemicolonToken */: + case 21 /* SemicolonToken */: return !inErrorRecovery; - case 5 /* OpenBraceToken */: - case 88 /* VarKeyword */: - case 73 /* FunctionKeyword */: - case 74 /* IfKeyword */: - case 65 /* DoKeyword */: - case 90 /* WhileKeyword */: - case 72 /* ForKeyword */: - case 61 /* ContinueKeyword */: - case 56 /* BreakKeyword */: - case 80 /* ReturnKeyword */: - case 91 /* WithKeyword */: - case 82 /* SwitchKeyword */: - case 84 /* ThrowKeyword */: - case 86 /* TryKeyword */: - case 62 /* DebuggerKeyword */: - case 58 /* CatchKeyword */: - case 71 /* FinallyKeyword */: + case 13 /* OpenBraceToken */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 81 /* FunctionKeyword */: + case 82 /* IfKeyword */: + case 73 /* DoKeyword */: + case 98 /* WhileKeyword */: + case 80 /* ForKeyword */: + case 69 /* ContinueKeyword */: + case 64 /* BreakKeyword */: + case 88 /* ReturnKeyword */: + case 99 /* WithKeyword */: + case 90 /* SwitchKeyword */: + case 92 /* ThrowKeyword */: + case 94 /* TryKeyword */: + case 70 /* DebuggerKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return true; - case 93 /* InterfaceKeyword */: - case 59 /* ClassKeyword */: - case 106 /* ModuleKeyword */: - case 67 /* EnumKeyword */: - if (isDeclaration()) { + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + return !isConstEnum; + case 101 /* InterfaceKeyword */: + case 67 /* ClassKeyword */: + case 114 /* ModuleKeyword */: + case 75 /* EnumKeyword */: + case 119 /* TypeKeyword */: + if (isDeclarationStart()) { return false; } - case 98 /* PublicKeyword */: - case 96 /* PrivateKeyword */: - case 99 /* StaticKeyword */: - if (lookAhead(function () { return nextToken() >= 55 /* Identifier */; })) { + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + if (lookAhead(function () { return nextToken() >= 63 /* Identifier */; })) { return false; } default: - return isExpression(); + return isStartOfExpression(); } } function parseStatement() { switch (token) { - case 5 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseBlock(false, false); - case 88 /* VarKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: return parseVariableStatement(); - case 73 /* FunctionKeyword */: + case 81 /* FunctionKeyword */: return parseFunctionDeclaration(); - case 13 /* SemicolonToken */: + case 21 /* SemicolonToken */: return parseEmptyStatement(); - case 74 /* IfKeyword */: + case 82 /* IfKeyword */: return parseIfStatement(); - case 65 /* DoKeyword */: + case 73 /* DoKeyword */: return parseDoStatement(); - case 90 /* WhileKeyword */: + case 98 /* WhileKeyword */: return parseWhileStatement(); - case 72 /* ForKeyword */: + case 80 /* ForKeyword */: return parseForOrForInStatement(); - case 61 /* ContinueKeyword */: - return parseBreakOrContinueStatement(152 /* ContinueStatement */); - case 56 /* BreakKeyword */: - return parseBreakOrContinueStatement(153 /* BreakStatement */); - case 80 /* ReturnKeyword */: + case 69 /* ContinueKeyword */: + return parseBreakOrContinueStatement(170 /* ContinueStatement */); + case 64 /* BreakKeyword */: + return parseBreakOrContinueStatement(171 /* BreakStatement */); + case 88 /* ReturnKeyword */: return parseReturnStatement(); - case 91 /* WithKeyword */: + case 99 /* WithKeyword */: return parseWithStatement(); - case 82 /* SwitchKeyword */: + case 90 /* SwitchKeyword */: return parseSwitchStatement(); - case 84 /* ThrowKeyword */: + case 92 /* ThrowKeyword */: return parseThrowStatement(); - case 86 /* TryKeyword */: - case 58 /* CatchKeyword */: - case 71 /* FinallyKeyword */: + case 94 /* TryKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return parseTryStatement(); - case 62 /* DebuggerKeyword */: + case 70 /* DebuggerKeyword */: return parseDebuggerStatement(); default: - if (isLabel()) { - return parseLabelledStatement(); - } - return parseExpressionStatement(); + return isLabel() ? parseLabeledStatement() : parseExpressionStatement(); } } - function parseStatementOrFunction() { - return token === 73 /* FunctionKeyword */ ? parseFunctionDeclaration() : parseStatement(); - } - function parseAndCheckFunctionBody(isConstructor) { - var initialPosition = scanner.getTokenPos(); - var errorCountBeforeBody = file.syntacticErrors.length; - if (token === 5 /* OpenBraceToken */) { - var body = parseBody(false); - if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { - var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; - grammarErrorAtPos(initialPosition, 1, diagnostic); - } - return body; + function parseFunctionBlockOrSemicolon() { + if (token === 13 /* OpenBraceToken */) { + return parseFunctionBlock(false); } if (canParseSemicolon()) { parseSemicolon(); @@ -4646,161 +4436,106 @@ var ts; error(ts.Diagnostics.Block_or_expected); } function parseVariableDeclaration(flags, noIn) { - var node = createNode(166 /* VariableDeclaration */); + var node = createNode(184 /* VariableDeclaration */); node.flags = flags; - var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); node.type = parseTypeAnnotation(); var initializerStart = scanner.getTokenPos(); var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; node.initializer = parseInitializer(false, noIn); - if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } return finishNode(node); } function parseVariableDeclarationList(flags, noIn) { - return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, 0 /* Disallow */); + return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }); } function parseVariableStatement(pos, flags) { - var node = createNode(144 /* VariableStatement */, pos); - if (flags) + var node = createNode(162 /* VariableStatement */, pos); + if (flags) { node.flags = flags; - var errorCountBeforeVarStatement = file.syntacticErrors.length; - parseExpected(88 /* VarKeyword */); - node.declarations = parseVariableDeclarationList(flags, false); - parseSemicolon(); - if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { - grammarErrorOnNode(node, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } + if (token === 102 /* LetKeyword */) { + node.flags |= 2048 /* Let */; + } + else if (token === 68 /* ConstKeyword */) { + node.flags |= 4096 /* Const */; + } + else { + ts.Debug.assert(token === 96 /* VarKeyword */); + } + nextToken(); + node.declarations = parseVariableDeclarationList(node.flags, false); + parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(pos, flags) { - var node = createNode(167 /* FunctionDeclaration */, pos); + var node = createNode(185 /* FunctionDeclaration */, pos); if (flags) node.flags = flags; - parseExpected(73 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); node.name = parseIdentifier(); - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - node.body = parseAndCheckFunctionBody(false); - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } - function parseConstructorDeclaration(pos, flags) { - var node = createNode(117 /* Constructor */, pos); - node.flags = flags; - parseExpected(103 /* ConstructorKeyword */); - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + function parseConstructorDeclaration(pos, modifiers) { + var node = createNode(126 /* Constructor */, pos); + setModifiers(node, modifiers); + parseExpected(111 /* ConstructorKeyword */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - node.body = parseAndCheckFunctionBody(true); - if (node.typeParameters) { - grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - if (node.type) { - grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } - function parsePropertyMemberDeclaration(pos, flags) { - var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; + function parsePropertyMemberDeclaration(pos, modifiers) { var name = parsePropertyName(); + var flags = modifiers ? modifiers.flags : 0; var questionStart = scanner.getTokenPos(); - if (parseOptional(41 /* QuestionToken */)) { - errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); + if (parseOptional(49 /* QuestionToken */)) { + flags |= 4 /* QuestionMark */; } - if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { - var method = createNode(116 /* Method */, pos); - method.flags = flags; + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + var method = createNode(125 /* Method */, pos); + setModifiers(method, modifiers); + if (flags) { + method.flags = flags; + } method.name = name; - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); method.typeParameters = sig.typeParameters; method.parameters = sig.parameters; method.type = sig.type; - method.body = parseAndCheckFunctionBody(false); + method.body = parseFunctionBlockOrSemicolon(); return finishNode(method); } else { - var property = createNode(115 /* Property */, pos); - property.flags = flags; + var property = createNode(124 /* Property */, pos); + setModifiers(property, modifiers); + if (flags) { + property.flags = flags; + } property.name = name; property.type = parseTypeAnnotation(); var initializerStart = scanner.getTokenPos(); var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; property.initializer = parseInitializer(false); parseSemicolon(); - if (inAmbientContext && property.initializer && errorCountBeforePropertyDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } return finishNode(property); } } - function parseAndCheckMemberAccessorDeclaration(kind, pos, flags) { - var errorCountBeforeAccessor = file.syntacticErrors.length; - var accessor = parseMemberAccessorDeclaration(kind, pos, flags); - if (errorCountBeforeAccessor === file.syntacticErrors.length) { - if (languageVersion < 1 /* ES5 */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (inAmbientContext) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); - } - else if (accessor.typeParameters) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); - } - else if (kind === 118 /* GetAccessor */ && accessor.parameters.length) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); - } - else if (kind === 119 /* SetAccessor */) { - if (accessor.type) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - else if (accessor.parameters.length !== 1) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); - } - else { - var parameter = accessor.parameters[0]; - if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - else if (parameter.flags & ts.NodeFlags.Modifier) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - else if (parameter.initializer) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - } - } - return accessor; - } - function parseMemberAccessorDeclaration(kind, pos, flags) { + function parseMemberAccessorDeclaration(kind, pos, modifiers) { var node = createNode(kind, pos); - node.flags = flags; + setModifiers(node, modifiers); node.name = parsePropertyName(); - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - if (inAmbientContext && canParseSemicolon()) { - parseSemicolon(); - node.body = createMissingNode(); - } - else { - node.body = parseBody(false); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } function isClassMemberStart() { @@ -4813,19 +4548,19 @@ var ts; idToken = token; nextToken(); } - if (token === 9 /* OpenBracketToken */) { + if (token === 17 /* OpenBracketToken */) { return true; } if (idToken !== undefined) { - if (!isKeyword(idToken) || idToken === 109 /* SetKeyword */ || idToken === 105 /* GetKeyword */) { + if (!isKeyword(idToken) || idToken === 117 /* SetKeyword */ || idToken === 113 /* GetKeyword */) { return true; } switch (token) { - case 7 /* OpenParenToken */: - case 15 /* LessThanToken */: - case 42 /* ColonToken */: - case 43 /* EqualsToken */: - case 41 /* QuestionToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 50 /* ColonToken */: + case 51 /* EqualsToken */: + case 49 /* QuestionToken */: return true; default: return canParseSemicolon(); @@ -4833,232 +4568,104 @@ var ts; } return false; } - function parseAndCheckModifiers(context) { + function parseModifiers(context) { var flags = 0; - var lastStaticModifierStart; - var lastStaticModifierLength; - var lastDeclareModifierStart; - var lastDeclareModifierLength; - var lastPrivateModifierStart; - var lastPrivateModifierLength; + var modifiers; while (true) { var modifierStart = scanner.getTokenPos(); var modifierToken = token; if (!parseAnyContextualModifier()) break; - var modifierLength = scanner.getStartPos() - modifierStart; - switch (modifierToken) { - case 98 /* PublicKeyword */: - if (flags & 32 /* Private */ || flags & 16 /* Public */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 64 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); - } - flags |= 16 /* Public */; - break; - case 96 /* PrivateKeyword */: - if (flags & 32 /* Private */ || flags & 16 /* Public */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 64 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); - } - lastPrivateModifierStart = modifierStart; - lastPrivateModifierLength = modifierLength; - flags |= 32 /* Private */; - break; - case 99 /* StaticKeyword */: - if (flags & 64 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } - lastStaticModifierStart = modifierStart; - lastStaticModifierLength = modifierLength; - flags |= 64 /* Static */; - break; - case 68 /* ExportKeyword */: - if (flags & 1 /* Export */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); - } - else if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 104 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } - else if (inAmbientContext && context === 1 /* ModuleElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } - lastDeclareModifierStart = modifierStart; - lastDeclareModifierLength = modifierLength; - flags |= 2 /* Ambient */; - break; + if (!modifiers) { + modifiers = []; } + flags |= modifierToFlag(modifierToken); + modifiers.push(finishNode(createNode(modifierToken, modifierStart))); } - if (token === 103 /* ConstructorKeyword */ && flags & 64 /* Static */) { - grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + if (modifiers) { + modifiers.flags = flags; } - else if (token === 103 /* ConstructorKeyword */ && flags & 32 /* Private */) { - grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); - } - else if (token === 75 /* ImportKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } - } - else if (token === 93 /* InterfaceKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); - } - } - else if (token !== 68 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { - var declarationStart = scanner.getTokenPos(); - var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; - grammarErrorAtPos(declarationStart, declarationFirstTokenLength, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - } - return flags; + return modifiers; } function parseClassMemberDeclaration() { var pos = getNodePos(); - var flags = parseAndCheckModifiers(2 /* ClassMembers */); - if (parseContextualModifier(105 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(118 /* GetAccessor */, pos, flags); + var modifiers = parseModifiers(2 /* ClassMembers */); + if (parseContextualModifier(113 /* GetKeyword */)) { + return parseMemberAccessorDeclaration(127 /* GetAccessor */, pos, modifiers); } - if (parseContextualModifier(109 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(119 /* SetAccessor */, pos, flags); + if (parseContextualModifier(117 /* SetKeyword */)) { + return parseMemberAccessorDeclaration(128 /* SetAccessor */, pos, modifiers); } - if (token === 103 /* ConstructorKeyword */) { - return parseConstructorDeclaration(pos, flags); + if (token === 111 /* ConstructorKeyword */) { + return parseConstructorDeclaration(pos, modifiers); } - if (token >= 55 /* Identifier */ || token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */) { - return parsePropertyMemberDeclaration(pos, flags); + if (token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { + return parsePropertyMemberDeclaration(pos, modifiers); } - if (token === 9 /* OpenBracketToken */) { - if (flags) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - return parseIndexSignatureMember(); + if (token === 17 /* OpenBracketToken */) { + return parseIndexSignatureMember(modifiers, pos); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassDeclaration(pos, flags) { - var node = createNode(169 /* ClassDeclaration */, pos); + var node = createNode(187 /* ClassDeclaration */, pos); node.flags = flags; - var errorCountBeforeClassDeclaration = file.syntacticErrors.length; - parseExpected(59 /* ClassKeyword */); + parseExpected(67 /* ClassKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - node.baseType = parseOptional(69 /* ExtendsKeyword */) ? parseTypeReference() : undefined; - var implementsKeywordStart = scanner.getTokenPos(); - var implementsKeywordLength; - if (parseOptional(92 /* ImplementsKeyword */)) { - implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; - node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, 0 /* Disallow */); + node.baseType = parseOptional(77 /* ExtendsKeyword */) ? parseTypeReference() : undefined; + if (parseOptional(100 /* ImplementsKeyword */)) { + node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference); } - var errorCountBeforeClassBody = file.syntacticErrors.length; - if (parseExpected(5 /* OpenBraceToken */)) { + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(6 /* ClassMembers */, false, parseClassMemberDeclaration); - parseExpected(6 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); } - if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { - grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "implements"); - } return finishNode(node); } function parseInterfaceDeclaration(pos, flags) { - var node = createNode(170 /* InterfaceDeclaration */, pos); + var node = createNode(188 /* InterfaceDeclaration */, pos); node.flags = flags; - var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; - parseExpected(93 /* InterfaceKeyword */); + parseExpected(101 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - var extendsKeywordStart = scanner.getTokenPos(); - var extendsKeywordLength; - if (parseOptional(69 /* ExtendsKeyword */)) { - extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; - node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, 0 /* Disallow */); + if (parseOptional(77 /* ExtendsKeyword */)) { + node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference); } - var errorCountBeforeInterfaceBody = file.syntacticErrors.length; node.members = parseTypeLiteral().members; - if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { - grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "extends"); - } + return finishNode(node); + } + function parseTypeAliasDeclaration(pos, flags) { + var node = createNode(189 /* TypeAliasDeclaration */, pos); + node.flags = flags; + parseExpected(119 /* TypeKeyword */); + node.name = parseIdentifier(); + parseExpected(51 /* EqualsToken */); + node.type = parseType(); + parseSemicolon(); return finishNode(node); } function parseAndCheckEnumDeclaration(pos, flags) { - function isIntegerLiteral(expression) { - function isInteger(literalExpression) { - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); - } - if (expression.kind === 138 /* PrefixOperator */) { - var unaryExpression = expression; - if (unaryExpression.operator === 24 /* PlusToken */ || unaryExpression.operator === 25 /* MinusToken */) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 2 /* NumericLiteral */) { - return isInteger(expression); - } - return false; - } - var inConstantEnumMemberSection = true; - function parseAndCheckEnumMember() { - var node = createNode(176 /* EnumMember */); - var errorCountBeforeEnumMember = file.syntacticErrors.length; + var enumIsConst = flags & 4096 /* Const */; + function parseEnumMember() { + var node = createNode(195 /* EnumMember */); node.name = parsePropertyName(); node.initializer = parseInitializer(false); - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); - } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer); - } return finishNode(node); } - var node = createNode(171 /* EnumDeclaration */, pos); + var node = createNode(190 /* EnumDeclaration */, pos); node.flags = flags; - parseExpected(67 /* EnumKeyword */); + if (enumIsConst) { + parseExpected(68 /* ConstKeyword */); + } + parseExpected(75 /* EnumKeyword */); node.name = parseIdentifier(); - if (parseExpected(5 /* OpenBraceToken */)) { - node.members = parseDelimitedList(7 /* EnumMembers */, parseAndCheckEnumMember, 1 /* Allow */); - parseExpected(6 /* CloseBraceToken */); + if (parseExpected(13 /* OpenBraceToken */)) { + node.members = parseDelimitedList(7 /* EnumMembers */, parseEnumMember); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -5066,10 +4673,10 @@ var ts; return finishNode(node); } function parseModuleBody() { - var node = createNode(173 /* ModuleBlock */); - if (parseExpected(5 /* OpenBraceToken */)) { + var node = createNode(192 /* ModuleBlock */); + if (parseExpected(13 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); - parseExpected(6 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -5077,55 +4684,38 @@ var ts; return finishNode(node); } function parseInternalModuleTail(pos, flags) { - var node = createNode(172 /* ModuleDeclaration */, pos); + var node = createNode(191 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseIdentifier(); - if (parseOptional(11 /* DotToken */)) { + if (parseOptional(19 /* DotToken */)) { node.body = parseInternalModuleTail(getNodePos(), 1 /* Export */); } else { node.body = parseModuleBody(); - ts.forEach(node.body.statements, function (s) { - if (s.kind === 175 /* ExportAssignment */) { - grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); - } - else if (s.kind === 174 /* ImportDeclaration */ && s.externalModuleName) { - grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - }); } return finishNode(node); } function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(172 /* ModuleDeclaration */, pos); + var node = createNode(191 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseStringLiteral(); - if (!inAmbientContext) { - var errorCount = file.syntacticErrors.length; - if (!errorCount || file.syntacticErrors[errorCount - 1].start < getTokenPos(pos)) { - grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - var saveInAmbientContext = inAmbientContext; - inAmbientContext = true; node.body = parseModuleBody(); - inAmbientContext = saveInAmbientContext; return finishNode(node); } function parseModuleDeclaration(pos, flags) { - parseExpected(106 /* ModuleKeyword */); - return token === 3 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); + parseExpected(114 /* ModuleKeyword */); + return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); } function parseImportDeclaration(pos, flags) { - var node = createNode(174 /* ImportDeclaration */, pos); + var node = createNode(193 /* ImportDeclaration */, pos); node.flags = flags; - parseExpected(75 /* ImportKeyword */); + parseExpected(83 /* ImportKeyword */); node.name = parseIdentifier(); - parseExpected(43 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); var entityName = parseEntityName(false); - if (entityName.kind === 55 /* Identifier */ && entityName.text === "require" && parseOptional(7 /* OpenParenToken */)) { + if (entityName.kind === 63 /* Identifier */ && entityName.text === "require" && parseOptional(15 /* OpenParenToken */)) { node.externalModuleName = parseStringLiteral(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); } else { node.entityName = entityName; @@ -5133,87 +4723,98 @@ var ts; parseSemicolon(); return finishNode(node); } - function parseExportAssignmentTail(pos) { - var node = createNode(175 /* ExportAssignment */, pos); + function parseExportAssignmentTail(pos, modifiers) { + var node = createNode(194 /* ExportAssignment */, pos); + setModifiers(node, modifiers); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); } - function isDeclaration() { + function isDeclarationStart() { switch (token) { - case 88 /* VarKeyword */: - case 73 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: + case 81 /* FunctionKeyword */: return true; - case 59 /* ClassKeyword */: - case 93 /* InterfaceKeyword */: - case 67 /* EnumKeyword */: - case 75 /* ImportKeyword */: - return lookAhead(function () { return nextToken() >= 55 /* Identifier */; }); - case 106 /* ModuleKeyword */: - return lookAhead(function () { return nextToken() >= 55 /* Identifier */ || token === 3 /* StringLiteral */; }); - case 68 /* ExportKeyword */: - return lookAhead(function () { return nextToken() === 43 /* EqualsToken */ || isDeclaration(); }); - case 104 /* DeclareKeyword */: - case 98 /* PublicKeyword */: - case 96 /* PrivateKeyword */: - case 99 /* StaticKeyword */: + case 67 /* ClassKeyword */: + case 101 /* InterfaceKeyword */: + case 75 /* EnumKeyword */: + case 83 /* ImportKeyword */: + case 119 /* TypeKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */; }); + case 114 /* ModuleKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */ || token === 7 /* StringLiteral */; }); + case 76 /* ExportKeyword */: + return lookAhead(function () { return nextToken() === 51 /* EqualsToken */ || isDeclarationStart(); }); + case 112 /* DeclareKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: return lookAhead(function () { nextToken(); - return isDeclaration(); + return isDeclarationStart(); }); } } function parseDeclaration(modifierContext) { var pos = getNodePos(); - var errorCountBeforeModifiers = file.syntacticErrors.length; - var flags = parseAndCheckModifiers(modifierContext); - if (token === 68 /* ExportKeyword */) { + var modifiers = parseModifiers(modifierContext); + if (token === 76 /* ExportKeyword */) { var modifiersEnd = scanner.getStartPos(); nextToken(); - if (parseOptional(43 /* EqualsToken */)) { - var exportAssignmentTail = parseExportAssignmentTail(pos); - if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { - var modifiersStart = ts.skipTrivia(sourceText, pos); - grammarErrorAtPos(modifiersStart, modifiersEnd - modifiersStart, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); - } - return exportAssignmentTail; + if (parseOptional(51 /* EqualsToken */)) { + return parseExportAssignmentTail(pos, modifiers); } } - var saveInAmbientContext = inAmbientContext; - if (flags & 2 /* Ambient */) { - inAmbientContext = true; - } + var flags = modifiers ? modifiers.flags : 0; var result; switch (token) { - case 88 /* VarKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: result = parseVariableStatement(pos, flags); break; - case 73 /* FunctionKeyword */: + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + if (isConstEnum) { + result = parseAndCheckEnumDeclaration(pos, flags | 4096 /* Const */); + } + else { + result = parseVariableStatement(pos, flags); + } + break; + case 81 /* FunctionKeyword */: result = parseFunctionDeclaration(pos, flags); break; - case 59 /* ClassKeyword */: + case 67 /* ClassKeyword */: result = parseClassDeclaration(pos, flags); break; - case 93 /* InterfaceKeyword */: + case 101 /* InterfaceKeyword */: result = parseInterfaceDeclaration(pos, flags); break; - case 67 /* EnumKeyword */: + case 119 /* TypeKeyword */: + result = parseTypeAliasDeclaration(pos, flags); + break; + case 75 /* EnumKeyword */: result = parseAndCheckEnumDeclaration(pos, flags); break; - case 106 /* ModuleKeyword */: + case 114 /* ModuleKeyword */: result = parseModuleDeclaration(pos, flags); break; - case 75 /* ImportKeyword */: + case 83 /* ImportKeyword */: result = parseImportDeclaration(pos, flags); break; default: error(ts.Diagnostics.Declaration_expected); } - inAmbientContext = saveInAmbientContext; + if (modifiers) { + result.modifiers = modifiers; + } return result; } function isSourceElement(inErrorRecovery) { - return isDeclaration() || isStatement(inErrorRecovery); + return isDeclarationStart() || isStatement(inErrorRecovery); } function parseSourceElement() { return parseSourceElementOrModuleElement(0 /* SourceElements */); @@ -5222,49 +4823,38 @@ var ts; return parseSourceElementOrModuleElement(1 /* ModuleElements */); } function parseSourceElementOrModuleElement(modifierContext) { - if (isDeclaration()) { - return parseDeclaration(modifierContext); - } - var statementStart = scanner.getTokenPos(); - var statementFirstTokenLength = scanner.getTextPos() - statementStart; - var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(); - if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { - grammarErrorAtPos(statementStart, statementFirstTokenLength, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - return statement; + return isDeclarationStart() ? parseDeclaration(modifierContext) : parseStatement(); } function processReferenceComments() { var referencedFiles = []; var amdDependencies = []; + var amdModuleName; commentRanges = []; token = scanner.scan(); for (var i = 0; i < commentRanges.length; i++) { var range = commentRanges[i]; var comment = sourceText.substring(range.pos, range.end); - var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (isNoDefaultLibRegEx.exec(comment)) { - file.hasNoDefaultLib = true; + var referencePathMatchResult = getFileReferenceFromReferencePath(comment, range); + if (referencePathMatchResult) { + var fileReference = referencePathMatchResult.fileReference; + file.hasNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + var diagnostic = referencePathMatchResult.diagnostic; + if (fileReference) { + referencedFiles.push(fileReference); } - else { - var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - if (!matchResult) { - var start = range.pos; - var length = range.end - start; - errorAtPos(start, length, ts.Diagnostics.Invalid_reference_directive_syntax); - } - else { - referencedFiles.push({ - pos: range.pos, - end: range.end, - filename: matchResult[3] - }); - } + if (diagnostic) { + errorAtPos(range.pos, range.end - range.pos, diagnostic); } } else { + var amdModuleNameRegEx = /^\/\/\/\s* 0) { + syntacticDiagnostics = file.parseDiagnostics; + } + else { + syntacticDiagnostics = file.grammarDiagnostics; + checkGrammar(sourceText, languageVersion, file); + } + } + ts.Debug.assert(syntacticDiagnostics !== undefined); + return syntacticDiagnostics; + } + scanner = ts.createScanner(languageVersion, true, sourceText, scanError, onComment); var rootNodeFlags = 0; if (ts.fileExtensionIs(filename, ".d.ts")) { - rootNodeFlags = 512 /* DeclarationFile */; - inAmbientContext = true; + rootNodeFlags = 1024 /* DeclarationFile */; } - file = createRootNode(177 /* SourceFile */, 0, sourceText.length, rootNodeFlags); + file = createRootNode(196 /* SourceFile */, 0, sourceText.length, rootNodeFlags); file.filename = ts.normalizePath(filename); file.text = sourceText; - file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; + file.getLineAndCharacterFromPosition = getLineAndCharacterFromSourcePosition; file.getPositionFromLineAndCharacter = getPositionFromSourceLineAndCharacter; - file.syntacticErrors = []; - file.semanticErrors = []; + file.getLineStarts = getLineStarts; + file.getSyntacticDiagnostics = getSyntacticDiagnostics; + file.parseDiagnostics = []; + file.grammarDiagnostics = []; + file.semanticDiagnostics = []; var referenceComments = processReferenceComments(); file.referencedFiles = referenceComments.referencedFiles; file.amdDependencies = referenceComments.amdDependencies; + file.amdModuleName = referenceComments.amdModuleName; file.statements = parseList(0 /* SourceElements */, true, parseSourceElement); file.externalModuleIndicator = getExternalModuleIndicator(); file.nodeCount = nodeCount; @@ -5304,9 +4912,905 @@ var ts; file.version = version; file.isOpen = isOpen; file.languageVersion = languageVersion; + file.identifiers = identifiers; return file; } ts.createSourceFile = createSourceFile; + function isLeftHandSideExpression(expr) { + if (expr) { + switch (expr.kind) { + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 148 /* NewExpression */: + case 147 /* CallExpression */: + case 149 /* TaggedTemplateExpression */: + case 141 /* ArrayLiteral */: + case 151 /* ParenExpression */: + case 142 /* ObjectLiteral */: + case 152 /* FunctionExpression */: + case 63 /* Identifier */: + case 120 /* Missing */: + case 8 /* RegularExpressionLiteral */: + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 158 /* TemplateExpression */: + case 78 /* FalseKeyword */: + case 87 /* NullKeyword */: + case 91 /* ThisKeyword */: + case 93 /* TrueKeyword */: + case 89 /* SuperKeyword */: + return true; + } + } + return false; + } + function isAssignmentOperator(token) { + return token >= 51 /* FirstAssignment */ && token <= 62 /* LastAssignment */; + } + function checkGrammar(sourceText, languageVersion, file) { + var grammarDiagnostics = file.grammarDiagnostics; + var scanner = ts.createScanner(languageVersion, true, sourceText); + var inAmbientContext = ts.fileExtensionIs(file.filename, ".d.ts"); + var inFunctionBlock = false; + var parent; + visitNode(file); + function visitNode(node) { + var savedParent = parent; + node.parent = parent; + parent = node; + if (!checkModifiers(node)) { + var savedInFunctionBlock = inFunctionBlock; + if (node.kind === 186 /* FunctionBlock */) { + inFunctionBlock = true; + } + var savedInAmbientContext = inAmbientContext; + if (node.flags & 2 /* Ambient */) { + inAmbientContext = true; + } + checkNodeAndChildren(node); + inAmbientContext = savedInAmbientContext; + inFunctionBlock = savedInFunctionBlock; + } + parent = savedParent; + } + function checkNodeAndChildren(node) { + var nodeKind = node.kind; + if (inAmbientContext && checkForStatementInAmbientContext(node, nodeKind)) { + return; + } + if (checkNode(node, nodeKind)) { + return; + } + forEachChild(node, visitNode); + } + function checkNode(node, nodeKind) { + switch (nodeKind) { + case 153 /* ArrowFunction */: + case 129 /* CallSignature */: + case 134 /* ConstructorType */: + case 130 /* ConstructSignature */: + case 133 /* FunctionType */: + return checkAnyParsedSignature(node); + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + return checkBreakOrContinueStatement(node); + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return checkCallOrNewExpression(node); + case 190 /* EnumDeclaration */: return checkEnumDeclaration(node); + case 123 /* Parameter */: return checkParameter(node); + case 156 /* BinaryExpression */: return checkBinaryExpression(node); + case 181 /* CatchBlock */: return checkCatchBlock(node); + case 187 /* ClassDeclaration */: return checkClassDeclaration(node); + case 126 /* Constructor */: return checkConstructor(node); + case 194 /* ExportAssignment */: return checkExportAssignment(node); + case 169 /* ForInStatement */: return checkForInStatement(node); + case 168 /* ForStatement */: return checkForStatement(node); + case 185 /* FunctionDeclaration */: return checkFunctionDeclaration(node); + case 152 /* FunctionExpression */: return checkFunctionExpression(node); + case 127 /* GetAccessor */: return checkGetAccessor(node); + case 146 /* IndexedAccess */: return checkIndexedAccess(node); + case 131 /* IndexSignature */: return checkIndexSignature(node); + case 188 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); + case 177 /* LabeledStatement */: return checkLabeledStatement(node); + case 125 /* Method */: return checkMethod(node); + case 191 /* ModuleDeclaration */: return checkModuleDeclaration(node); + case 142 /* ObjectLiteral */: return checkObjectLiteral(node); + case 6 /* NumericLiteral */: return checkNumericLiteral(node); + case 155 /* PostfixOperator */: return checkPostfixOperator(node); + case 154 /* PrefixOperator */: return checkPrefixOperator(node); + case 124 /* Property */: return checkProperty(node); + case 143 /* PropertyAssignment */: return checkPropertyAssignment(node); + case 172 /* ReturnStatement */: return checkReturnStatement(node); + case 128 /* SetAccessor */: return checkSetAccessor(node); + case 196 /* SourceFile */: return checkSourceFile(node); + case 144 /* ShorthandPropertyAssignment */: return checkShorthandPropertyAssignment(node); + case 174 /* SwitchStatement */: return checkSwitchStatement(node); + case 149 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); + case 138 /* TupleType */: return checkTupleType(node); + case 122 /* TypeParameter */: return checkTypeParameter(node); + case 132 /* TypeReference */: return checkTypeReference(node); + case 184 /* VariableDeclaration */: return checkVariableDeclaration(node); + case 162 /* VariableStatement */: return checkVariableStatement(node); + case 173 /* WithStatement */: return checkWithStatement(node); + } + } + function grammarErrorOnFirstToken(node, message, arg0, arg1, arg2) { + var start = ts.skipTrivia(sourceText, node.pos); + scanner.setTextPos(start); + scanner.scan(); + var end = scanner.getTextPos(); + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, end - start, message, arg0, arg1, arg2)); + return true; + } + function grammarErrorOnNode(node, message, arg0, arg1, arg2) { + var span = getErrorSpanForNode(node); + var start = span.end > span.pos ? ts.skipTrivia(file.text, span.pos) : span.pos; + var length = span.end - start; + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + function reportInvalidUseInStrictMode(node) { + var name = sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); + return grammarErrorOnNode(node, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, name); + } + function checkForStatementInAmbientContext(node, kind) { + switch (kind) { + case 161 /* Block */: + case 163 /* EmptyStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 183 /* DebuggerStatement */: + case 177 /* LabeledStatement */: + case 164 /* ExpressionStatement */: + return grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + } + } + function checkAnyParsedSignature(node) { + return checkTypeParameterList(node.typeParameters) || checkParameterList(node.parameters); + } + function checkBinaryExpression(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + if (isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operator)) { + if (isEvalOrArgumentsIdentifier(node.left)) { + return reportInvalidUseInStrictMode(node.left); + } + } + } + } + function isIterationStatement(node, lookInLabeledStatements) { + switch (node.kind) { + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + return true; + case 177 /* LabeledStatement */: + return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); + } + return false; + } + function checkLabeledStatement(node) { + var current = node.parent; + while (current) { + if (isAnyFunction(current)) { + break; + } + if (current.kind === 177 /* LabeledStatement */ && current.label.text === node.label.text) { + return grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); + } + current = current.parent; + } + } + function checkBreakOrContinueStatement(node) { + var current = node; + while (current) { + if (isAnyFunction(current)) { + return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); + } + switch (current.kind) { + case 177 /* LabeledStatement */: + if (node.label && current.label.text === node.label.text) { + var isMisplacedContinueLabel = node.kind === 170 /* ContinueStatement */ && !isIterationStatement(current.statement, true); + if (isMisplacedContinueLabel) { + return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); + } + return false; + } + break; + case 174 /* SwitchStatement */: + if (node.kind === 171 /* BreakStatement */ && !node.label) { + return false; + } + break; + default: + if (isIterationStatement(current, false) && !node.label) { + return false; + } + break; + } + current = current.parent; + } + if (node.label) { + var message = node.kind === 171 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } + else { + var message = node.kind === 171 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } + } + function checkCallOrNewExpression(node) { + return checkTypeArguments(node.typeArguments) || checkArguments(node.arguments); + } + function checkArguments(arguments) { + return checkForDisallowedTrailingComma(arguments) || checkForOmittedArgument(arguments); + } + function checkTypeArguments(typeArguments) { + return checkForDisallowedTrailingComma(typeArguments) || checkForAtLeastOneTypeArgument(typeArguments) || checkForMissingTypeArgument(typeArguments); + } + function checkForOmittedArgument(arguments) { + if (arguments) { + for (var i = 0, n = arguments.length; i < n; i++) { + var arg = arguments[i]; + if (arg.kind === 160 /* OmittedExpression */) { + return grammarErrorAtPos(arg.pos, 0, ts.Diagnostics.Argument_expression_expected); + } + } + } + } + function checkForMissingTypeArgument(typeArguments) { + if (typeArguments) { + for (var i = 0, n = typeArguments.length; i < n; i++) { + var arg = typeArguments[i]; + if (arg.kind === 120 /* Missing */) { + return grammarErrorAtPos(arg.pos, 0, ts.Diagnostics.Type_expected); + } + } + } + } + function checkForAtLeastOneTypeArgument(typeArguments) { + if (typeArguments && typeArguments.length === 0) { + var start = typeArguments.pos - "<".length; + var end = ts.skipTrivia(sourceText, typeArguments.end) + ">".length; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty); + } + } + function checkForDisallowedTrailingComma(list) { + if (list && list.hasTrailingComma) { + var start = list.end - ",".length; + var end = list.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); + } + } + function checkCatchBlock(node) { + if (node.type) { + var colonStart = ts.skipTrivia(sourceText, node.variable.end); + return grammarErrorAtPos(colonStart, ":".length, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); + } + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.variable)) { + return reportInvalidUseInStrictMode(node.variable); + } + } + function checkClassDeclaration(node) { + return checkForDisallowedTrailingComma(node.implementedTypes) || checkForAtLeastOneHeritageClause(node.implementedTypes, "implements"); + } + function checkForAtLeastOneHeritageClause(types, listType) { + if (types && types.length === 0) { + return grammarErrorAtPos(types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); + } + } + function checkConstructor(node) { + return checkAnyParsedSignature(node) || checkConstructorTypeParameters(node) || checkConstructorTypeAnnotation(node) || checkForBodyInAmbientContext(node.body, true); + } + function checkConstructorTypeParameters(node) { + if (node.typeParameters) { + return grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + } + function checkConstructorTypeAnnotation(node) { + if (node.type) { + return grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + } + function checkEnumDeclaration(enumDecl) { + var enumIsConst = (enumDecl.flags & 4096 /* Const */) !== 0; + var hasError = false; + if (!enumIsConst) { + var inConstantEnumMemberSection = true; + for (var i = 0, n = enumDecl.members.length; i < n; i++) { + var node = enumDecl.members[i]; + if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer)) { + hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers) || hasError; + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection) { + hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer) || hasError; + } + } + } + return hasError; + } + function isIntegerLiteral(expression) { + function isInteger(literalExpression) { + return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); + } + if (expression.kind === 154 /* PrefixOperator */) { + var unaryExpression = expression; + if (unaryExpression.operator === 32 /* PlusToken */ || unaryExpression.operator === 33 /* MinusToken */) { + expression = unaryExpression.operand; + } + } + if (expression.kind === 6 /* NumericLiteral */) { + return isInteger(expression); + } + return false; + } + function checkExportAssignment(node) { + if (node.flags & 243 /* Modifier */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); + } + } + function checkForInStatement(node) { + return checkVariableDeclarations(node.declarations) || checkForMoreThanOneDeclaration(node.declarations); + } + function checkForStatement(node) { + return checkVariableDeclarations(node.declarations); + } + function checkForMoreThanOneDeclaration(declarations) { + if (declarations && declarations.length > 1) { + return grammarErrorOnFirstToken(declarations[1], ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + } + } + function checkFunctionDeclaration(node) { + return checkAnyParsedSignature(node) || checkFunctionName(node.name) || checkForBodyInAmbientContext(node.body, false); + } + function checkFunctionExpression(node) { + return checkAnyParsedSignature(node) || checkFunctionName(node.name); + } + function checkFunctionName(name) { + if (name && name.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(name)) { + return reportInvalidUseInStrictMode(name); + } + } + function checkGetAccessor(node) { + return checkAnyParsedSignature(node) || checkAccessor(node); + } + function checkIndexedAccess(node) { + if (node.index.kind === 120 /* Missing */ && node.parent.kind === 148 /* NewExpression */ && node.parent.func === node) { + var start = ts.skipTrivia(sourceText, node.parent.pos); + var end = node.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + } + function checkIndexSignature(node) { + return checkIndexSignatureParameters(node) || checkForIndexSignatureModifiers(node); + } + function checkForIndexSignatureModifiers(node) { + if (node.flags & 243 /* Modifier */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); + } + } + function checkIndexSignatureParameters(node) { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + if (parameter) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + else { + return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + } + else if (parameter.flags & 8 /* Rest */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + } + else if (parameter.flags & 243 /* Modifier */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + } + else if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + } + else if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + } + else if (!parameter.type) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + } + else if (parameter.type.kind !== 118 /* StringKeyword */ && parameter.type.kind !== 116 /* NumberKeyword */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); + } + else if (!node.type) { + return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); + } + } + function checkInterfaceDeclaration(node) { + return checkForDisallowedTrailingComma(node.baseTypes) || checkForAtLeastOneHeritageClause(node.baseTypes, "extends"); + } + function checkMethod(node) { + return checkAnyParsedSignature(node) || checkForBodyInAmbientContext(node.body, false) || (node.parent.kind === 187 /* ClassDeclaration */ && checkForInvalidQuestionMark(node, ts.Diagnostics.A_class_member_cannot_be_declared_optional)); + } + function checkForBodyInAmbientContext(body, isConstructor) { + if (inAmbientContext && body && body.kind === 186 /* FunctionBlock */) { + var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; + return grammarErrorOnFirstToken(body, diagnostic); + } + } + function checkModuleDeclaration(node) { + return checkModuleDeclarationName(node) || checkModuleDeclarationStatements(node); + } + function checkModuleDeclarationName(node) { + if (!inAmbientContext && node.name.kind === 7 /* StringLiteral */) { + return grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); + } + } + function checkModuleDeclarationStatements(node) { + if (node.name.kind === 63 /* Identifier */ && node.body.kind === 192 /* ModuleBlock */) { + var statements = node.body.statements; + for (var i = 0, n = statements.length; i < n; i++) { + var statement = statements[i]; + if (statement.kind === 194 /* ExportAssignment */) { + return grammarErrorOnNode(statement, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + } + else if (statement.kind === 193 /* ImportDeclaration */ && statement.externalModuleName) { + return grammarErrorOnNode(statement.externalModuleName, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + } + } + } + } + function checkObjectLiteral(node) { + var seen = {}; + var Property = 1; + var GetAccessor = 2; + var SetAccesor = 4; + var GetOrSetAccessor = GetAccessor | SetAccesor; + var inStrictMode = (node.flags & 8192 /* ParsedInStrictMode */) !== 0; + for (var i = 0, n = node.properties.length; i < n; i++) { + var prop = node.properties[i]; + if (prop.kind === 160 /* OmittedExpression */) { + continue; + } + var p = prop; + var name = p.name; + var currentKind; + if (p.kind === 143 /* PropertyAssignment */) { + currentKind = Property; + } + else if (p.kind === 144 /* ShorthandPropertyAssignment */) { + currentKind = Property; + } + else if (p.kind === 127 /* GetAccessor */) { + currentKind = GetAccessor; + } + else if (p.kind === 128 /* SetAccessor */) { + currentKind = SetAccesor; + } + else { + ts.Debug.fail("Unexpected syntax kind:" + p.kind); + } + if (!ts.hasProperty(seen, name.text)) { + seen[name.text] = currentKind; + } + else { + var existingKind = seen[name.text]; + if (currentKind === Property && existingKind === Property) { + if (inStrictMode) { + grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + } + } + else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { + if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { + seen[name.text] = currentKind | existingKind; + } + else { + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + } + } + else { + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + } + } + } + } + function checkNumericLiteral(node) { + if (node.flags & 16384 /* OctalLiteral */) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); + } + else if (languageVersion >= 1 /* ES5 */) { + return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + } + } + } + function checkModifiers(node) { + switch (node.kind) { + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + case 124 /* Property */: + case 125 /* Method */: + case 131 /* IndexSignature */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 191 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + case 194 /* ExportAssignment */: + case 162 /* VariableStatement */: + case 185 /* FunctionDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 193 /* ImportDeclaration */: + case 123 /* Parameter */: + break; + default: + return false; + } + if (!node.modifiers) { + return; + } + var lastStatic, lastPrivate, lastProtected, lastDeclare; + var flags = 0; + for (var i = 0, n = node.modifiers.length; i < n; i++) { + var modifier = node.modifiers[i]; + switch (modifier.kind) { + case 106 /* PublicKeyword */: + case 105 /* ProtectedKeyword */: + case 104 /* PrivateKeyword */: + var text; + if (modifier.kind === 106 /* PublicKeyword */) { + text = "public"; + } + else if (modifier.kind === 105 /* ProtectedKeyword */) { + text = "protected"; + lastProtected = modifier; + } + else { + text = "private"; + lastPrivate = modifier; + } + if (flags & 112 /* AccessibilityModifier */) { + return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & 128 /* Static */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } + else if (node.parent.kind === 192 /* ModuleBlock */ || node.parent.kind === 196 /* SourceFile */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); + } + flags |= modifierToFlag(modifier.kind); + break; + case 107 /* StaticKeyword */: + if (flags & 128 /* Static */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); + } + else if (node.parent.kind === 192 /* ModuleBlock */ || node.parent.kind === 196 /* SourceFile */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } + flags |= 128 /* Static */; + lastStatic = modifier; + break; + case 76 /* ExportKeyword */: + if (flags & 1 /* Export */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); + } + else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } + else if (node.parent.kind === 187 /* ClassDeclaration */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= 1 /* Export */; + break; + case 112 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); + } + else if (node.parent.kind === 187 /* ClassDeclaration */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } + else if (inAmbientContext && node.parent.kind === 192 /* ModuleBlock */) { + return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } + flags |= 2 /* Ambient */; + lastDeclare = modifier; + break; + } + } + if (node.kind === 126 /* Constructor */) { + if (flags & 128 /* Static */) { + return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + else if (flags & 64 /* Protected */) { + return grammarErrorOnNode(lastProtected, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); + } + else if (flags & 32 /* Private */) { + return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); + } + } + else if (node.kind === 193 /* ImportDeclaration */ && flags & 2 /* Ambient */) { + return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } + else if (node.kind === 188 /* InterfaceDeclaration */ && flags & 2 /* Ambient */) { + return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); + } + } + function checkParameter(node) { + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.name)) { + return reportInvalidUseInStrictMode(node.name); + } + } + function checkTypeParameterList(typeParameters) { + if (checkForDisallowedTrailingComma(typeParameters)) { + return true; + } + if (typeParameters && typeParameters.length === 0) { + var start = typeParameters.pos - "<".length; + var end = ts.skipTrivia(sourceText, typeParameters.end) + ">".length; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); + } + } + function checkParameterList(parameters) { + if (checkForDisallowedTrailingComma(parameters)) { + return true; + } + var seenOptionalParameter = false; + var parameterCount = parameters.length; + for (var i = 0; i < parameterCount; i++) { + var parameter = parameters[i]; + if (parameter.flags & 8 /* Rest */) { + if (i !== (parameterCount - 1)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); + } + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); + } + } + else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { + seenOptionalParameter = true; + if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + } + } + else { + if (seenOptionalParameter) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + } + } + } + } + function checkPostfixOperator(node) { + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + } + function checkPrefixOperator(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + if ((node.operator === 37 /* PlusPlusToken */ || node.operator === 38 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + else if (node.operator === 72 /* DeleteKeyword */ && node.operand.kind === 63 /* Identifier */) { + return grammarErrorOnNode(node.operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); + } + } + } + function checkProperty(node) { + return (node.parent.kind === 187 /* ClassDeclaration */ && checkForInvalidQuestionMark(node, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) || checkForInitializerInAmbientContext(node); + } + function checkForInitializerInAmbientContext(node) { + if (inAmbientContext && node.initializer) { + return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + function checkPropertyAssignment(node) { + return checkForInvalidQuestionMark(node, ts.Diagnostics.An_object_member_cannot_be_declared_optional); + } + function checkForInvalidQuestionMark(node, message) { + if (node.flags & 4 /* QuestionMark */) { + var pos = ts.skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(pos, "?".length, message); + } + } + function checkReturnStatement(node) { + if (!inFunctionBlock) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + } + } + function checkSetAccessor(node) { + return checkAnyParsedSignature(node) || checkAccessor(node); + } + function checkAccessor(accessor) { + var kind = accessor.kind; + if (languageVersion < 1 /* ES5 */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (inAmbientContext) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); + } + else if (accessor.body === undefined) { + return grammarErrorAtPos(accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } + else if (accessor.typeParameters) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); + } + else if (kind === 127 /* GetAccessor */ && accessor.parameters.length) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); + } + else if (kind === 128 /* SetAccessor */) { + if (accessor.type) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + else if (accessor.parameters.length !== 1) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + else { + var parameter = accessor.parameters[0]; + if (parameter.flags & 8 /* Rest */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + else if (parameter.flags & 243 /* Modifier */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + else if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + else if (parameter.initializer) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + } + } + function checkSourceFile(node) { + return inAmbientContext && checkTopLevelElementsForRequiredDeclareModifier(file); + } + function checkTopLevelElementsForRequiredDeclareModifier(file) { + for (var i = 0, n = file.statements.length; i < n; i++) { + var decl = file.statements[i]; + if (isDeclaration(decl) || decl.kind === 162 /* VariableStatement */) { + if (checkTopLevelElementForRequiredDeclareModifier(decl)) { + return true; + } + } + } + } + function checkTopLevelElementForRequiredDeclareModifier(node) { + if (node.kind === 188 /* InterfaceDeclaration */ || node.kind === 193 /* ImportDeclaration */ || node.kind === 194 /* ExportAssignment */ || (node.flags & 2 /* Ambient */)) { + return false; + } + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + } + function checkShorthandPropertyAssignment(node) { + return checkForInvalidQuestionMark(node, ts.Diagnostics.An_object_member_cannot_be_declared_optional); + } + function checkSwitchStatement(node) { + var firstDefaultClause; + for (var i = 0, n = node.clauses.length; i < n; i++) { + var clause = node.clauses[i]; + if (clause.kind === 176 /* DefaultClause */) { + if (firstDefaultClause === undefined) { + firstDefaultClause = clause; + } + else { + var start = ts.skipTrivia(file.text, clause.pos); + var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); + } + } + } + } + function checkTaggedTemplateExpression(node) { + if (languageVersion < 2 /* ES6 */) { + return grammarErrorOnFirstToken(node.template, ts.Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + function checkTupleType(node) { + return checkForDisallowedTrailingComma(node.elementTypes) || checkForAtLeastOneType(node); + } + function checkForAtLeastOneType(node) { + if (node.elementTypes.length === 0) { + return grammarErrorOnNode(node, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); + } + } + function checkTypeParameter(node) { + if (node.expression) { + return grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); + } + } + function checkTypeReference(node) { + return checkTypeArguments(node.typeArguments); + } + function checkVariableDeclaration(node) { + if (inAmbientContext && node.initializer) { + var equalsPos = node.type ? ts.skipTrivia(sourceText, node.type.end) : ts.skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(equalsPos, "=".length, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + if (!inAmbientContext && !node.initializer && node.flags & 4096 /* Const */) { + return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); + } + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.name)) { + return reportInvalidUseInStrictMode(node.name); + } + } + function checkVariableDeclarations(declarations) { + if (declarations) { + if (checkForDisallowedTrailingComma(declarations)) { + return true; + } + if (!declarations.length) { + return grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + var decl = declarations[0]; + if (languageVersion < 2 /* ES6 */) { + if (decl.flags & 2048 /* Let */) { + return grammarErrorOnFirstToken(decl, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (decl.flags & 4096 /* Const */) { + return grammarErrorOnFirstToken(decl, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + } + } + function checkVariableStatement(node) { + return checkVariableDeclarations(node.declarations) || checkForDisallowedLetOrConstStatement(node); + } + function checkForDisallowedLetOrConstStatement(node) { + if (!allowLetAndConstDeclarations(node.parent)) { + if (node.flags & 2048 /* Let */) { + return grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (node.flags & 4096 /* Const */) { + return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } + } + function allowLetAndConstDeclarations(parent) { + switch (parent.kind) { + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 173 /* WithStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + return false; + case 177 /* LabeledStatement */: + return allowLetAndConstDeclarations(parent.parent); + } + return true; + } + function checkWithStatement(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + } function createProgram(rootNames, options, host) { var program; var files = []; @@ -5352,34 +5856,46 @@ var ts; var start = refPos; var length = refEnd - refPos; } + var diagnostic; if (hasExtension(filename)) { if (!ts.fileExtensionIs(filename, ".ts")) { - errors.push(ts.createFileDiagnostic(refFile, start, length, ts.Diagnostics.File_0_must_have_extension_ts_or_d_ts, filename)); + diagnostic = ts.Diagnostics.File_0_must_have_extension_ts_or_d_ts; } else if (!findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) { - errors.push(ts.createFileDiagnostic(refFile, start, length, ts.Diagnostics.File_0_not_found, filename)); + diagnostic = ts.Diagnostics.File_0_not_found; + } + else if (refFile && host.getCanonicalFileName(filename) === host.getCanonicalFileName(refFile.filename)) { + diagnostic = ts.Diagnostics.A_file_cannot_have_a_reference_to_itself; } } else { if (!(findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) || findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd))) { - errors.push(ts.createFileDiagnostic(refFile, start, length, ts.Diagnostics.File_0_not_found, filename + ".ts")); + diagnostic = ts.Diagnostics.File_0_not_found; + filename += ".ts"; + } + } + if (diagnostic) { + if (refFile) { + errors.push(ts.createFileDiagnostic(refFile, start, length, diagnostic, filename)); + } + else { + errors.push(ts.createCompilerDiagnostic(diagnostic, filename)); } } } function findSourceFile(filename, isDefaultLib, refFile, refStart, refLength) { var canonicalName = host.getCanonicalFileName(filename); - var file = getSourceFile(filename); - if (file) { - if (host.useCaseSensitiveFileNames() && canonicalName !== file.filename) { + if (ts.hasProperty(filesByName, canonicalName)) { + var file = filesByName[canonicalName]; + if (file && host.useCaseSensitiveFileNames() && canonicalName !== file.filename) { errors.push(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Filename_0_differs_from_already_included_filename_1_only_in_casing, filename, file.filename)); } } else { - file = host.getSourceFile(filename, options.target, function (hostErrorMessage) { + var file = filesByName[canonicalName] = host.getSourceFile(filename, options.target, function (hostErrorMessage) { errors.push(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Cannot_read_file_0_Colon_1, filename, hostErrorMessage)); }); if (file) { - filesByName[host.getCanonicalFileName(filename)] = file; seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; if (!options.noResolve) { var basePath = ts.getDirectoryPath(filename); @@ -5392,7 +5908,7 @@ var ts; else { files.push(file); } - ts.forEach(file.syntacticErrors, function (e) { + ts.forEach(file.getSyntacticDiagnostics(), function (e) { errors.push(e); }); } @@ -5401,12 +5917,13 @@ var ts; } function processReferencedFiles(file, basePath) { ts.forEach(file.referencedFiles, function (ref) { - processSourceFile(ts.normalizePath(ts.combinePaths(basePath, ref.filename)), false, file, ref.pos, ref.end); + var referencedFilename = ts.isRootedDiskPath(ref.filename) ? ref.filename : ts.combinePaths(basePath, ref.filename); + processSourceFile(ts.normalizePath(referencedFilename), false, file, ref.pos, ref.end); }); } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 174 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 193 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5424,9 +5941,9 @@ var ts; } } } - else if (node.kind === 172 /* ModuleDeclaration */ && node.name.kind === 3 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || file.flags & 512 /* DeclarationFile */)) { + else if (node.kind === 191 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { forEachChild(node.body, function (node) { - if (node.kind === 174 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 193 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5464,12 +5981,12 @@ var ts; if (options.outDir || options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModule !== undefined))) { var commonPathComponents; ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 512 /* DeclarationFile */) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { - var sourcePathCompoments = ts.getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); - sourcePathCompoments.pop(); + if (!(sourceFile.flags & 1024 /* DeclarationFile */) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { + var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); + sourcePathComponents.pop(); if (commonPathComponents) { - for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathCompoments.length); i++) { - if (commonPathComponents[i] !== sourcePathCompoments[i]) { + for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { if (i === 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); return; @@ -5478,16 +5995,16 @@ var ts; break; } } - if (sourcePathCompoments.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathCompoments.length; + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; } } else { - commonPathComponents = sourcePathCompoments; + commonPathComponents = sourcePathComponents; } } }); - commonSourceDirectory = ts.getNormalizedPathFromPathCompoments(commonPathComponents); + commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents); if (commonSourceDirectory) { commonSourceDirectory += ts.directorySeparator; } @@ -5498,33 +6015,50 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function isInstantiated(node) { - if (node.kind === 170 /* InterfaceDeclaration */) { - return false; + function getModuleInstanceState(node) { + if (node.kind === 188 /* InterfaceDeclaration */) { + return 0 /* NonInstantiated */; } - else if (node.kind === 174 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { - return false; + else if (node.kind === 190 /* EnumDeclaration */ && ts.isConstEnumDeclaration(node)) { + return 2 /* ConstEnumOnly */; } - else if (node.kind === 173 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { - return false; + else if (node.kind === 193 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + return 0 /* NonInstantiated */; } - else if (node.kind === 172 /* ModuleDeclaration */ && !isInstantiated(node.body)) { - return false; + else if (node.kind === 192 /* ModuleBlock */) { + var state = 0 /* NonInstantiated */; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0 /* NonInstantiated */: + return false; + case 2 /* ConstEnumOnly */: + state = 2 /* ConstEnumOnly */; + return false; + case 1 /* Instantiated */: + state = 1 /* Instantiated */; + return true; + } + }); + return state; + } + else if (node.kind === 191 /* ModuleDeclaration */) { + return getModuleInstanceState(node.body); } else { - return true; + return 1 /* Instantiated */; } } - ts.isInstantiated = isInstantiated; + ts.getModuleInstanceState = getModuleInstanceState; function bindSourceFile(file) { var parent; var container; + var blockScopeContainer; var lastContainer; var symbolCount = 0; var Symbol = ts.objectAllocator.getSymbolConstructor(); if (!file.locals) { file.locals = {}; - container = file; + container = blockScopeContainer = file; bind(file); file.symbolCount = symbolCount; } @@ -5537,34 +6071,36 @@ var ts; if (!symbol.declarations) symbol.declarations = []; symbol.declarations.push(node); - if (symbolKind & ts.SymbolFlags.HasExports && !symbol.exports) + if (symbolKind & 1952 /* HasExports */ && !symbol.exports) symbol.exports = {}; - if (symbolKind & ts.SymbolFlags.HasMembers && !symbol.members) + if (symbolKind & 6240 /* HasMembers */ && !symbol.members) symbol.members = {}; node.symbol = symbol; - if (symbolKind & ts.SymbolFlags.Value && !symbol.valueDeclaration) + if (symbolKind & 107455 /* Value */ && !symbol.valueDeclaration) symbol.valueDeclaration = node; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 172 /* ModuleDeclaration */ && node.name.kind === 3 /* StringLiteral */) { + if (node.kind === 191 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { return '"' + node.name.text + '"'; } return node.name.text; } switch (node.kind) { - case 117 /* Constructor */: + case 134 /* ConstructorType */: + case 126 /* Constructor */: return "__constructor"; - case 120 /* CallSignature */: + case 133 /* FunctionType */: + case 129 /* CallSignature */: return "__call"; - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: return "__new"; - case 122 /* IndexSignature */: + case 131 /* IndexSignature */: return "__index"; } } function getDisplayName(node) { - return node.name ? ts.identifierToString(node.name) : getDeclarationName(node); + return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); } function declareSymbol(symbols, parent, node, includes, excludes) { var name = getDeclarationName(node); @@ -5574,7 +6110,11 @@ var ts; if (node.name) { node.name.parent = node; } - file.semanticErrors.push(ts.createDiagnosticForNode(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(node))); + var message = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + ts.forEach(symbol.declarations, function (declaration) { + file.semanticDiagnostics.push(ts.createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); + }); + file.semanticDiagnostics.push(ts.createDiagnosticForNode(node.name, message, getDisplayName(node))); symbol = createSymbol(0, name); } } @@ -5583,13 +6123,13 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 169 /* ClassDeclaration */ && symbol.exports) { - var prototypeSymbol = createSymbol(2 /* Property */ | 67108864 /* Prototype */, "prototype"); + if (node.kind === 187 /* ClassDeclaration */ && symbol.exports) { + var prototypeSymbol = createSymbol(4 /* Property */ | 536870912 /* Prototype */, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { node.name.parent = node; } - file.semanticErrors.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + file.semanticDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } symbol.exports[prototypeSymbol.name] = prototypeSymbol; prototypeSymbol.parent = symbol; @@ -5606,16 +6146,16 @@ var ts; } function declareModuleMember(node, symbolKind, symbolExcludes) { var exportKind = 0; - if (symbolKind & ts.SymbolFlags.Value) { - exportKind |= 524288 /* ExportValue */; + if (symbolKind & 107455 /* Value */) { + exportKind |= 4194304 /* ExportValue */; } - if (symbolKind & ts.SymbolFlags.Type) { - exportKind |= 1048576 /* ExportType */; + if (symbolKind & 3152352 /* Type */) { + exportKind |= 8388608 /* ExportType */; } - if (symbolKind & ts.SymbolFlags.Namespace) { - exportKind |= 2097152 /* ExportNamespace */; + if (symbolKind & 1536 /* Namespace */) { + exportKind |= 16777216 /* ExportNamespace */; } - if (node.flags & 1 /* Export */ || (node.kind !== 174 /* ImportDeclaration */ && isAmbientContext(container))) { + if (node.flags & 1 /* Export */ || (node.kind !== 193 /* ImportDeclaration */ && isAmbientContext(container))) { if (exportKind) { var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); @@ -5629,14 +6169,15 @@ var ts; declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); } } - function bindChildren(node, symbolKind) { - if (symbolKind & ts.SymbolFlags.HasLocals) { + function bindChildren(node, symbolKind, isBlockScopeContainer) { + if (symbolKind & 1041936 /* HasLocals */) { node.locals = {}; } var saveParent = parent; var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; parent = node; - if (symbolKind & ts.SymbolFlags.IsContainer) { + if (symbolKind & 1048560 /* IsContainer */) { container = node; if (lastContainer !== container && !container.nextContainer) { if (lastContainer) { @@ -5645,156 +6186,228 @@ var ts; lastContainer = container; } } + if (isBlockScopeContainer) { + blockScopeContainer = node; + } ts.forEachChild(node, bind); container = saveContainer; parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; } - function bindDeclaration(node, symbolKind, symbolExcludes) { + function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 177 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 120 /* CallSignature */: - case 121 /* ConstructSignature */: - case 122 /* IndexSignature */: - case 116 /* Method */: - case 117 /* Constructor */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 169 /* ClassDeclaration */: - if (node.flags & 64 /* Static */) { + case 187 /* ClassDeclaration */: + if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 125 /* TypeLiteral */: - case 128 /* ObjectLiteral */: - case 170 /* InterfaceDeclaration */: + case 136 /* TypeLiteral */: + case 142 /* ObjectLiteral */: + case 188 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 171 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindConstructorDeclaration(node) { - bindDeclaration(node, 4096 /* Constructor */, 0); + bindDeclaration(node, 16384 /* Constructor */, 0, true); ts.forEach(node.parameters, function (p) { - if (p.flags & (16 /* Public */ | 32 /* Private */)) { - bindDeclaration(p, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + if (p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */)) { + bindDeclaration(p, 4 /* Property */, 107455 /* PropertyExcludes */, false); } }); } function bindModuleDeclaration(node) { - if (node.name.kind === 3 /* StringLiteral */) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); - } - else if (isInstantiated(node)) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + if (node.name.kind === 7 /* StringLiteral */) { + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); } else { - bindDeclaration(node, 256 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + var state = getModuleInstanceState(node); + if (state === 0 /* NonInstantiated */) { + bindDeclaration(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); + } + else { + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); + if (state === 2 /* ConstEnumOnly */) { + node.symbol.constEnumOnlyModule = true; + } + else if (node.symbol.constEnumOnlyModule) { + node.symbol.constEnumOnlyModule = false; + } + } } } - function bindAnonymousDeclaration(node, symbolKind, name) { + function bindFunctionOrConstructorType(node) { + var symbolKind = node.kind === 133 /* FunctionType */ ? 131072 /* CallSignature */ : 262144 /* ConstructSignature */; + var symbol = createSymbol(symbolKind, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, symbolKind); + bindChildren(node, symbolKind, false); + var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); + typeLiteralSymbol.members = {}; + typeLiteralSymbol.members[node.kind === 133 /* FunctionType */ ? "__call" : "__new"] = symbol; + } + function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindCatchVariableDeclaration(node) { - var symbol = createSymbol(1 /* Variable */, node.variable.text || "__missing"); - addDeclarationToSymbol(symbol, node, 1 /* Variable */); + var symbol = createSymbol(1 /* FunctionScopedVariable */, node.variable.text || "__missing"); + addDeclarationToSymbol(symbol, node, 1 /* FunctionScopedVariable */); var saveParent = parent; - parent = node; + var savedBlockScopeContainer = blockScopeContainer; + parent = blockScopeContainer = node; ts.forEachChild(node, bind); parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + function bindBlockScopedVariableDeclaration(node) { + switch (blockScopeContainer.kind) { + case 191 /* ModuleDeclaration */: + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + break; + case 196 /* SourceFile */: + if (ts.isExternalModule(container)) { + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + } + declareSymbol(blockScopeContainer.locals, undefined, node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + } + bindChildren(node, 2 /* BlockScopedVariable */, false); } function bind(node) { node.parent = parent; switch (node.kind) { - case 113 /* TypeParameter */: - bindDeclaration(node, 262144 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes); + case 122 /* TypeParameter */: + bindDeclaration(node, 1048576 /* TypeParameter */, 2103776 /* TypeParameterExcludes */, false); break; - case 114 /* Parameter */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.ParameterExcludes); + case 123 /* Parameter */: + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */, false); break; - case 166 /* VariableDeclaration */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.VariableExcludes); + case 184 /* VariableDeclaration */: + if (node.flags & 6144 /* BlockScoped */) { + bindBlockScopedVariableDeclaration(node); + } + else { + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */, false); + } break; - case 115 /* Property */: - case 129 /* PropertyAssignment */: - bindDeclaration(node, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + case 124 /* Property */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + bindDeclaration(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 176 /* EnumMember */: - bindDeclaration(node, 4 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes); + case 195 /* EnumMember */: + bindDeclaration(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; - case 120 /* CallSignature */: - bindDeclaration(node, 32768 /* CallSignature */, 0); + case 129 /* CallSignature */: + bindDeclaration(node, 131072 /* CallSignature */, 0, false); break; - case 116 /* Method */: - bindDeclaration(node, 2048 /* Method */, ts.SymbolFlags.MethodExcludes); + case 130 /* ConstructSignature */: + bindDeclaration(node, 262144 /* ConstructSignature */, 0, true); break; - case 121 /* ConstructSignature */: - bindDeclaration(node, 65536 /* ConstructSignature */, 0); + case 125 /* Method */: + bindDeclaration(node, 8192 /* Method */, 99263 /* MethodExcludes */, true); break; - case 122 /* IndexSignature */: - bindDeclaration(node, 131072 /* IndexSignature */, 0); + case 131 /* IndexSignature */: + bindDeclaration(node, 524288 /* IndexSignature */, 0, false); break; - case 167 /* FunctionDeclaration */: - bindDeclaration(node, 8 /* Function */, ts.SymbolFlags.FunctionExcludes); + case 185 /* FunctionDeclaration */: + bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; - case 117 /* Constructor */: + case 126 /* Constructor */: bindConstructorDeclaration(node); break; - case 118 /* GetAccessor */: - bindDeclaration(node, 8192 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes); + case 127 /* GetAccessor */: + bindDeclaration(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */, true); break; - case 119 /* SetAccessor */: - bindDeclaration(node, 16384 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes); + case 128 /* SetAccessor */: + bindDeclaration(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 125 /* TypeLiteral */: - bindAnonymousDeclaration(node, 512 /* TypeLiteral */, "__type"); + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + bindFunctionOrConstructorType(node); break; - case 128 /* ObjectLiteral */: - bindAnonymousDeclaration(node, 1024 /* ObjectLiteral */, "__object"); + case 136 /* TypeLiteral */: + bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: - bindAnonymousDeclaration(node, 8 /* Function */, "__function"); + case 142 /* ObjectLiteral */: + bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 163 /* CatchBlock */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); + break; + case 181 /* CatchBlock */: bindCatchVariableDeclaration(node); break; - case 169 /* ClassDeclaration */: - bindDeclaration(node, 16 /* Class */, ts.SymbolFlags.ClassExcludes); + case 187 /* ClassDeclaration */: + bindDeclaration(node, 32 /* Class */, 3258879 /* ClassExcludes */, false); break; - case 170 /* InterfaceDeclaration */: - bindDeclaration(node, 32 /* Interface */, ts.SymbolFlags.InterfaceExcludes); + case 188 /* InterfaceDeclaration */: + bindDeclaration(node, 64 /* Interface */, 3152288 /* InterfaceExcludes */, false); break; - case 171 /* EnumDeclaration */: - bindDeclaration(node, 64 /* Enum */, ts.SymbolFlags.EnumExcludes); + case 189 /* TypeAliasDeclaration */: + bindDeclaration(node, 2097152 /* TypeAlias */, 3152352 /* TypeAliasExcludes */, false); break; - case 172 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + if (ts.isConstEnumDeclaration(node)) { + bindDeclaration(node, 128 /* ConstEnum */, 3259263 /* ConstEnumExcludes */, false); + } + else { + bindDeclaration(node, 256 /* RegularEnum */, 3258623 /* RegularEnumExcludes */, false); + } + break; + case 191 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 174 /* ImportDeclaration */: - bindDeclaration(node, 4194304 /* Import */, ts.SymbolFlags.ImportExcludes); + case 193 /* ImportDeclaration */: + bindDeclaration(node, 33554432 /* Import */, 33554432 /* ImportExcludes */, false); break; - case 177 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 128 /* ValueModule */, '"' + ts.getModuleNameFromFilename(node.filename) + '"'); + bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); break; } + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 174 /* SwitchStatement */: + bindChildren(node, 0, true); + break; default: var saveParent = parent; parent = node; @@ -5814,10 +6427,25 @@ var ts; } return indentStrings[level]; } + ts.getIndentString = getIndentString; function getIndentSize() { return indentStrings[1].length; } - function emitFiles(resolver) { + function shouldEmitToOwnFile(sourceFile, compilerOptions) { + if (!ts.isDeclarationFile(sourceFile)) { + if ((ts.isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { + return true; + } + return false; + } + return false; + } + ts.shouldEmitToOwnFile = shouldEmitToOwnFile; + function isExternalModuleOrDeclarationFile(sourceFile) { + return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); + } + ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; + function emitFiles(resolver, targetSourceFile) { var program = resolver.getProgram(); var compilerHost = program.getCompilerHost(); var compilerOptions = program.getCompilerOptions(); @@ -5825,32 +6453,22 @@ var ts; var diagnostics = []; var newLine = program.getCompilerHost().getNewLine(); function getSourceFilePathInNewDir(newDirPath, sourceFile) { - var sourceFilePath = ts.getNormalizedPathFromPathCompoments(ts.getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); + var sourceFilePath = ts.getNormalizedPathFromPathComponents(ts.getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); return ts.combinePaths(newDirPath, sourceFilePath); } - function shouldEmitToOwnFile(sourceFile) { - if (!(sourceFile.flags & 512 /* DeclarationFile */)) { - if ((ts.isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { - return true; - } - } - } function getOwnEmitOutputFilePath(sourceFile, extension) { - if (program.getCompilerOptions().outDir) { - var emitOutputFilePathWithoutExtension = ts.getModuleNameFromFilename(getSourceFilePathInNewDir(program.getCompilerOptions().outDir, sourceFile)); + if (compilerOptions.outDir) { + var emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(compilerOptions.outDir, sourceFile)); } else { - var emitOutputFilePathWithoutExtension = ts.getModuleNameFromFilename(sourceFile.filename); + var emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.filename); } return emitOutputFilePathWithoutExtension + extension; } - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || (sourceFile.flags & 512 /* DeclarationFile */) !== 0; - } function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 117 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } }); @@ -5860,14 +6478,14 @@ var ts; var getAccessor; var setAccessor; ts.forEach(node.members, function (member) { - if ((member.kind === 118 /* GetAccessor */ || member.kind === 119 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 64 /* Static */) === (accessor.flags & 64 /* Static */)) { + if ((member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { if (!firstAccessor) { firstAccessor = member; } - if (member.kind === 118 /* GetAccessor */ && !getAccessor) { + if (member.kind === 127 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 119 /* SetAccessor */ && !setAccessor) { + if (member.kind === 128 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -5878,7 +6496,7 @@ var ts; setAccessor: setAccessor }; } - function createTextWriter(writeSymbol) { + function createTextWriter() { var output = ""; var indent = 0; var lineStart = true; @@ -5904,18 +6522,10 @@ var ts; function writeLiteral(s) { if (s && s.length) { write(s); - var pos = 0; - while (pos < s.length) { - switch (s.charCodeAt(pos++)) { - case 13 /* carriageReturn */: - if (pos < s.length && s.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - lineCount++; - linePos = output.length - s.length + pos; - break; - } + var lineStartsOfS = ts.computeLineStarts(s); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; } } } @@ -5929,7 +6539,6 @@ var ts; } return { write: write, - writeSymbol: writeSymbol, rawWrite: rawWrite, writeLiteral: writeLiteral, writeLine: writeLine, @@ -6026,10 +6635,9 @@ var ts; } function calculateIndent(pos, end) { var currentLineIndent = 0; - while (pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos))) { - pos++; + for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { if (currentSourceFile.text.charCodeAt(pos) === 9 /* tab */) { - currentLineIndent += getIndentSize(); + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); } else { currentLineIndent++; @@ -6039,7 +6647,7 @@ var ts; } } function emitJavaScript(jsFilePath, root) { - var writer = createTextWriter(writeSymbol); + var writer = createTextWriter(); var write = writer.write; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; @@ -6069,8 +6677,6 @@ var ts; var scopeEmitEnd = function () { }; var sourceMapData; - function writeSymbol(symbol, enclosingDeclaration, meaning) { - } function initializeEmitterWithSourceMaps() { var sourceMapDir; var sourceMapSourceIndex = -1; @@ -6175,7 +6781,7 @@ var ts; } function recordNewSourceFileStart(node) { var sourcesDirectoryPath = compilerOptions.sourceRoot ? program.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.filename, compilerHost.getCurrentDirectory(), true)); + sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.filename, compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, true)); sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; sourceMapData.inputSourceFileNames.push(node.filename); } @@ -6202,7 +6808,7 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 167 /* FunctionDeclaration */ || node.kind === 136 /* FunctionExpression */ || node.kind === 116 /* Method */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */ || node.kind === 172 /* ModuleDeclaration */ || node.kind === 169 /* ClassDeclaration */ || node.kind === 171 /* EnumDeclaration */) { + else if (node.kind === 185 /* FunctionDeclaration */ || node.kind === 152 /* FunctionExpression */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */ || node.kind === 191 /* ModuleDeclaration */ || node.kind === 187 /* ClassDeclaration */ || node.kind === 190 /* EnumDeclaration */) { if (node.name) { scopeName = node.name.text; } @@ -6221,16 +6827,32 @@ var ts; writeCommentRange(comment, writer); recordSourceMapSpan(comment.end); } + function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { + if (typeof JSON !== "undefined") { + return JSON.stringify({ + version: version, + file: file, + sourceRoot: sourceRoot, + sources: sources, + names: names, + mappings: mappings + }); + } + return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\"}"; + function serializeStringArray(list) { + var output = ""; + for (var i = 0, n = list.length; i < n; i++) { + if (i) { + output += ","; + } + output += "\"" + ts.escapeString(list[i]) + "\""; + } + return output; + } + } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); - writeFile(sourceMapData.sourceMapFilePath, JSON.stringify({ - version: 3, - file: sourceMapData.sourceMapFile, - sourceRoot: sourceMapData.sourceMapSourceRoot, - sources: sourceMapData.sourceMapSources, - names: sourceMapData.sourceMapNames, - mappings: sourceMapData.sourceMapMappings - }), false); + writeFile(sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); sourceMapDataList.push(sourceMapData); writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); } @@ -6257,7 +6879,7 @@ var ts; } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { sourceMapDir = ts.combinePaths(program.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), compilerHost.getCurrentDirectory(), true); + sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, true); } else { sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); @@ -6268,7 +6890,7 @@ var ts; } function emitNodeWithMap(node) { if (node) { - if (node.kind != 177 /* SourceFile */) { + if (node.kind != 196 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNode(node); recordEmitNodeEndSpan(node); @@ -6307,25 +6929,42 @@ var ts; emit(node); } } - function emitCommaList(nodes, count) { - if (!(count >= 0)) - count = nodes.length; - if (nodes) { - for (var i = 0; i < count; i++) { - if (i) - write(", "); - emit(nodes[i]); + function emitTrailingCommaIfPresent(nodeList, isMultiline) { + if (nodeList.hasTrailingComma) { + write(","); + if (isMultiline) { + writeLine(); } } } - function emitMultiLineList(nodes) { + function emitCommaList(nodes, includeTrailingComma, count) { + if (!(count >= 0)) { + count = nodes.length; + } + if (nodes) { + for (var i = 0; i < count; i++) { + if (i) { + write(", "); + } + emit(nodes[i]); + } + if (includeTrailingComma) { + emitTrailingCommaIfPresent(nodes, false); + } + } + } + function emitMultiLineList(nodes, includeTrailingComma) { if (nodes) { for (var i = 0; i < nodes.length; i++) { - if (i) + if (i) { write(","); + } writeLine(); emit(nodes[i]); } + if (includeTrailingComma) { + emitTrailingCommaIfPresent(nodes, true); + } } } function emitLines(nodes) { @@ -6338,21 +6977,97 @@ var ts; } } function emitLiteral(node) { - var text = getSourceTextOfLocalNode(node); - if (node.kind === 3 /* StringLiteral */ && compilerOptions.sourceMap) { + var text = getLiteralText(); + if (compilerOptions.sourceMap && (node.kind === 7 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else { write(text); } + function getLiteralText() { + if (compilerOptions.target < 2 /* ES6 */ && ts.isTemplateLiteralKind(node.kind)) { + return getTemplateLiteralAsStringLiteral(node); + } + return getSourceTextOfLocalNode(node); + } } - function emitQuotedIdentifier(node) { - if (node.kind === 3 /* StringLiteral */) { + function getTemplateLiteralAsStringLiteral(node) { + return '"' + ts.escapeString(node.text) + '"'; + } + function emitTemplateExpression(node) { + if (compilerOptions.target >= 2 /* ES6 */) { + ts.forEachChild(node, emit); + return; + } + ts.Debug.assert(node.parent.kind !== 149 /* TaggedTemplateExpression */); + var emitOuterParens = ts.isExpression(node.parent) && templateNeedsParens(node, node.parent); + if (emitOuterParens) { + write("("); + } + emitLiteral(node.head); + ts.forEach(node.templateSpans, function (templateSpan) { + var needsParens = templateSpan.expression.kind !== 151 /* ParenExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; + write(" + "); + if (needsParens) { + write("("); + } + emit(templateSpan.expression); + if (needsParens) { + write(")"); + } + if (templateSpan.literal.text.length !== 0) { + write(" + "); + emitLiteral(templateSpan.literal); + } + }); + if (emitOuterParens) { + write(")"); + } + function templateNeedsParens(template, parent) { + switch (parent.kind) { + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return parent.func === template; + case 151 /* ParenExpression */: + return false; + case 149 /* TaggedTemplateExpression */: + ts.Debug.fail("Path should be unreachable; tagged templates not supported pre-ES6."); + default: + return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; + } + } + function comparePrecedenceToBinaryPlus(expression) { + ts.Debug.assert(compilerOptions.target <= 1 /* ES5 */); + switch (expression.kind) { + case 156 /* BinaryExpression */: + switch (expression.operator) { + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: + return 1 /* GreaterThan */; + case 32 /* PlusToken */: + return 0 /* EqualTo */; + default: + return -1 /* LessThan */; + } + case 157 /* ConditionalExpression */: + return -1 /* LessThan */; + default: + return 1 /* GreaterThan */; + } + } + } + function emitTemplateSpan(span) { + emit(span.expression); + emit(span.literal); + } + function emitExpressionForPropertyName(node) { + if (node.kind === 7 /* StringLiteral */) { emitLiteral(node); } else { write("\""); - if (node.kind === 2 /* NumericLiteral */) { + if (node.kind === 6 /* NumericLiteral */) { write(node.text); } else { @@ -6361,45 +7076,52 @@ var ts; write("\""); } } - function isNonExpressionIdentifier(node) { + function isNotExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 114 /* Parameter */: - case 166 /* VariableDeclaration */: - case 115 /* Property */: - case 129 /* PropertyAssignment */: - case 176 /* EnumMember */: - case 116 /* Method */: - case 167 /* FunctionDeclaration */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 136 /* FunctionExpression */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 171 /* EnumDeclaration */: - case 172 /* ModuleDeclaration */: - case 174 /* ImportDeclaration */: + case 123 /* Parameter */: + case 184 /* VariableDeclaration */: + case 124 /* Property */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + case 195 /* EnumMember */: + case 125 /* Method */: + case 185 /* FunctionDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 152 /* FunctionExpression */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: return parent.name === node; - case 153 /* BreakStatement */: - case 152 /* ContinueStatement */: - case 175 /* ExportAssignment */: + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 194 /* ExportAssignment */: return false; - case 159 /* LabelledStatement */: + case 177 /* LabeledStatement */: return node.parent.label === node; - case 163 /* CatchBlock */: + case 181 /* CatchBlock */: return node.parent.variable === node; } } - function emitIdentifier(node) { - if (!isNonExpressionIdentifier(node)) { - var prefix = resolver.getExpressionNamePrefix(node); - if (prefix) { - write(prefix); - write("."); - } + function emitExpressionIdentifier(node) { + var prefix = resolver.getExpressionNamePrefix(node); + if (prefix) { + write(prefix); + write("."); } write(getSourceTextOfLocalNode(node)); } + function emitIdentifier(node) { + if (!isNotExpressionIdentifier(node)) { + emitExpressionIdentifier(node); + } + else { + write(getSourceTextOfLocalNode(node)); + } + } function emitThis(node) { if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { write("_this"); @@ -6421,17 +7143,17 @@ var ts; } } function emitArrayLiteral(node) { - if (node.flags & 128 /* MultiLine */) { + if (node.flags & 256 /* MultiLine */) { write("["); increaseIndent(); - emitMultiLineList(node.elements); + emitMultiLineList(node.elements, true); decreaseIndent(); writeLine(); write("]"); } else { write("["); - emitCommaList(node.elements); + emitCommaList(node.elements, true); write("]"); } } @@ -6439,17 +7161,17 @@ var ts; if (!node.properties.length) { write("{}"); } - else if (node.flags & 128 /* MultiLine */) { + else if (node.flags & 256 /* MultiLine */) { write("{"); increaseIndent(); - emitMultiLineList(node.properties); + emitMultiLineList(node.properties, compilerOptions.target >= 1 /* ES5 */); decreaseIndent(); writeLine(); write("}"); } else { write("{ "); - emitCommaList(node.properties); + emitCommaList(node.properties, compilerOptions.target >= 1 /* ES5 */); write(" }"); } } @@ -6460,10 +7182,40 @@ var ts; emit(node.initializer); emitTrailingComments(node); } + function emitShortHandPropertyAssignment(node) { + function emitAsNormalPropertyAssignment() { + emitLeadingComments(node); + emit(node.name); + write(": "); + emitExpressionIdentifier(node.name); + emitTrailingComments(node); + } + if (compilerOptions.target < 2 /* ES6 */) { + emitAsNormalPropertyAssignment(); + } + else if (compilerOptions.target >= 2 /* ES6 */) { + var prefix = resolver.getExpressionNamePrefix(node.name); + if (prefix) { + emitAsNormalPropertyAssignment(); + } + else { + emitLeadingComments(node); + emit(node.name); + emitTrailingComments(node); + } + } + } + function tryEmitConstantValue(node) { + var constantValue = resolver.getConstantValue(node); + if (constantValue !== undefined) { + var propertyName = node.kind === 145 /* PropertyAccess */ ? ts.declarationNameToString(node.right) : ts.getTextOfNode(node.index); + write(constantValue.toString() + " /* " + propertyName + " */"); + return true; + } + return false; + } function emitPropertyAccess(node) { - var text = resolver.getPropertyAccessSubstitution(node); - if (text) { - write(text); + if (tryEmitConstantValue(node)) { return; } emit(node.left); @@ -6471,6 +7223,9 @@ var ts; emit(node.right); } function emitIndexedAccess(node) { + if (tryEmitConstantValue(node)) { + return; + } emit(node.object); write("["); emit(node.index); @@ -6478,26 +7233,26 @@ var ts; } function emitCallExpression(node) { var superCall = false; - if (node.func.kind === 81 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { write("_super"); superCall = true; } else { emit(node.func); - superCall = node.func.kind === 130 /* PropertyAccess */ && node.func.left.kind === 81 /* SuperKeyword */; + superCall = node.func.kind === 145 /* PropertyAccess */ && node.func.left.kind === 89 /* SuperKeyword */; } if (superCall) { write(".call("); emitThis(node.func); if (node.arguments.length) { write(", "); - emitCommaList(node.arguments); + emitCommaList(node.arguments, false); } write(")"); } else { write("("); - emitCommaList(node.arguments); + emitCommaList(node.arguments, false); write(")"); } } @@ -6506,17 +7261,23 @@ var ts; emit(node.func); if (node.arguments) { write("("); - emitCommaList(node.arguments); + emitCommaList(node.arguments, false); write(")"); } } + function emitTaggedTemplateExpression(node) { + ts.Debug.assert(compilerOptions.target >= 2 /* ES6 */, "Trying to emit a tagged template in pre-ES6 mode."); + emit(node.tag); + write(" "); + emit(node.template); + } function emitParenExpression(node) { - if (node.expression.kind === 134 /* TypeAssertion */) { + if (node.expression.kind === 150 /* TypeAssertion */) { var operand = node.expression.operand; - while (operand.kind == 134 /* TypeAssertion */) { + while (operand.kind == 150 /* TypeAssertion */) { operand = operand.operand; } - if (operand.kind !== 138 /* PrefixOperator */ && operand.kind !== 139 /* PostfixOperator */ && operand.kind !== 133 /* NewExpression */ && !(operand.kind === 132 /* CallExpression */ && node.parent.kind === 133 /* NewExpression */) && !(operand.kind === 136 /* FunctionExpression */ && node.parent.kind === 132 /* CallExpression */)) { + if (operand.kind !== 154 /* PrefixOperator */ && operand.kind !== 155 /* PostfixOperator */ && operand.kind !== 148 /* NewExpression */ && !(operand.kind === 147 /* CallExpression */ && node.parent.kind === 148 /* NewExpression */) && !(operand.kind === 152 /* FunctionExpression */ && node.parent.kind === 147 /* CallExpression */)) { emit(operand); return; } @@ -6526,29 +7287,29 @@ var ts; write(")"); } function emitUnaryExpression(node) { - if (node.kind === 138 /* PrefixOperator */) { + if (node.kind === 154 /* PrefixOperator */) { write(ts.tokenToString(node.operator)); } - if (node.operator >= 55 /* Identifier */) { + if (node.operator >= 63 /* Identifier */) { write(" "); } - else if (node.kind === 138 /* PrefixOperator */ && node.operand.kind === 138 /* PrefixOperator */) { + else if (node.kind === 154 /* PrefixOperator */ && node.operand.kind === 154 /* PrefixOperator */) { var operand = node.operand; - if (node.operator === 24 /* PlusToken */ && (operand.operator === 24 /* PlusToken */ || operand.operator === 29 /* PlusPlusToken */)) { + if (node.operator === 32 /* PlusToken */ && (operand.operator === 32 /* PlusToken */ || operand.operator === 37 /* PlusPlusToken */)) { write(" "); } - else if (node.operator === 25 /* MinusToken */ && (operand.operator === 25 /* MinusToken */ || operand.operator === 30 /* MinusMinusToken */)) { + else if (node.operator === 33 /* MinusToken */ && (operand.operator === 33 /* MinusToken */ || operand.operator === 38 /* MinusMinusToken */)) { write(" "); } } emit(node.operand); - if (node.kind === 139 /* PostfixOperator */) { + if (node.kind === 155 /* PostfixOperator */) { write(ts.tokenToString(node.operator)); } } function emitBinaryExpression(node) { emit(node.left); - if (node.operator !== 14 /* CommaToken */) + if (node.operator !== 22 /* CommaToken */) write(" "); write(ts.tokenToString(node.operator)); write(" "); @@ -6562,21 +7323,21 @@ var ts; emit(node.whenFalse); } function emitBlock(node) { - emitToken(5 /* OpenBraceToken */, node.pos); + emitToken(13 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 173 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 172 /* ModuleDeclaration */); + if (node.kind === 192 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 191 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); decreaseIndent(); writeLine(); - emitToken(6 /* CloseBraceToken */, node.statements.end); + emitToken(14 /* CloseBraceToken */, node.statements.end); scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 143 /* Block */) { + if (node.kind === 161 /* Block */) { write(" "); emit(node); } @@ -6588,7 +7349,7 @@ var ts; } } function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 137 /* ArrowFunction */; + var isArrowExpression = node.expression.kind === 153 /* ArrowFunction */; emitLeadingComments(node); if (isArrowExpression) write("("); @@ -6600,16 +7361,16 @@ var ts; } function emitIfStatement(node) { emitLeadingComments(node); - var endPos = emitToken(74 /* IfKeyword */, node.pos); + var endPos = emitToken(82 /* IfKeyword */, node.pos); write(" "); - endPos = emitToken(7 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - emitToken(8 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(66 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 147 /* IfStatement */) { + emitToken(74 /* ElseKeyword */, node.thenStatement.end); + if (node.elseStatement.kind === 165 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -6622,7 +7383,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 143 /* Block */) { + if (node.statement.kind === 161 /* Block */) { write(" "); } else { @@ -6639,13 +7400,21 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForStatement(node) { - var endPos = emitToken(72 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(7 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); if (node.declarations) { - emitToken(88 /* VarKeyword */, endPos); + if (node.declarations[0] && node.declarations[0].flags & 2048 /* Let */) { + emitToken(102 /* LetKeyword */, endPos); + } + else if (node.declarations[0] && node.declarations[0].flags & 4096 /* Const */) { + emitToken(68 /* ConstKeyword */, endPos); + } + else { + emitToken(96 /* VarKeyword */, endPos); + } write(" "); - emitCommaList(node.declarations); + emitCommaList(node.declarations, false); } if (node.initializer) { emit(node.initializer); @@ -6658,30 +7427,38 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInStatement(node) { - var endPos = emitToken(72 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(7 /* OpenParenToken */, endPos); - if (node.declaration) { - emitToken(88 /* VarKeyword */, endPos); - write(" "); - emit(node.declaration); + endPos = emitToken(15 /* OpenParenToken */, endPos); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + if (decl.flags & 2048 /* Let */) { + emitToken(102 /* LetKeyword */, endPos); + } + else { + emitToken(96 /* VarKeyword */, endPos); + } + write(" "); + emit(decl); + } } else { emit(node.variable); } write(" in "); emit(node.expression); - emitToken(8 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.statement); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 153 /* BreakStatement */ ? 56 /* BreakKeyword */ : 61 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 171 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { emitLeadingComments(node); - emitToken(80 /* ReturnKeyword */, node.pos); + emitToken(88 /* ReturnKeyword */, node.pos); emitOptional(" ", node.expression); write(";"); emitTrailingComments(node); @@ -6693,21 +7470,24 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(82 /* SwitchKeyword */, node.pos); + var endPos = emitToken(90 /* SwitchKeyword */, node.pos); write(" "); - emitToken(7 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - endPos = emitToken(8 /* CloseParenToken */, node.expression.end); + endPos = emitToken(16 /* CloseParenToken */, node.expression.end); write(" "); - emitToken(5 /* OpenBraceToken */, endPos); + emitToken(13 /* OpenBraceToken */, endPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); writeLine(); - emitToken(6 /* CloseBraceToken */, node.clauses.end); + emitToken(14 /* CloseBraceToken */, node.clauses.end); + } + function isOnSameLine(node1, node2) { + return getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 157 /* CaseClause */) { + if (node.kind === 175 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -6715,9 +7495,15 @@ var ts; else { write("default:"); } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); + if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) { + write(" "); + emit(node.statements[0]); + } + else { + increaseIndent(); + emitLines(node.statements); + decreaseIndent(); + } } function emitThrowStatement(node) { write("throw "); @@ -6736,16 +7522,16 @@ var ts; } function emitCatchBlock(node) { writeLine(); - var endPos = emitToken(58 /* CatchKeyword */, node.pos); + var endPos = emitToken(66 /* CatchKeyword */, node.pos); write(" "); - emitToken(7 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.variable); - emitToken(8 /* CloseParenToken */, node.variable.end); + emitToken(16 /* CloseParenToken */, node.variable.end); write(" "); emitBlock(node); } function emitDebuggerStatement(node) { - emitToken(62 /* DebuggerKeyword */, node.pos); + emitToken(70 /* DebuggerKeyword */, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -6756,7 +7542,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 172 /* ModuleDeclaration */); + } while (node && node.kind !== 191 /* ModuleDeclaration */); return node; } function emitModuleMemberName(node) { @@ -6777,9 +7563,18 @@ var ts; } function emitVariableStatement(node) { emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) - write("var "); - emitCommaList(node.declarations); + if (!(node.flags & 1 /* Export */)) { + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } + } + emitCommaList(node.declarations, false); write(";"); emitTrailingComments(node); } @@ -6846,7 +7641,7 @@ var ts; } function emitAccessor(node) { emitLeadingComments(node); - write(node.kind === 118 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 127 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); emitTrailingComments(node); @@ -6855,15 +7650,15 @@ var ts; if (!node.body) { return emitPinnedOrTripleSlashComments(node); } - if (node.kind !== 116 /* Method */) { + if (node.kind !== 125 /* Method */) { emitLeadingComments(node); } write("function "); - if (node.kind === 167 /* FunctionDeclaration */ || (node.kind === 136 /* FunctionExpression */ && node.name)) { + if (node.kind === 185 /* FunctionDeclaration */ || (node.kind === 152 /* FunctionExpression */ && node.name)) { emit(node.name); } emitSignatureAndBody(node); - if (node.kind !== 116 /* Method */) { + if (node.kind !== 125 /* Method */) { emitTrailingComments(node); } } @@ -6879,7 +7674,7 @@ var ts; increaseIndent(); write("("); if (node) { - emitCommaList(node.parameters, node.parameters.length - (ts.hasRestParameters(node) ? 1 : 0)); + emitCommaList(node.parameters, false, node.parameters.length - (ts.hasRestParameters(node) ? 1 : 0)); } write(")"); decreaseIndent(); @@ -6889,16 +7684,16 @@ var ts; write(" {"); scopeEmitStart(node); increaseIndent(); - emitDetachedComments(node.body.kind === 168 /* FunctionBlock */ ? node.body.statements : node.body); + emitDetachedComments(node.body.kind === 186 /* FunctionBlock */ ? node.body.statements : node.body); var startIndex = 0; - if (node.body.kind === 168 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { startIndex = emitDirectivePrologues(node.body.statements, true); } var outPos = writer.getTextPos(); emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); - if (node.body.kind !== 168 /* FunctionBlock */ && outPos === writer.getTextPos()) { + if (node.body.kind !== 186 /* FunctionBlock */ && outPos === writer.getTextPos()) { decreaseIndent(); write(" "); emitStart(node.body); @@ -6911,7 +7706,7 @@ var ts; emitEnd(node.body); } else { - if (node.body.kind === 168 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { emitLinesStartingAt(node.body.statements, startIndex); } else { @@ -6923,10 +7718,10 @@ var ts; emitTrailingComments(node.body); } writeLine(); - if (node.body.kind === 168 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { emitLeadingCommentsOfPosition(node.body.statements.end); decreaseIndent(); - emitToken(6 /* CloseBraceToken */, node.body.statements.end); + emitToken(14 /* CloseBraceToken */, node.body.statements.end); } else { decreaseIndent(); @@ -6949,11 +7744,11 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 146 /* ExpressionStatement */) { + if (statement && statement.kind === 164 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 132 /* CallExpression */) { + if (expr && expr.kind === 147 /* CallExpression */) { var func = expr.func; - if (func && func.kind === 81 /* SuperKeyword */) { + if (func && func.kind === 89 /* SuperKeyword */) { return statement; } } @@ -6962,7 +7757,7 @@ var ts; } function emitParameterPropertyAssignments(node) { ts.forEach(node.parameters, function (param) { - if (param.flags & (16 /* Public */ | 32 /* Private */)) { + if (param.flags & 112 /* AccessibilityModifier */) { writeLine(); emitStart(param); emitStart(param.name); @@ -6977,7 +7772,7 @@ var ts; }); } function emitMemberAccess(memberName) { - if (memberName.kind === 3 /* StringLiteral */ || memberName.kind === 2 /* NumericLiteral */) { + if (memberName.kind === 7 /* StringLiteral */ || memberName.kind === 6 /* NumericLiteral */) { write("["); emitNode(memberName); write("]"); @@ -6989,7 +7784,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 115 /* Property */ && (member.flags & 64 /* Static */) === staticFlag && member.initializer) { + if (member.kind === 124 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -7012,7 +7807,7 @@ var ts; } function emitMemberFunctions(node) { ts.forEach(node.members, function (member) { - if (member.kind === 116 /* Method */) { + if (member.kind === 125 /* Method */) { if (!member.body) { return emitPinnedOrTripleSlashComments(member); } @@ -7021,7 +7816,7 @@ var ts; emitStart(member); emitStart(member.name); emitNode(node.name); - if (!(member.flags & 64 /* Static */)) { + if (!(member.flags & 128 /* Static */)) { write(".prototype"); } emitMemberAccess(member.name); @@ -7034,7 +7829,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 118 /* GetAccessor */ || member.kind === 119 /* SetAccessor */) { + else if (member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) { var accessors = getAllAccessorDeclarations(node, member); if (member === accessors.firstAccessor) { writeLine(); @@ -7042,11 +7837,11 @@ var ts; write("Object.defineProperty("); emitStart(member.name); emitNode(node.name); - if (!(member.flags & 64 /* Static */)) { + if (!(member.flags & 128 /* Static */)) { write(".prototype"); } write(", "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member.name); write(", {"); increaseIndent(); @@ -7106,17 +7901,17 @@ var ts; writeLine(); emitConstructorOfClass(); emitMemberFunctions(node); - emitMemberAssignments(node, 64 /* Static */); + emitMemberAssignments(node, 128 /* Static */); writeLine(); function emitClassReturnStatement() { write("return "); emitNode(node.name); } - emitToken(6 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); + emitToken(14 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); write(";"); decreaseIndent(); writeLine(); - emitToken(6 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); emitStart(node); write(")("); @@ -7137,7 +7932,7 @@ var ts; emitTrailingComments(node); function emitConstructorOfClass() { ts.forEach(node.members, function (member) { - if (member.kind === 117 /* Constructor */ && !member.body) { + if (member.kind === 126 /* Constructor */ && !member.body) { emitPinnedOrTripleSlashComments(member); } }); @@ -7188,7 +7983,7 @@ var ts; emitLeadingCommentsOfPosition(ctor.body.statements.end); } decreaseIndent(); - emitToken(6 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); + emitToken(14 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); scopeEmitEnd(); emitEnd(ctor || node); if (ctor) { @@ -7200,6 +7995,10 @@ var ts; emitPinnedOrTripleSlashComments(node); } function emitEnumDeclaration(node) { + var isConstEnum = ts.isConstEnumDeclaration(node); + if (isConstEnum && !compilerOptions.preserveConstEnums) { + return; + } emitLeadingComments(node); if (!(node.flags & 1 /* Export */)) { emitStart(node); @@ -7217,10 +8016,10 @@ var ts; write(") {"); increaseIndent(); scopeEmitStart(node); - emitEnumMemberDeclarations(); + emitEnumMemberDeclarations(isConstEnum); decreaseIndent(); writeLine(); - emitToken(6 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); write(")("); emitModuleMemberName(node); @@ -7239,7 +8038,7 @@ var ts; write(";"); } emitTrailingComments(node); - function emitEnumMemberDeclarations() { + function emitEnumMemberDeclarations(isConstEnum) { ts.forEach(node.members, function (member) { writeLine(); emitLeadingComments(member); @@ -7248,16 +8047,16 @@ var ts; write("["); write(resolver.getLocalNameOfContainer(node)); write("["); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); write("] = "); - if (member.initializer) { + if (member.initializer && !isConstEnum) { emit(member.initializer); } else { write(resolver.getEnumMemberValue(member).toString()); } write("] = "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member); write(";"); emitTrailingComments(member); @@ -7265,31 +8064,29 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 172 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 191 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } } function emitModuleDeclaration(node) { - if (!ts.isInstantiated(node)) { + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) { - emitStart(node); - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); - } + emitStart(node); + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); emitStart(node); write("(function ("); emitStart(node.name); write(resolver.getLocalNameOfContainer(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 173 /* ModuleBlock */) { + if (node.body.kind === 192 /* ModuleBlock */) { emit(node.body); } else { @@ -7302,34 +8099,28 @@ var ts; decreaseIndent(); writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(6 /* CloseBraceToken */, moduleBlock.statements.end); + emitToken(14 /* CloseBraceToken */, moduleBlock.statements.end); scopeEmitEnd(); } write(")("); + if (node.flags & 1 /* Export */) { + emit(node.name); + write(" = "); + } emitModuleMemberName(node); write(" || ("); emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (node.flags & 1 /* Export */) { - writeLine(); - emitStart(node); - write("var "); - emit(node.name); - write(" = "); - emitModuleMemberName(node); - emitEnd(node); - write(";"); - } emitTrailingComments(node); } function emitImportDeclaration(node) { var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); if (!emitImportDeclaration) { - emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); + emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 177 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.externalModuleName && node.parent.kind === 196 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { if (node.flags & 1 /* Export */) { writeLine(); emitLeadingComments(node); @@ -7358,7 +8149,7 @@ var ts; emitStart(node.externalModuleName); emitLiteral(node.externalModuleName); emitEnd(node.externalModuleName); - emitToken(8 /* CloseParenToken */, node.externalModuleName.end); + emitToken(16 /* CloseParenToken */, node.externalModuleName.end); } write(";"); emitEnd(node); @@ -7369,7 +8160,7 @@ var ts; function getExternalImportDeclarations(node) { var result = []; ts.forEach(node.statements, function (stat) { - if (stat.kind === 174 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === 193 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { result.push(stat); } }); @@ -7377,7 +8168,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 175 /* ExportAssignment */) { + if (node.kind === 194 /* ExportAssignment */) { return node; } }); @@ -7385,7 +8176,11 @@ var ts; function emitAMDModule(node, startIndex) { var imports = getExternalImportDeclarations(node); writeLine(); - write("define([\"require\", \"exports\""); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + write("[\"require\", \"exports\""); ts.forEach(imports, function (imp) { write(", "); emitLiteral(imp.externalModuleName); @@ -7493,117 +8288,129 @@ var ts; return emitPinnedOrTripleSlashComments(node); } switch (node.kind) { - case 55 /* Identifier */: + case 63 /* Identifier */: return emitIdentifier(node); - case 114 /* Parameter */: + case 123 /* Parameter */: return emitParameter(node); - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessor(node); - case 83 /* ThisKeyword */: + case 91 /* ThisKeyword */: return emitThis(node); - case 81 /* SuperKeyword */: + case 89 /* SuperKeyword */: return emitSuper(node); - case 79 /* NullKeyword */: + case 87 /* NullKeyword */: return write("null"); - case 85 /* TrueKeyword */: + case 93 /* TrueKeyword */: return write("true"); - case 70 /* FalseKeyword */: + case 78 /* FalseKeyword */: return write("false"); - case 2 /* NumericLiteral */: - case 3 /* StringLiteral */: - case 4 /* RegularExpressionLiteral */: + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 8 /* RegularExpressionLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 11 /* TemplateMiddle */: + case 12 /* TemplateTail */: return emitLiteral(node); - case 112 /* QualifiedName */: + case 158 /* TemplateExpression */: + return emitTemplateExpression(node); + case 159 /* TemplateSpan */: + return emitTemplateSpan(node); + case 121 /* QualifiedName */: return emitPropertyAccess(node); - case 127 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return emitArrayLiteral(node); - case 128 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return emitObjectLiteral(node); - case 129 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 130 /* PropertyAccess */: + case 144 /* ShorthandPropertyAssignment */: + return emitShortHandPropertyAssignment(node); + case 145 /* PropertyAccess */: return emitPropertyAccess(node); - case 131 /* IndexedAccess */: + case 146 /* IndexedAccess */: return emitIndexedAccess(node); - case 132 /* CallExpression */: + case 147 /* CallExpression */: return emitCallExpression(node); - case 133 /* NewExpression */: + case 148 /* NewExpression */: return emitNewExpression(node); - case 134 /* TypeAssertion */: + case 149 /* TaggedTemplateExpression */: + return emitTaggedTemplateExpression(node); + case 150 /* TypeAssertion */: return emit(node.operand); - case 135 /* ParenExpression */: + case 151 /* ParenExpression */: return emitParenExpression(node); - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 138 /* PrefixOperator */: - case 139 /* PostfixOperator */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: return emitUnaryExpression(node); - case 140 /* BinaryExpression */: + case 156 /* BinaryExpression */: return emitBinaryExpression(node); - case 141 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return emitConditionalExpression(node); - case 142 /* OmittedExpression */: + case 160 /* OmittedExpression */: return; - case 143 /* Block */: - case 162 /* TryBlock */: - case 164 /* FinallyBlock */: - case 168 /* FunctionBlock */: - case 173 /* ModuleBlock */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: return emitBlock(node); - case 144 /* VariableStatement */: + case 162 /* VariableStatement */: return emitVariableStatement(node); - case 145 /* EmptyStatement */: + case 163 /* EmptyStatement */: return write(";"); - case 146 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return emitExpressionStatement(node); - case 147 /* IfStatement */: + case 165 /* IfStatement */: return emitIfStatement(node); - case 148 /* DoStatement */: + case 166 /* DoStatement */: return emitDoStatement(node); - case 149 /* WhileStatement */: + case 167 /* WhileStatement */: return emitWhileStatement(node); - case 150 /* ForStatement */: + case 168 /* ForStatement */: return emitForStatement(node); - case 151 /* ForInStatement */: + case 169 /* ForInStatement */: return emitForInStatement(node); - case 152 /* ContinueStatement */: - case 153 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 154 /* ReturnStatement */: + case 172 /* ReturnStatement */: return emitReturnStatement(node); - case 155 /* WithStatement */: + case 173 /* WithStatement */: return emitWithStatement(node); - case 156 /* SwitchStatement */: + case 174 /* SwitchStatement */: return emitSwitchStatement(node); - case 157 /* CaseClause */: - case 158 /* DefaultClause */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 159 /* LabelledStatement */: + case 177 /* LabeledStatement */: return emitLabelledStatement(node); - case 160 /* ThrowStatement */: + case 178 /* ThrowStatement */: return emitThrowStatement(node); - case 161 /* TryStatement */: + case 179 /* TryStatement */: return emitTryStatement(node); - case 163 /* CatchBlock */: + case 181 /* CatchBlock */: return emitCatchBlock(node); - case 165 /* DebuggerStatement */: + case 183 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 166 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 169 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return emitClassDeclaration(node); - case 170 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 171 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 174 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return emitImportDeclaration(node); - case 177 /* SourceFile */: + case 196 /* SourceFile */: return emitSourceFile(node); } } @@ -7611,7 +8418,7 @@ var ts; return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { - var leadingComments = ts.getLeadingComments(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); + var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -7621,13 +8428,13 @@ var ts; return leadingComments; } function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 177 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 196 /* SourceFile */ || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); } else { - leadingComments = ts.getLeadingCommentsOfNode(node, currentSourceFile); + leadingComments = ts.getLeadingCommentRangesOfNode(node, currentSourceFile); } return leadingComments; } @@ -7638,8 +8445,8 @@ var ts; emitComments(leadingComments, true, writer, writeComment); } function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 177 /* SourceFile */ || node.end !== node.parent.end) { - var trailingComments = ts.getTrailingComments(currentSourceFile.text, node.end); + if (node.parent.kind === 196 /* SourceFile */ || node.end !== node.parent.end) { + var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(trailingComments, false, writer, writeComment); } } @@ -7649,13 +8456,13 @@ var ts; leadingComments = getLeadingCommentsWithoutDetachedComments(); } else { - leadingComments = ts.getLeadingComments(currentSourceFile.text, pos); + leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } emitNewLineBeforeLeadingComments({ pos: pos, end: pos }, leadingComments, writer); emitComments(leadingComments, true, writer, writeComment); } function emitDetachedCommentsAtPosition(node) { - var leadingComments = ts.getLeadingComments(currentSourceFile.text, node.pos); + var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); if (leadingComments) { var detachedComments = []; var lastComment; @@ -7717,7 +8524,7 @@ var ts; writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); } function emitDeclarations(jsFilePath, root) { - var writer = createTextWriter(writeSymbol); + var writer = createTextWriterWithSymbolWriter(); var write = writer.write; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; @@ -7728,11 +8535,23 @@ var ts; } : writeJsDocComments; var aliasDeclarationEmitInfo = []; var getSymbolVisibilityDiagnosticMessage; + function createTextWriterWithSymbolWriter() { + var writer = createTextWriter(); + writer.trackSymbol = trackSymbol; + writer.writeKeyword = writer.write; + writer.writeOperator = writer.write; + writer.writePunctuation = writer.write; + writer.writeSpace = writer.write; + writer.writeStringLiteral = writer.writeLiteral; + writer.writeParameter = writer.write; + writer.writeSymbol = writer.write; + return writer; + } function writeAsychronousImportDeclarations(importDeclarations) { var oldWriter = writer; ts.forEach(importDeclarations, function (aliasToWrite) { var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); - writer = createTextWriter(writeSymbol); + writer = createTextWriterWithSymbolWriter(); for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { writer.increaseIndent(); } @@ -7741,10 +8560,9 @@ var ts; }); writer = oldWriter; } - function writeSymbol(symbol, enclosingDeclaration, meaning) { + function trackSymbol(symbol, enclosingDeclaration, meaning) { var symbolAccesibilityResult = resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning); if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { - resolver.writeSymbol(symbol, enclosingDeclaration, meaning, writer); if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); } @@ -7799,21 +8617,27 @@ var ts; writeLine(); } function emitDeclarationFlags(node) { - if (node.flags & 64 /* Static */) { + if (node.flags & 128 /* Static */) { if (node.flags & 32 /* Private */) { write("private "); } + else if (node.flags & 64 /* Protected */) { + write("protected "); + } write("static "); } else { if (node.flags & 32 /* Private */) { write("private "); } + else if (node.flags & 64 /* Protected */) { + write("protected "); + } else if (node.parent === currentSourceFile) { if (node.flags & 1 /* Export */) { write("export "); } - if (node.kind !== 170 /* InterfaceDeclaration */) { + if (node.kind !== 188 /* InterfaceDeclaration */) { write("declare "); } } @@ -7869,7 +8693,7 @@ var ts; emitDeclarationFlags(node); write("module "); emitSourceTextOfNode(node.name); - while (node.body.kind !== 173 /* ModuleBlock */) { + while (node.body.kind !== 192 /* ModuleBlock */) { node = node.body; write("."); emitSourceTextOfNode(node.name); @@ -7886,10 +8710,34 @@ var ts; enclosingDeclaration = prevEnclosingDeclaration; } } + function emitTypeAliasDeclaration(node) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitDeclarationFlags(node); + write("type "); + emitSourceTextOfNode(node.name); + write(" = "); + getSymbolVisibilityDiagnosticMessage = getTypeAliasDeclarationVisibilityError; + resolver.writeTypeAtLocation(node.type, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + write(";"); + writeLine(); + } + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; + return { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } function emitEnumDeclaration(node) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); emitDeclarationFlags(node); + if (ts.isConstEnumDeclaration(node)) { + write("const "); + } write("enum "); emitSourceTextOfNode(node.name); write(" {"); @@ -7917,34 +8765,34 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 169 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 170 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 116 /* Method */: - if (node.parent.flags & 64 /* Static */) { + case 125 /* Method */: + if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 169 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 167 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: - ts.Debug.fail("This is unknown parent for type parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -7956,7 +8804,7 @@ var ts; emitJsDocComments(node); decreaseIndent(); emitSourceTextOfNode(node.name); - if (node.constraint && (node.parent.kind !== 116 /* Method */ || !(node.parent.flags & 32 /* Private */))) { + if (node.constraint && (node.parent.kind !== 125 /* Method */ || !(node.parent.flags & 32 /* Private */))) { write(" extends "); getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -7978,7 +8826,7 @@ var ts; resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.kind === 169 /* ClassDeclaration */) { + if (node.parent.kind === 187 /* ClassDeclaration */) { if (symbolAccesibilityResult.errorModuleName) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; } @@ -8006,7 +8854,7 @@ var ts; function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & (16 /* Public */ | 32 /* Private */)) { + if (param.flags & 112 /* AccessibilityModifier */) { emitPropertyDeclaration(param); } }); @@ -8063,9 +8911,9 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 166 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 184 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { emitSourceTextOfNode(node.name); - if (node.kind === 115 /* Property */ && (node.flags & 4 /* QuestionMark */)) { + if (node.kind === 124 /* Property */ && (node.flags & 4 /* QuestionMark */)) { write("?"); } if (!(node.flags & 32 /* Private */)) { @@ -8076,14 +8924,14 @@ var ts; } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 166 /* VariableDeclaration */) { + if (node.kind === 184 /* VariableDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 115 /* Property */) { - if (node.flags & 64 /* Static */) { + else if (node.kind === 124 /* Property */) { + if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 169 /* ClassDeclaration */) { + else if (node.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { @@ -8102,7 +8950,15 @@ var ts; if (hasDeclarationWithEmit) { emitJsDocComments(node); emitDeclarationFlags(node); - write("var "); + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } emitCommaList(node.declarations, emitVariableDeclaration); write(";"); writeLine(); @@ -8125,8 +8981,8 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 119 /* SetAccessor */) { - if (node.parent.flags & 64 /* Static */) { + if (node.kind === 128 /* SetAccessor */) { + if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } else { @@ -8139,7 +8995,7 @@ var ts; }; } else { - if (node.flags & 64 /* Static */) { + if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; } else { @@ -8154,14 +9010,14 @@ var ts; } } function emitFunctionDeclaration(node) { - if ((node.kind !== 167 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 185 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); emitDeclarationFlags(node); - if (node.kind === 167 /* FunctionDeclaration */) { + if (node.kind === 185 /* FunctionDeclaration */) { write("function "); emitSourceTextOfNode(node.name); } - else if (node.kind === 117 /* Constructor */) { + else if (node.kind === 126 /* Constructor */) { write("constructor"); } else { @@ -8179,24 +9035,24 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 120 /* CallSignature */ || node.kind === 122 /* IndexSignature */) { + if (node.kind === 129 /* CallSignature */ || node.kind === 131 /* IndexSignature */) { emitJsDocComments(node); } emitTypeParameters(node.typeParameters); - if (node.kind === 122 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("["); } else { write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 122 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("]"); } else { write(")"); } - if (node.kind !== 117 /* Constructor */ && !(node.flags & 32 /* Private */)) { + if (node.kind !== 126 /* Constructor */ && !(node.flags & 32 /* Private */)) { write(": "); getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8206,31 +9062,31 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 120 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 122 /* IndexSignature */: + case 131 /* IndexSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 116 /* Method */: - if (node.flags & 64 /* Static */) { + case 125 /* Method */: + if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 169 /* ClassDeclaration */) { + else if (node.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 167 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: - ts.Debug.fail("This is unknown kind for signature: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("This is unknown kind for signature: " + node.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8257,31 +9113,31 @@ var ts; function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 117 /* Constructor */: + case 126 /* Constructor */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; break; - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 116 /* Method */: - if (node.parent.flags & 64 /* Static */) { + case 125 /* Method */: + if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 169 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 167 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: - ts.Debug.fail("This is unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8292,74 +9148,80 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 117 /* Constructor */: - case 167 /* FunctionDeclaration */: - case 116 /* Method */: + case 126 /* Constructor */: + case 185 /* FunctionDeclaration */: + case 125 /* Method */: return emitFunctionDeclaration(node); - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: return emitConstructSignatureDeclaration(node); - case 120 /* CallSignature */: - case 122 /* IndexSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: return emitSignatureDeclaration(node); - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessorDeclaration(node); - case 144 /* VariableStatement */: + case 162 /* VariableStatement */: return emitVariableStatement(node); - case 115 /* Property */: + case 124 /* Property */: return emitPropertyDeclaration(node); - case 170 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 169 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return emitClassDeclaration(node); - case 176 /* EnumMember */: + case 189 /* TypeAliasDeclaration */: + return emitTypeAliasDeclaration(node); + case 195 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 171 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 174 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return emitImportDeclaration(node); - case 175 /* ExportAssignment */: + case 194 /* ExportAssignment */: return emitExportAssignment(node); - case 177 /* SourceFile */: + case 196 /* SourceFile */: return emitSourceFile(node); } } - function resolveScriptReference(sourceFile, reference) { - var referenceFileName = compilerOptions.noResolve ? reference.filename : ts.normalizePath(ts.combinePaths(ts.getDirectoryPath(sourceFile.filename), reference.filename)); + function tryResolveScriptReference(sourceFile, reference) { + var referenceFileName = ts.normalizePath(ts.combinePaths(ts.getDirectoryPath(sourceFile.filename), reference.filename)); return program.getSourceFile(referenceFileName); } var referencePathsOutput = ""; function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 512 /* DeclarationFile */ ? referencedFile.filename : shouldEmitToOwnFile(referencedFile) ? getOwnEmitOutputFilePath(referencedFile, ".d.ts") : ts.getModuleNameFromFilename(compilerOptions.out) + ".d.ts"; - declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, compilerHost.getCurrentDirectory(), false); - referencePathsOutput += "/// " + newLine; + var declFileName = referencedFile.flags & 1024 /* DeclarationFile */ ? referencedFile.filename : shouldEmitToOwnFile(referencedFile, compilerOptions) ? getOwnEmitOutputFilePath(referencedFile, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; + declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, false); + referencePathsOutput += "/// " + newLine; } if (root) { - var addedGlobalFileReference = false; - ts.forEach(root.referencedFiles, function (fileReference) { - var referencedFile = resolveScriptReference(root, fileReference); - if ((referencedFile.flags & 512 /* DeclarationFile */) || shouldEmitToOwnFile(referencedFile) || !addedGlobalFileReference) { - writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { - addedGlobalFileReference = true; + if (!compilerOptions.noResolve) { + var addedGlobalFileReference = false; + ts.forEach(root.referencedFiles, function (fileReference) { + var referencedFile = tryResolveScriptReference(root, fileReference); + if (referencedFile && ((referencedFile.flags & 1024 /* DeclarationFile */) || shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { + writeReferencePath(referencedFile); + if (!isExternalModuleOrDeclarationFile(referencedFile)) { + addedGlobalFileReference = true; + } } - } - }); + }); + } emitNode(root); } else { var emittedReferencedFiles = []; ts.forEach(program.getSourceFiles(), function (sourceFile) { if (!isExternalModuleOrDeclarationFile(sourceFile)) { - ts.forEach(sourceFile.referencedFiles, function (fileReference) { - var referencedFile = resolveScriptReference(sourceFile, fileReference); - if (isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile)) { - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); + if (!compilerOptions.noResolve) { + ts.forEach(sourceFile.referencedFiles, function (fileReference) { + var referencedFile = tryResolveScriptReference(sourceFile, fileReference); + if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { + writeReferencePath(referencedFile); + emittedReferencedFiles.push(referencedFile); + } + }); + } emitNode(sourceFile); } }); @@ -8376,29 +9238,61 @@ var ts; } }); declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); - writeFile(ts.getModuleNameFromFilename(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); + writeFile(ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); } } - var shouldEmitDeclarations = resolver.shouldEmitDeclarations(); + var hasSemanticErrors = resolver.hasSemanticErrors(); + var isEmitBlocked = resolver.isEmitBlocked(targetSourceFile); function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (shouldEmitDeclarations) { - emitDeclarations(jsFilePath, sourceFile); + if (!isEmitBlocked) { + emitJavaScript(jsFilePath, sourceFile); + if (!hasSemanticErrors && compilerOptions.declaration) { + emitDeclarations(jsFilePath, sourceFile); + } } } - ts.forEach(program.getSourceFiles(), function (sourceFile) { - if (shouldEmitToOwnFile(sourceFile)) { - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, ".js"); - emitFile(jsFilePath, sourceFile); + if (targetSourceFile === undefined) { + ts.forEach(program.getSourceFiles(), function (sourceFile) { + if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, ".js"); + emitFile(jsFilePath, sourceFile); + } + }); + if (compilerOptions.out) { + emitFile(compilerOptions.out); + } + } + else { + if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { + var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, ".js"); + emitFile(jsFilePath, targetSourceFile); + } + else if (!ts.isDeclarationFile(targetSourceFile) && compilerOptions.out) { + emitFile(compilerOptions.out); } - }); - if (compilerOptions.out) { - emitFile(compilerOptions.out); } diagnostics.sort(ts.compareDiagnostics); diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); + var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); + var emitResultStatus; + if (isEmitBlocked) { + emitResultStatus = 1 /* AllOutputGenerationSkipped */; + } + else if (hasEmitterError) { + emitResultStatus = 4 /* EmitErrorsEncountered */; + } + else if (hasSemanticErrors && compilerOptions.declaration) { + emitResultStatus = 3 /* DeclarationGenerationSkipped */; + } + else if (hasSemanticErrors && !compilerOptions.declaration) { + emitResultStatus = 2 /* JSGeneratedWithSemanticErrors */; + } + else { + emitResultStatus = 0 /* Succeeded */; + } return { - errors: diagnostics, + emitResultStatus: emitResultStatus, + diagnostics: diagnostics, sourceMaps: sourceMapDataList }; } @@ -8409,6 +9303,44 @@ var ts; var nextSymbolId = 1; var nextNodeId = 1; var nextMergeId = 1; + function getDeclarationOfKind(symbol, kind) { + var declarations = symbol.declarations; + for (var i = 0; i < declarations.length; i++) { + var declaration = declarations[i]; + if (declaration.kind === kind) { + return declaration; + } + } + return undefined; + } + ts.getDeclarationOfKind = getDeclarationOfKind; + var stringWriters = []; + function getSingleLineStringWriter() { + if (stringWriters.length == 0) { + var str = ""; + var writeText = function (text) { return str += text; }; + return { + string: function () { return str; }, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeParameter: writeText, + writeSymbol: writeText, + writeLine: function () { return str += " "; }, + increaseIndent: function () { + }, + decreaseIndent: function () { + }, + clear: function () { return str = ""; }, + trackSymbol: function () { + } + }; + } + return stringWriters.pop(); + } + ts.getSingleLineStringWriter = getSingleLineStringWriter; function createTypeChecker(program, fullTypeCheck) { var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); @@ -8416,18 +9348,22 @@ var ts; var typeCount = 0; var emptyArray = []; var emptySymbols = {}; + var compilerOptions = program.getCompilerOptions(); var checker = { getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, getTypeCount: function () { return typeCount; }, + isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, checkProgram: checkProgram, - emitFiles: invokeEmitter, + invokeEmitter: invokeEmitter, getParentOfSymbol: getParentOfSymbol, - getTypeOfSymbol: getTypeOfSymbol, + getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, getSignaturesOfType: getSignaturesOfType, @@ -8435,16 +9371,28 @@ var ts; getReturnTypeOfSignature: getReturnTypeOfSignature, getSymbolsInScope: getSymbolsInScope, getSymbolInfo: getSymbolInfo, + getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, getTypeOfNode: getTypeOfNode, - getApparentType: getApparentType, typeToString: typeToString, + getSymbolDisplayBuilder: getSymbolDisplayBuilder, symbolToString: symbolToString, - getAugmentedPropertiesOfApparentType: getAugmentedPropertiesOfApparentType + getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, + getRootSymbols: getRootSymbols, + getContextualType: getContextualType, + getFullyQualifiedName: getFullyQualifiedName, + getResolvedSignature: getResolvedSignature, + getEnumMemberValue: getEnumMemberValue, + isValidPropertyAccess: isValidPropertyAccess, + getSignatureFromDeclaration: getSignatureFromDeclaration, + isImplementationOfOverload: isImplementationOfOverload, + getAliasedSymbol: resolveImport, + hasEarlyErrors: hasEarlyErrors, + isEmitBlocked: isEmitBlocked }; - var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); - var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(33554432 /* Transient */, "__resolving__"); + var undefinedSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "arguments"); + var unknownSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(268435456 /* Transient */, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); @@ -8457,6 +9405,7 @@ var ts; var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); var globals = {}; @@ -8468,6 +9417,9 @@ var ts; var globalNumberType; var globalBooleanType; var globalRegExpType; + var globalTemplateStringsArrayType; + var tupleTypes = {}; + var unionTypes = {}; var stringLiteralTypes = {}; var emitExtends = false; var mergedSymbols = []; @@ -8489,32 +9441,38 @@ var ts; } function getExcludedSymbolFlags(flags) { var result = 0; - if (flags & 1 /* Variable */) - result |= ts.SymbolFlags.VariableExcludes; - if (flags & 2 /* Property */) - result |= ts.SymbolFlags.PropertyExcludes; - if (flags & 4 /* EnumMember */) - result |= ts.SymbolFlags.EnumMemberExcludes; - if (flags & 8 /* Function */) - result |= ts.SymbolFlags.FunctionExcludes; - if (flags & 16 /* Class */) - result |= ts.SymbolFlags.ClassExcludes; - if (flags & 32 /* Interface */) - result |= ts.SymbolFlags.InterfaceExcludes; - if (flags & 64 /* Enum */) - result |= ts.SymbolFlags.EnumExcludes; - if (flags & 128 /* ValueModule */) - result |= ts.SymbolFlags.ValueModuleExcludes; - if (flags & 2048 /* Method */) - result |= ts.SymbolFlags.MethodExcludes; - if (flags & 8192 /* GetAccessor */) - result |= ts.SymbolFlags.GetAccessorExcludes; - if (flags & 16384 /* SetAccessor */) - result |= ts.SymbolFlags.SetAccessorExcludes; - if (flags & 262144 /* TypeParameter */) - result |= ts.SymbolFlags.TypeParameterExcludes; - if (flags & 4194304 /* Import */) - result |= ts.SymbolFlags.ImportExcludes; + if (flags & 2 /* BlockScopedVariable */) + result |= 107455 /* BlockScopedVariableExcludes */; + if (flags & 1 /* FunctionScopedVariable */) + result |= 107454 /* FunctionScopedVariableExcludes */; + if (flags & 4 /* Property */) + result |= 107455 /* PropertyExcludes */; + if (flags & 8 /* EnumMember */) + result |= 107455 /* EnumMemberExcludes */; + if (flags & 16 /* Function */) + result |= 106927 /* FunctionExcludes */; + if (flags & 32 /* Class */) + result |= 3258879 /* ClassExcludes */; + if (flags & 64 /* Interface */) + result |= 3152288 /* InterfaceExcludes */; + if (flags & 256 /* RegularEnum */) + result |= 3258623 /* RegularEnumExcludes */; + if (flags & 128 /* ConstEnum */) + result |= 3259263 /* ConstEnumExcludes */; + if (flags & 512 /* ValueModule */) + result |= 106639 /* ValueModuleExcludes */; + if (flags & 8192 /* Method */) + result |= 99263 /* MethodExcludes */; + if (flags & 32768 /* GetAccessor */) + result |= 41919 /* GetAccessorExcludes */; + if (flags & 65536 /* SetAccessor */) + result |= 74687 /* SetAccessorExcludes */; + if (flags & 1048576 /* TypeParameter */) + result |= 2103776 /* TypeParameterExcludes */; + if (flags & 2097152 /* TypeAlias */) + result |= 3152352 /* TypeAliasExcludes */; + if (flags & 33554432 /* Import */) + result |= 33554432 /* ImportExcludes */; return result; } function recordMergedSymbol(target, source) { @@ -8523,11 +9481,13 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 16777216 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags | 134217728 /* Merged */, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; if (symbol.members) result.members = cloneSymbolTable(symbol.members); if (symbol.exports) @@ -8537,6 +9497,9 @@ var ts; } function extendSymbol(target, source) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + target.constEnumOnlyModule = false; + } target.flags |= source.flags; if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; @@ -8556,8 +9519,12 @@ var ts; recordMergedSymbol(target, source); } else { + var message = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { - error(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, symbolToString(source)); + error(node.name ? node.name : node, message, symbolToString(source)); + }); + ts.forEach(target.declarations, function (node) { + error(node.name ? node.name : node, message, symbolToString(source)); }); } } @@ -8578,7 +9545,7 @@ var ts; } else { var symbol = target[id]; - if (!(symbol.flags & 16777216 /* Merged */)) { + if (!(symbol.flags & 134217728 /* Merged */)) { target[id] = symbol = cloneSymbol(symbol); } extendSymbol(symbol, source[id]); @@ -8587,7 +9554,7 @@ var ts; } } function getSymbolLinks(symbol) { - if (symbol.flags & 33554432 /* Transient */) + if (symbol.flags & 268435456 /* Transient */) return symbol; if (!symbol.id) symbol.id = nextSymbolId++; @@ -8599,19 +9566,19 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return getAncestor(node, 177 /* SourceFile */); + return ts.getAncestor(node, 196 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 177 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 196 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { var target = resolveImport(symbol); if (target === unknownSymbol || target.flags & meaning) { return symbol; @@ -8619,104 +9586,127 @@ var ts; } } } + function isDefinedBefore(node1, node2) { + var file1 = ts.getSourceFileOfNode(node1); + var file2 = ts.getSourceFileOfNode(node2); + if (file1 === file2) { + return node1.pos <= node2.pos; + } + if (!compilerOptions.out) { + return true; + } + var sourceFiles = program.getSourceFiles(); + return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); + } function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { - var errorLocation = location; var result; var lastLocation; - var memberWithInitializerThatReferencesIdentifierFromConstructor; - function returnResolvedSymbol(s) { - if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { - var propertyName = memberWithInitializerThatReferencesIdentifierFromConstructor.name; - error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), nameArg); - return undefined; - } - if (!s && nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, nameArg); - } - return s; - } - while (location) { + var propertyWithInvalidInitializer; + var errorLocation = location; + loop: while (location) { if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - return returnResolvedSymbol(result); + break loop; } } switch (location.kind) { - case 177 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 172 /* ModuleDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { - return returnResolvedSymbol(result); + case 191 /* ModuleDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 35653619 /* ModuleMember */)) { + break loop; } break; - case 171 /* EnumDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 4 /* EnumMember */)) { - return returnResolvedSymbol(result); + case 190 /* EnumDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { + break loop; } break; - case 115 /* Property */: - if (location.parent.kind === 169 /* ClassDeclaration */ && !(location.flags & 64 /* Static */)) { + case 124 /* Property */: + if (location.parent.kind === 187 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { - memberWithInitializerThatReferencesIdentifierFromConstructor = location; + if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { + propertyWithInvalidInitializer = location; } } } break; - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { - if (lastLocation && lastLocation.flags & 64 /* Static */) { + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 3152352 /* Type */)) { + if (lastLocation && lastLocation.flags & 128 /* Static */) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } - else { - return returnResolvedSymbol(result); - } + break loop; } break; - case 116 /* Method */: - case 117 /* Constructor */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 167 /* FunctionDeclaration */: - case 137 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } break; - case 136 /* FunctionExpression */: + case 152 /* FunctionExpression */: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } var id = location.name; if (id && name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; - case 163 /* CatchBlock */: + case 181 /* CatchBlock */: var id = location.variable; if (name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; } lastLocation = location; location = location.parent; } - if (result = getSymbol(globals, name, meaning)) { - return returnResolvedSymbol(result); + if (!result) { + result = getSymbol(globals, name, meaning); } - return returnResolvedSymbol(undefined); + if (!result) { + if (nameNotFoundMessage) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + } + return undefined; + } + if (nameNotFoundMessage) { + if (propertyWithInvalidInitializer) { + var propertyName = propertyWithInvalidInitializer.name; + error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + return undefined; + } + if (result.flags & 2 /* BlockScopedVariable */) { + var declaration = ts.forEach(result.declarations, function (d) { return d.flags & 6144 /* BlockScoped */ ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + if (!isDefinedBefore(declaration, errorLocation)) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + } + } + return result; } function resolveImport(symbol) { - ts.Debug.assert((symbol.flags & 4194304 /* Import */) !== 0, "Should only get Imports here."); + ts.Debug.assert((symbol.flags & 33554432 /* Import */) !== 0, "Should only get Imports here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 174 /* ImportDeclaration */); + var node = getDeclarationOfKind(symbol, 193 /* ImportDeclaration */); var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -8732,44 +9722,44 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = getAncestor(entityName, 174 /* ImportDeclaration */); - ts.Debug.assert(importDeclaration); + importDeclaration = ts.getAncestor(entityName, 193 /* ImportDeclaration */); + ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 55 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 63 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 55 /* Identifier */ || entityName.parent.kind === 112 /* QualifiedName */) { - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Namespace); + if (entityName.kind === 63 /* Identifier */ || entityName.parent.kind === 121 /* QualifiedName */) { + return resolveEntityName(importDeclaration, entityName, 1536 /* Namespace */); } else { - ts.Debug.assert(entityName.parent.kind === 174 /* ImportDeclaration */); - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace); + ts.Debug.assert(entityName.parent.kind === 193 /* ImportDeclaration */); + return resolveEntityName(importDeclaration, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } function resolveEntityName(location, name, meaning) { - if (name.kind === 55 /* Identifier */) { - var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(name)); + if (name.kind === 63 /* Identifier */) { + var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return; } } - else if (name.kind === 112 /* QualifiedName */) { - var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || name.right.kind === 111 /* Missing */) + else if (name.kind === 121 /* QualifiedName */) { + var namespace = resolveEntityName(location, name.left, 1536 /* Namespace */); + if (!namespace || namespace === unknownSymbol || name.right.kind === 120 /* Missing */) return; var symbol = getSymbol(namespace.exports, name.right.text, meaning); if (!symbol) { - error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.identifierToString(name.right)); + error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(name.right)); return; } } else { return; } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveImport(symbol); } function isExternalModuleNameRelative(moduleName) { @@ -8782,7 +9772,7 @@ var ts; return; var isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 128 /* ValueModule */); + var symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */); if (symbol) { return getResolvedExportSymbol(symbol); } @@ -8809,10 +9799,10 @@ var ts; function getResolvedExportSymbol(moduleSymbol) { var symbol = getExportAssignmentSymbol(moduleSymbol); if (symbol) { - if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { + if (symbol.flags & (107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */)) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return resolveImport(symbol); } } @@ -8836,8 +9826,8 @@ var ts; error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } if (node.exportName.text) { - var meaning = ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace; - var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node.exportName)); + var meaning = 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */; + var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, node.exportName); } } symbolLinks.exportAssignSymbol = exportSymbol || unknownSymbol; @@ -8847,9 +9837,9 @@ var ts; var seenExportedMember = false; var result = []; ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 177 /* SourceFile */ ? declaration : declaration.body); + var block = (declaration.kind === 196 /* SourceFile */ ? declaration : declaration.body); ts.forEach(block.statements, function (node) { - if (node.kind === 175 /* ExportAssignment */) { + if (node.kind === 194 /* ExportAssignment */) { result.push(node); } else { @@ -8873,35 +9863,25 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 524288 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; + return symbol && (symbol.flags & 4194304 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & ts.SymbolFlags.Value) { + if (symbol.flags & 67108864 /* Instantiated */) { + return symbolIsValue(getSymbolLinks(symbol).target); + } + if (symbol.flags & 107455 /* Value */) { return true; } - if (symbol.flags & 4194304 /* Import */) { - return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; - } - if (symbol.flags & 8388608 /* Instantiated */) { - return (getSymbolLinks(symbol).target.flags & ts.SymbolFlags.Value) !== 0; + if (symbol.flags & 33554432 /* Import */) { + return (resolveImport(symbol).flags & 107455 /* Value */) !== 0; } return false; } - function getDeclarationOfKind(symbol, kind) { - var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; - if (declaration.kind === kind) { - return declaration; - } - } - return undefined; - } function findConstructorDeclaration(node) { var members = node.members; for (var i = 0; i < members.length; i++) { var member = members[i]; - if (member.kind === 117 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } } @@ -8952,13 +9932,10 @@ var ts; return type; } function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { - return setObjectTypeMembers(createObjectType(8192 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function isOptionalProperty(propertySymbol) { - if (propertySymbol.flags & 67108864 /* Prototype */) { - return false; - } - return (propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */) && propertySymbol.valueDeclaration.kind !== 114 /* Parameter */; + return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 123 /* Parameter */; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; @@ -8969,17 +9946,17 @@ var ts; } } switch (location.kind) { - case 177 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location).members)) { return result; } @@ -8989,15 +9966,15 @@ var ts; return callback(globals); } function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === ts.SymbolFlags.Value ? ts.SymbolFlags.Value : ts.SymbolFlags.Namespace; + return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1536 /* Namespace */; } - function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning) { + function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { function canQualifySymbol(symbolFromSymbolTable, meaning) { if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { return true; } - var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning)); + var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); return !!accessibleParent; } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { @@ -9009,14 +9986,16 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 4194304 /* Import */) { - var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + if (symbolFromSymbolTable.flags & 33554432 /* Import */) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 193 /* ImportDeclaration */ && declaration.externalModuleName; })) { + var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); + if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { + return [symbolFromSymbolTable]; + } + var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + } } } }); @@ -9035,7 +10014,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 4194304 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 33554432 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -9045,18 +10024,18 @@ var ts; return qualify; } function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { + if (symbol && enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook); + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook, false); if (accessibleSymbolChain) { var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); if (!hasAccessibleDeclarations) { return { accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, ts.SymbolFlags.Namespace) : undefined + errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536 /* Namespace */) : undefined }; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; @@ -9090,7 +10069,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 172 /* ModuleDeclaration */ && declaration.name.kind === 3 /* StringLiteral */) || (declaration.kind === 177 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 191 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 196 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9100,7 +10079,7 @@ var ts; return { aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 174 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 193 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -9119,268 +10098,438 @@ var ts; } function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName) { var firstIdentifier = getFirstIdentifier(entityName); - var firstIdentifierName = ts.identifierToString(firstIdentifier); - var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, ts.SymbolFlags.Namespace, ts.Diagnostics.Cannot_find_name_0, firstIdentifierName); + var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: firstIdentifierName }; + return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: ts.declarationNameToString(firstIdentifier) }; + } + function releaseStringWriter(writer) { + writer.clear(); + stringWriters.push(writer); + } + function writeKeyword(writer, kind) { + writer.writeKeyword(ts.tokenToString(kind)); + } + function writePunctuation(writer, kind) { + writer.writePunctuation(ts.tokenToString(kind)); + } + function writeOperator(writer, kind) { + writer.writeOperator(ts.tokenToString(kind)); + } + function writeSpace(writer) { + writer.writeSpace(" "); } function symbolToString(symbol, enclosingDeclaration, meaning) { - function getSymbolName(symbol) { + var writer = getSingleLineStringWriter(); + getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning); + var result = writer.string(); + releaseStringWriter(writer); + return result; + } + function typeToString(type, enclosingDeclaration, flags) { + var writer = getSingleLineStringWriter(); + getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + var result = writer.string(); + releaseStringWriter(writer); + var maxLength = compilerOptions.noErrorTruncation || flags & 4 /* NoTruncation */ ? undefined : 100; + if (maxLength && result.length >= maxLength) { + result = result.substr(0, maxLength - "...".length) + "..."; + } + return result; + } + function getTypeAliasForTypeLiteral(type) { + if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { + var node = type.symbol.declarations[0].parent; + while (node.kind === 140 /* ParenType */) { + node = node.parent; + } + if (node.kind === 189 /* TypeAliasDeclaration */) { + return getSymbolOfNode(node); + } + } + return undefined; + } + var _displayBuilder; + function getSymbolDisplayBuilder() { + function appendSymbolNameOnly(symbol, writer) { if (symbol.declarations && symbol.declarations.length > 0) { var declaration = symbol.declarations[0]; if (declaration.name) { - return ts.identifierToString(declaration.name); - } - } - return symbol.name; - } - if (enclosingDeclaration && !(symbol.flags & (ts.SymbolFlags.PropertyOrAccessor | ts.SymbolFlags.Signature | 4096 /* Constructor */ | 2048 /* Method */ | 262144 /* TypeParameter */))) { - var symbolName; - while (symbol) { - var isFirstName = !symbolName; - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning); - var currentSymbolName; - if (accessibleSymbolChain) { - currentSymbolName = ts.map(accessibleSymbolChain, function (accessibleSymbol) { return getSymbolName(accessibleSymbol); }).join("."); - } - else { - if (!isFirstName && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { - break; - } - currentSymbolName = getSymbolName(symbol); - } - symbolName = currentSymbolName + (isFirstName ? "" : ("." + symbolName)); - if (accessibleSymbolChain && !needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - break; - } - symbol = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - meaning = getQualifiedLeftMeaning(meaning); - } - return symbolName; - } - return getSymbolName(symbol); - } - function writeSymbolToTextWriter(symbol, enclosingDeclaration, meaning, writer) { - writer.write(symbolToString(symbol, enclosingDeclaration, meaning)); - } - function createSingleLineTextWriter() { - var result = ""; - return { - write: function (s) { - result += s; - }, - writeSymbol: function (symbol, enclosingDeclaration, meaning) { - writeSymbolToTextWriter(symbol, enclosingDeclaration, meaning, this); - }, - writeLine: function () { - result += " "; - }, - increaseIndent: function () { - }, - decreaseIndent: function () { - }, - getText: function () { - return result; - } - }; - } - function typeToString(type, enclosingDeclaration, flags) { - var stringWriter = createSingleLineTextWriter(); - writeTypeToTextWriter(type, enclosingDeclaration, flags, stringWriter); - return stringWriter.getText(); - } - function writeTypeToTextWriter(type, enclosingDeclaration, flags, writer) { - var typeStack; - return writeType(type, true); - function writeType(type, allowFunctionOrConstructorTypeLiteral) { - if (type.flags & ts.TypeFlags.Intrinsic) { - writer.write(type.intrinsicName); - } - else if (type.flags & 4096 /* Reference */) { - writeTypeReference(type); - } - else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { - writer.writeSymbol(type.symbol, enclosingDeclaration, ts.SymbolFlags.Type); - } - else if (type.flags & 8192 /* Anonymous */) { - writeAnonymousType(type, allowFunctionOrConstructorTypeLiteral); - } - else if (type.flags & 256 /* StringLiteral */) { - writer.write(type.text); - } - else { - writer.write("{ ... }"); - } - } - function writeTypeReference(type) { - if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { - writeType(type.typeArguments[0], false); - writer.write("[]"); - } - else { - writer.writeSymbol(type.target.symbol, enclosingDeclaration, ts.SymbolFlags.Type); - writer.write("<"); - for (var i = 0; i < type.typeArguments.length; i++) { - if (i > 0) { - writer.write(", "); - } - writeType(type.typeArguments[i], true); - } - writer.write(">"); - } - } - function writeAnonymousType(type, allowFunctionOrConstructorTypeLiteral) { - if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { - writeTypeofSymbol(type); - } - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeofSymbol(type); - } - else if (typeStack && ts.contains(typeStack, type)) { - writer.write("any"); - } - else { - if (!typeStack) { - typeStack = []; - } - typeStack.push(type); - writeLiteralType(type, allowFunctionOrConstructorTypeLiteral); - typeStack.pop(); - } - function shouldWriteTypeOfFunctionSymbol() { - if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 2048 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 64 /* Static */; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 8 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 177 /* SourceFile */ || declaration.parent.kind === 173 /* ModuleBlock */; })); - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); - } - } - } - } - function writeTypeofSymbol(type) { - writer.write("typeof "); - writer.writeSymbol(type.symbol, enclosingDeclaration, ts.SymbolFlags.Value); - } - function writeLiteralType(type, allowFunctionOrConstructorTypeLiteral) { - var resolved = resolveObjectTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writer.write("{}"); + writer.writeSymbol(ts.declarationNameToString(declaration.name), symbol); return; } - if (allowFunctionOrConstructorTypeLiteral) { + } + writer.writeSymbol(symbol.name, symbol); + } + function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags) { + var parentSymbol; + function appendParentTypeArgumentsAndSymbolName(symbol) { + if (parentSymbol) { + if (flags & 1 /* WriteTypeParametersOrArguments */) { + if (symbol.flags & 67108864 /* Instantiated */) { + buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); + } + else { + buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); + } + } + writePunctuation(writer, 19 /* DotToken */); + } + parentSymbol = symbol; + appendSymbolNameOnly(symbol, writer); + } + writer.trackSymbol(symbol, enclosingDeclaration, meaning); + function walkSymbol(symbol, meaning) { + if (symbol) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */)); + if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); + } + if (accessibleSymbolChain) { + for (var i = 0, n = accessibleSymbolChain.length; i < n; i++) { + appendParentTypeArgumentsAndSymbolName(accessibleSymbolChain[i]); + } + } + else { + if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { + return; + } + if (symbol.flags & 2048 /* TypeLiteral */ || symbol.flags & 4096 /* ObjectLiteral */) { + return; + } + appendParentTypeArgumentsAndSymbolName(symbol); + } + } + } + if (enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { + walkSymbol(symbol, meaning); + return; + } + return appendParentTypeArgumentsAndSymbolName(symbol); + } + function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, typeStack) { + var globalFlagsToPass = globalFlags & 16 /* WriteOwnNameForAnyLike */; + return writeType(type, globalFlags); + function writeType(type, flags) { + if (type.flags & 127 /* Intrinsic */) { + writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && (type.flags & 1 /* Any */) ? "any" : type.intrinsicName); + } + else if (type.flags & 4096 /* Reference */) { + writeTypeReference(type, flags); + } + else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 3152352 /* Type */); + } + else if (type.flags & 8192 /* Tuple */) { + writeTupleType(type); + } + else if (type.flags & 16384 /* Union */) { + writeUnionType(type, flags); + } + else if (type.flags & 32768 /* Anonymous */) { + writeAnonymousType(type, flags); + } + else if (type.flags & 256 /* StringLiteral */) { + writer.writeStringLiteral(type.text); + } + else { + writePunctuation(writer, 13 /* OpenBraceToken */); + writeSpace(writer); + writePunctuation(writer, 20 /* DotDotDotToken */); + writeSpace(writer); + writePunctuation(writer, 14 /* CloseBraceToken */); + } + } + function writeTypeList(types, union) { + for (var i = 0; i < types.length; i++) { + if (i > 0) { + if (union) { + writeSpace(writer); + } + writePunctuation(writer, union ? 43 /* BarToken */ : 22 /* CommaToken */); + writeSpace(writer); + } + writeType(types[i], union ? 64 /* InElementType */ : 0 /* None */); + } + } + function writeTypeReference(type, flags) { + if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { + writeType(type.typeArguments[0], 64 /* InElementType */); + writePunctuation(writer, 17 /* OpenBracketToken */); + writePunctuation(writer, 18 /* CloseBracketToken */); + } + else { + buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 3152352 /* Type */); + writePunctuation(writer, 23 /* LessThanToken */); + writeTypeList(type.typeArguments, false); + writePunctuation(writer, 24 /* GreaterThanToken */); + } + } + function writeTupleType(type) { + writePunctuation(writer, 17 /* OpenBracketToken */); + writeTypeList(type.elementTypes, false); + writePunctuation(writer, 18 /* CloseBracketToken */); + } + function writeUnionType(type, flags) { + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 15 /* OpenParenToken */); + } + writeTypeList(type.types, true); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* CloseParenToken */); + } + } + function writeAnonymousType(type, flags) { + if (type.symbol && type.symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { + writeTypeofSymbol(type); + } + else if (shouldWriteTypeOfFunctionSymbol()) { + writeTypeofSymbol(type); + } + else if (typeStack && ts.contains(typeStack, type)) { + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 3152352 /* Type */); + } + else { + writeKeyword(writer, 109 /* AnyKeyword */); + } + } + else { + if (!typeStack) { + typeStack = []; + } + typeStack.push(type); + writeLiteralType(type, flags); + typeStack.pop(); + } + function shouldWriteTypeOfFunctionSymbol() { + if (type.symbol) { + var isStaticMethodSymbol = !!(type.symbol.flags & 8192 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 196 /* SourceFile */ || declaration.parent.kind === 192 /* ModuleBlock */; })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); + } + } + } + } + function writeTypeofSymbol(type) { + writeKeyword(writer, 95 /* TypeOfKeyword */); + writeSpace(writer); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */); + } + function writeLiteralType(type, flags) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + writePunctuation(writer, 13 /* OpenBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); + return; + } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - writeSignature(resolved.callSignatures[0], true); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 15 /* OpenParenToken */); + } + buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* CloseParenToken */); + } return; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - writer.write("new "); - writeSignature(resolved.constructSignatures[0], true); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 15 /* OpenParenToken */); + } + writeKeyword(writer, 86 /* NewKeyword */); + writeSpace(writer); + buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* CloseParenToken */); + } return; } } - } - writer.write("{"); - writer.writeLine(); - writer.increaseIndent(); - for (var i = 0; i < resolved.callSignatures.length; i++) { - writeSignature(resolved.callSignatures[i]); - writer.write(";"); + writePunctuation(writer, 13 /* OpenBraceToken */); writer.writeLine(); - } - for (var i = 0; i < resolved.constructSignatures.length; i++) { - writer.write("new "); - writeSignature(resolved.constructSignatures[i]); - writer.write(";"); - writer.writeLine(); - } - if (resolved.stringIndexType) { - writer.write("[x: string]: "); - writeType(resolved.stringIndexType, true); - writer.write(";"); - writer.writeLine(); - } - if (resolved.numberIndexType) { - writer.write("[x: number]: "); - writeType(resolved.numberIndexType, true); - writer.write(";"); - writer.writeLine(); - } - for (var i = 0; i < resolved.properties.length; i++) { - var p = resolved.properties[i]; - var t = getTypeOfSymbol(p); - if (p.flags & (8 /* Function */ | 2048 /* Method */) && !getPropertiesOfType(t).length) { - var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var j = 0; j < signatures.length; j++) { - writer.writeSymbol(p); - if (isOptionalProperty(p)) { - writer.write("?"); + writer.increaseIndent(); + for (var i = 0; i < resolved.callSignatures.length; i++) { + buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + writePunctuation(writer, 21 /* SemicolonToken */); + writer.writeLine(); + } + for (var i = 0; i < resolved.constructSignatures.length; i++) { + writeKeyword(writer, 86 /* NewKeyword */); + writeSpace(writer); + buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + writePunctuation(writer, 21 /* SemicolonToken */); + writer.writeLine(); + } + if (resolved.stringIndexType) { + writePunctuation(writer, 17 /* OpenBracketToken */); + writer.writeParameter("x"); + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + writeKeyword(writer, 118 /* StringKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + writeType(resolved.stringIndexType, 0 /* None */); + writePunctuation(writer, 21 /* SemicolonToken */); + writer.writeLine(); + } + if (resolved.numberIndexType) { + writePunctuation(writer, 17 /* OpenBracketToken */); + writer.writeParameter("x"); + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + writeKeyword(writer, 116 /* NumberKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + writeType(resolved.numberIndexType, 0 /* None */); + writePunctuation(writer, 21 /* SemicolonToken */); + writer.writeLine(); + } + for (var i = 0; i < resolved.properties.length; i++) { + var p = resolved.properties[i]; + var t = getTypeOfSymbol(p); + if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { + var signatures = getSignaturesOfType(t, 0 /* Call */); + for (var j = 0; j < signatures.length; j++) { + buildSymbolDisplay(p, writer); + if (isOptionalProperty(p)) { + writePunctuation(writer, 49 /* QuestionToken */); + } + buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + writePunctuation(writer, 21 /* SemicolonToken */); + writer.writeLine(); } - writeSignature(signatures[j]); - writer.write(";"); + } + else { + buildSymbolDisplay(p, writer); + if (isOptionalProperty(p)) { + writePunctuation(writer, 49 /* QuestionToken */); + } + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + writeType(t, 0 /* None */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } } - else { - writer.writeSymbol(p); - if (isOptionalProperty(p)) { - writer.write("?"); - } - writer.write(": "); - writeType(t, true); - writer.write(";"); - writer.writeLine(); - } + writer.decreaseIndent(); + writePunctuation(writer, 14 /* CloseBraceToken */); } - writer.decreaseIndent(); - writer.write("}"); } - function writeSignature(signature, arrowStyle) { - if (signature.typeParameters) { - writer.write("<"); - for (var i = 0; i < signature.typeParameters.length; i++) { + function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { + var targetSymbol = getTargetSymbol(symbol); + if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */) { + buildDisplayForTypeParametersAndDelimiters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); + } + } + function buildTypeParameterDisplay(tp, writer, enclosingDeclaration, flags, typeStack) { + appendSymbolNameOnly(tp.symbol, writer); + var constraint = getConstraintOfTypeParameter(tp); + if (constraint) { + writeSpace(writer); + writeKeyword(writer, 77 /* ExtendsKeyword */); + writeSpace(writer); + buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); + } + } + function buildParameterDisplay(p, writer, enclosingDeclaration, flags, typeStack) { + if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { + writePunctuation(writer, 20 /* DotDotDotToken */); + } + appendSymbolNameOnly(p, writer); + if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { + writePunctuation(writer, 49 /* QuestionToken */); + } + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); + } + function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, typeStack) { + if (typeParameters && typeParameters.length) { + writePunctuation(writer, 23 /* LessThanToken */); + for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writer.write(", "); - } - var tp = signature.typeParameters[i]; - writer.writeSymbol(tp.symbol); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writer.write(" extends "); - writeType(constraint, true); + writePunctuation(writer, 22 /* CommaToken */); + writeSpace(writer); } + buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); } - writer.write(">"); + writePunctuation(writer, 24 /* GreaterThanToken */); } - writer.write("("); - for (var i = 0; i < signature.parameters.length; i++) { - if (i > 0) { - writer.write(", "); - } - var p = signature.parameters[i]; - if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { - writer.write("..."); - } - writer.writeSymbol(p); - if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { - writer.write("?"); - } - writer.write(": "); - writeType(getTypeOfSymbol(p), true); - } - writer.write(arrowStyle ? ") => " : "): "); - writeType(getReturnTypeOfSignature(signature), true); } + function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) { + if (typeParameters && typeParameters.length) { + writePunctuation(writer, 23 /* LessThanToken */); + for (var i = 0; i < typeParameters.length; i++) { + if (i > 0) { + writePunctuation(writer, 22 /* CommaToken */); + writeSpace(writer); + } + buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0 /* None */); + } + writePunctuation(writer, 24 /* GreaterThanToken */); + } + } + function buildDisplayForParametersAndDelimiters(parameters, writer, enclosingDeclaration, flags, typeStack) { + writePunctuation(writer, 15 /* OpenParenToken */); + for (var i = 0; i < parameters.length; i++) { + if (i > 0) { + writePunctuation(writer, 22 /* CommaToken */); + writeSpace(writer); + } + buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, typeStack); + } + writePunctuation(writer, 16 /* CloseParenToken */); + } + function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { + if (flags & 8 /* WriteArrowStyleSignature */) { + writeSpace(writer); + writePunctuation(writer, 31 /* EqualsGreaterThanToken */); + } + else { + writePunctuation(writer, 50 /* ColonToken */); + } + writeSpace(writer); + buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); + } + function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { + if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) { + buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); + } + else { + buildDisplayForTypeParametersAndDelimiters(signature.typeParameters, writer, enclosingDeclaration, flags, typeStack); + } + buildDisplayForParametersAndDelimiters(signature.parameters, writer, enclosingDeclaration, flags, typeStack); + buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack); + } + return _displayBuilder || (_displayBuilder = { + symbolToString: symbolToString, + typeToString: typeToString, + buildSymbolDisplay: buildSymbolDisplay, + buildTypeDisplay: buildTypeDisplay, + buildTypeParameterDisplay: buildTypeParameterDisplay, + buildParameterDisplay: buildParameterDisplay, + buildDisplayForParametersAndDelimiters: buildDisplayForParametersAndDelimiters, + buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, + buildDisplayForTypeArgumentsAndDelimiters: buildDisplayForTypeArgumentsAndDelimiters, + buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, + buildSignatureDisplay: buildSignatureDisplay, + buildReturnTypeDisplay: buildReturnTypeDisplay + }); } function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 172 /* ModuleDeclaration */) { - if (node.name.kind === 3 /* StringLiteral */) { + if (node.kind === 191 /* ModuleDeclaration */) { + if (node.name.kind === 7 /* StringLiteral */) { return node; } } - else if (node.kind === 177 /* SourceFile */) { + else if (node.kind === 196 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9396,7 +10545,7 @@ var ts; if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; } - if (symbolOfNode.flags & 4194304 /* Import */) { + if (symbolOfNode.flags & 33554432 /* Import */) { return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); } } @@ -9404,7 +10553,7 @@ var ts; if (exportAssignmentSymbol === symbol) { return true; } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 4194304 /* Import */)) { + if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 33554432 /* Import */)) { resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); if (resolvedExportSymbol === symbol) { return true; @@ -9422,34 +10571,35 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 166 /* VariableDeclaration */: - case 172 /* ModuleDeclaration */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 167 /* FunctionDeclaration */: - case 171 /* EnumDeclaration */: - case 174 /* ImportDeclaration */: - var parent = node.kind === 166 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 174 /* ImportDeclaration */ && parent.kind !== 177 /* SourceFile */ && ts.isInAmbientContext(parent))) { + case 184 /* VariableDeclaration */: + case 191 /* ModuleDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 185 /* FunctionDeclaration */: + case 190 /* EnumDeclaration */: + case 193 /* ImportDeclaration */: + var parent = node.kind === 184 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (!(node.flags & 1 /* Export */) && !(node.kind !== 193 /* ImportDeclaration */ && parent.kind !== 196 /* SourceFile */ && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); - case 115 /* Property */: - case 116 /* Method */: - if (node.flags & 32 /* Private */) { + case 124 /* Property */: + case 125 /* Method */: + if (node.flags & (32 /* Private */ | 64 /* Protected */)) { return false; } - case 117 /* Constructor */: - case 121 /* ConstructSignature */: - case 120 /* CallSignature */: - case 122 /* IndexSignature */: - case 114 /* Parameter */: - case 173 /* ModuleBlock */: + case 126 /* Constructor */: + case 130 /* ConstructSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: + case 123 /* Parameter */: + case 192 /* ModuleBlock */: return isDeclarationVisible(node.parent); - case 177 /* SourceFile */: + case 196 /* SourceFile */: return true; default: - ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } if (node) { @@ -9460,40 +10610,21 @@ var ts; return links.isVisible; } } - function getApparentType(type) { - if (type.flags & 512 /* TypeParameter */) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512 /* TypeParameter */); - if (!type) - type = emptyObjectType; - } - if (type.flags & ts.TypeFlags.StringLike) { - type = globalStringType; - } - else if (type.flags & ts.TypeFlags.NumberLike) { - type = globalNumberType; - } - else if (type.flags & 8 /* Boolean */) { - type = globalBooleanType; - } - return type; - } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } - function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 151 /* ForInStatement */) { + function getTypeOfVariableOrPropertyDeclaration(declaration) { + if (declaration.parent.kind === 169 /* ForInStatement */) { return anyType; } if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 114 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { var func = declaration.parent; - if (func.kind === 119 /* SetAccessor */) { - var getter = getDeclarationOfKind(declaration.parent.symbol, 118 /* GetAccessor */); + if (func.kind === 128 /* SetAccessor */) { + var getter = getDeclarationOfKind(declaration.parent.symbol, 127 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -9504,57 +10635,68 @@ var ts; } } if (declaration.initializer) { - var unwidenedType = checkAndMarkExpression(declaration.initializer); - var type = getWidenedType(unwidenedType); - if (type !== unwidenedType) { - checkImplicitAny(type); + var type = checkAndMarkExpression(declaration.initializer); + if (declaration.kind !== 143 /* PropertyAssignment */) { + var unwidenedType = type; + type = getWidenedType(type); + if (type !== unwidenedType) { + checkImplicitAny(type); + } } return type; } + if (declaration.kind === 144 /* ShorthandPropertyAssignment */) { + var type = checkIdentifier(declaration.name); + return type; + } var type = declaration.flags & 8 /* Rest */ ? createArrayType(anyType) : anyType; checkImplicitAny(type); return type; function checkImplicitAny(type) { - if (!fullTypeCheck || !program.getCompilerOptions().noImplicitAny) { + if (!fullTypeCheck || !compilerOptions.noImplicitAny) { return; } if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { return; } - if (isPrivateWithinAmbient(declaration) || (declaration.kind === 114 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { + if (isPrivateWithinAmbient(declaration) || (declaration.kind === 123 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { return; } switch (declaration.kind) { - case 115 /* Property */: + case 124 /* Property */: var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 114 /* Parameter */: + case 123 /* Parameter */: var diagnostic = declaration.flags & 8 /* Rest */ ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; default: var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } - error(declaration, diagnostic, ts.identifierToString(declaration.name), typeToString(type)); + error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeToString(type)); } } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 67108864 /* Prototype */) { + if (symbol.flags & 536870912 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.kind === 163 /* CatchBlock */) { + if (declaration.kind === 181 /* CatchBlock */) { return links.type = anyType; } links.type = resolvingType; - var type = getTypeOfVariableDeclaration(declaration); + var type = getTypeOfVariableOrPropertyDeclaration(declaration); if (links.type === resolvingType) { links.type = type; } } else if (links.type === resolvingType) { links.type = anyType; + if (compilerOptions.noImplicitAny) { + var diagnostic = symbol.valueDeclaration.type ? ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; + error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); + } } return links.type; } @@ -9563,7 +10705,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 118 /* GetAccessor */) { + if (accessor.kind === 127 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -9582,8 +10724,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = getDeclarationOfKind(symbol, 118 /* GetAccessor */); - var setter = getDeclarationOfKind(symbol, 119 /* SetAccessor */); + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); + var setter = getDeclarationOfKind(symbol, 128 /* SetAccessor */); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -9595,12 +10737,12 @@ var ts; type = setterParameterType; } else { - if (getter) { + if (getter && getter.body) { type = getReturnTypeFromBody(getter); } else { - if (program.getCompilerOptions().noImplicitAny) { - error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbol.name); + if (compilerOptions.noImplicitAny) { + error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbolToString(symbol)); } type = anyType; } @@ -9612,12 +10754,16 @@ var ts; } else if (links.type === resolvingType) { links.type = anyType; + if (compilerOptions.noImplicitAny) { + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); + error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); + } } } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - links.type = createObjectType(8192 /* Anonymous */, symbol); + links.type = createObjectType(32768 /* Anonymous */, symbol); } return links.type; } @@ -9643,24 +10789,24 @@ var ts; return links.type; } function getTypeOfSymbol(symbol) { - if (symbol.flags & (1 /* Variable */ | 2 /* Property */)) { + if (symbol.flags & 67108864 /* Instantiated */) { + return getTypeOfInstantiatedSymbol(symbol); + } + if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */ | 16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); } - if (symbol.flags & 4 /* EnumMember */) { + if (symbol.flags & 8 /* EnumMember */) { return getTypeOfEnumMember(symbol); } - if (symbol.flags & ts.SymbolFlags.Accessor) { + if (symbol.flags & 98304 /* Accessor */) { return getTypeOfAccessors(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getTypeOfImport(symbol); } - if (symbol.flags & 8388608 /* Instantiated */) { - return getTypeOfInstantiatedSymbol(symbol); - } return unknownType; } function getTargetType(type) { @@ -9676,7 +10822,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 170 /* InterfaceDeclaration */ || node.kind === 169 /* ClassDeclaration */) { + if (node.kind === 188 /* InterfaceDeclaration */ || node.kind === 187 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -9707,7 +10853,7 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 169 /* ClassDeclaration */); + var declaration = getDeclarationOfKind(symbol, 187 /* ClassDeclaration */); if (declaration.baseType) { var baseType = getTypeFromTypeReferenceNode(declaration.baseType); if (baseType !== unknownType) { @@ -9747,7 +10893,7 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 170 /* InterfaceDeclaration */ && declaration.baseTypes) { + if (declaration.kind === 188 /* InterfaceDeclaration */ && declaration.baseTypes) { ts.forEach(declaration.baseTypes, function (node) { var baseType = getTypeFromTypeReferenceNode(node); if (baseType !== unknownType) { @@ -9774,6 +10920,23 @@ var ts; } return links.declaredType; } + function getDeclaredTypeOfTypeAlias(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = resolvingType; + var declaration = getDeclarationOfKind(symbol, 189 /* TypeAliasDeclaration */); + var type = getTypeFromTypeNode(declaration.type); + if (links.declaredType === resolvingType) { + links.declaredType = type; + } + } + else if (links.declaredType === resolvingType) { + links.declaredType = unknownType; + var declaration = getDeclarationOfKind(symbol, 189 /* TypeAliasDeclaration */); + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + return links.declaredType; + } function getDeclaredTypeOfEnum(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -9788,7 +10951,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!getDeclarationOfKind(symbol, 113 /* TypeParameter */).constraint) { + if (!getDeclarationOfKind(symbol, 122 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -9803,22 +10966,25 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - if (symbol.flags & 16 /* Class */) { + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0); + if (symbol.flags & 32 /* Class */) { return getDeclaredTypeOfClass(symbol); } - if (symbol.flags & 32 /* Interface */) { + if (symbol.flags & 64 /* Interface */) { return getDeclaredTypeOfInterface(symbol); } - if (symbol.flags & 64 /* Enum */) { + if (symbol.flags & 2097152 /* TypeAlias */) { + return getDeclaredTypeOfTypeAlias(symbol); + } + if (symbol.flags & 384 /* Enum */) { return getDeclaredTypeOfEnum(symbol); } - if (symbol.flags & 262144 /* TypeParameter */) { + if (symbol.flags & 1048576 /* TypeParameter */) { return getDeclaredTypeOfTypeParameter(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getDeclaredTypeOfImport(symbol); } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0); return unknownType; } function createSymbolTable(symbols) { @@ -9861,7 +11027,7 @@ var ts; if (type.baseTypes.length) { members = createSymbolTable(type.declaredProperties); ts.forEach(type.baseTypes, function (baseType) { - addInheritedMembers(members, getPropertiesOfType(baseType)); + addInheritedMembers(members, getPropertiesOfObjectType(baseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0 /* Call */)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1 /* Construct */)); stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0 /* String */); @@ -9880,7 +11046,7 @@ var ts; var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; ts.forEach(target.baseTypes, function (baseType) { var instantiatedBaseType = instantiateType(baseType, mapper); - addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); + addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0 /* String */); @@ -9915,91 +11081,266 @@ var ts; } return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; } - function resolveAnonymousTypeMembers(type) { - var symbol = type.symbol; - var members = emptySymbols; - var callSignatures = emptyArray; - var constructSignatures = emptyArray; - if (symbol.flags & ts.SymbolFlags.HasExports) { - members = symbol.exports; + function createTupleTypeMemberSymbols(memberTypes) { + var members = {}; + for (var i = 0; i < memberTypes.length; i++) { + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "" + i); + symbol.type = memberTypes[i]; + members[i] = symbol; } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */)) { - callSignatures = getSignaturesOfSymbol(symbol); + return members; + } + function resolveTupleTypeMembers(type) { + var arrayType = resolveObjectOrUnionTypeMembers(createArrayType(getUnionType(type.elementTypes))); + var members = createTupleTypeMemberSymbols(type.elementTypes); + addInheritedMembers(members, arrayType.properties); + setObjectTypeMembers(type, members, arrayType.callSignatures, arrayType.constructSignatures, arrayType.stringIndexType, arrayType.numberIndexType); + } + function signatureListsIdentical(s, t) { + if (s.length !== t.length) { + return false; } - if (symbol.flags & 16 /* Class */) { - var classType = getDeclaredTypeOfClass(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); - if (!constructSignatures.length) - constructSignatures = getDefaultConstructSignatures(classType); - if (classType.baseTypes.length) { - var members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + for (var i = 0; i < s.length; i++) { + if (!compareSignatures(s[i], t[i], false, compareTypes)) { + return false; } } - var numberIndexType = (symbol.flags & 64 /* Enum */) ? stringType : undefined; - setObjectTypeMembers(type, members, callSignatures, constructSignatures, undefined, numberIndexType); + return true; } - function resolveObjectTypeMembers(type) { + function getUnionSignatures(types, kind) { + var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); + var signatures = signatureLists[0]; + for (var i = 0; i < signatures.length; i++) { + if (signatures[i].typeParameters) { + return emptyArray; + } + } + for (var i = 1; i < signatureLists.length; i++) { + if (!signatureListsIdentical(signatures, signatureLists[i])) { + return emptyArray; + } + } + var result = ts.map(signatures, cloneSignature); + for (var i = 0; i < result.length; i++) { + var s = result[i]; + s.resolvedReturnType = undefined; + s.unionSignatures = ts.map(signatureLists, function (signatures) { return signatures[i]; }); + } + return result; + } + function getUnionIndexType(types, kind) { + var indexTypes = []; + for (var i = 0; i < types.length; i++) { + var indexType = getIndexTypeOfType(types[i], kind); + if (!indexType) { + return undefined; + } + indexTypes.push(indexType); + } + return getUnionType(indexTypes); + } + function resolveUnionTypeMembers(type) { + var callSignatures = getUnionSignatures(type.types, 0 /* Call */); + var constructSignatures = getUnionSignatures(type.types, 1 /* Construct */); + var stringIndexType = getUnionIndexType(type.types, 0 /* String */); + var numberIndexType = getUnionIndexType(type.types, 1 /* Number */); + setObjectTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function resolveAnonymousTypeMembers(type) { + var symbol = type.symbol; + if (symbol.flags & 2048 /* TypeLiteral */) { + var members = symbol.members; + var callSignatures = getSignaturesOfSymbol(members["__call"]); + var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + } + else { + var members = emptySymbols; + var callSignatures = emptyArray; + var constructSignatures = emptyArray; + if (symbol.flags & 1952 /* HasExports */) { + members = symbol.exports; + } + if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { + callSignatures = getSignaturesOfSymbol(symbol); + } + if (symbol.flags & 32 /* Class */) { + var classType = getDeclaredTypeOfClass(symbol); + constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + if (!constructSignatures.length) { + constructSignatures = getDefaultConstructSignatures(classType); + } + if (classType.baseTypes.length) { + members = createSymbolTable(getNamedMembers(members)); + addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + } + } + var stringIndexType = undefined; + var numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; + } + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function resolveObjectOrUnionTypeMembers(type) { if (!type.members) { if (type.flags & (1024 /* Class */ | 2048 /* Interface */)) { resolveClassOrInterfaceMembers(type); } - else if (type.flags & 8192 /* Anonymous */) { + else if (type.flags & 32768 /* Anonymous */) { resolveAnonymousTypeMembers(type); } + else if (type.flags & 8192 /* Tuple */) { + resolveTupleTypeMembers(type); + } + else if (type.flags & 16384 /* Union */) { + resolveUnionTypeMembers(type); + } else { resolveTypeReferenceMembers(type); } } return type; } - function getPropertiesOfType(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - return resolveObjectTypeMembers(type).properties; + function getPropertiesOfObjectType(type) { + if (type.flags & 48128 /* ObjectType */) { + return resolveObjectOrUnionTypeMembers(type).properties; } return emptyArray; } + function getPropertyOfObjectType(type, name) { + if (type.flags & 48128 /* ObjectType */) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + } + } + function getPropertiesOfUnionType(type) { + var result = []; + ts.forEach(getPropertiesOfType(type.types[0]), function (prop) { + var unionProp = getPropertyOfUnionType(type, prop.name); + if (unionProp) { + result.push(unionProp); + } + }); + return result; + } + function getPropertiesOfType(type) { + if (type.flags & 16384 /* Union */) { + return getPropertiesOfUnionType(type); + } + return getPropertiesOfObjectType(getApparentType(type)); + } + function getApparentType(type) { + if (type.flags & 512 /* TypeParameter */) { + do { + type = getConstraintOfTypeParameter(type); + } while (type && type.flags & 512 /* TypeParameter */); + if (!type) { + type = emptyObjectType; + } + } + if (type.flags & 258 /* StringLike */) { + type = globalStringType; + } + else if (type.flags & 132 /* NumberLike */) { + type = globalNumberType; + } + else if (type.flags & 8 /* Boolean */) { + type = globalBooleanType; + } + return type; + } + function createUnionProperty(unionType, name) { + var types = unionType.types; + var props; + for (var i = 0; i < types.length; i++) { + var type = getApparentType(types[i]); + if (type !== unknownType) { + var prop = getPropertyOfType(type, name); + if (!prop) { + return undefined; + } + if (!props) { + props = [prop]; + } + else { + props.push(prop); + } + } + } + var propTypes = []; + var declarations = []; + for (var i = 0; i < props.length; i++) { + var prop = props[i]; + if (prop.declarations) { + declarations.push.apply(declarations, prop.declarations); + } + propTypes.push(getTypeOfSymbol(prop)); + } + var result = createSymbol(4 /* Property */ | 268435456 /* Transient */ | 1073741824 /* UnionProperty */, name); + result.unionType = unionType; + result.declarations = declarations; + result.type = getUnionType(propTypes); + return result; + } + function getPropertyOfUnionType(type, name) { + var properties = type.resolvedProperties || (type.resolvedProperties = {}); + if (ts.hasProperty(properties, name)) { + return properties[name]; + } + var property = createUnionProperty(type, name); + if (property) { + properties[name] = property; + } + return property; + } function getPropertyOfType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } + if (type.flags & 16384 /* Union */) { + return getPropertyOfUnionType(type, name); + } + if (!(type.flags & 48128 /* ObjectType */)) { + type = getApparentType(type); + if (!(type.flags & 48128 /* ObjectType */)) { + return undefined; } } - } - function getPropertyOfApparentType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } + var resolved = resolveObjectOrUnionTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfType(globalFunctionType, name); - if (symbol) - return symbol; - } - return getPropertyOfType(globalObjectType, name); } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) + return symbol; + } + return getPropertyOfObjectType(globalObjectType, name); } - function getSignaturesOfType(type, kind) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); + function getSignaturesOfObjectOrUnionType(type, kind) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { + var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; } return emptyArray; } - function getIndexTypeOfType(type, kind) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); + function getSignaturesOfType(type, kind) { + return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); + } + function getIndexTypeOfObjectOrUnionType(type, kind) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { + var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; } } + function getIndexTypeOfType(type, kind) { + return getIndexTypeOfObjectOrUnionType(getApparentType(type), kind); + } function getTypeParametersFromDeclaration(typeParameterDeclarations) { var result = []; ts.forEach(typeParameterDeclarations, function (node) { @@ -10013,7 +11354,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 117 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 126 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; @@ -10021,7 +11362,7 @@ var ts; for (var i = 0, n = declaration.parameters.length; i < n; i++) { var param = declaration.parameters[i]; parameters.push(param.symbol); - if (param.type && param.type.kind === 3 /* StringLiteral */) { + if (param.type && param.type.kind === 7 /* StringLiteral */) { hasStringLiterals = true; } if (minArgumentCount < 0) { @@ -10041,8 +11382,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 118 /* GetAccessor */) { - var setter = getDeclarationOfKind(declaration.symbol, 119 /* SetAccessor */); + if (declaration.kind === 127 /* GetAccessor */) { + var setter = getDeclarationOfKind(declaration.symbol, 128 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && !declaration.body) { @@ -10060,16 +11401,18 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 167 /* FunctionDeclaration */: - case 116 /* Method */: - case 117 /* Constructor */: - case 120 /* CallSignature */: - case 121 /* ConstructSignature */: - case 122 /* IndexSignature */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -10087,6 +11430,9 @@ var ts; if (signature.target) { var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } + else if (signature.unionSignatures) { + var type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); + } else { var type = getReturnTypeFromBody(signature.declaration); } @@ -10096,6 +11442,15 @@ var ts; } else if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = anyType; + if (compilerOptions.noImplicitAny) { + var declaration = signature.declaration; + if (declaration.name) { + error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(declaration.name)); + } + else { + error(declaration, ts.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); + } + } } return signature.resolvedReturnType; } @@ -10126,8 +11481,8 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 117 /* Constructor */ || signature.declaration.kind === 121 /* ConstructSignature */; - var type = createObjectType(8192 /* Anonymous */ | 16384 /* FromSignature */); + var isConstructor = signature.declaration.kind === 126 /* Constructor */ || signature.declaration.kind === 130 /* ConstructSignature */; + var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; type.callSignatures = !isConstructor ? [signature] : emptyArray; @@ -10140,7 +11495,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 108 /* NumberKeyword */ : 110 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 116 /* NumberKeyword */ : 118 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -10167,7 +11522,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 113 /* TypeParameter */).constraint); + type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 122 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -10207,17 +11562,17 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 113 /* TypeParameter */; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 122 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 123 /* TypeReference */ && n.typeName.kind === 55 /* Identifier */) { + if (n.kind === 132 /* TypeReference */ && n.typeName.kind === 63 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { + var symbol = resolveName(typeParameter, n.typeName.text, 3152352 /* Type */, undefined, undefined); + if (symbol && (symbol.flags & 1048576 /* TypeParameter */)) { links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); } } @@ -10235,10 +11590,10 @@ var ts; function getTypeFromTypeReferenceNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); + var symbol = resolveEntityName(node, node.typeName, 3152352 /* Type */); if (symbol) { var type; - if ((symbol.flags & 262144 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + if ((symbol.flags & 1048576 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } else { @@ -10246,7 +11601,7 @@ var ts; if (type.flags & (1024 /* Class */ | 2048 /* Interface */) && type.flags & 4096 /* Reference */) { var typeParameters = type.typeParameters; if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, ts.map(node.typeArguments, function (t) { return getTypeFromTypeNode(t); })); + type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNode)); } else { error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length); @@ -10278,9 +11633,9 @@ var ts; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; switch (declaration.kind) { - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 171 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: return declaration; } } @@ -10289,7 +11644,7 @@ var ts; return emptyObjectType; } var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return emptyObjectType; } @@ -10300,7 +11655,7 @@ var ts; return type; } function getGlobalSymbol(name) { - return resolveName(undefined, name, ts.SymbolFlags.Type, ts.Diagnostics.Cannot_find_global_type_0, name); + return resolveName(undefined, name, 3152352 /* Type */, ts.Diagnostics.Cannot_find_global_type_0, name); } function getGlobalType(name) { return getTypeOfGlobalSymbol(getGlobalSymbol(name), 0); @@ -10316,16 +11671,114 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeLiteralNode(node) { + function createTupleType(elementTypes) { + var id = getTypeListId(elementTypes); + var type = tupleTypes[id]; + if (!type) { + type = tupleTypes[id] = createObjectType(8192 /* Tuple */); + type.elementTypes = elementTypes; + } + return type; + } + function getTypeFromTupleTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = node.symbol; - var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); - var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - links.resolvedType = createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); + } + return links.resolvedType; + } + function addTypeToSortedSet(sortedSet, type) { + if (type.flags & 16384 /* Union */) { + addTypesToSortedSet(sortedSet, type.types); + } + else { + var i = 0; + var id = type.id; + while (i < sortedSet.length && sortedSet[i].id < id) { + i++; + } + if (i === sortedSet.length || sortedSet[i].id !== id) { + sortedSet.splice(i, 0, type); + } + } + } + function addTypesToSortedSet(sortedTypes, types) { + for (var i = 0, len = types.length; i < len; i++) { + addTypeToSortedSet(sortedTypes, types[i]); + } + } + function isSubtypeOfAny(candidate, types) { + for (var i = 0, len = types.length; i < len; i++) { + if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + return true; + } + } + return false; + } + function removeSubtypes(types) { + var i = types.length; + while (i > 0) { + i--; + if (isSubtypeOfAny(types[i], types)) { + types.splice(i, 1); + } + } + } + function containsAnyType(types) { + for (var i = 0; i < types.length; i++) { + if (types[i].flags & 1 /* Any */) { + return true; + } + } + return false; + } + function removeAllButLast(types, typeToRemove) { + var i = types.length; + while (i > 0 && types.length > 1) { + i--; + if (types[i] === typeToRemove) { + types.splice(i, 1); + } + } + } + function getUnionType(types, noSubtypeReduction) { + if (types.length === 0) { + return emptyObjectType; + } + var sortedTypes = []; + addTypesToSortedSet(sortedTypes, types); + if (noSubtypeReduction) { + if (containsAnyType(sortedTypes)) { + return anyType; + } + removeAllButLast(sortedTypes, undefinedType); + removeAllButLast(sortedTypes, nullType); + } + else { + removeSubtypes(sortedTypes); + } + if (sortedTypes.length === 1) { + return sortedTypes[0]; + } + var id = getTypeListId(sortedTypes); + var type = unionTypes[id]; + if (!type) { + type = unionTypes[id] = createObjectType(16384 /* Union */); + type.types = sortedTypes; + } + return type; + } + function getTypeFromUnionTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); + } + return links.resolvedType; + } + function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = createObjectType(32768 /* Anonymous */, node.symbol); } return links.resolvedType; } @@ -10333,7 +11786,7 @@ var ts; if (ts.hasProperty(stringLiteralTypes, node.text)) return stringLiteralTypes[node.text]; var type = stringLiteralTypes[node.text] = createType(256 /* StringLiteral */); - type.text = ts.getSourceTextOfNode(node); + type.text = ts.getTextOfNode(node); return type; } function getTypeFromStringLiteral(node) { @@ -10345,30 +11798,38 @@ var ts; } function getTypeFromTypeNode(node) { switch (node.kind) { - case 101 /* AnyKeyword */: + case 109 /* AnyKeyword */: return anyType; - case 110 /* StringKeyword */: + case 118 /* StringKeyword */: return stringType; - case 108 /* NumberKeyword */: + case 116 /* NumberKeyword */: return numberType; - case 102 /* BooleanKeyword */: + case 110 /* BooleanKeyword */: return booleanType; - case 89 /* VoidKeyword */: + case 97 /* VoidKeyword */: return voidType; - case 3 /* StringLiteral */: + case 7 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 123 /* TypeReference */: + case 132 /* TypeReference */: return getTypeFromTypeReferenceNode(node); - case 124 /* TypeQuery */: + case 135 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 126 /* ArrayType */: + case 137 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 125 /* TypeLiteral */: - return getTypeFromTypeLiteralNode(node); - case 55 /* Identifier */: - case 112 /* QualifiedName */: + case 138 /* TupleType */: + return getTypeFromTupleTypeNode(node); + case 139 /* UnionType */: + return getTypeFromUnionTypeNode(node); + case 140 /* ParenType */: + return getTypeFromTypeNode(node.type); + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 136 /* TypeLiteral */: + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); + case 63 /* Identifier */: + case 121 /* QualifiedName */: var symbol = getSymbolInfo(node); - return getDeclaredTypeOfSymbol(symbol); + return symbol && getDeclaredTypeOfSymbol(symbol); default: return unknownType; } @@ -10391,10 +11852,8 @@ var ts; } function createTypeMapper(sources, targets) { switch (sources.length) { - case 1: - return createUnaryTypeMapper(sources[0], targets[0]); - case 2: - return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + case 1: return createUnaryTypeMapper(sources[0], targets[0]); + case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -10412,10 +11871,8 @@ var ts; } function createTypeEraser(sources) { switch (sources.length) { - case 1: - return createUnaryTypeEraser(sources[0]); - case 2: - return createBinaryTypeEraser(sources[0], sources[1]); + case 1: return createUnaryTypeEraser(sources[0]); + case 2: return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -10464,12 +11921,12 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(8388608 /* Instantiated */ | 33554432 /* Transient */, symbol.name); + var result = createSymbol(67108864 /* Instantiated */ | 268435456 /* Transient */ | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -10480,8 +11937,8 @@ var ts; return result; } function instantiateAnonymousType(type, mapper) { - var result = createObjectType(8192 /* Anonymous */, type.symbol); - result.properties = instantiateList(getPropertiesOfType(type), mapper, instantiateSymbol); + var result = createObjectType(32768 /* Anonymous */, type.symbol); + result.properties = instantiateList(getPropertiesOfObjectType(type), mapper, instantiateSymbol); result.members = createSymbolTable(result.properties); result.callSignatures = instantiateList(getSignaturesOfType(type, 0 /* Call */), mapper, instantiateSignature); result.constructSignatures = instantiateList(getSignaturesOfType(type, 1 /* Construct */), mapper, instantiateSignature); @@ -10498,36 +11955,42 @@ var ts; if (type.flags & 512 /* TypeParameter */) { return mapper(type); } - if (type.flags & 8192 /* Anonymous */) { - return type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */ | 512 /* TypeLiteral */ | 1024 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; + if (type.flags & 32768 /* Anonymous */) { + return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096 /* Reference */) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); } + if (type.flags & 8192 /* Tuple */) { + return createTupleType(instantiateList(type.elementTypes, mapper, instantiateType)); + } + if (type.flags & 16384 /* Union */) { + return getUnionType(instantiateList(type.types, mapper, instantiateType), true); + } } return type; } function isContextSensitiveExpression(node) { switch (node.kind) { - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 128 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 129 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 127 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 143 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 141 /* ArrayLiteral */: return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 141 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 140 /* BinaryExpression */: - return node.operator === 40 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); + case 156 /* BinaryExpression */: + return node.operator === 48 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); } return false; } function getTypeWithoutConstructors(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); + if (type.flags & 48128 /* ObjectType */) { + var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.constructSignatures.length) { - var result = createObjectType(8192 /* Anonymous */, type.symbol); + var result = createObjectType(32768 /* Anonymous */, type.symbol); result.members = resolved.members; result.properties = resolved.properties; result.callSignatures = resolved.callSignatures; @@ -10541,173 +12004,155 @@ var ts; var assignableRelation = {}; var identityRelation = {}; function isTypeIdenticalTo(source, target) { - return checkTypeRelatedTo(source, target, identityRelation, undefined, undefined, undefined); + return checkTypeRelatedTo(source, target, identityRelation, undefined); + } + function compareTypes(source, target) { + return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 /* True */ : 0 /* False */; } function isTypeSubtypeOf(source, target) { - return checkTypeSubtypeOf(source, target, undefined, undefined, undefined); - } - function checkTypeSubtypeOf(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); + return checkTypeSubtypeOf(source, target, undefined); } function isTypeAssignableTo(source, target) { - return checkTypeAssignableTo(source, target, undefined, undefined, undefined); + return checkTypeAssignableTo(source, target, undefined); } - function checkTypeAssignableTo(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); + function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); } - function isTypeRelatedTo(source, target, relation) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + function checkTypeAssignableTo(source, target, errorNode, headMessage) { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage); } function isSignatureAssignableTo(source, target) { var sourceType = getOrCreateTypeFromSignature(source); var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined, undefined, undefined); + return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined); } - function isPropertyIdenticalTo(sourceProp, targetProp) { - return isPropertyIdenticalToRecursive(sourceProp, targetProp, false, function (s, t, _reportErrors) { return isTypeIdenticalTo(s, t); }); - } - function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { - return true; - } - var seen = {}; - ts.forEach(type.declaredProperties, function (p) { - seen[p.name] = { prop: p, containingType: type }; - }); - var ok = true; - for (var i = 0, len = type.baseTypes.length; i < len; ++i) { - var base = type.baseTypes[i]; - var properties = getPropertiesOfType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; - if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type), typeName1, typeName2); - addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); - } - } - } - } - return ok; - } - function isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, relate) { - ts.Debug.assert(sourceProp); - if (!targetProp) { - return false; - } - var sourcePropIsPrivate = getDeclarationFlagsFromSymbol(sourceProp) & 32 /* Private */; - var targetPropIsPrivate = getDeclarationFlagsFromSymbol(targetProp) & 32 /* Private */; - if (sourcePropIsPrivate !== targetPropIsPrivate) { - return false; - } - if (sourcePropIsPrivate) { - return (getTargetSymbol(sourceProp).parent === getTargetSymbol(targetProp).parent) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - else { - return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - } - function checkTypeRelatedTo(source, target, relation, errorNode, chainedMessage, terminalMessage) { + function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { var errorInfo; var sourceStack; var targetStack; + var maybeStack; var expandingFlags; var depth = 0; var overflow = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); + var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { + if (containingMessageChain) { + errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + } addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine())); } - return result; - function reportError(message, arg0, arg1) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1); + return result !== 0 /* False */; + function reportError(message, arg0, arg1, arg2) { + errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source, target, reportErrors) { - return isRelatedToWithCustomErrors(source, target, reportErrors, undefined, undefined); - } - function isRelatedToWithCustomErrors(source, target, reportErrors, chainedMessage, terminalMessage) { + function isRelatedTo(source, target, reportErrors, headMessage) { + var result; if (relation === identityRelation) { if (source === target) - return true; + return -1 /* True */; } else { if (source === target) - return true; + return -1 /* True */; if (target.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === undefinedType) - return true; + return -1 /* True */; if (source === nullType && target !== undefinedType) - return true; + return -1 /* True */; if (source.flags & 128 /* Enum */ && target === numberType) - return true; + return -1 /* True */; if (source.flags & 256 /* StringLiteral */ && target === stringType) - return true; + return -1 /* True */; if (relation === assignableRelation) { if (source.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === numberType && target.flags & 128 /* Enum */) - return true; + return -1 /* True */; } } - if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - if (typeParameterRelatedTo(source, target, reportErrors)) { - return true; + if (source.flags & 16384 /* Union */) { + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; + } + } + else if (target.flags & 16384 /* Union */) { + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; + } + } + else if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - if (typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return true; + if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return result; } } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & ts.TypeFlags.ObjectType && target.flags & ts.TypeFlags.ObjectType && objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + if (sourceOrApparentType.flags & 48128 /* ObjectType */ && target.flags & 48128 /* ObjectType */ && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return true; + return result; } } if (reportErrors) { - chainedMessage = chainedMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; - terminalMessage = terminalMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; - var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; - ts.Debug.assert(diagnosticKey); - reportError(diagnosticKey, typeToString(source), typeToString(target)); + headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; + reportError(headMessage, typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; + } + function typeRelatedToUnionType(source, target, reportErrors) { + var targetTypes = target.types; + for (var i = 0, len = targetTypes.length; i < len; i++) { + var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + if (related) { + return related; + } + } + return 0 /* False */; + } + function unionTypeRelatedToType(source, target, reportErrors) { + var result = -1 /* True */; + var sourceTypes = source.types; + for (var i = 0, len = sourceTypes.length; i < len; i++) { + var related = isRelatedTo(sourceTypes[i], target, reportErrors); + if (!related) { + return 0 /* False */; + } + result &= related; + } + return result; } function typesRelatedTo(sources, targets, reportErrors) { + var result = -1 /* True */; for (var i = 0, len = sources.length; i < len; i++) { - if (!isRelatedTo(sources[i], targets[i], reportErrors)) - return false; + var related = isRelatedTo(sources[i], targets[i], reportErrors); + if (!related) { + return 0 /* False */; + } + result &= related; } - return true; + return result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { if (source.symbol.name !== target.symbol.name) { - return false; + return 0 /* False */; } if (source.constraint === target.constraint) { - return true; + return -1 /* True */; } if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return false; + return 0 /* False */; } return isRelatedTo(source.constraint, target.constraint, reportErrors); } @@ -10715,49 +12160,79 @@ var ts; while (true) { var constraint = getConstraintOfTypeParameter(source); if (constraint === target) - return true; + return -1 /* True */; if (!(constraint && constraint.flags & 512 /* TypeParameter */)) break; source = constraint; } - return false; + return 0 /* False */; } } function objectTypeRelatedTo(source, target, reportErrors) { - if (overflow) - return false; - var result; + if (overflow) { + return 0 /* False */; + } var id = source.id + "," + target.id; - if ((result = relation[id]) !== undefined) - return result; + var related = relation[id]; + if (related !== undefined) { + return related ? -1 /* True */ : 0 /* False */; + } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) - return true; + if (maybeStack[i][id]) { + return 1 /* Maybe */; + } } if (depth === 100) { overflow = true; - return false; + return 0 /* False */; } } else { sourceStack = []; targetStack = []; + maybeStack = []; expandingFlags = 0; } sourceStack[depth] = source; targetStack[depth] = target; + maybeStack[depth] = {}; + maybeStack[depth][id] = true; depth++; var saveExpandingFlags = expandingFlags; if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - result = expandingFlags === 3 || propertiesRelatedTo(source, target, reportErrors) && signaturesRelatedTo(source, target, 0 /* Call */, reportErrors) && signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors) && stringIndexTypesRelatedTo(source, target, reportErrors) && numberIndexTypesRelatedTo(source, target, reportErrors); + if (expandingFlags === 3) { + var result = 1 /* Maybe */; + } + else { + var result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); + } + } + } + } + } expandingFlags = saveExpandingFlags; depth--; - if (depth === 0) { - relation[id] = result; + if (result) { + var maybeCache = maybeStack[depth]; + var destinationCache = result === -1 /* True */ || depth === 0 ? relation : maybeStack[depth - 1]; + for (var p in maybeCache) { + destinationCache[p] = maybeCache[p]; + } + } + else { + relation[id] = false; } return result; } @@ -10778,164 +12253,133 @@ var ts; } function propertiesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return propertiesAreIdenticalTo(source, target, reportErrors); + return propertiesIdenticalTo(source, target); } - else { - return propertiesAreSubtypeOrAssignableTo(source, target, reportErrors); - } - } - function propertiesAreIdenticalTo(source, target, reportErrors) { - if (source === target) { - return true; - } - var sourceProperties = getPropertiesOfType(source); - var targetProperties = getPropertiesOfType(target); - if (sourceProperties.length !== targetProperties.length) { - return false; - } - for (var i = 0, len = sourceProperties.length; i < len; ++i) { - var sourceProp = sourceProperties[i]; - var targetProp = getPropertyOfType(target, sourceProp.name); - if (!isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { - return false; - } - } - return true; - } - function propertiesAreSubtypeOrAssignableTo(source, target, reportErrors) { - var properties = getPropertiesOfType(target); + var result = -1 /* True */; + var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; - var sourceProp = getPropertyOfApparentType(source, targetProp.name); - if (sourceProp === targetProp) { - continue; - } - var targetPropIsOptional = isOptionalProperty(targetProp); - if (!sourceProp) { - if (!targetPropIsOptional) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); + var sourceProp = getPropertyOfType(source, targetProp.name); + if (sourceProp !== targetProp) { + if (!sourceProp) { + if (relation === subtypeRelation || !isOptionalProperty(targetProp)) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); + } + return 0 /* False */; } - return false; } - } - else if (sourceProp !== targetProp) { - if (targetProp.flags & 67108864 /* Prototype */) { - continue; - } - if (getDeclarationFlagsFromSymbol(sourceProp) & 32 /* Private */ || getDeclarationFlagsFromSymbol(targetProp) & 32 /* Private */) { - if (reportErrors) { - reportError(ts.Diagnostics.Private_property_0_cannot_be_reimplemented, symbolToString(targetProp)); + else if (!(targetProp.flags & 536870912 /* Prototype */)) { + var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); + var targetFlags = getDeclarationFlagsFromSymbol(targetProp); + if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { + if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { + if (reportErrors) { + if (sourceFlags & 32 /* Private */ && targetFlags & 32 /* Private */) { + reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); + } + else { + reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); + } + } + return 0 /* False */; + } } - return false; - } - if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); + else if (targetFlags & 64 /* Protected */) { + var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; + var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; + var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); + if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); + } + return 0 /* False */; + } } - return false; - } - else if (isOptionalProperty(sourceProp) && !targetPropIsOptional) { - if (reportErrors) { - reportError(ts.Diagnostics.Required_property_0_cannot_be_reimplemented_with_optional_property_in_1, targetProp.name, typeToString(source)); + else if (sourceFlags & 64 /* Protected */) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); + } + return 0 /* False */; + } + var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + if (!related) { + if (reportErrors) { + reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); + } + return 0 /* False */; + } + result &= related; + if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); + } + return 0 /* False */; } - return false; } } } - return true; + return result; + } + function propertiesIdenticalTo(source, target) { + var sourceProperties = getPropertiesOfObjectType(source); + var targetProperties = getPropertiesOfObjectType(target); + if (sourceProperties.length !== targetProperties.length) { + return 0 /* False */; + } + var result = -1 /* True */; + for (var i = 0, len = sourceProperties.length; i < len; ++i) { + var sourceProp = sourceProperties[i]; + var targetProp = getPropertyOfObjectType(target, sourceProp.name); + if (!targetProp) { + return 0 /* False */; + } + var related = compareProperties(sourceProp, targetProp, isRelatedTo); + if (!related) { + return 0 /* False */; + } + result &= related; + } + return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { - return areSignaturesIdenticalTo(source, target, kind, reportErrors); + return signaturesIdenticalTo(source, target, kind); } - else { - return areSignaturesSubtypeOrAssignableTo(source, target, kind, reportErrors); + if (target === anyFunctionType || source === anyFunctionType) { + return -1 /* True */; } - } - function areSignaturesIdenticalTo(source, target, kind, reportErrors) { - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - if (sourceSignatures.length !== targetSignatures.length) { - return false; - } - for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - if (!isSignatureIdenticalTo(sourceSignatures[i], targetSignatures[i], reportErrors)) { - return false; - } - } - return true; - } - function isSignatureIdenticalTo(source, target, reportErrors) { - if (source === target) { - return true; - } - if (source.hasRestParameter !== target.hasRestParameter) { - return false; - } - if (source.parameters.length !== target.parameters.length) { - return false; - } - if (source.minArgumentCount !== target.minArgumentCount) { - return false; - } - if (source.typeParameters && target.typeParameters) { - if (source.typeParameters.length !== target.typeParameters.length) { - return false; - } - for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - if (!isRelatedTo(source.typeParameters[i], target.typeParameters[i], reportErrors)) { - return false; - } - } - } - else if (source.typeParameters || source.typeParameters) { - return false; - } - source = getErasedSignature(source); - target = getErasedSignature(target); - for (var i = 0, len = source.parameters.length; i < len; i++) { - var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); - var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - if (!isRelatedTo(s, t, reportErrors)) { - return false; - } - } - var t = getReturnTypeOfSignature(target); - var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); - } - function areSignaturesSubtypeOrAssignableTo(source, target, kind, reportErrors) { - if (target === anyFunctionType || source === anyFunctionType) - return true; var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + var result = -1 /* True */; var saveErrorInfo = errorInfo; outer: for (var i = 0; i < targetSignatures.length; i++) { var t = targetSignatures[i]; - if (!t.hasStringLiterals || target.flags & 16384 /* FromSignature */) { + if (!t.hasStringLiterals || target.flags & 65536 /* FromSignature */) { var localErrors = reportErrors; for (var j = 0; j < sourceSignatures.length; j++) { var s = sourceSignatures[j]; - if (!s.hasStringLiterals || source.flags & 16384 /* FromSignature */) { - if (isSignatureSubtypeOrAssignableTo(s, t, localErrors)) { + if (!s.hasStringLiterals || source.flags & 65536 /* FromSignature */) { + var related = signatureRelatedTo(s, t, localErrors); + if (related) { + result &= related; errorInfo = saveErrorInfo; continue outer; } localErrors = false; } } - return false; + return 0 /* False */; } } - return true; + return result; } - function isSignatureSubtypeOrAssignableTo(source, target, reportErrors) { + function signatureRelatedTo(source, target, reportErrors) { if (source === target) { - return true; + return -1 /* True */; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return 0 /* False */; } var sourceMax = source.parameters.length; var targetMax = target.parameters.length; @@ -10958,87 +12402,175 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1 /* True */; for (var i = 0; i < checkCount; i++) { var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - if (!isRelatedTo(s, t, reportErrors)) { - if (!isRelatedTo(t, s, false)) { + var related = isRelatedTo(s, t, reportErrors); + if (!related) { + related = isRelatedTo(t, s, false); + if (!related) { if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); + reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } - return false; + return 0 /* False */; } errorInfo = saveErrorInfo; } + result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return true; + return result; var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); + } + function signaturesIdenticalTo(source, target, kind) { + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + if (sourceSignatures.length !== targetSignatures.length) { + return 0 /* False */; + } + var result = -1 /* True */; + for (var i = 0, len = sourceSignatures.length; i < len; ++i) { + var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); + if (!related) { + return 0 /* False */; + } + result &= related; + } + return result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return areIndexTypesIdenticalTo(0 /* String */, source, target, reportErrors); + return indexTypesIdenticalTo(0 /* String */, source, target); } - else { - var targetType = getIndexTypeOfType(target, 0 /* String */); - if (targetType) { - var sourceType = getIndexTypeOfType(source, 0 /* String */); - if (!sourceType) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return false; - } - if (!isRelatedTo(sourceType, targetType, reportErrors)) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); - } - return false; + var targetType = getIndexTypeOfType(target, 0 /* String */); + if (targetType) { + var sourceType = getIndexTypeOfType(source, 0 /* String */); + if (!sourceType) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } + return 0 /* False */; } - return true; + var related = isRelatedTo(sourceType, targetType, reportErrors); + if (!related) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signatures_are_incompatible); + } + return 0 /* False */; + } + return related; } + return -1 /* True */; } function numberIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return areIndexTypesIdenticalTo(1 /* Number */, source, target, reportErrors); + return indexTypesIdenticalTo(1 /* Number */, source, target); } - else { - var targetType = getIndexTypeOfType(target, 1 /* Number */); - if (targetType) { - var sourceStringType = getIndexTypeOfType(source, 0 /* String */); - var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); - if (!(sourceStringType || sourceNumberType)) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return false; - } - if (sourceStringType && sourceNumberType) { - var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); - } - else { - var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); - } - if (!compatible) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); - } - return false; + var targetType = getIndexTypeOfType(target, 1 /* Number */); + if (targetType) { + var sourceStringType = getIndexTypeOfType(source, 0 /* String */); + var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); + if (!(sourceStringType || sourceNumberType)) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } + return 0 /* False */; } - return true; + if (sourceStringType && sourceNumberType) { + var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + } + else { + var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + } + if (!related) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signatures_are_incompatible); + } + return 0 /* False */; + } + return related; } + return -1 /* True */; } - function areIndexTypesIdenticalTo(indexKind, source, target, reportErrors) { + function indexTypesIdenticalTo(indexKind, source, target) { var targetType = getIndexTypeOfType(target, indexKind); var sourceType = getIndexTypeOfType(source, indexKind); - return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); + if (!sourceType && !targetType) { + return -1 /* True */; + } + if (sourceType && targetType) { + return isRelatedTo(sourceType, targetType); + } + return 0 /* False */; } } + function isPropertyIdenticalTo(sourceProp, targetProp) { + return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; + } + function compareProperties(sourceProp, targetProp, compareTypes) { + if (sourceProp === targetProp) { + return -1 /* True */; + } + var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); + var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); + if (sourcePropAccessibility !== targetPropAccessibility) { + return 0 /* False */; + } + if (sourcePropAccessibility) { + if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { + return 0 /* False */; + } + } + else { + if (isOptionalProperty(sourceProp) !== isOptionalProperty(targetProp)) { + return 0 /* False */; + } + } + return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + function compareSignatures(source, target, compareReturnTypes, compareTypes) { + if (source === target) { + return -1 /* True */; + } + if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { + return 0 /* False */; + } + var result = -1 /* True */; + if (source.typeParameters && target.typeParameters) { + if (source.typeParameters.length !== target.typeParameters.length) { + return 0 /* False */; + } + for (var i = 0, len = source.typeParameters.length; i < len; ++i) { + var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); + if (!related) { + return 0 /* False */; + } + result &= related; + } + } + else if (source.typeParameters || source.typeParameters) { + return 0 /* False */; + } + source = getErasedSignature(source); + target = getErasedSignature(target); + for (var i = 0, len = source.parameters.length; i < len; i++) { + var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); + var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); + var related = compareTypes(s, t); + if (!related) { + return 0 /* False */; + } + result &= related; + } + if (compareReturnTypes) { + result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + return result; + } function isSupertypeOfEach(candidate, types) { for (var i = 0, len = types.length; i < len; i++) { if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) @@ -11046,52 +12578,37 @@ var ts; } return true; } - function getBestCommonType(types, contextualType, candidatesOnly) { - if (contextualType && isSupertypeOfEach(contextualType, types)) - return contextualType; - return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }) || (candidatesOnly ? undefined : emptyObjectType); + function getCommonSupertype(types) { + return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); } - function isTypeOfObjectLiteral(type) { - return (type.flags & 8192 /* Anonymous */) && type.symbol && (type.symbol.flags & 1024 /* ObjectLiteral */) ? true : false; - } - function getWidenedTypeOfObjectLiteral(type) { - var properties = getPropertiesOfType(type); - if (properties.length) { - var widenedTypes = []; - var propTypeWasWidened = false; - ts.forEach(properties, function (p) { - var propType = getTypeOfSymbol(p); - var widenedType = getWidenedType(propType); - if (propType !== widenedType) { - propTypeWasWidened = true; - if (program.getCompilerOptions().noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType)); - } + function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { + var bestSupertype; + var bestSupertypeDownfallType; + var bestSupertypeScore = 0; + for (var i = 0; i < types.length; i++) { + var score = 0; + var downfallType = undefined; + for (var j = 0; j < types.length; j++) { + if (isTypeSubtypeOf(types[j], types[i])) { + score++; } - widenedTypes.push(widenedType); - }); - if (propTypeWasWidened) { - var members = {}; - var index = 0; - ts.forEach(properties, function (p) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, p.name); - symbol.declarations = p.declarations; - symbol.parent = p.parent; - symbol.type = widenedTypes[index++]; - if (p.valueDeclaration) - symbol.valueDeclaration = p.valueDeclaration; - members[symbol.name] = symbol; - }); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType) - stringIndexType = getWidenedType(stringIndexType); - if (numberIndexType) - numberIndexType = getWidenedType(numberIndexType); - type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); + else if (!downfallType) { + downfallType = types[j]; + } + } + if (score > bestSupertypeScore) { + bestSupertype = types[i]; + bestSupertypeDownfallType = downfallType; + bestSupertypeScore = score; + } + if (bestSupertypeScore === types.length - 1) { + break; } } - return type; + checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead); + } + function isTypeOfObjectLiteral(type) { + return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 4096 /* ObjectLiteral */) ? true : false; } function isArrayType(type) { return type.flags & 4096 /* Reference */ && type.target === globalArrayType; @@ -11102,16 +12619,13 @@ var ts; } return type; } - function getWidenedTypeOfArrayLiteral(type) { - var elementType = type.typeArguments[0]; - var widenedType = getWidenedType(elementType); - type = elementType !== widenedType ? createArrayType(widenedType) : type; - return type; - } - function getWidenedType(type) { + function getWidenedType(type, suppressNoImplicitAnyErrors) { if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { return anyType; } + if (type.flags & 16384 /* Union */) { + return getWidenedTypeOfUnion(type); + } if (isTypeOfObjectLiteral(type)) { return getWidenedTypeOfObjectLiteral(type); } @@ -11119,6 +12633,55 @@ var ts; return getWidenedTypeOfArrayLiteral(type); } return type; + function getWidenedTypeOfUnion(type) { + return getUnionType(ts.map(type.types, function (t) { return getWidenedType(t, suppressNoImplicitAnyErrors); })); + } + function getWidenedTypeOfObjectLiteral(type) { + var properties = getPropertiesOfObjectType(type); + if (properties.length) { + var widenedTypes = []; + var propTypeWasWidened = false; + ts.forEach(properties, function (p) { + var propType = getTypeOfSymbol(p); + var widenedType = getWidenedType(propType); + if (propType !== widenedType) { + propTypeWasWidened = true; + if (!suppressNoImplicitAnyErrors && compilerOptions.noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType)); + } + } + widenedTypes.push(widenedType); + }); + if (propTypeWasWidened) { + var members = {}; + var index = 0; + ts.forEach(properties, function (p) { + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */ | p.flags, p.name); + symbol.declarations = p.declarations; + symbol.parent = p.parent; + symbol.type = widenedTypes[index++]; + symbol.target = p; + if (p.valueDeclaration) + symbol.valueDeclaration = p.valueDeclaration; + members[symbol.name] = symbol; + }); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); + if (stringIndexType) + stringIndexType = getWidenedType(stringIndexType); + if (numberIndexType) + numberIndexType = getWidenedType(numberIndexType); + type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); + } + } + return type; + } + function getWidenedTypeOfArrayLiteral(type) { + var elementType = type.typeArguments[0]; + var widenedType = getWidenedType(elementType, suppressNoImplicitAnyErrors); + type = elementType !== widenedType ? createArrayType(widenedType) : type; + return type; + } } function forEachMatchingParameterType(source, target, callback) { var sourceMax = source.parameters.length; @@ -11146,12 +12709,15 @@ var ts; callback(s, t); } } - function createInferenceContext(typeParameters) { + function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var i = 0; i < typeParameters.length; i++) - inferences.push([]); + for (var i = 0; i < typeParameters.length; i++) { + inferences.push({ primary: undefined, secondary: undefined }); + } return { typeParameters: typeParameters, + inferUnionTypes: inferUnionTypes, + inferenceCount: 0, inferences: inferences, inferredTypes: new Array(typeParameters.length) }; @@ -11160,6 +12726,7 @@ var ts; var sourceStack; var targetStack; var depth = 0; + var inferiority = 0; inferFromTypes(source, target); function isInProcess(source, target) { for (var i = 0; i < depth; i++) { @@ -11187,8 +12754,9 @@ var ts; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; - if (!ts.contains(inferences, source)) - inferences.push(source); + var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []); + if (!ts.contains(candidates, source)) + candidates.push(source); break; } } @@ -11200,7 +12768,33 @@ var ts; inferFromTypes(sourceTypes[i], targetTypes[i]); } } - else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & 4096 /* Reference */ || (target.flags & 8192 /* Anonymous */) && target.symbol && target.symbol.flags & (2048 /* Method */ | 512 /* TypeLiteral */))) { + else if (target.flags & 16384 /* Union */) { + var targetTypes = target.types; + var typeParameterCount = 0; + var typeParameter; + for (var i = 0; i < targetTypes.length; i++) { + var t = targetTypes[i]; + if (t.flags & 512 /* TypeParameter */ && ts.contains(context.typeParameters, t)) { + typeParameter = t; + typeParameterCount++; + } + else { + inferFromTypes(source, t); + } + } + if (typeParameterCount === 1) { + inferiority++; + inferFromTypes(source, typeParameter); + inferiority--; + } + } + else if (source.flags & 16384 /* Union */) { + var sourceTypes = source.types; + for (var i = 0; i < sourceTypes.length; i++) { + inferFromTypes(sourceTypes[i], target); + } + } + else if (source.flags & 48128 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -11220,10 +12814,10 @@ var ts; } } function inferFromProperties(source, target) { - var properties = getPropertiesOfType(target); + var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; - var sourceProp = getPropertyOfType(source, targetProp.name); + var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); } @@ -11253,112 +12847,283 @@ var ts; } } } + function getInferenceCandidates(context, index) { + var inferences = context.inferences[index]; + return inferences.primary || inferences.secondary || emptyArray; + } function getInferredType(context, index) { - var result = context.inferredTypes[index]; - if (!result) { - var commonType = getWidenedType(getBestCommonType(context.inferences[index])); - var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - var result = constraint && !isTypeAssignableTo(commonType, constraint) ? constraint : commonType; - context.inferredTypes[index] = result; + var inferredType = context.inferredTypes[index]; + if (!inferredType) { + var inferences = getInferenceCandidates(context, index); + if (inferences.length) { + var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); + inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; + } + else { + inferredType = emptyObjectType; + } + if (inferredType !== inferenceFailureType) { + var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + } + context.inferredTypes[index] = inferredType; } - return result; + return inferredType; } function getInferredTypes(context) { for (var i = 0; i < context.inferredTypes.length; i++) { getInferredType(context, i); } - context.inferences = undefined; return context.inferredTypes; } function hasAncestor(node, kind) { - return getAncestor(node, kind) !== undefined; + return ts.getAncestor(node, kind) !== undefined; } - function getAncestor(node, kind) { - switch (kind) { - case 169 /* ClassDeclaration */: - while (node) { - switch (node.kind) { - case 169 /* ClassDeclaration */: - return node; - case 171 /* EnumDeclaration */: - case 170 /* InterfaceDeclaration */: - case 172 /* ModuleDeclaration */: - case 174 /* ImportDeclaration */: - return undefined; - default: - node = node.parent; - continue; - } - } - break; - default: - while (node) { - if (node.kind === kind) { - return node; - } - else { - node = node.parent; - } - } - break; + function getResolvedSymbol(node) { + var links = getNodeLinks(node); + if (!links.resolvedSymbol) { + links.resolvedSymbol = resolveName(node, node.text, 107455 /* Value */ | 4194304 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol; } - return undefined; + return links.resolvedSymbol; } - function checkIdentifier(node) { - function isInTypeQuery(node) { - while (node) { - switch (node.kind) { - case 124 /* TypeQuery */: - return true; - case 55 /* Identifier */: - case 112 /* QualifiedName */: - node = node.parent; - continue; - default: - return false; + function isInTypeQuery(node) { + while (node) { + switch (node.kind) { + case 135 /* TypeQuery */: + return true; + case 63 /* Identifier */: + case 121 /* QualifiedName */: + node = node.parent; + continue; + default: + return false; + } + } + ts.Debug.fail("should not get here"); + } + function subtractPrimitiveTypes(type, subtractMask) { + if (type.flags & 16384 /* Union */) { + var types = type.types; + if (ts.forEach(types, function (t) { return t.flags & subtractMask; })) { + return getUnionType(ts.filter(types, function (t) { return !(t.flags & subtractMask); })); + } + } + return type; + } + function isVariableAssignedWithin(symbol, node) { + var links = getNodeLinks(node); + if (links.assignmentChecks) { + var cachedResult = links.assignmentChecks[symbol.id]; + if (cachedResult !== undefined) { + return cachedResult; + } + } + else { + links.assignmentChecks = {}; + } + return links.assignmentChecks[symbol.id] = isAssignedIn(node); + function isAssignedInBinaryExpression(node) { + if (node.operator >= 51 /* FirstAssignment */ && node.operator <= 62 /* LastAssignment */) { + var n = node.left; + while (n.kind === 151 /* ParenExpression */) { + n = n.expression; + } + if (n.kind === 63 /* Identifier */ && getResolvedSymbol(n) === symbol) { + return true; } } - ts.Debug.fail("should not get here"); + return ts.forEachChild(node, isAssignedIn); } - var symbol = resolveName(node, node.text, ts.SymbolFlags.Value | 524288 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)); - if (!symbol) { - symbol = unknownSymbol; + function isAssignedInVariableDeclaration(node) { + if (getSymbolOfNode(node) === symbol && node.initializer) { + return true; + } + return ts.forEachChild(node, isAssignedIn); } - if (symbol.flags & 4194304 /* Import */) { - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + function isAssignedIn(node) { + switch (node.kind) { + case 156 /* BinaryExpression */: + return isAssignedInBinaryExpression(node); + case 184 /* VariableDeclaration */: + return isAssignedInVariableDeclaration(node); + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 157 /* ConditionalExpression */: + case 161 /* Block */: + case 162 /* VariableStatement */: + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + return ts.forEachChild(node, isAssignedIn); + } + return false; + } + } + function getNarrowedTypeOfSymbol(symbol, node) { + var type = getTypeOfSymbol(symbol); + if (node && (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */)) { + loop: while (true) { + var child = node; + node = node.parent; + var narrowedType = type; + switch (node.kind) { + case 165 /* IfStatement */: + if (child !== node.expression) { + narrowedType = narrowType(type, node.expression, child === node.thenStatement); + } + break; + case 157 /* ConditionalExpression */: + if (child !== node.condition) { + narrowedType = narrowType(type, node.condition, child === node.whenTrue); + } + break; + case 156 /* BinaryExpression */: + if (child === node.right) { + if (node.operator === 47 /* AmpersandAmpersandToken */) { + narrowedType = narrowType(type, node.left, true); + } + else if (node.operator === 48 /* BarBarToken */) { + narrowedType = narrowType(type, node.left, false); + } + } + break; + case 196 /* SourceFile */: + case 191 /* ModuleDeclaration */: + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + break loop; + } + if (narrowedType !== type && isTypeSubtypeOf(narrowedType, type)) { + if (isVariableAssignedWithin(symbol, node)) { + break; + } + type = narrowedType; + } + } + } + return type; + function narrowTypeByEquality(type, expr, assumeTrue) { + var left = expr.left; + var right = expr.right; + if (left.kind !== 154 /* PrefixOperator */ || left.operator !== 95 /* TypeOfKeyword */ || left.operand.kind !== 63 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { + return type; + } + var t = right.text; + var checkType = t === "string" ? stringType : t === "number" ? numberType : t === "boolean" ? booleanType : emptyObjectType; + if (expr.operator === 30 /* ExclamationEqualsEqualsToken */) { + assumeTrue = !assumeTrue; + } + if (assumeTrue) { + return checkType === emptyObjectType ? subtractPrimitiveTypes(type, 2 /* String */ | 4 /* Number */ | 8 /* Boolean */) : checkType; + } + else { + return checkType === emptyObjectType ? type : subtractPrimitiveTypes(type, checkType.flags); + } + } + function narrowTypeByAnd(type, expr, assumeTrue) { + if (assumeTrue) { + return narrowType(narrowType(type, expr.left, true), expr.right, true); + } + else { + return getUnionType([ + narrowType(type, expr.left, false), + narrowType(narrowType(type, expr.left, true), expr.right, false) + ]); + } + } + function narrowTypeByOr(type, expr, assumeTrue) { + if (assumeTrue) { + return getUnionType([ + narrowType(type, expr.left, true), + narrowType(narrowType(type, expr.left, false), expr.right, true) + ]); + } + else { + return narrowType(narrowType(type, expr.left, false), expr.right, false); + } + } + function narrowTypeByInstanceof(type, expr, assumeTrue) { + if (!assumeTrue || expr.left.kind !== 63 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { + return type; + } + var rightType = checkExpression(expr.right); + if (!isTypeSubtypeOf(rightType, globalFunctionType)) { + return type; + } + var prototypeProperty = getPropertyOfType(rightType, "prototype"); + if (!prototypeProperty) { + return type; + } + var prototypeType = getTypeOfSymbol(prototypeProperty); + return isTypeSubtypeOf(prototypeType, type) ? prototypeType : type; + } + function narrowType(type, expr, assumeTrue) { + switch (expr.kind) { + case 151 /* ParenExpression */: + return narrowType(type, expr.expression, assumeTrue); + case 156 /* BinaryExpression */: + var operator = expr.operator; + if (operator === 29 /* EqualsEqualsEqualsToken */ || operator === 30 /* ExclamationEqualsEqualsToken */) { + return narrowTypeByEquality(type, expr, assumeTrue); + } + else if (operator === 47 /* AmpersandAmpersandToken */) { + return narrowTypeByAnd(type, expr, assumeTrue); + } + else if (operator === 48 /* BarBarToken */) { + return narrowTypeByOr(type, expr, assumeTrue); + } + else if (operator === 85 /* InstanceOfKeyword */) { + return narrowTypeByInstanceof(type, expr, assumeTrue); + } + break; + case 154 /* PrefixOperator */: + if (expr.operator === 45 /* ExclamationToken */) { + return narrowType(type, expr.operand, !assumeTrue); + } + break; + } + return type; + } + } + function checkIdentifier(node) { + var symbol = getResolvedSymbol(node); + if (symbol.flags & 33554432 /* Import */) { + getSymbolLinks(symbol).referenced = getSymbolLinks(symbol).referenced || (!isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol))); } - getNodeLinks(node).resolvedSymbol = symbol; checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); checkCollisionWithIndexVariableInGeneratedCode(node, node); - return getTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol)); - } - function getThisContainer(node) { - while (true) { - node = node.parent; - if (!node) { - return node; - } - switch (node.kind) { - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 172 /* ModuleDeclaration */: - case 115 /* Property */: - case 116 /* Method */: - case 117 /* Constructor */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 171 /* EnumDeclaration */: - case 177 /* SourceFile */: - case 137 /* ArrowFunction */: - return node; - } - } + return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 169 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 187 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 115 /* Property */ || container.kind === 117 /* Constructor */) { + if (container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -11366,26 +13131,26 @@ var ts; } } function checkThisExpression(node) { - var container = getThisContainer(node); + var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - while (container.kind === 137 /* ArrowFunction */) { - container = getThisContainer(container); + if (container.kind === 153 /* ArrowFunction */) { + container = ts.getThisContainer(container, false); needToCaptureLexicalThis = true; } switch (container.kind) { - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 171 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 117 /* Constructor */: + case 126 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 115 /* Property */: - if (container.flags & 64 /* Static */) { + case 124 /* Property */: + if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; @@ -11393,10 +13158,10 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 169 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 187 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); - return container.flags & 64 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); + return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); } return anyType; } @@ -11406,29 +13171,29 @@ var ts; if (!node) return node; switch (node.kind) { - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: - case 115 /* Property */: - case 116 /* Method */: - case 117 /* Constructor */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node; } } } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 114 /* Parameter */) { + if (n.kind === 123 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 132 /* CallExpression */ && node.parent.func === node; - var enclosingClass = getAncestor(node, 169 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 147 /* CallExpression */ && node.parent.func === node; + var enclosingClass = ts.getAncestor(node, 187 /* ClassDeclaration */); var baseClass; if (enclosingClass && enclosingClass.baseType) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -11442,26 +13207,26 @@ var ts; if (container) { var canUseSuperExpression = false; if (isCallExpression) { - canUseSuperExpression = container.kind === 117 /* Constructor */; + canUseSuperExpression = container.kind === 126 /* Constructor */; } else { var needToCaptureLexicalThis = false; - while (container && container.kind === 137 /* ArrowFunction */) { + while (container && container.kind === 153 /* ArrowFunction */) { container = getSuperContainer(container); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 169 /* ClassDeclaration */) { - if (container.flags & 64 /* Static */) { - canUseSuperExpression = container.kind === 116 /* Method */ || container.kind === 118 /* GetAccessor */ || container.kind === 119 /* SetAccessor */; + if (container && container.parent && container.parent.kind === 187 /* ClassDeclaration */) { + if (container.flags & 128 /* Static */) { + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */; } else { - canUseSuperExpression = container.kind === 116 /* Method */ || container.kind === 118 /* GetAccessor */ || container.kind === 119 /* SetAccessor */ || container.kind === 115 /* Property */ || container.kind === 117 /* Constructor */; + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */ || container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */; } } } if (canUseSuperExpression) { var returnType; - if ((container.flags & 64 /* Static */) || isCallExpression) { + if ((container.flags & 128 /* Static */) || isCallExpression) { getNodeLinks(node).flags |= 32 /* SuperStatic */; returnType = getTypeOfSymbol(baseClass.symbol); } @@ -11469,7 +13234,7 @@ var ts; getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 117 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 126 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -11489,11 +13254,19 @@ var ts; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; - if (func.kind === 136 /* FunctionExpression */ || func.kind === 137 /* ArrowFunction */) { + if (func.kind === 152 /* FunctionExpression */ || func.kind === 153 /* ArrowFunction */) { if (isContextSensitiveExpression(func)) { - var signature = getContextualSignature(func); - if (signature) { - return getTypeAtPosition(signature, ts.indexOf(func.parameters, parameter)); + var contextualSignature = getContextualSignature(func); + if (contextualSignature) { + var funcHasRestParameters = ts.hasRestParameters(func); + var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); + var indexOfParameter = ts.indexOf(func.parameters, parameter); + if (indexOfParameter < len) { + return getTypeAtPosition(contextualSignature, indexOfParameter); + } + if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { + return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); + } } } } @@ -11505,16 +13278,16 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 114 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { return getContextuallyTypedParameterType(declaration); } } return undefined; } function getContextualTypeForReturnExpression(node) { - var func = getContainingFunction(node); + var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 117 /* Constructor */ || func.kind === 118 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 119 /* SetAccessor */))) { + if (func.type || func.kind === 126 /* Constructor */ || func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignature(func); @@ -11536,12 +13309,12 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operator; - if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + if (operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } } - else if (operator === 40 /* BarBarToken */) { + else if (operator === 48 /* BarBarToken */) { var type = getContextualType(binaryExpression); if (!type && node === binaryExpression.right) { type = checkExpression(binaryExpression.left); @@ -11550,92 +13323,160 @@ var ts; } return undefined; } + function applyToContextualType(type, mapper) { + if (!(type.flags & 16384 /* Union */)) { + return mapper(type); + } + var types = type.types; + var mappedType; + var mappedTypes; + for (var i = 0; i < types.length; i++) { + var t = mapper(types[i]); + if (t) { + if (!mappedType) { + mappedType = t; + } + else if (!mappedTypes) { + mappedTypes = [mappedType, t]; + } + else { + mappedTypes.push(t); + } + } + } + return mappedTypes ? getUnionType(mappedTypes) : mappedType; + } + function getTypeOfPropertyOfContextualType(type, name) { + return applyToContextualType(type, function (t) { + var prop = getPropertyOfObjectType(t, name); + return prop ? getTypeOfSymbol(prop) : undefined; + }); + } + function getIndexTypeOfContextualType(type, kind) { + return applyToContextualType(type, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }); + } + function contextualTypeIsTupleType(type) { + return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, function (t) { return getPropertyOfObjectType(t, "0"); }) : getPropertyOfObjectType(type, "0")); + } + function contextualTypeHasIndexSignature(type, kind) { + return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }) : getIndexTypeOfObjectOrUnionType(type, kind)); + } function getContextualTypeForPropertyExpression(node) { var declaration = node.parent; var objectLiteral = declaration.parent; var type = getContextualType(objectLiteral); var name = declaration.name.text; if (type && name) { - var prop = getPropertyOfType(type, name); - if (prop) { - return getTypeOfSymbol(prop); - } - return isNumericName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */); + return getTypeOfPropertyOfContextualType(type, name) || isNumericName(name) && getIndexTypeOfContextualType(type, 1 /* Number */) || getIndexTypeOfContextualType(type, 0 /* String */); } return undefined; } function getContextualTypeForElementExpression(node) { var arrayLiteral = node.parent; var type = getContextualType(arrayLiteral); - return type ? getIndexTypeOfType(type, 1 /* Number */) : undefined; + if (type) { + var index = ts.indexOf(arrayLiteral.elements, node); + return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1 /* Number */); + } + return undefined; } function getContextualTypeForConditionalOperand(node) { var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } function getContextualType(node) { + if (isInsideWithStatementBody(node)) { + return undefined; + } if (node.contextualType) { return node.contextualType; } var parent = node.parent; switch (parent.kind) { - case 166 /* VariableDeclaration */: - case 114 /* Parameter */: - case 115 /* Property */: + case 184 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: return getContextualTypeForInitializerExpression(node); - case 137 /* ArrowFunction */: - case 154 /* ReturnStatement */: + case 153 /* ArrowFunction */: + case 172 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 132 /* CallExpression */: - case 133 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return getContextualTypeForArgument(node); - case 134 /* TypeAssertion */: + case 150 /* TypeAssertion */: return getTypeFromTypeNode(parent.type); - case 140 /* BinaryExpression */: + case 156 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 129 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: return getContextualTypeForPropertyExpression(node); - case 127 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return getContextualTypeForElementExpression(node); - case 141 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); } return undefined; } + function getNonGenericSignature(type) { + var signatures = getSignaturesOfObjectOrUnionType(type, 0 /* Call */); + if (signatures.length === 1) { + var signature = signatures[0]; + if (!signature.typeParameters) { + return signature; + } + } + } function getContextualSignature(node) { var type = getContextualType(node); - if (type) { - var signatures = getSignaturesOfType(type, 0 /* Call */); - if (signatures.length === 1) { - var signature = signatures[0]; - if (!signature.typeParameters) { - return signature; + if (!type) { + return undefined; + } + if (!(type.flags & 16384 /* Union */)) { + return getNonGenericSignature(type); + } + var signatureList; + var types = type.types; + for (var i = 0; i < types.length; i++) { + if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0 /* Call */).length > 1) { + return undefined; + } + var signature = getNonGenericSignature(types[i]); + if (signature) { + if (!signatureList) { + signatureList = [signature]; + } + else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { + return undefined; + } + else { + signatureList.push(signature); } } } - return undefined; + var result; + if (signatureList) { + result = cloneSignature(signatureList[0]); + result.resolvedReturnType = undefined; + result.unionSignatures = signatureList; + } + return result; } function isInferentialContext(mapper) { return mapper && mapper !== identityMapper; } function checkArrayLiteral(node, contextualMapper) { - var elementTypes = []; - ts.forEach(node.elements, function (element) { - if (element.kind !== 142 /* OmittedExpression */) { - var type = checkExpression(element, contextualMapper); - if (!ts.contains(elementTypes, type)) - elementTypes.push(type); - } - }); - var contextualType = isInferentialContext(contextualMapper) ? undefined : getContextualType(node); - var contextualElementType = contextualType && getIndexTypeOfType(contextualType, 1 /* Number */); - var elementType = getBestCommonType(elementTypes, contextualElementType, true); - if (!elementType) - elementType = elementTypes.length ? emptyObjectType : undefinedType; - return createArrayType(elementType); + var elements = node.elements; + if (!elements.length) { + return createArrayType(undefinedType); + } + var elementTypes = ts.map(elements, function (e) { return checkExpression(e, contextualMapper); }); + var contextualType = getContextualType(node); + if (contextualType && contextualTypeIsTupleType(contextualType)) { + return createTupleType(elementTypes); + } + return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return !isNaN(name); + return (+name).toString() === name; } function checkObjectLiteral(node, contextualMapper) { var members = node.symbol.members; @@ -11644,22 +13485,31 @@ var ts; for (var id in members) { if (ts.hasProperty(members, id)) { var member = members[id]; - if (member.flags & 2 /* Property */) { - var type = checkExpression(member.declarations[0].initializer, contextualMapper); - var prop = createSymbol(2 /* Property */ | 33554432 /* Transient */, member.name); + if (member.flags & 4 /* Property */) { + var memberDecl = member.declarations[0]; + var type; + if (memberDecl.kind === 143 /* PropertyAssignment */) { + type = checkExpression(memberDecl.initializer, contextualMapper); + } + else { + ts.Debug.assert(memberDecl.kind === 144 /* ShorthandPropertyAssignment */); + type = checkExpression(memberDecl.name, contextualMapper); + } + var prop = createSymbol(4 /* Property */ | 268435456 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) prop.valueDeclaration = member.valueDeclaration; prop.type = type; + prop.target = member; member = prop; } else { - var getAccessor = getDeclarationOfKind(member, 118 /* GetAccessor */); + var getAccessor = getDeclarationOfKind(member, 127 /* GetAccessor */); if (getAccessor) { checkAccessorDeclaration(getAccessor); } - var setAccessor = getDeclarationOfKind(member, 119 /* SetAccessor */); + var setAccessor = getDeclarationOfKind(member, 128 /* SetAccessor */); if (setAccessor) { checkAccessorDeclaration(setAccessor); } @@ -11671,29 +13521,56 @@ var ts; var numberIndexType = getIndexType(1 /* Number */); return createAnonymousType(node.symbol, properties, emptyArray, emptyArray, stringIndexType, numberIndexType); function getIndexType(kind) { - if (contextualType) { - var indexType = getIndexTypeOfType(contextualType, kind); - if (indexType) { - var propTypes = []; - for (var id in properties) { - if (ts.hasProperty(properties, id)) { - if (kind === 0 /* String */ || isNumericName(id)) { - var type = getTypeOfSymbol(properties[id]); - if (!ts.contains(propTypes, type)) - propTypes.push(type); + if (contextualType && contextualTypeHasIndexSignature(contextualType, kind)) { + var propTypes = []; + for (var id in properties) { + if (ts.hasProperty(properties, id)) { + if (kind === 0 /* String */ || isNumericName(id)) { + var type = getTypeOfSymbol(properties[id]); + if (!ts.contains(propTypes, type)) { + propTypes.push(type); } } } - return getBestCommonType(propTypes, isInferentialContext(contextualMapper) ? undefined : indexType); } + return propTypes.length ? getUnionType(propTypes) : undefinedType; } + return undefined; } } function getDeclarationKindFromSymbol(s) { - return s.flags & 67108864 /* Prototype */ ? 115 /* Property */ : s.valueDeclaration.kind; + return s.valueDeclaration ? s.valueDeclaration.kind : 124 /* Property */; } function getDeclarationFlagsFromSymbol(s) { - return s.flags & 67108864 /* Prototype */ ? 16 /* Public */ | 64 /* Static */ : s.valueDeclaration.flags; + return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 536870912 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; + } + function checkClassPropertyAccess(node, type, prop) { + var flags = getDeclarationFlagsFromSymbol(prop); + if (!(flags & (32 /* Private */ | 64 /* Protected */))) { + return; + } + var enclosingClassDeclaration = ts.getAncestor(node, 187 /* ClassDeclaration */); + var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; + var declaringClass = getDeclaredTypeOfSymbol(prop.parent); + if (flags & 32 /* Private */) { + if (declaringClass !== enclosingClass) { + error(node, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); + } + return; + } + if (node.left.kind === 89 /* SuperKeyword */) { + return; + } + if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { + error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); + return; + } + if (flags & 128 /* Static */) { + return; + } + if (!(getTargetType(type).flags & (1024 /* Class */ | 2048 /* Interface */) && hasBaseType(type, enclosingClass))) { + error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); + } } function checkPropertyAccess(node) { var type = checkExpression(node.left); @@ -11704,57 +13581,71 @@ var ts; if (apparentType === unknownType) { return unknownType; } - var prop = getPropertyOfApparentType(apparentType, node.right.text); + var prop = getPropertyOfType(apparentType, node.right.text); if (!prop) { if (node.right.text) { - error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.identifierToString(node.right), typeToString(type)); + error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(node.right), typeToString(type)); } return unknownType; } getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 81 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 116 /* Method */) { - error(node.right, ts.Diagnostics.Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword); + if (prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { + error(node.right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } - else if (getDeclarationFlagsFromSymbol(prop) & 32 /* Private */) { - var classDeclaration = getAncestor(node, 169 /* ClassDeclaration */); - if (!classDeclaration || !ts.contains(prop.parent.declarations, classDeclaration)) { - error(node, ts.Diagnostics.Property_0_is_inaccessible, getFullyQualifiedName(prop)); - } + else { + checkClassPropertyAccess(node, type, prop); } } return getTypeOfSymbol(prop); } return anyType; } + function isValidPropertyAccess(node, propertyName) { + var type = checkExpression(node.left); + if (type !== unknownType && type !== anyType) { + var prop = getPropertyOfType(getWidenedType(type), propertyName); + if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { + return false; + } + else { + var diagnosticsCount = diagnostics.length; + checkClassPropertyAccess(node, type, prop); + return diagnostics.length === diagnosticsCount; + } + } + } + return true; + } function checkIndexedAccess(node) { - var objectType = checkExpression(node.object); + var objectType = getApparentType(checkExpression(node.object)); var indexType = checkExpression(node.index); if (objectType === unknownType) return unknownType; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) { - return unknownType; + if (isConstEnumObjectType(objectType) && node.index.kind !== 7 /* StringLiteral */) { + error(node.index, ts.Diagnostics.Index_expression_arguments_in_const_enums_must_be_of_type_string); } - if (node.index.kind === 3 /* StringLiteral */ || node.index.kind === 2 /* NumericLiteral */) { + if (node.index.kind === 7 /* StringLiteral */ || node.index.kind === 6 /* NumericLiteral */) { var name = node.index.text; - var prop = getPropertyOfApparentType(apparentType, name); + var prop = getPropertyOfType(objectType, name); if (prop) { + getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } } - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike)) { - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.NumberLike)) { - var numberIndexType = getIndexTypeOfType(apparentType, 1 /* Number */); + if (indexType.flags & (1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */)) { + if (indexType.flags & (1 /* Any */ | 132 /* NumberLike */)) { + var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); if (numberIndexType) { return numberIndexType; } } - var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); + var stringIndexType = getIndexTypeOfType(objectType, 0 /* String */); if (stringIndexType) { return stringIndexType; } - if (program.getCompilerOptions().noImplicitAny && objectType !== anyType) { + if (compilerOptions.noImplicitAny && objectType !== anyType) { error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); } return anyType; @@ -11763,28 +13654,296 @@ var ts; return unknownType; } function resolveUntypedCall(node) { - ts.forEach(node.arguments, function (argument) { - checkExpression(argument); - }); + if (node.kind === 149 /* TaggedTemplateExpression */) { + checkExpression(node.template); + } + else { + ts.forEach(node.arguments, function (argument) { + checkExpression(argument); + }); + } return anySignature; } function resolveErrorCall(node) { resolveUntypedCall(node); return unknownSignature; } - function isCandidateSignature(node, signature) { - var args = node.arguments || emptyArray; - return args.length >= signature.minArgumentCount && (signature.hasRestParameter || args.length <= signature.parameters.length) && (!node.typeArguments || signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); + function hasCorrectArity(node, args, signature) { + var adjustedArgCount; + var typeArguments; + var callIsIncomplete; + if (node.kind === 149 /* TaggedTemplateExpression */) { + var tagExpression = node; + adjustedArgCount = args.length; + typeArguments = undefined; + if (tagExpression.template.kind === 158 /* TemplateExpression */) { + var templateExpression = tagExpression.template; + var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + ts.Debug.assert(lastSpan !== undefined); + callIsIncomplete = lastSpan.literal.kind === 120 /* Missing */ || ts.isUnterminatedTemplateEnd(lastSpan.literal); + } + else { + var templateLiteral = tagExpression.template; + ts.Debug.assert(templateLiteral.kind === 9 /* NoSubstitutionTemplateLiteral */); + callIsIncomplete = ts.isUnterminatedTemplateEnd(templateLiteral); + } + } + else { + var callExpression = node; + if (!callExpression.arguments) { + ts.Debug.assert(callExpression.kind === 148 /* NewExpression */); + return signature.minArgumentCount === 0; + } + adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; + callIsIncomplete = callExpression.arguments.end === callExpression.end; + typeArguments = callExpression.typeArguments; + } + ts.Debug.assert(adjustedArgCount !== undefined, "'adjustedArgCount' undefined"); + ts.Debug.assert(callIsIncomplete !== undefined, "'callIsIncomplete' undefined"); + return checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature); + function checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature) { + if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) { + return false; + } + var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + if (!hasRightNumberOfTypeArgs) { + return false; + } + var hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount; + return callIsIncomplete || hasEnoughArguments; + } } - function collectCandidates(node, signatures) { - var result = []; - var lastParent; - var lastSymbol; - var cutoffPos = 0; - var pos; - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; - if (isCandidateSignature(node, signature)) { + function getSingleCallSignature(type) { + if (type.flags & 48128 /* ObjectType */) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { + return resolved.callSignatures[0]; + } + } + return undefined; + } + function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { + var context = createInferenceContext(signature.typeParameters, true); + forEachMatchingParameterType(contextualSignature, signature, function (source, target) { + inferTypes(context, instantiateType(source, contextualMapper), target); + }); + return getSignatureInstantiation(signature, getInferredTypes(context)); + } + function inferTypeArguments(signature, args, excludeArgument) { + var typeParameters = signature.typeParameters; + var context = createInferenceContext(typeParameters, false); + var mapper = createInferenceMapper(context); + for (var i = 0; i < args.length; i++) { + if (args[i].kind === 160 /* OmittedExpression */) { + continue; + } + if (!excludeArgument || excludeArgument[i] === undefined) { + var parameterType = getTypeAtPosition(signature, i); + if (i === 0 && args[i].parent.kind === 149 /* TaggedTemplateExpression */) { + inferTypes(context, globalTemplateStringsArrayType, parameterType); + continue; + } + inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); + } + } + if (excludeArgument) { + for (var i = 0; i < args.length; i++) { + if (args[i].kind === 160 /* OmittedExpression */) { + continue; + } + if (excludeArgument[i] === false) { + var parameterType = getTypeAtPosition(signature, i); + inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); + } + } + } + var inferredTypes = getInferredTypes(context); + context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); + for (var i = 0; i < inferredTypes.length; i++) { + if (inferredTypes[i] === inferenceFailureType) { + inferredTypes[i] = unknownType; + } + } + return context; + } + function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors) { + var typeParameters = signature.typeParameters; + var typeArgumentsAreAssignable = true; + for (var i = 0; i < typeParameters.length; i++) { + var typeArgNode = typeArguments[i]; + var typeArgument = getTypeFromTypeNode(typeArgNode); + typeArgumentResultTypes[i] = typeArgument; + if (typeArgumentsAreAssignable) { + var constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + } + } + return typeArgumentsAreAssignable; + } + function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + var argType; + if (arg.kind === 160 /* OmittedExpression */) { + continue; + } + var paramType = getTypeAtPosition(signature, i); + if (i === 0 && node.kind === 149 /* TaggedTemplateExpression */) { + argType = globalTemplateStringsArrayType; + } + else { + argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + } + var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); + if (!isValidArgument) { + return false; + } + } + return true; + } + function getEffectiveCallArguments(node) { + var args; + if (node.kind === 149 /* TaggedTemplateExpression */) { + var template = node.template; + args = [template]; + if (template.kind === 158 /* TemplateExpression */) { + ts.forEach(template.templateSpans, function (span) { + args.push(span.expression); + }); + } + } + else { + args = node.arguments || emptyArray; + } + return args; + } + function resolveCall(node, signatures, candidatesOutArray) { + var isTaggedTemplate = node.kind === 149 /* TaggedTemplateExpression */; + var typeArguments = isTaggedTemplate ? undefined : node.typeArguments; + ts.forEach(typeArguments, checkSourceElement); + var candidates = candidatesOutArray || []; + collectCandidates(); + if (!candidates.length) { + error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + return resolveErrorCall(node); + } + var args = getEffectiveCallArguments(node); + var excludeArgument; + for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { + if (isContextSensitiveExpression(args[i])) { + if (!excludeArgument) { + excludeArgument = new Array(args.length); + } + excludeArgument[i] = true; + } + } + var candidateForArgumentError; + var candidateForTypeArgumentError; + var resultOfFailedInference; + var result; + if (candidates.length > 1) { + result = chooseOverload(candidates, subtypeRelation); + } + if (!result) { + candidateForArgumentError = undefined; + candidateForTypeArgumentError = undefined; + resultOfFailedInference = undefined; + result = chooseOverload(candidates, assignableRelation); + } + if (result) { + return result; + } + if (candidateForArgumentError) { + checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true); + } + else if (candidateForTypeArgumentError) { + if (!isTaggedTemplate && node.typeArguments) { + checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], true); + } + else { + ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); + var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex]; + var inferenceCandidates = getInferenceCandidates(resultOfFailedInference, resultOfFailedInference.failedTypeParameterIndex); + var diagnosticChainHead = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, typeToString(failedTypeParameter)); + reportNoCommonSupertypeError(inferenceCandidates, node.func || node.tag, diagnosticChainHead); + } + } + else { + error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + } + if (!fullTypeCheck) { + for (var i = 0, n = candidates.length; i < n; i++) { + if (hasCorrectArity(node, args, candidates[i])) { + return candidates[i]; + } + } + } + return resolveErrorCall(node); + function chooseOverload(candidates, relation) { + for (var i = 0; i < candidates.length; i++) { + if (!hasCorrectArity(node, args, candidates[i])) { + continue; + } + var originalCandidate = candidates[i]; + var inferenceResult; + while (true) { + var candidate = originalCandidate; + if (candidate.typeParameters) { + var typeArgumentTypes; + var typeArgumentsAreValid; + if (typeArguments) { + typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); + } + else { + inferenceResult = inferTypeArguments(candidate, args, excludeArgument); + typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; + typeArgumentTypes = inferenceResult.inferredTypes; + } + if (!typeArgumentsAreValid) { + break; + } + candidate = getSignatureInstantiation(candidate, typeArgumentTypes); + } + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { + break; + } + var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; + if (index < 0) { + return candidate; + } + excludeArgument[index] = false; + } + if (originalCandidate.typeParameters) { + var instantiatedCandidate = candidate; + if (typeArgumentsAreValid) { + candidateForArgumentError = instantiatedCandidate; + } + else { + candidateForTypeArgumentError = originalCandidate; + if (!typeArguments) { + resultOfFailedInference = inferenceResult; + } + } + } + else { + ts.Debug.assert(originalCandidate === candidate); + candidateForArgumentError = originalCandidate; + } + } + return undefined; + } + function collectCandidates() { + var result = candidates; + var lastParent; + var lastSymbol; + var cutoffPos = 0; + var pos; + ts.Debug.assert(!result.length); + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); var parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { @@ -11807,145 +13966,23 @@ var ts; result[pos] = signature; } } - return result; } - function getSingleCallSignature(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { - return resolved.callSignatures[0]; - } - } - return undefined; - } - function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature.typeParameters); - forEachMatchingParameterType(contextualSignature, signature, function (source, target) { - inferTypes(context, instantiateType(source, contextualMapper), target); - }); - return getSignatureInstantiation(signature, getInferredTypes(context)); - } - function inferentiallyTypeExpession(expr, contextualType, contextualMapper) { - var type = checkExpressionWithContextualType(expr, contextualType, contextualMapper); - var signature = getSingleCallSignature(type); - if (signature && signature.typeParameters) { - var contextualSignature = getSingleCallSignature(contextualType); - if (contextualSignature && !contextualSignature.typeParameters) { - type = getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); - } - } - return type; - } - function inferTypeArguments(signature, args, excludeArgument) { - var typeParameters = signature.typeParameters; - var context = createInferenceContext(typeParameters); - var mapper = createInferenceMapper(context); - for (var i = 0; i < args.length; i++) { - if (!excludeArgument || excludeArgument[i] === undefined) { - var parameterType = getTypeAtPosition(signature, i); - inferTypes(context, inferentiallyTypeExpession(args[i], parameterType, mapper), parameterType); - } - } - if (excludeArgument) { - for (var i = 0; i < args.length; i++) { - if (excludeArgument[i] === false) { - var parameterType = getTypeAtPosition(signature, i); - inferTypes(context, inferentiallyTypeExpession(args[i], parameterType, mapper), parameterType); - } - } - } - return getInferredTypes(context); - } - function checkTypeArguments(signature, typeArguments) { - var typeParameters = signature.typeParameters; - var result = []; - for (var i = 0; i < typeParameters.length; i++) { - var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); - var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint && fullTypeCheck) { - checkTypeAssignableTo(typeArgument, constraint, typeArgNode, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } - result.push(typeArgument); - } - return result; - } - function checkApplicableSignature(node, signature, relation, excludeArgument, reportErrors) { - if (node.arguments) { - for (var i = 0; i < node.arguments.length; i++) { - var arg = node.arguments[i]; - var paramType = getTypeAtPosition(signature, i); - var argType = arg.kind === 3 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); - if (!isValidArgument) { - return false; - } - } - } - return true; - } - function resolveCall(node, signatures) { - ts.forEach(node.typeArguments, checkSourceElement); - var candidates = collectCandidates(node, signatures); - if (!candidates.length) { - error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); - return resolveErrorCall(node); - } - var args = node.arguments || emptyArray; - var excludeArgument; - for (var i = 0; i < args.length; i++) { - if (isContextSensitiveExpression(args[i])) { - if (!excludeArgument) - excludeArgument = new Array(args.length); - excludeArgument[i] = true; - } - } - var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; - while (true) { - for (var i = 0; i < candidates.length; i++) { - while (true) { - var candidate = candidates[i]; - if (candidate.typeParameters) { - var typeArguments = node.typeArguments ? checkTypeArguments(candidate, node.typeArguments) : inferTypeArguments(candidate, args, excludeArgument); - candidate = getSignatureInstantiation(candidate, typeArguments); - } - if (!checkApplicableSignature(node, candidate, relation, excludeArgument, false)) { - break; - } - var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; - if (index < 0) { - return candidate; - } - excludeArgument[index] = false; - } - } - if (relation === assignableRelation) { - break; - } - relation = assignableRelation; - } - checkApplicableSignature(node, candidate, relation, undefined, true); - return resolveErrorCall(node); - } - function resolveCallExpression(node) { - if (node.func.kind === 81 /* SuperKeyword */) { + function resolveCallExpression(node, candidatesOutArray) { + if (node.func.kind === 89 /* SuperKeyword */) { var superType = checkSuperExpression(node.func); if (superType !== unknownType) { - return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */)); + return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); } return resolveUntypedCall(node); } var funcType = checkExpression(node.func); - if (funcType === unknownType) { - return resolveErrorCall(node); - } var apparentType = getApparentType(funcType); if (apparentType === unknownType) { return resolveErrorCall(node); } var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); var constructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */); - if ((funcType === anyType) || (!callSignatures.length && !constructSignatures.length && isTypeAssignableTo(funcType, globalFunctionType))) { + if (funcType === anyType || (!callSignatures.length && !constructSignatures.length && !(funcType.flags & 16384 /* Union */) && isTypeAssignableTo(funcType, globalFunctionType))) { if (node.typeArguments) { error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); } @@ -11960,13 +13997,10 @@ var ts; } return resolveErrorCall(node); } - return resolveCall(node, callSignatures); + return resolveCall(node, callSignatures, candidatesOutArray); } - function resolveNewExpression(node) { + function resolveNewExpression(node, candidatesOutArray) { var expressionType = checkExpression(node.func); - if (expressionType === unknownType) { - return resolveErrorCall(node); - } if (expressionType === anyType) { if (node.typeArguments) { error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); @@ -11979,11 +14013,11 @@ var ts; } var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */); if (constructSignatures.length) { - return resolveCall(node, constructSignatures); + return resolveCall(node, constructSignatures, candidatesOutArray); } var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */); if (callSignatures.length) { - var signature = resolveCall(node, callSignatures); + var signature = resolveCall(node, callSignatures, candidatesOutArray); if (getReturnTypeOfSignature(signature) !== voidType) { error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); } @@ -11992,23 +14026,50 @@ var ts; error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); return resolveErrorCall(node); } - function getResolvedSignature(node) { + function resolveTaggedTemplateExpression(node, candidatesOutArray) { + var tagType = checkExpression(node.tag); + var apparentType = getApparentType(tagType); + if (apparentType === unknownType) { + return resolveErrorCall(node); + } + var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); + if (tagType === anyType || (!callSignatures.length && !(tagType.flags & 16384 /* Union */) && isTypeAssignableTo(tagType, globalFunctionType))) { + return resolveUntypedCall(node); + } + if (!callSignatures.length) { + error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + return resolveErrorCall(node); + } + return resolveCall(node, callSignatures, candidatesOutArray); + } + function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); - if (!links.resolvedSignature) { + if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 132 /* CallExpression */ ? resolveCallExpression(node) : resolveNewExpression(node); + if (node.kind === 147 /* CallExpression */) { + links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); + } + else if (node.kind === 148 /* NewExpression */) { + links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); + } + else if (node.kind === 149 /* TaggedTemplateExpression */) { + links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); + } + else { + ts.Debug.fail("Branch in 'getResolvedSignature' should be unreachable."); + } } return links.resolvedSignature; } function checkCallExpression(node) { var signature = getResolvedSignature(node); - if (node.func.kind === 81 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { return voidType; } - if (node.kind === 133 /* NewExpression */) { + if (node.kind === 148 /* NewExpression */) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== 117 /* Constructor */ && declaration.kind !== 121 /* ConstructSignature */)) { - if (program.getCompilerOptions().noImplicitAny) { + if (declaration && declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */ && declaration.kind !== 134 /* ConstructorType */) { + if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -12016,13 +14077,16 @@ var ts; } return getReturnTypeOfSignature(signature); } + function checkTaggedTemplateExpression(node) { + return getReturnTypeOfSignature(getResolvedSignature(node)); + } function checkTypeAssertion(node) { var exprType = checkExpression(node.operand); var targetType = getTypeFromTypeNode(node.type); if (fullTypeCheck && targetType !== unknownType) { - var widenedType = getWidenedType(exprType); - if (!(isTypeAssignableTo(exprType, targetType) || isTypeAssignableTo(targetType, widenedType))) { - checkTypeAssignableTo(targetType, widenedType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); + var widenedType = getWidenedType(exprType, true); + if (!(isTypeAssignableTo(targetType, widenedType))) { + checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } return targetType; @@ -12044,26 +14108,27 @@ var ts; } } function getReturnTypeFromBody(func, contextualMapper) { - if (func.body.kind !== 168 /* FunctionBlock */) { + var contextualSignature = getContextualSignature(func); + if (func.body.kind !== 186 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); - if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType)); } return widenedType; } var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); if (types.length > 0) { - var commonType = getBestCommonType(types, undefined, true); + var commonType = contextualSignature ? getUnionType(types) : getCommonSupertype(types); if (!commonType) { error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); return unknownType; } var widenedType = getWidenedType(commonType); - if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { var typeName = typeToString(widenedType); if (func.name) { - error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(func.name), typeName); + error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.declarationNameToString(func.name), typeName); } else { error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -12073,35 +14138,9 @@ var ts; } return voidType; } - function forEachReturnStatement(body, visitor) { - return traverse(body); - function traverse(node) { - switch (node.kind) { - case 154 /* ReturnStatement */: - return visitor(node); - case 143 /* Block */: - case 168 /* FunctionBlock */: - case 147 /* IfStatement */: - case 148 /* DoStatement */: - case 149 /* WhileStatement */: - case 150 /* ForStatement */: - case 151 /* ForInStatement */: - case 155 /* WithStatement */: - case 156 /* SwitchStatement */: - case 157 /* CaseClause */: - case 158 /* DefaultClause */: - case 159 /* LabelledStatement */: - case 161 /* TryStatement */: - case 162 /* TryBlock */: - case 163 /* CatchBlock */: - case 164 /* FinallyBlock */: - return ts.forEachChild(node, traverse); - } - } - } function checkAndAggregateReturnExpressionTypes(body, contextualMapper) { var aggregatedTypes = []; - forEachReturnStatement(body, function (returnStatement) { + ts.forEachReturnStatement(body, function (returnStatement) { var expr = returnStatement.expression; if (expr) { var type = checkAndMarkExpression(expr, contextualMapper); @@ -12113,12 +14152,12 @@ var ts; return aggregatedTypes; } function bodyContainsAReturnStatement(funcBody) { - return forEachReturnStatement(funcBody, function (returnStatement) { + return ts.forEachReturnStatement(funcBody, function (returnStatement) { return true; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 160 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 178 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!fullTypeCheck) { @@ -12127,7 +14166,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (!func.body || func.body.kind !== 168 /* FunctionBlock */) { + if (!func.body || func.body.kind !== 186 /* FunctionBlock */) { return; } var bodyBlock = func.body; @@ -12162,56 +14201,81 @@ var ts; } } } + checkSignatureDeclaration(node); } } - if (fullTypeCheck && !(links.flags & 1 /* TypeChecked */)) { - checkSignatureDeclaration(node); - if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); - } - if (node.body.kind === 168 /* FunctionBlock */) { - checkSourceElement(node.body); - } - else { - var exprType = checkExpression(node.body); - if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined, undefined); - } - } - links.flags |= 1 /* TypeChecked */; - } return type; } + function checkFunctionExpressionBody(node) { + if (node.type) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + } + if (node.body.kind === 186 /* FunctionBlock */) { + checkSourceElement(node.body); + } + else { + var exprType = checkExpression(node.body); + if (node.type) { + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); + } + checkFunctionExpressionBodies(node.body); + } + } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!(type.flags & (1 /* Any */ | ts.TypeFlags.NumberLike))) { + if (!(type.flags & (1 /* Any */ | 132 /* NumberLike */))) { error(operand, diagnostic); return false; } return true; } - function checkReferenceExpression(n, message) { + function checkReferenceExpression(n, invalidReferenceMessage, constantVarianleMessage) { function findSymbol(n) { var symbol = getNodeLinks(n).resolvedSymbol; return symbol && getExportSymbolOfValueSymbolIfExported(symbol); } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 55 /* Identifier */: + case 63 /* Identifier */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 1 /* Variable */) !== 0; - case 130 /* PropertyAccess */: + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; + case 145 /* PropertyAccess */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~4 /* EnumMember */) !== 0; - case 131 /* IndexedAccess */: + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; + case 146 /* IndexedAccess */: return true; - case 135 /* ParenExpression */: + case 151 /* ParenExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; } } + function isConstVariableReference(n) { + switch (n.kind) { + case 63 /* Identifier */: + case 145 /* PropertyAccess */: + var symbol = findSymbol(n); + return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; + case 146 /* IndexedAccess */: + var index = n.index; + var symbol = findSymbol(n.object); + if (symbol && index.kind === 7 /* StringLiteral */) { + var name = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; + } + return false; + case 151 /* ParenExpression */: + return isConstVariableReference(n.expression); + default: + return false; + } + } if (!isReferenceOrErrorExpression(n)) { - error(n, message); + error(n, invalidReferenceMessage); + return false; + } + if (isConstVariableReference(n)) { + error(n, constantVarianleMessage); return false; } return true; @@ -12219,22 +14283,22 @@ var ts; function checkPrefixExpression(node) { var operandType = checkExpression(node.operand); switch (node.operator) { - case 24 /* PlusToken */: - case 25 /* MinusToken */: - case 38 /* TildeToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: return numberType; - case 37 /* ExclamationToken */: - case 64 /* DeleteKeyword */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: return booleanType; - case 87 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return stringType; - case 89 /* VoidKeyword */: + case 97 /* VoidKeyword */: return undefinedType; - case 29 /* PlusPlusToken */: - case 30 /* MinusMinusToken */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -12244,18 +14308,27 @@ var ts; var operandType = checkExpression(node.operand); var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } - function isTypeAnyTypeObjectTypeOrTypeParameter(type) { - return type === anyType || ((type.flags & (ts.TypeFlags.ObjectType | 512 /* TypeParameter */)) !== 0); + function isStructuredType(type) { + if (type.flags & 16384 /* Union */) { + return !ts.forEach(type.types, function (t) { return !isStructuredType(t); }); + } + return (type.flags & 65025 /* Structured */) !== 0; + } + function isConstEnumObjectType(type) { + return type.flags & (48128 /* ObjectType */ | 32768 /* Anonymous */) && type.symbol && isConstEnumSymbol(type.symbol); + } + function isConstEnumSymbol(symbol) { + return (symbol.flags & 128 /* ConstEnum */) !== 0; } function checkInstanceOfExpression(node, leftType, rightType) { - if (!isTypeAnyTypeObjectTypeOrTypeParameter(leftType)) { + if (leftType !== unknownType && !isStructuredType(leftType)) { error(node.left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { + if (rightType !== unknownType && rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { error(node.right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -12264,7 +14337,7 @@ var ts; if (leftType !== anyType && leftType !== stringType && leftType !== numberType) { error(node.left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number); } - if (!isTypeAnyTypeObjectTypeOrTypeParameter(rightType)) { + if (!isStructuredType(rightType)) { error(node.right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -12274,47 +14347,53 @@ var ts; var leftType = checkExpression(node.left, contextualMapper); var rightType = checkExpression(node.right, contextualMapper); switch (operator) { - case 26 /* AsteriskToken */: - case 46 /* AsteriskEqualsToken */: - case 27 /* SlashToken */: - case 47 /* SlashEqualsToken */: - case 28 /* PercentToken */: - case 48 /* PercentEqualsToken */: - case 25 /* MinusToken */: - case 45 /* MinusEqualsToken */: - case 31 /* LessThanLessThanToken */: - case 49 /* LessThanLessThanEqualsToken */: - case 32 /* GreaterThanGreaterThanToken */: - case 50 /* GreaterThanGreaterThanEqualsToken */: - case 33 /* GreaterThanGreaterThanGreaterThanToken */: - case 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 35 /* BarToken */: - case 53 /* BarEqualsToken */: - case 36 /* CaretToken */: - case 54 /* CaretEqualsToken */: - case 34 /* AmpersandToken */: - case 52 /* AmpersandEqualsToken */: + case 34 /* AsteriskToken */: + case 54 /* AsteriskEqualsToken */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 36 /* PercentToken */: + case 56 /* PercentEqualsToken */: + case 33 /* MinusToken */: + case 53 /* MinusEqualsToken */: + case 39 /* LessThanLessThanToken */: + case 57 /* LessThanLessThanEqualsToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; - var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - if (leftOk && rightOk) { - checkAssignmentOperator(numberType); + var suggestedOperator; + if ((leftType.flags & 8 /* Boolean */) && (rightType.flags & 8 /* Boolean */) && (suggestedOperator = getSuggestedBooleanOperator(node.operator)) !== undefined) { + error(node, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(node.operator), ts.tokenToString(suggestedOperator)); + } + else { + var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + if (leftOk && rightOk) { + checkAssignmentOperator(numberType); + } } return numberType; - case 24 /* PlusToken */: - case 44 /* PlusEqualsToken */: + case 32 /* PlusToken */: + case 52 /* PlusEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; var resultType; - if (leftType.flags & ts.TypeFlags.NumberLike && rightType.flags & ts.TypeFlags.NumberLike) { + if (leftType.flags & 132 /* NumberLike */ && rightType.flags & 132 /* NumberLike */) { resultType = numberType; } - else if (leftType.flags & ts.TypeFlags.StringLike || rightType.flags & ts.TypeFlags.StringLike) { + else if (leftType.flags & 258 /* StringLike */ || rightType.flags & 258 /* StringLike */) { resultType = stringType; } else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) { @@ -12324,41 +14403,56 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 44 /* PlusEqualsToken */) { + if (operator === 52 /* PlusEqualsToken */) { checkAssignmentOperator(resultType); } return resultType; - case 19 /* EqualsEqualsToken */: - case 20 /* ExclamationEqualsToken */: - case 21 /* EqualsEqualsEqualsToken */: - case 22 /* ExclamationEqualsEqualsToken */: - case 15 /* LessThanToken */: - case 16 /* GreaterThanToken */: - case 17 /* LessThanEqualsToken */: - case 18 /* GreaterThanEqualsToken */: - if (!isTypeSubtypeOf(leftType, rightType) && !isTypeSubtypeOf(rightType, leftType)) { + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } return booleanType; - case 77 /* InstanceOfKeyword */: + case 85 /* InstanceOfKeyword */: return checkInstanceOfExpression(node, leftType, rightType); - case 76 /* InKeyword */: + case 84 /* InKeyword */: return checkInExpression(node, leftType, rightType); - case 39 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return rightType; - case 40 /* BarBarToken */: - return getBestCommonType([leftType, rightType], isInferentialContext(contextualMapper) ? undefined : getContextualType(node)); - case 43 /* EqualsToken */: + case 48 /* BarBarToken */: + return getUnionType([leftType, rightType]); + case 51 /* EqualsToken */: checkAssignmentOperator(rightType); return rightType; - case 14 /* CommaToken */: + case 22 /* CommaToken */: return rightType; } + function getSuggestedBooleanOperator(operator) { + switch (operator) { + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + return 48 /* BarBarToken */; + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + return 30 /* ExclamationEqualsEqualsToken */; + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: + return 47 /* AmpersandAmpersandToken */; + default: + return undefined; + } + } function checkAssignmentOperator(valueType) { - if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { - var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); + if (fullTypeCheck && operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { + var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { - checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); + checkTypeAssignableTo(valueType, leftType, node.left, undefined); } } } @@ -12370,18 +14464,13 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, contextualMapper); var type2 = checkExpression(node.whenFalse, contextualMapper); - var contextualType = isInferentialContext(contextualMapper) ? undefined : getContextualType(node); - var resultType = getBestCommonType([type1, type2], contextualType, true); - if (!resultType) { - if (contextualType) { - error(node, ts.Diagnostics.No_best_common_type_exists_between_0_1_and_2, typeToString(contextualType), typeToString(type1), typeToString(type2)); - } - else { - error(node, ts.Diagnostics.No_best_common_type_exists_between_0_and_1, typeToString(type1), typeToString(type2)); - } - resultType = emptyObjectType; - } - return resultType; + return getUnionType([type1, type2]); + } + function checkTemplateExpression(node) { + ts.forEach(node.templateSpans, function (templateSpan) { + checkExpression(templateSpan.expression); + }); + return stringType; } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; @@ -12396,52 +14485,81 @@ var ts; return result; } function checkExpression(node, contextualMapper) { + var type = checkExpressionNode(node, contextualMapper); + if (contextualMapper && contextualMapper !== identityMapper) { + var signature = getSingleCallSignature(type); + if (signature && signature.typeParameters) { + var contextualType = getContextualType(node); + if (contextualType) { + var contextualSignature = getSingleCallSignature(contextualType); + if (contextualSignature && !contextualSignature.typeParameters) { + type = getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); + } + } + } + } + if (isConstEnumObjectType(type)) { + var ok = (node.parent.kind === 145 /* PropertyAccess */ && node.parent.left === node) || (node.parent.kind === 146 /* IndexedAccess */ && node.parent.object === node) || ((node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + if (!ok) { + error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + } + } + return type; + } + function checkExpressionNode(node, contextualMapper) { switch (node.kind) { - case 55 /* Identifier */: + case 63 /* Identifier */: return checkIdentifier(node); - case 83 /* ThisKeyword */: + case 91 /* ThisKeyword */: return checkThisExpression(node); - case 81 /* SuperKeyword */: + case 89 /* SuperKeyword */: return checkSuperExpression(node); - case 79 /* NullKeyword */: + case 87 /* NullKeyword */: return nullType; - case 85 /* TrueKeyword */: - case 70 /* FalseKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return booleanType; - case 2 /* NumericLiteral */: + case 6 /* NumericLiteral */: return numberType; - case 3 /* StringLiteral */: + case 158 /* TemplateExpression */: + return checkTemplateExpression(node); + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return stringType; - case 4 /* RegularExpressionLiteral */: + case 8 /* RegularExpressionLiteral */: return globalRegExpType; - case 112 /* QualifiedName */: + case 121 /* QualifiedName */: return checkPropertyAccess(node); - case 127 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return checkArrayLiteral(node, contextualMapper); - case 128 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return checkObjectLiteral(node, contextualMapper); - case 130 /* PropertyAccess */: + case 145 /* PropertyAccess */: return checkPropertyAccess(node); - case 131 /* IndexedAccess */: + case 146 /* IndexedAccess */: return checkIndexedAccess(node); - case 132 /* CallExpression */: - case 133 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return checkCallExpression(node); - case 134 /* TypeAssertion */: + case 149 /* TaggedTemplateExpression */: + return checkTaggedTemplateExpression(node); + case 150 /* TypeAssertion */: return checkTypeAssertion(node); - case 135 /* ParenExpression */: + case 151 /* ParenExpression */: return checkExpression(node.expression); - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return checkFunctionExpression(node, contextualMapper); - case 138 /* PrefixOperator */: + case 154 /* PrefixOperator */: return checkPrefixExpression(node); - case 139 /* PostfixOperator */: + case 155 /* PostfixOperator */: return checkPostfixExpression(node); - case 140 /* BinaryExpression */: + case 156 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 141 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); + case 160 /* OmittedExpression */: + return undefinedType; } return unknownType; } @@ -12456,7 +14574,7 @@ var ts; checkVariableDeclaration(parameterDeclaration); if (fullTypeCheck) { checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */) && !(parameterDeclaration.parent.kind === 117 /* Constructor */ && parameterDeclaration.parent.body)) { + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 126 /* Constructor */ && parameterDeclaration.parent.body)) { error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } if (parameterDeclaration.flags & 8 /* Rest */) { @@ -12471,12 +14589,12 @@ var ts; } } function checkReferencesInInitializer(n) { - if (n.kind === 55 /* Identifier */) { + if (n.kind === 63 /* Identifier */) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 114 /* Parameter */) { + if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { + if (referencedSymbol.valueDeclaration.kind === 123 /* Parameter */) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { - error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); + error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(parameterDeclaration.name)); return; } var enclosingOrReferencedParameter = ts.forEach(parameterDeclaration.parent.parameters, function (p) { return p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined; }); @@ -12484,7 +14602,7 @@ var ts; return; } } - error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.identifierToString(parameterDeclaration.name), ts.identifierToString(n)); + error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(parameterDeclaration.name), ts.declarationNameToString(n)); } } else { @@ -12504,13 +14622,14 @@ var ts; if (fullTypeCheck) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithArgumentsInGeneratedCode(node); - if (program.getCompilerOptions().noImplicitAny && !node.type) { + if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 120 /* CallSignature */: + case 129 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -12519,7 +14638,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 170 /* InterfaceDeclaration */) { + if (node.kind === 188 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -12533,7 +14652,7 @@ var ts; var declaration = indexSymbol.declarations[i]; if (declaration.parameters.length == 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 110 /* StringKeyword */: + case 118 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -12541,7 +14660,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 108 /* NumberKeyword */: + case 116 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -12575,39 +14694,37 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 132 /* CallExpression */ && n.func.kind === 81 /* SuperKeyword */; + return n.kind === 147 /* CallExpression */ && n.func.kind === 89 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 136 /* FunctionExpression */: - case 167 /* FunctionDeclaration */: - case 137 /* ArrowFunction */: - case 128 /* ObjectLiteral */: - return false; - default: - return ts.forEachChild(n, containsSuperCall); + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: + case 142 /* ObjectLiteral */: return false; + default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 83 /* ThisKeyword */) { + if (n.kind === 91 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 136 /* FunctionExpression */ && n.kind !== 167 /* FunctionDeclaration */) { + else if (n.kind !== 152 /* FunctionExpression */ && n.kind !== 185 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 115 /* Property */ && !(n.flags & 64 /* Static */) && !!n.initializer; + return n.kind === 124 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; } if (node.parent.baseType) { if (containsSuperCall(node.body)) { - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */); }); + var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 146 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 164 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -12622,16 +14739,15 @@ var ts; } function checkAccessorDeclaration(node) { if (fullTypeCheck) { - if (node.kind === 118 /* GetAccessor */) { + if (node.kind === 127 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } - var otherKind = node.kind === 118 /* GetAccessor */ ? 119 /* SetAccessor */ : 118 /* GetAccessor */; + var otherKind = node.kind === 127 /* GetAccessor */ ? 128 /* SetAccessor */ : 127 /* GetAccessor */; var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - var visibilityFlags = 32 /* Private */ | 16 /* Public */; - if (((node.flags & visibilityFlags) !== (otherAccessor.flags & visibilityFlags))) { + if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } var thisType = getAnnotatedAccessorType(node); @@ -12655,7 +14771,7 @@ var ts; var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]); if (fullTypeCheck && constraint) { var typeArgument = type.typeArguments[i]; - checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } } @@ -12666,13 +14782,19 @@ var ts; function checkTypeLiteral(node) { ts.forEach(node.members, checkSourceElement); if (fullTypeCheck) { - var type = getTypeFromTypeLiteralNode(node); + var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); checkIndexConstraints(type); checkTypeForDuplicateIndexSignatures(node); } } function checkArrayType(node) { - getTypeFromArrayTypeNode(node); + checkSourceElement(node.elementType); + } + function checkTupleType(node) { + ts.forEach(node.elementTypes, checkSourceElement); + } + function checkUnionType(node) { + ts.forEach(node.types, checkSourceElement); } function isPrivateWithinAmbient(node) { return (node.flags & 32 /* Private */) && ts.isInAmbientContext(node); @@ -12689,11 +14811,10 @@ var ts; error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); return; } - var symbol = getSymbolOfNode(signatureDeclarationNode); var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 170 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 120 /* CallSignature */ || signatureDeclarationNode.kind === 121 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 120 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 188 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 129 /* CallSignature */ || signatureDeclarationNode.kind === 130 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 129 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -12711,7 +14832,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = n.flags; - if (n.parent.kind !== 170 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 188 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { flags |= 1 /* Export */; } @@ -12736,8 +14857,8 @@ var ts; else if (deviation & 2 /* Ambient */) { error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); } - else if (deviation & 32 /* Private */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_or_private); + else if (deviation & (32 /* Private */ | 64 /* Protected */)) { + error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); } else if (deviation & 4 /* QuestionMark */) { error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required); @@ -12745,7 +14866,7 @@ var ts; }); } } - var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 4 /* QuestionMark */; + var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 64 /* Protected */ | 4 /* QuestionMark */; var someNodeFlags = 0; var allNodeFlags = flagsToCheck; var hasOverloads = false; @@ -12753,8 +14874,11 @@ var ts; var lastSeenNonAmbientDeclaration; var previousDeclaration; var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 4096 /* Constructor */) !== 0; + var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0; function reportImplementationExpectedError(node) { + if (node.name && node.name.kind === 120 /* Missing */) { + return; + } var seen = false; var subsequentNode = ts.forEachChild(node.parent, function (c) { if (seen) { @@ -12768,14 +14892,14 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 116 /* Method */); - ts.Debug.assert((node.flags & 64 /* Static */) !== (subsequentNode.flags & 64 /* Static */)); - var diagnostic = node.flags & 64 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + ts.Debug.assert(node.kind === 125 /* Method */); + ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); + var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode, diagnostic); return; } else if (subsequentNode.body) { - error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.identifierToString(node.name)); + error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -12788,24 +14912,26 @@ var ts; error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); } } - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & ts.SymbolFlags.Module; + var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536 /* Module */; + var duplicateFunctionDeclaration = false; + var multipleConstructorImplementation = false; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 170 /* InterfaceDeclaration */ || node.parent.kind === 125 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 188 /* InterfaceDeclaration */ || node.parent.kind === 136 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 167 /* FunctionDeclaration */ || node.kind === 116 /* Method */ || node.kind === 117 /* Constructor */) { + if (node.kind === 185 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; if (node.body && bodyDeclaration) { if (isConstructor) { - error(node, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed); + multipleConstructorImplementation = true; } else { - error(node, ts.Diagnostics.Duplicate_function_implementation); + duplicateFunctionDeclaration = true; } } else if (!isExportSymbolInsideModule && previousDeclaration && previousDeclaration.parent === node.parent && previousDeclaration.end !== node.pos) { @@ -12825,6 +14951,16 @@ var ts; } } } + if (multipleConstructorImplementation) { + ts.forEach(declarations, function (declaration) { + error(declaration, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed); + }); + } + if (duplicateFunctionDeclaration) { + ts.forEach(declarations, function (declaration) { + error(declaration.name, ts.Diagnostics.Duplicate_function_implementation); + }); + } if (!isExportSymbolInsideModule && lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } @@ -12852,7 +14988,7 @@ var ts; var symbol = node.localSymbol; if (!symbol) { symbol = getSymbolOfNode(node); - if (!(symbol.flags & ts.SymbolFlags.Export)) { + if (!(symbol.flags & 29360128 /* Export */)) { return; } } @@ -12874,20 +15010,20 @@ var ts; if (commonDeclarationSpace) { ts.forEach(symbol.declarations, function (d) { if (getDeclarationSpaces(d) & commonDeclarationSpace) { - error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.identifierToString(d.name)); + error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(d.name)); } }); } function getDeclarationSpaces(d) { switch (d.kind) { - case 170 /* InterfaceDeclaration */: - return 1048576 /* ExportType */; - case 172 /* ModuleDeclaration */: - return d.name.kind === 3 /* StringLiteral */ || ts.isInstantiated(d) ? 2097152 /* ExportNamespace */ | 524288 /* ExportValue */ : 2097152 /* ExportNamespace */; - case 169 /* ClassDeclaration */: - case 171 /* EnumDeclaration */: - return 1048576 /* ExportType */ | 524288 /* ExportValue */; - case 174 /* ImportDeclaration */: + case 188 /* InterfaceDeclaration */: + return 8388608 /* ExportType */; + case 191 /* ModuleDeclaration */: + return d.name.kind === 7 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 16777216 /* ExportNamespace */ | 4194304 /* ExportValue */ : 16777216 /* ExportNamespace */; + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + return 8388608 /* ExportType */ | 4194304 /* ExportValue */; + case 193 /* ImportDeclaration */: var result = 0; var target = resolveImport(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { @@ -12895,7 +15031,7 @@ var ts; }); return result; default: - return 524288 /* ExportValue */; + return 4194304 /* ExportValue */; } } } @@ -12916,11 +15052,11 @@ var ts; if (node.type && !isAccessor(node.kind)) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && !node.body && !node.type) { + if (fullTypeCheck && compilerOptions.noImplicitAny && !node.body && !node.type) { if (!isPrivateWithinAmbient(node)) { var typeName = typeToString(anyType); if (node.name) { - error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(node.name), typeName); + error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.declarationNameToString(node.name), typeName); } else { error(node, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -12945,7 +15081,7 @@ var ts; if (!(name && name.text === "_i")) { return; } - if (node.kind === 114 /* Parameter */) { + if (node.kind === 123 /* Parameter */) { if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) { error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } @@ -12962,11 +15098,11 @@ var ts; return; } switch (current.kind) { - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 116 /* Method */: - case 137 /* ArrowFunction */: - case 117 /* Constructor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 125 /* Method */: + case 153 /* ArrowFunction */: + case 126 /* Constructor */: if (ts.hasRestParameters(current)) { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); return; @@ -12980,13 +15116,13 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 115 /* Property */ || node.kind === 116 /* Method */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */) { + if (node.kind === 124 /* Property */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */) { return false; } if (ts.isInAmbientContext(node)) { return false; } - if (node.kind === 114 /* Parameter */ && !node.parent.body) { + if (node.kind === 123 /* Parameter */ && !node.parent.body) { return false; } return true; @@ -13001,7 +15137,7 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration = node.kind !== 55 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } @@ -13017,12 +15153,12 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = getAncestor(node, 169 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 187 /* ClassDeclaration */); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } if (enclosingClass.baseType) { - var isDeclaration = node.kind !== 55 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } @@ -13031,6 +15167,31 @@ var ts; } } } + function checkCollisionWithRequireExportsInGeneratedCode(node, name) { + if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { + return; + } + if (node.kind === 191 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + return; + } + var parent = node.kind === 184 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (parent.kind === 196 /* SourceFile */ && ts.isExternalModule(parent)) { + error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); + } + } + function checkCollisionWithConstDeclarations(node) { + if (node.initializer && (node.flags & 6144 /* BlockScoped */) === 0) { + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1 /* FunctionScopedVariable */) { + var localDeclarationSymbol = resolveName(node, node.name.text, 3 /* Variable */, undefined, undefined); + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { + if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 4096 /* Const */) { + error(node, ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0, symbolToString(localDeclarationSymbol)); + } + } + } + } + } function checkVariableDeclaration(node) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); @@ -13043,18 +15204,20 @@ var ts; type = typeOfValueDeclaration; } else { - type = getTypeOfVariableDeclaration(node); + type = getTypeOfVariableOrPropertyDeclaration(node); } if (node.initializer) { if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); + checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined); } + checkCollisionWithConstDeclarations(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); if (!useTypeFromValueDeclaration) { if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); } } } @@ -13090,10 +15253,13 @@ var ts; checkSourceElement(node.statement); } function checkForInStatement(node) { - if (node.declaration) { - checkVariableDeclaration(node.declaration); - if (node.declaration.type) { - error(node.declaration, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + checkVariableDeclaration(decl); + if (decl.type) { + error(decl, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + } } } if (node.variable) { @@ -13102,41 +15268,33 @@ var ts; error(node.variable, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); } else { - checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement); + checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); } } var exprType = checkExpression(node.expression); - if (!isTypeAnyTypeObjectTypeOrTypeParameter(exprType) && exprType !== unknownType) { + if (!isStructuredType(exprType) && exprType !== unknownType) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); } function checkBreakOrContinueStatement(node) { } - function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || node.kind === 167 /* FunctionDeclaration */ || node.kind === 136 /* FunctionExpression */ || node.kind === 137 /* ArrowFunction */ || node.kind === 116 /* Method */ || node.kind === 117 /* Constructor */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */) { - return node; - } - } - } function checkReturnStatement(node) { if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { - var func = getContainingFunction(node); + var func = ts.getContainingFunction(node); if (func) { - if (func.kind === 119 /* SetAccessor */) { + if (func.kind === 128 /* SetAccessor */) { if (node.expression) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } } else { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - var checkAssignability = func.type || (func.kind === 118 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 119 /* SetAccessor */))); + var checkAssignability = func.type || (func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))); if (checkAssignability) { - checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined, undefined); + checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined); } - else if (func.kind == 117 /* Constructor */) { + else if (func.kind == 126 /* Constructor */) { if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -13155,13 +15313,13 @@ var ts; if (fullTypeCheck && clause.expression) { var caseType = checkExpression(clause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { - checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined, undefined); + checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined); } } checkBlock(clause); }); } - function checkLabelledStatement(node) { + function checkLabeledStatement(node) { checkSourceElement(node.statement); } function checkThrowStatement(node) { @@ -13190,7 +15348,7 @@ var ts; errorNode = indexDeclaration; } else if (type.flags & 2048 /* Interface */) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(type.baseTypes, function (base) { return getPropertyOfType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(type.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : type.symbol.declarations[0]; } if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { @@ -13203,7 +15361,7 @@ var ts; var stringIndexType = getIndexTypeOfType(type, 0 /* String */); var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); if (stringIndexType || numberIndexType) { - ts.forEach(getPropertiesOfType(type), function (prop) { + ts.forEach(getPropertiesOfObjectType(type), function (prop) { var propType = getTypeOfSymbol(prop); checkIndexConstraintForProperty(prop, propType, declaredStringIndexer, stringIndexType, 0 /* String */); checkIndexConstraintForProperty(prop, propType, declaredNumberIndexer, numberIndexType, 1 /* Number */); @@ -13239,7 +15397,7 @@ var ts; if (fullTypeCheck) { for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.identifierToString(node.name)); + error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); } } } @@ -13250,6 +15408,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkTypeParameters(node.typeParameters); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); var type = getDeclaredTypeOfSymbol(symbol); @@ -13261,10 +15420,10 @@ var ts; if (type.baseTypes.length) { if (fullTypeCheck) { var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); - checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { + checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, 107455 /* Value */)) { error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); @@ -13279,7 +15438,7 @@ var ts; if (t !== unknownType) { var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { - checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -13295,45 +15454,45 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; + return s.flags & 67108864 /* Instantiated */ ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { - var baseProperties = getPropertiesOfType(baseType); + var baseProperties = getPropertiesOfObjectType(baseType); for (var i = 0, len = baseProperties.length; i < len; ++i) { var base = getTargetSymbol(baseProperties[i]); - if (base.flags & 67108864 /* Prototype */) { + if (base.flags & 536870912 /* Prototype */) { continue; } - var derived = getTargetSymbol(getPropertyOfType(type, base.name)); + var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); if (derived) { var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); if ((baseDeclarationFlags & 32 /* Private */) || (derivedDeclarationFlags & 32 /* Private */)) { continue; } - if ((baseDeclarationFlags & 64 /* Static */) !== (derivedDeclarationFlags & 64 /* Static */)) { + if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { continue; } - if ((base.flags & derived.flags & 2048 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { + if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { continue; } var errorMessage; - if (base.flags & 2048 /* Method */) { - if (derived.flags & ts.SymbolFlags.Accessor) { + if (base.flags & 8192 /* Method */) { + if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert(derived.flags & 2 /* Property */); + ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } - else if (base.flags & 2 /* Property */) { - ts.Debug.assert(derived.flags & 2048 /* Method */); + else if (base.flags & 4 /* Property */) { + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); - ts.Debug.assert(derived.flags & 2048 /* Method */); + ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); @@ -13341,7 +15500,7 @@ var ts; } } function isAccessor(kind) { - return kind === 118 /* GetAccessor */ || kind === 119 /* SetAccessor */; + return kind === 127 /* GetAccessor */ || kind === 128 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -13368,13 +15527,46 @@ var ts; } return true; } + function checkInheritedPropertiesAreIdentical(type, typeNode) { + if (!type.baseTypes.length || type.baseTypes.length === 1) { + return true; + } + var seen = {}; + ts.forEach(type.declaredProperties, function (p) { + seen[p.name] = { prop: p, containingType: type }; + }); + var ok = true; + for (var i = 0, len = type.baseTypes.length; i < len; ++i) { + var base = type.baseTypes[i]; + var properties = getPropertiesOfObjectType(base); + for (var j = 0, proplen = properties.length; j < proplen; ++j) { + var prop = properties[j]; + if (!ts.hasProperty(seen, prop.name)) { + seen[prop.name] = { prop: prop, containingType: base }; + } + else { + var existing = seen[prop.name]; + var isInheritedProperty = existing.containingType !== type; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok = false; + var typeName1 = typeToString(existing.containingType); + var typeName2 = typeToString(base); + var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); + addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); + } + } + } + } + return ok; + } function checkInterfaceDeclaration(node) { checkTypeParameters(node.typeParameters); if (fullTypeCheck) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 170 /* InterfaceDeclaration */); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 188 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -13384,7 +15576,7 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); if (checkInheritedPropertiesAreIdentical(type, node.name)) { ts.forEach(type.baseTypes, function (baseType) { - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); } @@ -13396,20 +15588,144 @@ var ts; checkTypeForDuplicateIndexSignatures(node); } } - function getConstantValue(node) { - var isNegative = false; - if (node.kind === 138 /* PrefixOperator */) { - var unaryExpression = node; - if (unaryExpression.operator === 25 /* MinusToken */ || unaryExpression.operator === 24 /* PlusToken */) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === 25 /* MinusToken */; + function checkTypeAliasDeclaration(node) { + checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); + checkSourceElement(node.type); + } + function computeEnumMemberValues(node) { + var nodeLinks = getNodeLinks(node); + if (!(nodeLinks.flags & 128 /* EnumValuesComputed */)) { + var enumSymbol = getSymbolOfNode(node); + var enumType = getDeclaredTypeOfSymbol(enumSymbol); + var autoValue = 0; + var ambient = ts.isInAmbientContext(node); + var enumIsConst = ts.isConstEnumDeclaration(node); + ts.forEach(node.members, function (member) { + if (isNumericName(member.name.text)) { + error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + } + var initializer = member.initializer; + if (initializer) { + autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + if (autoValue === undefined) { + if (enumIsConst) { + error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + } + else if (!ambient) { + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); + } + } + else if (enumIsConst) { + if (isNaN(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN); + } + else if (!isFinite(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + } + } + } + else if (ambient && !enumIsConst) { + autoValue = undefined; + } + if (autoValue !== undefined) { + getNodeLinks(member).enumMemberValue = autoValue++; + } + }); + nodeLinks.flags |= 128 /* EnumValuesComputed */; + } + function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { + return evalConstant(initializer); + function evalConstant(e) { + switch (e.kind) { + case 154 /* PrefixOperator */: + var value = evalConstant(e.operand); + if (value === undefined) { + return undefined; + } + switch (e.operator) { + case 32 /* PlusToken */: return value; + case 33 /* MinusToken */: return -value; + case 46 /* TildeToken */: return enumIsConst ? ~value : undefined; + } + return undefined; + case 156 /* BinaryExpression */: + if (!enumIsConst) { + return undefined; + } + var left = evalConstant(e.left); + if (left === undefined) { + return undefined; + } + var right = evalConstant(e.right); + if (right === undefined) { + return undefined; + } + switch (e.operator) { + case 43 /* BarToken */: return left | right; + case 42 /* AmpersandToken */: return left & right; + case 40 /* GreaterThanGreaterThanToken */: return left >> right; + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; + case 39 /* LessThanLessThanToken */: return left << right; + case 44 /* CaretToken */: return left ^ right; + case 34 /* AsteriskToken */: return left * right; + case 35 /* SlashToken */: return left / right; + case 32 /* PlusToken */: return left + right; + case 33 /* MinusToken */: return left - right; + case 36 /* PercentToken */: return left % right; + } + return undefined; + case 6 /* NumericLiteral */: + return +e.text; + case 151 /* ParenExpression */: + return enumIsConst ? evalConstant(e.expression) : undefined; + case 63 /* Identifier */: + case 146 /* IndexedAccess */: + case 145 /* PropertyAccess */: + if (!enumIsConst) { + return undefined; + } + var member = initializer.parent; + var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); + var enumType; + var propertyName; + if (e.kind === 63 /* Identifier */) { + enumType = currentType; + propertyName = e.text; + } + else { + if (e.kind === 146 /* IndexedAccess */) { + if (e.index.kind !== 7 /* StringLiteral */) { + return undefined; + } + var enumType = getTypeOfNode(e.object); + propertyName = e.index.text; + } + else { + var enumType = getTypeOfNode(e.left); + propertyName = e.right.text; + } + if (enumType !== currentType) { + return undefined; + } + } + if (propertyName === undefined) { + return undefined; + } + var property = getPropertyOfObjectType(enumType, propertyName); + if (!property || !(property.flags & 8 /* EnumMember */)) { + return undefined; + } + var propertyDecl = property.valueDeclaration; + if (member === propertyDecl) { + return undefined; + } + if (!isDefinedBefore(propertyDecl, member)) { + return undefined; + } + return getNodeLinks(propertyDecl).enumMemberValue; + } } } - if (node.kind === 2 /* NumericLiteral */) { - var literalText = node.text; - return isNegative ? -literalText : +literalText; - } - return undefined; } function checkEnumDeclaration(node) { if (!fullTypeCheck) { @@ -13417,31 +15733,23 @@ var ts; } checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); + computeEnumMemberValues(node); var enumSymbol = getSymbolOfNode(node); - var enumType = getDeclaredTypeOfSymbol(enumSymbol); - var autoValue = 0; - var ambient = ts.isInAmbientContext(node); - ts.forEach(node.members, function (member) { - var initializer = member.initializer; - if (initializer) { - autoValue = getConstantValue(initializer); - if (autoValue === undefined && !ambient) { - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined, undefined); - } - } - else if (ambient) { - autoValue = undefined; - } - if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; - } - }); var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { + if (enumSymbol.declarations.length > 1) { + var enumIsConst = ts.isConstEnumDeclaration(node); + ts.forEach(enumSymbol.declarations, function (decl) { + if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { + error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 171 /* EnumDeclaration */) { + if (declaration.kind !== 190 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -13464,7 +15772,7 @@ var ts; var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === 169 /* ClassDeclaration */ || (declaration.kind === 167 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 187 /* ClassDeclaration */ || (declaration.kind === 185 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -13473,9 +15781,10 @@ var ts; function checkModuleDeclaration(node) { if (fullTypeCheck) { checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { + if (symbol.flags & 512 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -13486,7 +15795,7 @@ var ts; } } } - if (node.name.kind === 3 /* StringLiteral */) { + if (node.name.kind === 7 /* StringLiteral */) { if (!isGlobalSourceFile(node.parent)) { error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); } @@ -13498,37 +15807,38 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 112 /* QualifiedName */) { + while (node.kind === 121 /* QualifiedName */) { node = node.left; } return node; } function checkImportDeclaration(node) { checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); var symbol = getSymbolOfNode(node); var target; if (node.entityName) { target = resolveImport(symbol); if (target !== unknownSymbol) { - if (target.flags & ts.SymbolFlags.Value) { + if (target.flags & 107455 /* Value */) { var moduleName = getFirstIdentifier(node.entityName); - if (resolveEntityName(node, moduleName, ts.SymbolFlags.Value | ts.SymbolFlags.Namespace).flags & ts.SymbolFlags.Namespace) { + if (resolveEntityName(node, moduleName, 107455 /* Value */ | 1536 /* Namespace */).flags & 1536 /* Namespace */) { checkExpression(node.entityName); } else { - error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.identifierToString(moduleName)); + error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName)); } } - if (target.flags & ts.SymbolFlags.Type) { + if (target.flags & 3152352 /* Type */) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); } } } else { - if (node.parent.kind === 177 /* SourceFile */) { + if (node.parent.kind === 196 /* SourceFile */) { target = resolveImport(symbol); } - else if (node.parent.kind === 173 /* ModuleBlock */ && node.parent.parent.name.kind === 3 /* StringLiteral */) { + else if (node.parent.kind === 192 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { if (isExternalModuleNameRelative(node.externalModuleName.text)) { error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); target = unknownSymbol; @@ -13542,7 +15852,7 @@ var ts; } } if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & ts.SymbolFlags.Value ? ts.SymbolFlags.Value : 0) | (symbol.flags & ts.SymbolFlags.Type ? ts.SymbolFlags.Type : 0) | (symbol.flags & ts.SymbolFlags.Namespace ? ts.SymbolFlags.Namespace : 0); + var excludedMeanings = (symbol.flags & 107455 /* Value */ ? 107455 /* Value */ : 0) | (symbol.flags & 3152352 /* Type */ ? 3152352 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); } @@ -13550,7 +15860,7 @@ var ts; } function checkExportAssignment(node) { var container = node.parent; - if (container.kind !== 177 /* SourceFile */) { + if (container.kind !== 196 /* SourceFile */) { container = container.parent; } checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); @@ -13559,91 +15869,170 @@ var ts; if (!node) return; switch (node.kind) { - case 113 /* TypeParameter */: + case 122 /* TypeParameter */: return checkTypeParameter(node); - case 114 /* Parameter */: + case 123 /* Parameter */: return checkParameter(node); - case 115 /* Property */: + case 124 /* Property */: return checkPropertyDeclaration(node); - case 120 /* CallSignature */: - case 121 /* ConstructSignature */: - case 122 /* IndexSignature */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return checkSignatureDeclaration(node); - case 116 /* Method */: + case 125 /* Method */: return checkMethodDeclaration(node); - case 117 /* Constructor */: + case 126 /* Constructor */: return checkConstructorDeclaration(node); - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return checkAccessorDeclaration(node); - case 123 /* TypeReference */: + case 132 /* TypeReference */: return checkTypeReference(node); - case 124 /* TypeQuery */: + case 135 /* TypeQuery */: return checkTypeQuery(node); - case 125 /* TypeLiteral */: + case 136 /* TypeLiteral */: return checkTypeLiteral(node); - case 126 /* ArrayType */: + case 137 /* ArrayType */: return checkArrayType(node); - case 167 /* FunctionDeclaration */: + case 138 /* TupleType */: + return checkTupleType(node); + case 139 /* UnionType */: + return checkUnionType(node); + case 140 /* ParenType */: + return checkSourceElement(node.type); + case 185 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 143 /* Block */: - case 168 /* FunctionBlock */: - case 173 /* ModuleBlock */: + case 161 /* Block */: return checkBlock(node); - case 144 /* VariableStatement */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + return checkBody(node); + case 162 /* VariableStatement */: return checkVariableStatement(node); - case 146 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return checkExpressionStatement(node); - case 147 /* IfStatement */: + case 165 /* IfStatement */: return checkIfStatement(node); - case 148 /* DoStatement */: + case 166 /* DoStatement */: return checkDoStatement(node); - case 149 /* WhileStatement */: + case 167 /* WhileStatement */: return checkWhileStatement(node); - case 150 /* ForStatement */: + case 168 /* ForStatement */: return checkForStatement(node); - case 151 /* ForInStatement */: + case 169 /* ForInStatement */: return checkForInStatement(node); - case 152 /* ContinueStatement */: - case 153 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 154 /* ReturnStatement */: + case 172 /* ReturnStatement */: return checkReturnStatement(node); - case 155 /* WithStatement */: + case 173 /* WithStatement */: return checkWithStatement(node); - case 156 /* SwitchStatement */: + case 174 /* SwitchStatement */: return checkSwitchStatement(node); - case 159 /* LabelledStatement */: - return checkLabelledStatement(node); - case 160 /* ThrowStatement */: + case 177 /* LabeledStatement */: + return checkLabeledStatement(node); + case 178 /* ThrowStatement */: return checkThrowStatement(node); - case 161 /* TryStatement */: + case 179 /* TryStatement */: return checkTryStatement(node); - case 166 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return ts.Debug.fail("Checker encountered variable declaration"); - case 169 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return checkClassDeclaration(node); - case 170 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 171 /* EnumDeclaration */: + case 189 /* TypeAliasDeclaration */: + return checkTypeAliasDeclaration(node); + case 190 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 174 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return checkImportDeclaration(node); - case 175 /* ExportAssignment */: + case 194 /* ExportAssignment */: return checkExportAssignment(node); } } + function checkFunctionExpressionBodies(node) { + switch (node.kind) { + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + ts.forEach(node.parameters, checkFunctionExpressionBodies); + checkFunctionExpressionBody(node); + break; + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + ts.forEach(node.parameters, checkFunctionExpressionBodies); + break; + case 173 /* WithStatement */: + checkFunctionExpressionBodies(node.expression); + break; + case 123 /* Parameter */: + case 124 /* Property */: + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 143 /* PropertyAssignment */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 149 /* TaggedTemplateExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 156 /* BinaryExpression */: + case 157 /* ConditionalExpression */: + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 162 /* VariableStatement */: + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: + case 172 /* ReturnStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 184 /* VariableDeclaration */: + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + case 195 /* EnumMember */: + case 196 /* SourceFile */: + ts.forEachChild(node, checkFunctionExpressionBodies); + break; + } + } + function checkBody(node) { + checkBlock(node); + checkFunctionExpressionBodies(node); + } function checkSourceFile(node) { var links = getNodeLinks(node); if (!(links.flags & 1 /* TypeChecked */)) { emitExtends = false; potentialThisCollisions.length = 0; - ts.forEach(node.statements, checkSourceElement); + checkBody(node); if (ts.isExternalModule(node)) { var symbol = getExportAssignmentSymbol(node.symbol); - if (symbol && symbol.flags & 4194304 /* Import */) { + if (symbol && symbol.flags & 33554432 /* Import */) { getSymbolLinks(symbol).referenced = true; } } @@ -13694,6 +16083,17 @@ var ts; position = sourceFile.end; return findChildAtPosition(sourceFile); } + function isInsideWithStatementBody(node) { + if (node) { + while (node.parent) { + if (node.parent.kind === 173 /* WithStatement */ && node.parent.statement === node) { + return true; + } + node = node.parent; + } + } + return false; + } function getSymbolsInScope(location, meaning) { var symbols = {}; var memberFlags = 0; @@ -13714,32 +16114,35 @@ var ts; } } } + if (isInsideWithStatementBody(location)) { + return []; + } while (location) { if (location.locals && !isGlobalSourceFile(location)) { copySymbols(location.locals, meaning); } switch (location.kind) { - case 177 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 172 /* ModuleDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); + case 191 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 35653619 /* ModuleMember */); break; - case 171 /* EnumDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 4 /* EnumMember */); + case 190 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - if (!(memberFlags & 64 /* Static */)) { - copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + if (!(memberFlags & 128 /* Static */)) { + copySymbols(getSymbolOfNode(location).members, meaning & 3152352 /* Type */); } break; - case 136 /* FunctionExpression */: + case 152 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } break; - case 163 /* CatchBlock */: + case 181 /* CatchBlock */: if (location.variable.text) { copySymbol(location.symbol, meaning); } @@ -13752,199 +16155,102 @@ var ts; return ts.mapToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 55 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; - } - function isDeclarationOrFunctionExpressionOrCatchVariableName(name) { - if (name.kind !== 55 /* Identifier */ && name.kind !== 3 /* StringLiteral */ && name.kind !== 2 /* NumericLiteral */) { - return false; - } - var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 136 /* FunctionExpression */) { - return parent.name === name; - } - if (parent.kind === 163 /* CatchBlock */) { - return parent.variable === name; - } - return false; + return name.kind == 63 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 113 /* TypeParameter */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 171 /* EnumDeclaration */: + case 122 /* TypeParameter */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 190 /* EnumDeclaration */: return true; } } - function isDeclaration(node) { - switch (node.kind) { - case 113 /* TypeParameter */: - case 114 /* Parameter */: - case 166 /* VariableDeclaration */: - case 115 /* Property */: - case 129 /* PropertyAssignment */: - case 176 /* EnumMember */: - case 116 /* Method */: - case 167 /* FunctionDeclaration */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 171 /* EnumDeclaration */: - case 172 /* ModuleDeclaration */: - case 174 /* ImportDeclaration */: - return true; - } - return false; - } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 112 /* QualifiedName */) + while (node.parent && node.parent.kind === 121 /* QualifiedName */) node = node.parent; - return node.parent && node.parent.kind === 123 /* TypeReference */; - } - function isExpression(node) { - switch (node.kind) { - case 83 /* ThisKeyword */: - case 81 /* SuperKeyword */: - case 79 /* NullKeyword */: - case 85 /* TrueKeyword */: - case 70 /* FalseKeyword */: - case 4 /* RegularExpressionLiteral */: - case 127 /* ArrayLiteral */: - case 128 /* ObjectLiteral */: - case 130 /* PropertyAccess */: - case 131 /* IndexedAccess */: - case 132 /* CallExpression */: - case 133 /* NewExpression */: - case 134 /* TypeAssertion */: - case 135 /* ParenExpression */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: - case 138 /* PrefixOperator */: - case 139 /* PostfixOperator */: - case 140 /* BinaryExpression */: - case 141 /* ConditionalExpression */: - case 142 /* OmittedExpression */: - return true; - case 112 /* QualifiedName */: - while (node.parent.kind === 112 /* QualifiedName */) - node = node.parent; - return node.parent.kind === 124 /* TypeQuery */; - case 55 /* Identifier */: - if (node.parent.kind === 124 /* TypeQuery */) { - return true; - } - case 2 /* NumericLiteral */: - case 3 /* StringLiteral */: - var parent = node.parent; - switch (parent.kind) { - case 166 /* VariableDeclaration */: - case 114 /* Parameter */: - case 115 /* Property */: - case 176 /* EnumMember */: - case 129 /* PropertyAssignment */: - return parent.initializer === node; - case 146 /* ExpressionStatement */: - case 147 /* IfStatement */: - case 148 /* DoStatement */: - case 149 /* WhileStatement */: - case 154 /* ReturnStatement */: - case 155 /* WithStatement */: - case 156 /* SwitchStatement */: - case 157 /* CaseClause */: - case 160 /* ThrowStatement */: - case 156 /* SwitchStatement */: - return parent.expression === node; - case 150 /* ForStatement */: - return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 151 /* ForInStatement */: - return parent.variable === node || parent.expression === node; - case 134 /* TypeAssertion */: - return node === parent.operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; + return node.parent && node.parent.kind === 132 /* TypeReference */; } function isTypeNode(node) { - if (node.kind >= ts.SyntaxKind.FirstTypeNode && node.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 140 /* LastTypeNode */) { return true; } switch (node.kind) { - case 101 /* AnyKeyword */: - case 108 /* NumberKeyword */: - case 110 /* StringKeyword */: - case 102 /* BooleanKeyword */: + case 109 /* AnyKeyword */: + case 116 /* NumberKeyword */: + case 118 /* StringKeyword */: + case 110 /* BooleanKeyword */: return true; - case 89 /* VoidKeyword */: - return node.parent.kind !== 138 /* PrefixOperator */; - case 3 /* StringLiteral */: - return node.parent.kind === 114 /* Parameter */; - case 55 /* Identifier */: - if (node.parent.kind === 112 /* QualifiedName */) { + case 97 /* VoidKeyword */: + return node.parent.kind !== 154 /* PrefixOperator */; + case 7 /* StringLiteral */: + return node.parent.kind === 123 /* Parameter */; + case 63 /* Identifier */: + if (node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - case 112 /* QualifiedName */: + case 121 /* QualifiedName */: + ts.Debug.assert(node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); var parent = node.parent; - if (parent.kind === 124 /* TypeQuery */) { + if (parent.kind === 135 /* TypeQuery */) { return false; } - if (parent.kind >= ts.SyntaxKind.FirstTypeNode && parent.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 140 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 113 /* TypeParameter */: + case 122 /* TypeParameter */: return node === parent.constraint; - case 115 /* Property */: - case 114 /* Parameter */: - case 166 /* VariableDeclaration */: + case 124 /* Property */: + case 123 /* Parameter */: + case 184 /* VariableDeclaration */: return node === parent.type; - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: - case 117 /* Constructor */: - case 116 /* Method */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 126 /* Constructor */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node === parent.type; - case 120 /* CallSignature */: - case 121 /* ConstructSignature */: - case 122 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return node === parent.type; - case 134 /* TypeAssertion */: + case 150 /* TypeAssertion */: return node === parent.type; - case 132 /* CallExpression */: - case 133 /* NewExpression */: - return parent.typeArguments.indexOf(node) >= 0; + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; + case 149 /* TaggedTemplateExpression */: + return false; } } return false; } function isInRightSideOfImportOrExportAssignment(node) { - while (node.parent.kind === 112 /* QualifiedName */) { + while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - if (node.parent.kind === 174 /* ImportDeclaration */) { + if (node.parent.kind === 193 /* ImportDeclaration */) { return node.parent.entityName === node; } - if (node.parent.kind === 175 /* ExportAssignment */) { + if (node.parent.kind === 194 /* ExportAssignment */) { return node.parent.exportName === node; } return false; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 112 /* QualifiedName */ || node.parent.kind === 130 /* PropertyAccess */) && node.parent.right === node; + return (node.parent.kind === 121 /* QualifiedName */ || node.parent.kind === 145 /* PropertyAccess */) && node.parent.right === node; } function getSymbolOfEntityName(entityName) { - if (isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { + if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 175 /* ExportAssignment */) { - return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 4194304 /* Import */); + if (entityName.parent.kind === 194 /* ExportAssignment */) { + return resolveEntityName(entityName.parent.parent, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */ | 33554432 /* Import */); } if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImport(entityName); @@ -13952,12 +16258,12 @@ var ts; if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (isExpression(entityName)) { - if (entityName.kind === 55 /* Identifier */) { - var meaning = ts.SymbolFlags.Value | 4194304 /* Import */; + if (ts.isExpression(entityName)) { + if (entityName.kind === 63 /* Identifier */) { + var meaning = 107455 /* Value */ | 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } - else if (entityName.kind === 112 /* QualifiedName */ || entityName.kind === 130 /* PropertyAccess */) { + else if (entityName.kind === 121 /* QualifiedName */ || entityName.kind === 145 /* PropertyAccess */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccess(entityName); @@ -13969,52 +16275,68 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 123 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; - meaning |= 4194304 /* Import */; + var meaning = entityName.parent.kind === 132 /* TypeReference */ ? 3152352 /* Type */ : 1536 /* Namespace */; + meaning |= 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } return undefined; } function getSymbolInfo(node) { + if (isInsideWithStatementBody(node)) { + return undefined; + } + if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + return getSymbolOfNode(node.parent); + } + if (node.kind === 63 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 194 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); + } switch (node.kind) { - case 55 /* Identifier */: - case 130 /* PropertyAccess */: - case 112 /* QualifiedName */: + case 63 /* Identifier */: + case 145 /* PropertyAccess */: + case 121 /* QualifiedName */: return getSymbolOfEntityName(node); - case 83 /* ThisKeyword */: - case 81 /* SuperKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: var type = checkExpression(node); return type.symbol; - case 103 /* ConstructorKeyword */: + case 111 /* ConstructorKeyword */: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 117 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 126 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; - case 3 /* StringLiteral */: - if (node.parent.kind === 131 /* IndexedAccess */ && node.parent.index === node) { + case 7 /* StringLiteral */: + if (node.parent.kind === 193 /* ImportDeclaration */ && node.parent.externalModuleName === node) { + var importSymbol = getSymbolOfNode(node.parent); + var moduleType = getTypeOfSymbol(importSymbol); + return moduleType ? moduleType.symbol : undefined; + } + case 6 /* NumericLiteral */: + if (node.parent.kind == 146 /* IndexedAccess */ && node.parent.index === node) { var objectType = checkExpression(node.parent.object); if (objectType === unknownType) return undefined; var apparentType = getApparentType(objectType); if (apparentType === unknownType) return undefined; - return getPropertyOfApparentType(apparentType, node.text); - } - else if (node.parent.kind === 174 /* ImportDeclaration */ && node.parent.externalModuleName === node) { - var importSymbol = getSymbolOfNode(node.parent); - var moduleType = getTypeOfSymbol(importSymbol); - return moduleType ? moduleType.symbol : undefined; - } - else if (node.parent.kind === 172 /* ModuleDeclaration */) { - return getSymbolOfNode(node.parent); + return getPropertyOfType(apparentType, node.text); } break; } return undefined; } + function getShorthandAssignmentValueSymbol(location) { + if (location && location.kind === 144 /* ShorthandPropertyAssignment */) { + return resolveEntityName(location, location.name, 107455 /* Value */); + } + return undefined; + } function getTypeOfNode(node) { - if (isExpression(node)) { + if (isInsideWithStatementBody(node)) { + return unknownType; + } + if (ts.isExpression(node)) { return getTypeOfExpression(node); } if (isTypeNode(node)) { @@ -14026,19 +16348,19 @@ var ts; } if (isTypeDeclarationName(node)) { var symbol = getSymbolInfo(node); - return getDeclaredTypeOfSymbol(symbol); + return symbol && getDeclaredTypeOfSymbol(symbol); } - if (isDeclaration(node)) { + if (ts.isDeclaration(node)) { var symbol = getSymbolOfNode(node); return getTypeOfSymbol(symbol); } - if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { var symbol = getSymbolInfo(node); - return getTypeOfSymbol(symbol); + return symbol && getTypeOfSymbol(symbol); } if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolInfo(node); - var declaredType = getDeclaredTypeOfSymbol(symbol); + var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); } return unknownType; @@ -14049,38 +16371,37 @@ var ts; } return checkExpression(expr); } - function getAugmentedPropertiesOfApparentType(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & ts.TypeFlags.ObjectType) { - var propertiesByName = {}; - var results = []; - ts.forEach(getPropertiesOfType(apparentType), function (s) { - propertiesByName[s.name] = s; - results.push(s); - }); - var resolved = resolveObjectTypeMembers(type); - ts.forEachValue(resolved.members, function (s) { - if (symbolIsValue(s) && !propertiesByName[s.name]) { - propertiesByName[s.name] = s; - results.push(s); + function getAugmentedPropertiesOfType(type) { + var type = getApparentType(type); + var propsByName = createSymbolTable(getPropertiesOfType(type)); + if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) { + ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { + if (!ts.hasProperty(propsByName, p.name)) { + propsByName[p.name] = p; } }); - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - ts.forEach(getPropertiesOfType(globalFunctionType), function (s) { - if (!propertiesByName[s.name]) { - propertiesByName[s.name] = s; - results.push(s); - } - }); + } + return getNamedMembers(propsByName); + } + function getRootSymbols(symbol) { + if (symbol.flags & 1073741824 /* UnionProperty */) { + var symbols = []; + var name = symbol.name; + ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { + symbols.push(getPropertyOfType(t, name)); + }); + return symbols; + } + else if (symbol.flags & 268435456 /* Transient */) { + var target = getSymbolLinks(symbol).target; + if (target) { + return [target]; } - return results; - } - else { - return getPropertiesOfType(apparentType); } + return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 128 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 177 /* SourceFile */; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 196 /* SourceFile */; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -14092,7 +16413,7 @@ var ts; } function isUniqueLocalName(name, container) { for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 524288 /* ExportValue */)) { + if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (107455 /* Value */ | 4194304 /* ExportValue */)) { return false; } } @@ -14106,14 +16427,14 @@ var ts; while (!isUniqueLocalName(ts.escapeIdentifier(prefix + name), container)) { prefix += "_"; } - links.localModuleName = prefix + ts.getSourceTextOfNode(container.name); + links.localModuleName = prefix + ts.getTextOfNode(container.name); } return links.localModuleName; } function getLocalNameForSymbol(symbol, location) { var node = location; while (node) { - if ((node.kind === 172 /* ModuleDeclaration */ || node.kind === 171 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { + if ((node.kind === 191 /* ModuleDeclaration */ || node.kind === 190 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { return getLocalNameOfContainer(node); } node = node.parent; @@ -14124,7 +16445,7 @@ var ts; var symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (symbol !== exportSymbol && !(exportSymbol.flags & ts.SymbolFlags.ExportHasLocal)) { + if (symbol !== exportSymbol && !(exportSymbol.flags & 944 /* ExportHasLocal */)) { symbol = exportSymbol; } if (symbol.parent) { @@ -14132,30 +16453,31 @@ var ts; } } } - function getPropertyAccessSubstitution(node) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 4 /* EnumMember */)) { - var declaration = symbol.valueDeclaration; - var constantValue; - if (declaration.kind === 176 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { - return constantValue.toString() + " /* " + ts.identifierToString(declaration.name) + " */"; - } - } - } function getExportAssignmentName(node) { var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; + return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol) : undefined; } - function isTopLevelValueImportedViaEntityName(node) { - if (node.parent.kind !== 177 /* SourceFile */ || !node.entityName) { + function isTopLevelValueImportWithEntityName(node) { + if (node.parent.kind !== 196 /* SourceFile */ || !node.entityName) { return false; } - var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & ts.SymbolFlags.Value) !== 0); + return isImportResolvedToValue(getSymbolOfNode(node)); } - function shouldEmitDeclarations() { - return program.getCompilerOptions().declaration && !program.getDiagnostics().length && !getDiagnostics().length; + function hasSemanticErrors() { + return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; + } + function isEmitBlocked(sourceFile) { + return program.getDiagnostics(sourceFile).length !== 0 || hasEarlyErrors(sourceFile) || (compilerOptions.noEmitOnError && getDiagnostics(sourceFile).length !== 0); + } + function hasEarlyErrors(sourceFile) { + return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; }); + } + function isImportResolvedToValue(symbol) { + var target = resolveImport(symbol); + return target !== unknownSymbol && target.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); + } + function isConstEnumOrConstEnumOnlyModule(s) { + return isConstEnumSymbol(s) || s.constEnumOnlyModule; } function isReferencedImportDeclaration(node) { var symbol = getSymbolOfNode(node); @@ -14163,10 +16485,7 @@ var ts; return true; } if (node.flags & 1 /* Export */) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { - return true; - } + return isImportResolvedToValue(symbol); } return false; } @@ -14182,44 +16501,56 @@ var ts; return getNodeLinks(node).flags; } function getEnumMemberValue(node) { + computeEnumMemberValues(node.parent); return getNodeLinks(node).enumMemberValue; } + function getConstantValue(node) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol && (symbol.flags & 8 /* EnumMember */)) { + var declaration = symbol.valueDeclaration; + var constantValue; + if (declaration.kind === 195 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + return constantValue; + } + } + return undefined; + } function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 512 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); - writeTypeToTextWriter(type, enclosingDeclaration, flags, writer); + var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* CallSignature */ | 262144 /* ConstructSignature */)) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { var signature = getSignatureFromDeclaration(signatureDeclaration); - writeTypeToTextWriter(getReturnTypeOfSignature(signature), enclosingDeclaration, flags, writer); + getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } - function invokeEmitter() { + function invokeEmitter(targetSourceFile) { var resolver = { getProgram: function () { return program; }, getLocalNameOfContainer: getLocalNameOfContainer, getExpressionNamePrefix: getExpressionNamePrefix, - getPropertyAccessSubstitution: getPropertyAccessSubstitution, getExportAssignmentName: getExportAssignmentName, isReferencedImportDeclaration: isReferencedImportDeclaration, getNodeCheckFlags: getNodeCheckFlags, getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, - shouldEmitDeclarations: shouldEmitDeclarations, + isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, + hasSemanticErrors: hasSemanticErrors, + isEmitBlocked: isEmitBlocked, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, writeTypeAtLocation: writeTypeAtLocation, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, - writeSymbol: writeSymbolToTextWriter, isSymbolAccessible: isSymbolAccessible, - isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile + isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile, + getConstantValue: getConstantValue }; checkProgram(); - return ts.emitFiles(resolver); + return ts.emitFiles(resolver, targetSourceFile); } function initializeTypeChecker() { ts.forEach(program.getSourceFiles(), function (file) { ts.bindSourceFile(file); - ts.forEach(file.semanticErrors, addDiagnostic); + ts.forEach(file.semanticDiagnostics, addDiagnostic); }); ts.forEach(program.getSourceFiles(), function (file) { if (!ts.isExternalModule(file)) { @@ -14238,6 +16569,7 @@ var ts; globalNumberType = getGlobalType("Number"); globalBooleanType = getGlobalType("Boolean"); globalRegExpType = getGlobalType("RegExp"); + globalTemplateStringsArrayType = compilerOptions.target >= 2 /* ES6 */ ? getGlobalType("TemplateStringsArray") : unknownType; } initializeTypeChecker(); return checker; @@ -14296,6 +16628,11 @@ var ts; paramType: ts.Diagnostics.KIND, error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd }, + { + name: "noEmitOnError", + type: "boolean", + description: ts.Diagnostics.Do_not_emit_outputs_if_any_type_checking_errors_were_reported + }, { name: "noImplicitAny", type: "boolean", @@ -14344,10 +16681,10 @@ var ts; { name: "target", shortName: "t", - type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */ }, - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5, + type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ }, + description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, - error: ts.Diagnostics.Argument_for_target_option_must_be_es3_or_es5 + error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 }, { name: "version", @@ -14360,6 +16697,11 @@ var ts; shortName: "w", type: "boolean", description: ts.Diagnostics.Watch_input_files + }, + { + name: "preserveConstEnums", + type: "boolean", + description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code } ]; var shortOptionNames = {}; @@ -14411,9 +16753,10 @@ var ts; options[opt.name] = args[i++] || ""; break; default: - var value = (args[i++] || "").toLowerCase(); - if (ts.hasProperty(opt.type, value)) { - options[opt.name] = opt.type[value]; + var map = opt.type; + var key = (args[i++] || "").toLowerCase(); + if (ts.hasProperty(map, key)) { + options[opt.name] = map[key]; } else { errors.push(ts.createCompilerDiagnostic(opt.error)); @@ -14468,7 +16811,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var version = "1.1.0.0"; + var version = "1.3.0.0"; function validateLocaleAndSetLanguage(locale, errors) { var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); if (!matchResult) { @@ -14567,13 +16910,14 @@ var ts; function getCanonicalFileName(fileName) { return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } + var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(filename, languageVersion, onError) { try { var text = sys.readFile(filename, options.charset); } catch (e) { if (onError) { - onError(e.message); + onError(e.number === unsupportedFileEncodingErrorCode ? getDiagnosticText(ts.Diagnostics.Unsupported_file_encoding) : e.message); } text = ""; } @@ -14618,32 +16962,42 @@ var ts; } function executeCommandLine(args) { var commandLine = ts.parseCommandLine(args); - if (commandLine.options.locale) { + var compilerOptions = commandLine.options; + if (compilerOptions.locale) { + if (typeof JSON === "undefined") { + reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.The_current_host_does_not_support_the_0_option, "--locale")); + return sys.exit(1); + } validateLocaleAndSetLanguage(commandLine.options.locale, commandLine.errors); } if (commandLine.errors.length > 0) { reportDiagnostics(commandLine.errors); - return sys.exit(1); + return sys.exit(5 /* CompilerOptionsErrors */); } - if (commandLine.options.version) { + if (compilerOptions.version) { reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Version_0, version)); - return sys.exit(0); + return sys.exit(0 /* Succeeded */); } - if (commandLine.options.help || commandLine.filenames.length === 0) { + if (compilerOptions.help) { printVersion(); printHelp(); - return sys.exit(0); + return sys.exit(0 /* Succeeded */); } - var defaultCompilerHost = createCompilerHost(commandLine.options); - if (commandLine.options.watch) { + if (commandLine.filenames.length === 0) { + printVersion(); + printHelp(); + return sys.exit(5 /* CompilerOptionsErrors */); + } + var defaultCompilerHost = createCompilerHost(compilerOptions); + if (compilerOptions.watch) { if (!sys.watchFile) { reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.The_current_host_does_not_support_the_0_option, "--watch")); - return sys.exit(1); + return sys.exit(5 /* CompilerOptionsErrors */); } watchProgram(commandLine, defaultCompilerHost); } else { - var result = compile(commandLine, defaultCompilerHost).errors.length > 0 ? 1 : 0; + var result = compile(commandLine, defaultCompilerHost).exitStatus; return sys.exit(result); } } @@ -14704,22 +17058,32 @@ var ts; } function compile(commandLine, compilerHost) { var parseStart = new Date().getTime(); - var program = ts.createProgram(commandLine.filenames, commandLine.options, compilerHost); + var compilerOptions = commandLine.options; + var program = ts.createProgram(commandLine.filenames, compilerOptions, compilerHost); var bindStart = new Date().getTime(); var errors = program.getDiagnostics(); + var exitStatus; if (errors.length) { var checkStart = bindStart; var emitStart = bindStart; var reportStart = bindStart; + exitStatus = 1 /* AllOutputGenerationSkipped */; } else { var checker = program.getTypeChecker(true); var checkStart = new Date().getTime(); - var semanticErrors = checker.getDiagnostics(); - var emitStart = new Date().getTime(); - var emitErrors = checker.emitFiles().errors; - var reportStart = new Date().getTime(); - errors = ts.concatenate(semanticErrors, emitErrors); + errors = checker.getDiagnostics(); + if (checker.isEmitBlocked()) { + exitStatus = 1 /* AllOutputGenerationSkipped */; + } + else { + var emitStart = new Date().getTime(); + var emitOutput = checker.invokeEmitter(); + var emitErrors = emitOutput.diagnostics; + exitStatus = emitOutput.emitResultStatus; + var reportStart = new Date().getTime(); + errors = ts.concatenate(errors, emitErrors); + } } reportDiagnostics(errors); if (commandLine.options.diagnostics) { @@ -14739,7 +17103,7 @@ var ts; reportTimeStatistic("Emit time", reportStart - emitStart); reportTimeStatistic("Total time", reportStart - parseStart); } - return { program: program, errors: errors }; + return { program: program, exitStatus: exitStatus }; } function printVersion() { sys.write(getDiagnosticText(ts.Diagnostics.Version_0, version) + sys.newLine); @@ -14755,7 +17119,7 @@ var ts; output += sys.newLine + sys.newLine; var padding = makePadding(marginLength); output += getDiagnosticText(ts.Diagnostics.Examples_Colon_0, makePadding(marginLength - examplesLength) + "tsc hello.ts") + sys.newLine; - output += padding + "tsc --out foo.js foo.ts" + sys.newLine; + output += padding + "tsc --out file.js file.ts" + sys.newLine; output += padding + "tsc @args.txt" + sys.newLine; output += sys.newLine; output += getDiagnosticText(ts.Diagnostics.Options_Colon) + sys.newLine; diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index d9b53be63cf..367a79bd47a 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -13,12 +13,587 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ +var ts; +(function (ts) { + (function (EmitReturnStatus) { + EmitReturnStatus[EmitReturnStatus["Succeeded"] = 0] = "Succeeded"; + EmitReturnStatus[EmitReturnStatus["AllOutputGenerationSkipped"] = 1] = "AllOutputGenerationSkipped"; + EmitReturnStatus[EmitReturnStatus["JSGeneratedWithSemanticErrors"] = 2] = "JSGeneratedWithSemanticErrors"; + EmitReturnStatus[EmitReturnStatus["DeclarationGenerationSkipped"] = 3] = "DeclarationGenerationSkipped"; + EmitReturnStatus[EmitReturnStatus["EmitErrorsEncountered"] = 4] = "EmitErrorsEncountered"; + EmitReturnStatus[EmitReturnStatus["CompilerOptionsErrors"] = 5] = "CompilerOptionsErrors"; + })(ts.EmitReturnStatus || (ts.EmitReturnStatus = {})); + var EmitReturnStatus = ts.EmitReturnStatus; + (function (DiagnosticCategory) { + DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; + DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; + DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; + })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); + var DiagnosticCategory = ts.DiagnosticCategory; +})(ts || (ts = {})); +var ts; +(function (ts) { + function forEach(array, callback) { + var result; + if (array) { + for (var i = 0, len = array.length; i < len; i++) { + if (result = callback(array[i])) { + break; + } + } + } + return result; + } + ts.forEach = forEach; + function contains(array, value) { + if (array) { + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return true; + } + } + } + return false; + } + ts.contains = contains; + function indexOf(array, value) { + if (array) { + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + } + return -1; + } + ts.indexOf = indexOf; + function countWhere(array, predicate) { + var count = 0; + if (array) { + for (var i = 0, len = array.length; i < len; i++) { + if (predicate(array[i])) { + count++; + } + } + } + return count; + } + ts.countWhere = countWhere; + function filter(array, f) { + if (array) { + var result = []; + for (var i = 0, len = array.length; i < len; i++) { + var item = array[i]; + if (f(item)) { + result.push(item); + } + } + } + return result; + } + ts.filter = filter; + function map(array, f) { + if (array) { + var result = []; + for (var i = 0, len = array.length; i < len; i++) { + result.push(f(array[i])); + } + } + return result; + } + ts.map = map; + function concatenate(array1, array2) { + if (!array2 || !array2.length) + return array1; + if (!array1 || !array1.length) + return array2; + return array1.concat(array2); + } + ts.concatenate = concatenate; + function deduplicate(array) { + if (array) { + var result = []; + for (var i = 0, len = array.length; i < len; i++) { + var item = array[i]; + if (!contains(result, item)) + result.push(item); + } + } + return result; + } + ts.deduplicate = deduplicate; + function sum(array, prop) { + var result = 0; + for (var i = 0; i < array.length; i++) { + result += array[i][prop]; + } + return result; + } + ts.sum = sum; + function lastOrUndefined(array) { + if (array.length === 0) { + return undefined; + } + return array[array.length - 1]; + } + ts.lastOrUndefined = lastOrUndefined; + function binarySearch(array, value) { + var low = 0; + var high = array.length - 1; + while (low <= high) { + var middle = low + ((high - low) >> 1); + var midValue = array[middle]; + if (midValue === value) { + return middle; + } + else if (midValue > value) { + high = middle - 1; + } + else { + low = middle + 1; + } + } + return ~low; + } + ts.binarySearch = binarySearch; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function hasProperty(map, key) { + return hasOwnProperty.call(map, key); + } + ts.hasProperty = hasProperty; + function getProperty(map, key) { + return hasOwnProperty.call(map, key) ? map[key] : undefined; + } + ts.getProperty = getProperty; + function isEmpty(map) { + for (var id in map) { + if (hasProperty(map, id)) { + return false; + } + } + return true; + } + ts.isEmpty = isEmpty; + function clone(object) { + var result = {}; + for (var id in object) { + result[id] = object[id]; + } + return result; + } + ts.clone = clone; + function forEachValue(map, callback) { + var result; + for (var id in map) { + if (result = callback(map[id])) + break; + } + return result; + } + ts.forEachValue = forEachValue; + function forEachKey(map, callback) { + var result; + for (var id in map) { + if (result = callback(id)) + break; + } + return result; + } + ts.forEachKey = forEachKey; + function lookUp(map, key) { + return hasProperty(map, key) ? map[key] : undefined; + } + ts.lookUp = lookUp; + function mapToArray(map) { + var result = []; + for (var id in map) { + result.push(map[id]); + } + return result; + } + ts.mapToArray = mapToArray; + function arrayToMap(array, makeKey) { + var result = {}; + forEach(array, function (value) { + result[makeKey(value)] = value; + }); + return result; + } + ts.arrayToMap = arrayToMap; + function formatStringFromArgs(text, args, baseIndex) { + baseIndex = baseIndex || 0; + return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); + } + ts.localizedDiagnosticMessages = undefined; + function getLocaleSpecificMessage(message) { + return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] ? ts.localizedDiagnosticMessages[message] : message; + } + ts.getLocaleSpecificMessage = getLocaleSpecificMessage; + function createFileDiagnostic(file, start, length, message) { + Debug.assert(start >= 0, "start must be non-negative, is " + start); + Debug.assert(length >= 0, "length must be non-negative, is " + length); + var text = getLocaleSpecificMessage(message.key); + if (arguments.length > 4) { + text = formatStringFromArgs(text, arguments, 4); + } + return { + file: file, + start: start, + length: length, + messageText: text, + category: message.category, + code: message.code, + isEarly: message.isEarly + }; + } + ts.createFileDiagnostic = createFileDiagnostic; + function createCompilerDiagnostic(message) { + var text = getLocaleSpecificMessage(message.key); + if (arguments.length > 1) { + text = formatStringFromArgs(text, arguments, 1); + } + return { + file: undefined, + start: undefined, + length: undefined, + messageText: text, + category: message.category, + code: message.code, + isEarly: message.isEarly + }; + } + ts.createCompilerDiagnostic = createCompilerDiagnostic; + function chainDiagnosticMessages(details, message) { + var text = getLocaleSpecificMessage(message.key); + if (arguments.length > 2) { + text = formatStringFromArgs(text, arguments, 2); + } + return { + messageText: text, + category: message.category, + code: message.code, + next: details + }; + } + ts.chainDiagnosticMessages = chainDiagnosticMessages; + function concatenateDiagnosticMessageChains(headChain, tailChain) { + Debug.assert(!headChain.next); + headChain.next = tailChain; + return headChain; + } + ts.concatenateDiagnosticMessageChains = concatenateDiagnosticMessageChains; + function flattenDiagnosticChain(file, start, length, diagnosticChain, newLine) { + Debug.assert(start >= 0, "start must be non-negative, is " + start); + Debug.assert(length >= 0, "length must be non-negative, is " + length); + var code = diagnosticChain.code; + var category = diagnosticChain.category; + var messageText = ""; + var indent = 0; + while (diagnosticChain) { + if (indent) { + messageText += newLine; + for (var i = 0; i < indent; i++) { + messageText += " "; + } + } + messageText += diagnosticChain.messageText; + indent++; + diagnosticChain = diagnosticChain.next; + } + return { + file: file, + start: start, + length: length, + code: code, + category: category, + messageText: messageText + }; + } + ts.flattenDiagnosticChain = flattenDiagnosticChain; + function compareValues(a, b) { + if (a === b) + return 0 /* EqualTo */; + if (a === undefined) + return -1 /* LessThan */; + if (b === undefined) + return 1 /* GreaterThan */; + return a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; + } + ts.compareValues = compareValues; + function getDiagnosticFilename(diagnostic) { + return diagnostic.file ? diagnostic.file.filename : undefined; + } + function compareDiagnostics(d1, d2) { + return compareValues(getDiagnosticFilename(d1), getDiagnosticFilename(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareValues(d1.messageText, d2.messageText) || 0; + } + ts.compareDiagnostics = compareDiagnostics; + function deduplicateSortedDiagnostics(diagnostics) { + if (diagnostics.length < 2) { + return diagnostics; + } + var newDiagnostics = [diagnostics[0]]; + var previousDiagnostic = diagnostics[0]; + for (var i = 1; i < diagnostics.length; i++) { + var currentDiagnostic = diagnostics[i]; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0 /* EqualTo */; + if (!isDupe) { + newDiagnostics.push(currentDiagnostic); + previousDiagnostic = currentDiagnostic; + } + } + return newDiagnostics; + } + ts.deduplicateSortedDiagnostics = deduplicateSortedDiagnostics; + function normalizeSlashes(path) { + return path.replace(/\\/g, "/"); + } + ts.normalizeSlashes = normalizeSlashes; + function getRootLength(path) { + if (path.charCodeAt(0) === 47 /* slash */) { + if (path.charCodeAt(1) !== 47 /* slash */) + return 1; + var p1 = path.indexOf("/", 2); + if (p1 < 0) + return 2; + var p2 = path.indexOf("/", p1 + 1); + if (p2 < 0) + return p1 + 1; + return p2 + 1; + } + if (path.charCodeAt(1) === 58 /* colon */) { + if (path.charCodeAt(2) === 47 /* slash */) + return 3; + return 2; + } + return 0; + } + ts.getRootLength = getRootLength; + ts.directorySeparator = "/"; + function getNormalizedParts(normalizedSlashedPath, rootLength) { + var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); + var normalized = []; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (part !== ".") { + if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { + normalized.pop(); + } + else { + normalized.push(part); + } + } + } + return normalized; + } + function normalizePath(path) { + var path = normalizeSlashes(path); + var rootLength = getRootLength(path); + var normalized = getNormalizedParts(path, rootLength); + return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); + } + ts.normalizePath = normalizePath; + function getDirectoryPath(path) { + return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator))); + } + ts.getDirectoryPath = getDirectoryPath; + function isUrl(path) { + return path && !isRootedDiskPath(path) && path.indexOf("://") !== -1; + } + ts.isUrl = isUrl; + function isRootedDiskPath(path) { + return getRootLength(path) !== 0; + } + ts.isRootedDiskPath = isRootedDiskPath; + function normalizedPathComponents(path, rootLength) { + var normalizedParts = getNormalizedParts(path, rootLength); + return [path.substr(0, rootLength)].concat(normalizedParts); + } + function getNormalizedPathComponents(path, currentDirectory) { + var path = normalizeSlashes(path); + var rootLength = getRootLength(path); + if (rootLength == 0) { + path = combinePaths(normalizeSlashes(currentDirectory), path); + rootLength = getRootLength(path); + } + return normalizedPathComponents(path, rootLength); + } + ts.getNormalizedPathComponents = getNormalizedPathComponents; + function getNormalizedPathFromPathComponents(pathComponents) { + if (pathComponents && pathComponents.length) { + return pathComponents[0] + pathComponents.slice(1).join(ts.directorySeparator); + } + } + ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; + function getNormalizedPathComponentsOfUrl(url) { + var urlLength = url.length; + var rootLength = url.indexOf("://") + "://".length; + while (rootLength < urlLength) { + if (url.charCodeAt(rootLength) === 47 /* slash */) { + rootLength++; + } + else { + break; + } + } + if (rootLength === urlLength) { + return [url]; + } + var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); + if (indexOfNextSlash !== -1) { + rootLength = indexOfNextSlash + 1; + return normalizedPathComponents(url, rootLength); + } + else { + return [url + ts.directorySeparator]; + } + } + function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { + if (isUrl(pathOrUrl)) { + return getNormalizedPathComponentsOfUrl(pathOrUrl); + } + else { + return getNormalizedPathComponents(pathOrUrl, currentDirectory); + } + } + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { + var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); + var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); + if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + directoryComponents.length--; + } + for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { + if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { + break; + } + } + if (joinStartIndex) { + var relativePath = ""; + var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); + for (; joinStartIndex < directoryComponents.length; joinStartIndex++) { + if (directoryComponents[joinStartIndex] !== "") { + relativePath = relativePath + ".." + ts.directorySeparator; + } + } + return relativePath + relativePathComponents.join(ts.directorySeparator); + } + var absolutePath = getNormalizedPathFromPathComponents(pathComponents); + if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { + absolutePath = "file:///" + absolutePath; + } + return absolutePath; + } + ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; + function getBaseFilename(path) { + var i = path.lastIndexOf(ts.directorySeparator); + return i < 0 ? path : path.substring(i + 1); + } + ts.getBaseFilename = getBaseFilename; + function combinePaths(path1, path2) { + if (!(path1 && path1.length)) + return path2; + if (!(path2 && path2.length)) + return path1; + if (path2.charAt(0) === ts.directorySeparator) + return path2; + if (path1.charAt(path1.length - 1) === ts.directorySeparator) + return path1 + path2; + return path1 + ts.directorySeparator + path2; + } + ts.combinePaths = combinePaths; + function fileExtensionIs(path, extension) { + var pathLen = path.length; + var extLen = extension.length; + return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; + } + ts.fileExtensionIs = fileExtensionIs; + var supportedExtensions = [".d.ts", ".ts", ".js"]; + function removeFileExtension(path) { + for (var i = 0; i < supportedExtensions.length; i++) { + var ext = supportedExtensions[i]; + if (fileExtensionIs(path, ext)) { + return path.substr(0, path.length - ext.length); + } + } + return path; + } + ts.removeFileExtension = removeFileExtension; + var escapedCharsRegExp = /[\t\v\f\b\0\r\n\"\\\u2028\u2029\u0085]/g; + var escapedCharsMap = { + "\t": "\\t", + "\v": "\\v", + "\f": "\\f", + "\b": "\\b", + "\0": "\\0", + "\r": "\\r", + "\n": "\\n", + "\"": "\\\"", + "\u2028": "\\u2028", + "\u2029": "\\u2029", + "\u0085": "\\u0085" + }; + function escapeString(s) { + return escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, function (c) { + return escapedCharsMap[c] || c; + }) : s; + } + ts.escapeString = escapeString; + function Symbol(flags, name) { + this.flags = flags; + this.name = name; + this.declarations = undefined; + } + function Type(checker, flags) { + this.flags = flags; + } + function Signature(checker) { + } + ts.objectAllocator = { + getNodeConstructor: function (kind) { + function Node() { + } + Node.prototype = { + kind: kind, + pos: 0, + end: 0, + flags: 0, + parent: undefined + }; + return Node; + }, + getSymbolConstructor: function () { return Symbol; }, + getTypeConstructor: function () { return Type; }, + getSignatureConstructor: function () { return Signature; } + }; + var Debug; + (function (Debug) { + var currentAssertionLevel = 0 /* None */; + function shouldAssert(level) { + return currentAssertionLevel >= level; + } + Debug.shouldAssert = shouldAssert; + function assert(expression, message, verboseDebugInfo) { + if (!expression) { + var verboseDebugString = ""; + if (verboseDebugInfo) { + verboseDebugString = "\r\nVerbose Debug Information: " + verboseDebugInfo(); + } + throw new Error("Debug Failure. False expression: " + (message || "") + verboseDebugString); + } + } + Debug.assert = assert; + function fail(message) { + Debug.assert(false, message); + } + Debug.fail = fail; + })(Debug = ts.Debug || (ts.Debug = {})); +})(ts || (ts = {})); var ts; (function (ts) { ts.Diagnostics = { Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, + A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1 /* Error */, key: "A file cannot have a reference to itself." }, Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, @@ -98,6 +673,7 @@ var ts; An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, + A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1 /* Error */, key: "A tuple type element list cannot be empty." }, Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, @@ -126,6 +702,17 @@ var ts; Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, + var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, + Invalid_template_literal_expected: { code: 1158, category: 1 /* Error */, key: "Invalid template literal; expected '}'" }, + Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: 1 /* Error */, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, + Unterminated_template_literal: { code: 1160, category: 1 /* Error */, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1161, category: 1 /* Error */, key: "Unterminated regular expression literal." }, + An_object_member_cannot_be_declared_optional: { code: 1162, category: 1 /* Error */, key: "An object member cannot be declared optional." }, Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, @@ -146,17 +733,16 @@ var ts; Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, - Type_0_is_not_assignable_to_type_1: { code: 2323, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, + Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, - Private_property_0_cannot_be_reimplemented: { code: 2325, category: 1 /* Error */, key: "Private property '{0}' cannot be reimplemented." }, - Types_of_property_0_are_incompatible_Colon: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, - Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2327, category: 1 /* Error */, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1 /* Error */, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, + Types_of_property_0_are_incompatible: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible." }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1 /* Error */, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, + Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible:" }, + Index_signatures_are_incompatible: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible." }, this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, @@ -166,10 +752,9 @@ var ts; Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_inaccessible: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is inaccessible." }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, @@ -179,7 +764,6 @@ var ts; Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, @@ -192,8 +776,6 @@ var ts; The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - No_best_common_type_exists_between_0_1_and_2: { code: 2366, category: 1 /* Error */, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, - No_best_common_type_exists_between_0_and_1: { code: 2367, category: 1 /* Error */, key: "No best common type exists between '{0}' and '{1}'." }, Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, @@ -211,7 +793,7 @@ var ts; Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_or_private: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public or private." }, + Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public, private or protected." }, Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, @@ -242,12 +824,9 @@ var ts; Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, @@ -255,7 +834,6 @@ var ts; Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, @@ -267,6 +845,23 @@ var ts; Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1 /* Error */, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, + Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1 /* Error */, key: "Types have separate declarations of a private property '{0}'." }, + Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1 /* Error */, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, + Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1 /* Error */, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1 /* Error */, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1 /* Error */, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1 /* Error */, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1 /* Error */, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1 /* Error */, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1 /* Error */, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: 1 /* Error */, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: 1 /* Error */, key: "Type alias name cannot be '{0}'" }, + An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1 /* Error */, key: "An AMD module cannot have multiple name assignments." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, @@ -346,6 +941,15 @@ var ts; Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: 1 /* Error */, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: 1 /* Error */, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 4084, category: 1 /* Error */, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + Index_expression_arguments_in_const_enums_must_be_of_type_string: { code: 4085, category: 1 /* Error */, key: "Index expression arguments in 'const' enums must be of type 'string'." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 4086, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 4087, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, @@ -360,8 +964,10 @@ var ts; Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2 /* Message */, key: "Do not erase const enum declarations in generated code." }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2 /* Message */, key: "Do not emit outputs if any type checking errors were reported." }, Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, @@ -383,7 +989,7 @@ var ts; Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, @@ -403,122 +1009,127 @@ var ts; Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, + _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, + _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: 1 /* Error */, key: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, + Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: 1 /* Error */, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, You_cannot_rename_this_element: { code: 8000, category: 1 /* Error */, key: "You cannot rename this element." } }; })(ts || (ts = {})); var ts; (function (ts) { var textToToken = { - "any": 101 /* AnyKeyword */, - "boolean": 102 /* BooleanKeyword */, - "break": 56 /* BreakKeyword */, - "case": 57 /* CaseKeyword */, - "catch": 58 /* CatchKeyword */, - "class": 59 /* ClassKeyword */, - "continue": 61 /* ContinueKeyword */, - "const": 60 /* ConstKeyword */, - "constructor": 103 /* ConstructorKeyword */, - "debugger": 62 /* DebuggerKeyword */, - "declare": 104 /* DeclareKeyword */, - "default": 63 /* DefaultKeyword */, - "delete": 64 /* DeleteKeyword */, - "do": 65 /* DoKeyword */, - "else": 66 /* ElseKeyword */, - "enum": 67 /* EnumKeyword */, - "export": 68 /* ExportKeyword */, - "extends": 69 /* ExtendsKeyword */, - "false": 70 /* FalseKeyword */, - "finally": 71 /* FinallyKeyword */, - "for": 72 /* ForKeyword */, - "function": 73 /* FunctionKeyword */, - "get": 105 /* GetKeyword */, - "if": 74 /* IfKeyword */, - "implements": 92 /* ImplementsKeyword */, - "import": 75 /* ImportKeyword */, - "in": 76 /* InKeyword */, - "instanceof": 77 /* InstanceOfKeyword */, - "interface": 93 /* InterfaceKeyword */, - "let": 94 /* LetKeyword */, - "module": 106 /* ModuleKeyword */, - "new": 78 /* NewKeyword */, - "null": 79 /* NullKeyword */, - "number": 108 /* NumberKeyword */, - "package": 95 /* PackageKeyword */, - "private": 96 /* PrivateKeyword */, - "protected": 97 /* ProtectedKeyword */, - "public": 98 /* PublicKeyword */, - "require": 107 /* RequireKeyword */, - "return": 80 /* ReturnKeyword */, - "set": 109 /* SetKeyword */, - "static": 99 /* StaticKeyword */, - "string": 110 /* StringKeyword */, - "super": 81 /* SuperKeyword */, - "switch": 82 /* SwitchKeyword */, - "this": 83 /* ThisKeyword */, - "throw": 84 /* ThrowKeyword */, - "true": 85 /* TrueKeyword */, - "try": 86 /* TryKeyword */, - "typeof": 87 /* TypeOfKeyword */, - "var": 88 /* VarKeyword */, - "void": 89 /* VoidKeyword */, - "while": 90 /* WhileKeyword */, - "with": 91 /* WithKeyword */, - "yield": 100 /* YieldKeyword */, - "{": 5 /* OpenBraceToken */, - "}": 6 /* CloseBraceToken */, - "(": 7 /* OpenParenToken */, - ")": 8 /* CloseParenToken */, - "[": 9 /* OpenBracketToken */, - "]": 10 /* CloseBracketToken */, - ".": 11 /* DotToken */, - "...": 12 /* DotDotDotToken */, - ";": 13 /* SemicolonToken */, - ",": 14 /* CommaToken */, - "<": 15 /* LessThanToken */, - ">": 16 /* GreaterThanToken */, - "<=": 17 /* LessThanEqualsToken */, - ">=": 18 /* GreaterThanEqualsToken */, - "==": 19 /* EqualsEqualsToken */, - "!=": 20 /* ExclamationEqualsToken */, - "===": 21 /* EqualsEqualsEqualsToken */, - "!==": 22 /* ExclamationEqualsEqualsToken */, - "=>": 23 /* EqualsGreaterThanToken */, - "+": 24 /* PlusToken */, - "-": 25 /* MinusToken */, - "*": 26 /* AsteriskToken */, - "/": 27 /* SlashToken */, - "%": 28 /* PercentToken */, - "++": 29 /* PlusPlusToken */, - "--": 30 /* MinusMinusToken */, - "<<": 31 /* LessThanLessThanToken */, - ">>": 32 /* GreaterThanGreaterThanToken */, - ">>>": 33 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 34 /* AmpersandToken */, - "|": 35 /* BarToken */, - "^": 36 /* CaretToken */, - "!": 37 /* ExclamationToken */, - "~": 38 /* TildeToken */, - "&&": 39 /* AmpersandAmpersandToken */, - "||": 40 /* BarBarToken */, - "?": 41 /* QuestionToken */, - ":": 42 /* ColonToken */, - "=": 43 /* EqualsToken */, - "+=": 44 /* PlusEqualsToken */, - "-=": 45 /* MinusEqualsToken */, - "*=": 46 /* AsteriskEqualsToken */, - "/=": 47 /* SlashEqualsToken */, - "%=": 48 /* PercentEqualsToken */, - "<<=": 49 /* LessThanLessThanEqualsToken */, - ">>=": 50 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 52 /* AmpersandEqualsToken */, - "|=": 53 /* BarEqualsToken */, - "^=": 54 /* CaretEqualsToken */ + "any": 109 /* AnyKeyword */, + "boolean": 110 /* BooleanKeyword */, + "break": 64 /* BreakKeyword */, + "case": 65 /* CaseKeyword */, + "catch": 66 /* CatchKeyword */, + "class": 67 /* ClassKeyword */, + "continue": 69 /* ContinueKeyword */, + "const": 68 /* ConstKeyword */, + "constructor": 111 /* ConstructorKeyword */, + "debugger": 70 /* DebuggerKeyword */, + "declare": 112 /* DeclareKeyword */, + "default": 71 /* DefaultKeyword */, + "delete": 72 /* DeleteKeyword */, + "do": 73 /* DoKeyword */, + "else": 74 /* ElseKeyword */, + "enum": 75 /* EnumKeyword */, + "export": 76 /* ExportKeyword */, + "extends": 77 /* ExtendsKeyword */, + "false": 78 /* FalseKeyword */, + "finally": 79 /* FinallyKeyword */, + "for": 80 /* ForKeyword */, + "function": 81 /* FunctionKeyword */, + "get": 113 /* GetKeyword */, + "if": 82 /* IfKeyword */, + "implements": 100 /* ImplementsKeyword */, + "import": 83 /* ImportKeyword */, + "in": 84 /* InKeyword */, + "instanceof": 85 /* InstanceOfKeyword */, + "interface": 101 /* InterfaceKeyword */, + "let": 102 /* LetKeyword */, + "module": 114 /* ModuleKeyword */, + "new": 86 /* NewKeyword */, + "null": 87 /* NullKeyword */, + "number": 116 /* NumberKeyword */, + "package": 103 /* PackageKeyword */, + "private": 104 /* PrivateKeyword */, + "protected": 105 /* ProtectedKeyword */, + "public": 106 /* PublicKeyword */, + "require": 115 /* RequireKeyword */, + "return": 88 /* ReturnKeyword */, + "set": 117 /* SetKeyword */, + "static": 107 /* StaticKeyword */, + "string": 118 /* StringKeyword */, + "super": 89 /* SuperKeyword */, + "switch": 90 /* SwitchKeyword */, + "this": 91 /* ThisKeyword */, + "throw": 92 /* ThrowKeyword */, + "true": 93 /* TrueKeyword */, + "try": 94 /* TryKeyword */, + "type": 119 /* TypeKeyword */, + "typeof": 95 /* TypeOfKeyword */, + "var": 96 /* VarKeyword */, + "void": 97 /* VoidKeyword */, + "while": 98 /* WhileKeyword */, + "with": 99 /* WithKeyword */, + "yield": 108 /* YieldKeyword */, + "{": 13 /* OpenBraceToken */, + "}": 14 /* CloseBraceToken */, + "(": 15 /* OpenParenToken */, + ")": 16 /* CloseParenToken */, + "[": 17 /* OpenBracketToken */, + "]": 18 /* CloseBracketToken */, + ".": 19 /* DotToken */, + "...": 20 /* DotDotDotToken */, + ";": 21 /* SemicolonToken */, + ",": 22 /* CommaToken */, + "<": 23 /* LessThanToken */, + ">": 24 /* GreaterThanToken */, + "<=": 25 /* LessThanEqualsToken */, + ">=": 26 /* GreaterThanEqualsToken */, + "==": 27 /* EqualsEqualsToken */, + "!=": 28 /* ExclamationEqualsToken */, + "===": 29 /* EqualsEqualsEqualsToken */, + "!==": 30 /* ExclamationEqualsEqualsToken */, + "=>": 31 /* EqualsGreaterThanToken */, + "+": 32 /* PlusToken */, + "-": 33 /* MinusToken */, + "*": 34 /* AsteriskToken */, + "/": 35 /* SlashToken */, + "%": 36 /* PercentToken */, + "++": 37 /* PlusPlusToken */, + "--": 38 /* MinusMinusToken */, + "<<": 39 /* LessThanLessThanToken */, + ">>": 40 /* GreaterThanGreaterThanToken */, + ">>>": 41 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 42 /* AmpersandToken */, + "|": 43 /* BarToken */, + "^": 44 /* CaretToken */, + "!": 45 /* ExclamationToken */, + "~": 46 /* TildeToken */, + "&&": 47 /* AmpersandAmpersandToken */, + "||": 48 /* BarBarToken */, + "?": 49 /* QuestionToken */, + ":": 50 /* ColonToken */, + "=": 51 /* EqualsToken */, + "+=": 52 /* PlusEqualsToken */, + "-=": 53 /* MinusEqualsToken */, + "*=": 54 /* AsteriskEqualsToken */, + "/=": 55 /* SlashEqualsToken */, + "%=": 56 /* PercentEqualsToken */, + "<<=": 57 /* LessThanLessThanEqualsToken */, + ">>=": 58 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 60 /* AmpersandEqualsToken */, + "|=": 61 /* BarEqualsToken */, + "^=": 62 /* CaretEqualsToken */ }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; + var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; function lookupInUnicodeMap(code, map) { if (code < map[0]) { return false; @@ -561,12 +1172,13 @@ var ts; return tokenStrings[t]; } ts.tokenToString = tokenToString; - function getLineStarts(text) { + function computeLineStarts(text) { var result = new Array(); var pos = 0; var lineStart = 0; while (pos < text.length) { - switch (text.charCodeAt(pos++)) { + var ch = text.charCodeAt(pos++); + switch (ch) { case 13 /* carriageReturn */: if (text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; @@ -575,12 +1187,18 @@ var ts; result.push(lineStart); lineStart = pos; break; + default: + if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { + result.push(lineStart); + lineStart = pos; + } + break; } } result.push(lineStart); return result; } - ts.getLineStarts = getLineStarts; + ts.computeLineStarts = computeLineStarts; function getPositionFromLineAndCharacter(lineStarts, line, character) { ts.Debug.assert(line > 0); return lineStarts[line - 1] + character - 1; @@ -598,7 +1216,7 @@ var ts; } ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; function positionToLineAndCharacter(text, pos) { - var lineStarts = getLineStarts(text); + var lineStarts = computeLineStarts(text); return getLineAndCharacterOfPosition(lineStarts, pos); } ts.positionToLineAndCharacter = positionToLineAndCharacter; @@ -608,7 +1226,7 @@ var ts; } ts.isWhiteSpace = isWhiteSpace; function isLineBreak(ch) { - return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */; + return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */ || ch === 133 /* nextLine */; } ts.isLineBreak = isLineBreak; function isDigit(ch) { @@ -740,15 +1358,23 @@ var ts; return result; } } - function getLeadingComments(text, pos) { + function getLeadingCommentRanges(text, pos) { return getCommentRanges(text, pos, false); } - ts.getLeadingComments = getLeadingComments; - function getTrailingComments(text, pos) { + ts.getLeadingCommentRanges = getLeadingCommentRanges; + function getTrailingCommentRanges(text, pos) { return getCommentRanges(text, pos, true); } - ts.getTrailingComments = getTrailingComments; - function createScanner(languageVersion, text, onError, onComment) { + ts.getTrailingCommentRanges = getTrailingCommentRanges; + function isIdentifierStart(ch, languageVersion) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); + } + ts.isIdentifierStart = isIdentifierStart; + function isIdentifierPart(ch, languageVersion) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); + } + ts.isIdentifierPart = isIdentifierPart; + function createScanner(languageVersion, skipTrivia, text, onError, onComment) { var pos; var len; var startPos; @@ -800,10 +1426,10 @@ var ts; } return +(text.substring(start, pos)); } - function scanHexDigits(count, exact) { + function scanHexDigits(count, mustMatchCount) { var digits = 0; var value = 0; - while (digits < count || !exact) { + while (digits < count || !mustMatchCount) { var ch = text.charCodeAt(pos); if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { value = value * 16 + ch - 48 /* _0 */; @@ -832,7 +1458,7 @@ var ts; while (true) { if (pos >= len) { result += text.substring(start, pos); - error(ts.Diagnostics.Unexpected_end_of_text); + error(ts.Diagnostics.Unterminated_string_literal); break; } var ch = text.charCodeAt(pos); @@ -843,61 +1469,7 @@ var ts; } if (ch === 92 /* backslash */) { result += text.substring(start, pos); - pos++; - if (pos >= len) { - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - result += "\0"; - break; - case 98 /* b */: - result += "\b"; - break; - case 116 /* t */: - result += "\t"; - break; - case 110 /* n */: - result += "\n"; - break; - case 118 /* v */: - result += "\v"; - break; - case 102 /* f */: - result += "\f"; - break; - case 114 /* r */: - result += "\r"; - break; - case 39 /* singleQuote */: - result += "\'"; - break; - case 34 /* doubleQuote */: - result += "\""; - break; - case 120 /* x */: - case 117 /* u */: - var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); - if (ch >= 0) { - result += String.fromCharCode(ch); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - } - break; - case 13 /* carriageReturn */: - if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) - pos++; - break; - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - break; - default: - result += String.fromCharCode(ch); - } + result += scanEscapeSequence(); start = pos; continue; } @@ -910,6 +1482,102 @@ var ts; } return result; } + function scanTemplateAndSetTokenValue() { + var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; + pos++; + var start = pos; + var contents = ""; + var resultingToken; + while (true) { + if (pos >= len) { + contents += text.substring(start, pos); + error(ts.Diagnostics.Unterminated_template_literal); + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + var currChar = text.charCodeAt(pos); + if (currChar === 96 /* backtick */) { + contents += text.substring(start, pos); + pos++; + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + if (currChar === 36 /* $ */ && pos + 1 < len && text.charCodeAt(pos + 1) === 123 /* openBrace */) { + contents += text.substring(start, pos); + pos += 2; + resultingToken = startedWithBacktick ? 10 /* TemplateHead */ : 11 /* TemplateMiddle */; + break; + } + if (currChar === 92 /* backslash */) { + contents += text.substring(start, pos); + contents += scanEscapeSequence(); + start = pos; + continue; + } + if (currChar === 13 /* carriageReturn */) { + contents += text.substring(start, pos); + if (pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + pos++; + } + pos++; + contents += "\n"; + start = pos; + continue; + } + pos++; + } + ts.Debug.assert(resultingToken !== undefined); + tokenValue = contents; + return resultingToken; + } + function scanEscapeSequence() { + pos++; + if (pos >= len) { + error(ts.Diagnostics.Unexpected_end_of_text); + return ""; + } + var ch = text.charCodeAt(pos++); + switch (ch) { + case 48 /* _0 */: + return "\0"; + case 98 /* b */: + return "\b"; + case 116 /* t */: + return "\t"; + case 110 /* n */: + return "\n"; + case 118 /* v */: + return "\v"; + case 102 /* f */: + return "\f"; + case 114 /* r */: + return "\r"; + case 39 /* singleQuote */: + return "\'"; + case 34 /* doubleQuote */: + return "\""; + case 120 /* x */: + case 117 /* u */: + var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); + if (ch >= 0) { + return String.fromCharCode(ch); + } + else { + error(ts.Diagnostics.Hexadecimal_digit_expected); + return ""; + } + case 13 /* carriageReturn */: + if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + case 8232 /* lineSeparator */: + case 8233 /* paragraphSeparator */: + return ""; + default: + return String.fromCharCode(ch); + } + } function peekUnicodeEscape() { if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { var start = pos; @@ -953,7 +1621,7 @@ var ts; return token = textToToken[tokenValue]; } } - return token = 55 /* Identifier */; + return token = 63 /* Identifier */; } function scan() { startPos = pos; @@ -968,73 +1636,96 @@ var ts; case 10 /* lineFeed */: case 13 /* carriageReturn */: precedingLineBreak = true; + if (skipTrivia) { + pos++; + continue; + } + else { + if (ch === 13 /* carriageReturn */ && pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + pos += 2; + } + else { + pos++; + } + return token = 4 /* NewLineTrivia */; + } case 9 /* tab */: case 11 /* verticalTab */: case 12 /* formFeed */: case 32 /* space */: - pos++; - continue; + if (skipTrivia) { + pos++; + continue; + } + else { + while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { + pos++; + } + return token = 5 /* WhitespaceTrivia */; + } case 33 /* exclamation */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 22 /* ExclamationEqualsEqualsToken */; + return pos += 3, token = 30 /* ExclamationEqualsEqualsToken */; } - return pos += 2, token = 20 /* ExclamationEqualsToken */; + return pos += 2, token = 28 /* ExclamationEqualsToken */; } - return pos++, token = 37 /* ExclamationToken */; + return pos++, token = 45 /* ExclamationToken */; case 34 /* doubleQuote */: case 39 /* singleQuote */: tokenValue = scanString(); - return token = 3 /* StringLiteral */; + return token = 7 /* StringLiteral */; + case 96 /* backtick */: + return token = scanTemplateAndSetTokenValue(); case 37 /* percent */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 48 /* PercentEqualsToken */; + return pos += 2, token = 56 /* PercentEqualsToken */; } - return pos++, token = 28 /* PercentToken */; + return pos++, token = 36 /* PercentToken */; case 38 /* ampersand */: if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 39 /* AmpersandAmpersandToken */; + return pos += 2, token = 47 /* AmpersandAmpersandToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 52 /* AmpersandEqualsToken */; + return pos += 2, token = 60 /* AmpersandEqualsToken */; } - return pos++, token = 34 /* AmpersandToken */; + return pos++, token = 42 /* AmpersandToken */; case 40 /* openParen */: - return pos++, token = 7 /* OpenParenToken */; + return pos++, token = 15 /* OpenParenToken */; case 41 /* closeParen */: - return pos++, token = 8 /* CloseParenToken */; + return pos++, token = 16 /* CloseParenToken */; case 42 /* asterisk */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 46 /* AsteriskEqualsToken */; + return pos += 2, token = 54 /* AsteriskEqualsToken */; } - return pos++, token = 26 /* AsteriskToken */; + return pos++, token = 34 /* AsteriskToken */; case 43 /* plus */: if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 29 /* PlusPlusToken */; + return pos += 2, token = 37 /* PlusPlusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 44 /* PlusEqualsToken */; + return pos += 2, token = 52 /* PlusEqualsToken */; } - return pos++, token = 24 /* PlusToken */; + return pos++, token = 32 /* PlusToken */; case 44 /* comma */: - return pos++, token = 14 /* CommaToken */; + return pos++, token = 22 /* CommaToken */; case 45 /* minus */: if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 30 /* MinusMinusToken */; + return pos += 2, token = 38 /* MinusMinusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 45 /* MinusEqualsToken */; + return pos += 2, token = 53 /* MinusEqualsToken */; } - return pos++, token = 25 /* MinusToken */; + return pos++, token = 33 /* MinusToken */; case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanNumber(); - return token = 2 /* NumericLiteral */; + return token = 6 /* NumericLiteral */; } if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { - return pos += 3, token = 12 /* DotDotDotToken */; + return pos += 3, token = 20 /* DotDotDotToken */; } - return pos++, token = 11 /* DotToken */; + return pos++, token = 19 /* DotToken */; case 47 /* slash */: if (text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; @@ -1047,7 +1738,12 @@ var ts; if (onComment) { onComment(tokenPos, pos); } - continue; + if (skipTrivia) { + continue; + } + else { + return token = 2 /* SingleLineCommentTrivia */; + } } if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { pos += 2; @@ -1070,12 +1766,17 @@ var ts; if (onComment) { onComment(tokenPos, pos); } - continue; + if (skipTrivia) { + continue; + } + else { + return token = 3 /* MultiLineCommentTrivia */; + } } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 47 /* SlashEqualsToken */; + return pos += 2, token = 55 /* SlashEqualsToken */; } - return pos++, token = 27 /* SlashToken */; + return pos++, token = 35 /* SlashToken */; case 48 /* _0 */: if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; @@ -1085,11 +1786,11 @@ var ts; value = 0; } tokenValue = "" + value; - return 2 /* NumericLiteral */; + return token = 6 /* NumericLiteral */; } if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); - return 2 /* NumericLiteral */; + return token = 6 /* NumericLiteral */; } case 49 /* _1 */: case 50 /* _2 */: @@ -1101,60 +1802,60 @@ var ts; case 56 /* _8 */: case 57 /* _9 */: tokenValue = "" + scanNumber(); - return token = 2 /* NumericLiteral */; + return token = 6 /* NumericLiteral */; case 58 /* colon */: - return pos++, token = 42 /* ColonToken */; + return pos++, token = 50 /* ColonToken */; case 59 /* semicolon */: - return pos++, token = 13 /* SemicolonToken */; + return pos++, token = 21 /* SemicolonToken */; case 60 /* lessThan */: if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 49 /* LessThanLessThanEqualsToken */; + return pos += 3, token = 57 /* LessThanLessThanEqualsToken */; } - return pos += 2, token = 31 /* LessThanLessThanToken */; + return pos += 2, token = 39 /* LessThanLessThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 17 /* LessThanEqualsToken */; + return pos += 2, token = 25 /* LessThanEqualsToken */; } - return pos++, token = 15 /* LessThanToken */; + return pos++, token = 23 /* LessThanToken */; case 61 /* equals */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 21 /* EqualsEqualsEqualsToken */; + return pos += 3, token = 29 /* EqualsEqualsEqualsToken */; } - return pos += 2, token = 19 /* EqualsEqualsToken */; + return pos += 2, token = 27 /* EqualsEqualsToken */; } if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 23 /* EqualsGreaterThanToken */; + return pos += 2, token = 31 /* EqualsGreaterThanToken */; } - return pos++, token = 43 /* EqualsToken */; + return pos++, token = 51 /* EqualsToken */; case 62 /* greaterThan */: - return pos++, token = 16 /* GreaterThanToken */; + return pos++, token = 24 /* GreaterThanToken */; case 63 /* question */: - return pos++, token = 41 /* QuestionToken */; + return pos++, token = 49 /* QuestionToken */; case 91 /* openBracket */: - return pos++, token = 9 /* OpenBracketToken */; + return pos++, token = 17 /* OpenBracketToken */; case 93 /* closeBracket */: - return pos++, token = 10 /* CloseBracketToken */; + return pos++, token = 18 /* CloseBracketToken */; case 94 /* caret */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* CaretEqualsToken */; + return pos += 2, token = 62 /* CaretEqualsToken */; } - return pos++, token = 36 /* CaretToken */; + return pos++, token = 44 /* CaretToken */; case 123 /* openBrace */: - return pos++, token = 5 /* OpenBraceToken */; + return pos++, token = 13 /* OpenBraceToken */; case 124 /* bar */: if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 40 /* BarBarToken */; + return pos += 2, token = 48 /* BarBarToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 53 /* BarEqualsToken */; + return pos += 2, token = 61 /* BarEqualsToken */; } - return pos++, token = 35 /* BarToken */; + return pos++, token = 43 /* BarToken */; case 125 /* closeBrace */: - return pos++, token = 6 /* CloseBraceToken */; + return pos++, token = 14 /* CloseBraceToken */; case 126 /* tilde */: - return pos++, token = 38 /* TildeToken */; + return pos++, token = 46 /* TildeToken */; case 92 /* backslash */: var ch = peekUnicodeEscape(); if (ch >= 0 && isIdentifierStart(ch)) { @@ -1190,42 +1891,45 @@ var ts; } } function reScanGreaterToken() { - if (token === 16 /* GreaterThanToken */) { + if (token === 24 /* GreaterThanToken */) { if (text.charCodeAt(pos) === 62 /* greaterThan */) { if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + return pos += 3, token = 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } - return pos += 2, token = 33 /* GreaterThanGreaterThanGreaterThanToken */; + return pos += 2, token = 41 /* GreaterThanGreaterThanGreaterThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 50 /* GreaterThanGreaterThanEqualsToken */; + return pos += 2, token = 58 /* GreaterThanGreaterThanEqualsToken */; } - return pos++, token = 32 /* GreaterThanGreaterThanToken */; + return pos++, token = 40 /* GreaterThanGreaterThanToken */; } if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 18 /* GreaterThanEqualsToken */; + return pos++, token = 26 /* GreaterThanEqualsToken */; } } return token; } function reScanSlashToken() { - if (token === 27 /* SlashToken */ || token === 47 /* SlashEqualsToken */) { + if (token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; while (true) { if (p >= len) { - return token; + error(ts.Diagnostics.Unterminated_regular_expression_literal); + break; } var ch = text.charCodeAt(p); if (isLineBreak(ch)) { - return token; + error(ts.Diagnostics.Unterminated_regular_expression_literal); + break; } if (inEscape) { inEscape = false; } else if (ch === 47 /* slash */ && !inCharacterClass) { + p++; break; } else if (ch === 91 /* openBracket */) { @@ -1239,16 +1943,20 @@ var ts; } p++; } - p++; - while (isIdentifierPart(text.charCodeAt(p))) { + while (p < len && isIdentifierPart(text.charCodeAt(p))) { p++; } pos = p; tokenValue = text.substring(tokenPos, pos); - token = 4 /* RegularExpressionLiteral */; + token = 8 /* RegularExpressionLiteral */; } return token; } + function reScanTemplateToken() { + ts.Debug.assert(token === 14 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); + pos = tokenPos; + return token = scanTemplateAndSetTokenValue(); + } function tryScan(callback) { var savePos = pos; var saveStartPos = startPos; @@ -1288,10 +1996,11 @@ var ts; getTokenText: function () { return text.substring(tokenPos, pos); }, getTokenValue: function () { return tokenValue; }, hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 55 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; }, - isReservedWord: function () { return token >= ts.SyntaxKind.FirstReservedWord && token <= ts.SyntaxKind.LastReservedWord; }, + isIdentifier: function () { return token === 63 /* Identifier */ || token > 99 /* LastReservedWord */; }, + isReservedWord: function () { return token >= 64 /* FirstReservedWord */ && token <= 99 /* LastReservedWord */; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, scan: scan, setText: setText, setTextPos: setTextPos, @@ -1302,971 +2011,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 2] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 3] = "StringLiteral"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 4] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 5] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 6] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 7] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 8] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 9] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 10] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 11] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 12] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 13] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 14] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 15] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 16] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 17] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 18] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 19] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 20] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 21] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 22] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 23] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 24] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 25] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 26] = "AsteriskToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 27] = "SlashToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 28] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 29] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 30] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 31] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 32] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 33] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 34] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 35] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 36] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 37] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 38] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 39] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 40] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 41] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 42] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 43] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 44] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 45] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 46] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 47] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 48] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 49] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 50] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 51] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 52] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 53] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 54] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["Identifier"] = 55] = "Identifier"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 56] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 57] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 58] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 59] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 60] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 61] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 62] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 63] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 64] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 65] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 66] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 67] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 68] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 69] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 70] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 71] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 72] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 73] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 74] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 75] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 76] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 77] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 78] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 79] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 80] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 81] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 82] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 83] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 84] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 85] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 86] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 87] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 88] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 89] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 90] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 91] = "WithKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 92] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 93] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 94] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 95] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 96] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 97] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 98] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 99] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 100] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 101] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 102] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 103] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 104] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 105] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 106] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 107] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 108] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 109] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 110] = "StringKeyword"; - SyntaxKind[SyntaxKind["Missing"] = 111] = "Missing"; - SyntaxKind[SyntaxKind["QualifiedName"] = 112] = "QualifiedName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 113] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 114] = "Parameter"; - SyntaxKind[SyntaxKind["Property"] = 115] = "Property"; - SyntaxKind[SyntaxKind["Method"] = 116] = "Method"; - SyntaxKind[SyntaxKind["Constructor"] = 117] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 118] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 119] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 120] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 121] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 122] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 123] = "TypeReference"; - SyntaxKind[SyntaxKind["TypeQuery"] = 124] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 125] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 126] = "ArrayType"; - SyntaxKind[SyntaxKind["ArrayLiteral"] = 127] = "ArrayLiteral"; - SyntaxKind[SyntaxKind["ObjectLiteral"] = 128] = "ObjectLiteral"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 129] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["PropertyAccess"] = 130] = "PropertyAccess"; - SyntaxKind[SyntaxKind["IndexedAccess"] = 131] = "IndexedAccess"; - SyntaxKind[SyntaxKind["CallExpression"] = 132] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 133] = "NewExpression"; - SyntaxKind[SyntaxKind["TypeAssertion"] = 134] = "TypeAssertion"; - SyntaxKind[SyntaxKind["ParenExpression"] = 135] = "ParenExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 136] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 137] = "ArrowFunction"; - SyntaxKind[SyntaxKind["PrefixOperator"] = 138] = "PrefixOperator"; - SyntaxKind[SyntaxKind["PostfixOperator"] = 139] = "PostfixOperator"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 140] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 141] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 142] = "OmittedExpression"; - SyntaxKind[SyntaxKind["Block"] = 143] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 144] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 145] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 146] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 147] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 148] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 149] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 150] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 151] = "ForInStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 152] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 153] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 154] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 155] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 156] = "SwitchStatement"; - SyntaxKind[SyntaxKind["CaseClause"] = 157] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 158] = "DefaultClause"; - SyntaxKind[SyntaxKind["LabelledStatement"] = 159] = "LabelledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 160] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 161] = "TryStatement"; - SyntaxKind[SyntaxKind["TryBlock"] = 162] = "TryBlock"; - SyntaxKind[SyntaxKind["CatchBlock"] = 163] = "CatchBlock"; - SyntaxKind[SyntaxKind["FinallyBlock"] = 164] = "FinallyBlock"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 165] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 166] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 167] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["FunctionBlock"] = 168] = "FunctionBlock"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 169] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 170] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 171] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 172] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 173] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 174] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 175] = "ExportAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 176] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 177] = "SourceFile"; - SyntaxKind[SyntaxKind["Program"] = 178] = "Program"; - SyntaxKind[SyntaxKind["SyntaxList"] = 179] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 180] = "Count"; - SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.BreakKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.StringKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = SyntaxKind.TypeReference] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = SyntaxKind.ArrayType] = "LastTypeNode"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; - })(ts.SyntaxKind || (ts.SyntaxKind = {})); - var SyntaxKind = ts.SyntaxKind; - (function (NodeFlags) { - NodeFlags[NodeFlags["Export"] = 0x00000001] = "Export"; - NodeFlags[NodeFlags["Ambient"] = 0x00000002] = "Ambient"; - NodeFlags[NodeFlags["QuestionMark"] = 0x00000004] = "QuestionMark"; - NodeFlags[NodeFlags["Rest"] = 0x00000008] = "Rest"; - NodeFlags[NodeFlags["Public"] = 0x00000010] = "Public"; - NodeFlags[NodeFlags["Private"] = 0x00000020] = "Private"; - NodeFlags[NodeFlags["Static"] = 0x00000040] = "Static"; - NodeFlags[NodeFlags["MultiLine"] = 0x00000080] = "MultiLine"; - NodeFlags[NodeFlags["Synthetic"] = 0x00000100] = "Synthetic"; - NodeFlags[NodeFlags["DeclarationFile"] = 0x00000200] = "DeclarationFile"; - NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Static] = "Modifier"; - })(ts.NodeFlags || (ts.NodeFlags = {})); - var NodeFlags = ts.NodeFlags; - (function (TypeFormatFlags) { - TypeFormatFlags[TypeFormatFlags["None"] = 0x00000000] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 0x00000001] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 0x00000002] = "UseTypeOfFunction"; - })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); - var TypeFormatFlags = ts.TypeFormatFlags; - (function (SymbolAccessibility) { - SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; - SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; - SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; - })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); - var SymbolAccessibility = ts.SymbolAccessibility; - (function (SymbolFlags) { - SymbolFlags[SymbolFlags["Variable"] = 0x00000001] = "Variable"; - SymbolFlags[SymbolFlags["Property"] = 0x00000002] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 0x00000004] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 0x00000008] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 0x00000010] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 0x00000020] = "Interface"; - SymbolFlags[SymbolFlags["Enum"] = 0x00000040] = "Enum"; - SymbolFlags[SymbolFlags["ValueModule"] = 0x00000080] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000100] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000200] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000400] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 0x00000800] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 0x00001000] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 0x00002000] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 0x00004000] = "SetAccessor"; - SymbolFlags[SymbolFlags["CallSignature"] = 0x00008000] = "CallSignature"; - SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00010000] = "ConstructSignature"; - SymbolFlags[SymbolFlags["IndexSignature"] = 0x00020000] = "IndexSignature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 0x00040000] = "TypeParameter"; - SymbolFlags[SymbolFlags["ExportValue"] = 0x00080000] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 0x00100000] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00200000] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Import"] = 0x00400000] = "Import"; - SymbolFlags[SymbolFlags["Instantiated"] = 0x00800000] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 0x01000000] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 0x02000000] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 0x04000000] = "Prototype"; - SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; - SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter] = "Type"; - SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; - SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; - SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; - SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["VariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.Variable] = "VariableExcludes"; - SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~SymbolFlags.ValueModule] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = SymbolFlags.Type & ~SymbolFlags.Interface] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["EnumExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~(SymbolFlags.Enum | SymbolFlags.ValueModule)] = "EnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)] = "ValueModuleExcludes"; - SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = SymbolFlags.Value & ~SymbolFlags.Method] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.Import] = "ModuleMember"; - SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; - SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; - SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; - SymbolFlags[SymbolFlags["HasMembers"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral] = "HasMembers"; - SymbolFlags[SymbolFlags["IsContainer"] = SymbolFlags.HasLocals | SymbolFlags.HasExports | SymbolFlags.HasMembers] = "IsContainer"; - SymbolFlags[SymbolFlags["PropertyOrAccessor"] = SymbolFlags.Property | SymbolFlags.Accessor] = "PropertyOrAccessor"; - SymbolFlags[SymbolFlags["Export"] = SymbolFlags.ExportNamespace | SymbolFlags.ExportType | SymbolFlags.ExportValue] = "Export"; - })(ts.SymbolFlags || (ts.SymbolFlags = {})); - var SymbolFlags = ts.SymbolFlags; - (function (NodeCheckFlags) { - NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 0x00000001] = "TypeChecked"; - NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 0x00000002] = "LexicalThis"; - NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 0x00000004] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 0x00000008] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 0x00000010] = "SuperInstance"; - NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 0x00000020] = "SuperStatic"; - NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 0x00000040] = "ContextChecked"; - })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); - var NodeCheckFlags = ts.NodeCheckFlags; - (function (TypeFlags) { - TypeFlags[TypeFlags["Any"] = 0x00000001] = "Any"; - TypeFlags[TypeFlags["String"] = 0x00000002] = "String"; - TypeFlags[TypeFlags["Number"] = 0x00000004] = "Number"; - TypeFlags[TypeFlags["Boolean"] = 0x00000008] = "Boolean"; - TypeFlags[TypeFlags["Void"] = 0x00000010] = "Void"; - TypeFlags[TypeFlags["Undefined"] = 0x00000020] = "Undefined"; - TypeFlags[TypeFlags["Null"] = 0x00000040] = "Null"; - TypeFlags[TypeFlags["Enum"] = 0x00000080] = "Enum"; - TypeFlags[TypeFlags["StringLiteral"] = 0x00000100] = "StringLiteral"; - TypeFlags[TypeFlags["TypeParameter"] = 0x00000200] = "TypeParameter"; - TypeFlags[TypeFlags["Class"] = 0x00000400] = "Class"; - TypeFlags[TypeFlags["Interface"] = 0x00000800] = "Interface"; - TypeFlags[TypeFlags["Reference"] = 0x00001000] = "Reference"; - TypeFlags[TypeFlags["Anonymous"] = 0x00002000] = "Anonymous"; - TypeFlags[TypeFlags["FromSignature"] = 0x00004000] = "FromSignature"; - TypeFlags[TypeFlags["Intrinsic"] = TypeFlags.Any | TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null] = "Intrinsic"; - TypeFlags[TypeFlags["StringLike"] = TypeFlags.String | TypeFlags.StringLiteral] = "StringLike"; - TypeFlags[TypeFlags["NumberLike"] = TypeFlags.Number | TypeFlags.Enum] = "NumberLike"; - TypeFlags[TypeFlags["ObjectType"] = TypeFlags.Class | TypeFlags.Interface | TypeFlags.Reference | TypeFlags.Anonymous] = "ObjectType"; - })(ts.TypeFlags || (ts.TypeFlags = {})); - var TypeFlags = ts.TypeFlags; - (function (SignatureKind) { - SignatureKind[SignatureKind["Call"] = 0] = "Call"; - SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; - })(ts.SignatureKind || (ts.SignatureKind = {})); - var SignatureKind = ts.SignatureKind; - (function (IndexKind) { - IndexKind[IndexKind["String"] = 0] = "String"; - IndexKind[IndexKind["Number"] = 1] = "Number"; - })(ts.IndexKind || (ts.IndexKind = {})); - var IndexKind = ts.IndexKind; - (function (DiagnosticCategory) { - DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; - DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); - var DiagnosticCategory = ts.DiagnosticCategory; - (function (ModuleKind) { - ModuleKind[ModuleKind["None"] = 0] = "None"; - ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; - ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; - })(ts.ModuleKind || (ts.ModuleKind = {})); - var ModuleKind = ts.ModuleKind; - (function (ScriptTarget) { - ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; - ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; - })(ts.ScriptTarget || (ts.ScriptTarget = {})); - var ScriptTarget = ts.ScriptTarget; - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 0x7F] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 0x0A] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 0x0D] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - CharacterCodes[CharacterCodes["mathematicalSpace"] = 0x205F] = "mathematicalSpace"; - CharacterCodes[CharacterCodes["ogham"] = 0x1680] = "ogham"; - CharacterCodes[CharacterCodes["_"] = 0x5F] = "_"; - CharacterCodes[CharacterCodes["$"] = 0x24] = "$"; - CharacterCodes[CharacterCodes["_0"] = 0x30] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 0x31] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 0x32] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 0x33] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 0x34] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 0x35] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 0x36] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 0x37] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 0x38] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 0x39] = "_9"; - CharacterCodes[CharacterCodes["a"] = 0x61] = "a"; - CharacterCodes[CharacterCodes["b"] = 0x62] = "b"; - CharacterCodes[CharacterCodes["c"] = 0x63] = "c"; - CharacterCodes[CharacterCodes["d"] = 0x64] = "d"; - CharacterCodes[CharacterCodes["e"] = 0x65] = "e"; - CharacterCodes[CharacterCodes["f"] = 0x66] = "f"; - CharacterCodes[CharacterCodes["g"] = 0x67] = "g"; - CharacterCodes[CharacterCodes["h"] = 0x68] = "h"; - CharacterCodes[CharacterCodes["i"] = 0x69] = "i"; - CharacterCodes[CharacterCodes["j"] = 0x6A] = "j"; - CharacterCodes[CharacterCodes["k"] = 0x6B] = "k"; - CharacterCodes[CharacterCodes["l"] = 0x6C] = "l"; - CharacterCodes[CharacterCodes["m"] = 0x6D] = "m"; - CharacterCodes[CharacterCodes["n"] = 0x6E] = "n"; - CharacterCodes[CharacterCodes["o"] = 0x6F] = "o"; - CharacterCodes[CharacterCodes["p"] = 0x70] = "p"; - CharacterCodes[CharacterCodes["q"] = 0x71] = "q"; - CharacterCodes[CharacterCodes["r"] = 0x72] = "r"; - CharacterCodes[CharacterCodes["s"] = 0x73] = "s"; - CharacterCodes[CharacterCodes["t"] = 0x74] = "t"; - CharacterCodes[CharacterCodes["u"] = 0x75] = "u"; - CharacterCodes[CharacterCodes["v"] = 0x76] = "v"; - CharacterCodes[CharacterCodes["w"] = 0x77] = "w"; - CharacterCodes[CharacterCodes["x"] = 0x78] = "x"; - CharacterCodes[CharacterCodes["y"] = 0x79] = "y"; - CharacterCodes[CharacterCodes["z"] = 0x7A] = "z"; - CharacterCodes[CharacterCodes["A"] = 0x41] = "A"; - CharacterCodes[CharacterCodes["B"] = 0x42] = "B"; - CharacterCodes[CharacterCodes["C"] = 0x43] = "C"; - CharacterCodes[CharacterCodes["D"] = 0x44] = "D"; - CharacterCodes[CharacterCodes["E"] = 0x45] = "E"; - CharacterCodes[CharacterCodes["F"] = 0x46] = "F"; - CharacterCodes[CharacterCodes["G"] = 0x47] = "G"; - CharacterCodes[CharacterCodes["H"] = 0x48] = "H"; - CharacterCodes[CharacterCodes["I"] = 0x49] = "I"; - CharacterCodes[CharacterCodes["J"] = 0x4A] = "J"; - CharacterCodes[CharacterCodes["K"] = 0x4B] = "K"; - CharacterCodes[CharacterCodes["L"] = 0x4C] = "L"; - CharacterCodes[CharacterCodes["M"] = 0x4D] = "M"; - CharacterCodes[CharacterCodes["N"] = 0x4E] = "N"; - CharacterCodes[CharacterCodes["O"] = 0x4F] = "O"; - CharacterCodes[CharacterCodes["P"] = 0x50] = "P"; - CharacterCodes[CharacterCodes["Q"] = 0x51] = "Q"; - CharacterCodes[CharacterCodes["R"] = 0x52] = "R"; - CharacterCodes[CharacterCodes["S"] = 0x53] = "S"; - CharacterCodes[CharacterCodes["T"] = 0x54] = "T"; - CharacterCodes[CharacterCodes["U"] = 0x55] = "U"; - CharacterCodes[CharacterCodes["V"] = 0x56] = "V"; - CharacterCodes[CharacterCodes["W"] = 0x57] = "W"; - CharacterCodes[CharacterCodes["X"] = 0x58] = "X"; - CharacterCodes[CharacterCodes["Y"] = 0x59] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 0x5a] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 0x26] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 0x2A] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 0x40] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 0x5C] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 0x7C] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 0x5E] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 0x7D] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 0x5D] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 0x29] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 0x3A] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 0x2C] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 0x2E] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 0x22] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 0x3D] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 0x21] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 0x3E] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 0x3C] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 0x2D] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 0x7B] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 0x5B] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 0x28] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 0x25] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 0x2B] = "plus"; - CharacterCodes[CharacterCodes["question"] = 0x3F] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 0x3B] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 0x27] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 0x2F] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 0x7E] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 0x08] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 0x0C] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 0x09] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 0x0B] = "verticalTab"; - })(ts.CharacterCodes || (ts.CharacterCodes = {})); - var CharacterCodes = ts.CharacterCodes; -})(ts || (ts = {})); -var ts; -(function (ts) { - function forEach(array, callback) { - var result; - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (result = callback(array[i])) - break; - } - } - return result; - } - ts.forEach = forEach; - function contains(array, value) { - if (array) { - var len = array.length; - for (var i = 0; i < len; i++) { - if (array[i] === value) { - return true; - } - } - } - return false; - } - ts.contains = contains; - function indexOf(array, value) { - if (array) { - var len = array.length; - for (var i = 0; i < len; i++) { - if (array[i] === value) { - return i; - } - } - } - return -1; - } - ts.indexOf = indexOf; - function filter(array, f) { - var result; - if (array) { - result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (f(item)) { - result.push(item); - } - } - } - return result; - } - ts.filter = filter; - function map(array, f) { - var result; - if (array) { - result = []; - var len = array.length; - for (var i = 0; i < len; i++) { - result.push(f(array[i])); - } - } - return result; - } - ts.map = map; - function concatenate(array1, array2) { - if (!array2 || !array2.length) - return array1; - if (!array1 || !array1.length) - return array2; - return array1.concat(array2); - } - ts.concatenate = concatenate; - function sum(array, prop) { - var result = 0; - for (var i = 0; i < array.length; i++) { - result += array[i][prop]; - } - return result; - } - ts.sum = sum; - function binarySearch(array, value) { - var low = 0; - var high = array.length - 1; - while (low <= high) { - var middle = low + ((high - low) >> 1); - var midValue = array[middle]; - if (midValue === value) { - return middle; - } - else if (midValue > value) { - high = middle - 1; - } - else { - low = middle + 1; - } - } - return ~low; - } - ts.binarySearch = binarySearch; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function hasProperty(map, key) { - return hasOwnProperty.call(map, key); - } - ts.hasProperty = hasProperty; - function getProperty(map, key) { - return hasOwnProperty.call(map, key) ? map[key] : undefined; - } - ts.getProperty = getProperty; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; - function clone(object) { - var result = {}; - for (var id in object) { - result[id] = object[id]; - } - return result; - } - ts.clone = clone; - function forEachValue(map, callback) { - var result; - for (var id in map) { - if (result = callback(map[id])) - break; - } - return result; - } - ts.forEachValue = forEachValue; - function forEachKey(map, callback) { - var result; - for (var id in map) { - if (result = callback(id)) - break; - } - return result; - } - ts.forEachKey = forEachKey; - function lookUp(map, key) { - return hasProperty(map, key) ? map[key] : undefined; - } - ts.lookUp = lookUp; - function mapToArray(map) { - var result = []; - for (var id in map) { - result.push(map[id]); - } - return result; - } - ts.mapToArray = mapToArray; - function arrayToMap(array, makeKey) { - var result = {}; - forEach(array, function (value) { - result[makeKey(value)] = value; - }); - return result; - } - ts.arrayToMap = arrayToMap; - function formatStringFromArgs(text, args, baseIndex) { - baseIndex = baseIndex || 0; - return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); - } - ts.localizedDiagnosticMessages = undefined; - function getLocaleSpecificMessage(message) { - if (ts.localizedDiagnosticMessages) { - message = ts.localizedDiagnosticMessages[message]; - } - return message; - } - ts.getLocaleSpecificMessage = getLocaleSpecificMessage; - function createFileDiagnostic(file, start, length, message) { - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 4) { - text = formatStringFromArgs(text, arguments, 4); - } - return { - file: file, - start: start, - length: length, - messageText: text, - category: message.category, - code: message.code - }; - } - ts.createFileDiagnostic = createFileDiagnostic; - function createCompilerDiagnostic(message) { - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 1) { - text = formatStringFromArgs(text, arguments, 1); - } - return { - file: undefined, - start: undefined, - length: undefined, - messageText: text, - category: message.category, - code: message.code - }; - } - ts.createCompilerDiagnostic = createCompilerDiagnostic; - function chainDiagnosticMessages(details, message) { - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 2) { - text = formatStringFromArgs(text, arguments, 2); - } - return { - messageText: text, - category: message.category, - code: message.code, - next: details - }; - } - ts.chainDiagnosticMessages = chainDiagnosticMessages; - function flattenDiagnosticChain(file, start, length, diagnosticChain, newLine) { - var code = diagnosticChain.code; - var category = diagnosticChain.category; - var messageText = ""; - var indent = 0; - while (diagnosticChain) { - if (indent) { - messageText += newLine; - for (var i = 0; i < indent; i++) { - messageText += " "; - } - } - messageText += diagnosticChain.messageText; - indent++; - diagnosticChain = diagnosticChain.next; - } - return { - file: file, - start: start, - length: length, - code: code, - category: category, - messageText: messageText - }; - } - ts.flattenDiagnosticChain = flattenDiagnosticChain; - function compareValues(a, b) { - if (a === b) - return 0; - if (a === undefined) - return -1; - if (b === undefined) - return 1; - return a < b ? -1 : 1; - } - ts.compareValues = compareValues; - function getDiagnosticFilename(diagnostic) { - return diagnostic.file ? diagnostic.file.filename : undefined; - } - function compareDiagnostics(d1, d2) { - return compareValues(getDiagnosticFilename(d1), getDiagnosticFilename(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareValues(d1.messageText, d2.messageText) || 0; - } - ts.compareDiagnostics = compareDiagnostics; - function deduplicateSortedDiagnostics(diagnostics) { - if (diagnostics.length < 2) { - return diagnostics; - } - var newDiagnostics = [diagnostics[0]]; - var previousDiagnostic = diagnostics[0]; - for (var i = 1; i < diagnostics.length; i++) { - var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; - if (!isDupe) { - newDiagnostics.push(currentDiagnostic); - previousDiagnostic = currentDiagnostic; - } - } - return newDiagnostics; - } - ts.deduplicateSortedDiagnostics = deduplicateSortedDiagnostics; - function normalizeSlashes(path) { - return path.replace(/\\/g, "/"); - } - ts.normalizeSlashes = normalizeSlashes; - function getRootLength(path) { - if (path.charCodeAt(0) === 47 /* slash */) { - if (path.charCodeAt(1) !== 47 /* slash */) - return 1; - var p1 = path.indexOf("/", 2); - if (p1 < 0) - return 2; - var p2 = path.indexOf("/", p1 + 1); - if (p2 < 0) - return p1 + 1; - return p2 + 1; - } - if (path.charCodeAt(1) === 58 /* colon */) { - if (path.charCodeAt(2) === 47 /* slash */) - return 3; - return 2; - } - return 0; - } - ts.getRootLength = getRootLength; - ts.directorySeparator = "/"; - function getNormalizedParts(normalizedSlashedPath, rootLength) { - var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); - var normalized = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part !== ".") { - if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { - normalized.pop(); - } - else { - normalized.push(part); - } - } - } - return normalized; - } - function normalizePath(path) { - var path = normalizeSlashes(path); - var rootLength = getRootLength(path); - var normalized = getNormalizedParts(path, rootLength); - return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); - } - ts.normalizePath = normalizePath; - function getDirectoryPath(path) { - return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator))); - } - ts.getDirectoryPath = getDirectoryPath; - function isUrl(path) { - return path && !isRootedDiskPath(path) && path.indexOf("://") !== -1; - } - ts.isUrl = isUrl; - function isRootedDiskPath(path) { - return getRootLength(path) !== 0; - } - ts.isRootedDiskPath = isRootedDiskPath; - function normalizedPathComponents(path, rootLength) { - var normalizedParts = getNormalizedParts(path, rootLength); - return [path.substr(0, rootLength)].concat(normalizedParts); - } - function getNormalizedPathComponents(path, currentDirectory) { - var path = normalizeSlashes(path); - var rootLength = getRootLength(path); - if (rootLength == 0) { - path = combinePaths(normalizeSlashes(currentDirectory), path); - rootLength = getRootLength(path); - } - return normalizedPathComponents(path, rootLength); - } - ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedPathFromPathCompoments(pathComponents) { - if (pathComponents && pathComponents.length) { - return pathComponents[0] + pathComponents.slice(1).join(ts.directorySeparator); - } - } - ts.getNormalizedPathFromPathCompoments = getNormalizedPathFromPathCompoments; - function getNormalizedPathComponentsOfUrl(url) { - var urlLength = url.length; - var rootLength = url.indexOf("://") + "://".length; - while (rootLength < urlLength) { - if (url.charCodeAt(rootLength) === 47 /* slash */) { - rootLength++; - } - else { - break; - } - } - if (rootLength === urlLength) { - return [url]; - } - var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); - if (indexOfNextSlash !== -1) { - rootLength = indexOfNextSlash + 1; - return normalizedPathComponents(url, rootLength); - } - else { - return [url + ts.directorySeparator]; - } - } - function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { - if (isUrl(pathOrUrl)) { - return getNormalizedPathComponentsOfUrl(pathOrUrl); - } - else { - return getNormalizedPathComponents(pathOrUrl, currentDirectory); - } - } - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, isAbsolutePathAnUrl) { - var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); - var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); - if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { - directoryComponents.length--; - } - for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { - if (directoryComponents[joinStartIndex] !== pathComponents[joinStartIndex]) { - break; - } - } - if (joinStartIndex) { - var relativePath = ""; - var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); - for (; joinStartIndex < directoryComponents.length; joinStartIndex++) { - if (directoryComponents[joinStartIndex] !== "") { - relativePath = relativePath + ".." + ts.directorySeparator; - } - } - return relativePath + relativePathComponents.join(ts.directorySeparator); - } - var absolutePath = getNormalizedPathFromPathCompoments(pathComponents); - if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { - absolutePath = "file:///" + absolutePath; - } - return absolutePath; - } - ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; - function getBaseFilename(path) { - var i = path.lastIndexOf(ts.directorySeparator); - return i < 0 ? path : path.substring(i + 1); - } - ts.getBaseFilename = getBaseFilename; - function combinePaths(path1, path2) { - if (!(path1 && path1.length)) - return path2; - if (!(path2 && path2.length)) - return path1; - if (path2.charAt(0) === ts.directorySeparator) - return path2; - if (path1.charAt(path1.length - 1) === ts.directorySeparator) - return path1 + path2; - return path1 + ts.directorySeparator + path2; - } - ts.combinePaths = combinePaths; - function fileExtensionIs(path, extension) { - var pathLen = path.length; - var extLen = extension.length; - return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; - } - ts.fileExtensionIs = fileExtensionIs; - function Symbol(flags, name) { - this.flags = flags; - this.name = name; - this.declarations = undefined; - } - function Type(checker, flags) { - this.flags = flags; - } - function Signature(checker) { - } - ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node() { - } - Node.prototype = { - kind: kind, - pos: 0, - end: 0, - flags: 0, - parent: undefined - }; - return Node; - }, - getSymbolConstructor: function () { return Symbol; }, - getTypeConstructor: function () { return Type; }, - getSignatureConstructor: function () { return Signature; } - }; - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(ts.AssertionLevel || (ts.AssertionLevel = {})); - var AssertionLevel = ts.AssertionLevel; - (function (Debug) { - var currentAssertionLevel = 0 /* None */; - function shouldAssert(level) { - return currentAssertionLevel >= level; - } - Debug.shouldAssert = shouldAssert; - function assert(expression, message, verboseDebugInfo) { - if (!expression) { - var verboseDebugString = ""; - if (verboseDebugInfo) { - verboseDebugString = "\r\nVerbose Debug Information: " + verboseDebugInfo(); - } - throw new Error("Debug Failure. False expression: " + (message || "") + verboseDebugString); - } - } - Debug.assert = assert; - function fail(message) { - Debug.assert(false, message); - } - Debug.fail = fail; - })(ts.Debug || (ts.Debug = {})); - var Debug = ts.Debug; -})(ts || (ts = {})); -var ts; -(function (ts) { - var nodeConstructors = new Array(180 /* Count */); + var nodeConstructors = new Array(199 /* Count */); function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -2278,19 +2023,8 @@ var ts; node.flags = flags; return node; } - var moduleExtensions = [".d.ts", ".ts", ".js"]; - function getModuleNameFromFilename(filename) { - for (var i = 0; i < moduleExtensions.length; i++) { - var ext = moduleExtensions[i]; - var len = filename.length - ext.length; - if (len > 0 && filename.substr(len) === ext) - return filename.substr(0, len); - } - return filename; - } - ts.getModuleNameFromFilename = getModuleNameFromFilename; function getSourceFileOfNode(node) { - while (node && node.kind !== 177 /* SourceFile */) + while (node && node.kind !== 196 /* SourceFile */) node = node.parent; return node; } @@ -2305,19 +2039,22 @@ var ts; return node.pos; } ts.getStartPosOfNode = getStartPosOfNode; - function getTokenPosOfNode(node) { - return ts.skipTrivia(getSourceFileOfNode(node).text, node.pos); + function getTokenPosOfNode(node, sourceFile) { + if (node.pos === node.end) { + return node.pos; + } + return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; - function getSourceTextOfNodeFromSourceText(sourceText, node) { + function getTextOfNodeFromSourceText(sourceText, node) { return sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); } - ts.getSourceTextOfNodeFromSourceText = getSourceTextOfNodeFromSourceText; - function getSourceTextOfNode(node) { + ts.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText; + function getTextOfNode(node) { var text = getSourceFileOfNode(node).text; return text.substring(ts.skipTrivia(text, node.pos), node.end); } - ts.getSourceTextOfNode = getSourceTextOfNode; + ts.getTextOfNode = getTextOfNode; function escapeIdentifier(identifier) { return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; } @@ -2326,14 +2063,14 @@ var ts; return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; } ts.unescapeIdentifier = unescapeIdentifier; - function identifierToString(identifier) { - return identifier.kind === 111 /* Missing */ ? "(Missing)" : getSourceTextOfNode(identifier); + function declarationNameToString(name) { + return name.kind === 120 /* Missing */ ? "(Missing)" : getTextOfNode(name); } - ts.identifierToString = identifierToString; + ts.declarationNameToString = declarationNameToString; function createDiagnosticForNode(node, message, arg0, arg1, arg2) { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); - var start = ts.skipTrivia(file.text, node.pos); + var start = node.kind === 120 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); var length = node.end - start; return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); } @@ -2349,12 +2086,12 @@ var ts; function getErrorSpanForNode(node) { var errorSpan; switch (node.kind) { - case 166 /* VariableDeclaration */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 172 /* ModuleDeclaration */: - case 171 /* EnumDeclaration */: - case 176 /* EnumMember */: + case 184 /* VariableDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 191 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + case 195 /* EnumMember */: errorSpan = node.name; break; } @@ -2365,28 +2102,37 @@ var ts; return file.externalModuleIndicator !== undefined; } ts.isExternalModule = isExternalModule; + function isDeclarationFile(file) { + return (file.flags & 1024 /* DeclarationFile */) !== 0; + } + ts.isDeclarationFile = isDeclarationFile; + function isConstEnumDeclaration(node) { + return (node.flags & 4096 /* Const */) !== 0; + } + ts.isConstEnumDeclaration = isConstEnumDeclaration; function isPrologueDirective(node) { - return node.kind === 146 /* ExpressionStatement */ && node.expression.kind === 3 /* StringLiteral */; + return node.kind === 164 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 55 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); + return node.kind === 63 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); } function isUseStrictPrologueDirective(node) { ts.Debug.assert(isPrologueDirective(node)); return node.expression.text === "use strict"; } - function getLeadingCommentsOfNode(node, sourceFileOfNode) { - if (node.kind === 114 /* Parameter */ || node.kind === 113 /* TypeParameter */) { - return ts.concatenate(ts.getTrailingComments(sourceFileOfNode.text, node.pos), ts.getLeadingComments(sourceFileOfNode.text, node.pos)); + function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { + sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); + if (node.kind === 123 /* Parameter */ || node.kind === 122 /* TypeParameter */) { + return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { - return ts.getLeadingComments(sourceFileOfNode.text, node.pos); + return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); } } - ts.getLeadingCommentsOfNode = getLeadingCommentsOfNode; + ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJsDocComments(node, sourceFileOfNode) { - return ts.filter(getLeadingCommentsOfNode(node, sourceFileOfNode), function (comment) { return isJsDocComment(comment); }); + return ts.filter(getLeadingCommentRangesOfNode(node, sourceFileOfNode), function (comment) { return isJsDocComment(comment); }); function isJsDocComment(comment) { return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47 /* slash */; } @@ -2413,218 +2159,519 @@ var ts; if (!node) return; switch (node.kind) { - case 112 /* QualifiedName */: + case 121 /* QualifiedName */: return child(node.left) || child(node.right); - case 113 /* TypeParameter */: + case 122 /* TypeParameter */: return child(node.name) || child(node.constraint); - case 114 /* Parameter */: + case 123 /* Parameter */: return child(node.name) || child(node.type) || child(node.initializer); - case 115 /* Property */: - case 129 /* PropertyAssignment */: + case 124 /* Property */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: return child(node.name) || child(node.type) || child(node.initializer); - case 120 /* CallSignature */: - case 121 /* ConstructSignature */: - case 122 /* IndexSignature */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return children(node.typeParameters) || children(node.parameters) || child(node.type); - case 116 /* Method */: - case 117 /* Constructor */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 136 /* FunctionExpression */: - case 167 /* FunctionDeclaration */: - case 137 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); - case 123 /* TypeReference */: + case 132 /* TypeReference */: return child(node.typeName) || children(node.typeArguments); - case 124 /* TypeQuery */: + case 135 /* TypeQuery */: return child(node.exprName); - case 125 /* TypeLiteral */: + case 136 /* TypeLiteral */: return children(node.members); - case 126 /* ArrayType */: + case 137 /* ArrayType */: return child(node.elementType); - case 127 /* ArrayLiteral */: + case 138 /* TupleType */: + return children(node.elementTypes); + case 139 /* UnionType */: + return children(node.types); + case 140 /* ParenType */: + return child(node.type); + case 141 /* ArrayLiteral */: return children(node.elements); - case 128 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return children(node.properties); - case 130 /* PropertyAccess */: + case 145 /* PropertyAccess */: return child(node.left) || child(node.right); - case 131 /* IndexedAccess */: + case 146 /* IndexedAccess */: return child(node.object) || child(node.index); - case 132 /* CallExpression */: - case 133 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 134 /* TypeAssertion */: + case 149 /* TaggedTemplateExpression */: + return child(node.tag) || child(node.template); + case 150 /* TypeAssertion */: return child(node.type) || child(node.operand); - case 135 /* ParenExpression */: + case 151 /* ParenExpression */: return child(node.expression); - case 138 /* PrefixOperator */: - case 139 /* PostfixOperator */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: return child(node.operand); - case 140 /* BinaryExpression */: + case 156 /* BinaryExpression */: return child(node.left) || child(node.right); - case 141 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 143 /* Block */: - case 162 /* TryBlock */: - case 164 /* FinallyBlock */: - case 168 /* FunctionBlock */: - case 173 /* ModuleBlock */: - case 177 /* SourceFile */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 196 /* SourceFile */: return children(node.statements); - case 144 /* VariableStatement */: + case 162 /* VariableStatement */: return children(node.declarations); - case 146 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return child(node.expression); - case 147 /* IfStatement */: + case 165 /* IfStatement */: return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 148 /* DoStatement */: + case 166 /* DoStatement */: return child(node.statement) || child(node.expression); - case 149 /* WhileStatement */: + case 167 /* WhileStatement */: return child(node.expression) || child(node.statement); - case 150 /* ForStatement */: + case 168 /* ForStatement */: return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 151 /* ForInStatement */: - return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 152 /* ContinueStatement */: - case 153 /* BreakStatement */: + case 169 /* ForInStatement */: + return children(node.declarations) || child(node.variable) || child(node.expression) || child(node.statement); + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return child(node.label); - case 154 /* ReturnStatement */: + case 172 /* ReturnStatement */: return child(node.expression); - case 155 /* WithStatement */: + case 173 /* WithStatement */: return child(node.expression) || child(node.statement); - case 156 /* SwitchStatement */: + case 174 /* SwitchStatement */: return child(node.expression) || children(node.clauses); - case 157 /* CaseClause */: - case 158 /* DefaultClause */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: return child(node.expression) || children(node.statements); - case 159 /* LabelledStatement */: + case 177 /* LabeledStatement */: return child(node.label) || child(node.statement); - case 160 /* ThrowStatement */: + case 178 /* ThrowStatement */: return child(node.expression); - case 161 /* TryStatement */: + case 179 /* TryStatement */: return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 163 /* CatchBlock */: + case 181 /* CatchBlock */: return child(node.variable) || children(node.statements); - case 166 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return child(node.name) || child(node.type) || child(node.initializer); - case 169 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 170 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 171 /* EnumDeclaration */: + case 189 /* TypeAliasDeclaration */: + return child(node.name) || child(node.type); + case 190 /* EnumDeclaration */: return child(node.name) || children(node.members); - case 176 /* EnumMember */: + case 195 /* EnumMember */: return child(node.name) || child(node.initializer); - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return child(node.name) || child(node.body); - case 174 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 175 /* ExportAssignment */: + case 194 /* ExportAssignment */: return child(node.exportName); + case 158 /* TemplateExpression */: + return child(node.head) || children(node.templateSpans); + case 159 /* TemplateSpan */: + return child(node.expression) || child(node.literal); } } ts.forEachChild = forEachChild; + function forEachReturnStatement(body, visitor) { + return traverse(body); + function traverse(node) { + switch (node.kind) { + case 172 /* ReturnStatement */: + return visitor(node); + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + return forEachChild(node, traverse); + } + } + } + ts.forEachReturnStatement = forEachReturnStatement; + function isAnyFunction(node) { + if (node) { + switch (node.kind) { + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + return true; + } + } + return false; + } + ts.isAnyFunction = isAnyFunction; + function getContainingFunction(node) { + while (true) { + node = node.parent; + if (!node || isAnyFunction(node)) { + return node; + } + } + } + ts.getContainingFunction = getContainingFunction; + function getThisContainer(node, includeArrowFunctions) { + while (true) { + node = node.parent; + if (!node) { + return undefined; + } + switch (node.kind) { + case 153 /* ArrowFunction */: + if (!includeArrowFunctions) { + continue; + } + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 191 /* ModuleDeclaration */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 190 /* EnumDeclaration */: + case 196 /* SourceFile */: + return node; + } + } + } + ts.getThisContainer = getThisContainer; + function getSuperContainer(node) { + while (true) { + node = node.parent; + if (!node) { + return undefined; + } + switch (node.kind) { + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + return node; + } + } + } + ts.getSuperContainer = getSuperContainer; + function isExpression(node) { + switch (node.kind) { + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: + case 8 /* RegularExpressionLiteral */: + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 149 /* TaggedTemplateExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 156 /* BinaryExpression */: + case 157 /* ConditionalExpression */: + case 158 /* TemplateExpression */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 160 /* OmittedExpression */: + return true; + case 121 /* QualifiedName */: + while (node.parent.kind === 121 /* QualifiedName */) + node = node.parent; + return node.parent.kind === 135 /* TypeQuery */; + case 63 /* Identifier */: + if (node.parent.kind === 135 /* TypeQuery */) { + return true; + } + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + var parent = node.parent; + switch (parent.kind) { + case 184 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: + case 195 /* EnumMember */: + case 143 /* PropertyAssignment */: + return parent.initializer === node; + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 178 /* ThrowStatement */: + case 174 /* SwitchStatement */: + return parent.expression === node; + case 168 /* ForStatement */: + return parent.initializer === node || parent.condition === node || parent.iterator === node; + case 169 /* ForInStatement */: + return parent.variable === node || parent.expression === node; + case 150 /* TypeAssertion */: + return node === parent.operand; + case 159 /* TemplateSpan */: + return node === parent.expression; + default: + if (isExpression(parent)) { + return true; + } + } + } + return false; + } + ts.isExpression = isExpression; function hasRestParameters(s) { return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & 8 /* Rest */) !== 0; } ts.hasRestParameters = hasRestParameters; + function isLiteralKind(kind) { + return 6 /* FirstLiteralToken */ <= kind && kind <= 9 /* LastLiteralToken */; + } + ts.isLiteralKind = isLiteralKind; + function isTextualLiteralKind(kind) { + return kind === 7 /* StringLiteral */ || kind === 9 /* NoSubstitutionTemplateLiteral */; + } + ts.isTextualLiteralKind = isTextualLiteralKind; + function isTemplateLiteralKind(kind) { + return 9 /* FirstTemplateToken */ <= kind && kind <= 12 /* LastTemplateToken */; + } + ts.isTemplateLiteralKind = isTemplateLiteralKind; function isInAmbientContext(node) { while (node) { - if (node.flags & (2 /* Ambient */ | 512 /* DeclarationFile */)) + if (node.flags & (2 /* Ambient */ | 1024 /* DeclarationFile */)) return true; node = node.parent; } return false; } ts.isInAmbientContext = isInAmbientContext; - var ParsingContext; - (function (ParsingContext) { - ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; - ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; - ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; - ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; - ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; - ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; - ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; - ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["BaseTypeReferences"] = 8] = "BaseTypeReferences"; - ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; - ParsingContext[ParsingContext["ArgumentExpressions"] = 10] = "ArgumentExpressions"; - ParsingContext[ParsingContext["ObjectLiteralMembers"] = 11] = "ObjectLiteralMembers"; - ParsingContext[ParsingContext["ArrayLiteralMembers"] = 12] = "ArrayLiteralMembers"; - ParsingContext[ParsingContext["Parameters"] = 13] = "Parameters"; - ParsingContext[ParsingContext["TypeParameters"] = 14] = "TypeParameters"; - ParsingContext[ParsingContext["TypeArguments"] = 15] = "TypeArguments"; - ParsingContext[ParsingContext["Count"] = 16] = "Count"; - })(ParsingContext || (ParsingContext = {})); - var Tristate; - (function (Tristate) { - Tristate[Tristate["False"] = 0] = "False"; - Tristate[Tristate["True"] = 1] = "True"; - Tristate[Tristate["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); + function isDeclaration(node) { + switch (node.kind) { + case 122 /* TypeParameter */: + case 123 /* Parameter */: + case 184 /* VariableDeclaration */: + case 124 /* Property */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + case 195 /* EnumMember */: + case 125 /* Method */: + case 185 /* FunctionDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: + return true; + } + return false; + } + ts.isDeclaration = isDeclaration; + function isStatement(n) { + switch (n.kind) { + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 183 /* DebuggerStatement */: + case 166 /* DoStatement */: + case 164 /* ExpressionStatement */: + case 163 /* EmptyStatement */: + case 169 /* ForInStatement */: + case 168 /* ForStatement */: + case 165 /* IfStatement */: + case 177 /* LabeledStatement */: + case 172 /* ReturnStatement */: + case 174 /* SwitchStatement */: + case 92 /* ThrowKeyword */: + case 179 /* TryStatement */: + case 162 /* VariableStatement */: + case 167 /* WhileStatement */: + case 173 /* WithStatement */: + case 194 /* ExportAssignment */: + return true; + default: + return false; + } + } + ts.isStatement = isStatement; + function isDeclarationOrFunctionExpressionOrCatchVariableName(name) { + if (name.kind !== 63 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { + return false; + } + var parent = name.parent; + if (isDeclaration(parent) || parent.kind === 152 /* FunctionExpression */) { + return parent.name === name; + } + if (parent.kind === 181 /* CatchBlock */) { + return parent.variable === name; + } + return false; + } + ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; + function getAncestor(node, kind) { + switch (kind) { + case 187 /* ClassDeclaration */: + while (node) { + switch (node.kind) { + case 187 /* ClassDeclaration */: + return node; + case 190 /* EnumDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: + return undefined; + default: + node = node.parent; + continue; + } + } + break; + default: + while (node) { + if (node.kind === kind) { + return node; + } + node = node.parent; + } + break; + } + return undefined; + } + ts.getAncestor = getAncestor; function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 1 /* ModuleElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 2 /* BlockStatements */: - return ts.Diagnostics.Statement_expected; - case 3 /* SwitchClauses */: - return ts.Diagnostics.case_or_default_expected; - case 4 /* SwitchClauseStatements */: - return ts.Diagnostics.Statement_expected; - case 5 /* TypeMembers */: - return ts.Diagnostics.Property_or_signature_expected; - case 6 /* ClassMembers */: - return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7 /* EnumMembers */: - return ts.Diagnostics.Enum_member_expected; - case 8 /* BaseTypeReferences */: - return ts.Diagnostics.Type_reference_expected; - case 9 /* VariableDeclarations */: - return ts.Diagnostics.Variable_declaration_expected; - case 10 /* ArgumentExpressions */: - return ts.Diagnostics.Argument_expression_expected; - case 11 /* ObjectLiteralMembers */: - return ts.Diagnostics.Property_assignment_expected; - case 12 /* ArrayLiteralMembers */: - return ts.Diagnostics.Expression_or_comma_expected; - case 13 /* Parameters */: - return ts.Diagnostics.Parameter_declaration_expected; - case 14 /* TypeParameters */: - return ts.Diagnostics.Type_parameter_declaration_expected; - case 15 /* TypeArguments */: - return ts.Diagnostics.Type_argument_expected; + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* ModuleElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* BlockStatements */: return ts.Diagnostics.Statement_expected; + case 3 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 4 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; + case 5 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 6 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 7 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 8 /* BaseTypeReferences */: return ts.Diagnostics.Type_reference_expected; + case 9 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 10 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 11 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 12 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 13 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 14 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 15 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 16 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; } } ; - var LookAheadMode; - (function (LookAheadMode) { - LookAheadMode[LookAheadMode["NotLookingAhead"] = 0] = "NotLookingAhead"; - LookAheadMode[LookAheadMode["NoErrorYet"] = 1] = "NoErrorYet"; - LookAheadMode[LookAheadMode["Error"] = 2] = "Error"; - })(LookAheadMode || (LookAheadMode = {})); - var ModifierContext; - (function (ModifierContext) { - ModifierContext[ModifierContext["SourceElements"] = 0] = "SourceElements"; - ModifierContext[ModifierContext["ModuleElements"] = 1] = "ModuleElements"; - ModifierContext[ModifierContext["ClassMembers"] = 2] = "ClassMembers"; - ModifierContext[ModifierContext["Parameters"] = 3] = "Parameters"; - })(ModifierContext || (ModifierContext = {})); - var TrailingCommaBehavior; - (function (TrailingCommaBehavior) { - TrailingCommaBehavior[TrailingCommaBehavior["Disallow"] = 0] = "Disallow"; - TrailingCommaBehavior[TrailingCommaBehavior["Allow"] = 1] = "Allow"; - TrailingCommaBehavior[TrailingCommaBehavior["Preserve"] = 2] = "Preserve"; - })(TrailingCommaBehavior || (TrailingCommaBehavior = {})); - var ControlBlockContext; - (function (ControlBlockContext) { - ControlBlockContext[ControlBlockContext["NotNested"] = 0] = "NotNested"; - ControlBlockContext[ControlBlockContext["Nested"] = 1] = "Nested"; - ControlBlockContext[ControlBlockContext["CrossingFunctionBoundary"] = 2] = "CrossingFunctionBoundary"; - })(ControlBlockContext || (ControlBlockContext = {})); + function getFileReferenceFromReferencePath(comment, commentRange) { + var simpleReferenceRegEx = /^\/\/\/\s*/gim; + if (simpleReferenceRegEx.exec(comment)) { + if (isNoDefaultLibRegEx.exec(comment)) { + return { + isNoDefaultLib: true + }; + } + else { + var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); + if (matchResult) { + var start = commentRange.pos; + var end = commentRange.end; + return { + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, + isNoDefaultLib: false + }; + } + else { + return { + diagnostic: ts.Diagnostics.Invalid_reference_directive_syntax, + isNoDefaultLib: false + }; + } + } + } + return undefined; + } + ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; + function isKeyword(token) { + return 64 /* FirstKeyword */ <= token && token <= 119 /* LastKeyword */; + } + ts.isKeyword = isKeyword; + function isTrivia(token) { + return 2 /* FirstTriviaToken */ <= token && token <= 5 /* LastTriviaToken */; + } + ts.isTrivia = isTrivia; + function isUnterminatedTemplateEnd(node) { + ts.Debug.assert(node.kind === 9 /* NoSubstitutionTemplateLiteral */ || node.kind === 12 /* TemplateTail */); + var sourceText = getSourceFileOfNode(node).text; + if (node.end !== sourceText.length) { + return false; + } + return sourceText.charCodeAt(node.end - 1) !== 96 /* backtick */ || node.text.length === 0; + } + ts.isUnterminatedTemplateEnd = isUnterminatedTemplateEnd; + function isModifier(token) { + switch (token) { + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + case 76 /* ExportKeyword */: + case 112 /* DeclareKeyword */: + return true; + } + return false; + } + ts.isModifier = isModifier; + function modifierToFlag(token) { + switch (token) { + case 107 /* StaticKeyword */: return 128 /* Static */; + case 106 /* PublicKeyword */: return 16 /* Public */; + case 105 /* ProtectedKeyword */: return 64 /* Protected */; + case 104 /* PrivateKeyword */: return 32 /* Private */; + case 76 /* ExportKeyword */: return 1 /* Export */; + case 112 /* DeclareKeyword */: return 2 /* Ambient */; + } + return 0; + } function createSourceFile(filename, sourceText, languageVersion, version, isOpen) { if (isOpen === void 0) { isOpen = false; } var file; @@ -2638,118 +2685,26 @@ var ts; var lineStarts; var isInStrictMode = false; var lookAheadMode = 0 /* NotLookingAhead */; - var inAmbientContext = false; - var inFunctionBody = false; - var inSwitchStatement = 0 /* NotNested */; - var inIterationStatement = 0 /* NotNested */; - var labelledStatementInfo = (function () { - var functionBoundarySentinel; - var currentLabelSet; - var labelSetStack; - var isIterationStack; - function addLabel(label) { - if (!currentLabelSet) { - currentLabelSet = {}; - } - currentLabelSet[label.text] = true; - } - function pushCurrentLabelSet(isIterationStatement) { - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - ts.Debug.assert(currentLabelSet !== undefined); - labelSetStack.push(currentLabelSet); - isIterationStack.push(isIterationStatement); - currentLabelSet = undefined; - } - function pushFunctionBoundary() { - if (!functionBoundarySentinel) { - functionBoundarySentinel = {}; - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - } - ts.Debug.assert(currentLabelSet === undefined); - labelSetStack.push(functionBoundarySentinel); - isIterationStack.push(false); - } - function pop() { - ts.Debug.assert(labelSetStack.length && isIterationStack.length && currentLabelSet === undefined); - labelSetStack.pop(); - isIterationStack.pop(); - } - function nodeIsNestedInLabel(label, requireIterationStatement, stopAtFunctionBoundary) { - if (!requireIterationStatement && currentLabelSet && ts.hasProperty(currentLabelSet, label.text)) { - return 1 /* Nested */; - } - if (!labelSetStack) { - return 0 /* NotNested */; - } - var crossedFunctionBoundary = false; - for (var i = labelSetStack.length - 1; i >= 0; i--) { - var labelSet = labelSetStack[i]; - if (labelSet === functionBoundarySentinel) { - if (stopAtFunctionBoundary) { - break; - } - else { - crossedFunctionBoundary = true; - continue; - } - } - if (requireIterationStatement && isIterationStack[i] === false) { - continue; - } - if (ts.hasProperty(labelSet, label.text)) { - return crossedFunctionBoundary ? 2 /* CrossingFunctionBoundary */ : 1 /* Nested */; - } - } - return 0 /* NotNested */; - } - return { - addLabel: addLabel, - pushCurrentLabelSet: pushCurrentLabelSet, - pushFunctionBoundary: pushFunctionBoundary, - pop: pop, - nodeIsNestedInLabel: nodeIsNestedInLabel - }; - })(); - function getLineAndCharacterlFromSourcePosition(position) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getLineAndCharacterOfPosition(lineStarts, position); + function getLineStarts() { + return lineStarts || (lineStarts = ts.computeLineStarts(sourceText)); + } + function getLineAndCharacterFromSourcePosition(position) { + return ts.getLineAndCharacterOfPosition(getLineStarts(), position); } function getPositionFromSourceLineAndCharacter(line, character) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getPositionFromLineAndCharacter(lineStarts, line, character); + return ts.getPositionFromLineAndCharacter(getLineStarts(), line, character); } function error(message, arg0, arg1, arg2) { var start = scanner.getTokenPos(); var length = scanner.getTextPos() - start; errorAtPos(start, length, message, arg0, arg1, arg2); } - function grammarErrorOnNode(node, message, arg0, arg1, arg2) { - var span = getErrorSpanForNode(node); - var start = ts.skipTrivia(file.text, span.pos); - var length = span.end - start; - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function reportInvalidUseInStrictMode(node) { - var name = sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); - grammarErrorOnNode(node, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, name); - } - function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } function errorAtPos(start, length, message, arg0, arg1, arg2) { - var lastErrorPos = file.syntacticErrors.length ? file.syntacticErrors[file.syntacticErrors.length - 1].start : -1; + var lastErrorPos = file.parseDiagnostics.length ? file.parseDiagnostics[file.parseDiagnostics.length - 1].start : -1; if (start !== lastErrorPos) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + var diagnostic = ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); + diagnostic.isParseError = true; + file.parseDiagnostics.push(diagnostic); } if (lookAheadMode === 1 /* NoErrorYet */) { lookAheadMode = 2 /* Error */; @@ -2781,9 +2736,12 @@ var ts; function reScanSlashToken() { return token = scanner.reScanSlashToken(); } + function reScanTemplateToken() { + return token = scanner.reScanTemplateToken(); + } function lookAheadHelper(callback, alwaysResetState) { var saveToken = token; - var saveSyntacticErrorsLength = file.syntacticErrors.length; + var saveSyntacticErrorsLength = file.parseDiagnostics.length; var saveLookAheadMode = lookAheadMode; lookAheadMode = 1 /* NoErrorYet */; var result = callback(); @@ -2794,7 +2752,7 @@ var ts; lookAheadMode = saveLookAheadMode; if (!result || alwaysResetState) { token = saveToken; - file.syntacticErrors.length = saveSyntacticErrorsLength; + file.parseDiagnostics.length = saveSyntacticErrorsLength; } return result; } @@ -2810,7 +2768,7 @@ var ts; return scanner.tryScan(function () { return lookAheadHelper(callback, false); }); } function isIdentifier() { - return token === 55 /* Identifier */ || (isInStrictMode ? token > ts.SyntaxKind.LastFutureReservedWord : token > ts.SyntaxKind.LastReservedWord); + return token === 63 /* Identifier */ || (isInStrictMode ? token > 108 /* LastFutureReservedWord */ : token > 99 /* LastReservedWord */); } function parseExpected(t) { if (token === t) { @@ -2828,14 +2786,14 @@ var ts; return false; } function canParseSemicolon() { - if (token === 13 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { return true; } - return token === 6 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); + return token === 14 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); } function parseSemicolon() { if (canParseSemicolon()) { - if (token === 13 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { nextToken(); } } @@ -2846,70 +2804,65 @@ var ts; function createNode(kind, pos) { nodeCount++; var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(); - if (!(pos >= 0)) + if (!(pos >= 0)) { pos = scanner.getStartPos(); + } node.pos = pos; node.end = pos; return node; } function finishNode(node) { node.end = scanner.getStartPos(); + if (isInStrictMode) { + node.flags |= 8192 /* ParsedInStrictMode */; + } return node; } - function createMissingNode() { - return createNode(111 /* Missing */); + function createMissingNode(pos) { + return createNode(120 /* Missing */, pos); + } + function internIdentifier(text) { + text = escapeIdentifier(text); + return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); } function createIdentifier(isIdentifier) { identifierCount++; if (isIdentifier) { - var node = createNode(55 /* Identifier */); - var text = escapeIdentifier(scanner.getTokenValue()); - node.text = ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); + var node = createNode(63 /* Identifier */); + node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } error(ts.Diagnostics.Identifier_expected); - return createMissingNode(); + var node = createMissingNode(); + node.text = ""; + return node; } function parseIdentifier() { return createIdentifier(isIdentifier()); } function parseIdentifierName() { - return createIdentifier(token >= 55 /* Identifier */); + return createIdentifier(token >= 63 /* Identifier */); } function isPropertyName() { - return token >= 55 /* Identifier */ || token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */; + return token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; } function parsePropertyName() { - if (token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */) { - return parsePrimaryExpression(); + if (token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { + return parseLiteralNode(true); } return parseIdentifierName(); } - function isKeyword(token) { - return ts.SyntaxKind.FirstKeyword <= token && token <= ts.SyntaxKind.LastKeyword; - } - function isModifier(token) { - switch (token) { - case 98 /* PublicKeyword */: - case 96 /* PrivateKeyword */: - case 99 /* StaticKeyword */: - case 68 /* ExportKeyword */: - case 104 /* DeclareKeyword */: - return true; - } - return false; - } function parseContextualModifier(t) { return token === t && tryParse(function () { nextToken(); - return token === 9 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function parseAnyContextualModifier() { return isModifier(token) && tryParse(function () { nextToken(); - return token === 9 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function isListElement(kind, inErrorRecovery) { @@ -2921,27 +2874,28 @@ var ts; case 4 /* SwitchClauseStatements */: return isStatement(inErrorRecovery); case 3 /* SwitchClauses */: - return token === 57 /* CaseKeyword */ || token === 63 /* DefaultKeyword */; + return token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 5 /* TypeMembers */: - return isTypeMember(); + return isStartOfTypeMember(); case 6 /* ClassMembers */: return lookAhead(isClassMemberStart); case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: return isPropertyName(); case 8 /* BaseTypeReferences */: - return isIdentifier() && ((token !== 69 /* ExtendsKeyword */ && token !== 92 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); + return isIdentifier() && ((token !== 77 /* ExtendsKeyword */ && token !== 100 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); case 9 /* VariableDeclarations */: case 14 /* TypeParameters */: return isIdentifier(); case 10 /* ArgumentExpressions */: - return isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 12 /* ArrayLiteralMembers */: - return token === 14 /* CommaToken */ || isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 13 /* Parameters */: - return isParameter(); + return isStartOfParameter(); case 15 /* TypeArguments */: - return isType(); + case 16 /* TupleElementTypes */: + return token === 22 /* CommaToken */ || isStartOfType(); } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } @@ -2957,39 +2911,40 @@ var ts; case 6 /* ClassMembers */: case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: - return token === 6 /* CloseBraceToken */; + return token === 14 /* CloseBraceToken */; case 4 /* SwitchClauseStatements */: - return token === 6 /* CloseBraceToken */ || token === 57 /* CaseKeyword */ || token === 63 /* DefaultKeyword */; + return token === 14 /* CloseBraceToken */ || token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 8 /* BaseTypeReferences */: - return token === 5 /* OpenBraceToken */ || token === 69 /* ExtendsKeyword */ || token === 92 /* ImplementsKeyword */; + return token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 9 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); case 14 /* TypeParameters */: - return token === 16 /* GreaterThanToken */ || token === 7 /* OpenParenToken */ || token === 5 /* OpenBraceToken */ || token === 69 /* ExtendsKeyword */ || token === 92 /* ImplementsKeyword */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */ || token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 10 /* ArgumentExpressions */: - return token === 8 /* CloseParenToken */ || token === 13 /* SemicolonToken */; + return token === 16 /* CloseParenToken */ || token === 21 /* SemicolonToken */; case 12 /* ArrayLiteralMembers */: - return token === 10 /* CloseBracketToken */; + case 16 /* TupleElementTypes */: + return token === 18 /* CloseBracketToken */; case 13 /* Parameters */: - return token === 8 /* CloseParenToken */ || token === 10 /* CloseBracketToken */ || token === 5 /* OpenBraceToken */; + return token === 16 /* CloseParenToken */ || token === 18 /* CloseBracketToken */ || token === 13 /* OpenBraceToken */; case 15 /* TypeArguments */: - return token === 16 /* GreaterThanToken */ || token === 7 /* OpenParenToken */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */; } } function isVariableDeclaratorListTerminator() { if (canParseSemicolon()) { return true; } - if (token === 76 /* InKeyword */) { + if (token === 84 /* InKeyword */) { return true; } - if (token === 23 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return true; } return false; } function isInSomeParsingContext() { - for (var kind = 0; kind < 16 /* Count */; kind++) { + for (var kind = 0; kind < 17 /* Count */; kind++) { if (parsingContext & (1 << kind)) { if (isListElement(kind, true) || isListTerminator(kind)) { return true; @@ -3033,18 +2988,17 @@ var ts; parsingContext = saveParsingContext; return result; } - function parseDelimitedList(kind, parseElement, trailingCommaBehavior) { + function parseDelimitedList(kind, parseElement) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; var result = []; result.pos = getNodePos(); - var errorCountBeforeParsingList = file.syntacticErrors.length; var commaStart = -1; while (true) { if (isListElement(kind, false)) { result.push(parseElement()); commaStart = scanner.getTokenPos(); - if (parseOptional(14 /* CommaToken */)) { + if (parseOptional(22 /* CommaToken */)) { continue; } commaStart = -1; @@ -3054,16 +3008,6 @@ var ts; error(ts.Diagnostics._0_expected, ","); } else if (isListTerminator(kind)) { - if (commaStart >= 0) { - if (trailingCommaBehavior === 0 /* Disallow */) { - if (file.syntacticErrors.length === errorCountBeforeParsingList) { - grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, ts.Diagnostics.Trailing_comma_not_allowed); - } - } - else if (trailingCommaBehavior === 2 /* Preserve */) { - result.push(createNode(142 /* OmittedExpression */)); - } - } break; } else { @@ -3074,6 +3018,9 @@ var ts; nextToken(); } } + if (commaStart >= 0) { + result.hasTrailingComma = true; + } result.end = getNodeEnd(); parsingContext = saveParsingContext; return result; @@ -3093,7 +3040,7 @@ var ts; } function parseBracketedList(kind, parseElement, startToken, endToken) { if (parseExpected(startToken)) { - var result = parseDelimitedList(kind, parseElement, 0 /* Disallow */); + var result = parseDelimitedList(kind, parseElement); parseExpected(endToken); return result; } @@ -3101,8 +3048,8 @@ var ts; } function parseEntityName(allowReservedWords) { var entity = parseIdentifier(); - while (parseOptional(11 /* DotToken */)) { - var node = createNode(112 /* QualifiedName */, entity.pos); + while (parseOptional(19 /* DotToken */)) { + var node = createNode(121 /* QualifiedName */, entity.pos); node.left = entity; node.right = allowReservedWords ? parseIdentifierName() : parseIdentifier(); entity = finishNode(node); @@ -3114,100 +3061,131 @@ var ts; nextToken(); return finishNode(node); } - function parseLiteralNode() { + function parseTemplateExpression() { + var template = createNode(158 /* TemplateExpression */); + template.head = parseLiteralNode(); + ts.Debug.assert(template.head.kind === 10 /* TemplateHead */, "Template head has wrong token kind"); + var templateSpans = []; + templateSpans.pos = getNodePos(); + do { + templateSpans.push(parseTemplateSpan()); + } while (templateSpans[templateSpans.length - 1].literal.kind === 11 /* TemplateMiddle */); + templateSpans.end = getNodeEnd(); + template.templateSpans = templateSpans; + return finishNode(template); + } + function parseTemplateSpan() { + var span = createNode(159 /* TemplateSpan */); + span.expression = parseExpression(false); + var literal; + if (token === 14 /* CloseBraceToken */) { + reScanTemplateToken(); + literal = parseLiteralNode(); + } + else { + error(ts.Diagnostics.Invalid_template_literal_expected); + literal = createMissingNode(); + literal.text = ""; + } + span.literal = literal; + return finishNode(span); + } + function parseLiteralNode(internName) { var node = createNode(token); - node.text = scanner.getTokenValue(); + var text = scanner.getTokenValue(); + node.text = internName ? internIdentifier(text) : text; var tokenPos = scanner.getTokenPos(); nextToken(); finishNode(node); - if (node.kind === 2 /* NumericLiteral */ && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - if (isInStrictMode) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= 1 /* ES5 */) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } + if (node.kind === 6 /* NumericLiteral */ && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { + node.flags |= 16384 /* OctalLiteral */; } return node; } function parseStringLiteral() { - if (token === 3 /* StringLiteral */) - return parseLiteralNode(); + if (token === 7 /* StringLiteral */) { + return parseLiteralNode(true); + } error(ts.Diagnostics.String_literal_expected); return createMissingNode(); } function parseTypeReference() { - var node = createNode(123 /* TypeReference */); + var node = createNode(132 /* TypeReference */); node.typeName = parseEntityName(false); - if (!scanner.hasPrecedingLineBreak() && token === 15 /* LessThanToken */) { + if (!scanner.hasPrecedingLineBreak() && token === 23 /* LessThanToken */) { node.typeArguments = parseTypeArguments(); } return finishNode(node); } function parseTypeQuery() { - var node = createNode(124 /* TypeQuery */); - parseExpected(87 /* TypeOfKeyword */); + var node = createNode(135 /* TypeQuery */); + parseExpected(95 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(113 /* TypeParameter */); + var node = createNode(122 /* TypeParameter */); node.name = parseIdentifier(); - if (parseOptional(69 /* ExtendsKeyword */)) { - if (isType() || !isExpression()) { + if (parseOptional(77 /* ExtendsKeyword */)) { + if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } else { - var expr = parseUnaryExpression(); - grammarErrorOnNode(expr, ts.Diagnostics.Type_expected); + node.expression = parseUnaryExpression(); } } return finishNode(node); } function parseTypeParameters() { - if (token === 15 /* LessThanToken */) { - var pos = getNodePos(); - var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 15 /* LessThanToken */, 16 /* GreaterThanToken */); - if (!result.length) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Type_parameter_list_cannot_be_empty); - } - return result; + if (token === 23 /* LessThanToken */) { + return parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 23 /* LessThanToken */, 24 /* GreaterThanToken */); } } function parseParameterType() { - return parseOptional(42 /* ColonToken */) ? token === 3 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; + return parseOptional(50 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; } - function isParameter() { - return token === 12 /* DotDotDotToken */ || isIdentifier() || isModifier(token); + function isStartOfParameter() { + return token === 20 /* DotDotDotToken */ || isIdentifier() || isModifier(token); + } + function setModifiers(node, modifiers) { + if (modifiers) { + node.flags |= modifiers.flags; + node.modifiers = modifiers; + } } function parseParameter(flags) { if (flags === void 0) { flags = 0; } - var node = createNode(114 /* Parameter */); - node.flags |= parseAndCheckModifiers(3 /* Parameters */); - if (parseOptional(12 /* DotDotDotToken */)) { + var node = createNode(123 /* Parameter */); + var modifiers = parseModifiers(3 /* Parameters */); + setModifiers(node, modifiers); + if (parseOptional(20 /* DotDotDotToken */)) { node.flags |= 8 /* Rest */; } node.name = parseIdentifier(); - if (node.name.kind === 111 /* Missing */ && node.flags === 0 && isModifier(token)) { + if (node.name.kind === 120 /* Missing */ && node.flags === 0 && isModifier(token)) { nextToken(); } - if (parseOptional(41 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } node.type = parseParameterType(); node.initializer = parseInitializer(true); return finishNode(node); } - function parseSignature(kind, returnToken) { - if (kind === 121 /* ConstructSignature */) { - parseExpected(78 /* NewKeyword */); + function parseSignature(kind, returnToken, returnTokenRequired) { + if (kind === 130 /* ConstructSignature */) { + parseExpected(86 /* NewKeyword */); } var typeParameters = parseTypeParameters(); - var parameters = parseParameterList(7 /* OpenParenToken */, 8 /* CloseParenToken */); - checkParameterList(parameters); - var type = parseOptional(returnToken) ? parseType() : undefined; + var parameters = parseParameterList(15 /* OpenParenToken */, 16 /* CloseParenToken */); + var type; + if (returnTokenRequired) { + parseExpected(returnToken); + type = parseType(); + } + else if (parseOptional(returnToken)) { + type = parseType(); + } return { typeParameters: typeParameters, parameters: parameters, @@ -3217,201 +3195,126 @@ var ts; function parseParameterList(startDelimiter, endDelimiter) { return parseBracketedList(13 /* Parameters */, parseParameter, startDelimiter, endDelimiter); } - function checkParameterList(parameters) { - var seenOptionalParameter = false; - var parameterCount = parameters.length; - for (var i = 0; i < parameterCount; i++) { - var parameter = parameters[i]; - if (isInStrictMode && isEvalOrArgumentsIdentifier(parameter.name)) { - reportInvalidUseInStrictMode(parameter.name); - return; - } - else if (parameter.flags & 8 /* Rest */) { - if (i !== (parameterCount - 1)) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - return; - } - if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); - return; - } - if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); - return; - } - } - else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { - seenOptionalParameter = true; - if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - return; - } - } - else { - if (seenOptionalParameter) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - return; - } - } - } - } function parseSignatureMember(kind, returnToken) { var node = createNode(kind); - var sig = parseSignature(kind, returnToken); + var sig = parseSignature(kind, returnToken, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; parseSemicolon(); return finishNode(node); } - function parseIndexSignatureMember() { - var node = createNode(122 /* IndexSignature */); - var errorCountBeforeIndexSignature = file.syntacticErrors.length; - var indexerStart = scanner.getTokenPos(); - node.parameters = parseParameterList(9 /* OpenBracketToken */, 10 /* CloseBracketToken */); - var indexerLength = scanner.getStartPos() - indexerStart; + function parseIndexSignatureMember(modifiers, pos) { + var node = createNode(131 /* IndexSignature */, pos); + setModifiers(node, modifiers); + node.parameters = parseParameterList(17 /* OpenBracketToken */, 18 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseSemicolon(); - if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { - checkIndexSignature(node, indexerStart, indexerLength); - } return finishNode(node); } - function checkIndexSignature(node, indexerStart, indexerLength) { - var parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - var arityDiagnostic = ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter; - if (parameter) { - grammarErrorOnNode(parameter.name, arityDiagnostic); - } - else { - grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); - } - return; - } - else if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - return; - } - else if (parameter.flags & ts.NodeFlags.Modifier) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - return; - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - return; - } - else if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - return; - } - else if (!parameter.type) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - return; - } - else if (parameter.type.kind !== 110 /* StringKeyword */ && parameter.type.kind !== 108 /* NumberKeyword */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); - return; - } - else if (!node.type) { - grammarErrorAtPos(indexerStart, indexerLength, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); - return; - } - } function parsePropertyOrMethod() { var node = createNode(0 /* Unknown */); node.name = parsePropertyName(); - if (parseOptional(41 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } - if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { - node.kind = 116 /* Method */; - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + node.kind = 125 /* Method */; + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; } else { - node.kind = 115 /* Property */; + node.kind = 124 /* Property */; node.type = parseTypeAnnotation(); } parseSemicolon(); return finishNode(node); } - function isTypeMember() { + function isStartOfTypeMember() { switch (token) { - case 7 /* OpenParenToken */: - case 15 /* LessThanToken */: - case 9 /* OpenBracketToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 17 /* OpenBracketToken */: return true; default: - return isPropertyName() && lookAhead(function () { return nextToken() === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */ || token === 41 /* QuestionToken */ || token === 42 /* ColonToken */ || canParseSemicolon(); }); + return isPropertyName() && lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */ || token === 49 /* QuestionToken */ || token === 50 /* ColonToken */ || canParseSemicolon(); }); } } function parseTypeMember() { switch (token) { - case 7 /* OpenParenToken */: - case 15 /* LessThanToken */: - return parseSignatureMember(120 /* CallSignature */, 42 /* ColonToken */); - case 9 /* OpenBracketToken */: - return parseIndexSignatureMember(); - case 78 /* NewKeyword */: - if (lookAhead(function () { return nextToken() === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */; })) { - return parseSignatureMember(121 /* ConstructSignature */, 42 /* ColonToken */); + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + return parseSignatureMember(129 /* CallSignature */, 50 /* ColonToken */); + case 17 /* OpenBracketToken */: + return parseIndexSignatureMember(undefined); + case 86 /* NewKeyword */: + if (lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */; })) { + return parseSignatureMember(130 /* ConstructSignature */, 50 /* ColonToken */); } - case 3 /* StringLiteral */: - case 2 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 6 /* NumericLiteral */: return parsePropertyOrMethod(); default: - if (token >= 55 /* Identifier */) { + if (token >= 63 /* Identifier */) { return parsePropertyOrMethod(); } } } function parseTypeLiteral() { - var node = createNode(125 /* TypeLiteral */); - if (parseExpected(5 /* OpenBraceToken */)) { + var node = createNode(136 /* TypeLiteral */); + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); - parseExpected(6 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); } return finishNode(node); } - function parseFunctionType(signatureKind) { - var node = createNode(125 /* TypeLiteral */); - var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, 23 /* EqualsGreaterThanToken */); + function parseTupleType() { + var node = createNode(138 /* TupleType */); + node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 17 /* OpenBracketToken */, 18 /* CloseBracketToken */); + return finishNode(node); + } + function parseParenType() { + var node = createNode(140 /* ParenType */); + parseExpected(15 /* OpenParenToken */); + node.type = parseType(); + parseExpected(16 /* CloseParenToken */); + return finishNode(node); + } + function parseFunctionType(typeKind) { + var member = createNode(typeKind); + var sig = parseSignature(typeKind === 133 /* FunctionType */ ? 129 /* CallSignature */ : 130 /* ConstructSignature */, 31 /* EqualsGreaterThanToken */, true); member.typeParameters = sig.typeParameters; member.parameters = sig.parameters; member.type = sig.type; finishNode(member); - node.members = createNodeArray(member); - return finishNode(node); + return member; } function parseKeywordAndNoDot() { var node = parseTokenNode(); - return token === 11 /* DotToken */ ? undefined : node; + return token === 19 /* DotToken */ ? undefined : node; } function parseNonArrayType() { switch (token) { - case 101 /* AnyKeyword */: - case 110 /* StringKeyword */: - case 108 /* NumberKeyword */: - case 102 /* BooleanKeyword */: - case 89 /* VoidKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 87 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return parseTypeQuery(); - case 5 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseTypeLiteral(); - case 7 /* OpenParenToken */: - case 15 /* LessThanToken */: - return parseFunctionType(120 /* CallSignature */); - case 78 /* NewKeyword */: - return parseFunctionType(121 /* ConstructSignature */); + case 17 /* OpenBracketToken */: + return parseTupleType(); + case 15 /* OpenParenToken */: + return parseParenType(); default: if (isIdentifier()) { return parseTypeReference(); @@ -3420,89 +3323,137 @@ var ts; error(ts.Diagnostics.Type_expected); return createMissingNode(); } - function isType() { + function isStartOfType() { switch (token) { - case 101 /* AnyKeyword */: - case 110 /* StringKeyword */: - case 108 /* NumberKeyword */: - case 102 /* BooleanKeyword */: - case 89 /* VoidKeyword */: - case 87 /* TypeOfKeyword */: - case 5 /* OpenBraceToken */: - case 15 /* LessThanToken */: - case 78 /* NewKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: + case 95 /* TypeOfKeyword */: + case 13 /* OpenBraceToken */: + case 17 /* OpenBracketToken */: + case 23 /* LessThanToken */: + case 86 /* NewKeyword */: return true; - case 7 /* OpenParenToken */: + case 15 /* OpenParenToken */: return lookAhead(function () { nextToken(); - return token === 8 /* CloseParenToken */ || isParameter(); + return token === 16 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); }); default: return isIdentifier(); } } - function parseType() { + function parsePrimaryType() { var type = parseNonArrayType(); - while (type && !scanner.hasPrecedingLineBreak() && parseOptional(9 /* OpenBracketToken */)) { - parseExpected(10 /* CloseBracketToken */); - var node = createNode(126 /* ArrayType */, type.pos); + while (!scanner.hasPrecedingLineBreak() && parseOptional(17 /* OpenBracketToken */)) { + parseExpected(18 /* CloseBracketToken */); + var node = createNode(137 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } return type; } - function parseTypeAnnotation() { - return parseOptional(42 /* ColonToken */) ? parseType() : undefined; + function parseUnionType() { + var type = parsePrimaryType(); + if (token === 43 /* BarToken */) { + var types = [type]; + types.pos = type.pos; + while (parseOptional(43 /* BarToken */)) { + types.push(parsePrimaryType()); + } + types.end = getNodeEnd(); + var node = createNode(139 /* UnionType */, type.pos); + node.types = types; + type = finishNode(node); + } + return type; } - function isExpression() { + function isStartOfFunctionType() { + return token === 23 /* LessThanToken */ || token === 15 /* OpenParenToken */ && lookAhead(function () { + nextToken(); + if (token === 16 /* CloseParenToken */ || token === 20 /* DotDotDotToken */) { + return true; + } + if (isIdentifier() || isModifier(token)) { + nextToken(); + if (token === 50 /* ColonToken */ || token === 22 /* CommaToken */ || token === 49 /* QuestionToken */ || token === 51 /* EqualsToken */ || isIdentifier() || isModifier(token)) { + return true; + } + if (token === 16 /* CloseParenToken */) { + nextToken(); + if (token === 31 /* EqualsGreaterThanToken */) { + return true; + } + } + } + return false; + }); + } + function parseType() { + if (isStartOfFunctionType()) { + return parseFunctionType(133 /* FunctionType */); + } + if (token === 86 /* NewKeyword */) { + return parseFunctionType(134 /* ConstructorType */); + } + return parseUnionType(); + } + function parseTypeAnnotation() { + return parseOptional(50 /* ColonToken */) ? parseType() : undefined; + } + function isStartOfExpression() { switch (token) { - case 83 /* ThisKeyword */: - case 81 /* SuperKeyword */: - case 79 /* NullKeyword */: - case 85 /* TrueKeyword */: - case 70 /* FalseKeyword */: - case 2 /* NumericLiteral */: - case 3 /* StringLiteral */: - case 7 /* OpenParenToken */: - case 9 /* OpenBracketToken */: - case 5 /* OpenBraceToken */: - case 73 /* FunctionKeyword */: - case 78 /* NewKeyword */: - case 27 /* SlashToken */: - case 47 /* SlashEqualsToken */: - case 24 /* PlusToken */: - case 25 /* MinusToken */: - case 38 /* TildeToken */: - case 37 /* ExclamationToken */: - case 64 /* DeleteKeyword */: - case 87 /* TypeOfKeyword */: - case 89 /* VoidKeyword */: - case 29 /* PlusPlusToken */: - case 30 /* MinusMinusToken */: - case 15 /* LessThanToken */: - case 55 /* Identifier */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 15 /* OpenParenToken */: + case 17 /* OpenBracketToken */: + case 13 /* OpenBraceToken */: + case 81 /* FunctionKeyword */: + case 86 /* NewKeyword */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: + case 23 /* LessThanToken */: + case 63 /* Identifier */: return true; default: return isIdentifier(); } } - function isExpressionStatement() { - return token !== 5 /* OpenBraceToken */ && token !== 73 /* FunctionKeyword */ && isExpression(); + function isStartOfExpressionStatement() { + return token !== 13 /* OpenBraceToken */ && token !== 81 /* FunctionKeyword */ && isStartOfExpression(); } function parseExpression(noIn) { var expr = parseAssignmentExpression(noIn); - while (parseOptional(14 /* CommaToken */)) { - expr = makeBinaryExpression(expr, 14 /* CommaToken */, parseAssignmentExpression(noIn)); + while (parseOptional(22 /* CommaToken */)) { + expr = makeBinaryExpression(expr, 22 /* CommaToken */, parseAssignmentExpression(noIn)); } return expr; } function parseInitializer(inParameter, noIn) { - if (token !== 43 /* EqualsToken */) { - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 5 /* OpenBraceToken */) || !isExpression()) { + if (token !== 51 /* EqualsToken */) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token === 13 /* OpenBraceToken */) || !isStartOfExpression()) { return undefined; } } - parseExpected(43 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); return parseAssignmentExpression(noIn); } function parseAssignmentExpression(noIn) { @@ -3511,49 +3462,20 @@ var ts; return arrowExpression; } var expr = parseConditionalExpression(noIn); - if (expr.kind === 55 /* Identifier */ && token === 23 /* EqualsGreaterThanToken */) { + if (expr.kind === 63 /* Identifier */ && token === 31 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } - if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } + if (isLeftHandSideExpression(expr) && isAssignmentOperator(token)) { var operator = token; nextToken(); return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); } return expr; } - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 130 /* PropertyAccess */: - case 131 /* IndexedAccess */: - case 133 /* NewExpression */: - case 132 /* CallExpression */: - case 127 /* ArrayLiteral */: - case 135 /* ParenExpression */: - case 128 /* ObjectLiteral */: - case 136 /* FunctionExpression */: - case 55 /* Identifier */: - case 111 /* Missing */: - case 4 /* RegularExpressionLiteral */: - case 2 /* NumericLiteral */: - case 3 /* StringLiteral */: - case 70 /* FalseKeyword */: - case 79 /* NullKeyword */: - case 83 /* ThisKeyword */: - case 85 /* TrueKeyword */: - case 81 /* SuperKeyword */: - return true; - } - } - return false; - } function parseSimpleArrowFunctionExpression(identifier) { - ts.Debug.assert(token === 23 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - parseExpected(23 /* EqualsGreaterThanToken */); - var parameter = createNode(114 /* Parameter */, identifier.pos); + ts.Debug.assert(token === 31 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + parseExpected(31 /* EqualsGreaterThanToken */); + var parameter = createNode(123 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); var parameters = []; @@ -3570,17 +3492,17 @@ var ts; } var pos = getNodePos(); if (triState === 1 /* True */) { - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); - if (parseExpected(23 /* EqualsGreaterThanToken */) || token === 5 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (parseExpected(31 /* EqualsGreaterThanToken */) || token === 13 /* OpenBraceToken */) { return parseArrowExpressionTail(pos, sig, false); } else { - return makeFunctionExpression(137 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); + return makeFunctionExpression(153 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); } } var sig = tryParseSignatureIfArrowOrBraceFollows(); if (sig) { - parseExpected(23 /* EqualsGreaterThanToken */); + parseExpected(31 /* EqualsGreaterThanToken */); return parseArrowExpressionTail(pos, sig, false); } else { @@ -3588,35 +3510,35 @@ var ts; } } function isParenthesizedArrowFunctionExpression() { - if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { return lookAhead(function () { var first = token; var second = nextToken(); - if (first === 7 /* OpenParenToken */) { - if (second === 8 /* CloseParenToken */) { + if (first === 15 /* OpenParenToken */) { + if (second === 16 /* CloseParenToken */) { var third = nextToken(); switch (third) { - case 23 /* EqualsGreaterThanToken */: - case 42 /* ColonToken */: - case 5 /* OpenBraceToken */: + case 31 /* EqualsGreaterThanToken */: + case 50 /* ColonToken */: + case 13 /* OpenBraceToken */: return 1 /* True */; default: return 0 /* False */; } } - if (second === 12 /* DotDotDotToken */) { + if (second === 20 /* DotDotDotToken */) { return 1 /* True */; } if (!isIdentifier()) { return 0 /* False */; } - if (nextToken() === 42 /* ColonToken */) { + if (nextToken() === 50 /* ColonToken */) { return 1 /* True */; } return 2 /* Unknown */; } else { - ts.Debug.assert(first === 15 /* LessThanToken */); + ts.Debug.assert(first === 23 /* LessThanToken */); if (!isIdentifier()) { return 0 /* False */; } @@ -3624,15 +3546,15 @@ var ts; } }); } - if (token === 23 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return 1 /* True */; } return 0 /* False */; } function tryParseSignatureIfArrowOrBraceFollows() { return tryParse(function () { - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); - if (token === 23 /* EqualsGreaterThanToken */ || token === 5 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (token === 31 /* EqualsGreaterThanToken */ || token === 13 /* OpenBraceToken */) { return sig; } return undefined; @@ -3640,27 +3562,24 @@ var ts; } function parseArrowExpressionTail(pos, sig, noIn) { var body; - if (token === 5 /* OpenBraceToken */) { - body = parseBody(false); + if (token === 13 /* OpenBraceToken */) { + body = parseFunctionBlock(false); } - else if (isStatement(true) && !isExpressionStatement() && token !== 73 /* FunctionKeyword */) { - body = parseBody(true); + else if (isStatement(true) && !isStartOfExpressionStatement() && token !== 81 /* FunctionKeyword */) { + body = parseFunctionBlock(true); } else { body = parseAssignmentExpression(noIn); } - return makeFunctionExpression(137 /* ArrowFunction */, pos, undefined, sig, body); - } - function isAssignmentOperator() { - return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; + return makeFunctionExpression(153 /* ArrowFunction */, pos, undefined, sig, body); } function parseConditionalExpression(noIn) { var expr = parseBinaryExpression(noIn); - while (parseOptional(41 /* QuestionToken */)) { - var node = createNode(141 /* ConditionalExpression */, expr.pos); + while (parseOptional(49 /* QuestionToken */)) { + var node = createNode(157 /* ConditionalExpression */, expr.pos); node.condition = expr; node.whenTrue = parseAssignmentExpression(false); - parseExpected(42 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.whenFalse = parseAssignmentExpression(noIn); expr = finishNode(node); } @@ -3673,7 +3592,7 @@ var ts; while (true) { reScanGreaterToken(); var precedence = getOperatorPrecedence(); - if (precedence && precedence > minPrecedence && (!noIn || token !== 76 /* InKeyword */)) { + if (precedence && precedence > minPrecedence && (!noIn || token !== 84 /* InKeyword */)) { var operator = token; nextToken(); expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); @@ -3684,44 +3603,44 @@ var ts; } function getOperatorPrecedence() { switch (token) { - case 40 /* BarBarToken */: + case 48 /* BarBarToken */: return 1; - case 39 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return 2; - case 35 /* BarToken */: + case 43 /* BarToken */: return 3; - case 36 /* CaretToken */: + case 44 /* CaretToken */: return 4; - case 34 /* AmpersandToken */: + case 42 /* AmpersandToken */: return 5; - case 19 /* EqualsEqualsToken */: - case 20 /* ExclamationEqualsToken */: - case 21 /* EqualsEqualsEqualsToken */: - case 22 /* ExclamationEqualsEqualsToken */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: return 6; - case 15 /* LessThanToken */: - case 16 /* GreaterThanToken */: - case 17 /* LessThanEqualsToken */: - case 18 /* GreaterThanEqualsToken */: - case 77 /* InstanceOfKeyword */: - case 76 /* InKeyword */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + case 85 /* InstanceOfKeyword */: + case 84 /* InKeyword */: return 7; - case 31 /* LessThanLessThanToken */: - case 32 /* GreaterThanGreaterThanToken */: - case 33 /* GreaterThanGreaterThanGreaterThanToken */: + case 39 /* LessThanLessThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return 8; - case 24 /* PlusToken */: - case 25 /* MinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: return 9; - case 26 /* AsteriskToken */: - case 27 /* SlashToken */: - case 28 /* PercentToken */: + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: return 10; } return undefined; } function makeBinaryExpression(left, operator, right) { - var node = createNode(140 /* BinaryExpression */, left.pos); + var node = createNode(156 /* BinaryExpression */, left.pos); node.left = left; node.operator = operator; node.right = right; @@ -3730,52 +3649,40 @@ var ts; function parseUnaryExpression() { var pos = getNodePos(); switch (token) { - case 24 /* PlusToken */: - case 25 /* MinusToken */: - case 38 /* TildeToken */: - case 37 /* ExclamationToken */: - case 64 /* DeleteKeyword */: - case 87 /* TypeOfKeyword */: - case 89 /* VoidKeyword */: - case 29 /* PlusPlusToken */: - case 30 /* MinusMinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var operator = token; nextToken(); - var operand = parseUnaryExpression(); - if (isInStrictMode) { - if ((token === 29 /* PlusPlusToken */ || token === 30 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { - reportInvalidUseInStrictMode(operand); - } - else if (token === 64 /* DeleteKeyword */ && operand.kind === 55 /* Identifier */) { - grammarErrorOnNode(operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); - } - } - return makeUnaryExpression(138 /* PrefixOperator */, pos, operator, operand); - case 15 /* LessThanToken */: + return makeUnaryExpression(154 /* PrefixOperator */, pos, operator, parseUnaryExpression()); + case 23 /* LessThanToken */: return parseTypeAssertion(); } var primaryExpression = parsePrimaryExpression(); - var illegalUsageOfSuperKeyword = primaryExpression.kind === 81 /* SuperKeyword */ && token !== 7 /* OpenParenToken */ && token !== 11 /* DotToken */; + var illegalUsageOfSuperKeyword = primaryExpression.kind === 89 /* SuperKeyword */ && token !== 15 /* OpenParenToken */ && token !== 19 /* DotToken */; if (illegalUsageOfSuperKeyword) { error(ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); } var expr = parseCallAndAccess(primaryExpression, false); ts.Debug.assert(isLeftHandSideExpression(expr)); - if ((token === 29 /* PlusPlusToken */ || token === 30 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } + if ((token === 37 /* PlusPlusToken */ || token === 38 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { var operator = token; nextToken(); - expr = makeUnaryExpression(139 /* PostfixOperator */, expr.pos, operator, expr); + expr = makeUnaryExpression(155 /* PostfixOperator */, expr.pos, operator, expr); } return expr; } function parseTypeAssertion() { - var node = createNode(134 /* TypeAssertion */); - parseExpected(15 /* LessThanToken */); + var node = createNode(150 /* TypeAssertion */); + parseExpected(23 /* LessThanToken */); node.type = parseType(); - parseExpected(16 /* GreaterThanToken */); + parseExpected(24 /* GreaterThanToken */); node.operand = parseUnaryExpression(); return finishNode(node); } @@ -3787,87 +3694,111 @@ var ts; } function parseCallAndAccess(expr, inNewExpression) { while (true) { - if (parseOptional(11 /* DotToken */)) { - var propertyAccess = createNode(130 /* PropertyAccess */, expr.pos); + var dotOrBracketStart = scanner.getTokenPos(); + if (parseOptional(19 /* DotToken */)) { + var propertyAccess = createNode(145 /* PropertyAccess */, expr.pos); + var id; + if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { + var matchesPattern = lookAhead(function () { + nextToken(); + return !scanner.hasPrecedingLineBreak() && (scanner.isIdentifier() || scanner.isReservedWord); + }); + if (matchesPattern) { + errorAtPos(dotOrBracketStart + 1, 0, ts.Diagnostics.Identifier_expected); + id = createMissingNode(); + } + } propertyAccess.left = expr; - propertyAccess.right = parseIdentifierName(); + propertyAccess.right = id || parseIdentifierName(); expr = finishNode(propertyAccess); continue; } - var bracketStart = scanner.getTokenPos(); - if (parseOptional(9 /* OpenBracketToken */)) { - var indexedAccess = createNode(131 /* IndexedAccess */, expr.pos); + if (parseOptional(17 /* OpenBracketToken */)) { + var indexedAccess = createNode(146 /* IndexedAccess */, expr.pos); indexedAccess.object = expr; - if (inNewExpression && parseOptional(10 /* CloseBracketToken */)) { + if (inNewExpression && parseOptional(18 /* CloseBracketToken */)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { indexedAccess.index = parseExpression(); - parseExpected(10 /* CloseBracketToken */); + if (indexedAccess.index.kind === 7 /* StringLiteral */ || indexedAccess.index.kind === 6 /* NumericLiteral */) { + var literal = indexedAccess.index; + literal.text = internIdentifier(literal.text); + } + parseExpected(18 /* CloseBracketToken */); } expr = finishNode(indexedAccess); continue; } - if ((token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(132 /* CallExpression */, expr.pos); + if ((token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) && !inNewExpression) { + var callExpr = createNode(147 /* CallExpression */, expr.pos); callExpr.func = expr; - if (token === 15 /* LessThanToken */) { + if (token === 23 /* LessThanToken */) { if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) return expr; } else { - parseExpected(7 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); } - callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseAssignmentExpression, 0 /* Disallow */); - parseExpected(8 /* CloseParenToken */); + callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression); + parseExpected(16 /* CloseParenToken */); expr = finishNode(callExpr); continue; } + if (token === 9 /* NoSubstitutionTemplateLiteral */ || token === 10 /* TemplateHead */) { + var tagExpression = createNode(149 /* TaggedTemplateExpression */, expr.pos); + tagExpression.tag = expr; + tagExpression.template = token === 9 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() : parseTemplateExpression(); + expr = finishNode(tagExpression); + continue; + } return expr; } } function parseTypeArgumentsAndOpenParen() { var result = parseTypeArguments(); - parseExpected(7 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); return result; } function parseTypeArguments() { - var typeArgumentListStart = scanner.getTokenPos(); - var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(15 /* TypeArguments */, parseType, 15 /* LessThanToken */, 16 /* GreaterThanToken */); - if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { - grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, ts.Diagnostics.Type_argument_list_cannot_be_empty); + return parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 23 /* LessThanToken */, 24 /* GreaterThanToken */); + } + function parseSingleTypeArgument() { + if (token === 22 /* CommaToken */) { + return createNode(120 /* Missing */); } - return result; + return parseType(); } function parsePrimaryExpression() { switch (token) { - case 83 /* ThisKeyword */: - case 81 /* SuperKeyword */: - case 79 /* NullKeyword */: - case 85 /* TrueKeyword */: - case 70 /* FalseKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return parseTokenNode(); - case 2 /* NumericLiteral */: - case 3 /* StringLiteral */: + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return parseLiteralNode(); - case 7 /* OpenParenToken */: + case 15 /* OpenParenToken */: return parseParenExpression(); - case 9 /* OpenBracketToken */: + case 17 /* OpenBracketToken */: return parseArrayLiteral(); - case 5 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseObjectLiteral(); - case 73 /* FunctionKeyword */: + case 81 /* FunctionKeyword */: return parseFunctionExpression(); - case 78 /* NewKeyword */: + case 86 /* NewKeyword */: return parseNewExpression(); - case 27 /* SlashToken */: - case 47 /* SlashEqualsToken */: - if (reScanSlashToken() === 4 /* RegularExpressionLiteral */) { + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + if (reScanSlashToken() === 8 /* RegularExpressionLiteral */) { return parseLiteralNode(); } break; + case 10 /* TemplateHead */: + return parseTemplateExpression(); default: if (isIdentifier()) { return parseIdentifier(); @@ -3877,113 +3808,88 @@ var ts; return createMissingNode(); } function parseParenExpression() { - var node = createNode(135 /* ParenExpression */); - parseExpected(7 /* OpenParenToken */); + var node = createNode(151 /* ParenExpression */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); return finishNode(node); } + function parseAssignmentExpressionOrOmittedExpression() { + return token === 22 /* CommaToken */ ? createNode(160 /* OmittedExpression */) : parseAssignmentExpression(); + } function parseArrayLiteralElement() { - return token === 14 /* CommaToken */ ? createNode(142 /* OmittedExpression */) : parseAssignmentExpression(); + return parseAssignmentExpressionOrOmittedExpression(); + } + function parseArgumentExpression() { + return parseAssignmentExpressionOrOmittedExpression(); } function parseArrayLiteral() { - var node = createNode(127 /* ArrayLiteral */); - parseExpected(9 /* OpenBracketToken */); + var node = createNode(141 /* ArrayLiteral */); + parseExpected(17 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) - node.flags |= 128 /* MultiLine */; - node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, 2 /* Preserve */); - parseExpected(10 /* CloseBracketToken */); + node.flags |= 256 /* MultiLine */; + node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement); + parseExpected(18 /* CloseBracketToken */); return finishNode(node); } function parsePropertyAssignment() { - var node = createNode(129 /* PropertyAssignment */); - node.name = parsePropertyName(); - if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); - var body = parseBody(false); - node.initializer = makeFunctionExpression(136 /* FunctionExpression */, node.pos, undefined, sig, body); + var nodePos = scanner.getStartPos(); + var tokenIsIdentifier = isIdentifier(); + var nameToken = token; + var propertyName = parsePropertyName(); + var node; + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + node = createNode(143 /* PropertyAssignment */, nodePos); + node.name = propertyName; + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + var body = parseFunctionBlock(false); + node.initializer = makeFunctionExpression(152 /* FunctionExpression */, node.pos, undefined, sig, body); + return finishNode(node); + } + var flags = 0; + if (token === 49 /* QuestionToken */) { + flags |= 4 /* QuestionMark */; + nextToken(); + } + if ((token === 22 /* CommaToken */ || token === 14 /* CloseBraceToken */) && tokenIsIdentifier) { + node = createNode(144 /* ShorthandPropertyAssignment */, nodePos); + node.name = propertyName; } else { - parseExpected(42 /* ColonToken */); + node = createNode(143 /* PropertyAssignment */, nodePos); + node.name = propertyName; + parseExpected(50 /* ColonToken */); node.initializer = parseAssignmentExpression(false); } + node.flags = flags; return finishNode(node); } function parseObjectLiteralMember() { var initialPos = getNodePos(); var initialToken = token; - if (parseContextualModifier(105 /* GetKeyword */) || parseContextualModifier(109 /* SetKeyword */)) { - var kind = initialToken === 105 /* GetKeyword */ ? 118 /* GetAccessor */ : 119 /* SetAccessor */; - return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); + if (parseContextualModifier(113 /* GetKeyword */) || parseContextualModifier(117 /* SetKeyword */)) { + var kind = initialToken === 113 /* GetKeyword */ ? 127 /* GetAccessor */ : 128 /* SetAccessor */; + return parseMemberAccessorDeclaration(kind, initialPos, undefined); } return parsePropertyAssignment(); } function parseObjectLiteral() { - var node = createNode(128 /* ObjectLiteral */); - parseExpected(5 /* OpenBraceToken */); + var node = createNode(142 /* ObjectLiteral */); + parseExpected(13 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { - node.flags |= 128 /* MultiLine */; + node.flags |= 256 /* MultiLine */; } - var trailingCommaBehavior = languageVersion === 0 /* ES3 */ ? 1 /* Allow */ : 2 /* Preserve */; - node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, trailingCommaBehavior); - parseExpected(6 /* CloseBraceToken */); - var seen = {}; - var Property = 1; - var GetAccessor = 2; - var SetAccesor = 4; - var GetOrSetAccessor = GetAccessor | SetAccesor; - ts.forEach(node.properties, function (p) { - if (p.kind === 142 /* OmittedExpression */) { - return; - } - var currentKind; - if (p.kind === 129 /* PropertyAssignment */) { - currentKind = Property; - } - else if (p.kind === 118 /* GetAccessor */) { - currentKind = GetAccessor; - } - else if (p.kind === 119 /* SetAccessor */) { - currentKind = SetAccesor; - } - else { - ts.Debug.fail("Unexpected syntax kind:" + ts.SyntaxKind[p.kind]); - } - if (!ts.hasProperty(seen, p.name.text)) { - seen[p.name.text] = currentKind; - } - else { - var existingKind = seen[p.name.text]; - if (currentKind === Property && existingKind === Property) { - if (isInStrictMode) { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); - } - } - else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { - if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[p.name.text] = currentKind | existingKind; - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - }); + node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember); + parseExpected(14 /* CloseBraceToken */); return finishNode(node); } function parseFunctionExpression() { var pos = getNodePos(); - parseExpected(73 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); - var body = parseBody(false); - if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { - reportInvalidUseInStrictMode(name); - } - return makeFunctionExpression(136 /* FunctionExpression */, pos, name, sig, body); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + var body = parseFunctionBlock(false); + return makeFunctionExpression(152 /* FunctionExpression */, pos, name, sig, body); } function makeFunctionExpression(kind, pos, name, sig, body) { var node = createNode(kind, pos); @@ -3995,274 +3901,180 @@ var ts; return finishNode(node); } function parseNewExpression() { - var node = createNode(133 /* NewExpression */); - parseExpected(78 /* NewKeyword */); + var node = createNode(148 /* NewExpression */); + parseExpected(86 /* NewKeyword */); node.func = parseCallAndAccess(parsePrimaryExpression(), true); - if (parseOptional(7 /* OpenParenToken */) || token === 15 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { - node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseAssignmentExpression, 0 /* Disallow */); - parseExpected(8 /* CloseParenToken */); + if (parseOptional(15 /* OpenParenToken */) || token === 23 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { + node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression); + parseExpected(16 /* CloseParenToken */); } return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(143 /* Block */); - if (parseExpected(5 /* OpenBraceToken */) || ignoreMissingOpenBrace) { + var node = createNode(161 /* Block */); + if (parseExpected(13 /* OpenBraceToken */) || ignoreMissingOpenBrace) { node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); - parseExpected(6 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); } return finishNode(node); } - function parseBody(ignoreMissingOpenBrace) { - var saveInFunctionBody = inFunctionBody; - var saveInSwitchStatement = inSwitchStatement; - var saveInIterationStatement = inIterationStatement; - inFunctionBody = true; - if (inSwitchStatement === 1 /* Nested */) { - inSwitchStatement = 2 /* CrossingFunctionBoundary */; - } - if (inIterationStatement === 1 /* Nested */) { - inIterationStatement = 2 /* CrossingFunctionBoundary */; - } - labelledStatementInfo.pushFunctionBoundary(); + function parseFunctionBlock(ignoreMissingOpenBrace) { var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 168 /* FunctionBlock */; - labelledStatementInfo.pop(); - inFunctionBody = saveInFunctionBody; - inSwitchStatement = saveInSwitchStatement; - inIterationStatement = saveInIterationStatement; + block.kind = 186 /* FunctionBlock */; return block; } function parseEmptyStatement() { - var node = createNode(145 /* EmptyStatement */); - parseExpected(13 /* SemicolonToken */); + var node = createNode(163 /* EmptyStatement */); + parseExpected(21 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(147 /* IfStatement */); - parseExpected(74 /* IfKeyword */); - parseExpected(7 /* OpenParenToken */); + var node = createNode(165 /* IfStatement */); + parseExpected(82 /* IfKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(66 /* ElseKeyword */) ? parseStatement() : undefined; + node.elseStatement = parseOptional(74 /* ElseKeyword */) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(148 /* DoStatement */); - parseExpected(65 /* DoKeyword */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; + var node = createNode(166 /* DoStatement */); + parseExpected(73 /* DoKeyword */); node.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; - parseExpected(90 /* WhileKeyword */); - parseExpected(7 /* OpenParenToken */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); - parseOptional(13 /* SemicolonToken */); + parseExpected(16 /* CloseParenToken */); + parseOptional(21 /* SemicolonToken */); return finishNode(node); } function parseWhileStatement() { - var node = createNode(149 /* WhileStatement */); - parseExpected(90 /* WhileKeyword */); - parseExpected(7 /* OpenParenToken */); + var node = createNode(167 /* WhileStatement */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; + parseExpected(16 /* CloseParenToken */); node.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; return finishNode(node); } function parseForOrForInStatement() { var pos = getNodePos(); - parseExpected(72 /* ForKeyword */); - parseExpected(7 /* OpenParenToken */); - if (token !== 13 /* SemicolonToken */) { - if (parseOptional(88 /* VarKeyword */)) { + parseExpected(80 /* ForKeyword */); + parseExpected(15 /* OpenParenToken */); + if (token !== 21 /* SemicolonToken */) { + if (parseOptional(96 /* VarKeyword */)) { var declarations = parseVariableDeclarationList(0, true); - if (!declarations.length) { - error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } + } + else if (parseOptional(102 /* LetKeyword */)) { + var declarations = parseVariableDeclarationList(2048 /* Let */, true); + } + else if (parseOptional(68 /* ConstKeyword */)) { + var declarations = parseVariableDeclarationList(4096 /* Const */, true); } else { var varOrInit = parseExpression(true); } } var forOrForInStatement; - if (parseOptional(76 /* InKeyword */)) { - var forInStatement = createNode(151 /* ForInStatement */, pos); + if (parseOptional(84 /* InKeyword */)) { + var forInStatement = createNode(169 /* ForInStatement */, pos); if (declarations) { - if (declarations.length > 1) { - error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - } - forInStatement.declaration = declarations[0]; + forInStatement.declarations = declarations; } else { forInStatement.variable = varOrInit; } forInStatement.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forInStatement; } else { - var forStatement = createNode(150 /* ForStatement */, pos); - if (declarations) + var forStatement = createNode(168 /* ForStatement */, pos); + if (declarations) { forStatement.declarations = declarations; - if (varOrInit) + } + if (varOrInit) { forStatement.initializer = varOrInit; - parseExpected(13 /* SemicolonToken */); - if (token !== 13 /* SemicolonToken */ && token !== 8 /* CloseParenToken */) { + } + parseExpected(21 /* SemicolonToken */); + if (token !== 21 /* SemicolonToken */ && token !== 16 /* CloseParenToken */) { forStatement.condition = parseExpression(); } - parseExpected(13 /* SemicolonToken */); - if (token !== 8 /* CloseParenToken */) { + parseExpected(21 /* SemicolonToken */); + if (token !== 16 /* CloseParenToken */) { forStatement.iterator = parseExpression(); } - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forStatement; } - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; forOrForInStatement.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; return finishNode(forOrForInStatement); } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 153 /* BreakStatement */ ? 56 /* BreakKeyword */ : 61 /* ContinueKeyword */); - if (!canParseSemicolon()) + parseExpected(kind === 171 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */); + if (!canParseSemicolon()) { node.label = parseIdentifier(); + } parseSemicolon(); - finishNode(node); - if (!inAmbientContext && errorCountBeforeStatement === file.syntacticErrors.length) { - if (node.label) { - checkBreakOrContinueStatementWithLabel(node); - } - else { - checkBareBreakOrContinueStatement(node); - } - } - return node; - } - function checkBareBreakOrContinueStatement(node) { - if (node.kind === 153 /* BreakStatement */) { - if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */ && inSwitchStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - return; - } - } - else if (node.kind === 152 /* ContinueStatement */) { - if (inIterationStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - return; - } - } - else { - ts.Debug.fail("checkAnonymousBreakOrContinueStatement"); - } - ts.Debug.assert(inIterationStatement === 2 /* CrossingFunctionBoundary */ || inSwitchStatement === 2 /* CrossingFunctionBoundary */); - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - } - function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 152 /* ContinueStatement */, false); - if (nodeIsNestedInLabel === 1 /* Nested */) { - return; - } - if (nodeIsNestedInLabel === 2 /* CrossingFunctionBoundary */) { - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - return; - } - if (node.kind === 152 /* ContinueStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - else if (node.kind === 153 /* BreakStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); - } - else { - ts.Debug.fail("checkBreakOrContinueStatementWithLabel"); - } + return finishNode(node); } function parseReturnStatement() { - var node = createNode(154 /* ReturnStatement */); - var errorCountBeforeReturnStatement = file.syntacticErrors.length; + var node = createNode(172 /* ReturnStatement */); var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; - parseExpected(80 /* ReturnKeyword */); - if (!canParseSemicolon()) + parseExpected(88 /* ReturnKeyword */); + if (!canParseSemicolon()) { node.expression = parseExpression(); - parseSemicolon(); - if (!inFunctionBody && !inAmbientContext && errorCountBeforeReturnStatement === file.syntacticErrors.length) { - grammarErrorAtPos(returnTokenStart, returnTokenLength, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); } + parseSemicolon(); return finishNode(node); } function parseWithStatement() { - var node = createNode(155 /* WithStatement */); - var startPos = scanner.getTokenPos(); - parseExpected(91 /* WithKeyword */); - var endPos = scanner.getStartPos(); - parseExpected(7 /* OpenParenToken */); + var node = createNode(173 /* WithStatement */); + parseExpected(99 /* WithKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); node.statement = parseStatement(); - node = finishNode(node); - if (isInStrictMode) { - grammarErrorAtPos(startPos, endPos - startPos, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - return node; + return finishNode(node); } function parseCaseClause() { - var node = createNode(157 /* CaseClause */); - parseExpected(57 /* CaseKeyword */); + var node = createNode(175 /* CaseClause */); + parseExpected(65 /* CaseKeyword */); node.expression = parseExpression(); - parseExpected(42 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(158 /* DefaultClause */); - parseExpected(63 /* DefaultKeyword */); - parseExpected(42 /* ColonToken */); + var node = createNode(176 /* DefaultClause */); + parseExpected(71 /* DefaultKeyword */); + parseExpected(50 /* ColonToken */); node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 57 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); + return token === 65 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(156 /* SwitchStatement */); - parseExpected(82 /* SwitchKeyword */); - parseExpected(7 /* OpenParenToken */); + var node = createNode(174 /* SwitchStatement */); + parseExpected(90 /* SwitchKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(8 /* CloseParenToken */); - parseExpected(5 /* OpenBraceToken */); - var saveInSwitchStatement = inSwitchStatement; - inSwitchStatement = 1 /* Nested */; + parseExpected(16 /* CloseParenToken */); + parseExpected(13 /* OpenBraceToken */); node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); - inSwitchStatement = saveInSwitchStatement; - parseExpected(6 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 158 /* DefaultClause */; }); - for (var i = 1, n = defaultClauses.length; i < n; i++) { - var clause = defaultClauses[i]; - var start = ts.skipTrivia(file.text, clause.pos); - var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; - grammarErrorAtPos(start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - } + parseExpected(14 /* CloseBraceToken */); return finishNode(node); } function parseThrowStatement() { - var node = createNode(160 /* ThrowStatement */); - parseExpected(84 /* ThrowKeyword */); + var node = createNode(178 /* ThrowStatement */); + parseExpected(92 /* ThrowKeyword */); if (scanner.hasPrecedingLineBreak()) { error(ts.Diagnostics.Line_break_not_permitted_here); } @@ -4271,13 +4083,13 @@ var ts; return finishNode(node); } function parseTryStatement() { - var node = createNode(161 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(86 /* TryKeyword */, 162 /* TryBlock */); - if (token === 58 /* CatchKeyword */) { + var node = createNode(179 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(94 /* TryKeyword */, 180 /* TryBlock */); + if (token === 66 /* CatchKeyword */) { node.catchBlock = parseCatchBlock(); } - if (token === 71 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(71 /* FinallyKeyword */, 164 /* FinallyBlock */); + if (token === 79 /* FinallyKeyword */) { + node.finallyBlock = parseTokenAndBlock(79 /* FinallyKeyword */, 182 /* FinallyBlock */); } if (!(node.catchBlock || node.finallyBlock)) { error(ts.Diagnostics.catch_or_finally_expected); @@ -4294,155 +4106,133 @@ var ts; } function parseCatchBlock() { var pos = getNodePos(); - parseExpected(58 /* CatchKeyword */); - parseExpected(7 /* OpenParenToken */); + parseExpected(66 /* CatchKeyword */); + parseExpected(15 /* OpenParenToken */); var variable = parseIdentifier(); - var typeAnnotationColonStart = scanner.getTokenPos(); - var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; var typeAnnotation = parseTypeAnnotation(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); var result = parseBlock(false, false); - result.kind = 163 /* CatchBlock */; + result.kind = 181 /* CatchBlock */; result.pos = pos; result.variable = variable; - if (typeAnnotation) { - errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(variable)) { - reportInvalidUseInStrictMode(variable); - } + result.type = typeAnnotation; return result; } function parseDebuggerStatement() { - var node = createNode(165 /* DebuggerStatement */); - parseExpected(62 /* DebuggerKeyword */); + var node = createNode(183 /* DebuggerStatement */); + parseExpected(70 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); } function isIterationStatementStart() { - return token === 90 /* WhileKeyword */ || token === 65 /* DoKeyword */ || token === 72 /* ForKeyword */; - } - function parseStatementWithLabelSet() { - labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(); - labelledStatementInfo.pop(); - return statement; + return token === 98 /* WhileKeyword */ || token === 73 /* DoKeyword */ || token === 80 /* ForKeyword */; } function isLabel() { - return isIdentifier() && lookAhead(function () { return nextToken() === 42 /* ColonToken */; }); + return isIdentifier() && lookAhead(function () { return nextToken() === 50 /* ColonToken */; }); } - function parseLabelledStatement() { - var node = createNode(159 /* LabelledStatement */); + function parseLabeledStatement() { + var node = createNode(177 /* LabeledStatement */); node.label = parseIdentifier(); - parseExpected(42 /* ColonToken */); - if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { - grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getSourceTextOfNodeFromSourceText(sourceText, node.label)); - } - labelledStatementInfo.addLabel(node.label); - node.statement = isLabel() ? parseLabelledStatement() : parseStatementWithLabelSet(); + parseExpected(50 /* ColonToken */); + node.statement = isLabel() ? parseLabeledStatement() : parseStatement(); return finishNode(node); } function parseExpressionStatement() { - var node = createNode(146 /* ExpressionStatement */); + var node = createNode(164 /* ExpressionStatement */); node.expression = parseExpression(); parseSemicolon(); return finishNode(node); } function isStatement(inErrorRecovery) { switch (token) { - case 13 /* SemicolonToken */: + case 21 /* SemicolonToken */: return !inErrorRecovery; - case 5 /* OpenBraceToken */: - case 88 /* VarKeyword */: - case 73 /* FunctionKeyword */: - case 74 /* IfKeyword */: - case 65 /* DoKeyword */: - case 90 /* WhileKeyword */: - case 72 /* ForKeyword */: - case 61 /* ContinueKeyword */: - case 56 /* BreakKeyword */: - case 80 /* ReturnKeyword */: - case 91 /* WithKeyword */: - case 82 /* SwitchKeyword */: - case 84 /* ThrowKeyword */: - case 86 /* TryKeyword */: - case 62 /* DebuggerKeyword */: - case 58 /* CatchKeyword */: - case 71 /* FinallyKeyword */: + case 13 /* OpenBraceToken */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 81 /* FunctionKeyword */: + case 82 /* IfKeyword */: + case 73 /* DoKeyword */: + case 98 /* WhileKeyword */: + case 80 /* ForKeyword */: + case 69 /* ContinueKeyword */: + case 64 /* BreakKeyword */: + case 88 /* ReturnKeyword */: + case 99 /* WithKeyword */: + case 90 /* SwitchKeyword */: + case 92 /* ThrowKeyword */: + case 94 /* TryKeyword */: + case 70 /* DebuggerKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return true; - case 93 /* InterfaceKeyword */: - case 59 /* ClassKeyword */: - case 106 /* ModuleKeyword */: - case 67 /* EnumKeyword */: - if (isDeclaration()) { + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + return !isConstEnum; + case 101 /* InterfaceKeyword */: + case 67 /* ClassKeyword */: + case 114 /* ModuleKeyword */: + case 75 /* EnumKeyword */: + case 119 /* TypeKeyword */: + if (isDeclarationStart()) { return false; } - case 98 /* PublicKeyword */: - case 96 /* PrivateKeyword */: - case 99 /* StaticKeyword */: - if (lookAhead(function () { return nextToken() >= 55 /* Identifier */; })) { + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + if (lookAhead(function () { return nextToken() >= 63 /* Identifier */; })) { return false; } default: - return isExpression(); + return isStartOfExpression(); } } function parseStatement() { switch (token) { - case 5 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseBlock(false, false); - case 88 /* VarKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: return parseVariableStatement(); - case 73 /* FunctionKeyword */: + case 81 /* FunctionKeyword */: return parseFunctionDeclaration(); - case 13 /* SemicolonToken */: + case 21 /* SemicolonToken */: return parseEmptyStatement(); - case 74 /* IfKeyword */: + case 82 /* IfKeyword */: return parseIfStatement(); - case 65 /* DoKeyword */: + case 73 /* DoKeyword */: return parseDoStatement(); - case 90 /* WhileKeyword */: + case 98 /* WhileKeyword */: return parseWhileStatement(); - case 72 /* ForKeyword */: + case 80 /* ForKeyword */: return parseForOrForInStatement(); - case 61 /* ContinueKeyword */: - return parseBreakOrContinueStatement(152 /* ContinueStatement */); - case 56 /* BreakKeyword */: - return parseBreakOrContinueStatement(153 /* BreakStatement */); - case 80 /* ReturnKeyword */: + case 69 /* ContinueKeyword */: + return parseBreakOrContinueStatement(170 /* ContinueStatement */); + case 64 /* BreakKeyword */: + return parseBreakOrContinueStatement(171 /* BreakStatement */); + case 88 /* ReturnKeyword */: return parseReturnStatement(); - case 91 /* WithKeyword */: + case 99 /* WithKeyword */: return parseWithStatement(); - case 82 /* SwitchKeyword */: + case 90 /* SwitchKeyword */: return parseSwitchStatement(); - case 84 /* ThrowKeyword */: + case 92 /* ThrowKeyword */: return parseThrowStatement(); - case 86 /* TryKeyword */: - case 58 /* CatchKeyword */: - case 71 /* FinallyKeyword */: + case 94 /* TryKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return parseTryStatement(); - case 62 /* DebuggerKeyword */: + case 70 /* DebuggerKeyword */: return parseDebuggerStatement(); default: - if (isLabel()) { - return parseLabelledStatement(); - } - return parseExpressionStatement(); + return isLabel() ? parseLabeledStatement() : parseExpressionStatement(); } } - function parseStatementOrFunction() { - return token === 73 /* FunctionKeyword */ ? parseFunctionDeclaration() : parseStatement(); - } - function parseAndCheckFunctionBody(isConstructor) { - var initialPosition = scanner.getTokenPos(); - var errorCountBeforeBody = file.syntacticErrors.length; - if (token === 5 /* OpenBraceToken */) { - var body = parseBody(false); - if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { - var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; - grammarErrorAtPos(initialPosition, 1, diagnostic); - } - return body; + function parseFunctionBlockOrSemicolon() { + if (token === 13 /* OpenBraceToken */) { + return parseFunctionBlock(false); } if (canParseSemicolon()) { parseSemicolon(); @@ -4451,161 +4241,106 @@ var ts; error(ts.Diagnostics.Block_or_expected); } function parseVariableDeclaration(flags, noIn) { - var node = createNode(166 /* VariableDeclaration */); + var node = createNode(184 /* VariableDeclaration */); node.flags = flags; - var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); node.type = parseTypeAnnotation(); var initializerStart = scanner.getTokenPos(); var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; node.initializer = parseInitializer(false, noIn); - if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } return finishNode(node); } function parseVariableDeclarationList(flags, noIn) { - return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, 0 /* Disallow */); + return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }); } function parseVariableStatement(pos, flags) { - var node = createNode(144 /* VariableStatement */, pos); - if (flags) + var node = createNode(162 /* VariableStatement */, pos); + if (flags) { node.flags = flags; - var errorCountBeforeVarStatement = file.syntacticErrors.length; - parseExpected(88 /* VarKeyword */); - node.declarations = parseVariableDeclarationList(flags, false); - parseSemicolon(); - if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { - grammarErrorOnNode(node, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } + if (token === 102 /* LetKeyword */) { + node.flags |= 2048 /* Let */; + } + else if (token === 68 /* ConstKeyword */) { + node.flags |= 4096 /* Const */; + } + else { + ts.Debug.assert(token === 96 /* VarKeyword */); + } + nextToken(); + node.declarations = parseVariableDeclarationList(node.flags, false); + parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(pos, flags) { - var node = createNode(167 /* FunctionDeclaration */, pos); + var node = createNode(185 /* FunctionDeclaration */, pos); if (flags) node.flags = flags; - parseExpected(73 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); node.name = parseIdentifier(); - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - node.body = parseAndCheckFunctionBody(false); - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } - function parseConstructorDeclaration(pos, flags) { - var node = createNode(117 /* Constructor */, pos); - node.flags = flags; - parseExpected(103 /* ConstructorKeyword */); - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + function parseConstructorDeclaration(pos, modifiers) { + var node = createNode(126 /* Constructor */, pos); + setModifiers(node, modifiers); + parseExpected(111 /* ConstructorKeyword */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - node.body = parseAndCheckFunctionBody(true); - if (node.typeParameters) { - grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - if (node.type) { - grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } - function parsePropertyMemberDeclaration(pos, flags) { - var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; + function parsePropertyMemberDeclaration(pos, modifiers) { var name = parsePropertyName(); + var flags = modifiers ? modifiers.flags : 0; var questionStart = scanner.getTokenPos(); - if (parseOptional(41 /* QuestionToken */)) { - errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); + if (parseOptional(49 /* QuestionToken */)) { + flags |= 4 /* QuestionMark */; } - if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { - var method = createNode(116 /* Method */, pos); - method.flags = flags; + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + var method = createNode(125 /* Method */, pos); + setModifiers(method, modifiers); + if (flags) { + method.flags = flags; + } method.name = name; - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); method.typeParameters = sig.typeParameters; method.parameters = sig.parameters; method.type = sig.type; - method.body = parseAndCheckFunctionBody(false); + method.body = parseFunctionBlockOrSemicolon(); return finishNode(method); } else { - var property = createNode(115 /* Property */, pos); - property.flags = flags; + var property = createNode(124 /* Property */, pos); + setModifiers(property, modifiers); + if (flags) { + property.flags = flags; + } property.name = name; property.type = parseTypeAnnotation(); var initializerStart = scanner.getTokenPos(); var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; property.initializer = parseInitializer(false); parseSemicolon(); - if (inAmbientContext && property.initializer && errorCountBeforePropertyDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } return finishNode(property); } } - function parseAndCheckMemberAccessorDeclaration(kind, pos, flags) { - var errorCountBeforeAccessor = file.syntacticErrors.length; - var accessor = parseMemberAccessorDeclaration(kind, pos, flags); - if (errorCountBeforeAccessor === file.syntacticErrors.length) { - if (languageVersion < 1 /* ES5 */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (inAmbientContext) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); - } - else if (accessor.typeParameters) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); - } - else if (kind === 118 /* GetAccessor */ && accessor.parameters.length) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); - } - else if (kind === 119 /* SetAccessor */) { - if (accessor.type) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - else if (accessor.parameters.length !== 1) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); - } - else { - var parameter = accessor.parameters[0]; - if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - else if (parameter.flags & ts.NodeFlags.Modifier) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - else if (parameter.initializer) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - } - } - return accessor; - } - function parseMemberAccessorDeclaration(kind, pos, flags) { + function parseMemberAccessorDeclaration(kind, pos, modifiers) { var node = createNode(kind, pos); - node.flags = flags; + setModifiers(node, modifiers); node.name = parsePropertyName(); - var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - if (inAmbientContext && canParseSemicolon()) { - parseSemicolon(); - node.body = createMissingNode(); - } - else { - node.body = parseBody(false); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } function isClassMemberStart() { @@ -4618,19 +4353,19 @@ var ts; idToken = token; nextToken(); } - if (token === 9 /* OpenBracketToken */) { + if (token === 17 /* OpenBracketToken */) { return true; } if (idToken !== undefined) { - if (!isKeyword(idToken) || idToken === 109 /* SetKeyword */ || idToken === 105 /* GetKeyword */) { + if (!isKeyword(idToken) || idToken === 117 /* SetKeyword */ || idToken === 113 /* GetKeyword */) { return true; } switch (token) { - case 7 /* OpenParenToken */: - case 15 /* LessThanToken */: - case 42 /* ColonToken */: - case 43 /* EqualsToken */: - case 41 /* QuestionToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 50 /* ColonToken */: + case 51 /* EqualsToken */: + case 49 /* QuestionToken */: return true; default: return canParseSemicolon(); @@ -4638,232 +4373,104 @@ var ts; } return false; } - function parseAndCheckModifiers(context) { + function parseModifiers(context) { var flags = 0; - var lastStaticModifierStart; - var lastStaticModifierLength; - var lastDeclareModifierStart; - var lastDeclareModifierLength; - var lastPrivateModifierStart; - var lastPrivateModifierLength; + var modifiers; while (true) { var modifierStart = scanner.getTokenPos(); var modifierToken = token; if (!parseAnyContextualModifier()) break; - var modifierLength = scanner.getStartPos() - modifierStart; - switch (modifierToken) { - case 98 /* PublicKeyword */: - if (flags & 32 /* Private */ || flags & 16 /* Public */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 64 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); - } - flags |= 16 /* Public */; - break; - case 96 /* PrivateKeyword */: - if (flags & 32 /* Private */ || flags & 16 /* Public */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 64 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); - } - lastPrivateModifierStart = modifierStart; - lastPrivateModifierLength = modifierLength; - flags |= 32 /* Private */; - break; - case 99 /* StaticKeyword */: - if (flags & 64 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } - lastStaticModifierStart = modifierStart; - lastStaticModifierLength = modifierLength; - flags |= 64 /* Static */; - break; - case 68 /* ExportKeyword */: - if (flags & 1 /* Export */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); - } - else if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 104 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } - else if (inAmbientContext && context === 1 /* ModuleElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } - lastDeclareModifierStart = modifierStart; - lastDeclareModifierLength = modifierLength; - flags |= 2 /* Ambient */; - break; + if (!modifiers) { + modifiers = []; } + flags |= modifierToFlag(modifierToken); + modifiers.push(finishNode(createNode(modifierToken, modifierStart))); } - if (token === 103 /* ConstructorKeyword */ && flags & 64 /* Static */) { - grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + if (modifiers) { + modifiers.flags = flags; } - else if (token === 103 /* ConstructorKeyword */ && flags & 32 /* Private */) { - grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); - } - else if (token === 75 /* ImportKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } - } - else if (token === 93 /* InterfaceKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); - } - } - else if (token !== 68 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { - var declarationStart = scanner.getTokenPos(); - var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; - grammarErrorAtPos(declarationStart, declarationFirstTokenLength, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - } - return flags; + return modifiers; } function parseClassMemberDeclaration() { var pos = getNodePos(); - var flags = parseAndCheckModifiers(2 /* ClassMembers */); - if (parseContextualModifier(105 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(118 /* GetAccessor */, pos, flags); + var modifiers = parseModifiers(2 /* ClassMembers */); + if (parseContextualModifier(113 /* GetKeyword */)) { + return parseMemberAccessorDeclaration(127 /* GetAccessor */, pos, modifiers); } - if (parseContextualModifier(109 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(119 /* SetAccessor */, pos, flags); + if (parseContextualModifier(117 /* SetKeyword */)) { + return parseMemberAccessorDeclaration(128 /* SetAccessor */, pos, modifiers); } - if (token === 103 /* ConstructorKeyword */) { - return parseConstructorDeclaration(pos, flags); + if (token === 111 /* ConstructorKeyword */) { + return parseConstructorDeclaration(pos, modifiers); } - if (token >= 55 /* Identifier */ || token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */) { - return parsePropertyMemberDeclaration(pos, flags); + if (token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { + return parsePropertyMemberDeclaration(pos, modifiers); } - if (token === 9 /* OpenBracketToken */) { - if (flags) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - return parseIndexSignatureMember(); + if (token === 17 /* OpenBracketToken */) { + return parseIndexSignatureMember(modifiers, pos); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassDeclaration(pos, flags) { - var node = createNode(169 /* ClassDeclaration */, pos); + var node = createNode(187 /* ClassDeclaration */, pos); node.flags = flags; - var errorCountBeforeClassDeclaration = file.syntacticErrors.length; - parseExpected(59 /* ClassKeyword */); + parseExpected(67 /* ClassKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - node.baseType = parseOptional(69 /* ExtendsKeyword */) ? parseTypeReference() : undefined; - var implementsKeywordStart = scanner.getTokenPos(); - var implementsKeywordLength; - if (parseOptional(92 /* ImplementsKeyword */)) { - implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; - node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, 0 /* Disallow */); + node.baseType = parseOptional(77 /* ExtendsKeyword */) ? parseTypeReference() : undefined; + if (parseOptional(100 /* ImplementsKeyword */)) { + node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference); } - var errorCountBeforeClassBody = file.syntacticErrors.length; - if (parseExpected(5 /* OpenBraceToken */)) { + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(6 /* ClassMembers */, false, parseClassMemberDeclaration); - parseExpected(6 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); } - if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { - grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "implements"); - } return finishNode(node); } function parseInterfaceDeclaration(pos, flags) { - var node = createNode(170 /* InterfaceDeclaration */, pos); + var node = createNode(188 /* InterfaceDeclaration */, pos); node.flags = flags; - var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; - parseExpected(93 /* InterfaceKeyword */); + parseExpected(101 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - var extendsKeywordStart = scanner.getTokenPos(); - var extendsKeywordLength; - if (parseOptional(69 /* ExtendsKeyword */)) { - extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; - node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, 0 /* Disallow */); + if (parseOptional(77 /* ExtendsKeyword */)) { + node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference); } - var errorCountBeforeInterfaceBody = file.syntacticErrors.length; node.members = parseTypeLiteral().members; - if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { - grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "extends"); - } + return finishNode(node); + } + function parseTypeAliasDeclaration(pos, flags) { + var node = createNode(189 /* TypeAliasDeclaration */, pos); + node.flags = flags; + parseExpected(119 /* TypeKeyword */); + node.name = parseIdentifier(); + parseExpected(51 /* EqualsToken */); + node.type = parseType(); + parseSemicolon(); return finishNode(node); } function parseAndCheckEnumDeclaration(pos, flags) { - function isIntegerLiteral(expression) { - function isInteger(literalExpression) { - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); - } - if (expression.kind === 138 /* PrefixOperator */) { - var unaryExpression = expression; - if (unaryExpression.operator === 24 /* PlusToken */ || unaryExpression.operator === 25 /* MinusToken */) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 2 /* NumericLiteral */) { - return isInteger(expression); - } - return false; - } - var inConstantEnumMemberSection = true; - function parseAndCheckEnumMember() { - var node = createNode(176 /* EnumMember */); - var errorCountBeforeEnumMember = file.syntacticErrors.length; + var enumIsConst = flags & 4096 /* Const */; + function parseEnumMember() { + var node = createNode(195 /* EnumMember */); node.name = parsePropertyName(); node.initializer = parseInitializer(false); - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); - } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer); - } return finishNode(node); } - var node = createNode(171 /* EnumDeclaration */, pos); + var node = createNode(190 /* EnumDeclaration */, pos); node.flags = flags; - parseExpected(67 /* EnumKeyword */); + if (enumIsConst) { + parseExpected(68 /* ConstKeyword */); + } + parseExpected(75 /* EnumKeyword */); node.name = parseIdentifier(); - if (parseExpected(5 /* OpenBraceToken */)) { - node.members = parseDelimitedList(7 /* EnumMembers */, parseAndCheckEnumMember, 1 /* Allow */); - parseExpected(6 /* CloseBraceToken */); + if (parseExpected(13 /* OpenBraceToken */)) { + node.members = parseDelimitedList(7 /* EnumMembers */, parseEnumMember); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -4871,10 +4478,10 @@ var ts; return finishNode(node); } function parseModuleBody() { - var node = createNode(173 /* ModuleBlock */); - if (parseExpected(5 /* OpenBraceToken */)) { + var node = createNode(192 /* ModuleBlock */); + if (parseExpected(13 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); - parseExpected(6 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -4882,55 +4489,38 @@ var ts; return finishNode(node); } function parseInternalModuleTail(pos, flags) { - var node = createNode(172 /* ModuleDeclaration */, pos); + var node = createNode(191 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseIdentifier(); - if (parseOptional(11 /* DotToken */)) { + if (parseOptional(19 /* DotToken */)) { node.body = parseInternalModuleTail(getNodePos(), 1 /* Export */); } else { node.body = parseModuleBody(); - ts.forEach(node.body.statements, function (s) { - if (s.kind === 175 /* ExportAssignment */) { - grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); - } - else if (s.kind === 174 /* ImportDeclaration */ && s.externalModuleName) { - grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - }); } return finishNode(node); } function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(172 /* ModuleDeclaration */, pos); + var node = createNode(191 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseStringLiteral(); - if (!inAmbientContext) { - var errorCount = file.syntacticErrors.length; - if (!errorCount || file.syntacticErrors[errorCount - 1].start < getTokenPos(pos)) { - grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - var saveInAmbientContext = inAmbientContext; - inAmbientContext = true; node.body = parseModuleBody(); - inAmbientContext = saveInAmbientContext; return finishNode(node); } function parseModuleDeclaration(pos, flags) { - parseExpected(106 /* ModuleKeyword */); - return token === 3 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); + parseExpected(114 /* ModuleKeyword */); + return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); } function parseImportDeclaration(pos, flags) { - var node = createNode(174 /* ImportDeclaration */, pos); + var node = createNode(193 /* ImportDeclaration */, pos); node.flags = flags; - parseExpected(75 /* ImportKeyword */); + parseExpected(83 /* ImportKeyword */); node.name = parseIdentifier(); - parseExpected(43 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); var entityName = parseEntityName(false); - if (entityName.kind === 55 /* Identifier */ && entityName.text === "require" && parseOptional(7 /* OpenParenToken */)) { + if (entityName.kind === 63 /* Identifier */ && entityName.text === "require" && parseOptional(15 /* OpenParenToken */)) { node.externalModuleName = parseStringLiteral(); - parseExpected(8 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); } else { node.entityName = entityName; @@ -4938,87 +4528,98 @@ var ts; parseSemicolon(); return finishNode(node); } - function parseExportAssignmentTail(pos) { - var node = createNode(175 /* ExportAssignment */, pos); + function parseExportAssignmentTail(pos, modifiers) { + var node = createNode(194 /* ExportAssignment */, pos); + setModifiers(node, modifiers); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); } - function isDeclaration() { + function isDeclarationStart() { switch (token) { - case 88 /* VarKeyword */: - case 73 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: + case 81 /* FunctionKeyword */: return true; - case 59 /* ClassKeyword */: - case 93 /* InterfaceKeyword */: - case 67 /* EnumKeyword */: - case 75 /* ImportKeyword */: - return lookAhead(function () { return nextToken() >= 55 /* Identifier */; }); - case 106 /* ModuleKeyword */: - return lookAhead(function () { return nextToken() >= 55 /* Identifier */ || token === 3 /* StringLiteral */; }); - case 68 /* ExportKeyword */: - return lookAhead(function () { return nextToken() === 43 /* EqualsToken */ || isDeclaration(); }); - case 104 /* DeclareKeyword */: - case 98 /* PublicKeyword */: - case 96 /* PrivateKeyword */: - case 99 /* StaticKeyword */: + case 67 /* ClassKeyword */: + case 101 /* InterfaceKeyword */: + case 75 /* EnumKeyword */: + case 83 /* ImportKeyword */: + case 119 /* TypeKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */; }); + case 114 /* ModuleKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */ || token === 7 /* StringLiteral */; }); + case 76 /* ExportKeyword */: + return lookAhead(function () { return nextToken() === 51 /* EqualsToken */ || isDeclarationStart(); }); + case 112 /* DeclareKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: return lookAhead(function () { nextToken(); - return isDeclaration(); + return isDeclarationStart(); }); } } function parseDeclaration(modifierContext) { var pos = getNodePos(); - var errorCountBeforeModifiers = file.syntacticErrors.length; - var flags = parseAndCheckModifiers(modifierContext); - if (token === 68 /* ExportKeyword */) { + var modifiers = parseModifiers(modifierContext); + if (token === 76 /* ExportKeyword */) { var modifiersEnd = scanner.getStartPos(); nextToken(); - if (parseOptional(43 /* EqualsToken */)) { - var exportAssignmentTail = parseExportAssignmentTail(pos); - if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { - var modifiersStart = ts.skipTrivia(sourceText, pos); - grammarErrorAtPos(modifiersStart, modifiersEnd - modifiersStart, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); - } - return exportAssignmentTail; + if (parseOptional(51 /* EqualsToken */)) { + return parseExportAssignmentTail(pos, modifiers); } } - var saveInAmbientContext = inAmbientContext; - if (flags & 2 /* Ambient */) { - inAmbientContext = true; - } + var flags = modifiers ? modifiers.flags : 0; var result; switch (token) { - case 88 /* VarKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: result = parseVariableStatement(pos, flags); break; - case 73 /* FunctionKeyword */: + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + if (isConstEnum) { + result = parseAndCheckEnumDeclaration(pos, flags | 4096 /* Const */); + } + else { + result = parseVariableStatement(pos, flags); + } + break; + case 81 /* FunctionKeyword */: result = parseFunctionDeclaration(pos, flags); break; - case 59 /* ClassKeyword */: + case 67 /* ClassKeyword */: result = parseClassDeclaration(pos, flags); break; - case 93 /* InterfaceKeyword */: + case 101 /* InterfaceKeyword */: result = parseInterfaceDeclaration(pos, flags); break; - case 67 /* EnumKeyword */: + case 119 /* TypeKeyword */: + result = parseTypeAliasDeclaration(pos, flags); + break; + case 75 /* EnumKeyword */: result = parseAndCheckEnumDeclaration(pos, flags); break; - case 106 /* ModuleKeyword */: + case 114 /* ModuleKeyword */: result = parseModuleDeclaration(pos, flags); break; - case 75 /* ImportKeyword */: + case 83 /* ImportKeyword */: result = parseImportDeclaration(pos, flags); break; default: error(ts.Diagnostics.Declaration_expected); } - inAmbientContext = saveInAmbientContext; + if (modifiers) { + result.modifiers = modifiers; + } return result; } function isSourceElement(inErrorRecovery) { - return isDeclaration() || isStatement(inErrorRecovery); + return isDeclarationStart() || isStatement(inErrorRecovery); } function parseSourceElement() { return parseSourceElementOrModuleElement(0 /* SourceElements */); @@ -5027,49 +4628,38 @@ var ts; return parseSourceElementOrModuleElement(1 /* ModuleElements */); } function parseSourceElementOrModuleElement(modifierContext) { - if (isDeclaration()) { - return parseDeclaration(modifierContext); - } - var statementStart = scanner.getTokenPos(); - var statementFirstTokenLength = scanner.getTextPos() - statementStart; - var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(); - if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { - grammarErrorAtPos(statementStart, statementFirstTokenLength, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - return statement; + return isDeclarationStart() ? parseDeclaration(modifierContext) : parseStatement(); } function processReferenceComments() { var referencedFiles = []; var amdDependencies = []; + var amdModuleName; commentRanges = []; token = scanner.scan(); for (var i = 0; i < commentRanges.length; i++) { var range = commentRanges[i]; var comment = sourceText.substring(range.pos, range.end); - var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (isNoDefaultLibRegEx.exec(comment)) { - file.hasNoDefaultLib = true; + var referencePathMatchResult = getFileReferenceFromReferencePath(comment, range); + if (referencePathMatchResult) { + var fileReference = referencePathMatchResult.fileReference; + file.hasNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + var diagnostic = referencePathMatchResult.diagnostic; + if (fileReference) { + referencedFiles.push(fileReference); } - else { - var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - if (!matchResult) { - var start = range.pos; - var length = range.end - start; - errorAtPos(start, length, ts.Diagnostics.Invalid_reference_directive_syntax); - } - else { - referencedFiles.push({ - pos: range.pos, - end: range.end, - filename: matchResult[3] - }); - } + if (diagnostic) { + errorAtPos(range.pos, range.end - range.pos, diagnostic); } } else { + var amdModuleNameRegEx = /^\/\/\/\s* 0) { + syntacticDiagnostics = file.parseDiagnostics; + } + else { + syntacticDiagnostics = file.grammarDiagnostics; + checkGrammar(sourceText, languageVersion, file); + } + } + ts.Debug.assert(syntacticDiagnostics !== undefined); + return syntacticDiagnostics; + } + scanner = ts.createScanner(languageVersion, true, sourceText, scanError, onComment); var rootNodeFlags = 0; if (ts.fileExtensionIs(filename, ".d.ts")) { - rootNodeFlags = 512 /* DeclarationFile */; - inAmbientContext = true; + rootNodeFlags = 1024 /* DeclarationFile */; } - file = createRootNode(177 /* SourceFile */, 0, sourceText.length, rootNodeFlags); + file = createRootNode(196 /* SourceFile */, 0, sourceText.length, rootNodeFlags); file.filename = ts.normalizePath(filename); file.text = sourceText; - file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; + file.getLineAndCharacterFromPosition = getLineAndCharacterFromSourcePosition; file.getPositionFromLineAndCharacter = getPositionFromSourceLineAndCharacter; - file.syntacticErrors = []; - file.semanticErrors = []; + file.getLineStarts = getLineStarts; + file.getSyntacticDiagnostics = getSyntacticDiagnostics; + file.parseDiagnostics = []; + file.grammarDiagnostics = []; + file.semanticDiagnostics = []; var referenceComments = processReferenceComments(); file.referencedFiles = referenceComments.referencedFiles; file.amdDependencies = referenceComments.amdDependencies; + file.amdModuleName = referenceComments.amdModuleName; file.statements = parseList(0 /* SourceElements */, true, parseSourceElement); file.externalModuleIndicator = getExternalModuleIndicator(); file.nodeCount = nodeCount; @@ -5109,9 +4717,905 @@ var ts; file.version = version; file.isOpen = isOpen; file.languageVersion = languageVersion; + file.identifiers = identifiers; return file; } ts.createSourceFile = createSourceFile; + function isLeftHandSideExpression(expr) { + if (expr) { + switch (expr.kind) { + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 148 /* NewExpression */: + case 147 /* CallExpression */: + case 149 /* TaggedTemplateExpression */: + case 141 /* ArrayLiteral */: + case 151 /* ParenExpression */: + case 142 /* ObjectLiteral */: + case 152 /* FunctionExpression */: + case 63 /* Identifier */: + case 120 /* Missing */: + case 8 /* RegularExpressionLiteral */: + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 158 /* TemplateExpression */: + case 78 /* FalseKeyword */: + case 87 /* NullKeyword */: + case 91 /* ThisKeyword */: + case 93 /* TrueKeyword */: + case 89 /* SuperKeyword */: + return true; + } + } + return false; + } + function isAssignmentOperator(token) { + return token >= 51 /* FirstAssignment */ && token <= 62 /* LastAssignment */; + } + function checkGrammar(sourceText, languageVersion, file) { + var grammarDiagnostics = file.grammarDiagnostics; + var scanner = ts.createScanner(languageVersion, true, sourceText); + var inAmbientContext = ts.fileExtensionIs(file.filename, ".d.ts"); + var inFunctionBlock = false; + var parent; + visitNode(file); + function visitNode(node) { + var savedParent = parent; + node.parent = parent; + parent = node; + if (!checkModifiers(node)) { + var savedInFunctionBlock = inFunctionBlock; + if (node.kind === 186 /* FunctionBlock */) { + inFunctionBlock = true; + } + var savedInAmbientContext = inAmbientContext; + if (node.flags & 2 /* Ambient */) { + inAmbientContext = true; + } + checkNodeAndChildren(node); + inAmbientContext = savedInAmbientContext; + inFunctionBlock = savedInFunctionBlock; + } + parent = savedParent; + } + function checkNodeAndChildren(node) { + var nodeKind = node.kind; + if (inAmbientContext && checkForStatementInAmbientContext(node, nodeKind)) { + return; + } + if (checkNode(node, nodeKind)) { + return; + } + forEachChild(node, visitNode); + } + function checkNode(node, nodeKind) { + switch (nodeKind) { + case 153 /* ArrowFunction */: + case 129 /* CallSignature */: + case 134 /* ConstructorType */: + case 130 /* ConstructSignature */: + case 133 /* FunctionType */: + return checkAnyParsedSignature(node); + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + return checkBreakOrContinueStatement(node); + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return checkCallOrNewExpression(node); + case 190 /* EnumDeclaration */: return checkEnumDeclaration(node); + case 123 /* Parameter */: return checkParameter(node); + case 156 /* BinaryExpression */: return checkBinaryExpression(node); + case 181 /* CatchBlock */: return checkCatchBlock(node); + case 187 /* ClassDeclaration */: return checkClassDeclaration(node); + case 126 /* Constructor */: return checkConstructor(node); + case 194 /* ExportAssignment */: return checkExportAssignment(node); + case 169 /* ForInStatement */: return checkForInStatement(node); + case 168 /* ForStatement */: return checkForStatement(node); + case 185 /* FunctionDeclaration */: return checkFunctionDeclaration(node); + case 152 /* FunctionExpression */: return checkFunctionExpression(node); + case 127 /* GetAccessor */: return checkGetAccessor(node); + case 146 /* IndexedAccess */: return checkIndexedAccess(node); + case 131 /* IndexSignature */: return checkIndexSignature(node); + case 188 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); + case 177 /* LabeledStatement */: return checkLabeledStatement(node); + case 125 /* Method */: return checkMethod(node); + case 191 /* ModuleDeclaration */: return checkModuleDeclaration(node); + case 142 /* ObjectLiteral */: return checkObjectLiteral(node); + case 6 /* NumericLiteral */: return checkNumericLiteral(node); + case 155 /* PostfixOperator */: return checkPostfixOperator(node); + case 154 /* PrefixOperator */: return checkPrefixOperator(node); + case 124 /* Property */: return checkProperty(node); + case 143 /* PropertyAssignment */: return checkPropertyAssignment(node); + case 172 /* ReturnStatement */: return checkReturnStatement(node); + case 128 /* SetAccessor */: return checkSetAccessor(node); + case 196 /* SourceFile */: return checkSourceFile(node); + case 144 /* ShorthandPropertyAssignment */: return checkShorthandPropertyAssignment(node); + case 174 /* SwitchStatement */: return checkSwitchStatement(node); + case 149 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); + case 138 /* TupleType */: return checkTupleType(node); + case 122 /* TypeParameter */: return checkTypeParameter(node); + case 132 /* TypeReference */: return checkTypeReference(node); + case 184 /* VariableDeclaration */: return checkVariableDeclaration(node); + case 162 /* VariableStatement */: return checkVariableStatement(node); + case 173 /* WithStatement */: return checkWithStatement(node); + } + } + function grammarErrorOnFirstToken(node, message, arg0, arg1, arg2) { + var start = ts.skipTrivia(sourceText, node.pos); + scanner.setTextPos(start); + scanner.scan(); + var end = scanner.getTextPos(); + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, end - start, message, arg0, arg1, arg2)); + return true; + } + function grammarErrorOnNode(node, message, arg0, arg1, arg2) { + var span = getErrorSpanForNode(node); + var start = span.end > span.pos ? ts.skipTrivia(file.text, span.pos) : span.pos; + var length = span.end - start; + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + function reportInvalidUseInStrictMode(node) { + var name = sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); + return grammarErrorOnNode(node, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, name); + } + function checkForStatementInAmbientContext(node, kind) { + switch (kind) { + case 161 /* Block */: + case 163 /* EmptyStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 183 /* DebuggerStatement */: + case 177 /* LabeledStatement */: + case 164 /* ExpressionStatement */: + return grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + } + } + function checkAnyParsedSignature(node) { + return checkTypeParameterList(node.typeParameters) || checkParameterList(node.parameters); + } + function checkBinaryExpression(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + if (isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operator)) { + if (isEvalOrArgumentsIdentifier(node.left)) { + return reportInvalidUseInStrictMode(node.left); + } + } + } + } + function isIterationStatement(node, lookInLabeledStatements) { + switch (node.kind) { + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + return true; + case 177 /* LabeledStatement */: + return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); + } + return false; + } + function checkLabeledStatement(node) { + var current = node.parent; + while (current) { + if (isAnyFunction(current)) { + break; + } + if (current.kind === 177 /* LabeledStatement */ && current.label.text === node.label.text) { + return grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); + } + current = current.parent; + } + } + function checkBreakOrContinueStatement(node) { + var current = node; + while (current) { + if (isAnyFunction(current)) { + return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); + } + switch (current.kind) { + case 177 /* LabeledStatement */: + if (node.label && current.label.text === node.label.text) { + var isMisplacedContinueLabel = node.kind === 170 /* ContinueStatement */ && !isIterationStatement(current.statement, true); + if (isMisplacedContinueLabel) { + return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); + } + return false; + } + break; + case 174 /* SwitchStatement */: + if (node.kind === 171 /* BreakStatement */ && !node.label) { + return false; + } + break; + default: + if (isIterationStatement(current, false) && !node.label) { + return false; + } + break; + } + current = current.parent; + } + if (node.label) { + var message = node.kind === 171 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } + else { + var message = node.kind === 171 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } + } + function checkCallOrNewExpression(node) { + return checkTypeArguments(node.typeArguments) || checkArguments(node.arguments); + } + function checkArguments(arguments) { + return checkForDisallowedTrailingComma(arguments) || checkForOmittedArgument(arguments); + } + function checkTypeArguments(typeArguments) { + return checkForDisallowedTrailingComma(typeArguments) || checkForAtLeastOneTypeArgument(typeArguments) || checkForMissingTypeArgument(typeArguments); + } + function checkForOmittedArgument(arguments) { + if (arguments) { + for (var i = 0, n = arguments.length; i < n; i++) { + var arg = arguments[i]; + if (arg.kind === 160 /* OmittedExpression */) { + return grammarErrorAtPos(arg.pos, 0, ts.Diagnostics.Argument_expression_expected); + } + } + } + } + function checkForMissingTypeArgument(typeArguments) { + if (typeArguments) { + for (var i = 0, n = typeArguments.length; i < n; i++) { + var arg = typeArguments[i]; + if (arg.kind === 120 /* Missing */) { + return grammarErrorAtPos(arg.pos, 0, ts.Diagnostics.Type_expected); + } + } + } + } + function checkForAtLeastOneTypeArgument(typeArguments) { + if (typeArguments && typeArguments.length === 0) { + var start = typeArguments.pos - "<".length; + var end = ts.skipTrivia(sourceText, typeArguments.end) + ">".length; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty); + } + } + function checkForDisallowedTrailingComma(list) { + if (list && list.hasTrailingComma) { + var start = list.end - ",".length; + var end = list.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); + } + } + function checkCatchBlock(node) { + if (node.type) { + var colonStart = ts.skipTrivia(sourceText, node.variable.end); + return grammarErrorAtPos(colonStart, ":".length, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); + } + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.variable)) { + return reportInvalidUseInStrictMode(node.variable); + } + } + function checkClassDeclaration(node) { + return checkForDisallowedTrailingComma(node.implementedTypes) || checkForAtLeastOneHeritageClause(node.implementedTypes, "implements"); + } + function checkForAtLeastOneHeritageClause(types, listType) { + if (types && types.length === 0) { + return grammarErrorAtPos(types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); + } + } + function checkConstructor(node) { + return checkAnyParsedSignature(node) || checkConstructorTypeParameters(node) || checkConstructorTypeAnnotation(node) || checkForBodyInAmbientContext(node.body, true); + } + function checkConstructorTypeParameters(node) { + if (node.typeParameters) { + return grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + } + function checkConstructorTypeAnnotation(node) { + if (node.type) { + return grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + } + function checkEnumDeclaration(enumDecl) { + var enumIsConst = (enumDecl.flags & 4096 /* Const */) !== 0; + var hasError = false; + if (!enumIsConst) { + var inConstantEnumMemberSection = true; + for (var i = 0, n = enumDecl.members.length; i < n; i++) { + var node = enumDecl.members[i]; + if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer)) { + hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers) || hasError; + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection) { + hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer) || hasError; + } + } + } + return hasError; + } + function isIntegerLiteral(expression) { + function isInteger(literalExpression) { + return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); + } + if (expression.kind === 154 /* PrefixOperator */) { + var unaryExpression = expression; + if (unaryExpression.operator === 32 /* PlusToken */ || unaryExpression.operator === 33 /* MinusToken */) { + expression = unaryExpression.operand; + } + } + if (expression.kind === 6 /* NumericLiteral */) { + return isInteger(expression); + } + return false; + } + function checkExportAssignment(node) { + if (node.flags & 243 /* Modifier */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); + } + } + function checkForInStatement(node) { + return checkVariableDeclarations(node.declarations) || checkForMoreThanOneDeclaration(node.declarations); + } + function checkForStatement(node) { + return checkVariableDeclarations(node.declarations); + } + function checkForMoreThanOneDeclaration(declarations) { + if (declarations && declarations.length > 1) { + return grammarErrorOnFirstToken(declarations[1], ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + } + } + function checkFunctionDeclaration(node) { + return checkAnyParsedSignature(node) || checkFunctionName(node.name) || checkForBodyInAmbientContext(node.body, false); + } + function checkFunctionExpression(node) { + return checkAnyParsedSignature(node) || checkFunctionName(node.name); + } + function checkFunctionName(name) { + if (name && name.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(name)) { + return reportInvalidUseInStrictMode(name); + } + } + function checkGetAccessor(node) { + return checkAnyParsedSignature(node) || checkAccessor(node); + } + function checkIndexedAccess(node) { + if (node.index.kind === 120 /* Missing */ && node.parent.kind === 148 /* NewExpression */ && node.parent.func === node) { + var start = ts.skipTrivia(sourceText, node.parent.pos); + var end = node.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + } + function checkIndexSignature(node) { + return checkIndexSignatureParameters(node) || checkForIndexSignatureModifiers(node); + } + function checkForIndexSignatureModifiers(node) { + if (node.flags & 243 /* Modifier */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); + } + } + function checkIndexSignatureParameters(node) { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + if (parameter) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + else { + return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + } + else if (parameter.flags & 8 /* Rest */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + } + else if (parameter.flags & 243 /* Modifier */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + } + else if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + } + else if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + } + else if (!parameter.type) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + } + else if (parameter.type.kind !== 118 /* StringKeyword */ && parameter.type.kind !== 116 /* NumberKeyword */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); + } + else if (!node.type) { + return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); + } + } + function checkInterfaceDeclaration(node) { + return checkForDisallowedTrailingComma(node.baseTypes) || checkForAtLeastOneHeritageClause(node.baseTypes, "extends"); + } + function checkMethod(node) { + return checkAnyParsedSignature(node) || checkForBodyInAmbientContext(node.body, false) || (node.parent.kind === 187 /* ClassDeclaration */ && checkForInvalidQuestionMark(node, ts.Diagnostics.A_class_member_cannot_be_declared_optional)); + } + function checkForBodyInAmbientContext(body, isConstructor) { + if (inAmbientContext && body && body.kind === 186 /* FunctionBlock */) { + var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; + return grammarErrorOnFirstToken(body, diagnostic); + } + } + function checkModuleDeclaration(node) { + return checkModuleDeclarationName(node) || checkModuleDeclarationStatements(node); + } + function checkModuleDeclarationName(node) { + if (!inAmbientContext && node.name.kind === 7 /* StringLiteral */) { + return grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); + } + } + function checkModuleDeclarationStatements(node) { + if (node.name.kind === 63 /* Identifier */ && node.body.kind === 192 /* ModuleBlock */) { + var statements = node.body.statements; + for (var i = 0, n = statements.length; i < n; i++) { + var statement = statements[i]; + if (statement.kind === 194 /* ExportAssignment */) { + return grammarErrorOnNode(statement, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + } + else if (statement.kind === 193 /* ImportDeclaration */ && statement.externalModuleName) { + return grammarErrorOnNode(statement.externalModuleName, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + } + } + } + } + function checkObjectLiteral(node) { + var seen = {}; + var Property = 1; + var GetAccessor = 2; + var SetAccesor = 4; + var GetOrSetAccessor = GetAccessor | SetAccesor; + var inStrictMode = (node.flags & 8192 /* ParsedInStrictMode */) !== 0; + for (var i = 0, n = node.properties.length; i < n; i++) { + var prop = node.properties[i]; + if (prop.kind === 160 /* OmittedExpression */) { + continue; + } + var p = prop; + var name = p.name; + var currentKind; + if (p.kind === 143 /* PropertyAssignment */) { + currentKind = Property; + } + else if (p.kind === 144 /* ShorthandPropertyAssignment */) { + currentKind = Property; + } + else if (p.kind === 127 /* GetAccessor */) { + currentKind = GetAccessor; + } + else if (p.kind === 128 /* SetAccessor */) { + currentKind = SetAccesor; + } + else { + ts.Debug.fail("Unexpected syntax kind:" + p.kind); + } + if (!ts.hasProperty(seen, name.text)) { + seen[name.text] = currentKind; + } + else { + var existingKind = seen[name.text]; + if (currentKind === Property && existingKind === Property) { + if (inStrictMode) { + grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + } + } + else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { + if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { + seen[name.text] = currentKind | existingKind; + } + else { + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + } + } + else { + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + } + } + } + } + function checkNumericLiteral(node) { + if (node.flags & 16384 /* OctalLiteral */) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); + } + else if (languageVersion >= 1 /* ES5 */) { + return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + } + } + } + function checkModifiers(node) { + switch (node.kind) { + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + case 124 /* Property */: + case 125 /* Method */: + case 131 /* IndexSignature */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 191 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + case 194 /* ExportAssignment */: + case 162 /* VariableStatement */: + case 185 /* FunctionDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 193 /* ImportDeclaration */: + case 123 /* Parameter */: + break; + default: + return false; + } + if (!node.modifiers) { + return; + } + var lastStatic, lastPrivate, lastProtected, lastDeclare; + var flags = 0; + for (var i = 0, n = node.modifiers.length; i < n; i++) { + var modifier = node.modifiers[i]; + switch (modifier.kind) { + case 106 /* PublicKeyword */: + case 105 /* ProtectedKeyword */: + case 104 /* PrivateKeyword */: + var text; + if (modifier.kind === 106 /* PublicKeyword */) { + text = "public"; + } + else if (modifier.kind === 105 /* ProtectedKeyword */) { + text = "protected"; + lastProtected = modifier; + } + else { + text = "private"; + lastPrivate = modifier; + } + if (flags & 112 /* AccessibilityModifier */) { + return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & 128 /* Static */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } + else if (node.parent.kind === 192 /* ModuleBlock */ || node.parent.kind === 196 /* SourceFile */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); + } + flags |= modifierToFlag(modifier.kind); + break; + case 107 /* StaticKeyword */: + if (flags & 128 /* Static */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); + } + else if (node.parent.kind === 192 /* ModuleBlock */ || node.parent.kind === 196 /* SourceFile */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } + flags |= 128 /* Static */; + lastStatic = modifier; + break; + case 76 /* ExportKeyword */: + if (flags & 1 /* Export */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); + } + else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } + else if (node.parent.kind === 187 /* ClassDeclaration */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= 1 /* Export */; + break; + case 112 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); + } + else if (node.parent.kind === 187 /* ClassDeclaration */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } + else if (inAmbientContext && node.parent.kind === 192 /* ModuleBlock */) { + return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } + flags |= 2 /* Ambient */; + lastDeclare = modifier; + break; + } + } + if (node.kind === 126 /* Constructor */) { + if (flags & 128 /* Static */) { + return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + else if (flags & 64 /* Protected */) { + return grammarErrorOnNode(lastProtected, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); + } + else if (flags & 32 /* Private */) { + return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); + } + } + else if (node.kind === 193 /* ImportDeclaration */ && flags & 2 /* Ambient */) { + return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } + else if (node.kind === 188 /* InterfaceDeclaration */ && flags & 2 /* Ambient */) { + return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); + } + } + function checkParameter(node) { + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.name)) { + return reportInvalidUseInStrictMode(node.name); + } + } + function checkTypeParameterList(typeParameters) { + if (checkForDisallowedTrailingComma(typeParameters)) { + return true; + } + if (typeParameters && typeParameters.length === 0) { + var start = typeParameters.pos - "<".length; + var end = ts.skipTrivia(sourceText, typeParameters.end) + ">".length; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); + } + } + function checkParameterList(parameters) { + if (checkForDisallowedTrailingComma(parameters)) { + return true; + } + var seenOptionalParameter = false; + var parameterCount = parameters.length; + for (var i = 0; i < parameterCount; i++) { + var parameter = parameters[i]; + if (parameter.flags & 8 /* Rest */) { + if (i !== (parameterCount - 1)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); + } + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); + } + } + else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { + seenOptionalParameter = true; + if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + } + } + else { + if (seenOptionalParameter) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + } + } + } + } + function checkPostfixOperator(node) { + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + } + function checkPrefixOperator(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + if ((node.operator === 37 /* PlusPlusToken */ || node.operator === 38 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + else if (node.operator === 72 /* DeleteKeyword */ && node.operand.kind === 63 /* Identifier */) { + return grammarErrorOnNode(node.operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); + } + } + } + function checkProperty(node) { + return (node.parent.kind === 187 /* ClassDeclaration */ && checkForInvalidQuestionMark(node, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) || checkForInitializerInAmbientContext(node); + } + function checkForInitializerInAmbientContext(node) { + if (inAmbientContext && node.initializer) { + return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + function checkPropertyAssignment(node) { + return checkForInvalidQuestionMark(node, ts.Diagnostics.An_object_member_cannot_be_declared_optional); + } + function checkForInvalidQuestionMark(node, message) { + if (node.flags & 4 /* QuestionMark */) { + var pos = ts.skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(pos, "?".length, message); + } + } + function checkReturnStatement(node) { + if (!inFunctionBlock) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + } + } + function checkSetAccessor(node) { + return checkAnyParsedSignature(node) || checkAccessor(node); + } + function checkAccessor(accessor) { + var kind = accessor.kind; + if (languageVersion < 1 /* ES5 */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (inAmbientContext) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); + } + else if (accessor.body === undefined) { + return grammarErrorAtPos(accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } + else if (accessor.typeParameters) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); + } + else if (kind === 127 /* GetAccessor */ && accessor.parameters.length) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); + } + else if (kind === 128 /* SetAccessor */) { + if (accessor.type) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + else if (accessor.parameters.length !== 1) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + else { + var parameter = accessor.parameters[0]; + if (parameter.flags & 8 /* Rest */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + else if (parameter.flags & 243 /* Modifier */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + else if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + else if (parameter.initializer) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + } + } + function checkSourceFile(node) { + return inAmbientContext && checkTopLevelElementsForRequiredDeclareModifier(file); + } + function checkTopLevelElementsForRequiredDeclareModifier(file) { + for (var i = 0, n = file.statements.length; i < n; i++) { + var decl = file.statements[i]; + if (isDeclaration(decl) || decl.kind === 162 /* VariableStatement */) { + if (checkTopLevelElementForRequiredDeclareModifier(decl)) { + return true; + } + } + } + } + function checkTopLevelElementForRequiredDeclareModifier(node) { + if (node.kind === 188 /* InterfaceDeclaration */ || node.kind === 193 /* ImportDeclaration */ || node.kind === 194 /* ExportAssignment */ || (node.flags & 2 /* Ambient */)) { + return false; + } + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + } + function checkShorthandPropertyAssignment(node) { + return checkForInvalidQuestionMark(node, ts.Diagnostics.An_object_member_cannot_be_declared_optional); + } + function checkSwitchStatement(node) { + var firstDefaultClause; + for (var i = 0, n = node.clauses.length; i < n; i++) { + var clause = node.clauses[i]; + if (clause.kind === 176 /* DefaultClause */) { + if (firstDefaultClause === undefined) { + firstDefaultClause = clause; + } + else { + var start = ts.skipTrivia(file.text, clause.pos); + var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); + } + } + } + } + function checkTaggedTemplateExpression(node) { + if (languageVersion < 2 /* ES6 */) { + return grammarErrorOnFirstToken(node.template, ts.Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + function checkTupleType(node) { + return checkForDisallowedTrailingComma(node.elementTypes) || checkForAtLeastOneType(node); + } + function checkForAtLeastOneType(node) { + if (node.elementTypes.length === 0) { + return grammarErrorOnNode(node, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); + } + } + function checkTypeParameter(node) { + if (node.expression) { + return grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); + } + } + function checkTypeReference(node) { + return checkTypeArguments(node.typeArguments); + } + function checkVariableDeclaration(node) { + if (inAmbientContext && node.initializer) { + var equalsPos = node.type ? ts.skipTrivia(sourceText, node.type.end) : ts.skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(equalsPos, "=".length, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + if (!inAmbientContext && !node.initializer && node.flags & 4096 /* Const */) { + return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); + } + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.name)) { + return reportInvalidUseInStrictMode(node.name); + } + } + function checkVariableDeclarations(declarations) { + if (declarations) { + if (checkForDisallowedTrailingComma(declarations)) { + return true; + } + if (!declarations.length) { + return grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + var decl = declarations[0]; + if (languageVersion < 2 /* ES6 */) { + if (decl.flags & 2048 /* Let */) { + return grammarErrorOnFirstToken(decl, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (decl.flags & 4096 /* Const */) { + return grammarErrorOnFirstToken(decl, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + } + } + function checkVariableStatement(node) { + return checkVariableDeclarations(node.declarations) || checkForDisallowedLetOrConstStatement(node); + } + function checkForDisallowedLetOrConstStatement(node) { + if (!allowLetAndConstDeclarations(node.parent)) { + if (node.flags & 2048 /* Let */) { + return grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (node.flags & 4096 /* Const */) { + return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } + } + function allowLetAndConstDeclarations(parent) { + switch (parent.kind) { + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 173 /* WithStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + return false; + case 177 /* LabeledStatement */: + return allowLetAndConstDeclarations(parent.parent); + } + return true; + } + function checkWithStatement(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + } function createProgram(rootNames, options, host) { var program; var files = []; @@ -5157,34 +5661,46 @@ var ts; var start = refPos; var length = refEnd - refPos; } + var diagnostic; if (hasExtension(filename)) { if (!ts.fileExtensionIs(filename, ".ts")) { - errors.push(ts.createFileDiagnostic(refFile, start, length, ts.Diagnostics.File_0_must_have_extension_ts_or_d_ts, filename)); + diagnostic = ts.Diagnostics.File_0_must_have_extension_ts_or_d_ts; } else if (!findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) { - errors.push(ts.createFileDiagnostic(refFile, start, length, ts.Diagnostics.File_0_not_found, filename)); + diagnostic = ts.Diagnostics.File_0_not_found; + } + else if (refFile && host.getCanonicalFileName(filename) === host.getCanonicalFileName(refFile.filename)) { + diagnostic = ts.Diagnostics.A_file_cannot_have_a_reference_to_itself; } } else { if (!(findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) || findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd))) { - errors.push(ts.createFileDiagnostic(refFile, start, length, ts.Diagnostics.File_0_not_found, filename + ".ts")); + diagnostic = ts.Diagnostics.File_0_not_found; + filename += ".ts"; + } + } + if (diagnostic) { + if (refFile) { + errors.push(ts.createFileDiagnostic(refFile, start, length, diagnostic, filename)); + } + else { + errors.push(ts.createCompilerDiagnostic(diagnostic, filename)); } } } function findSourceFile(filename, isDefaultLib, refFile, refStart, refLength) { var canonicalName = host.getCanonicalFileName(filename); - var file = getSourceFile(filename); - if (file) { - if (host.useCaseSensitiveFileNames() && canonicalName !== file.filename) { + if (ts.hasProperty(filesByName, canonicalName)) { + var file = filesByName[canonicalName]; + if (file && host.useCaseSensitiveFileNames() && canonicalName !== file.filename) { errors.push(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Filename_0_differs_from_already_included_filename_1_only_in_casing, filename, file.filename)); } } else { - file = host.getSourceFile(filename, options.target, function (hostErrorMessage) { + var file = filesByName[canonicalName] = host.getSourceFile(filename, options.target, function (hostErrorMessage) { errors.push(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Cannot_read_file_0_Colon_1, filename, hostErrorMessage)); }); if (file) { - filesByName[host.getCanonicalFileName(filename)] = file; seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; if (!options.noResolve) { var basePath = ts.getDirectoryPath(filename); @@ -5197,7 +5713,7 @@ var ts; else { files.push(file); } - ts.forEach(file.syntacticErrors, function (e) { + ts.forEach(file.getSyntacticDiagnostics(), function (e) { errors.push(e); }); } @@ -5206,12 +5722,13 @@ var ts; } function processReferencedFiles(file, basePath) { ts.forEach(file.referencedFiles, function (ref) { - processSourceFile(ts.normalizePath(ts.combinePaths(basePath, ref.filename)), false, file, ref.pos, ref.end); + var referencedFilename = ts.isRootedDiskPath(ref.filename) ? ref.filename : ts.combinePaths(basePath, ref.filename); + processSourceFile(ts.normalizePath(referencedFilename), false, file, ref.pos, ref.end); }); } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 174 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 193 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5229,9 +5746,9 @@ var ts; } } } - else if (node.kind === 172 /* ModuleDeclaration */ && node.name.kind === 3 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || file.flags & 512 /* DeclarationFile */)) { + else if (node.kind === 191 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { forEachChild(node.body, function (node) { - if (node.kind === 174 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 193 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5269,12 +5786,12 @@ var ts; if (options.outDir || options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModule !== undefined))) { var commonPathComponents; ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 512 /* DeclarationFile */) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { - var sourcePathCompoments = ts.getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); - sourcePathCompoments.pop(); + if (!(sourceFile.flags & 1024 /* DeclarationFile */) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { + var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); + sourcePathComponents.pop(); if (commonPathComponents) { - for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathCompoments.length); i++) { - if (commonPathComponents[i] !== sourcePathCompoments[i]) { + for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { if (i === 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); return; @@ -5283,16 +5800,16 @@ var ts; break; } } - if (sourcePathCompoments.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathCompoments.length; + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; } } else { - commonPathComponents = sourcePathCompoments; + commonPathComponents = sourcePathComponents; } } }); - commonSourceDirectory = ts.getNormalizedPathFromPathCompoments(commonPathComponents); + commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents); if (commonSourceDirectory) { commonSourceDirectory += ts.directorySeparator; } @@ -5303,33 +5820,50 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function isInstantiated(node) { - if (node.kind === 170 /* InterfaceDeclaration */) { - return false; + function getModuleInstanceState(node) { + if (node.kind === 188 /* InterfaceDeclaration */) { + return 0 /* NonInstantiated */; } - else if (node.kind === 174 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { - return false; + else if (node.kind === 190 /* EnumDeclaration */ && ts.isConstEnumDeclaration(node)) { + return 2 /* ConstEnumOnly */; } - else if (node.kind === 173 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { - return false; + else if (node.kind === 193 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + return 0 /* NonInstantiated */; } - else if (node.kind === 172 /* ModuleDeclaration */ && !isInstantiated(node.body)) { - return false; + else if (node.kind === 192 /* ModuleBlock */) { + var state = 0 /* NonInstantiated */; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0 /* NonInstantiated */: + return false; + case 2 /* ConstEnumOnly */: + state = 2 /* ConstEnumOnly */; + return false; + case 1 /* Instantiated */: + state = 1 /* Instantiated */; + return true; + } + }); + return state; + } + else if (node.kind === 191 /* ModuleDeclaration */) { + return getModuleInstanceState(node.body); } else { - return true; + return 1 /* Instantiated */; } } - ts.isInstantiated = isInstantiated; + ts.getModuleInstanceState = getModuleInstanceState; function bindSourceFile(file) { var parent; var container; + var blockScopeContainer; var lastContainer; var symbolCount = 0; var Symbol = ts.objectAllocator.getSymbolConstructor(); if (!file.locals) { file.locals = {}; - container = file; + container = blockScopeContainer = file; bind(file); file.symbolCount = symbolCount; } @@ -5342,34 +5876,36 @@ var ts; if (!symbol.declarations) symbol.declarations = []; symbol.declarations.push(node); - if (symbolKind & ts.SymbolFlags.HasExports && !symbol.exports) + if (symbolKind & 1952 /* HasExports */ && !symbol.exports) symbol.exports = {}; - if (symbolKind & ts.SymbolFlags.HasMembers && !symbol.members) + if (symbolKind & 6240 /* HasMembers */ && !symbol.members) symbol.members = {}; node.symbol = symbol; - if (symbolKind & ts.SymbolFlags.Value && !symbol.valueDeclaration) + if (symbolKind & 107455 /* Value */ && !symbol.valueDeclaration) symbol.valueDeclaration = node; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 172 /* ModuleDeclaration */ && node.name.kind === 3 /* StringLiteral */) { + if (node.kind === 191 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { return '"' + node.name.text + '"'; } return node.name.text; } switch (node.kind) { - case 117 /* Constructor */: + case 134 /* ConstructorType */: + case 126 /* Constructor */: return "__constructor"; - case 120 /* CallSignature */: + case 133 /* FunctionType */: + case 129 /* CallSignature */: return "__call"; - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: return "__new"; - case 122 /* IndexSignature */: + case 131 /* IndexSignature */: return "__index"; } } function getDisplayName(node) { - return node.name ? ts.identifierToString(node.name) : getDeclarationName(node); + return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); } function declareSymbol(symbols, parent, node, includes, excludes) { var name = getDeclarationName(node); @@ -5379,7 +5915,11 @@ var ts; if (node.name) { node.name.parent = node; } - file.semanticErrors.push(ts.createDiagnosticForNode(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(node))); + var message = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + ts.forEach(symbol.declarations, function (declaration) { + file.semanticDiagnostics.push(ts.createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); + }); + file.semanticDiagnostics.push(ts.createDiagnosticForNode(node.name, message, getDisplayName(node))); symbol = createSymbol(0, name); } } @@ -5388,13 +5928,13 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 169 /* ClassDeclaration */ && symbol.exports) { - var prototypeSymbol = createSymbol(2 /* Property */ | 67108864 /* Prototype */, "prototype"); + if (node.kind === 187 /* ClassDeclaration */ && symbol.exports) { + var prototypeSymbol = createSymbol(4 /* Property */ | 536870912 /* Prototype */, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { node.name.parent = node; } - file.semanticErrors.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + file.semanticDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } symbol.exports[prototypeSymbol.name] = prototypeSymbol; prototypeSymbol.parent = symbol; @@ -5411,16 +5951,16 @@ var ts; } function declareModuleMember(node, symbolKind, symbolExcludes) { var exportKind = 0; - if (symbolKind & ts.SymbolFlags.Value) { - exportKind |= 524288 /* ExportValue */; + if (symbolKind & 107455 /* Value */) { + exportKind |= 4194304 /* ExportValue */; } - if (symbolKind & ts.SymbolFlags.Type) { - exportKind |= 1048576 /* ExportType */; + if (symbolKind & 3152352 /* Type */) { + exportKind |= 8388608 /* ExportType */; } - if (symbolKind & ts.SymbolFlags.Namespace) { - exportKind |= 2097152 /* ExportNamespace */; + if (symbolKind & 1536 /* Namespace */) { + exportKind |= 16777216 /* ExportNamespace */; } - if (node.flags & 1 /* Export */ || (node.kind !== 174 /* ImportDeclaration */ && isAmbientContext(container))) { + if (node.flags & 1 /* Export */ || (node.kind !== 193 /* ImportDeclaration */ && isAmbientContext(container))) { if (exportKind) { var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); @@ -5434,14 +5974,15 @@ var ts; declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); } } - function bindChildren(node, symbolKind) { - if (symbolKind & ts.SymbolFlags.HasLocals) { + function bindChildren(node, symbolKind, isBlockScopeContainer) { + if (symbolKind & 1041936 /* HasLocals */) { node.locals = {}; } var saveParent = parent; var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; parent = node; - if (symbolKind & ts.SymbolFlags.IsContainer) { + if (symbolKind & 1048560 /* IsContainer */) { container = node; if (lastContainer !== container && !container.nextContainer) { if (lastContainer) { @@ -5450,156 +5991,228 @@ var ts; lastContainer = container; } } + if (isBlockScopeContainer) { + blockScopeContainer = node; + } ts.forEachChild(node, bind); container = saveContainer; parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; } - function bindDeclaration(node, symbolKind, symbolExcludes) { + function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 177 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 120 /* CallSignature */: - case 121 /* ConstructSignature */: - case 122 /* IndexSignature */: - case 116 /* Method */: - case 117 /* Constructor */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 169 /* ClassDeclaration */: - if (node.flags & 64 /* Static */) { + case 187 /* ClassDeclaration */: + if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 125 /* TypeLiteral */: - case 128 /* ObjectLiteral */: - case 170 /* InterfaceDeclaration */: + case 136 /* TypeLiteral */: + case 142 /* ObjectLiteral */: + case 188 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 171 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindConstructorDeclaration(node) { - bindDeclaration(node, 4096 /* Constructor */, 0); + bindDeclaration(node, 16384 /* Constructor */, 0, true); ts.forEach(node.parameters, function (p) { - if (p.flags & (16 /* Public */ | 32 /* Private */)) { - bindDeclaration(p, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + if (p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */)) { + bindDeclaration(p, 4 /* Property */, 107455 /* PropertyExcludes */, false); } }); } function bindModuleDeclaration(node) { - if (node.name.kind === 3 /* StringLiteral */) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); - } - else if (isInstantiated(node)) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + if (node.name.kind === 7 /* StringLiteral */) { + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); } else { - bindDeclaration(node, 256 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + var state = getModuleInstanceState(node); + if (state === 0 /* NonInstantiated */) { + bindDeclaration(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); + } + else { + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); + if (state === 2 /* ConstEnumOnly */) { + node.symbol.constEnumOnlyModule = true; + } + else if (node.symbol.constEnumOnlyModule) { + node.symbol.constEnumOnlyModule = false; + } + } } } - function bindAnonymousDeclaration(node, symbolKind, name) { + function bindFunctionOrConstructorType(node) { + var symbolKind = node.kind === 133 /* FunctionType */ ? 131072 /* CallSignature */ : 262144 /* ConstructSignature */; + var symbol = createSymbol(symbolKind, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, symbolKind); + bindChildren(node, symbolKind, false); + var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); + typeLiteralSymbol.members = {}; + typeLiteralSymbol.members[node.kind === 133 /* FunctionType */ ? "__call" : "__new"] = symbol; + } + function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindCatchVariableDeclaration(node) { - var symbol = createSymbol(1 /* Variable */, node.variable.text || "__missing"); - addDeclarationToSymbol(symbol, node, 1 /* Variable */); + var symbol = createSymbol(1 /* FunctionScopedVariable */, node.variable.text || "__missing"); + addDeclarationToSymbol(symbol, node, 1 /* FunctionScopedVariable */); var saveParent = parent; - parent = node; + var savedBlockScopeContainer = blockScopeContainer; + parent = blockScopeContainer = node; ts.forEachChild(node, bind); parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + function bindBlockScopedVariableDeclaration(node) { + switch (blockScopeContainer.kind) { + case 191 /* ModuleDeclaration */: + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + break; + case 196 /* SourceFile */: + if (ts.isExternalModule(container)) { + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + } + declareSymbol(blockScopeContainer.locals, undefined, node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + } + bindChildren(node, 2 /* BlockScopedVariable */, false); } function bind(node) { node.parent = parent; switch (node.kind) { - case 113 /* TypeParameter */: - bindDeclaration(node, 262144 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes); + case 122 /* TypeParameter */: + bindDeclaration(node, 1048576 /* TypeParameter */, 2103776 /* TypeParameterExcludes */, false); break; - case 114 /* Parameter */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.ParameterExcludes); + case 123 /* Parameter */: + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */, false); break; - case 166 /* VariableDeclaration */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.VariableExcludes); + case 184 /* VariableDeclaration */: + if (node.flags & 6144 /* BlockScoped */) { + bindBlockScopedVariableDeclaration(node); + } + else { + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */, false); + } break; - case 115 /* Property */: - case 129 /* PropertyAssignment */: - bindDeclaration(node, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + case 124 /* Property */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + bindDeclaration(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 176 /* EnumMember */: - bindDeclaration(node, 4 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes); + case 195 /* EnumMember */: + bindDeclaration(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; - case 120 /* CallSignature */: - bindDeclaration(node, 32768 /* CallSignature */, 0); + case 129 /* CallSignature */: + bindDeclaration(node, 131072 /* CallSignature */, 0, false); break; - case 116 /* Method */: - bindDeclaration(node, 2048 /* Method */, ts.SymbolFlags.MethodExcludes); + case 130 /* ConstructSignature */: + bindDeclaration(node, 262144 /* ConstructSignature */, 0, true); break; - case 121 /* ConstructSignature */: - bindDeclaration(node, 65536 /* ConstructSignature */, 0); + case 125 /* Method */: + bindDeclaration(node, 8192 /* Method */, 99263 /* MethodExcludes */, true); break; - case 122 /* IndexSignature */: - bindDeclaration(node, 131072 /* IndexSignature */, 0); + case 131 /* IndexSignature */: + bindDeclaration(node, 524288 /* IndexSignature */, 0, false); break; - case 167 /* FunctionDeclaration */: - bindDeclaration(node, 8 /* Function */, ts.SymbolFlags.FunctionExcludes); + case 185 /* FunctionDeclaration */: + bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; - case 117 /* Constructor */: + case 126 /* Constructor */: bindConstructorDeclaration(node); break; - case 118 /* GetAccessor */: - bindDeclaration(node, 8192 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes); + case 127 /* GetAccessor */: + bindDeclaration(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */, true); break; - case 119 /* SetAccessor */: - bindDeclaration(node, 16384 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes); + case 128 /* SetAccessor */: + bindDeclaration(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 125 /* TypeLiteral */: - bindAnonymousDeclaration(node, 512 /* TypeLiteral */, "__type"); + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + bindFunctionOrConstructorType(node); break; - case 128 /* ObjectLiteral */: - bindAnonymousDeclaration(node, 1024 /* ObjectLiteral */, "__object"); + case 136 /* TypeLiteral */: + bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: - bindAnonymousDeclaration(node, 8 /* Function */, "__function"); + case 142 /* ObjectLiteral */: + bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 163 /* CatchBlock */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); + break; + case 181 /* CatchBlock */: bindCatchVariableDeclaration(node); break; - case 169 /* ClassDeclaration */: - bindDeclaration(node, 16 /* Class */, ts.SymbolFlags.ClassExcludes); + case 187 /* ClassDeclaration */: + bindDeclaration(node, 32 /* Class */, 3258879 /* ClassExcludes */, false); break; - case 170 /* InterfaceDeclaration */: - bindDeclaration(node, 32 /* Interface */, ts.SymbolFlags.InterfaceExcludes); + case 188 /* InterfaceDeclaration */: + bindDeclaration(node, 64 /* Interface */, 3152288 /* InterfaceExcludes */, false); break; - case 171 /* EnumDeclaration */: - bindDeclaration(node, 64 /* Enum */, ts.SymbolFlags.EnumExcludes); + case 189 /* TypeAliasDeclaration */: + bindDeclaration(node, 2097152 /* TypeAlias */, 3152352 /* TypeAliasExcludes */, false); break; - case 172 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + if (ts.isConstEnumDeclaration(node)) { + bindDeclaration(node, 128 /* ConstEnum */, 3259263 /* ConstEnumExcludes */, false); + } + else { + bindDeclaration(node, 256 /* RegularEnum */, 3258623 /* RegularEnumExcludes */, false); + } + break; + case 191 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 174 /* ImportDeclaration */: - bindDeclaration(node, 4194304 /* Import */, ts.SymbolFlags.ImportExcludes); + case 193 /* ImportDeclaration */: + bindDeclaration(node, 33554432 /* Import */, 33554432 /* ImportExcludes */, false); break; - case 177 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 128 /* ValueModule */, '"' + ts.getModuleNameFromFilename(node.filename) + '"'); + bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); break; } + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 174 /* SwitchStatement */: + bindChildren(node, 0, true); + break; default: var saveParent = parent; parent = node; @@ -5619,10 +6232,25 @@ var ts; } return indentStrings[level]; } + ts.getIndentString = getIndentString; function getIndentSize() { return indentStrings[1].length; } - function emitFiles(resolver) { + function shouldEmitToOwnFile(sourceFile, compilerOptions) { + if (!ts.isDeclarationFile(sourceFile)) { + if ((ts.isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { + return true; + } + return false; + } + return false; + } + ts.shouldEmitToOwnFile = shouldEmitToOwnFile; + function isExternalModuleOrDeclarationFile(sourceFile) { + return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); + } + ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; + function emitFiles(resolver, targetSourceFile) { var program = resolver.getProgram(); var compilerHost = program.getCompilerHost(); var compilerOptions = program.getCompilerOptions(); @@ -5630,32 +6258,22 @@ var ts; var diagnostics = []; var newLine = program.getCompilerHost().getNewLine(); function getSourceFilePathInNewDir(newDirPath, sourceFile) { - var sourceFilePath = ts.getNormalizedPathFromPathCompoments(ts.getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); + var sourceFilePath = ts.getNormalizedPathFromPathComponents(ts.getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); return ts.combinePaths(newDirPath, sourceFilePath); } - function shouldEmitToOwnFile(sourceFile) { - if (!(sourceFile.flags & 512 /* DeclarationFile */)) { - if ((ts.isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { - return true; - } - } - } function getOwnEmitOutputFilePath(sourceFile, extension) { - if (program.getCompilerOptions().outDir) { - var emitOutputFilePathWithoutExtension = ts.getModuleNameFromFilename(getSourceFilePathInNewDir(program.getCompilerOptions().outDir, sourceFile)); + if (compilerOptions.outDir) { + var emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(compilerOptions.outDir, sourceFile)); } else { - var emitOutputFilePathWithoutExtension = ts.getModuleNameFromFilename(sourceFile.filename); + var emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.filename); } return emitOutputFilePathWithoutExtension + extension; } - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || (sourceFile.flags & 512 /* DeclarationFile */) !== 0; - } function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 117 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } }); @@ -5665,14 +6283,14 @@ var ts; var getAccessor; var setAccessor; ts.forEach(node.members, function (member) { - if ((member.kind === 118 /* GetAccessor */ || member.kind === 119 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 64 /* Static */) === (accessor.flags & 64 /* Static */)) { + if ((member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { if (!firstAccessor) { firstAccessor = member; } - if (member.kind === 118 /* GetAccessor */ && !getAccessor) { + if (member.kind === 127 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 119 /* SetAccessor */ && !setAccessor) { + if (member.kind === 128 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -5683,7 +6301,7 @@ var ts; setAccessor: setAccessor }; } - function createTextWriter(writeSymbol) { + function createTextWriter() { var output = ""; var indent = 0; var lineStart = true; @@ -5709,18 +6327,10 @@ var ts; function writeLiteral(s) { if (s && s.length) { write(s); - var pos = 0; - while (pos < s.length) { - switch (s.charCodeAt(pos++)) { - case 13 /* carriageReturn */: - if (pos < s.length && s.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - lineCount++; - linePos = output.length - s.length + pos; - break; - } + var lineStartsOfS = ts.computeLineStarts(s); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; } } } @@ -5734,7 +6344,6 @@ var ts; } return { write: write, - writeSymbol: writeSymbol, rawWrite: rawWrite, writeLiteral: writeLiteral, writeLine: writeLine, @@ -5831,10 +6440,9 @@ var ts; } function calculateIndent(pos, end) { var currentLineIndent = 0; - while (pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos))) { - pos++; + for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { if (currentSourceFile.text.charCodeAt(pos) === 9 /* tab */) { - currentLineIndent += getIndentSize(); + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); } else { currentLineIndent++; @@ -5844,7 +6452,7 @@ var ts; } } function emitJavaScript(jsFilePath, root) { - var writer = createTextWriter(writeSymbol); + var writer = createTextWriter(); var write = writer.write; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; @@ -5874,8 +6482,6 @@ var ts; var scopeEmitEnd = function () { }; var sourceMapData; - function writeSymbol(symbol, enclosingDeclaration, meaning) { - } function initializeEmitterWithSourceMaps() { var sourceMapDir; var sourceMapSourceIndex = -1; @@ -5980,7 +6586,7 @@ var ts; } function recordNewSourceFileStart(node) { var sourcesDirectoryPath = compilerOptions.sourceRoot ? program.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.filename, compilerHost.getCurrentDirectory(), true)); + sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.filename, compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, true)); sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; sourceMapData.inputSourceFileNames.push(node.filename); } @@ -6007,7 +6613,7 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 167 /* FunctionDeclaration */ || node.kind === 136 /* FunctionExpression */ || node.kind === 116 /* Method */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */ || node.kind === 172 /* ModuleDeclaration */ || node.kind === 169 /* ClassDeclaration */ || node.kind === 171 /* EnumDeclaration */) { + else if (node.kind === 185 /* FunctionDeclaration */ || node.kind === 152 /* FunctionExpression */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */ || node.kind === 191 /* ModuleDeclaration */ || node.kind === 187 /* ClassDeclaration */ || node.kind === 190 /* EnumDeclaration */) { if (node.name) { scopeName = node.name.text; } @@ -6026,16 +6632,32 @@ var ts; writeCommentRange(comment, writer); recordSourceMapSpan(comment.end); } + function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { + if (typeof JSON !== "undefined") { + return JSON.stringify({ + version: version, + file: file, + sourceRoot: sourceRoot, + sources: sources, + names: names, + mappings: mappings + }); + } + return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\"}"; + function serializeStringArray(list) { + var output = ""; + for (var i = 0, n = list.length; i < n; i++) { + if (i) { + output += ","; + } + output += "\"" + ts.escapeString(list[i]) + "\""; + } + return output; + } + } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { encodeLastRecordedSourceMapSpan(); - writeFile(sourceMapData.sourceMapFilePath, JSON.stringify({ - version: 3, - file: sourceMapData.sourceMapFile, - sourceRoot: sourceMapData.sourceMapSourceRoot, - sources: sourceMapData.sourceMapSources, - names: sourceMapData.sourceMapNames, - mappings: sourceMapData.sourceMapMappings - }), false); + writeFile(sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); sourceMapDataList.push(sourceMapData); writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); } @@ -6062,7 +6684,7 @@ var ts; } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { sourceMapDir = ts.combinePaths(program.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), compilerHost.getCurrentDirectory(), true); + sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, true); } else { sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); @@ -6073,7 +6695,7 @@ var ts; } function emitNodeWithMap(node) { if (node) { - if (node.kind != 177 /* SourceFile */) { + if (node.kind != 196 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNode(node); recordEmitNodeEndSpan(node); @@ -6112,25 +6734,42 @@ var ts; emit(node); } } - function emitCommaList(nodes, count) { - if (!(count >= 0)) - count = nodes.length; - if (nodes) { - for (var i = 0; i < count; i++) { - if (i) - write(", "); - emit(nodes[i]); + function emitTrailingCommaIfPresent(nodeList, isMultiline) { + if (nodeList.hasTrailingComma) { + write(","); + if (isMultiline) { + writeLine(); } } } - function emitMultiLineList(nodes) { + function emitCommaList(nodes, includeTrailingComma, count) { + if (!(count >= 0)) { + count = nodes.length; + } + if (nodes) { + for (var i = 0; i < count; i++) { + if (i) { + write(", "); + } + emit(nodes[i]); + } + if (includeTrailingComma) { + emitTrailingCommaIfPresent(nodes, false); + } + } + } + function emitMultiLineList(nodes, includeTrailingComma) { if (nodes) { for (var i = 0; i < nodes.length; i++) { - if (i) + if (i) { write(","); + } writeLine(); emit(nodes[i]); } + if (includeTrailingComma) { + emitTrailingCommaIfPresent(nodes, true); + } } } function emitLines(nodes) { @@ -6143,21 +6782,97 @@ var ts; } } function emitLiteral(node) { - var text = getSourceTextOfLocalNode(node); - if (node.kind === 3 /* StringLiteral */ && compilerOptions.sourceMap) { + var text = getLiteralText(); + if (compilerOptions.sourceMap && (node.kind === 7 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else { write(text); } + function getLiteralText() { + if (compilerOptions.target < 2 /* ES6 */ && ts.isTemplateLiteralKind(node.kind)) { + return getTemplateLiteralAsStringLiteral(node); + } + return getSourceTextOfLocalNode(node); + } } - function emitQuotedIdentifier(node) { - if (node.kind === 3 /* StringLiteral */) { + function getTemplateLiteralAsStringLiteral(node) { + return '"' + ts.escapeString(node.text) + '"'; + } + function emitTemplateExpression(node) { + if (compilerOptions.target >= 2 /* ES6 */) { + ts.forEachChild(node, emit); + return; + } + ts.Debug.assert(node.parent.kind !== 149 /* TaggedTemplateExpression */); + var emitOuterParens = ts.isExpression(node.parent) && templateNeedsParens(node, node.parent); + if (emitOuterParens) { + write("("); + } + emitLiteral(node.head); + ts.forEach(node.templateSpans, function (templateSpan) { + var needsParens = templateSpan.expression.kind !== 151 /* ParenExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; + write(" + "); + if (needsParens) { + write("("); + } + emit(templateSpan.expression); + if (needsParens) { + write(")"); + } + if (templateSpan.literal.text.length !== 0) { + write(" + "); + emitLiteral(templateSpan.literal); + } + }); + if (emitOuterParens) { + write(")"); + } + function templateNeedsParens(template, parent) { + switch (parent.kind) { + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return parent.func === template; + case 151 /* ParenExpression */: + return false; + case 149 /* TaggedTemplateExpression */: + ts.Debug.fail("Path should be unreachable; tagged templates not supported pre-ES6."); + default: + return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; + } + } + function comparePrecedenceToBinaryPlus(expression) { + ts.Debug.assert(compilerOptions.target <= 1 /* ES5 */); + switch (expression.kind) { + case 156 /* BinaryExpression */: + switch (expression.operator) { + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: + return 1 /* GreaterThan */; + case 32 /* PlusToken */: + return 0 /* EqualTo */; + default: + return -1 /* LessThan */; + } + case 157 /* ConditionalExpression */: + return -1 /* LessThan */; + default: + return 1 /* GreaterThan */; + } + } + } + function emitTemplateSpan(span) { + emit(span.expression); + emit(span.literal); + } + function emitExpressionForPropertyName(node) { + if (node.kind === 7 /* StringLiteral */) { emitLiteral(node); } else { write("\""); - if (node.kind === 2 /* NumericLiteral */) { + if (node.kind === 6 /* NumericLiteral */) { write(node.text); } else { @@ -6166,45 +6881,52 @@ var ts; write("\""); } } - function isNonExpressionIdentifier(node) { + function isNotExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 114 /* Parameter */: - case 166 /* VariableDeclaration */: - case 115 /* Property */: - case 129 /* PropertyAssignment */: - case 176 /* EnumMember */: - case 116 /* Method */: - case 167 /* FunctionDeclaration */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 136 /* FunctionExpression */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 171 /* EnumDeclaration */: - case 172 /* ModuleDeclaration */: - case 174 /* ImportDeclaration */: + case 123 /* Parameter */: + case 184 /* VariableDeclaration */: + case 124 /* Property */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + case 195 /* EnumMember */: + case 125 /* Method */: + case 185 /* FunctionDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 152 /* FunctionExpression */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: return parent.name === node; - case 153 /* BreakStatement */: - case 152 /* ContinueStatement */: - case 175 /* ExportAssignment */: + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 194 /* ExportAssignment */: return false; - case 159 /* LabelledStatement */: + case 177 /* LabeledStatement */: return node.parent.label === node; - case 163 /* CatchBlock */: + case 181 /* CatchBlock */: return node.parent.variable === node; } } - function emitIdentifier(node) { - if (!isNonExpressionIdentifier(node)) { - var prefix = resolver.getExpressionNamePrefix(node); - if (prefix) { - write(prefix); - write("."); - } + function emitExpressionIdentifier(node) { + var prefix = resolver.getExpressionNamePrefix(node); + if (prefix) { + write(prefix); + write("."); } write(getSourceTextOfLocalNode(node)); } + function emitIdentifier(node) { + if (!isNotExpressionIdentifier(node)) { + emitExpressionIdentifier(node); + } + else { + write(getSourceTextOfLocalNode(node)); + } + } function emitThis(node) { if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { write("_this"); @@ -6226,17 +6948,17 @@ var ts; } } function emitArrayLiteral(node) { - if (node.flags & 128 /* MultiLine */) { + if (node.flags & 256 /* MultiLine */) { write("["); increaseIndent(); - emitMultiLineList(node.elements); + emitMultiLineList(node.elements, true); decreaseIndent(); writeLine(); write("]"); } else { write("["); - emitCommaList(node.elements); + emitCommaList(node.elements, true); write("]"); } } @@ -6244,17 +6966,17 @@ var ts; if (!node.properties.length) { write("{}"); } - else if (node.flags & 128 /* MultiLine */) { + else if (node.flags & 256 /* MultiLine */) { write("{"); increaseIndent(); - emitMultiLineList(node.properties); + emitMultiLineList(node.properties, compilerOptions.target >= 1 /* ES5 */); decreaseIndent(); writeLine(); write("}"); } else { write("{ "); - emitCommaList(node.properties); + emitCommaList(node.properties, compilerOptions.target >= 1 /* ES5 */); write(" }"); } } @@ -6265,10 +6987,40 @@ var ts; emit(node.initializer); emitTrailingComments(node); } + function emitShortHandPropertyAssignment(node) { + function emitAsNormalPropertyAssignment() { + emitLeadingComments(node); + emit(node.name); + write(": "); + emitExpressionIdentifier(node.name); + emitTrailingComments(node); + } + if (compilerOptions.target < 2 /* ES6 */) { + emitAsNormalPropertyAssignment(); + } + else if (compilerOptions.target >= 2 /* ES6 */) { + var prefix = resolver.getExpressionNamePrefix(node.name); + if (prefix) { + emitAsNormalPropertyAssignment(); + } + else { + emitLeadingComments(node); + emit(node.name); + emitTrailingComments(node); + } + } + } + function tryEmitConstantValue(node) { + var constantValue = resolver.getConstantValue(node); + if (constantValue !== undefined) { + var propertyName = node.kind === 145 /* PropertyAccess */ ? ts.declarationNameToString(node.right) : ts.getTextOfNode(node.index); + write(constantValue.toString() + " /* " + propertyName + " */"); + return true; + } + return false; + } function emitPropertyAccess(node) { - var text = resolver.getPropertyAccessSubstitution(node); - if (text) { - write(text); + if (tryEmitConstantValue(node)) { return; } emit(node.left); @@ -6276,6 +7028,9 @@ var ts; emit(node.right); } function emitIndexedAccess(node) { + if (tryEmitConstantValue(node)) { + return; + } emit(node.object); write("["); emit(node.index); @@ -6283,26 +7038,26 @@ var ts; } function emitCallExpression(node) { var superCall = false; - if (node.func.kind === 81 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { write("_super"); superCall = true; } else { emit(node.func); - superCall = node.func.kind === 130 /* PropertyAccess */ && node.func.left.kind === 81 /* SuperKeyword */; + superCall = node.func.kind === 145 /* PropertyAccess */ && node.func.left.kind === 89 /* SuperKeyword */; } if (superCall) { write(".call("); emitThis(node.func); if (node.arguments.length) { write(", "); - emitCommaList(node.arguments); + emitCommaList(node.arguments, false); } write(")"); } else { write("("); - emitCommaList(node.arguments); + emitCommaList(node.arguments, false); write(")"); } } @@ -6311,17 +7066,23 @@ var ts; emit(node.func); if (node.arguments) { write("("); - emitCommaList(node.arguments); + emitCommaList(node.arguments, false); write(")"); } } + function emitTaggedTemplateExpression(node) { + ts.Debug.assert(compilerOptions.target >= 2 /* ES6 */, "Trying to emit a tagged template in pre-ES6 mode."); + emit(node.tag); + write(" "); + emit(node.template); + } function emitParenExpression(node) { - if (node.expression.kind === 134 /* TypeAssertion */) { + if (node.expression.kind === 150 /* TypeAssertion */) { var operand = node.expression.operand; - while (operand.kind == 134 /* TypeAssertion */) { + while (operand.kind == 150 /* TypeAssertion */) { operand = operand.operand; } - if (operand.kind !== 138 /* PrefixOperator */ && operand.kind !== 139 /* PostfixOperator */ && operand.kind !== 133 /* NewExpression */ && !(operand.kind === 132 /* CallExpression */ && node.parent.kind === 133 /* NewExpression */) && !(operand.kind === 136 /* FunctionExpression */ && node.parent.kind === 132 /* CallExpression */)) { + if (operand.kind !== 154 /* PrefixOperator */ && operand.kind !== 155 /* PostfixOperator */ && operand.kind !== 148 /* NewExpression */ && !(operand.kind === 147 /* CallExpression */ && node.parent.kind === 148 /* NewExpression */) && !(operand.kind === 152 /* FunctionExpression */ && node.parent.kind === 147 /* CallExpression */)) { emit(operand); return; } @@ -6331,29 +7092,29 @@ var ts; write(")"); } function emitUnaryExpression(node) { - if (node.kind === 138 /* PrefixOperator */) { + if (node.kind === 154 /* PrefixOperator */) { write(ts.tokenToString(node.operator)); } - if (node.operator >= 55 /* Identifier */) { + if (node.operator >= 63 /* Identifier */) { write(" "); } - else if (node.kind === 138 /* PrefixOperator */ && node.operand.kind === 138 /* PrefixOperator */) { + else if (node.kind === 154 /* PrefixOperator */ && node.operand.kind === 154 /* PrefixOperator */) { var operand = node.operand; - if (node.operator === 24 /* PlusToken */ && (operand.operator === 24 /* PlusToken */ || operand.operator === 29 /* PlusPlusToken */)) { + if (node.operator === 32 /* PlusToken */ && (operand.operator === 32 /* PlusToken */ || operand.operator === 37 /* PlusPlusToken */)) { write(" "); } - else if (node.operator === 25 /* MinusToken */ && (operand.operator === 25 /* MinusToken */ || operand.operator === 30 /* MinusMinusToken */)) { + else if (node.operator === 33 /* MinusToken */ && (operand.operator === 33 /* MinusToken */ || operand.operator === 38 /* MinusMinusToken */)) { write(" "); } } emit(node.operand); - if (node.kind === 139 /* PostfixOperator */) { + if (node.kind === 155 /* PostfixOperator */) { write(ts.tokenToString(node.operator)); } } function emitBinaryExpression(node) { emit(node.left); - if (node.operator !== 14 /* CommaToken */) + if (node.operator !== 22 /* CommaToken */) write(" "); write(ts.tokenToString(node.operator)); write(" "); @@ -6367,21 +7128,21 @@ var ts; emit(node.whenFalse); } function emitBlock(node) { - emitToken(5 /* OpenBraceToken */, node.pos); + emitToken(13 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 173 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 172 /* ModuleDeclaration */); + if (node.kind === 192 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 191 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); decreaseIndent(); writeLine(); - emitToken(6 /* CloseBraceToken */, node.statements.end); + emitToken(14 /* CloseBraceToken */, node.statements.end); scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 143 /* Block */) { + if (node.kind === 161 /* Block */) { write(" "); emit(node); } @@ -6393,7 +7154,7 @@ var ts; } } function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 137 /* ArrowFunction */; + var isArrowExpression = node.expression.kind === 153 /* ArrowFunction */; emitLeadingComments(node); if (isArrowExpression) write("("); @@ -6405,16 +7166,16 @@ var ts; } function emitIfStatement(node) { emitLeadingComments(node); - var endPos = emitToken(74 /* IfKeyword */, node.pos); + var endPos = emitToken(82 /* IfKeyword */, node.pos); write(" "); - endPos = emitToken(7 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - emitToken(8 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(66 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 147 /* IfStatement */) { + emitToken(74 /* ElseKeyword */, node.thenStatement.end); + if (node.elseStatement.kind === 165 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -6427,7 +7188,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 143 /* Block */) { + if (node.statement.kind === 161 /* Block */) { write(" "); } else { @@ -6444,13 +7205,21 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForStatement(node) { - var endPos = emitToken(72 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(7 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); if (node.declarations) { - emitToken(88 /* VarKeyword */, endPos); + if (node.declarations[0] && node.declarations[0].flags & 2048 /* Let */) { + emitToken(102 /* LetKeyword */, endPos); + } + else if (node.declarations[0] && node.declarations[0].flags & 4096 /* Const */) { + emitToken(68 /* ConstKeyword */, endPos); + } + else { + emitToken(96 /* VarKeyword */, endPos); + } write(" "); - emitCommaList(node.declarations); + emitCommaList(node.declarations, false); } if (node.initializer) { emit(node.initializer); @@ -6463,30 +7232,38 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInStatement(node) { - var endPos = emitToken(72 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(7 /* OpenParenToken */, endPos); - if (node.declaration) { - emitToken(88 /* VarKeyword */, endPos); - write(" "); - emit(node.declaration); + endPos = emitToken(15 /* OpenParenToken */, endPos); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + if (decl.flags & 2048 /* Let */) { + emitToken(102 /* LetKeyword */, endPos); + } + else { + emitToken(96 /* VarKeyword */, endPos); + } + write(" "); + emit(decl); + } } else { emit(node.variable); } write(" in "); emit(node.expression); - emitToken(8 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.statement); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 153 /* BreakStatement */ ? 56 /* BreakKeyword */ : 61 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 171 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { emitLeadingComments(node); - emitToken(80 /* ReturnKeyword */, node.pos); + emitToken(88 /* ReturnKeyword */, node.pos); emitOptional(" ", node.expression); write(";"); emitTrailingComments(node); @@ -6498,21 +7275,24 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(82 /* SwitchKeyword */, node.pos); + var endPos = emitToken(90 /* SwitchKeyword */, node.pos); write(" "); - emitToken(7 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - endPos = emitToken(8 /* CloseParenToken */, node.expression.end); + endPos = emitToken(16 /* CloseParenToken */, node.expression.end); write(" "); - emitToken(5 /* OpenBraceToken */, endPos); + emitToken(13 /* OpenBraceToken */, endPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); writeLine(); - emitToken(6 /* CloseBraceToken */, node.clauses.end); + emitToken(14 /* CloseBraceToken */, node.clauses.end); + } + function isOnSameLine(node1, node2) { + return getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 157 /* CaseClause */) { + if (node.kind === 175 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -6520,9 +7300,15 @@ var ts; else { write("default:"); } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); + if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) { + write(" "); + emit(node.statements[0]); + } + else { + increaseIndent(); + emitLines(node.statements); + decreaseIndent(); + } } function emitThrowStatement(node) { write("throw "); @@ -6541,16 +7327,16 @@ var ts; } function emitCatchBlock(node) { writeLine(); - var endPos = emitToken(58 /* CatchKeyword */, node.pos); + var endPos = emitToken(66 /* CatchKeyword */, node.pos); write(" "); - emitToken(7 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.variable); - emitToken(8 /* CloseParenToken */, node.variable.end); + emitToken(16 /* CloseParenToken */, node.variable.end); write(" "); emitBlock(node); } function emitDebuggerStatement(node) { - emitToken(62 /* DebuggerKeyword */, node.pos); + emitToken(70 /* DebuggerKeyword */, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -6561,7 +7347,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 172 /* ModuleDeclaration */); + } while (node && node.kind !== 191 /* ModuleDeclaration */); return node; } function emitModuleMemberName(node) { @@ -6582,9 +7368,18 @@ var ts; } function emitVariableStatement(node) { emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) - write("var "); - emitCommaList(node.declarations); + if (!(node.flags & 1 /* Export */)) { + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } + } + emitCommaList(node.declarations, false); write(";"); emitTrailingComments(node); } @@ -6651,7 +7446,7 @@ var ts; } function emitAccessor(node) { emitLeadingComments(node); - write(node.kind === 118 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 127 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); emitTrailingComments(node); @@ -6660,15 +7455,15 @@ var ts; if (!node.body) { return emitPinnedOrTripleSlashComments(node); } - if (node.kind !== 116 /* Method */) { + if (node.kind !== 125 /* Method */) { emitLeadingComments(node); } write("function "); - if (node.kind === 167 /* FunctionDeclaration */ || (node.kind === 136 /* FunctionExpression */ && node.name)) { + if (node.kind === 185 /* FunctionDeclaration */ || (node.kind === 152 /* FunctionExpression */ && node.name)) { emit(node.name); } emitSignatureAndBody(node); - if (node.kind !== 116 /* Method */) { + if (node.kind !== 125 /* Method */) { emitTrailingComments(node); } } @@ -6684,7 +7479,7 @@ var ts; increaseIndent(); write("("); if (node) { - emitCommaList(node.parameters, node.parameters.length - (ts.hasRestParameters(node) ? 1 : 0)); + emitCommaList(node.parameters, false, node.parameters.length - (ts.hasRestParameters(node) ? 1 : 0)); } write(")"); decreaseIndent(); @@ -6694,16 +7489,16 @@ var ts; write(" {"); scopeEmitStart(node); increaseIndent(); - emitDetachedComments(node.body.kind === 168 /* FunctionBlock */ ? node.body.statements : node.body); + emitDetachedComments(node.body.kind === 186 /* FunctionBlock */ ? node.body.statements : node.body); var startIndex = 0; - if (node.body.kind === 168 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { startIndex = emitDirectivePrologues(node.body.statements, true); } var outPos = writer.getTextPos(); emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); - if (node.body.kind !== 168 /* FunctionBlock */ && outPos === writer.getTextPos()) { + if (node.body.kind !== 186 /* FunctionBlock */ && outPos === writer.getTextPos()) { decreaseIndent(); write(" "); emitStart(node.body); @@ -6716,7 +7511,7 @@ var ts; emitEnd(node.body); } else { - if (node.body.kind === 168 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { emitLinesStartingAt(node.body.statements, startIndex); } else { @@ -6728,10 +7523,10 @@ var ts; emitTrailingComments(node.body); } writeLine(); - if (node.body.kind === 168 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { emitLeadingCommentsOfPosition(node.body.statements.end); decreaseIndent(); - emitToken(6 /* CloseBraceToken */, node.body.statements.end); + emitToken(14 /* CloseBraceToken */, node.body.statements.end); } else { decreaseIndent(); @@ -6754,11 +7549,11 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 146 /* ExpressionStatement */) { + if (statement && statement.kind === 164 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 132 /* CallExpression */) { + if (expr && expr.kind === 147 /* CallExpression */) { var func = expr.func; - if (func && func.kind === 81 /* SuperKeyword */) { + if (func && func.kind === 89 /* SuperKeyword */) { return statement; } } @@ -6767,7 +7562,7 @@ var ts; } function emitParameterPropertyAssignments(node) { ts.forEach(node.parameters, function (param) { - if (param.flags & (16 /* Public */ | 32 /* Private */)) { + if (param.flags & 112 /* AccessibilityModifier */) { writeLine(); emitStart(param); emitStart(param.name); @@ -6782,7 +7577,7 @@ var ts; }); } function emitMemberAccess(memberName) { - if (memberName.kind === 3 /* StringLiteral */ || memberName.kind === 2 /* NumericLiteral */) { + if (memberName.kind === 7 /* StringLiteral */ || memberName.kind === 6 /* NumericLiteral */) { write("["); emitNode(memberName); write("]"); @@ -6794,7 +7589,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 115 /* Property */ && (member.flags & 64 /* Static */) === staticFlag && member.initializer) { + if (member.kind === 124 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -6817,7 +7612,7 @@ var ts; } function emitMemberFunctions(node) { ts.forEach(node.members, function (member) { - if (member.kind === 116 /* Method */) { + if (member.kind === 125 /* Method */) { if (!member.body) { return emitPinnedOrTripleSlashComments(member); } @@ -6826,7 +7621,7 @@ var ts; emitStart(member); emitStart(member.name); emitNode(node.name); - if (!(member.flags & 64 /* Static */)) { + if (!(member.flags & 128 /* Static */)) { write(".prototype"); } emitMemberAccess(member.name); @@ -6839,7 +7634,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 118 /* GetAccessor */ || member.kind === 119 /* SetAccessor */) { + else if (member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) { var accessors = getAllAccessorDeclarations(node, member); if (member === accessors.firstAccessor) { writeLine(); @@ -6847,11 +7642,11 @@ var ts; write("Object.defineProperty("); emitStart(member.name); emitNode(node.name); - if (!(member.flags & 64 /* Static */)) { + if (!(member.flags & 128 /* Static */)) { write(".prototype"); } write(", "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member.name); write(", {"); increaseIndent(); @@ -6911,17 +7706,17 @@ var ts; writeLine(); emitConstructorOfClass(); emitMemberFunctions(node); - emitMemberAssignments(node, 64 /* Static */); + emitMemberAssignments(node, 128 /* Static */); writeLine(); function emitClassReturnStatement() { write("return "); emitNode(node.name); } - emitToken(6 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); + emitToken(14 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); write(";"); decreaseIndent(); writeLine(); - emitToken(6 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); emitStart(node); write(")("); @@ -6942,7 +7737,7 @@ var ts; emitTrailingComments(node); function emitConstructorOfClass() { ts.forEach(node.members, function (member) { - if (member.kind === 117 /* Constructor */ && !member.body) { + if (member.kind === 126 /* Constructor */ && !member.body) { emitPinnedOrTripleSlashComments(member); } }); @@ -6993,7 +7788,7 @@ var ts; emitLeadingCommentsOfPosition(ctor.body.statements.end); } decreaseIndent(); - emitToken(6 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); + emitToken(14 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); scopeEmitEnd(); emitEnd(ctor || node); if (ctor) { @@ -7005,6 +7800,10 @@ var ts; emitPinnedOrTripleSlashComments(node); } function emitEnumDeclaration(node) { + var isConstEnum = ts.isConstEnumDeclaration(node); + if (isConstEnum && !compilerOptions.preserveConstEnums) { + return; + } emitLeadingComments(node); if (!(node.flags & 1 /* Export */)) { emitStart(node); @@ -7022,10 +7821,10 @@ var ts; write(") {"); increaseIndent(); scopeEmitStart(node); - emitEnumMemberDeclarations(); + emitEnumMemberDeclarations(isConstEnum); decreaseIndent(); writeLine(); - emitToken(6 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); write(")("); emitModuleMemberName(node); @@ -7044,7 +7843,7 @@ var ts; write(";"); } emitTrailingComments(node); - function emitEnumMemberDeclarations() { + function emitEnumMemberDeclarations(isConstEnum) { ts.forEach(node.members, function (member) { writeLine(); emitLeadingComments(member); @@ -7053,16 +7852,16 @@ var ts; write("["); write(resolver.getLocalNameOfContainer(node)); write("["); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); write("] = "); - if (member.initializer) { + if (member.initializer && !isConstEnum) { emit(member.initializer); } else { write(resolver.getEnumMemberValue(member).toString()); } write("] = "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member); write(";"); emitTrailingComments(member); @@ -7070,31 +7869,29 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 172 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 191 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } } function emitModuleDeclaration(node) { - if (!ts.isInstantiated(node)) { + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) { - emitStart(node); - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); - } + emitStart(node); + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); emitStart(node); write("(function ("); emitStart(node.name); write(resolver.getLocalNameOfContainer(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 173 /* ModuleBlock */) { + if (node.body.kind === 192 /* ModuleBlock */) { emit(node.body); } else { @@ -7107,34 +7904,28 @@ var ts; decreaseIndent(); writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(6 /* CloseBraceToken */, moduleBlock.statements.end); + emitToken(14 /* CloseBraceToken */, moduleBlock.statements.end); scopeEmitEnd(); } write(")("); + if (node.flags & 1 /* Export */) { + emit(node.name); + write(" = "); + } emitModuleMemberName(node); write(" || ("); emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (node.flags & 1 /* Export */) { - writeLine(); - emitStart(node); - write("var "); - emit(node.name); - write(" = "); - emitModuleMemberName(node); - emitEnd(node); - write(";"); - } emitTrailingComments(node); } function emitImportDeclaration(node) { var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); if (!emitImportDeclaration) { - emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); + emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 177 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.externalModuleName && node.parent.kind === 196 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { if (node.flags & 1 /* Export */) { writeLine(); emitLeadingComments(node); @@ -7163,7 +7954,7 @@ var ts; emitStart(node.externalModuleName); emitLiteral(node.externalModuleName); emitEnd(node.externalModuleName); - emitToken(8 /* CloseParenToken */, node.externalModuleName.end); + emitToken(16 /* CloseParenToken */, node.externalModuleName.end); } write(";"); emitEnd(node); @@ -7174,7 +7965,7 @@ var ts; function getExternalImportDeclarations(node) { var result = []; ts.forEach(node.statements, function (stat) { - if (stat.kind === 174 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === 193 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { result.push(stat); } }); @@ -7182,7 +7973,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 175 /* ExportAssignment */) { + if (node.kind === 194 /* ExportAssignment */) { return node; } }); @@ -7190,7 +7981,11 @@ var ts; function emitAMDModule(node, startIndex) { var imports = getExternalImportDeclarations(node); writeLine(); - write("define([\"require\", \"exports\""); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + write("[\"require\", \"exports\""); ts.forEach(imports, function (imp) { write(", "); emitLiteral(imp.externalModuleName); @@ -7298,117 +8093,129 @@ var ts; return emitPinnedOrTripleSlashComments(node); } switch (node.kind) { - case 55 /* Identifier */: + case 63 /* Identifier */: return emitIdentifier(node); - case 114 /* Parameter */: + case 123 /* Parameter */: return emitParameter(node); - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessor(node); - case 83 /* ThisKeyword */: + case 91 /* ThisKeyword */: return emitThis(node); - case 81 /* SuperKeyword */: + case 89 /* SuperKeyword */: return emitSuper(node); - case 79 /* NullKeyword */: + case 87 /* NullKeyword */: return write("null"); - case 85 /* TrueKeyword */: + case 93 /* TrueKeyword */: return write("true"); - case 70 /* FalseKeyword */: + case 78 /* FalseKeyword */: return write("false"); - case 2 /* NumericLiteral */: - case 3 /* StringLiteral */: - case 4 /* RegularExpressionLiteral */: + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 8 /* RegularExpressionLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 11 /* TemplateMiddle */: + case 12 /* TemplateTail */: return emitLiteral(node); - case 112 /* QualifiedName */: + case 158 /* TemplateExpression */: + return emitTemplateExpression(node); + case 159 /* TemplateSpan */: + return emitTemplateSpan(node); + case 121 /* QualifiedName */: return emitPropertyAccess(node); - case 127 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return emitArrayLiteral(node); - case 128 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return emitObjectLiteral(node); - case 129 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 130 /* PropertyAccess */: + case 144 /* ShorthandPropertyAssignment */: + return emitShortHandPropertyAssignment(node); + case 145 /* PropertyAccess */: return emitPropertyAccess(node); - case 131 /* IndexedAccess */: + case 146 /* IndexedAccess */: return emitIndexedAccess(node); - case 132 /* CallExpression */: + case 147 /* CallExpression */: return emitCallExpression(node); - case 133 /* NewExpression */: + case 148 /* NewExpression */: return emitNewExpression(node); - case 134 /* TypeAssertion */: + case 149 /* TaggedTemplateExpression */: + return emitTaggedTemplateExpression(node); + case 150 /* TypeAssertion */: return emit(node.operand); - case 135 /* ParenExpression */: + case 151 /* ParenExpression */: return emitParenExpression(node); - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 138 /* PrefixOperator */: - case 139 /* PostfixOperator */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: return emitUnaryExpression(node); - case 140 /* BinaryExpression */: + case 156 /* BinaryExpression */: return emitBinaryExpression(node); - case 141 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return emitConditionalExpression(node); - case 142 /* OmittedExpression */: + case 160 /* OmittedExpression */: return; - case 143 /* Block */: - case 162 /* TryBlock */: - case 164 /* FinallyBlock */: - case 168 /* FunctionBlock */: - case 173 /* ModuleBlock */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: return emitBlock(node); - case 144 /* VariableStatement */: + case 162 /* VariableStatement */: return emitVariableStatement(node); - case 145 /* EmptyStatement */: + case 163 /* EmptyStatement */: return write(";"); - case 146 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return emitExpressionStatement(node); - case 147 /* IfStatement */: + case 165 /* IfStatement */: return emitIfStatement(node); - case 148 /* DoStatement */: + case 166 /* DoStatement */: return emitDoStatement(node); - case 149 /* WhileStatement */: + case 167 /* WhileStatement */: return emitWhileStatement(node); - case 150 /* ForStatement */: + case 168 /* ForStatement */: return emitForStatement(node); - case 151 /* ForInStatement */: + case 169 /* ForInStatement */: return emitForInStatement(node); - case 152 /* ContinueStatement */: - case 153 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 154 /* ReturnStatement */: + case 172 /* ReturnStatement */: return emitReturnStatement(node); - case 155 /* WithStatement */: + case 173 /* WithStatement */: return emitWithStatement(node); - case 156 /* SwitchStatement */: + case 174 /* SwitchStatement */: return emitSwitchStatement(node); - case 157 /* CaseClause */: - case 158 /* DefaultClause */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 159 /* LabelledStatement */: + case 177 /* LabeledStatement */: return emitLabelledStatement(node); - case 160 /* ThrowStatement */: + case 178 /* ThrowStatement */: return emitThrowStatement(node); - case 161 /* TryStatement */: + case 179 /* TryStatement */: return emitTryStatement(node); - case 163 /* CatchBlock */: + case 181 /* CatchBlock */: return emitCatchBlock(node); - case 165 /* DebuggerStatement */: + case 183 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 166 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 169 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return emitClassDeclaration(node); - case 170 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 171 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 174 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return emitImportDeclaration(node); - case 177 /* SourceFile */: + case 196 /* SourceFile */: return emitSourceFile(node); } } @@ -7416,7 +8223,7 @@ var ts; return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { - var leadingComments = ts.getLeadingComments(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); + var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -7426,13 +8233,13 @@ var ts; return leadingComments; } function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 177 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 196 /* SourceFile */ || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); } else { - leadingComments = ts.getLeadingCommentsOfNode(node, currentSourceFile); + leadingComments = ts.getLeadingCommentRangesOfNode(node, currentSourceFile); } return leadingComments; } @@ -7443,8 +8250,8 @@ var ts; emitComments(leadingComments, true, writer, writeComment); } function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 177 /* SourceFile */ || node.end !== node.parent.end) { - var trailingComments = ts.getTrailingComments(currentSourceFile.text, node.end); + if (node.parent.kind === 196 /* SourceFile */ || node.end !== node.parent.end) { + var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(trailingComments, false, writer, writeComment); } } @@ -7454,13 +8261,13 @@ var ts; leadingComments = getLeadingCommentsWithoutDetachedComments(); } else { - leadingComments = ts.getLeadingComments(currentSourceFile.text, pos); + leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } emitNewLineBeforeLeadingComments({ pos: pos, end: pos }, leadingComments, writer); emitComments(leadingComments, true, writer, writeComment); } function emitDetachedCommentsAtPosition(node) { - var leadingComments = ts.getLeadingComments(currentSourceFile.text, node.pos); + var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); if (leadingComments) { var detachedComments = []; var lastComment; @@ -7522,7 +8329,7 @@ var ts; writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); } function emitDeclarations(jsFilePath, root) { - var writer = createTextWriter(writeSymbol); + var writer = createTextWriterWithSymbolWriter(); var write = writer.write; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; @@ -7533,11 +8340,23 @@ var ts; } : writeJsDocComments; var aliasDeclarationEmitInfo = []; var getSymbolVisibilityDiagnosticMessage; + function createTextWriterWithSymbolWriter() { + var writer = createTextWriter(); + writer.trackSymbol = trackSymbol; + writer.writeKeyword = writer.write; + writer.writeOperator = writer.write; + writer.writePunctuation = writer.write; + writer.writeSpace = writer.write; + writer.writeStringLiteral = writer.writeLiteral; + writer.writeParameter = writer.write; + writer.writeSymbol = writer.write; + return writer; + } function writeAsychronousImportDeclarations(importDeclarations) { var oldWriter = writer; ts.forEach(importDeclarations, function (aliasToWrite) { var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); - writer = createTextWriter(writeSymbol); + writer = createTextWriterWithSymbolWriter(); for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { writer.increaseIndent(); } @@ -7546,10 +8365,9 @@ var ts; }); writer = oldWriter; } - function writeSymbol(symbol, enclosingDeclaration, meaning) { + function trackSymbol(symbol, enclosingDeclaration, meaning) { var symbolAccesibilityResult = resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning); if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { - resolver.writeSymbol(symbol, enclosingDeclaration, meaning, writer); if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); } @@ -7604,21 +8422,27 @@ var ts; writeLine(); } function emitDeclarationFlags(node) { - if (node.flags & 64 /* Static */) { + if (node.flags & 128 /* Static */) { if (node.flags & 32 /* Private */) { write("private "); } + else if (node.flags & 64 /* Protected */) { + write("protected "); + } write("static "); } else { if (node.flags & 32 /* Private */) { write("private "); } + else if (node.flags & 64 /* Protected */) { + write("protected "); + } else if (node.parent === currentSourceFile) { if (node.flags & 1 /* Export */) { write("export "); } - if (node.kind !== 170 /* InterfaceDeclaration */) { + if (node.kind !== 188 /* InterfaceDeclaration */) { write("declare "); } } @@ -7674,7 +8498,7 @@ var ts; emitDeclarationFlags(node); write("module "); emitSourceTextOfNode(node.name); - while (node.body.kind !== 173 /* ModuleBlock */) { + while (node.body.kind !== 192 /* ModuleBlock */) { node = node.body; write("."); emitSourceTextOfNode(node.name); @@ -7691,10 +8515,34 @@ var ts; enclosingDeclaration = prevEnclosingDeclaration; } } + function emitTypeAliasDeclaration(node) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitDeclarationFlags(node); + write("type "); + emitSourceTextOfNode(node.name); + write(" = "); + getSymbolVisibilityDiagnosticMessage = getTypeAliasDeclarationVisibilityError; + resolver.writeTypeAtLocation(node.type, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + write(";"); + writeLine(); + } + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; + return { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } function emitEnumDeclaration(node) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); emitDeclarationFlags(node); + if (ts.isConstEnumDeclaration(node)) { + write("const "); + } write("enum "); emitSourceTextOfNode(node.name); write(" {"); @@ -7722,34 +8570,34 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 169 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 170 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 116 /* Method */: - if (node.parent.flags & 64 /* Static */) { + case 125 /* Method */: + if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 169 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 167 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: - ts.Debug.fail("This is unknown parent for type parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -7761,7 +8609,7 @@ var ts; emitJsDocComments(node); decreaseIndent(); emitSourceTextOfNode(node.name); - if (node.constraint && (node.parent.kind !== 116 /* Method */ || !(node.parent.flags & 32 /* Private */))) { + if (node.constraint && (node.parent.kind !== 125 /* Method */ || !(node.parent.flags & 32 /* Private */))) { write(" extends "); getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -7783,7 +8631,7 @@ var ts; resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.kind === 169 /* ClassDeclaration */) { + if (node.parent.kind === 187 /* ClassDeclaration */) { if (symbolAccesibilityResult.errorModuleName) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; } @@ -7811,7 +8659,7 @@ var ts; function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & (16 /* Public */ | 32 /* Private */)) { + if (param.flags & 112 /* AccessibilityModifier */) { emitPropertyDeclaration(param); } }); @@ -7868,9 +8716,9 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 166 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 184 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { emitSourceTextOfNode(node.name); - if (node.kind === 115 /* Property */ && (node.flags & 4 /* QuestionMark */)) { + if (node.kind === 124 /* Property */ && (node.flags & 4 /* QuestionMark */)) { write("?"); } if (!(node.flags & 32 /* Private */)) { @@ -7881,14 +8729,14 @@ var ts; } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 166 /* VariableDeclaration */) { + if (node.kind === 184 /* VariableDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 115 /* Property */) { - if (node.flags & 64 /* Static */) { + else if (node.kind === 124 /* Property */) { + if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 169 /* ClassDeclaration */) { + else if (node.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { @@ -7907,7 +8755,15 @@ var ts; if (hasDeclarationWithEmit) { emitJsDocComments(node); emitDeclarationFlags(node); - write("var "); + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } emitCommaList(node.declarations, emitVariableDeclaration); write(";"); writeLine(); @@ -7930,8 +8786,8 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 119 /* SetAccessor */) { - if (node.parent.flags & 64 /* Static */) { + if (node.kind === 128 /* SetAccessor */) { + if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } else { @@ -7944,7 +8800,7 @@ var ts; }; } else { - if (node.flags & 64 /* Static */) { + if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; } else { @@ -7959,14 +8815,14 @@ var ts; } } function emitFunctionDeclaration(node) { - if ((node.kind !== 167 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 185 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); emitDeclarationFlags(node); - if (node.kind === 167 /* FunctionDeclaration */) { + if (node.kind === 185 /* FunctionDeclaration */) { write("function "); emitSourceTextOfNode(node.name); } - else if (node.kind === 117 /* Constructor */) { + else if (node.kind === 126 /* Constructor */) { write("constructor"); } else { @@ -7984,24 +8840,24 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 120 /* CallSignature */ || node.kind === 122 /* IndexSignature */) { + if (node.kind === 129 /* CallSignature */ || node.kind === 131 /* IndexSignature */) { emitJsDocComments(node); } emitTypeParameters(node.typeParameters); - if (node.kind === 122 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("["); } else { write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 122 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("]"); } else { write(")"); } - if (node.kind !== 117 /* Constructor */ && !(node.flags & 32 /* Private */)) { + if (node.kind !== 126 /* Constructor */ && !(node.flags & 32 /* Private */)) { write(": "); getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8011,31 +8867,31 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 120 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 122 /* IndexSignature */: + case 131 /* IndexSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 116 /* Method */: - if (node.flags & 64 /* Static */) { + case 125 /* Method */: + if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 169 /* ClassDeclaration */) { + else if (node.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 167 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: - ts.Debug.fail("This is unknown kind for signature: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("This is unknown kind for signature: " + node.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8062,31 +8918,31 @@ var ts; function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 117 /* Constructor */: + case 126 /* Constructor */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; break; - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 116 /* Method */: - if (node.parent.flags & 64 /* Static */) { + case 125 /* Method */: + if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 169 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 167 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: - ts.Debug.fail("This is unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8097,74 +8953,80 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 117 /* Constructor */: - case 167 /* FunctionDeclaration */: - case 116 /* Method */: + case 126 /* Constructor */: + case 185 /* FunctionDeclaration */: + case 125 /* Method */: return emitFunctionDeclaration(node); - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: return emitConstructSignatureDeclaration(node); - case 120 /* CallSignature */: - case 122 /* IndexSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: return emitSignatureDeclaration(node); - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessorDeclaration(node); - case 144 /* VariableStatement */: + case 162 /* VariableStatement */: return emitVariableStatement(node); - case 115 /* Property */: + case 124 /* Property */: return emitPropertyDeclaration(node); - case 170 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 169 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return emitClassDeclaration(node); - case 176 /* EnumMember */: + case 189 /* TypeAliasDeclaration */: + return emitTypeAliasDeclaration(node); + case 195 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 171 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 174 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return emitImportDeclaration(node); - case 175 /* ExportAssignment */: + case 194 /* ExportAssignment */: return emitExportAssignment(node); - case 177 /* SourceFile */: + case 196 /* SourceFile */: return emitSourceFile(node); } } - function resolveScriptReference(sourceFile, reference) { - var referenceFileName = compilerOptions.noResolve ? reference.filename : ts.normalizePath(ts.combinePaths(ts.getDirectoryPath(sourceFile.filename), reference.filename)); + function tryResolveScriptReference(sourceFile, reference) { + var referenceFileName = ts.normalizePath(ts.combinePaths(ts.getDirectoryPath(sourceFile.filename), reference.filename)); return program.getSourceFile(referenceFileName); } var referencePathsOutput = ""; function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 512 /* DeclarationFile */ ? referencedFile.filename : shouldEmitToOwnFile(referencedFile) ? getOwnEmitOutputFilePath(referencedFile, ".d.ts") : ts.getModuleNameFromFilename(compilerOptions.out) + ".d.ts"; - declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, compilerHost.getCurrentDirectory(), false); - referencePathsOutput += "/// " + newLine; + var declFileName = referencedFile.flags & 1024 /* DeclarationFile */ ? referencedFile.filename : shouldEmitToOwnFile(referencedFile, compilerOptions) ? getOwnEmitOutputFilePath(referencedFile, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; + declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, false); + referencePathsOutput += "/// " + newLine; } if (root) { - var addedGlobalFileReference = false; - ts.forEach(root.referencedFiles, function (fileReference) { - var referencedFile = resolveScriptReference(root, fileReference); - if ((referencedFile.flags & 512 /* DeclarationFile */) || shouldEmitToOwnFile(referencedFile) || !addedGlobalFileReference) { - writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { - addedGlobalFileReference = true; + if (!compilerOptions.noResolve) { + var addedGlobalFileReference = false; + ts.forEach(root.referencedFiles, function (fileReference) { + var referencedFile = tryResolveScriptReference(root, fileReference); + if (referencedFile && ((referencedFile.flags & 1024 /* DeclarationFile */) || shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { + writeReferencePath(referencedFile); + if (!isExternalModuleOrDeclarationFile(referencedFile)) { + addedGlobalFileReference = true; + } } - } - }); + }); + } emitNode(root); } else { var emittedReferencedFiles = []; ts.forEach(program.getSourceFiles(), function (sourceFile) { if (!isExternalModuleOrDeclarationFile(sourceFile)) { - ts.forEach(sourceFile.referencedFiles, function (fileReference) { - var referencedFile = resolveScriptReference(sourceFile, fileReference); - if (isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile)) { - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); + if (!compilerOptions.noResolve) { + ts.forEach(sourceFile.referencedFiles, function (fileReference) { + var referencedFile = tryResolveScriptReference(sourceFile, fileReference); + if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { + writeReferencePath(referencedFile); + emittedReferencedFiles.push(referencedFile); + } + }); + } emitNode(sourceFile); } }); @@ -8181,29 +9043,61 @@ var ts; } }); declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); - writeFile(ts.getModuleNameFromFilename(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); + writeFile(ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); } } - var shouldEmitDeclarations = resolver.shouldEmitDeclarations(); + var hasSemanticErrors = resolver.hasSemanticErrors(); + var isEmitBlocked = resolver.isEmitBlocked(targetSourceFile); function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (shouldEmitDeclarations) { - emitDeclarations(jsFilePath, sourceFile); + if (!isEmitBlocked) { + emitJavaScript(jsFilePath, sourceFile); + if (!hasSemanticErrors && compilerOptions.declaration) { + emitDeclarations(jsFilePath, sourceFile); + } } } - ts.forEach(program.getSourceFiles(), function (sourceFile) { - if (shouldEmitToOwnFile(sourceFile)) { - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, ".js"); - emitFile(jsFilePath, sourceFile); + if (targetSourceFile === undefined) { + ts.forEach(program.getSourceFiles(), function (sourceFile) { + if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, ".js"); + emitFile(jsFilePath, sourceFile); + } + }); + if (compilerOptions.out) { + emitFile(compilerOptions.out); + } + } + else { + if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { + var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, ".js"); + emitFile(jsFilePath, targetSourceFile); + } + else if (!ts.isDeclarationFile(targetSourceFile) && compilerOptions.out) { + emitFile(compilerOptions.out); } - }); - if (compilerOptions.out) { - emitFile(compilerOptions.out); } diagnostics.sort(ts.compareDiagnostics); diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); + var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); + var emitResultStatus; + if (isEmitBlocked) { + emitResultStatus = 1 /* AllOutputGenerationSkipped */; + } + else if (hasEmitterError) { + emitResultStatus = 4 /* EmitErrorsEncountered */; + } + else if (hasSemanticErrors && compilerOptions.declaration) { + emitResultStatus = 3 /* DeclarationGenerationSkipped */; + } + else if (hasSemanticErrors && !compilerOptions.declaration) { + emitResultStatus = 2 /* JSGeneratedWithSemanticErrors */; + } + else { + emitResultStatus = 0 /* Succeeded */; + } return { - errors: diagnostics, + emitResultStatus: emitResultStatus, + diagnostics: diagnostics, sourceMaps: sourceMapDataList }; } @@ -8214,6 +9108,44 @@ var ts; var nextSymbolId = 1; var nextNodeId = 1; var nextMergeId = 1; + function getDeclarationOfKind(symbol, kind) { + var declarations = symbol.declarations; + for (var i = 0; i < declarations.length; i++) { + var declaration = declarations[i]; + if (declaration.kind === kind) { + return declaration; + } + } + return undefined; + } + ts.getDeclarationOfKind = getDeclarationOfKind; + var stringWriters = []; + function getSingleLineStringWriter() { + if (stringWriters.length == 0) { + var str = ""; + var writeText = function (text) { return str += text; }; + return { + string: function () { return str; }, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeParameter: writeText, + writeSymbol: writeText, + writeLine: function () { return str += " "; }, + increaseIndent: function () { + }, + decreaseIndent: function () { + }, + clear: function () { return str = ""; }, + trackSymbol: function () { + } + }; + } + return stringWriters.pop(); + } + ts.getSingleLineStringWriter = getSingleLineStringWriter; function createTypeChecker(program, fullTypeCheck) { var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); @@ -8221,18 +9153,22 @@ var ts; var typeCount = 0; var emptyArray = []; var emptySymbols = {}; + var compilerOptions = program.getCompilerOptions(); var checker = { getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, getTypeCount: function () { return typeCount; }, + isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, checkProgram: checkProgram, - emitFiles: invokeEmitter, + invokeEmitter: invokeEmitter, getParentOfSymbol: getParentOfSymbol, - getTypeOfSymbol: getTypeOfSymbol, + getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, getSignaturesOfType: getSignaturesOfType, @@ -8240,16 +9176,28 @@ var ts; getReturnTypeOfSignature: getReturnTypeOfSignature, getSymbolsInScope: getSymbolsInScope, getSymbolInfo: getSymbolInfo, + getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, getTypeOfNode: getTypeOfNode, - getApparentType: getApparentType, typeToString: typeToString, + getSymbolDisplayBuilder: getSymbolDisplayBuilder, symbolToString: symbolToString, - getAugmentedPropertiesOfApparentType: getAugmentedPropertiesOfApparentType + getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, + getRootSymbols: getRootSymbols, + getContextualType: getContextualType, + getFullyQualifiedName: getFullyQualifiedName, + getResolvedSignature: getResolvedSignature, + getEnumMemberValue: getEnumMemberValue, + isValidPropertyAccess: isValidPropertyAccess, + getSignatureFromDeclaration: getSignatureFromDeclaration, + isImplementationOfOverload: isImplementationOfOverload, + getAliasedSymbol: resolveImport, + hasEarlyErrors: hasEarlyErrors, + isEmitBlocked: isEmitBlocked }; - var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); - var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(33554432 /* Transient */, "__resolving__"); + var undefinedSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "arguments"); + var unknownSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(268435456 /* Transient */, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); @@ -8262,6 +9210,7 @@ var ts; var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); var globals = {}; @@ -8273,6 +9222,9 @@ var ts; var globalNumberType; var globalBooleanType; var globalRegExpType; + var globalTemplateStringsArrayType; + var tupleTypes = {}; + var unionTypes = {}; var stringLiteralTypes = {}; var emitExtends = false; var mergedSymbols = []; @@ -8294,32 +9246,38 @@ var ts; } function getExcludedSymbolFlags(flags) { var result = 0; - if (flags & 1 /* Variable */) - result |= ts.SymbolFlags.VariableExcludes; - if (flags & 2 /* Property */) - result |= ts.SymbolFlags.PropertyExcludes; - if (flags & 4 /* EnumMember */) - result |= ts.SymbolFlags.EnumMemberExcludes; - if (flags & 8 /* Function */) - result |= ts.SymbolFlags.FunctionExcludes; - if (flags & 16 /* Class */) - result |= ts.SymbolFlags.ClassExcludes; - if (flags & 32 /* Interface */) - result |= ts.SymbolFlags.InterfaceExcludes; - if (flags & 64 /* Enum */) - result |= ts.SymbolFlags.EnumExcludes; - if (flags & 128 /* ValueModule */) - result |= ts.SymbolFlags.ValueModuleExcludes; - if (flags & 2048 /* Method */) - result |= ts.SymbolFlags.MethodExcludes; - if (flags & 8192 /* GetAccessor */) - result |= ts.SymbolFlags.GetAccessorExcludes; - if (flags & 16384 /* SetAccessor */) - result |= ts.SymbolFlags.SetAccessorExcludes; - if (flags & 262144 /* TypeParameter */) - result |= ts.SymbolFlags.TypeParameterExcludes; - if (flags & 4194304 /* Import */) - result |= ts.SymbolFlags.ImportExcludes; + if (flags & 2 /* BlockScopedVariable */) + result |= 107455 /* BlockScopedVariableExcludes */; + if (flags & 1 /* FunctionScopedVariable */) + result |= 107454 /* FunctionScopedVariableExcludes */; + if (flags & 4 /* Property */) + result |= 107455 /* PropertyExcludes */; + if (flags & 8 /* EnumMember */) + result |= 107455 /* EnumMemberExcludes */; + if (flags & 16 /* Function */) + result |= 106927 /* FunctionExcludes */; + if (flags & 32 /* Class */) + result |= 3258879 /* ClassExcludes */; + if (flags & 64 /* Interface */) + result |= 3152288 /* InterfaceExcludes */; + if (flags & 256 /* RegularEnum */) + result |= 3258623 /* RegularEnumExcludes */; + if (flags & 128 /* ConstEnum */) + result |= 3259263 /* ConstEnumExcludes */; + if (flags & 512 /* ValueModule */) + result |= 106639 /* ValueModuleExcludes */; + if (flags & 8192 /* Method */) + result |= 99263 /* MethodExcludes */; + if (flags & 32768 /* GetAccessor */) + result |= 41919 /* GetAccessorExcludes */; + if (flags & 65536 /* SetAccessor */) + result |= 74687 /* SetAccessorExcludes */; + if (flags & 1048576 /* TypeParameter */) + result |= 2103776 /* TypeParameterExcludes */; + if (flags & 2097152 /* TypeAlias */) + result |= 3152352 /* TypeAliasExcludes */; + if (flags & 33554432 /* Import */) + result |= 33554432 /* ImportExcludes */; return result; } function recordMergedSymbol(target, source) { @@ -8328,11 +9286,13 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 16777216 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags | 134217728 /* Merged */, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; if (symbol.members) result.members = cloneSymbolTable(symbol.members); if (symbol.exports) @@ -8342,6 +9302,9 @@ var ts; } function extendSymbol(target, source) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + target.constEnumOnlyModule = false; + } target.flags |= source.flags; if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; @@ -8361,8 +9324,12 @@ var ts; recordMergedSymbol(target, source); } else { + var message = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { - error(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, symbolToString(source)); + error(node.name ? node.name : node, message, symbolToString(source)); + }); + ts.forEach(target.declarations, function (node) { + error(node.name ? node.name : node, message, symbolToString(source)); }); } } @@ -8383,7 +9350,7 @@ var ts; } else { var symbol = target[id]; - if (!(symbol.flags & 16777216 /* Merged */)) { + if (!(symbol.flags & 134217728 /* Merged */)) { target[id] = symbol = cloneSymbol(symbol); } extendSymbol(symbol, source[id]); @@ -8392,7 +9359,7 @@ var ts; } } function getSymbolLinks(symbol) { - if (symbol.flags & 33554432 /* Transient */) + if (symbol.flags & 268435456 /* Transient */) return symbol; if (!symbol.id) symbol.id = nextSymbolId++; @@ -8404,19 +9371,19 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return getAncestor(node, 177 /* SourceFile */); + return ts.getAncestor(node, 196 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 177 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 196 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { var target = resolveImport(symbol); if (target === unknownSymbol || target.flags & meaning) { return symbol; @@ -8424,104 +9391,127 @@ var ts; } } } + function isDefinedBefore(node1, node2) { + var file1 = ts.getSourceFileOfNode(node1); + var file2 = ts.getSourceFileOfNode(node2); + if (file1 === file2) { + return node1.pos <= node2.pos; + } + if (!compilerOptions.out) { + return true; + } + var sourceFiles = program.getSourceFiles(); + return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); + } function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { - var errorLocation = location; var result; var lastLocation; - var memberWithInitializerThatReferencesIdentifierFromConstructor; - function returnResolvedSymbol(s) { - if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { - var propertyName = memberWithInitializerThatReferencesIdentifierFromConstructor.name; - error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), nameArg); - return undefined; - } - if (!s && nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, nameArg); - } - return s; - } - while (location) { + var propertyWithInvalidInitializer; + var errorLocation = location; + loop: while (location) { if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - return returnResolvedSymbol(result); + break loop; } } switch (location.kind) { - case 177 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 172 /* ModuleDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { - return returnResolvedSymbol(result); + case 191 /* ModuleDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 35653619 /* ModuleMember */)) { + break loop; } break; - case 171 /* EnumDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 4 /* EnumMember */)) { - return returnResolvedSymbol(result); + case 190 /* EnumDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { + break loop; } break; - case 115 /* Property */: - if (location.parent.kind === 169 /* ClassDeclaration */ && !(location.flags & 64 /* Static */)) { + case 124 /* Property */: + if (location.parent.kind === 187 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { - memberWithInitializerThatReferencesIdentifierFromConstructor = location; + if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { + propertyWithInvalidInitializer = location; } } } break; - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { - if (lastLocation && lastLocation.flags & 64 /* Static */) { + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 3152352 /* Type */)) { + if (lastLocation && lastLocation.flags & 128 /* Static */) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } - else { - return returnResolvedSymbol(result); - } + break loop; } break; - case 116 /* Method */: - case 117 /* Constructor */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 167 /* FunctionDeclaration */: - case 137 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } break; - case 136 /* FunctionExpression */: + case 152 /* FunctionExpression */: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } var id = location.name; if (id && name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; - case 163 /* CatchBlock */: + case 181 /* CatchBlock */: var id = location.variable; if (name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; } lastLocation = location; location = location.parent; } - if (result = getSymbol(globals, name, meaning)) { - return returnResolvedSymbol(result); + if (!result) { + result = getSymbol(globals, name, meaning); } - return returnResolvedSymbol(undefined); + if (!result) { + if (nameNotFoundMessage) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + } + return undefined; + } + if (nameNotFoundMessage) { + if (propertyWithInvalidInitializer) { + var propertyName = propertyWithInvalidInitializer.name; + error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + return undefined; + } + if (result.flags & 2 /* BlockScopedVariable */) { + var declaration = ts.forEach(result.declarations, function (d) { return d.flags & 6144 /* BlockScoped */ ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + if (!isDefinedBefore(declaration, errorLocation)) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + } + } + return result; } function resolveImport(symbol) { - ts.Debug.assert((symbol.flags & 4194304 /* Import */) !== 0, "Should only get Imports here."); + ts.Debug.assert((symbol.flags & 33554432 /* Import */) !== 0, "Should only get Imports here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 174 /* ImportDeclaration */); + var node = getDeclarationOfKind(symbol, 193 /* ImportDeclaration */); var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -8537,44 +9527,44 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = getAncestor(entityName, 174 /* ImportDeclaration */); - ts.Debug.assert(importDeclaration); + importDeclaration = ts.getAncestor(entityName, 193 /* ImportDeclaration */); + ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 55 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 63 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 55 /* Identifier */ || entityName.parent.kind === 112 /* QualifiedName */) { - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Namespace); + if (entityName.kind === 63 /* Identifier */ || entityName.parent.kind === 121 /* QualifiedName */) { + return resolveEntityName(importDeclaration, entityName, 1536 /* Namespace */); } else { - ts.Debug.assert(entityName.parent.kind === 174 /* ImportDeclaration */); - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace); + ts.Debug.assert(entityName.parent.kind === 193 /* ImportDeclaration */); + return resolveEntityName(importDeclaration, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } function resolveEntityName(location, name, meaning) { - if (name.kind === 55 /* Identifier */) { - var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(name)); + if (name.kind === 63 /* Identifier */) { + var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return; } } - else if (name.kind === 112 /* QualifiedName */) { - var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || name.right.kind === 111 /* Missing */) + else if (name.kind === 121 /* QualifiedName */) { + var namespace = resolveEntityName(location, name.left, 1536 /* Namespace */); + if (!namespace || namespace === unknownSymbol || name.right.kind === 120 /* Missing */) return; var symbol = getSymbol(namespace.exports, name.right.text, meaning); if (!symbol) { - error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.identifierToString(name.right)); + error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(name.right)); return; } } else { return; } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveImport(symbol); } function isExternalModuleNameRelative(moduleName) { @@ -8587,7 +9577,7 @@ var ts; return; var isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 128 /* ValueModule */); + var symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */); if (symbol) { return getResolvedExportSymbol(symbol); } @@ -8614,10 +9604,10 @@ var ts; function getResolvedExportSymbol(moduleSymbol) { var symbol = getExportAssignmentSymbol(moduleSymbol); if (symbol) { - if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { + if (symbol.flags & (107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */)) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return resolveImport(symbol); } } @@ -8641,8 +9631,8 @@ var ts; error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } if (node.exportName.text) { - var meaning = ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace; - var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node.exportName)); + var meaning = 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */; + var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, node.exportName); } } symbolLinks.exportAssignSymbol = exportSymbol || unknownSymbol; @@ -8652,9 +9642,9 @@ var ts; var seenExportedMember = false; var result = []; ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 177 /* SourceFile */ ? declaration : declaration.body); + var block = (declaration.kind === 196 /* SourceFile */ ? declaration : declaration.body); ts.forEach(block.statements, function (node) { - if (node.kind === 175 /* ExportAssignment */) { + if (node.kind === 194 /* ExportAssignment */) { result.push(node); } else { @@ -8678,35 +9668,25 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 524288 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; + return symbol && (symbol.flags & 4194304 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & ts.SymbolFlags.Value) { + if (symbol.flags & 67108864 /* Instantiated */) { + return symbolIsValue(getSymbolLinks(symbol).target); + } + if (symbol.flags & 107455 /* Value */) { return true; } - if (symbol.flags & 4194304 /* Import */) { - return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; - } - if (symbol.flags & 8388608 /* Instantiated */) { - return (getSymbolLinks(symbol).target.flags & ts.SymbolFlags.Value) !== 0; + if (symbol.flags & 33554432 /* Import */) { + return (resolveImport(symbol).flags & 107455 /* Value */) !== 0; } return false; } - function getDeclarationOfKind(symbol, kind) { - var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; - if (declaration.kind === kind) { - return declaration; - } - } - return undefined; - } function findConstructorDeclaration(node) { var members = node.members; for (var i = 0; i < members.length; i++) { var member = members[i]; - if (member.kind === 117 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } } @@ -8757,13 +9737,10 @@ var ts; return type; } function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { - return setObjectTypeMembers(createObjectType(8192 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function isOptionalProperty(propertySymbol) { - if (propertySymbol.flags & 67108864 /* Prototype */) { - return false; - } - return (propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */) && propertySymbol.valueDeclaration.kind !== 114 /* Parameter */; + return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 123 /* Parameter */; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; @@ -8774,17 +9751,17 @@ var ts; } } switch (location.kind) { - case 177 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location).members)) { return result; } @@ -8794,15 +9771,15 @@ var ts; return callback(globals); } function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === ts.SymbolFlags.Value ? ts.SymbolFlags.Value : ts.SymbolFlags.Namespace; + return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1536 /* Namespace */; } - function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning) { + function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { function canQualifySymbol(symbolFromSymbolTable, meaning) { if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { return true; } - var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning)); + var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); return !!accessibleParent; } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { @@ -8814,14 +9791,16 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 4194304 /* Import */) { - var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + if (symbolFromSymbolTable.flags & 33554432 /* Import */) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 193 /* ImportDeclaration */ && declaration.externalModuleName; })) { + var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); + if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { + return [symbolFromSymbolTable]; + } + var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + } } } }); @@ -8840,7 +9819,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 4194304 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 33554432 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -8850,18 +9829,18 @@ var ts; return qualify; } function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { + if (symbol && enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook); + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook, false); if (accessibleSymbolChain) { var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); if (!hasAccessibleDeclarations) { return { accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, ts.SymbolFlags.Namespace) : undefined + errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536 /* Namespace */) : undefined }; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; @@ -8895,7 +9874,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 172 /* ModuleDeclaration */ && declaration.name.kind === 3 /* StringLiteral */) || (declaration.kind === 177 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 191 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 196 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -8905,7 +9884,7 @@ var ts; return { aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 174 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 193 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -8924,268 +9903,438 @@ var ts; } function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName) { var firstIdentifier = getFirstIdentifier(entityName); - var firstIdentifierName = ts.identifierToString(firstIdentifier); - var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, ts.SymbolFlags.Namespace, ts.Diagnostics.Cannot_find_name_0, firstIdentifierName); + var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: firstIdentifierName }; + return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: ts.declarationNameToString(firstIdentifier) }; + } + function releaseStringWriter(writer) { + writer.clear(); + stringWriters.push(writer); + } + function writeKeyword(writer, kind) { + writer.writeKeyword(ts.tokenToString(kind)); + } + function writePunctuation(writer, kind) { + writer.writePunctuation(ts.tokenToString(kind)); + } + function writeOperator(writer, kind) { + writer.writeOperator(ts.tokenToString(kind)); + } + function writeSpace(writer) { + writer.writeSpace(" "); } function symbolToString(symbol, enclosingDeclaration, meaning) { - function getSymbolName(symbol) { + var writer = getSingleLineStringWriter(); + getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning); + var result = writer.string(); + releaseStringWriter(writer); + return result; + } + function typeToString(type, enclosingDeclaration, flags) { + var writer = getSingleLineStringWriter(); + getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + var result = writer.string(); + releaseStringWriter(writer); + var maxLength = compilerOptions.noErrorTruncation || flags & 4 /* NoTruncation */ ? undefined : 100; + if (maxLength && result.length >= maxLength) { + result = result.substr(0, maxLength - "...".length) + "..."; + } + return result; + } + function getTypeAliasForTypeLiteral(type) { + if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { + var node = type.symbol.declarations[0].parent; + while (node.kind === 140 /* ParenType */) { + node = node.parent; + } + if (node.kind === 189 /* TypeAliasDeclaration */) { + return getSymbolOfNode(node); + } + } + return undefined; + } + var _displayBuilder; + function getSymbolDisplayBuilder() { + function appendSymbolNameOnly(symbol, writer) { if (symbol.declarations && symbol.declarations.length > 0) { var declaration = symbol.declarations[0]; if (declaration.name) { - return ts.identifierToString(declaration.name); - } - } - return symbol.name; - } - if (enclosingDeclaration && !(symbol.flags & (ts.SymbolFlags.PropertyOrAccessor | ts.SymbolFlags.Signature | 4096 /* Constructor */ | 2048 /* Method */ | 262144 /* TypeParameter */))) { - var symbolName; - while (symbol) { - var isFirstName = !symbolName; - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning); - var currentSymbolName; - if (accessibleSymbolChain) { - currentSymbolName = ts.map(accessibleSymbolChain, function (accessibleSymbol) { return getSymbolName(accessibleSymbol); }).join("."); - } - else { - if (!isFirstName && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { - break; - } - currentSymbolName = getSymbolName(symbol); - } - symbolName = currentSymbolName + (isFirstName ? "" : ("." + symbolName)); - if (accessibleSymbolChain && !needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - break; - } - symbol = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - meaning = getQualifiedLeftMeaning(meaning); - } - return symbolName; - } - return getSymbolName(symbol); - } - function writeSymbolToTextWriter(symbol, enclosingDeclaration, meaning, writer) { - writer.write(symbolToString(symbol, enclosingDeclaration, meaning)); - } - function createSingleLineTextWriter() { - var result = ""; - return { - write: function (s) { - result += s; - }, - writeSymbol: function (symbol, enclosingDeclaration, meaning) { - writeSymbolToTextWriter(symbol, enclosingDeclaration, meaning, this); - }, - writeLine: function () { - result += " "; - }, - increaseIndent: function () { - }, - decreaseIndent: function () { - }, - getText: function () { - return result; - } - }; - } - function typeToString(type, enclosingDeclaration, flags) { - var stringWriter = createSingleLineTextWriter(); - writeTypeToTextWriter(type, enclosingDeclaration, flags, stringWriter); - return stringWriter.getText(); - } - function writeTypeToTextWriter(type, enclosingDeclaration, flags, writer) { - var typeStack; - return writeType(type, true); - function writeType(type, allowFunctionOrConstructorTypeLiteral) { - if (type.flags & ts.TypeFlags.Intrinsic) { - writer.write(type.intrinsicName); - } - else if (type.flags & 4096 /* Reference */) { - writeTypeReference(type); - } - else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { - writer.writeSymbol(type.symbol, enclosingDeclaration, ts.SymbolFlags.Type); - } - else if (type.flags & 8192 /* Anonymous */) { - writeAnonymousType(type, allowFunctionOrConstructorTypeLiteral); - } - else if (type.flags & 256 /* StringLiteral */) { - writer.write(type.text); - } - else { - writer.write("{ ... }"); - } - } - function writeTypeReference(type) { - if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { - writeType(type.typeArguments[0], false); - writer.write("[]"); - } - else { - writer.writeSymbol(type.target.symbol, enclosingDeclaration, ts.SymbolFlags.Type); - writer.write("<"); - for (var i = 0; i < type.typeArguments.length; i++) { - if (i > 0) { - writer.write(", "); - } - writeType(type.typeArguments[i], true); - } - writer.write(">"); - } - } - function writeAnonymousType(type, allowFunctionOrConstructorTypeLiteral) { - if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { - writeTypeofSymbol(type); - } - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeofSymbol(type); - } - else if (typeStack && ts.contains(typeStack, type)) { - writer.write("any"); - } - else { - if (!typeStack) { - typeStack = []; - } - typeStack.push(type); - writeLiteralType(type, allowFunctionOrConstructorTypeLiteral); - typeStack.pop(); - } - function shouldWriteTypeOfFunctionSymbol() { - if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 2048 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 64 /* Static */; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 8 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 177 /* SourceFile */ || declaration.parent.kind === 173 /* ModuleBlock */; })); - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); - } - } - } - } - function writeTypeofSymbol(type) { - writer.write("typeof "); - writer.writeSymbol(type.symbol, enclosingDeclaration, ts.SymbolFlags.Value); - } - function writeLiteralType(type, allowFunctionOrConstructorTypeLiteral) { - var resolved = resolveObjectTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writer.write("{}"); + writer.writeSymbol(ts.declarationNameToString(declaration.name), symbol); return; } - if (allowFunctionOrConstructorTypeLiteral) { + } + writer.writeSymbol(symbol.name, symbol); + } + function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags) { + var parentSymbol; + function appendParentTypeArgumentsAndSymbolName(symbol) { + if (parentSymbol) { + if (flags & 1 /* WriteTypeParametersOrArguments */) { + if (symbol.flags & 67108864 /* Instantiated */) { + buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); + } + else { + buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); + } + } + writePunctuation(writer, 19 /* DotToken */); + } + parentSymbol = symbol; + appendSymbolNameOnly(symbol, writer); + } + writer.trackSymbol(symbol, enclosingDeclaration, meaning); + function walkSymbol(symbol, meaning) { + if (symbol) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */)); + if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); + } + if (accessibleSymbolChain) { + for (var i = 0, n = accessibleSymbolChain.length; i < n; i++) { + appendParentTypeArgumentsAndSymbolName(accessibleSymbolChain[i]); + } + } + else { + if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { + return; + } + if (symbol.flags & 2048 /* TypeLiteral */ || symbol.flags & 4096 /* ObjectLiteral */) { + return; + } + appendParentTypeArgumentsAndSymbolName(symbol); + } + } + } + if (enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { + walkSymbol(symbol, meaning); + return; + } + return appendParentTypeArgumentsAndSymbolName(symbol); + } + function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, typeStack) { + var globalFlagsToPass = globalFlags & 16 /* WriteOwnNameForAnyLike */; + return writeType(type, globalFlags); + function writeType(type, flags) { + if (type.flags & 127 /* Intrinsic */) { + writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && (type.flags & 1 /* Any */) ? "any" : type.intrinsicName); + } + else if (type.flags & 4096 /* Reference */) { + writeTypeReference(type, flags); + } + else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 3152352 /* Type */); + } + else if (type.flags & 8192 /* Tuple */) { + writeTupleType(type); + } + else if (type.flags & 16384 /* Union */) { + writeUnionType(type, flags); + } + else if (type.flags & 32768 /* Anonymous */) { + writeAnonymousType(type, flags); + } + else if (type.flags & 256 /* StringLiteral */) { + writer.writeStringLiteral(type.text); + } + else { + writePunctuation(writer, 13 /* OpenBraceToken */); + writeSpace(writer); + writePunctuation(writer, 20 /* DotDotDotToken */); + writeSpace(writer); + writePunctuation(writer, 14 /* CloseBraceToken */); + } + } + function writeTypeList(types, union) { + for (var i = 0; i < types.length; i++) { + if (i > 0) { + if (union) { + writeSpace(writer); + } + writePunctuation(writer, union ? 43 /* BarToken */ : 22 /* CommaToken */); + writeSpace(writer); + } + writeType(types[i], union ? 64 /* InElementType */ : 0 /* None */); + } + } + function writeTypeReference(type, flags) { + if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { + writeType(type.typeArguments[0], 64 /* InElementType */); + writePunctuation(writer, 17 /* OpenBracketToken */); + writePunctuation(writer, 18 /* CloseBracketToken */); + } + else { + buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 3152352 /* Type */); + writePunctuation(writer, 23 /* LessThanToken */); + writeTypeList(type.typeArguments, false); + writePunctuation(writer, 24 /* GreaterThanToken */); + } + } + function writeTupleType(type) { + writePunctuation(writer, 17 /* OpenBracketToken */); + writeTypeList(type.elementTypes, false); + writePunctuation(writer, 18 /* CloseBracketToken */); + } + function writeUnionType(type, flags) { + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 15 /* OpenParenToken */); + } + writeTypeList(type.types, true); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* CloseParenToken */); + } + } + function writeAnonymousType(type, flags) { + if (type.symbol && type.symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { + writeTypeofSymbol(type); + } + else if (shouldWriteTypeOfFunctionSymbol()) { + writeTypeofSymbol(type); + } + else if (typeStack && ts.contains(typeStack, type)) { + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 3152352 /* Type */); + } + else { + writeKeyword(writer, 109 /* AnyKeyword */); + } + } + else { + if (!typeStack) { + typeStack = []; + } + typeStack.push(type); + writeLiteralType(type, flags); + typeStack.pop(); + } + function shouldWriteTypeOfFunctionSymbol() { + if (type.symbol) { + var isStaticMethodSymbol = !!(type.symbol.flags & 8192 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 196 /* SourceFile */ || declaration.parent.kind === 192 /* ModuleBlock */; })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); + } + } + } + } + function writeTypeofSymbol(type) { + writeKeyword(writer, 95 /* TypeOfKeyword */); + writeSpace(writer); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */); + } + function writeLiteralType(type, flags) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + writePunctuation(writer, 13 /* OpenBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); + return; + } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - writeSignature(resolved.callSignatures[0], true); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 15 /* OpenParenToken */); + } + buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* CloseParenToken */); + } return; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - writer.write("new "); - writeSignature(resolved.constructSignatures[0], true); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 15 /* OpenParenToken */); + } + writeKeyword(writer, 86 /* NewKeyword */); + writeSpace(writer); + buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* CloseParenToken */); + } return; } } - } - writer.write("{"); - writer.writeLine(); - writer.increaseIndent(); - for (var i = 0; i < resolved.callSignatures.length; i++) { - writeSignature(resolved.callSignatures[i]); - writer.write(";"); + writePunctuation(writer, 13 /* OpenBraceToken */); writer.writeLine(); - } - for (var i = 0; i < resolved.constructSignatures.length; i++) { - writer.write("new "); - writeSignature(resolved.constructSignatures[i]); - writer.write(";"); - writer.writeLine(); - } - if (resolved.stringIndexType) { - writer.write("[x: string]: "); - writeType(resolved.stringIndexType, true); - writer.write(";"); - writer.writeLine(); - } - if (resolved.numberIndexType) { - writer.write("[x: number]: "); - writeType(resolved.numberIndexType, true); - writer.write(";"); - writer.writeLine(); - } - for (var i = 0; i < resolved.properties.length; i++) { - var p = resolved.properties[i]; - var t = getTypeOfSymbol(p); - if (p.flags & (8 /* Function */ | 2048 /* Method */) && !getPropertiesOfType(t).length) { - var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var j = 0; j < signatures.length; j++) { - writer.writeSymbol(p); - if (isOptionalProperty(p)) { - writer.write("?"); + writer.increaseIndent(); + for (var i = 0; i < resolved.callSignatures.length; i++) { + buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + writePunctuation(writer, 21 /* SemicolonToken */); + writer.writeLine(); + } + for (var i = 0; i < resolved.constructSignatures.length; i++) { + writeKeyword(writer, 86 /* NewKeyword */); + writeSpace(writer); + buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + writePunctuation(writer, 21 /* SemicolonToken */); + writer.writeLine(); + } + if (resolved.stringIndexType) { + writePunctuation(writer, 17 /* OpenBracketToken */); + writer.writeParameter("x"); + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + writeKeyword(writer, 118 /* StringKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + writeType(resolved.stringIndexType, 0 /* None */); + writePunctuation(writer, 21 /* SemicolonToken */); + writer.writeLine(); + } + if (resolved.numberIndexType) { + writePunctuation(writer, 17 /* OpenBracketToken */); + writer.writeParameter("x"); + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + writeKeyword(writer, 116 /* NumberKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + writeType(resolved.numberIndexType, 0 /* None */); + writePunctuation(writer, 21 /* SemicolonToken */); + writer.writeLine(); + } + for (var i = 0; i < resolved.properties.length; i++) { + var p = resolved.properties[i]; + var t = getTypeOfSymbol(p); + if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { + var signatures = getSignaturesOfType(t, 0 /* Call */); + for (var j = 0; j < signatures.length; j++) { + buildSymbolDisplay(p, writer); + if (isOptionalProperty(p)) { + writePunctuation(writer, 49 /* QuestionToken */); + } + buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + writePunctuation(writer, 21 /* SemicolonToken */); + writer.writeLine(); } - writeSignature(signatures[j]); - writer.write(";"); + } + else { + buildSymbolDisplay(p, writer); + if (isOptionalProperty(p)) { + writePunctuation(writer, 49 /* QuestionToken */); + } + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + writeType(t, 0 /* None */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } } - else { - writer.writeSymbol(p); - if (isOptionalProperty(p)) { - writer.write("?"); - } - writer.write(": "); - writeType(t, true); - writer.write(";"); - writer.writeLine(); - } + writer.decreaseIndent(); + writePunctuation(writer, 14 /* CloseBraceToken */); } - writer.decreaseIndent(); - writer.write("}"); } - function writeSignature(signature, arrowStyle) { - if (signature.typeParameters) { - writer.write("<"); - for (var i = 0; i < signature.typeParameters.length; i++) { + function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { + var targetSymbol = getTargetSymbol(symbol); + if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */) { + buildDisplayForTypeParametersAndDelimiters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); + } + } + function buildTypeParameterDisplay(tp, writer, enclosingDeclaration, flags, typeStack) { + appendSymbolNameOnly(tp.symbol, writer); + var constraint = getConstraintOfTypeParameter(tp); + if (constraint) { + writeSpace(writer); + writeKeyword(writer, 77 /* ExtendsKeyword */); + writeSpace(writer); + buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); + } + } + function buildParameterDisplay(p, writer, enclosingDeclaration, flags, typeStack) { + if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { + writePunctuation(writer, 20 /* DotDotDotToken */); + } + appendSymbolNameOnly(p, writer); + if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { + writePunctuation(writer, 49 /* QuestionToken */); + } + writePunctuation(writer, 50 /* ColonToken */); + writeSpace(writer); + buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); + } + function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, typeStack) { + if (typeParameters && typeParameters.length) { + writePunctuation(writer, 23 /* LessThanToken */); + for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writer.write(", "); - } - var tp = signature.typeParameters[i]; - writer.writeSymbol(tp.symbol); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writer.write(" extends "); - writeType(constraint, true); + writePunctuation(writer, 22 /* CommaToken */); + writeSpace(writer); } + buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); } - writer.write(">"); + writePunctuation(writer, 24 /* GreaterThanToken */); } - writer.write("("); - for (var i = 0; i < signature.parameters.length; i++) { - if (i > 0) { - writer.write(", "); - } - var p = signature.parameters[i]; - if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { - writer.write("..."); - } - writer.writeSymbol(p); - if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { - writer.write("?"); - } - writer.write(": "); - writeType(getTypeOfSymbol(p), true); - } - writer.write(arrowStyle ? ") => " : "): "); - writeType(getReturnTypeOfSignature(signature), true); } + function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) { + if (typeParameters && typeParameters.length) { + writePunctuation(writer, 23 /* LessThanToken */); + for (var i = 0; i < typeParameters.length; i++) { + if (i > 0) { + writePunctuation(writer, 22 /* CommaToken */); + writeSpace(writer); + } + buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0 /* None */); + } + writePunctuation(writer, 24 /* GreaterThanToken */); + } + } + function buildDisplayForParametersAndDelimiters(parameters, writer, enclosingDeclaration, flags, typeStack) { + writePunctuation(writer, 15 /* OpenParenToken */); + for (var i = 0; i < parameters.length; i++) { + if (i > 0) { + writePunctuation(writer, 22 /* CommaToken */); + writeSpace(writer); + } + buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, typeStack); + } + writePunctuation(writer, 16 /* CloseParenToken */); + } + function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { + if (flags & 8 /* WriteArrowStyleSignature */) { + writeSpace(writer); + writePunctuation(writer, 31 /* EqualsGreaterThanToken */); + } + else { + writePunctuation(writer, 50 /* ColonToken */); + } + writeSpace(writer); + buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); + } + function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { + if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) { + buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); + } + else { + buildDisplayForTypeParametersAndDelimiters(signature.typeParameters, writer, enclosingDeclaration, flags, typeStack); + } + buildDisplayForParametersAndDelimiters(signature.parameters, writer, enclosingDeclaration, flags, typeStack); + buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack); + } + return _displayBuilder || (_displayBuilder = { + symbolToString: symbolToString, + typeToString: typeToString, + buildSymbolDisplay: buildSymbolDisplay, + buildTypeDisplay: buildTypeDisplay, + buildTypeParameterDisplay: buildTypeParameterDisplay, + buildParameterDisplay: buildParameterDisplay, + buildDisplayForParametersAndDelimiters: buildDisplayForParametersAndDelimiters, + buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, + buildDisplayForTypeArgumentsAndDelimiters: buildDisplayForTypeArgumentsAndDelimiters, + buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, + buildSignatureDisplay: buildSignatureDisplay, + buildReturnTypeDisplay: buildReturnTypeDisplay + }); } function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 172 /* ModuleDeclaration */) { - if (node.name.kind === 3 /* StringLiteral */) { + if (node.kind === 191 /* ModuleDeclaration */) { + if (node.name.kind === 7 /* StringLiteral */) { return node; } } - else if (node.kind === 177 /* SourceFile */) { + else if (node.kind === 196 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9201,7 +10350,7 @@ var ts; if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; } - if (symbolOfNode.flags & 4194304 /* Import */) { + if (symbolOfNode.flags & 33554432 /* Import */) { return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); } } @@ -9209,7 +10358,7 @@ var ts; if (exportAssignmentSymbol === symbol) { return true; } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 4194304 /* Import */)) { + if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 33554432 /* Import */)) { resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); if (resolvedExportSymbol === symbol) { return true; @@ -9227,34 +10376,35 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 166 /* VariableDeclaration */: - case 172 /* ModuleDeclaration */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 167 /* FunctionDeclaration */: - case 171 /* EnumDeclaration */: - case 174 /* ImportDeclaration */: - var parent = node.kind === 166 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 174 /* ImportDeclaration */ && parent.kind !== 177 /* SourceFile */ && ts.isInAmbientContext(parent))) { + case 184 /* VariableDeclaration */: + case 191 /* ModuleDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 185 /* FunctionDeclaration */: + case 190 /* EnumDeclaration */: + case 193 /* ImportDeclaration */: + var parent = node.kind === 184 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (!(node.flags & 1 /* Export */) && !(node.kind !== 193 /* ImportDeclaration */ && parent.kind !== 196 /* SourceFile */ && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); - case 115 /* Property */: - case 116 /* Method */: - if (node.flags & 32 /* Private */) { + case 124 /* Property */: + case 125 /* Method */: + if (node.flags & (32 /* Private */ | 64 /* Protected */)) { return false; } - case 117 /* Constructor */: - case 121 /* ConstructSignature */: - case 120 /* CallSignature */: - case 122 /* IndexSignature */: - case 114 /* Parameter */: - case 173 /* ModuleBlock */: + case 126 /* Constructor */: + case 130 /* ConstructSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: + case 123 /* Parameter */: + case 192 /* ModuleBlock */: return isDeclarationVisible(node.parent); - case 177 /* SourceFile */: + case 196 /* SourceFile */: return true; default: - ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } if (node) { @@ -9265,40 +10415,21 @@ var ts; return links.isVisible; } } - function getApparentType(type) { - if (type.flags & 512 /* TypeParameter */) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512 /* TypeParameter */); - if (!type) - type = emptyObjectType; - } - if (type.flags & ts.TypeFlags.StringLike) { - type = globalStringType; - } - else if (type.flags & ts.TypeFlags.NumberLike) { - type = globalNumberType; - } - else if (type.flags & 8 /* Boolean */) { - type = globalBooleanType; - } - return type; - } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } - function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 151 /* ForInStatement */) { + function getTypeOfVariableOrPropertyDeclaration(declaration) { + if (declaration.parent.kind === 169 /* ForInStatement */) { return anyType; } if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 114 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { var func = declaration.parent; - if (func.kind === 119 /* SetAccessor */) { - var getter = getDeclarationOfKind(declaration.parent.symbol, 118 /* GetAccessor */); + if (func.kind === 128 /* SetAccessor */) { + var getter = getDeclarationOfKind(declaration.parent.symbol, 127 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -9309,57 +10440,68 @@ var ts; } } if (declaration.initializer) { - var unwidenedType = checkAndMarkExpression(declaration.initializer); - var type = getWidenedType(unwidenedType); - if (type !== unwidenedType) { - checkImplicitAny(type); + var type = checkAndMarkExpression(declaration.initializer); + if (declaration.kind !== 143 /* PropertyAssignment */) { + var unwidenedType = type; + type = getWidenedType(type); + if (type !== unwidenedType) { + checkImplicitAny(type); + } } return type; } + if (declaration.kind === 144 /* ShorthandPropertyAssignment */) { + var type = checkIdentifier(declaration.name); + return type; + } var type = declaration.flags & 8 /* Rest */ ? createArrayType(anyType) : anyType; checkImplicitAny(type); return type; function checkImplicitAny(type) { - if (!fullTypeCheck || !program.getCompilerOptions().noImplicitAny) { + if (!fullTypeCheck || !compilerOptions.noImplicitAny) { return; } if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { return; } - if (isPrivateWithinAmbient(declaration) || (declaration.kind === 114 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { + if (isPrivateWithinAmbient(declaration) || (declaration.kind === 123 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { return; } switch (declaration.kind) { - case 115 /* Property */: + case 124 /* Property */: var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 114 /* Parameter */: + case 123 /* Parameter */: var diagnostic = declaration.flags & 8 /* Rest */ ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; default: var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } - error(declaration, diagnostic, ts.identifierToString(declaration.name), typeToString(type)); + error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeToString(type)); } } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 67108864 /* Prototype */) { + if (symbol.flags & 536870912 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.kind === 163 /* CatchBlock */) { + if (declaration.kind === 181 /* CatchBlock */) { return links.type = anyType; } links.type = resolvingType; - var type = getTypeOfVariableDeclaration(declaration); + var type = getTypeOfVariableOrPropertyDeclaration(declaration); if (links.type === resolvingType) { links.type = type; } } else if (links.type === resolvingType) { links.type = anyType; + if (compilerOptions.noImplicitAny) { + var diagnostic = symbol.valueDeclaration.type ? ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; + error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); + } } return links.type; } @@ -9368,7 +10510,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 118 /* GetAccessor */) { + if (accessor.kind === 127 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -9387,8 +10529,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = getDeclarationOfKind(symbol, 118 /* GetAccessor */); - var setter = getDeclarationOfKind(symbol, 119 /* SetAccessor */); + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); + var setter = getDeclarationOfKind(symbol, 128 /* SetAccessor */); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -9400,12 +10542,12 @@ var ts; type = setterParameterType; } else { - if (getter) { + if (getter && getter.body) { type = getReturnTypeFromBody(getter); } else { - if (program.getCompilerOptions().noImplicitAny) { - error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbol.name); + if (compilerOptions.noImplicitAny) { + error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbolToString(symbol)); } type = anyType; } @@ -9417,12 +10559,16 @@ var ts; } else if (links.type === resolvingType) { links.type = anyType; + if (compilerOptions.noImplicitAny) { + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); + error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); + } } } function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - links.type = createObjectType(8192 /* Anonymous */, symbol); + links.type = createObjectType(32768 /* Anonymous */, symbol); } return links.type; } @@ -9448,24 +10594,24 @@ var ts; return links.type; } function getTypeOfSymbol(symbol) { - if (symbol.flags & (1 /* Variable */ | 2 /* Property */)) { + if (symbol.flags & 67108864 /* Instantiated */) { + return getTypeOfInstantiatedSymbol(symbol); + } + if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */ | 16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); } - if (symbol.flags & 4 /* EnumMember */) { + if (symbol.flags & 8 /* EnumMember */) { return getTypeOfEnumMember(symbol); } - if (symbol.flags & ts.SymbolFlags.Accessor) { + if (symbol.flags & 98304 /* Accessor */) { return getTypeOfAccessors(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getTypeOfImport(symbol); } - if (symbol.flags & 8388608 /* Instantiated */) { - return getTypeOfInstantiatedSymbol(symbol); - } return unknownType; } function getTargetType(type) { @@ -9481,7 +10627,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 170 /* InterfaceDeclaration */ || node.kind === 169 /* ClassDeclaration */) { + if (node.kind === 188 /* InterfaceDeclaration */ || node.kind === 187 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -9512,7 +10658,7 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 169 /* ClassDeclaration */); + var declaration = getDeclarationOfKind(symbol, 187 /* ClassDeclaration */); if (declaration.baseType) { var baseType = getTypeFromTypeReferenceNode(declaration.baseType); if (baseType !== unknownType) { @@ -9552,7 +10698,7 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 170 /* InterfaceDeclaration */ && declaration.baseTypes) { + if (declaration.kind === 188 /* InterfaceDeclaration */ && declaration.baseTypes) { ts.forEach(declaration.baseTypes, function (node) { var baseType = getTypeFromTypeReferenceNode(node); if (baseType !== unknownType) { @@ -9579,6 +10725,23 @@ var ts; } return links.declaredType; } + function getDeclaredTypeOfTypeAlias(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = resolvingType; + var declaration = getDeclarationOfKind(symbol, 189 /* TypeAliasDeclaration */); + var type = getTypeFromTypeNode(declaration.type); + if (links.declaredType === resolvingType) { + links.declaredType = type; + } + } + else if (links.declaredType === resolvingType) { + links.declaredType = unknownType; + var declaration = getDeclarationOfKind(symbol, 189 /* TypeAliasDeclaration */); + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + return links.declaredType; + } function getDeclaredTypeOfEnum(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -9593,7 +10756,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!getDeclarationOfKind(symbol, 113 /* TypeParameter */).constraint) { + if (!getDeclarationOfKind(symbol, 122 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -9608,22 +10771,25 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - if (symbol.flags & 16 /* Class */) { + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0); + if (symbol.flags & 32 /* Class */) { return getDeclaredTypeOfClass(symbol); } - if (symbol.flags & 32 /* Interface */) { + if (symbol.flags & 64 /* Interface */) { return getDeclaredTypeOfInterface(symbol); } - if (symbol.flags & 64 /* Enum */) { + if (symbol.flags & 2097152 /* TypeAlias */) { + return getDeclaredTypeOfTypeAlias(symbol); + } + if (symbol.flags & 384 /* Enum */) { return getDeclaredTypeOfEnum(symbol); } - if (symbol.flags & 262144 /* TypeParameter */) { + if (symbol.flags & 1048576 /* TypeParameter */) { return getDeclaredTypeOfTypeParameter(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getDeclaredTypeOfImport(symbol); } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0); return unknownType; } function createSymbolTable(symbols) { @@ -9666,7 +10832,7 @@ var ts; if (type.baseTypes.length) { members = createSymbolTable(type.declaredProperties); ts.forEach(type.baseTypes, function (baseType) { - addInheritedMembers(members, getPropertiesOfType(baseType)); + addInheritedMembers(members, getPropertiesOfObjectType(baseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0 /* Call */)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1 /* Construct */)); stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0 /* String */); @@ -9685,7 +10851,7 @@ var ts; var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; ts.forEach(target.baseTypes, function (baseType) { var instantiatedBaseType = instantiateType(baseType, mapper); - addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); + addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0 /* String */); @@ -9720,91 +10886,266 @@ var ts; } return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; } - function resolveAnonymousTypeMembers(type) { - var symbol = type.symbol; - var members = emptySymbols; - var callSignatures = emptyArray; - var constructSignatures = emptyArray; - if (symbol.flags & ts.SymbolFlags.HasExports) { - members = symbol.exports; + function createTupleTypeMemberSymbols(memberTypes) { + var members = {}; + for (var i = 0; i < memberTypes.length; i++) { + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "" + i); + symbol.type = memberTypes[i]; + members[i] = symbol; } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */)) { - callSignatures = getSignaturesOfSymbol(symbol); + return members; + } + function resolveTupleTypeMembers(type) { + var arrayType = resolveObjectOrUnionTypeMembers(createArrayType(getUnionType(type.elementTypes))); + var members = createTupleTypeMemberSymbols(type.elementTypes); + addInheritedMembers(members, arrayType.properties); + setObjectTypeMembers(type, members, arrayType.callSignatures, arrayType.constructSignatures, arrayType.stringIndexType, arrayType.numberIndexType); + } + function signatureListsIdentical(s, t) { + if (s.length !== t.length) { + return false; } - if (symbol.flags & 16 /* Class */) { - var classType = getDeclaredTypeOfClass(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); - if (!constructSignatures.length) - constructSignatures = getDefaultConstructSignatures(classType); - if (classType.baseTypes.length) { - var members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + for (var i = 0; i < s.length; i++) { + if (!compareSignatures(s[i], t[i], false, compareTypes)) { + return false; } } - var numberIndexType = (symbol.flags & 64 /* Enum */) ? stringType : undefined; - setObjectTypeMembers(type, members, callSignatures, constructSignatures, undefined, numberIndexType); + return true; } - function resolveObjectTypeMembers(type) { + function getUnionSignatures(types, kind) { + var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); + var signatures = signatureLists[0]; + for (var i = 0; i < signatures.length; i++) { + if (signatures[i].typeParameters) { + return emptyArray; + } + } + for (var i = 1; i < signatureLists.length; i++) { + if (!signatureListsIdentical(signatures, signatureLists[i])) { + return emptyArray; + } + } + var result = ts.map(signatures, cloneSignature); + for (var i = 0; i < result.length; i++) { + var s = result[i]; + s.resolvedReturnType = undefined; + s.unionSignatures = ts.map(signatureLists, function (signatures) { return signatures[i]; }); + } + return result; + } + function getUnionIndexType(types, kind) { + var indexTypes = []; + for (var i = 0; i < types.length; i++) { + var indexType = getIndexTypeOfType(types[i], kind); + if (!indexType) { + return undefined; + } + indexTypes.push(indexType); + } + return getUnionType(indexTypes); + } + function resolveUnionTypeMembers(type) { + var callSignatures = getUnionSignatures(type.types, 0 /* Call */); + var constructSignatures = getUnionSignatures(type.types, 1 /* Construct */); + var stringIndexType = getUnionIndexType(type.types, 0 /* String */); + var numberIndexType = getUnionIndexType(type.types, 1 /* Number */); + setObjectTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function resolveAnonymousTypeMembers(type) { + var symbol = type.symbol; + if (symbol.flags & 2048 /* TypeLiteral */) { + var members = symbol.members; + var callSignatures = getSignaturesOfSymbol(members["__call"]); + var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + } + else { + var members = emptySymbols; + var callSignatures = emptyArray; + var constructSignatures = emptyArray; + if (symbol.flags & 1952 /* HasExports */) { + members = symbol.exports; + } + if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { + callSignatures = getSignaturesOfSymbol(symbol); + } + if (symbol.flags & 32 /* Class */) { + var classType = getDeclaredTypeOfClass(symbol); + constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + if (!constructSignatures.length) { + constructSignatures = getDefaultConstructSignatures(classType); + } + if (classType.baseTypes.length) { + members = createSymbolTable(getNamedMembers(members)); + addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + } + } + var stringIndexType = undefined; + var numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; + } + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function resolveObjectOrUnionTypeMembers(type) { if (!type.members) { if (type.flags & (1024 /* Class */ | 2048 /* Interface */)) { resolveClassOrInterfaceMembers(type); } - else if (type.flags & 8192 /* Anonymous */) { + else if (type.flags & 32768 /* Anonymous */) { resolveAnonymousTypeMembers(type); } + else if (type.flags & 8192 /* Tuple */) { + resolveTupleTypeMembers(type); + } + else if (type.flags & 16384 /* Union */) { + resolveUnionTypeMembers(type); + } else { resolveTypeReferenceMembers(type); } } return type; } - function getPropertiesOfType(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - return resolveObjectTypeMembers(type).properties; + function getPropertiesOfObjectType(type) { + if (type.flags & 48128 /* ObjectType */) { + return resolveObjectOrUnionTypeMembers(type).properties; } return emptyArray; } + function getPropertyOfObjectType(type, name) { + if (type.flags & 48128 /* ObjectType */) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + } + } + function getPropertiesOfUnionType(type) { + var result = []; + ts.forEach(getPropertiesOfType(type.types[0]), function (prop) { + var unionProp = getPropertyOfUnionType(type, prop.name); + if (unionProp) { + result.push(unionProp); + } + }); + return result; + } + function getPropertiesOfType(type) { + if (type.flags & 16384 /* Union */) { + return getPropertiesOfUnionType(type); + } + return getPropertiesOfObjectType(getApparentType(type)); + } + function getApparentType(type) { + if (type.flags & 512 /* TypeParameter */) { + do { + type = getConstraintOfTypeParameter(type); + } while (type && type.flags & 512 /* TypeParameter */); + if (!type) { + type = emptyObjectType; + } + } + if (type.flags & 258 /* StringLike */) { + type = globalStringType; + } + else if (type.flags & 132 /* NumberLike */) { + type = globalNumberType; + } + else if (type.flags & 8 /* Boolean */) { + type = globalBooleanType; + } + return type; + } + function createUnionProperty(unionType, name) { + var types = unionType.types; + var props; + for (var i = 0; i < types.length; i++) { + var type = getApparentType(types[i]); + if (type !== unknownType) { + var prop = getPropertyOfType(type, name); + if (!prop) { + return undefined; + } + if (!props) { + props = [prop]; + } + else { + props.push(prop); + } + } + } + var propTypes = []; + var declarations = []; + for (var i = 0; i < props.length; i++) { + var prop = props[i]; + if (prop.declarations) { + declarations.push.apply(declarations, prop.declarations); + } + propTypes.push(getTypeOfSymbol(prop)); + } + var result = createSymbol(4 /* Property */ | 268435456 /* Transient */ | 1073741824 /* UnionProperty */, name); + result.unionType = unionType; + result.declarations = declarations; + result.type = getUnionType(propTypes); + return result; + } + function getPropertyOfUnionType(type, name) { + var properties = type.resolvedProperties || (type.resolvedProperties = {}); + if (ts.hasProperty(properties, name)) { + return properties[name]; + } + var property = createUnionProperty(type, name); + if (property) { + properties[name] = property; + } + return property; + } function getPropertyOfType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } + if (type.flags & 16384 /* Union */) { + return getPropertyOfUnionType(type, name); + } + if (!(type.flags & 48128 /* ObjectType */)) { + type = getApparentType(type); + if (!(type.flags & 48128 /* ObjectType */)) { + return undefined; } } - } - function getPropertyOfApparentType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } + var resolved = resolveObjectOrUnionTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfType(globalFunctionType, name); - if (symbol) - return symbol; - } - return getPropertyOfType(globalObjectType, name); } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) + return symbol; + } + return getPropertyOfObjectType(globalObjectType, name); } - function getSignaturesOfType(type, kind) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); + function getSignaturesOfObjectOrUnionType(type, kind) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { + var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; } return emptyArray; } - function getIndexTypeOfType(type, kind) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); + function getSignaturesOfType(type, kind) { + return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); + } + function getIndexTypeOfObjectOrUnionType(type, kind) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { + var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; } } + function getIndexTypeOfType(type, kind) { + return getIndexTypeOfObjectOrUnionType(getApparentType(type), kind); + } function getTypeParametersFromDeclaration(typeParameterDeclarations) { var result = []; ts.forEach(typeParameterDeclarations, function (node) { @@ -9818,7 +11159,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 117 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 126 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; @@ -9826,7 +11167,7 @@ var ts; for (var i = 0, n = declaration.parameters.length; i < n; i++) { var param = declaration.parameters[i]; parameters.push(param.symbol); - if (param.type && param.type.kind === 3 /* StringLiteral */) { + if (param.type && param.type.kind === 7 /* StringLiteral */) { hasStringLiterals = true; } if (minArgumentCount < 0) { @@ -9846,8 +11187,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 118 /* GetAccessor */) { - var setter = getDeclarationOfKind(declaration.symbol, 119 /* SetAccessor */); + if (declaration.kind === 127 /* GetAccessor */) { + var setter = getDeclarationOfKind(declaration.symbol, 128 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && !declaration.body) { @@ -9865,16 +11206,18 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 167 /* FunctionDeclaration */: - case 116 /* Method */: - case 117 /* Constructor */: - case 120 /* CallSignature */: - case 121 /* ConstructSignature */: - case 122 /* IndexSignature */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -9892,6 +11235,9 @@ var ts; if (signature.target) { var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } + else if (signature.unionSignatures) { + var type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); + } else { var type = getReturnTypeFromBody(signature.declaration); } @@ -9901,6 +11247,15 @@ var ts; } else if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = anyType; + if (compilerOptions.noImplicitAny) { + var declaration = signature.declaration; + if (declaration.name) { + error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(declaration.name)); + } + else { + error(declaration, ts.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); + } + } } return signature.resolvedReturnType; } @@ -9931,8 +11286,8 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 117 /* Constructor */ || signature.declaration.kind === 121 /* ConstructSignature */; - var type = createObjectType(8192 /* Anonymous */ | 16384 /* FromSignature */); + var isConstructor = signature.declaration.kind === 126 /* Constructor */ || signature.declaration.kind === 130 /* ConstructSignature */; + var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; type.callSignatures = !isConstructor ? [signature] : emptyArray; @@ -9945,7 +11300,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 108 /* NumberKeyword */ : 110 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 116 /* NumberKeyword */ : 118 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -9972,7 +11327,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 113 /* TypeParameter */).constraint); + type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 122 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -10012,17 +11367,17 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 113 /* TypeParameter */; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 122 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 123 /* TypeReference */ && n.typeName.kind === 55 /* Identifier */) { + if (n.kind === 132 /* TypeReference */ && n.typeName.kind === 63 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { + var symbol = resolveName(typeParameter, n.typeName.text, 3152352 /* Type */, undefined, undefined); + if (symbol && (symbol.flags & 1048576 /* TypeParameter */)) { links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); } } @@ -10040,10 +11395,10 @@ var ts; function getTypeFromTypeReferenceNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); + var symbol = resolveEntityName(node, node.typeName, 3152352 /* Type */); if (symbol) { var type; - if ((symbol.flags & 262144 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + if ((symbol.flags & 1048576 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } else { @@ -10051,7 +11406,7 @@ var ts; if (type.flags & (1024 /* Class */ | 2048 /* Interface */) && type.flags & 4096 /* Reference */) { var typeParameters = type.typeParameters; if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, ts.map(node.typeArguments, function (t) { return getTypeFromTypeNode(t); })); + type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNode)); } else { error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length); @@ -10083,9 +11438,9 @@ var ts; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; switch (declaration.kind) { - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 171 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: return declaration; } } @@ -10094,7 +11449,7 @@ var ts; return emptyObjectType; } var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return emptyObjectType; } @@ -10105,7 +11460,7 @@ var ts; return type; } function getGlobalSymbol(name) { - return resolveName(undefined, name, ts.SymbolFlags.Type, ts.Diagnostics.Cannot_find_global_type_0, name); + return resolveName(undefined, name, 3152352 /* Type */, ts.Diagnostics.Cannot_find_global_type_0, name); } function getGlobalType(name) { return getTypeOfGlobalSymbol(getGlobalSymbol(name), 0); @@ -10121,16 +11476,114 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeLiteralNode(node) { + function createTupleType(elementTypes) { + var id = getTypeListId(elementTypes); + var type = tupleTypes[id]; + if (!type) { + type = tupleTypes[id] = createObjectType(8192 /* Tuple */); + type.elementTypes = elementTypes; + } + return type; + } + function getTypeFromTupleTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = node.symbol; - var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); - var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - links.resolvedType = createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); + } + return links.resolvedType; + } + function addTypeToSortedSet(sortedSet, type) { + if (type.flags & 16384 /* Union */) { + addTypesToSortedSet(sortedSet, type.types); + } + else { + var i = 0; + var id = type.id; + while (i < sortedSet.length && sortedSet[i].id < id) { + i++; + } + if (i === sortedSet.length || sortedSet[i].id !== id) { + sortedSet.splice(i, 0, type); + } + } + } + function addTypesToSortedSet(sortedTypes, types) { + for (var i = 0, len = types.length; i < len; i++) { + addTypeToSortedSet(sortedTypes, types[i]); + } + } + function isSubtypeOfAny(candidate, types) { + for (var i = 0, len = types.length; i < len; i++) { + if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + return true; + } + } + return false; + } + function removeSubtypes(types) { + var i = types.length; + while (i > 0) { + i--; + if (isSubtypeOfAny(types[i], types)) { + types.splice(i, 1); + } + } + } + function containsAnyType(types) { + for (var i = 0; i < types.length; i++) { + if (types[i].flags & 1 /* Any */) { + return true; + } + } + return false; + } + function removeAllButLast(types, typeToRemove) { + var i = types.length; + while (i > 0 && types.length > 1) { + i--; + if (types[i] === typeToRemove) { + types.splice(i, 1); + } + } + } + function getUnionType(types, noSubtypeReduction) { + if (types.length === 0) { + return emptyObjectType; + } + var sortedTypes = []; + addTypesToSortedSet(sortedTypes, types); + if (noSubtypeReduction) { + if (containsAnyType(sortedTypes)) { + return anyType; + } + removeAllButLast(sortedTypes, undefinedType); + removeAllButLast(sortedTypes, nullType); + } + else { + removeSubtypes(sortedTypes); + } + if (sortedTypes.length === 1) { + return sortedTypes[0]; + } + var id = getTypeListId(sortedTypes); + var type = unionTypes[id]; + if (!type) { + type = unionTypes[id] = createObjectType(16384 /* Union */); + type.types = sortedTypes; + } + return type; + } + function getTypeFromUnionTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); + } + return links.resolvedType; + } + function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = createObjectType(32768 /* Anonymous */, node.symbol); } return links.resolvedType; } @@ -10138,7 +11591,7 @@ var ts; if (ts.hasProperty(stringLiteralTypes, node.text)) return stringLiteralTypes[node.text]; var type = stringLiteralTypes[node.text] = createType(256 /* StringLiteral */); - type.text = ts.getSourceTextOfNode(node); + type.text = ts.getTextOfNode(node); return type; } function getTypeFromStringLiteral(node) { @@ -10150,30 +11603,38 @@ var ts; } function getTypeFromTypeNode(node) { switch (node.kind) { - case 101 /* AnyKeyword */: + case 109 /* AnyKeyword */: return anyType; - case 110 /* StringKeyword */: + case 118 /* StringKeyword */: return stringType; - case 108 /* NumberKeyword */: + case 116 /* NumberKeyword */: return numberType; - case 102 /* BooleanKeyword */: + case 110 /* BooleanKeyword */: return booleanType; - case 89 /* VoidKeyword */: + case 97 /* VoidKeyword */: return voidType; - case 3 /* StringLiteral */: + case 7 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 123 /* TypeReference */: + case 132 /* TypeReference */: return getTypeFromTypeReferenceNode(node); - case 124 /* TypeQuery */: + case 135 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 126 /* ArrayType */: + case 137 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 125 /* TypeLiteral */: - return getTypeFromTypeLiteralNode(node); - case 55 /* Identifier */: - case 112 /* QualifiedName */: + case 138 /* TupleType */: + return getTypeFromTupleTypeNode(node); + case 139 /* UnionType */: + return getTypeFromUnionTypeNode(node); + case 140 /* ParenType */: + return getTypeFromTypeNode(node.type); + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 136 /* TypeLiteral */: + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); + case 63 /* Identifier */: + case 121 /* QualifiedName */: var symbol = getSymbolInfo(node); - return getDeclaredTypeOfSymbol(symbol); + return symbol && getDeclaredTypeOfSymbol(symbol); default: return unknownType; } @@ -10196,10 +11657,8 @@ var ts; } function createTypeMapper(sources, targets) { switch (sources.length) { - case 1: - return createUnaryTypeMapper(sources[0], targets[0]); - case 2: - return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + case 1: return createUnaryTypeMapper(sources[0], targets[0]); + case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -10217,10 +11676,8 @@ var ts; } function createTypeEraser(sources) { switch (sources.length) { - case 1: - return createUnaryTypeEraser(sources[0]); - case 2: - return createBinaryTypeEraser(sources[0], sources[1]); + case 1: return createUnaryTypeEraser(sources[0]); + case 2: return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -10269,12 +11726,12 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(8388608 /* Instantiated */ | 33554432 /* Transient */, symbol.name); + var result = createSymbol(67108864 /* Instantiated */ | 268435456 /* Transient */ | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -10285,8 +11742,8 @@ var ts; return result; } function instantiateAnonymousType(type, mapper) { - var result = createObjectType(8192 /* Anonymous */, type.symbol); - result.properties = instantiateList(getPropertiesOfType(type), mapper, instantiateSymbol); + var result = createObjectType(32768 /* Anonymous */, type.symbol); + result.properties = instantiateList(getPropertiesOfObjectType(type), mapper, instantiateSymbol); result.members = createSymbolTable(result.properties); result.callSignatures = instantiateList(getSignaturesOfType(type, 0 /* Call */), mapper, instantiateSignature); result.constructSignatures = instantiateList(getSignaturesOfType(type, 1 /* Construct */), mapper, instantiateSignature); @@ -10303,36 +11760,42 @@ var ts; if (type.flags & 512 /* TypeParameter */) { return mapper(type); } - if (type.flags & 8192 /* Anonymous */) { - return type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */ | 512 /* TypeLiteral */ | 1024 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; + if (type.flags & 32768 /* Anonymous */) { + return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096 /* Reference */) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); } + if (type.flags & 8192 /* Tuple */) { + return createTupleType(instantiateList(type.elementTypes, mapper, instantiateType)); + } + if (type.flags & 16384 /* Union */) { + return getUnionType(instantiateList(type.types, mapper, instantiateType), true); + } } return type; } function isContextSensitiveExpression(node) { switch (node.kind) { - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 128 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 129 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 127 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 143 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 141 /* ArrayLiteral */: return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 141 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 140 /* BinaryExpression */: - return node.operator === 40 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); + case 156 /* BinaryExpression */: + return node.operator === 48 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); } return false; } function getTypeWithoutConstructors(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); + if (type.flags & 48128 /* ObjectType */) { + var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.constructSignatures.length) { - var result = createObjectType(8192 /* Anonymous */, type.symbol); + var result = createObjectType(32768 /* Anonymous */, type.symbol); result.members = resolved.members; result.properties = resolved.properties; result.callSignatures = resolved.callSignatures; @@ -10346,173 +11809,155 @@ var ts; var assignableRelation = {}; var identityRelation = {}; function isTypeIdenticalTo(source, target) { - return checkTypeRelatedTo(source, target, identityRelation, undefined, undefined, undefined); + return checkTypeRelatedTo(source, target, identityRelation, undefined); + } + function compareTypes(source, target) { + return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 /* True */ : 0 /* False */; } function isTypeSubtypeOf(source, target) { - return checkTypeSubtypeOf(source, target, undefined, undefined, undefined); - } - function checkTypeSubtypeOf(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); + return checkTypeSubtypeOf(source, target, undefined); } function isTypeAssignableTo(source, target) { - return checkTypeAssignableTo(source, target, undefined, undefined, undefined); + return checkTypeAssignableTo(source, target, undefined); } - function checkTypeAssignableTo(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); + function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); } - function isTypeRelatedTo(source, target, relation) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + function checkTypeAssignableTo(source, target, errorNode, headMessage) { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage); } function isSignatureAssignableTo(source, target) { var sourceType = getOrCreateTypeFromSignature(source); var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined, undefined, undefined); + return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined); } - function isPropertyIdenticalTo(sourceProp, targetProp) { - return isPropertyIdenticalToRecursive(sourceProp, targetProp, false, function (s, t, _reportErrors) { return isTypeIdenticalTo(s, t); }); - } - function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { - return true; - } - var seen = {}; - ts.forEach(type.declaredProperties, function (p) { - seen[p.name] = { prop: p, containingType: type }; - }); - var ok = true; - for (var i = 0, len = type.baseTypes.length; i < len; ++i) { - var base = type.baseTypes[i]; - var properties = getPropertiesOfType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; - if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type), typeName1, typeName2); - addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); - } - } - } - } - return ok; - } - function isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, relate) { - ts.Debug.assert(sourceProp); - if (!targetProp) { - return false; - } - var sourcePropIsPrivate = getDeclarationFlagsFromSymbol(sourceProp) & 32 /* Private */; - var targetPropIsPrivate = getDeclarationFlagsFromSymbol(targetProp) & 32 /* Private */; - if (sourcePropIsPrivate !== targetPropIsPrivate) { - return false; - } - if (sourcePropIsPrivate) { - return (getTargetSymbol(sourceProp).parent === getTargetSymbol(targetProp).parent) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - else { - return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - } - function checkTypeRelatedTo(source, target, relation, errorNode, chainedMessage, terminalMessage) { + function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { var errorInfo; var sourceStack; var targetStack; + var maybeStack; var expandingFlags; var depth = 0; var overflow = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); + var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { + if (containingMessageChain) { + errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + } addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine())); } - return result; - function reportError(message, arg0, arg1) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1); + return result !== 0 /* False */; + function reportError(message, arg0, arg1, arg2) { + errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source, target, reportErrors) { - return isRelatedToWithCustomErrors(source, target, reportErrors, undefined, undefined); - } - function isRelatedToWithCustomErrors(source, target, reportErrors, chainedMessage, terminalMessage) { + function isRelatedTo(source, target, reportErrors, headMessage) { + var result; if (relation === identityRelation) { if (source === target) - return true; + return -1 /* True */; } else { if (source === target) - return true; + return -1 /* True */; if (target.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === undefinedType) - return true; + return -1 /* True */; if (source === nullType && target !== undefinedType) - return true; + return -1 /* True */; if (source.flags & 128 /* Enum */ && target === numberType) - return true; + return -1 /* True */; if (source.flags & 256 /* StringLiteral */ && target === stringType) - return true; + return -1 /* True */; if (relation === assignableRelation) { if (source.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === numberType && target.flags & 128 /* Enum */) - return true; + return -1 /* True */; } } - if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - if (typeParameterRelatedTo(source, target, reportErrors)) { - return true; + if (source.flags & 16384 /* Union */) { + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; + } + } + else if (target.flags & 16384 /* Union */) { + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; + } + } + else if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - if (typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return true; + if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return result; } } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & ts.TypeFlags.ObjectType && target.flags & ts.TypeFlags.ObjectType && objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + if (sourceOrApparentType.flags & 48128 /* ObjectType */ && target.flags & 48128 /* ObjectType */ && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return true; + return result; } } if (reportErrors) { - chainedMessage = chainedMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; - terminalMessage = terminalMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; - var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; - ts.Debug.assert(diagnosticKey); - reportError(diagnosticKey, typeToString(source), typeToString(target)); + headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; + reportError(headMessage, typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; + } + function typeRelatedToUnionType(source, target, reportErrors) { + var targetTypes = target.types; + for (var i = 0, len = targetTypes.length; i < len; i++) { + var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + if (related) { + return related; + } + } + return 0 /* False */; + } + function unionTypeRelatedToType(source, target, reportErrors) { + var result = -1 /* True */; + var sourceTypes = source.types; + for (var i = 0, len = sourceTypes.length; i < len; i++) { + var related = isRelatedTo(sourceTypes[i], target, reportErrors); + if (!related) { + return 0 /* False */; + } + result &= related; + } + return result; } function typesRelatedTo(sources, targets, reportErrors) { + var result = -1 /* True */; for (var i = 0, len = sources.length; i < len; i++) { - if (!isRelatedTo(sources[i], targets[i], reportErrors)) - return false; + var related = isRelatedTo(sources[i], targets[i], reportErrors); + if (!related) { + return 0 /* False */; + } + result &= related; } - return true; + return result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { if (source.symbol.name !== target.symbol.name) { - return false; + return 0 /* False */; } if (source.constraint === target.constraint) { - return true; + return -1 /* True */; } if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return false; + return 0 /* False */; } return isRelatedTo(source.constraint, target.constraint, reportErrors); } @@ -10520,49 +11965,79 @@ var ts; while (true) { var constraint = getConstraintOfTypeParameter(source); if (constraint === target) - return true; + return -1 /* True */; if (!(constraint && constraint.flags & 512 /* TypeParameter */)) break; source = constraint; } - return false; + return 0 /* False */; } } function objectTypeRelatedTo(source, target, reportErrors) { - if (overflow) - return false; - var result; + if (overflow) { + return 0 /* False */; + } var id = source.id + "," + target.id; - if ((result = relation[id]) !== undefined) - return result; + var related = relation[id]; + if (related !== undefined) { + return related ? -1 /* True */ : 0 /* False */; + } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) - return true; + if (maybeStack[i][id]) { + return 1 /* Maybe */; + } } if (depth === 100) { overflow = true; - return false; + return 0 /* False */; } } else { sourceStack = []; targetStack = []; + maybeStack = []; expandingFlags = 0; } sourceStack[depth] = source; targetStack[depth] = target; + maybeStack[depth] = {}; + maybeStack[depth][id] = true; depth++; var saveExpandingFlags = expandingFlags; if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - result = expandingFlags === 3 || propertiesRelatedTo(source, target, reportErrors) && signaturesRelatedTo(source, target, 0 /* Call */, reportErrors) && signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors) && stringIndexTypesRelatedTo(source, target, reportErrors) && numberIndexTypesRelatedTo(source, target, reportErrors); + if (expandingFlags === 3) { + var result = 1 /* Maybe */; + } + else { + var result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); + } + } + } + } + } expandingFlags = saveExpandingFlags; depth--; - if (depth === 0) { - relation[id] = result; + if (result) { + var maybeCache = maybeStack[depth]; + var destinationCache = result === -1 /* True */ || depth === 0 ? relation : maybeStack[depth - 1]; + for (var p in maybeCache) { + destinationCache[p] = maybeCache[p]; + } + } + else { + relation[id] = false; } return result; } @@ -10583,164 +12058,133 @@ var ts; } function propertiesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return propertiesAreIdenticalTo(source, target, reportErrors); + return propertiesIdenticalTo(source, target); } - else { - return propertiesAreSubtypeOrAssignableTo(source, target, reportErrors); - } - } - function propertiesAreIdenticalTo(source, target, reportErrors) { - if (source === target) { - return true; - } - var sourceProperties = getPropertiesOfType(source); - var targetProperties = getPropertiesOfType(target); - if (sourceProperties.length !== targetProperties.length) { - return false; - } - for (var i = 0, len = sourceProperties.length; i < len; ++i) { - var sourceProp = sourceProperties[i]; - var targetProp = getPropertyOfType(target, sourceProp.name); - if (!isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { - return false; - } - } - return true; - } - function propertiesAreSubtypeOrAssignableTo(source, target, reportErrors) { - var properties = getPropertiesOfType(target); + var result = -1 /* True */; + var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; - var sourceProp = getPropertyOfApparentType(source, targetProp.name); - if (sourceProp === targetProp) { - continue; - } - var targetPropIsOptional = isOptionalProperty(targetProp); - if (!sourceProp) { - if (!targetPropIsOptional) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); + var sourceProp = getPropertyOfType(source, targetProp.name); + if (sourceProp !== targetProp) { + if (!sourceProp) { + if (relation === subtypeRelation || !isOptionalProperty(targetProp)) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); + } + return 0 /* False */; } - return false; } - } - else if (sourceProp !== targetProp) { - if (targetProp.flags & 67108864 /* Prototype */) { - continue; - } - if (getDeclarationFlagsFromSymbol(sourceProp) & 32 /* Private */ || getDeclarationFlagsFromSymbol(targetProp) & 32 /* Private */) { - if (reportErrors) { - reportError(ts.Diagnostics.Private_property_0_cannot_be_reimplemented, symbolToString(targetProp)); + else if (!(targetProp.flags & 536870912 /* Prototype */)) { + var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); + var targetFlags = getDeclarationFlagsFromSymbol(targetProp); + if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { + if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { + if (reportErrors) { + if (sourceFlags & 32 /* Private */ && targetFlags & 32 /* Private */) { + reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); + } + else { + reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); + } + } + return 0 /* False */; + } } - return false; - } - if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); + else if (targetFlags & 64 /* Protected */) { + var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; + var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; + var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); + if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); + } + return 0 /* False */; + } } - return false; - } - else if (isOptionalProperty(sourceProp) && !targetPropIsOptional) { - if (reportErrors) { - reportError(ts.Diagnostics.Required_property_0_cannot_be_reimplemented_with_optional_property_in_1, targetProp.name, typeToString(source)); + else if (sourceFlags & 64 /* Protected */) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); + } + return 0 /* False */; + } + var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + if (!related) { + if (reportErrors) { + reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); + } + return 0 /* False */; + } + result &= related; + if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); + } + return 0 /* False */; } - return false; } } } - return true; + return result; + } + function propertiesIdenticalTo(source, target) { + var sourceProperties = getPropertiesOfObjectType(source); + var targetProperties = getPropertiesOfObjectType(target); + if (sourceProperties.length !== targetProperties.length) { + return 0 /* False */; + } + var result = -1 /* True */; + for (var i = 0, len = sourceProperties.length; i < len; ++i) { + var sourceProp = sourceProperties[i]; + var targetProp = getPropertyOfObjectType(target, sourceProp.name); + if (!targetProp) { + return 0 /* False */; + } + var related = compareProperties(sourceProp, targetProp, isRelatedTo); + if (!related) { + return 0 /* False */; + } + result &= related; + } + return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { - return areSignaturesIdenticalTo(source, target, kind, reportErrors); + return signaturesIdenticalTo(source, target, kind); } - else { - return areSignaturesSubtypeOrAssignableTo(source, target, kind, reportErrors); + if (target === anyFunctionType || source === anyFunctionType) { + return -1 /* True */; } - } - function areSignaturesIdenticalTo(source, target, kind, reportErrors) { - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - if (sourceSignatures.length !== targetSignatures.length) { - return false; - } - for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - if (!isSignatureIdenticalTo(sourceSignatures[i], targetSignatures[i], reportErrors)) { - return false; - } - } - return true; - } - function isSignatureIdenticalTo(source, target, reportErrors) { - if (source === target) { - return true; - } - if (source.hasRestParameter !== target.hasRestParameter) { - return false; - } - if (source.parameters.length !== target.parameters.length) { - return false; - } - if (source.minArgumentCount !== target.minArgumentCount) { - return false; - } - if (source.typeParameters && target.typeParameters) { - if (source.typeParameters.length !== target.typeParameters.length) { - return false; - } - for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - if (!isRelatedTo(source.typeParameters[i], target.typeParameters[i], reportErrors)) { - return false; - } - } - } - else if (source.typeParameters || source.typeParameters) { - return false; - } - source = getErasedSignature(source); - target = getErasedSignature(target); - for (var i = 0, len = source.parameters.length; i < len; i++) { - var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); - var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - if (!isRelatedTo(s, t, reportErrors)) { - return false; - } - } - var t = getReturnTypeOfSignature(target); - var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); - } - function areSignaturesSubtypeOrAssignableTo(source, target, kind, reportErrors) { - if (target === anyFunctionType || source === anyFunctionType) - return true; var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + var result = -1 /* True */; var saveErrorInfo = errorInfo; outer: for (var i = 0; i < targetSignatures.length; i++) { var t = targetSignatures[i]; - if (!t.hasStringLiterals || target.flags & 16384 /* FromSignature */) { + if (!t.hasStringLiterals || target.flags & 65536 /* FromSignature */) { var localErrors = reportErrors; for (var j = 0; j < sourceSignatures.length; j++) { var s = sourceSignatures[j]; - if (!s.hasStringLiterals || source.flags & 16384 /* FromSignature */) { - if (isSignatureSubtypeOrAssignableTo(s, t, localErrors)) { + if (!s.hasStringLiterals || source.flags & 65536 /* FromSignature */) { + var related = signatureRelatedTo(s, t, localErrors); + if (related) { + result &= related; errorInfo = saveErrorInfo; continue outer; } localErrors = false; } } - return false; + return 0 /* False */; } } - return true; + return result; } - function isSignatureSubtypeOrAssignableTo(source, target, reportErrors) { + function signatureRelatedTo(source, target, reportErrors) { if (source === target) { - return true; + return -1 /* True */; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return 0 /* False */; } var sourceMax = source.parameters.length; var targetMax = target.parameters.length; @@ -10763,87 +12207,175 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1 /* True */; for (var i = 0; i < checkCount; i++) { var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - if (!isRelatedTo(s, t, reportErrors)) { - if (!isRelatedTo(t, s, false)) { + var related = isRelatedTo(s, t, reportErrors); + if (!related) { + related = isRelatedTo(t, s, false); + if (!related) { if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); + reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } - return false; + return 0 /* False */; } errorInfo = saveErrorInfo; } + result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return true; + return result; var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); + } + function signaturesIdenticalTo(source, target, kind) { + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + if (sourceSignatures.length !== targetSignatures.length) { + return 0 /* False */; + } + var result = -1 /* True */; + for (var i = 0, len = sourceSignatures.length; i < len; ++i) { + var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); + if (!related) { + return 0 /* False */; + } + result &= related; + } + return result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return areIndexTypesIdenticalTo(0 /* String */, source, target, reportErrors); + return indexTypesIdenticalTo(0 /* String */, source, target); } - else { - var targetType = getIndexTypeOfType(target, 0 /* String */); - if (targetType) { - var sourceType = getIndexTypeOfType(source, 0 /* String */); - if (!sourceType) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return false; - } - if (!isRelatedTo(sourceType, targetType, reportErrors)) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); - } - return false; + var targetType = getIndexTypeOfType(target, 0 /* String */); + if (targetType) { + var sourceType = getIndexTypeOfType(source, 0 /* String */); + if (!sourceType) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } + return 0 /* False */; } - return true; + var related = isRelatedTo(sourceType, targetType, reportErrors); + if (!related) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signatures_are_incompatible); + } + return 0 /* False */; + } + return related; } + return -1 /* True */; } function numberIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return areIndexTypesIdenticalTo(1 /* Number */, source, target, reportErrors); + return indexTypesIdenticalTo(1 /* Number */, source, target); } - else { - var targetType = getIndexTypeOfType(target, 1 /* Number */); - if (targetType) { - var sourceStringType = getIndexTypeOfType(source, 0 /* String */); - var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); - if (!(sourceStringType || sourceNumberType)) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return false; - } - if (sourceStringType && sourceNumberType) { - var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); - } - else { - var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); - } - if (!compatible) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); - } - return false; + var targetType = getIndexTypeOfType(target, 1 /* Number */); + if (targetType) { + var sourceStringType = getIndexTypeOfType(source, 0 /* String */); + var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); + if (!(sourceStringType || sourceNumberType)) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } + return 0 /* False */; } - return true; + if (sourceStringType && sourceNumberType) { + var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + } + else { + var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + } + if (!related) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signatures_are_incompatible); + } + return 0 /* False */; + } + return related; } + return -1 /* True */; } - function areIndexTypesIdenticalTo(indexKind, source, target, reportErrors) { + function indexTypesIdenticalTo(indexKind, source, target) { var targetType = getIndexTypeOfType(target, indexKind); var sourceType = getIndexTypeOfType(source, indexKind); - return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); + if (!sourceType && !targetType) { + return -1 /* True */; + } + if (sourceType && targetType) { + return isRelatedTo(sourceType, targetType); + } + return 0 /* False */; } } + function isPropertyIdenticalTo(sourceProp, targetProp) { + return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; + } + function compareProperties(sourceProp, targetProp, compareTypes) { + if (sourceProp === targetProp) { + return -1 /* True */; + } + var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); + var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); + if (sourcePropAccessibility !== targetPropAccessibility) { + return 0 /* False */; + } + if (sourcePropAccessibility) { + if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { + return 0 /* False */; + } + } + else { + if (isOptionalProperty(sourceProp) !== isOptionalProperty(targetProp)) { + return 0 /* False */; + } + } + return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + function compareSignatures(source, target, compareReturnTypes, compareTypes) { + if (source === target) { + return -1 /* True */; + } + if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { + return 0 /* False */; + } + var result = -1 /* True */; + if (source.typeParameters && target.typeParameters) { + if (source.typeParameters.length !== target.typeParameters.length) { + return 0 /* False */; + } + for (var i = 0, len = source.typeParameters.length; i < len; ++i) { + var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); + if (!related) { + return 0 /* False */; + } + result &= related; + } + } + else if (source.typeParameters || source.typeParameters) { + return 0 /* False */; + } + source = getErasedSignature(source); + target = getErasedSignature(target); + for (var i = 0, len = source.parameters.length; i < len; i++) { + var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); + var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); + var related = compareTypes(s, t); + if (!related) { + return 0 /* False */; + } + result &= related; + } + if (compareReturnTypes) { + result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + return result; + } function isSupertypeOfEach(candidate, types) { for (var i = 0, len = types.length; i < len; i++) { if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) @@ -10851,52 +12383,37 @@ var ts; } return true; } - function getBestCommonType(types, contextualType, candidatesOnly) { - if (contextualType && isSupertypeOfEach(contextualType, types)) - return contextualType; - return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }) || (candidatesOnly ? undefined : emptyObjectType); + function getCommonSupertype(types) { + return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); } - function isTypeOfObjectLiteral(type) { - return (type.flags & 8192 /* Anonymous */) && type.symbol && (type.symbol.flags & 1024 /* ObjectLiteral */) ? true : false; - } - function getWidenedTypeOfObjectLiteral(type) { - var properties = getPropertiesOfType(type); - if (properties.length) { - var widenedTypes = []; - var propTypeWasWidened = false; - ts.forEach(properties, function (p) { - var propType = getTypeOfSymbol(p); - var widenedType = getWidenedType(propType); - if (propType !== widenedType) { - propTypeWasWidened = true; - if (program.getCompilerOptions().noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType)); - } + function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { + var bestSupertype; + var bestSupertypeDownfallType; + var bestSupertypeScore = 0; + for (var i = 0; i < types.length; i++) { + var score = 0; + var downfallType = undefined; + for (var j = 0; j < types.length; j++) { + if (isTypeSubtypeOf(types[j], types[i])) { + score++; } - widenedTypes.push(widenedType); - }); - if (propTypeWasWidened) { - var members = {}; - var index = 0; - ts.forEach(properties, function (p) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, p.name); - symbol.declarations = p.declarations; - symbol.parent = p.parent; - symbol.type = widenedTypes[index++]; - if (p.valueDeclaration) - symbol.valueDeclaration = p.valueDeclaration; - members[symbol.name] = symbol; - }); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType) - stringIndexType = getWidenedType(stringIndexType); - if (numberIndexType) - numberIndexType = getWidenedType(numberIndexType); - type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); + else if (!downfallType) { + downfallType = types[j]; + } + } + if (score > bestSupertypeScore) { + bestSupertype = types[i]; + bestSupertypeDownfallType = downfallType; + bestSupertypeScore = score; + } + if (bestSupertypeScore === types.length - 1) { + break; } } - return type; + checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead); + } + function isTypeOfObjectLiteral(type) { + return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 4096 /* ObjectLiteral */) ? true : false; } function isArrayType(type) { return type.flags & 4096 /* Reference */ && type.target === globalArrayType; @@ -10907,16 +12424,13 @@ var ts; } return type; } - function getWidenedTypeOfArrayLiteral(type) { - var elementType = type.typeArguments[0]; - var widenedType = getWidenedType(elementType); - type = elementType !== widenedType ? createArrayType(widenedType) : type; - return type; - } - function getWidenedType(type) { + function getWidenedType(type, suppressNoImplicitAnyErrors) { if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { return anyType; } + if (type.flags & 16384 /* Union */) { + return getWidenedTypeOfUnion(type); + } if (isTypeOfObjectLiteral(type)) { return getWidenedTypeOfObjectLiteral(type); } @@ -10924,6 +12438,55 @@ var ts; return getWidenedTypeOfArrayLiteral(type); } return type; + function getWidenedTypeOfUnion(type) { + return getUnionType(ts.map(type.types, function (t) { return getWidenedType(t, suppressNoImplicitAnyErrors); })); + } + function getWidenedTypeOfObjectLiteral(type) { + var properties = getPropertiesOfObjectType(type); + if (properties.length) { + var widenedTypes = []; + var propTypeWasWidened = false; + ts.forEach(properties, function (p) { + var propType = getTypeOfSymbol(p); + var widenedType = getWidenedType(propType); + if (propType !== widenedType) { + propTypeWasWidened = true; + if (!suppressNoImplicitAnyErrors && compilerOptions.noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType)); + } + } + widenedTypes.push(widenedType); + }); + if (propTypeWasWidened) { + var members = {}; + var index = 0; + ts.forEach(properties, function (p) { + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */ | p.flags, p.name); + symbol.declarations = p.declarations; + symbol.parent = p.parent; + symbol.type = widenedTypes[index++]; + symbol.target = p; + if (p.valueDeclaration) + symbol.valueDeclaration = p.valueDeclaration; + members[symbol.name] = symbol; + }); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); + if (stringIndexType) + stringIndexType = getWidenedType(stringIndexType); + if (numberIndexType) + numberIndexType = getWidenedType(numberIndexType); + type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); + } + } + return type; + } + function getWidenedTypeOfArrayLiteral(type) { + var elementType = type.typeArguments[0]; + var widenedType = getWidenedType(elementType, suppressNoImplicitAnyErrors); + type = elementType !== widenedType ? createArrayType(widenedType) : type; + return type; + } } function forEachMatchingParameterType(source, target, callback) { var sourceMax = source.parameters.length; @@ -10951,12 +12514,15 @@ var ts; callback(s, t); } } - function createInferenceContext(typeParameters) { + function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var i = 0; i < typeParameters.length; i++) - inferences.push([]); + for (var i = 0; i < typeParameters.length; i++) { + inferences.push({ primary: undefined, secondary: undefined }); + } return { typeParameters: typeParameters, + inferUnionTypes: inferUnionTypes, + inferenceCount: 0, inferences: inferences, inferredTypes: new Array(typeParameters.length) }; @@ -10965,6 +12531,7 @@ var ts; var sourceStack; var targetStack; var depth = 0; + var inferiority = 0; inferFromTypes(source, target); function isInProcess(source, target) { for (var i = 0; i < depth; i++) { @@ -10992,8 +12559,9 @@ var ts; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; - if (!ts.contains(inferences, source)) - inferences.push(source); + var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []); + if (!ts.contains(candidates, source)) + candidates.push(source); break; } } @@ -11005,7 +12573,33 @@ var ts; inferFromTypes(sourceTypes[i], targetTypes[i]); } } - else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & 4096 /* Reference */ || (target.flags & 8192 /* Anonymous */) && target.symbol && target.symbol.flags & (2048 /* Method */ | 512 /* TypeLiteral */))) { + else if (target.flags & 16384 /* Union */) { + var targetTypes = target.types; + var typeParameterCount = 0; + var typeParameter; + for (var i = 0; i < targetTypes.length; i++) { + var t = targetTypes[i]; + if (t.flags & 512 /* TypeParameter */ && ts.contains(context.typeParameters, t)) { + typeParameter = t; + typeParameterCount++; + } + else { + inferFromTypes(source, t); + } + } + if (typeParameterCount === 1) { + inferiority++; + inferFromTypes(source, typeParameter); + inferiority--; + } + } + else if (source.flags & 16384 /* Union */) { + var sourceTypes = source.types; + for (var i = 0; i < sourceTypes.length; i++) { + inferFromTypes(sourceTypes[i], target); + } + } + else if (source.flags & 48128 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -11025,10 +12619,10 @@ var ts; } } function inferFromProperties(source, target) { - var properties = getPropertiesOfType(target); + var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; - var sourceProp = getPropertyOfType(source, targetProp.name); + var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); } @@ -11058,112 +12652,283 @@ var ts; } } } + function getInferenceCandidates(context, index) { + var inferences = context.inferences[index]; + return inferences.primary || inferences.secondary || emptyArray; + } function getInferredType(context, index) { - var result = context.inferredTypes[index]; - if (!result) { - var commonType = getWidenedType(getBestCommonType(context.inferences[index])); - var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - var result = constraint && !isTypeAssignableTo(commonType, constraint) ? constraint : commonType; - context.inferredTypes[index] = result; + var inferredType = context.inferredTypes[index]; + if (!inferredType) { + var inferences = getInferenceCandidates(context, index); + if (inferences.length) { + var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); + inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; + } + else { + inferredType = emptyObjectType; + } + if (inferredType !== inferenceFailureType) { + var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + } + context.inferredTypes[index] = inferredType; } - return result; + return inferredType; } function getInferredTypes(context) { for (var i = 0; i < context.inferredTypes.length; i++) { getInferredType(context, i); } - context.inferences = undefined; return context.inferredTypes; } function hasAncestor(node, kind) { - return getAncestor(node, kind) !== undefined; + return ts.getAncestor(node, kind) !== undefined; } - function getAncestor(node, kind) { - switch (kind) { - case 169 /* ClassDeclaration */: - while (node) { - switch (node.kind) { - case 169 /* ClassDeclaration */: - return node; - case 171 /* EnumDeclaration */: - case 170 /* InterfaceDeclaration */: - case 172 /* ModuleDeclaration */: - case 174 /* ImportDeclaration */: - return undefined; - default: - node = node.parent; - continue; - } - } - break; - default: - while (node) { - if (node.kind === kind) { - return node; - } - else { - node = node.parent; - } - } - break; + function getResolvedSymbol(node) { + var links = getNodeLinks(node); + if (!links.resolvedSymbol) { + links.resolvedSymbol = resolveName(node, node.text, 107455 /* Value */ | 4194304 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol; } - return undefined; + return links.resolvedSymbol; } - function checkIdentifier(node) { - function isInTypeQuery(node) { - while (node) { - switch (node.kind) { - case 124 /* TypeQuery */: - return true; - case 55 /* Identifier */: - case 112 /* QualifiedName */: - node = node.parent; - continue; - default: - return false; + function isInTypeQuery(node) { + while (node) { + switch (node.kind) { + case 135 /* TypeQuery */: + return true; + case 63 /* Identifier */: + case 121 /* QualifiedName */: + node = node.parent; + continue; + default: + return false; + } + } + ts.Debug.fail("should not get here"); + } + function subtractPrimitiveTypes(type, subtractMask) { + if (type.flags & 16384 /* Union */) { + var types = type.types; + if (ts.forEach(types, function (t) { return t.flags & subtractMask; })) { + return getUnionType(ts.filter(types, function (t) { return !(t.flags & subtractMask); })); + } + } + return type; + } + function isVariableAssignedWithin(symbol, node) { + var links = getNodeLinks(node); + if (links.assignmentChecks) { + var cachedResult = links.assignmentChecks[symbol.id]; + if (cachedResult !== undefined) { + return cachedResult; + } + } + else { + links.assignmentChecks = {}; + } + return links.assignmentChecks[symbol.id] = isAssignedIn(node); + function isAssignedInBinaryExpression(node) { + if (node.operator >= 51 /* FirstAssignment */ && node.operator <= 62 /* LastAssignment */) { + var n = node.left; + while (n.kind === 151 /* ParenExpression */) { + n = n.expression; + } + if (n.kind === 63 /* Identifier */ && getResolvedSymbol(n) === symbol) { + return true; } } - ts.Debug.fail("should not get here"); + return ts.forEachChild(node, isAssignedIn); } - var symbol = resolveName(node, node.text, ts.SymbolFlags.Value | 524288 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)); - if (!symbol) { - symbol = unknownSymbol; + function isAssignedInVariableDeclaration(node) { + if (getSymbolOfNode(node) === symbol && node.initializer) { + return true; + } + return ts.forEachChild(node, isAssignedIn); } - if (symbol.flags & 4194304 /* Import */) { - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + function isAssignedIn(node) { + switch (node.kind) { + case 156 /* BinaryExpression */: + return isAssignedInBinaryExpression(node); + case 184 /* VariableDeclaration */: + return isAssignedInVariableDeclaration(node); + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 157 /* ConditionalExpression */: + case 161 /* Block */: + case 162 /* VariableStatement */: + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + return ts.forEachChild(node, isAssignedIn); + } + return false; + } + } + function getNarrowedTypeOfSymbol(symbol, node) { + var type = getTypeOfSymbol(symbol); + if (node && (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */)) { + loop: while (true) { + var child = node; + node = node.parent; + var narrowedType = type; + switch (node.kind) { + case 165 /* IfStatement */: + if (child !== node.expression) { + narrowedType = narrowType(type, node.expression, child === node.thenStatement); + } + break; + case 157 /* ConditionalExpression */: + if (child !== node.condition) { + narrowedType = narrowType(type, node.condition, child === node.whenTrue); + } + break; + case 156 /* BinaryExpression */: + if (child === node.right) { + if (node.operator === 47 /* AmpersandAmpersandToken */) { + narrowedType = narrowType(type, node.left, true); + } + else if (node.operator === 48 /* BarBarToken */) { + narrowedType = narrowType(type, node.left, false); + } + } + break; + case 196 /* SourceFile */: + case 191 /* ModuleDeclaration */: + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + break loop; + } + if (narrowedType !== type && isTypeSubtypeOf(narrowedType, type)) { + if (isVariableAssignedWithin(symbol, node)) { + break; + } + type = narrowedType; + } + } + } + return type; + function narrowTypeByEquality(type, expr, assumeTrue) { + var left = expr.left; + var right = expr.right; + if (left.kind !== 154 /* PrefixOperator */ || left.operator !== 95 /* TypeOfKeyword */ || left.operand.kind !== 63 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { + return type; + } + var t = right.text; + var checkType = t === "string" ? stringType : t === "number" ? numberType : t === "boolean" ? booleanType : emptyObjectType; + if (expr.operator === 30 /* ExclamationEqualsEqualsToken */) { + assumeTrue = !assumeTrue; + } + if (assumeTrue) { + return checkType === emptyObjectType ? subtractPrimitiveTypes(type, 2 /* String */ | 4 /* Number */ | 8 /* Boolean */) : checkType; + } + else { + return checkType === emptyObjectType ? type : subtractPrimitiveTypes(type, checkType.flags); + } + } + function narrowTypeByAnd(type, expr, assumeTrue) { + if (assumeTrue) { + return narrowType(narrowType(type, expr.left, true), expr.right, true); + } + else { + return getUnionType([ + narrowType(type, expr.left, false), + narrowType(narrowType(type, expr.left, true), expr.right, false) + ]); + } + } + function narrowTypeByOr(type, expr, assumeTrue) { + if (assumeTrue) { + return getUnionType([ + narrowType(type, expr.left, true), + narrowType(narrowType(type, expr.left, false), expr.right, true) + ]); + } + else { + return narrowType(narrowType(type, expr.left, false), expr.right, false); + } + } + function narrowTypeByInstanceof(type, expr, assumeTrue) { + if (!assumeTrue || expr.left.kind !== 63 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { + return type; + } + var rightType = checkExpression(expr.right); + if (!isTypeSubtypeOf(rightType, globalFunctionType)) { + return type; + } + var prototypeProperty = getPropertyOfType(rightType, "prototype"); + if (!prototypeProperty) { + return type; + } + var prototypeType = getTypeOfSymbol(prototypeProperty); + return isTypeSubtypeOf(prototypeType, type) ? prototypeType : type; + } + function narrowType(type, expr, assumeTrue) { + switch (expr.kind) { + case 151 /* ParenExpression */: + return narrowType(type, expr.expression, assumeTrue); + case 156 /* BinaryExpression */: + var operator = expr.operator; + if (operator === 29 /* EqualsEqualsEqualsToken */ || operator === 30 /* ExclamationEqualsEqualsToken */) { + return narrowTypeByEquality(type, expr, assumeTrue); + } + else if (operator === 47 /* AmpersandAmpersandToken */) { + return narrowTypeByAnd(type, expr, assumeTrue); + } + else if (operator === 48 /* BarBarToken */) { + return narrowTypeByOr(type, expr, assumeTrue); + } + else if (operator === 85 /* InstanceOfKeyword */) { + return narrowTypeByInstanceof(type, expr, assumeTrue); + } + break; + case 154 /* PrefixOperator */: + if (expr.operator === 45 /* ExclamationToken */) { + return narrowType(type, expr.operand, !assumeTrue); + } + break; + } + return type; + } + } + function checkIdentifier(node) { + var symbol = getResolvedSymbol(node); + if (symbol.flags & 33554432 /* Import */) { + getSymbolLinks(symbol).referenced = getSymbolLinks(symbol).referenced || (!isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol))); } - getNodeLinks(node).resolvedSymbol = symbol; checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); checkCollisionWithIndexVariableInGeneratedCode(node, node); - return getTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol)); - } - function getThisContainer(node) { - while (true) { - node = node.parent; - if (!node) { - return node; - } - switch (node.kind) { - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 172 /* ModuleDeclaration */: - case 115 /* Property */: - case 116 /* Method */: - case 117 /* Constructor */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 171 /* EnumDeclaration */: - case 177 /* SourceFile */: - case 137 /* ArrowFunction */: - return node; - } - } + return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 169 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 187 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 115 /* Property */ || container.kind === 117 /* Constructor */) { + if (container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -11171,26 +12936,26 @@ var ts; } } function checkThisExpression(node) { - var container = getThisContainer(node); + var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - while (container.kind === 137 /* ArrowFunction */) { - container = getThisContainer(container); + if (container.kind === 153 /* ArrowFunction */) { + container = ts.getThisContainer(container, false); needToCaptureLexicalThis = true; } switch (container.kind) { - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 171 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 117 /* Constructor */: + case 126 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 115 /* Property */: - if (container.flags & 64 /* Static */) { + case 124 /* Property */: + if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; @@ -11198,10 +12963,10 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 169 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 187 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); - return container.flags & 64 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); + return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); } return anyType; } @@ -11211,29 +12976,29 @@ var ts; if (!node) return node; switch (node.kind) { - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: - case 115 /* Property */: - case 116 /* Method */: - case 117 /* Constructor */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node; } } } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 114 /* Parameter */) { + if (n.kind === 123 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 132 /* CallExpression */ && node.parent.func === node; - var enclosingClass = getAncestor(node, 169 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 147 /* CallExpression */ && node.parent.func === node; + var enclosingClass = ts.getAncestor(node, 187 /* ClassDeclaration */); var baseClass; if (enclosingClass && enclosingClass.baseType) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -11247,26 +13012,26 @@ var ts; if (container) { var canUseSuperExpression = false; if (isCallExpression) { - canUseSuperExpression = container.kind === 117 /* Constructor */; + canUseSuperExpression = container.kind === 126 /* Constructor */; } else { var needToCaptureLexicalThis = false; - while (container && container.kind === 137 /* ArrowFunction */) { + while (container && container.kind === 153 /* ArrowFunction */) { container = getSuperContainer(container); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 169 /* ClassDeclaration */) { - if (container.flags & 64 /* Static */) { - canUseSuperExpression = container.kind === 116 /* Method */ || container.kind === 118 /* GetAccessor */ || container.kind === 119 /* SetAccessor */; + if (container && container.parent && container.parent.kind === 187 /* ClassDeclaration */) { + if (container.flags & 128 /* Static */) { + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */; } else { - canUseSuperExpression = container.kind === 116 /* Method */ || container.kind === 118 /* GetAccessor */ || container.kind === 119 /* SetAccessor */ || container.kind === 115 /* Property */ || container.kind === 117 /* Constructor */; + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */ || container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */; } } } if (canUseSuperExpression) { var returnType; - if ((container.flags & 64 /* Static */) || isCallExpression) { + if ((container.flags & 128 /* Static */) || isCallExpression) { getNodeLinks(node).flags |= 32 /* SuperStatic */; returnType = getTypeOfSymbol(baseClass.symbol); } @@ -11274,7 +13039,7 @@ var ts; getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 117 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 126 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -11294,11 +13059,19 @@ var ts; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; - if (func.kind === 136 /* FunctionExpression */ || func.kind === 137 /* ArrowFunction */) { + if (func.kind === 152 /* FunctionExpression */ || func.kind === 153 /* ArrowFunction */) { if (isContextSensitiveExpression(func)) { - var signature = getContextualSignature(func); - if (signature) { - return getTypeAtPosition(signature, ts.indexOf(func.parameters, parameter)); + var contextualSignature = getContextualSignature(func); + if (contextualSignature) { + var funcHasRestParameters = ts.hasRestParameters(func); + var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); + var indexOfParameter = ts.indexOf(func.parameters, parameter); + if (indexOfParameter < len) { + return getTypeAtPosition(contextualSignature, indexOfParameter); + } + if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { + return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); + } } } } @@ -11310,16 +13083,16 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 114 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { return getContextuallyTypedParameterType(declaration); } } return undefined; } function getContextualTypeForReturnExpression(node) { - var func = getContainingFunction(node); + var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 117 /* Constructor */ || func.kind === 118 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 119 /* SetAccessor */))) { + if (func.type || func.kind === 126 /* Constructor */ || func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignature(func); @@ -11341,12 +13114,12 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operator; - if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + if (operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } } - else if (operator === 40 /* BarBarToken */) { + else if (operator === 48 /* BarBarToken */) { var type = getContextualType(binaryExpression); if (!type && node === binaryExpression.right) { type = checkExpression(binaryExpression.left); @@ -11355,92 +13128,160 @@ var ts; } return undefined; } + function applyToContextualType(type, mapper) { + if (!(type.flags & 16384 /* Union */)) { + return mapper(type); + } + var types = type.types; + var mappedType; + var mappedTypes; + for (var i = 0; i < types.length; i++) { + var t = mapper(types[i]); + if (t) { + if (!mappedType) { + mappedType = t; + } + else if (!mappedTypes) { + mappedTypes = [mappedType, t]; + } + else { + mappedTypes.push(t); + } + } + } + return mappedTypes ? getUnionType(mappedTypes) : mappedType; + } + function getTypeOfPropertyOfContextualType(type, name) { + return applyToContextualType(type, function (t) { + var prop = getPropertyOfObjectType(t, name); + return prop ? getTypeOfSymbol(prop) : undefined; + }); + } + function getIndexTypeOfContextualType(type, kind) { + return applyToContextualType(type, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }); + } + function contextualTypeIsTupleType(type) { + return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, function (t) { return getPropertyOfObjectType(t, "0"); }) : getPropertyOfObjectType(type, "0")); + } + function contextualTypeHasIndexSignature(type, kind) { + return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }) : getIndexTypeOfObjectOrUnionType(type, kind)); + } function getContextualTypeForPropertyExpression(node) { var declaration = node.parent; var objectLiteral = declaration.parent; var type = getContextualType(objectLiteral); var name = declaration.name.text; if (type && name) { - var prop = getPropertyOfType(type, name); - if (prop) { - return getTypeOfSymbol(prop); - } - return isNumericName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */); + return getTypeOfPropertyOfContextualType(type, name) || isNumericName(name) && getIndexTypeOfContextualType(type, 1 /* Number */) || getIndexTypeOfContextualType(type, 0 /* String */); } return undefined; } function getContextualTypeForElementExpression(node) { var arrayLiteral = node.parent; var type = getContextualType(arrayLiteral); - return type ? getIndexTypeOfType(type, 1 /* Number */) : undefined; + if (type) { + var index = ts.indexOf(arrayLiteral.elements, node); + return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1 /* Number */); + } + return undefined; } function getContextualTypeForConditionalOperand(node) { var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } function getContextualType(node) { + if (isInsideWithStatementBody(node)) { + return undefined; + } if (node.contextualType) { return node.contextualType; } var parent = node.parent; switch (parent.kind) { - case 166 /* VariableDeclaration */: - case 114 /* Parameter */: - case 115 /* Property */: + case 184 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: return getContextualTypeForInitializerExpression(node); - case 137 /* ArrowFunction */: - case 154 /* ReturnStatement */: + case 153 /* ArrowFunction */: + case 172 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 132 /* CallExpression */: - case 133 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return getContextualTypeForArgument(node); - case 134 /* TypeAssertion */: + case 150 /* TypeAssertion */: return getTypeFromTypeNode(parent.type); - case 140 /* BinaryExpression */: + case 156 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 129 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: return getContextualTypeForPropertyExpression(node); - case 127 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return getContextualTypeForElementExpression(node); - case 141 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); } return undefined; } + function getNonGenericSignature(type) { + var signatures = getSignaturesOfObjectOrUnionType(type, 0 /* Call */); + if (signatures.length === 1) { + var signature = signatures[0]; + if (!signature.typeParameters) { + return signature; + } + } + } function getContextualSignature(node) { var type = getContextualType(node); - if (type) { - var signatures = getSignaturesOfType(type, 0 /* Call */); - if (signatures.length === 1) { - var signature = signatures[0]; - if (!signature.typeParameters) { - return signature; + if (!type) { + return undefined; + } + if (!(type.flags & 16384 /* Union */)) { + return getNonGenericSignature(type); + } + var signatureList; + var types = type.types; + for (var i = 0; i < types.length; i++) { + if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0 /* Call */).length > 1) { + return undefined; + } + var signature = getNonGenericSignature(types[i]); + if (signature) { + if (!signatureList) { + signatureList = [signature]; + } + else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { + return undefined; + } + else { + signatureList.push(signature); } } } - return undefined; + var result; + if (signatureList) { + result = cloneSignature(signatureList[0]); + result.resolvedReturnType = undefined; + result.unionSignatures = signatureList; + } + return result; } function isInferentialContext(mapper) { return mapper && mapper !== identityMapper; } function checkArrayLiteral(node, contextualMapper) { - var elementTypes = []; - ts.forEach(node.elements, function (element) { - if (element.kind !== 142 /* OmittedExpression */) { - var type = checkExpression(element, contextualMapper); - if (!ts.contains(elementTypes, type)) - elementTypes.push(type); - } - }); - var contextualType = isInferentialContext(contextualMapper) ? undefined : getContextualType(node); - var contextualElementType = contextualType && getIndexTypeOfType(contextualType, 1 /* Number */); - var elementType = getBestCommonType(elementTypes, contextualElementType, true); - if (!elementType) - elementType = elementTypes.length ? emptyObjectType : undefinedType; - return createArrayType(elementType); + var elements = node.elements; + if (!elements.length) { + return createArrayType(undefinedType); + } + var elementTypes = ts.map(elements, function (e) { return checkExpression(e, contextualMapper); }); + var contextualType = getContextualType(node); + if (contextualType && contextualTypeIsTupleType(contextualType)) { + return createTupleType(elementTypes); + } + return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return !isNaN(name); + return (+name).toString() === name; } function checkObjectLiteral(node, contextualMapper) { var members = node.symbol.members; @@ -11449,22 +13290,31 @@ var ts; for (var id in members) { if (ts.hasProperty(members, id)) { var member = members[id]; - if (member.flags & 2 /* Property */) { - var type = checkExpression(member.declarations[0].initializer, contextualMapper); - var prop = createSymbol(2 /* Property */ | 33554432 /* Transient */, member.name); + if (member.flags & 4 /* Property */) { + var memberDecl = member.declarations[0]; + var type; + if (memberDecl.kind === 143 /* PropertyAssignment */) { + type = checkExpression(memberDecl.initializer, contextualMapper); + } + else { + ts.Debug.assert(memberDecl.kind === 144 /* ShorthandPropertyAssignment */); + type = checkExpression(memberDecl.name, contextualMapper); + } + var prop = createSymbol(4 /* Property */ | 268435456 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) prop.valueDeclaration = member.valueDeclaration; prop.type = type; + prop.target = member; member = prop; } else { - var getAccessor = getDeclarationOfKind(member, 118 /* GetAccessor */); + var getAccessor = getDeclarationOfKind(member, 127 /* GetAccessor */); if (getAccessor) { checkAccessorDeclaration(getAccessor); } - var setAccessor = getDeclarationOfKind(member, 119 /* SetAccessor */); + var setAccessor = getDeclarationOfKind(member, 128 /* SetAccessor */); if (setAccessor) { checkAccessorDeclaration(setAccessor); } @@ -11476,29 +13326,56 @@ var ts; var numberIndexType = getIndexType(1 /* Number */); return createAnonymousType(node.symbol, properties, emptyArray, emptyArray, stringIndexType, numberIndexType); function getIndexType(kind) { - if (contextualType) { - var indexType = getIndexTypeOfType(contextualType, kind); - if (indexType) { - var propTypes = []; - for (var id in properties) { - if (ts.hasProperty(properties, id)) { - if (kind === 0 /* String */ || isNumericName(id)) { - var type = getTypeOfSymbol(properties[id]); - if (!ts.contains(propTypes, type)) - propTypes.push(type); + if (contextualType && contextualTypeHasIndexSignature(contextualType, kind)) { + var propTypes = []; + for (var id in properties) { + if (ts.hasProperty(properties, id)) { + if (kind === 0 /* String */ || isNumericName(id)) { + var type = getTypeOfSymbol(properties[id]); + if (!ts.contains(propTypes, type)) { + propTypes.push(type); } } } - return getBestCommonType(propTypes, isInferentialContext(contextualMapper) ? undefined : indexType); } + return propTypes.length ? getUnionType(propTypes) : undefinedType; } + return undefined; } } function getDeclarationKindFromSymbol(s) { - return s.flags & 67108864 /* Prototype */ ? 115 /* Property */ : s.valueDeclaration.kind; + return s.valueDeclaration ? s.valueDeclaration.kind : 124 /* Property */; } function getDeclarationFlagsFromSymbol(s) { - return s.flags & 67108864 /* Prototype */ ? 16 /* Public */ | 64 /* Static */ : s.valueDeclaration.flags; + return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 536870912 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; + } + function checkClassPropertyAccess(node, type, prop) { + var flags = getDeclarationFlagsFromSymbol(prop); + if (!(flags & (32 /* Private */ | 64 /* Protected */))) { + return; + } + var enclosingClassDeclaration = ts.getAncestor(node, 187 /* ClassDeclaration */); + var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; + var declaringClass = getDeclaredTypeOfSymbol(prop.parent); + if (flags & 32 /* Private */) { + if (declaringClass !== enclosingClass) { + error(node, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); + } + return; + } + if (node.left.kind === 89 /* SuperKeyword */) { + return; + } + if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { + error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); + return; + } + if (flags & 128 /* Static */) { + return; + } + if (!(getTargetType(type).flags & (1024 /* Class */ | 2048 /* Interface */) && hasBaseType(type, enclosingClass))) { + error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); + } } function checkPropertyAccess(node) { var type = checkExpression(node.left); @@ -11509,57 +13386,71 @@ var ts; if (apparentType === unknownType) { return unknownType; } - var prop = getPropertyOfApparentType(apparentType, node.right.text); + var prop = getPropertyOfType(apparentType, node.right.text); if (!prop) { if (node.right.text) { - error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.identifierToString(node.right), typeToString(type)); + error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(node.right), typeToString(type)); } return unknownType; } getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 81 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 116 /* Method */) { - error(node.right, ts.Diagnostics.Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword); + if (prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { + error(node.right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } - else if (getDeclarationFlagsFromSymbol(prop) & 32 /* Private */) { - var classDeclaration = getAncestor(node, 169 /* ClassDeclaration */); - if (!classDeclaration || !ts.contains(prop.parent.declarations, classDeclaration)) { - error(node, ts.Diagnostics.Property_0_is_inaccessible, getFullyQualifiedName(prop)); - } + else { + checkClassPropertyAccess(node, type, prop); } } return getTypeOfSymbol(prop); } return anyType; } + function isValidPropertyAccess(node, propertyName) { + var type = checkExpression(node.left); + if (type !== unknownType && type !== anyType) { + var prop = getPropertyOfType(getWidenedType(type), propertyName); + if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { + return false; + } + else { + var diagnosticsCount = diagnostics.length; + checkClassPropertyAccess(node, type, prop); + return diagnostics.length === diagnosticsCount; + } + } + } + return true; + } function checkIndexedAccess(node) { - var objectType = checkExpression(node.object); + var objectType = getApparentType(checkExpression(node.object)); var indexType = checkExpression(node.index); if (objectType === unknownType) return unknownType; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) { - return unknownType; + if (isConstEnumObjectType(objectType) && node.index.kind !== 7 /* StringLiteral */) { + error(node.index, ts.Diagnostics.Index_expression_arguments_in_const_enums_must_be_of_type_string); } - if (node.index.kind === 3 /* StringLiteral */ || node.index.kind === 2 /* NumericLiteral */) { + if (node.index.kind === 7 /* StringLiteral */ || node.index.kind === 6 /* NumericLiteral */) { var name = node.index.text; - var prop = getPropertyOfApparentType(apparentType, name); + var prop = getPropertyOfType(objectType, name); if (prop) { + getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } } - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike)) { - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.NumberLike)) { - var numberIndexType = getIndexTypeOfType(apparentType, 1 /* Number */); + if (indexType.flags & (1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */)) { + if (indexType.flags & (1 /* Any */ | 132 /* NumberLike */)) { + var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); if (numberIndexType) { return numberIndexType; } } - var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); + var stringIndexType = getIndexTypeOfType(objectType, 0 /* String */); if (stringIndexType) { return stringIndexType; } - if (program.getCompilerOptions().noImplicitAny && objectType !== anyType) { + if (compilerOptions.noImplicitAny && objectType !== anyType) { error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); } return anyType; @@ -11568,28 +13459,296 @@ var ts; return unknownType; } function resolveUntypedCall(node) { - ts.forEach(node.arguments, function (argument) { - checkExpression(argument); - }); + if (node.kind === 149 /* TaggedTemplateExpression */) { + checkExpression(node.template); + } + else { + ts.forEach(node.arguments, function (argument) { + checkExpression(argument); + }); + } return anySignature; } function resolveErrorCall(node) { resolveUntypedCall(node); return unknownSignature; } - function isCandidateSignature(node, signature) { - var args = node.arguments || emptyArray; - return args.length >= signature.minArgumentCount && (signature.hasRestParameter || args.length <= signature.parameters.length) && (!node.typeArguments || signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); + function hasCorrectArity(node, args, signature) { + var adjustedArgCount; + var typeArguments; + var callIsIncomplete; + if (node.kind === 149 /* TaggedTemplateExpression */) { + var tagExpression = node; + adjustedArgCount = args.length; + typeArguments = undefined; + if (tagExpression.template.kind === 158 /* TemplateExpression */) { + var templateExpression = tagExpression.template; + var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + ts.Debug.assert(lastSpan !== undefined); + callIsIncomplete = lastSpan.literal.kind === 120 /* Missing */ || ts.isUnterminatedTemplateEnd(lastSpan.literal); + } + else { + var templateLiteral = tagExpression.template; + ts.Debug.assert(templateLiteral.kind === 9 /* NoSubstitutionTemplateLiteral */); + callIsIncomplete = ts.isUnterminatedTemplateEnd(templateLiteral); + } + } + else { + var callExpression = node; + if (!callExpression.arguments) { + ts.Debug.assert(callExpression.kind === 148 /* NewExpression */); + return signature.minArgumentCount === 0; + } + adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; + callIsIncomplete = callExpression.arguments.end === callExpression.end; + typeArguments = callExpression.typeArguments; + } + ts.Debug.assert(adjustedArgCount !== undefined, "'adjustedArgCount' undefined"); + ts.Debug.assert(callIsIncomplete !== undefined, "'callIsIncomplete' undefined"); + return checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature); + function checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature) { + if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) { + return false; + } + var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + if (!hasRightNumberOfTypeArgs) { + return false; + } + var hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount; + return callIsIncomplete || hasEnoughArguments; + } } - function collectCandidates(node, signatures) { - var result = []; - var lastParent; - var lastSymbol; - var cutoffPos = 0; - var pos; - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; - if (isCandidateSignature(node, signature)) { + function getSingleCallSignature(type) { + if (type.flags & 48128 /* ObjectType */) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { + return resolved.callSignatures[0]; + } + } + return undefined; + } + function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { + var context = createInferenceContext(signature.typeParameters, true); + forEachMatchingParameterType(contextualSignature, signature, function (source, target) { + inferTypes(context, instantiateType(source, contextualMapper), target); + }); + return getSignatureInstantiation(signature, getInferredTypes(context)); + } + function inferTypeArguments(signature, args, excludeArgument) { + var typeParameters = signature.typeParameters; + var context = createInferenceContext(typeParameters, false); + var mapper = createInferenceMapper(context); + for (var i = 0; i < args.length; i++) { + if (args[i].kind === 160 /* OmittedExpression */) { + continue; + } + if (!excludeArgument || excludeArgument[i] === undefined) { + var parameterType = getTypeAtPosition(signature, i); + if (i === 0 && args[i].parent.kind === 149 /* TaggedTemplateExpression */) { + inferTypes(context, globalTemplateStringsArrayType, parameterType); + continue; + } + inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); + } + } + if (excludeArgument) { + for (var i = 0; i < args.length; i++) { + if (args[i].kind === 160 /* OmittedExpression */) { + continue; + } + if (excludeArgument[i] === false) { + var parameterType = getTypeAtPosition(signature, i); + inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); + } + } + } + var inferredTypes = getInferredTypes(context); + context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); + for (var i = 0; i < inferredTypes.length; i++) { + if (inferredTypes[i] === inferenceFailureType) { + inferredTypes[i] = unknownType; + } + } + return context; + } + function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors) { + var typeParameters = signature.typeParameters; + var typeArgumentsAreAssignable = true; + for (var i = 0; i < typeParameters.length; i++) { + var typeArgNode = typeArguments[i]; + var typeArgument = getTypeFromTypeNode(typeArgNode); + typeArgumentResultTypes[i] = typeArgument; + if (typeArgumentsAreAssignable) { + var constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + } + } + return typeArgumentsAreAssignable; + } + function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + var argType; + if (arg.kind === 160 /* OmittedExpression */) { + continue; + } + var paramType = getTypeAtPosition(signature, i); + if (i === 0 && node.kind === 149 /* TaggedTemplateExpression */) { + argType = globalTemplateStringsArrayType; + } + else { + argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + } + var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); + if (!isValidArgument) { + return false; + } + } + return true; + } + function getEffectiveCallArguments(node) { + var args; + if (node.kind === 149 /* TaggedTemplateExpression */) { + var template = node.template; + args = [template]; + if (template.kind === 158 /* TemplateExpression */) { + ts.forEach(template.templateSpans, function (span) { + args.push(span.expression); + }); + } + } + else { + args = node.arguments || emptyArray; + } + return args; + } + function resolveCall(node, signatures, candidatesOutArray) { + var isTaggedTemplate = node.kind === 149 /* TaggedTemplateExpression */; + var typeArguments = isTaggedTemplate ? undefined : node.typeArguments; + ts.forEach(typeArguments, checkSourceElement); + var candidates = candidatesOutArray || []; + collectCandidates(); + if (!candidates.length) { + error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + return resolveErrorCall(node); + } + var args = getEffectiveCallArguments(node); + var excludeArgument; + for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { + if (isContextSensitiveExpression(args[i])) { + if (!excludeArgument) { + excludeArgument = new Array(args.length); + } + excludeArgument[i] = true; + } + } + var candidateForArgumentError; + var candidateForTypeArgumentError; + var resultOfFailedInference; + var result; + if (candidates.length > 1) { + result = chooseOverload(candidates, subtypeRelation); + } + if (!result) { + candidateForArgumentError = undefined; + candidateForTypeArgumentError = undefined; + resultOfFailedInference = undefined; + result = chooseOverload(candidates, assignableRelation); + } + if (result) { + return result; + } + if (candidateForArgumentError) { + checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true); + } + else if (candidateForTypeArgumentError) { + if (!isTaggedTemplate && node.typeArguments) { + checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], true); + } + else { + ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); + var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex]; + var inferenceCandidates = getInferenceCandidates(resultOfFailedInference, resultOfFailedInference.failedTypeParameterIndex); + var diagnosticChainHead = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, typeToString(failedTypeParameter)); + reportNoCommonSupertypeError(inferenceCandidates, node.func || node.tag, diagnosticChainHead); + } + } + else { + error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + } + if (!fullTypeCheck) { + for (var i = 0, n = candidates.length; i < n; i++) { + if (hasCorrectArity(node, args, candidates[i])) { + return candidates[i]; + } + } + } + return resolveErrorCall(node); + function chooseOverload(candidates, relation) { + for (var i = 0; i < candidates.length; i++) { + if (!hasCorrectArity(node, args, candidates[i])) { + continue; + } + var originalCandidate = candidates[i]; + var inferenceResult; + while (true) { + var candidate = originalCandidate; + if (candidate.typeParameters) { + var typeArgumentTypes; + var typeArgumentsAreValid; + if (typeArguments) { + typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); + } + else { + inferenceResult = inferTypeArguments(candidate, args, excludeArgument); + typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; + typeArgumentTypes = inferenceResult.inferredTypes; + } + if (!typeArgumentsAreValid) { + break; + } + candidate = getSignatureInstantiation(candidate, typeArgumentTypes); + } + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { + break; + } + var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; + if (index < 0) { + return candidate; + } + excludeArgument[index] = false; + } + if (originalCandidate.typeParameters) { + var instantiatedCandidate = candidate; + if (typeArgumentsAreValid) { + candidateForArgumentError = instantiatedCandidate; + } + else { + candidateForTypeArgumentError = originalCandidate; + if (!typeArguments) { + resultOfFailedInference = inferenceResult; + } + } + } + else { + ts.Debug.assert(originalCandidate === candidate); + candidateForArgumentError = originalCandidate; + } + } + return undefined; + } + function collectCandidates() { + var result = candidates; + var lastParent; + var lastSymbol; + var cutoffPos = 0; + var pos; + ts.Debug.assert(!result.length); + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); var parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { @@ -11612,145 +13771,23 @@ var ts; result[pos] = signature; } } - return result; } - function getSingleCallSignature(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { - return resolved.callSignatures[0]; - } - } - return undefined; - } - function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature.typeParameters); - forEachMatchingParameterType(contextualSignature, signature, function (source, target) { - inferTypes(context, instantiateType(source, contextualMapper), target); - }); - return getSignatureInstantiation(signature, getInferredTypes(context)); - } - function inferentiallyTypeExpession(expr, contextualType, contextualMapper) { - var type = checkExpressionWithContextualType(expr, contextualType, contextualMapper); - var signature = getSingleCallSignature(type); - if (signature && signature.typeParameters) { - var contextualSignature = getSingleCallSignature(contextualType); - if (contextualSignature && !contextualSignature.typeParameters) { - type = getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); - } - } - return type; - } - function inferTypeArguments(signature, args, excludeArgument) { - var typeParameters = signature.typeParameters; - var context = createInferenceContext(typeParameters); - var mapper = createInferenceMapper(context); - for (var i = 0; i < args.length; i++) { - if (!excludeArgument || excludeArgument[i] === undefined) { - var parameterType = getTypeAtPosition(signature, i); - inferTypes(context, inferentiallyTypeExpession(args[i], parameterType, mapper), parameterType); - } - } - if (excludeArgument) { - for (var i = 0; i < args.length; i++) { - if (excludeArgument[i] === false) { - var parameterType = getTypeAtPosition(signature, i); - inferTypes(context, inferentiallyTypeExpession(args[i], parameterType, mapper), parameterType); - } - } - } - return getInferredTypes(context); - } - function checkTypeArguments(signature, typeArguments) { - var typeParameters = signature.typeParameters; - var result = []; - for (var i = 0; i < typeParameters.length; i++) { - var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); - var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint && fullTypeCheck) { - checkTypeAssignableTo(typeArgument, constraint, typeArgNode, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } - result.push(typeArgument); - } - return result; - } - function checkApplicableSignature(node, signature, relation, excludeArgument, reportErrors) { - if (node.arguments) { - for (var i = 0; i < node.arguments.length; i++) { - var arg = node.arguments[i]; - var paramType = getTypeAtPosition(signature, i); - var argType = arg.kind === 3 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); - if (!isValidArgument) { - return false; - } - } - } - return true; - } - function resolveCall(node, signatures) { - ts.forEach(node.typeArguments, checkSourceElement); - var candidates = collectCandidates(node, signatures); - if (!candidates.length) { - error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); - return resolveErrorCall(node); - } - var args = node.arguments || emptyArray; - var excludeArgument; - for (var i = 0; i < args.length; i++) { - if (isContextSensitiveExpression(args[i])) { - if (!excludeArgument) - excludeArgument = new Array(args.length); - excludeArgument[i] = true; - } - } - var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; - while (true) { - for (var i = 0; i < candidates.length; i++) { - while (true) { - var candidate = candidates[i]; - if (candidate.typeParameters) { - var typeArguments = node.typeArguments ? checkTypeArguments(candidate, node.typeArguments) : inferTypeArguments(candidate, args, excludeArgument); - candidate = getSignatureInstantiation(candidate, typeArguments); - } - if (!checkApplicableSignature(node, candidate, relation, excludeArgument, false)) { - break; - } - var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; - if (index < 0) { - return candidate; - } - excludeArgument[index] = false; - } - } - if (relation === assignableRelation) { - break; - } - relation = assignableRelation; - } - checkApplicableSignature(node, candidate, relation, undefined, true); - return resolveErrorCall(node); - } - function resolveCallExpression(node) { - if (node.func.kind === 81 /* SuperKeyword */) { + function resolveCallExpression(node, candidatesOutArray) { + if (node.func.kind === 89 /* SuperKeyword */) { var superType = checkSuperExpression(node.func); if (superType !== unknownType) { - return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */)); + return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); } return resolveUntypedCall(node); } var funcType = checkExpression(node.func); - if (funcType === unknownType) { - return resolveErrorCall(node); - } var apparentType = getApparentType(funcType); if (apparentType === unknownType) { return resolveErrorCall(node); } var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); var constructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */); - if ((funcType === anyType) || (!callSignatures.length && !constructSignatures.length && isTypeAssignableTo(funcType, globalFunctionType))) { + if (funcType === anyType || (!callSignatures.length && !constructSignatures.length && !(funcType.flags & 16384 /* Union */) && isTypeAssignableTo(funcType, globalFunctionType))) { if (node.typeArguments) { error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); } @@ -11765,13 +13802,10 @@ var ts; } return resolveErrorCall(node); } - return resolveCall(node, callSignatures); + return resolveCall(node, callSignatures, candidatesOutArray); } - function resolveNewExpression(node) { + function resolveNewExpression(node, candidatesOutArray) { var expressionType = checkExpression(node.func); - if (expressionType === unknownType) { - return resolveErrorCall(node); - } if (expressionType === anyType) { if (node.typeArguments) { error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); @@ -11784,11 +13818,11 @@ var ts; } var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */); if (constructSignatures.length) { - return resolveCall(node, constructSignatures); + return resolveCall(node, constructSignatures, candidatesOutArray); } var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */); if (callSignatures.length) { - var signature = resolveCall(node, callSignatures); + var signature = resolveCall(node, callSignatures, candidatesOutArray); if (getReturnTypeOfSignature(signature) !== voidType) { error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); } @@ -11797,23 +13831,50 @@ var ts; error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); return resolveErrorCall(node); } - function getResolvedSignature(node) { + function resolveTaggedTemplateExpression(node, candidatesOutArray) { + var tagType = checkExpression(node.tag); + var apparentType = getApparentType(tagType); + if (apparentType === unknownType) { + return resolveErrorCall(node); + } + var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); + if (tagType === anyType || (!callSignatures.length && !(tagType.flags & 16384 /* Union */) && isTypeAssignableTo(tagType, globalFunctionType))) { + return resolveUntypedCall(node); + } + if (!callSignatures.length) { + error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + return resolveErrorCall(node); + } + return resolveCall(node, callSignatures, candidatesOutArray); + } + function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); - if (!links.resolvedSignature) { + if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 132 /* CallExpression */ ? resolveCallExpression(node) : resolveNewExpression(node); + if (node.kind === 147 /* CallExpression */) { + links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); + } + else if (node.kind === 148 /* NewExpression */) { + links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); + } + else if (node.kind === 149 /* TaggedTemplateExpression */) { + links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); + } + else { + ts.Debug.fail("Branch in 'getResolvedSignature' should be unreachable."); + } } return links.resolvedSignature; } function checkCallExpression(node) { var signature = getResolvedSignature(node); - if (node.func.kind === 81 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { return voidType; } - if (node.kind === 133 /* NewExpression */) { + if (node.kind === 148 /* NewExpression */) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== 117 /* Constructor */ && declaration.kind !== 121 /* ConstructSignature */)) { - if (program.getCompilerOptions().noImplicitAny) { + if (declaration && declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */ && declaration.kind !== 134 /* ConstructorType */) { + if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -11821,13 +13882,16 @@ var ts; } return getReturnTypeOfSignature(signature); } + function checkTaggedTemplateExpression(node) { + return getReturnTypeOfSignature(getResolvedSignature(node)); + } function checkTypeAssertion(node) { var exprType = checkExpression(node.operand); var targetType = getTypeFromTypeNode(node.type); if (fullTypeCheck && targetType !== unknownType) { - var widenedType = getWidenedType(exprType); - if (!(isTypeAssignableTo(exprType, targetType) || isTypeAssignableTo(targetType, widenedType))) { - checkTypeAssignableTo(targetType, widenedType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); + var widenedType = getWidenedType(exprType, true); + if (!(isTypeAssignableTo(targetType, widenedType))) { + checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } return targetType; @@ -11849,26 +13913,27 @@ var ts; } } function getReturnTypeFromBody(func, contextualMapper) { - if (func.body.kind !== 168 /* FunctionBlock */) { + var contextualSignature = getContextualSignature(func); + if (func.body.kind !== 186 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); - if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType)); } return widenedType; } var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); if (types.length > 0) { - var commonType = getBestCommonType(types, undefined, true); + var commonType = contextualSignature ? getUnionType(types) : getCommonSupertype(types); if (!commonType) { error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); return unknownType; } var widenedType = getWidenedType(commonType); - if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { var typeName = typeToString(widenedType); if (func.name) { - error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(func.name), typeName); + error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.declarationNameToString(func.name), typeName); } else { error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -11878,35 +13943,9 @@ var ts; } return voidType; } - function forEachReturnStatement(body, visitor) { - return traverse(body); - function traverse(node) { - switch (node.kind) { - case 154 /* ReturnStatement */: - return visitor(node); - case 143 /* Block */: - case 168 /* FunctionBlock */: - case 147 /* IfStatement */: - case 148 /* DoStatement */: - case 149 /* WhileStatement */: - case 150 /* ForStatement */: - case 151 /* ForInStatement */: - case 155 /* WithStatement */: - case 156 /* SwitchStatement */: - case 157 /* CaseClause */: - case 158 /* DefaultClause */: - case 159 /* LabelledStatement */: - case 161 /* TryStatement */: - case 162 /* TryBlock */: - case 163 /* CatchBlock */: - case 164 /* FinallyBlock */: - return ts.forEachChild(node, traverse); - } - } - } function checkAndAggregateReturnExpressionTypes(body, contextualMapper) { var aggregatedTypes = []; - forEachReturnStatement(body, function (returnStatement) { + ts.forEachReturnStatement(body, function (returnStatement) { var expr = returnStatement.expression; if (expr) { var type = checkAndMarkExpression(expr, contextualMapper); @@ -11918,12 +13957,12 @@ var ts; return aggregatedTypes; } function bodyContainsAReturnStatement(funcBody) { - return forEachReturnStatement(funcBody, function (returnStatement) { + return ts.forEachReturnStatement(funcBody, function (returnStatement) { return true; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 160 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 178 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!fullTypeCheck) { @@ -11932,7 +13971,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (!func.body || func.body.kind !== 168 /* FunctionBlock */) { + if (!func.body || func.body.kind !== 186 /* FunctionBlock */) { return; } var bodyBlock = func.body; @@ -11967,56 +14006,81 @@ var ts; } } } + checkSignatureDeclaration(node); } } - if (fullTypeCheck && !(links.flags & 1 /* TypeChecked */)) { - checkSignatureDeclaration(node); - if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); - } - if (node.body.kind === 168 /* FunctionBlock */) { - checkSourceElement(node.body); - } - else { - var exprType = checkExpression(node.body); - if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined, undefined); - } - } - links.flags |= 1 /* TypeChecked */; - } return type; } + function checkFunctionExpressionBody(node) { + if (node.type) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); + } + if (node.body.kind === 186 /* FunctionBlock */) { + checkSourceElement(node.body); + } + else { + var exprType = checkExpression(node.body); + if (node.type) { + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); + } + checkFunctionExpressionBodies(node.body); + } + } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!(type.flags & (1 /* Any */ | ts.TypeFlags.NumberLike))) { + if (!(type.flags & (1 /* Any */ | 132 /* NumberLike */))) { error(operand, diagnostic); return false; } return true; } - function checkReferenceExpression(n, message) { + function checkReferenceExpression(n, invalidReferenceMessage, constantVarianleMessage) { function findSymbol(n) { var symbol = getNodeLinks(n).resolvedSymbol; return symbol && getExportSymbolOfValueSymbolIfExported(symbol); } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 55 /* Identifier */: + case 63 /* Identifier */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 1 /* Variable */) !== 0; - case 130 /* PropertyAccess */: + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; + case 145 /* PropertyAccess */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~4 /* EnumMember */) !== 0; - case 131 /* IndexedAccess */: + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; + case 146 /* IndexedAccess */: return true; - case 135 /* ParenExpression */: + case 151 /* ParenExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; } } + function isConstVariableReference(n) { + switch (n.kind) { + case 63 /* Identifier */: + case 145 /* PropertyAccess */: + var symbol = findSymbol(n); + return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; + case 146 /* IndexedAccess */: + var index = n.index; + var symbol = findSymbol(n.object); + if (symbol && index.kind === 7 /* StringLiteral */) { + var name = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; + } + return false; + case 151 /* ParenExpression */: + return isConstVariableReference(n.expression); + default: + return false; + } + } if (!isReferenceOrErrorExpression(n)) { - error(n, message); + error(n, invalidReferenceMessage); + return false; + } + if (isConstVariableReference(n)) { + error(n, constantVarianleMessage); return false; } return true; @@ -12024,22 +14088,22 @@ var ts; function checkPrefixExpression(node) { var operandType = checkExpression(node.operand); switch (node.operator) { - case 24 /* PlusToken */: - case 25 /* MinusToken */: - case 38 /* TildeToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: return numberType; - case 37 /* ExclamationToken */: - case 64 /* DeleteKeyword */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: return booleanType; - case 87 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return stringType; - case 89 /* VoidKeyword */: + case 97 /* VoidKeyword */: return undefinedType; - case 29 /* PlusPlusToken */: - case 30 /* MinusMinusToken */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -12049,18 +14113,27 @@ var ts; var operandType = checkExpression(node.operand); var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } - function isTypeAnyTypeObjectTypeOrTypeParameter(type) { - return type === anyType || ((type.flags & (ts.TypeFlags.ObjectType | 512 /* TypeParameter */)) !== 0); + function isStructuredType(type) { + if (type.flags & 16384 /* Union */) { + return !ts.forEach(type.types, function (t) { return !isStructuredType(t); }); + } + return (type.flags & 65025 /* Structured */) !== 0; + } + function isConstEnumObjectType(type) { + return type.flags & (48128 /* ObjectType */ | 32768 /* Anonymous */) && type.symbol && isConstEnumSymbol(type.symbol); + } + function isConstEnumSymbol(symbol) { + return (symbol.flags & 128 /* ConstEnum */) !== 0; } function checkInstanceOfExpression(node, leftType, rightType) { - if (!isTypeAnyTypeObjectTypeOrTypeParameter(leftType)) { + if (leftType !== unknownType && !isStructuredType(leftType)) { error(node.left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { + if (rightType !== unknownType && rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { error(node.right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -12069,7 +14142,7 @@ var ts; if (leftType !== anyType && leftType !== stringType && leftType !== numberType) { error(node.left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number); } - if (!isTypeAnyTypeObjectTypeOrTypeParameter(rightType)) { + if (!isStructuredType(rightType)) { error(node.right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -12079,47 +14152,53 @@ var ts; var leftType = checkExpression(node.left, contextualMapper); var rightType = checkExpression(node.right, contextualMapper); switch (operator) { - case 26 /* AsteriskToken */: - case 46 /* AsteriskEqualsToken */: - case 27 /* SlashToken */: - case 47 /* SlashEqualsToken */: - case 28 /* PercentToken */: - case 48 /* PercentEqualsToken */: - case 25 /* MinusToken */: - case 45 /* MinusEqualsToken */: - case 31 /* LessThanLessThanToken */: - case 49 /* LessThanLessThanEqualsToken */: - case 32 /* GreaterThanGreaterThanToken */: - case 50 /* GreaterThanGreaterThanEqualsToken */: - case 33 /* GreaterThanGreaterThanGreaterThanToken */: - case 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 35 /* BarToken */: - case 53 /* BarEqualsToken */: - case 36 /* CaretToken */: - case 54 /* CaretEqualsToken */: - case 34 /* AmpersandToken */: - case 52 /* AmpersandEqualsToken */: + case 34 /* AsteriskToken */: + case 54 /* AsteriskEqualsToken */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 36 /* PercentToken */: + case 56 /* PercentEqualsToken */: + case 33 /* MinusToken */: + case 53 /* MinusEqualsToken */: + case 39 /* LessThanLessThanToken */: + case 57 /* LessThanLessThanEqualsToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; - var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - if (leftOk && rightOk) { - checkAssignmentOperator(numberType); + var suggestedOperator; + if ((leftType.flags & 8 /* Boolean */) && (rightType.flags & 8 /* Boolean */) && (suggestedOperator = getSuggestedBooleanOperator(node.operator)) !== undefined) { + error(node, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(node.operator), ts.tokenToString(suggestedOperator)); + } + else { + var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + if (leftOk && rightOk) { + checkAssignmentOperator(numberType); + } } return numberType; - case 24 /* PlusToken */: - case 44 /* PlusEqualsToken */: + case 32 /* PlusToken */: + case 52 /* PlusEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; var resultType; - if (leftType.flags & ts.TypeFlags.NumberLike && rightType.flags & ts.TypeFlags.NumberLike) { + if (leftType.flags & 132 /* NumberLike */ && rightType.flags & 132 /* NumberLike */) { resultType = numberType; } - else if (leftType.flags & ts.TypeFlags.StringLike || rightType.flags & ts.TypeFlags.StringLike) { + else if (leftType.flags & 258 /* StringLike */ || rightType.flags & 258 /* StringLike */) { resultType = stringType; } else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) { @@ -12129,41 +14208,56 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 44 /* PlusEqualsToken */) { + if (operator === 52 /* PlusEqualsToken */) { checkAssignmentOperator(resultType); } return resultType; - case 19 /* EqualsEqualsToken */: - case 20 /* ExclamationEqualsToken */: - case 21 /* EqualsEqualsEqualsToken */: - case 22 /* ExclamationEqualsEqualsToken */: - case 15 /* LessThanToken */: - case 16 /* GreaterThanToken */: - case 17 /* LessThanEqualsToken */: - case 18 /* GreaterThanEqualsToken */: - if (!isTypeSubtypeOf(leftType, rightType) && !isTypeSubtypeOf(rightType, leftType)) { + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } return booleanType; - case 77 /* InstanceOfKeyword */: + case 85 /* InstanceOfKeyword */: return checkInstanceOfExpression(node, leftType, rightType); - case 76 /* InKeyword */: + case 84 /* InKeyword */: return checkInExpression(node, leftType, rightType); - case 39 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return rightType; - case 40 /* BarBarToken */: - return getBestCommonType([leftType, rightType], isInferentialContext(contextualMapper) ? undefined : getContextualType(node)); - case 43 /* EqualsToken */: + case 48 /* BarBarToken */: + return getUnionType([leftType, rightType]); + case 51 /* EqualsToken */: checkAssignmentOperator(rightType); return rightType; - case 14 /* CommaToken */: + case 22 /* CommaToken */: return rightType; } + function getSuggestedBooleanOperator(operator) { + switch (operator) { + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + return 48 /* BarBarToken */; + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + return 30 /* ExclamationEqualsEqualsToken */; + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: + return 47 /* AmpersandAmpersandToken */; + default: + return undefined; + } + } function checkAssignmentOperator(valueType) { - if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { - var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); + if (fullTypeCheck && operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { + var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { - checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); + checkTypeAssignableTo(valueType, leftType, node.left, undefined); } } } @@ -12175,18 +14269,13 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, contextualMapper); var type2 = checkExpression(node.whenFalse, contextualMapper); - var contextualType = isInferentialContext(contextualMapper) ? undefined : getContextualType(node); - var resultType = getBestCommonType([type1, type2], contextualType, true); - if (!resultType) { - if (contextualType) { - error(node, ts.Diagnostics.No_best_common_type_exists_between_0_1_and_2, typeToString(contextualType), typeToString(type1), typeToString(type2)); - } - else { - error(node, ts.Diagnostics.No_best_common_type_exists_between_0_and_1, typeToString(type1), typeToString(type2)); - } - resultType = emptyObjectType; - } - return resultType; + return getUnionType([type1, type2]); + } + function checkTemplateExpression(node) { + ts.forEach(node.templateSpans, function (templateSpan) { + checkExpression(templateSpan.expression); + }); + return stringType; } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; @@ -12201,52 +14290,81 @@ var ts; return result; } function checkExpression(node, contextualMapper) { + var type = checkExpressionNode(node, contextualMapper); + if (contextualMapper && contextualMapper !== identityMapper) { + var signature = getSingleCallSignature(type); + if (signature && signature.typeParameters) { + var contextualType = getContextualType(node); + if (contextualType) { + var contextualSignature = getSingleCallSignature(contextualType); + if (contextualSignature && !contextualSignature.typeParameters) { + type = getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); + } + } + } + } + if (isConstEnumObjectType(type)) { + var ok = (node.parent.kind === 145 /* PropertyAccess */ && node.parent.left === node) || (node.parent.kind === 146 /* IndexedAccess */ && node.parent.object === node) || ((node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + if (!ok) { + error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + } + } + return type; + } + function checkExpressionNode(node, contextualMapper) { switch (node.kind) { - case 55 /* Identifier */: + case 63 /* Identifier */: return checkIdentifier(node); - case 83 /* ThisKeyword */: + case 91 /* ThisKeyword */: return checkThisExpression(node); - case 81 /* SuperKeyword */: + case 89 /* SuperKeyword */: return checkSuperExpression(node); - case 79 /* NullKeyword */: + case 87 /* NullKeyword */: return nullType; - case 85 /* TrueKeyword */: - case 70 /* FalseKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return booleanType; - case 2 /* NumericLiteral */: + case 6 /* NumericLiteral */: return numberType; - case 3 /* StringLiteral */: + case 158 /* TemplateExpression */: + return checkTemplateExpression(node); + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return stringType; - case 4 /* RegularExpressionLiteral */: + case 8 /* RegularExpressionLiteral */: return globalRegExpType; - case 112 /* QualifiedName */: + case 121 /* QualifiedName */: return checkPropertyAccess(node); - case 127 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return checkArrayLiteral(node, contextualMapper); - case 128 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return checkObjectLiteral(node, contextualMapper); - case 130 /* PropertyAccess */: + case 145 /* PropertyAccess */: return checkPropertyAccess(node); - case 131 /* IndexedAccess */: + case 146 /* IndexedAccess */: return checkIndexedAccess(node); - case 132 /* CallExpression */: - case 133 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return checkCallExpression(node); - case 134 /* TypeAssertion */: + case 149 /* TaggedTemplateExpression */: + return checkTaggedTemplateExpression(node); + case 150 /* TypeAssertion */: return checkTypeAssertion(node); - case 135 /* ParenExpression */: + case 151 /* ParenExpression */: return checkExpression(node.expression); - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return checkFunctionExpression(node, contextualMapper); - case 138 /* PrefixOperator */: + case 154 /* PrefixOperator */: return checkPrefixExpression(node); - case 139 /* PostfixOperator */: + case 155 /* PostfixOperator */: return checkPostfixExpression(node); - case 140 /* BinaryExpression */: + case 156 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 141 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); + case 160 /* OmittedExpression */: + return undefinedType; } return unknownType; } @@ -12261,7 +14379,7 @@ var ts; checkVariableDeclaration(parameterDeclaration); if (fullTypeCheck) { checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */) && !(parameterDeclaration.parent.kind === 117 /* Constructor */ && parameterDeclaration.parent.body)) { + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 126 /* Constructor */ && parameterDeclaration.parent.body)) { error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } if (parameterDeclaration.flags & 8 /* Rest */) { @@ -12276,12 +14394,12 @@ var ts; } } function checkReferencesInInitializer(n) { - if (n.kind === 55 /* Identifier */) { + if (n.kind === 63 /* Identifier */) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 114 /* Parameter */) { + if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { + if (referencedSymbol.valueDeclaration.kind === 123 /* Parameter */) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { - error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); + error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(parameterDeclaration.name)); return; } var enclosingOrReferencedParameter = ts.forEach(parameterDeclaration.parent.parameters, function (p) { return p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined; }); @@ -12289,7 +14407,7 @@ var ts; return; } } - error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.identifierToString(parameterDeclaration.name), ts.identifierToString(n)); + error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(parameterDeclaration.name), ts.declarationNameToString(n)); } } else { @@ -12309,13 +14427,14 @@ var ts; if (fullTypeCheck) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithArgumentsInGeneratedCode(node); - if (program.getCompilerOptions().noImplicitAny && !node.type) { + if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 121 /* ConstructSignature */: + case 130 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 120 /* CallSignature */: + case 129 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -12324,7 +14443,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 170 /* InterfaceDeclaration */) { + if (node.kind === 188 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -12338,7 +14457,7 @@ var ts; var declaration = indexSymbol.declarations[i]; if (declaration.parameters.length == 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 110 /* StringKeyword */: + case 118 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -12346,7 +14465,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 108 /* NumberKeyword */: + case 116 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -12380,39 +14499,37 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 132 /* CallExpression */ && n.func.kind === 81 /* SuperKeyword */; + return n.kind === 147 /* CallExpression */ && n.func.kind === 89 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 136 /* FunctionExpression */: - case 167 /* FunctionDeclaration */: - case 137 /* ArrowFunction */: - case 128 /* ObjectLiteral */: - return false; - default: - return ts.forEachChild(n, containsSuperCall); + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: + case 142 /* ObjectLiteral */: return false; + default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 83 /* ThisKeyword */) { + if (n.kind === 91 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 136 /* FunctionExpression */ && n.kind !== 167 /* FunctionDeclaration */) { + else if (n.kind !== 152 /* FunctionExpression */ && n.kind !== 185 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 115 /* Property */ && !(n.flags & 64 /* Static */) && !!n.initializer; + return n.kind === 124 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; } if (node.parent.baseType) { if (containsSuperCall(node.body)) { - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */); }); + var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 146 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 164 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -12427,16 +14544,15 @@ var ts; } function checkAccessorDeclaration(node) { if (fullTypeCheck) { - if (node.kind === 118 /* GetAccessor */) { + if (node.kind === 127 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } - var otherKind = node.kind === 118 /* GetAccessor */ ? 119 /* SetAccessor */ : 118 /* GetAccessor */; + var otherKind = node.kind === 127 /* GetAccessor */ ? 128 /* SetAccessor */ : 127 /* GetAccessor */; var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - var visibilityFlags = 32 /* Private */ | 16 /* Public */; - if (((node.flags & visibilityFlags) !== (otherAccessor.flags & visibilityFlags))) { + if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } var thisType = getAnnotatedAccessorType(node); @@ -12460,7 +14576,7 @@ var ts; var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]); if (fullTypeCheck && constraint) { var typeArgument = type.typeArguments[i]; - checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } } @@ -12471,13 +14587,19 @@ var ts; function checkTypeLiteral(node) { ts.forEach(node.members, checkSourceElement); if (fullTypeCheck) { - var type = getTypeFromTypeLiteralNode(node); + var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); checkIndexConstraints(type); checkTypeForDuplicateIndexSignatures(node); } } function checkArrayType(node) { - getTypeFromArrayTypeNode(node); + checkSourceElement(node.elementType); + } + function checkTupleType(node) { + ts.forEach(node.elementTypes, checkSourceElement); + } + function checkUnionType(node) { + ts.forEach(node.types, checkSourceElement); } function isPrivateWithinAmbient(node) { return (node.flags & 32 /* Private */) && ts.isInAmbientContext(node); @@ -12494,11 +14616,10 @@ var ts; error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); return; } - var symbol = getSymbolOfNode(signatureDeclarationNode); var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 170 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 120 /* CallSignature */ || signatureDeclarationNode.kind === 121 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 120 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 188 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 129 /* CallSignature */ || signatureDeclarationNode.kind === 130 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 129 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -12516,7 +14637,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = n.flags; - if (n.parent.kind !== 170 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 188 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { flags |= 1 /* Export */; } @@ -12541,8 +14662,8 @@ var ts; else if (deviation & 2 /* Ambient */) { error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); } - else if (deviation & 32 /* Private */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_or_private); + else if (deviation & (32 /* Private */ | 64 /* Protected */)) { + error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); } else if (deviation & 4 /* QuestionMark */) { error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required); @@ -12550,7 +14671,7 @@ var ts; }); } } - var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 4 /* QuestionMark */; + var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 64 /* Protected */ | 4 /* QuestionMark */; var someNodeFlags = 0; var allNodeFlags = flagsToCheck; var hasOverloads = false; @@ -12558,8 +14679,11 @@ var ts; var lastSeenNonAmbientDeclaration; var previousDeclaration; var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 4096 /* Constructor */) !== 0; + var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0; function reportImplementationExpectedError(node) { + if (node.name && node.name.kind === 120 /* Missing */) { + return; + } var seen = false; var subsequentNode = ts.forEachChild(node.parent, function (c) { if (seen) { @@ -12573,14 +14697,14 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 116 /* Method */); - ts.Debug.assert((node.flags & 64 /* Static */) !== (subsequentNode.flags & 64 /* Static */)); - var diagnostic = node.flags & 64 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; + ts.Debug.assert(node.kind === 125 /* Method */); + ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); + var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode, diagnostic); return; } else if (subsequentNode.body) { - error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.identifierToString(node.name)); + error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -12593,24 +14717,26 @@ var ts; error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); } } - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & ts.SymbolFlags.Module; + var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536 /* Module */; + var duplicateFunctionDeclaration = false; + var multipleConstructorImplementation = false; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 170 /* InterfaceDeclaration */ || node.parent.kind === 125 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 188 /* InterfaceDeclaration */ || node.parent.kind === 136 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 167 /* FunctionDeclaration */ || node.kind === 116 /* Method */ || node.kind === 117 /* Constructor */) { + if (node.kind === 185 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; if (node.body && bodyDeclaration) { if (isConstructor) { - error(node, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed); + multipleConstructorImplementation = true; } else { - error(node, ts.Diagnostics.Duplicate_function_implementation); + duplicateFunctionDeclaration = true; } } else if (!isExportSymbolInsideModule && previousDeclaration && previousDeclaration.parent === node.parent && previousDeclaration.end !== node.pos) { @@ -12630,6 +14756,16 @@ var ts; } } } + if (multipleConstructorImplementation) { + ts.forEach(declarations, function (declaration) { + error(declaration, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed); + }); + } + if (duplicateFunctionDeclaration) { + ts.forEach(declarations, function (declaration) { + error(declaration.name, ts.Diagnostics.Duplicate_function_implementation); + }); + } if (!isExportSymbolInsideModule && lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } @@ -12657,7 +14793,7 @@ var ts; var symbol = node.localSymbol; if (!symbol) { symbol = getSymbolOfNode(node); - if (!(symbol.flags & ts.SymbolFlags.Export)) { + if (!(symbol.flags & 29360128 /* Export */)) { return; } } @@ -12679,20 +14815,20 @@ var ts; if (commonDeclarationSpace) { ts.forEach(symbol.declarations, function (d) { if (getDeclarationSpaces(d) & commonDeclarationSpace) { - error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.identifierToString(d.name)); + error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(d.name)); } }); } function getDeclarationSpaces(d) { switch (d.kind) { - case 170 /* InterfaceDeclaration */: - return 1048576 /* ExportType */; - case 172 /* ModuleDeclaration */: - return d.name.kind === 3 /* StringLiteral */ || ts.isInstantiated(d) ? 2097152 /* ExportNamespace */ | 524288 /* ExportValue */ : 2097152 /* ExportNamespace */; - case 169 /* ClassDeclaration */: - case 171 /* EnumDeclaration */: - return 1048576 /* ExportType */ | 524288 /* ExportValue */; - case 174 /* ImportDeclaration */: + case 188 /* InterfaceDeclaration */: + return 8388608 /* ExportType */; + case 191 /* ModuleDeclaration */: + return d.name.kind === 7 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 16777216 /* ExportNamespace */ | 4194304 /* ExportValue */ : 16777216 /* ExportNamespace */; + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + return 8388608 /* ExportType */ | 4194304 /* ExportValue */; + case 193 /* ImportDeclaration */: var result = 0; var target = resolveImport(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { @@ -12700,7 +14836,7 @@ var ts; }); return result; default: - return 524288 /* ExportValue */; + return 4194304 /* ExportValue */; } } } @@ -12721,11 +14857,11 @@ var ts; if (node.type && !isAccessor(node.kind)) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && !node.body && !node.type) { + if (fullTypeCheck && compilerOptions.noImplicitAny && !node.body && !node.type) { if (!isPrivateWithinAmbient(node)) { var typeName = typeToString(anyType); if (node.name) { - error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(node.name), typeName); + error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.declarationNameToString(node.name), typeName); } else { error(node, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -12750,7 +14886,7 @@ var ts; if (!(name && name.text === "_i")) { return; } - if (node.kind === 114 /* Parameter */) { + if (node.kind === 123 /* Parameter */) { if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) { error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } @@ -12767,11 +14903,11 @@ var ts; return; } switch (current.kind) { - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 116 /* Method */: - case 137 /* ArrowFunction */: - case 117 /* Constructor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 125 /* Method */: + case 153 /* ArrowFunction */: + case 126 /* Constructor */: if (ts.hasRestParameters(current)) { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); return; @@ -12785,13 +14921,13 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 115 /* Property */ || node.kind === 116 /* Method */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */) { + if (node.kind === 124 /* Property */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */) { return false; } if (ts.isInAmbientContext(node)) { return false; } - if (node.kind === 114 /* Parameter */ && !node.parent.body) { + if (node.kind === 123 /* Parameter */ && !node.parent.body) { return false; } return true; @@ -12806,7 +14942,7 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration = node.kind !== 55 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } @@ -12822,12 +14958,12 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = getAncestor(node, 169 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 187 /* ClassDeclaration */); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } if (enclosingClass.baseType) { - var isDeclaration = node.kind !== 55 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } @@ -12836,6 +14972,31 @@ var ts; } } } + function checkCollisionWithRequireExportsInGeneratedCode(node, name) { + if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { + return; + } + if (node.kind === 191 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + return; + } + var parent = node.kind === 184 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (parent.kind === 196 /* SourceFile */ && ts.isExternalModule(parent)) { + error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); + } + } + function checkCollisionWithConstDeclarations(node) { + if (node.initializer && (node.flags & 6144 /* BlockScoped */) === 0) { + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1 /* FunctionScopedVariable */) { + var localDeclarationSymbol = resolveName(node, node.name.text, 3 /* Variable */, undefined, undefined); + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { + if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 4096 /* Const */) { + error(node, ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0, symbolToString(localDeclarationSymbol)); + } + } + } + } + } function checkVariableDeclaration(node) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); @@ -12848,18 +15009,20 @@ var ts; type = typeOfValueDeclaration; } else { - type = getTypeOfVariableDeclaration(node); + type = getTypeOfVariableOrPropertyDeclaration(node); } if (node.initializer) { if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); + checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined); } + checkCollisionWithConstDeclarations(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); if (!useTypeFromValueDeclaration) { if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); } } } @@ -12895,10 +15058,13 @@ var ts; checkSourceElement(node.statement); } function checkForInStatement(node) { - if (node.declaration) { - checkVariableDeclaration(node.declaration); - if (node.declaration.type) { - error(node.declaration, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + checkVariableDeclaration(decl); + if (decl.type) { + error(decl, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + } } } if (node.variable) { @@ -12907,41 +15073,33 @@ var ts; error(node.variable, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); } else { - checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement); + checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); } } var exprType = checkExpression(node.expression); - if (!isTypeAnyTypeObjectTypeOrTypeParameter(exprType) && exprType !== unknownType) { + if (!isStructuredType(exprType) && exprType !== unknownType) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); } function checkBreakOrContinueStatement(node) { } - function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || node.kind === 167 /* FunctionDeclaration */ || node.kind === 136 /* FunctionExpression */ || node.kind === 137 /* ArrowFunction */ || node.kind === 116 /* Method */ || node.kind === 117 /* Constructor */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */) { - return node; - } - } - } function checkReturnStatement(node) { if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { - var func = getContainingFunction(node); + var func = ts.getContainingFunction(node); if (func) { - if (func.kind === 119 /* SetAccessor */) { + if (func.kind === 128 /* SetAccessor */) { if (node.expression) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } } else { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - var checkAssignability = func.type || (func.kind === 118 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 119 /* SetAccessor */))); + var checkAssignability = func.type || (func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))); if (checkAssignability) { - checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined, undefined); + checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined); } - else if (func.kind == 117 /* Constructor */) { + else if (func.kind == 126 /* Constructor */) { if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -12960,13 +15118,13 @@ var ts; if (fullTypeCheck && clause.expression) { var caseType = checkExpression(clause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { - checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined, undefined); + checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined); } } checkBlock(clause); }); } - function checkLabelledStatement(node) { + function checkLabeledStatement(node) { checkSourceElement(node.statement); } function checkThrowStatement(node) { @@ -12995,7 +15153,7 @@ var ts; errorNode = indexDeclaration; } else if (type.flags & 2048 /* Interface */) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(type.baseTypes, function (base) { return getPropertyOfType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(type.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : type.symbol.declarations[0]; } if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { @@ -13008,7 +15166,7 @@ var ts; var stringIndexType = getIndexTypeOfType(type, 0 /* String */); var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); if (stringIndexType || numberIndexType) { - ts.forEach(getPropertiesOfType(type), function (prop) { + ts.forEach(getPropertiesOfObjectType(type), function (prop) { var propType = getTypeOfSymbol(prop); checkIndexConstraintForProperty(prop, propType, declaredStringIndexer, stringIndexType, 0 /* String */); checkIndexConstraintForProperty(prop, propType, declaredNumberIndexer, numberIndexType, 1 /* Number */); @@ -13044,7 +15202,7 @@ var ts; if (fullTypeCheck) { for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.identifierToString(node.name)); + error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); } } } @@ -13055,6 +15213,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); checkTypeParameters(node.typeParameters); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); var type = getDeclaredTypeOfSymbol(symbol); @@ -13066,10 +15225,10 @@ var ts; if (type.baseTypes.length) { if (fullTypeCheck) { var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); - checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { + checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, 107455 /* Value */)) { error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); @@ -13084,7 +15243,7 @@ var ts; if (t !== unknownType) { var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { - checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -13100,45 +15259,45 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; + return s.flags & 67108864 /* Instantiated */ ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { - var baseProperties = getPropertiesOfType(baseType); + var baseProperties = getPropertiesOfObjectType(baseType); for (var i = 0, len = baseProperties.length; i < len; ++i) { var base = getTargetSymbol(baseProperties[i]); - if (base.flags & 67108864 /* Prototype */) { + if (base.flags & 536870912 /* Prototype */) { continue; } - var derived = getTargetSymbol(getPropertyOfType(type, base.name)); + var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); if (derived) { var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); if ((baseDeclarationFlags & 32 /* Private */) || (derivedDeclarationFlags & 32 /* Private */)) { continue; } - if ((baseDeclarationFlags & 64 /* Static */) !== (derivedDeclarationFlags & 64 /* Static */)) { + if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { continue; } - if ((base.flags & derived.flags & 2048 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { + if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { continue; } var errorMessage; - if (base.flags & 2048 /* Method */) { - if (derived.flags & ts.SymbolFlags.Accessor) { + if (base.flags & 8192 /* Method */) { + if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert(derived.flags & 2 /* Property */); + ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } - else if (base.flags & 2 /* Property */) { - ts.Debug.assert(derived.flags & 2048 /* Method */); + else if (base.flags & 4 /* Property */) { + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); - ts.Debug.assert(derived.flags & 2048 /* Method */); + ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); @@ -13146,7 +15305,7 @@ var ts; } } function isAccessor(kind) { - return kind === 118 /* GetAccessor */ || kind === 119 /* SetAccessor */; + return kind === 127 /* GetAccessor */ || kind === 128 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -13173,13 +15332,46 @@ var ts; } return true; } + function checkInheritedPropertiesAreIdentical(type, typeNode) { + if (!type.baseTypes.length || type.baseTypes.length === 1) { + return true; + } + var seen = {}; + ts.forEach(type.declaredProperties, function (p) { + seen[p.name] = { prop: p, containingType: type }; + }); + var ok = true; + for (var i = 0, len = type.baseTypes.length; i < len; ++i) { + var base = type.baseTypes[i]; + var properties = getPropertiesOfObjectType(base); + for (var j = 0, proplen = properties.length; j < proplen; ++j) { + var prop = properties[j]; + if (!ts.hasProperty(seen, prop.name)) { + seen[prop.name] = { prop: prop, containingType: base }; + } + else { + var existing = seen[prop.name]; + var isInheritedProperty = existing.containingType !== type; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok = false; + var typeName1 = typeToString(existing.containingType); + var typeName2 = typeToString(base); + var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); + addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); + } + } + } + } + return ok; + } function checkInterfaceDeclaration(node) { checkTypeParameters(node.typeParameters); if (fullTypeCheck) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 170 /* InterfaceDeclaration */); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 188 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -13189,7 +15381,7 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); if (checkInheritedPropertiesAreIdentical(type, node.name)) { ts.forEach(type.baseTypes, function (baseType) { - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); } @@ -13201,20 +15393,144 @@ var ts; checkTypeForDuplicateIndexSignatures(node); } } - function getConstantValue(node) { - var isNegative = false; - if (node.kind === 138 /* PrefixOperator */) { - var unaryExpression = node; - if (unaryExpression.operator === 25 /* MinusToken */ || unaryExpression.operator === 24 /* PlusToken */) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === 25 /* MinusToken */; + function checkTypeAliasDeclaration(node) { + checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); + checkSourceElement(node.type); + } + function computeEnumMemberValues(node) { + var nodeLinks = getNodeLinks(node); + if (!(nodeLinks.flags & 128 /* EnumValuesComputed */)) { + var enumSymbol = getSymbolOfNode(node); + var enumType = getDeclaredTypeOfSymbol(enumSymbol); + var autoValue = 0; + var ambient = ts.isInAmbientContext(node); + var enumIsConst = ts.isConstEnumDeclaration(node); + ts.forEach(node.members, function (member) { + if (isNumericName(member.name.text)) { + error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + } + var initializer = member.initializer; + if (initializer) { + autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + if (autoValue === undefined) { + if (enumIsConst) { + error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + } + else if (!ambient) { + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); + } + } + else if (enumIsConst) { + if (isNaN(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN); + } + else if (!isFinite(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + } + } + } + else if (ambient && !enumIsConst) { + autoValue = undefined; + } + if (autoValue !== undefined) { + getNodeLinks(member).enumMemberValue = autoValue++; + } + }); + nodeLinks.flags |= 128 /* EnumValuesComputed */; + } + function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { + return evalConstant(initializer); + function evalConstant(e) { + switch (e.kind) { + case 154 /* PrefixOperator */: + var value = evalConstant(e.operand); + if (value === undefined) { + return undefined; + } + switch (e.operator) { + case 32 /* PlusToken */: return value; + case 33 /* MinusToken */: return -value; + case 46 /* TildeToken */: return enumIsConst ? ~value : undefined; + } + return undefined; + case 156 /* BinaryExpression */: + if (!enumIsConst) { + return undefined; + } + var left = evalConstant(e.left); + if (left === undefined) { + return undefined; + } + var right = evalConstant(e.right); + if (right === undefined) { + return undefined; + } + switch (e.operator) { + case 43 /* BarToken */: return left | right; + case 42 /* AmpersandToken */: return left & right; + case 40 /* GreaterThanGreaterThanToken */: return left >> right; + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; + case 39 /* LessThanLessThanToken */: return left << right; + case 44 /* CaretToken */: return left ^ right; + case 34 /* AsteriskToken */: return left * right; + case 35 /* SlashToken */: return left / right; + case 32 /* PlusToken */: return left + right; + case 33 /* MinusToken */: return left - right; + case 36 /* PercentToken */: return left % right; + } + return undefined; + case 6 /* NumericLiteral */: + return +e.text; + case 151 /* ParenExpression */: + return enumIsConst ? evalConstant(e.expression) : undefined; + case 63 /* Identifier */: + case 146 /* IndexedAccess */: + case 145 /* PropertyAccess */: + if (!enumIsConst) { + return undefined; + } + var member = initializer.parent; + var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); + var enumType; + var propertyName; + if (e.kind === 63 /* Identifier */) { + enumType = currentType; + propertyName = e.text; + } + else { + if (e.kind === 146 /* IndexedAccess */) { + if (e.index.kind !== 7 /* StringLiteral */) { + return undefined; + } + var enumType = getTypeOfNode(e.object); + propertyName = e.index.text; + } + else { + var enumType = getTypeOfNode(e.left); + propertyName = e.right.text; + } + if (enumType !== currentType) { + return undefined; + } + } + if (propertyName === undefined) { + return undefined; + } + var property = getPropertyOfObjectType(enumType, propertyName); + if (!property || !(property.flags & 8 /* EnumMember */)) { + return undefined; + } + var propertyDecl = property.valueDeclaration; + if (member === propertyDecl) { + return undefined; + } + if (!isDefinedBefore(propertyDecl, member)) { + return undefined; + } + return getNodeLinks(propertyDecl).enumMemberValue; + } } } - if (node.kind === 2 /* NumericLiteral */) { - var literalText = node.text; - return isNegative ? -literalText : +literalText; - } - return undefined; } function checkEnumDeclaration(node) { if (!fullTypeCheck) { @@ -13222,31 +15538,23 @@ var ts; } checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); + computeEnumMemberValues(node); var enumSymbol = getSymbolOfNode(node); - var enumType = getDeclaredTypeOfSymbol(enumSymbol); - var autoValue = 0; - var ambient = ts.isInAmbientContext(node); - ts.forEach(node.members, function (member) { - var initializer = member.initializer; - if (initializer) { - autoValue = getConstantValue(initializer); - if (autoValue === undefined && !ambient) { - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined, undefined); - } - } - else if (ambient) { - autoValue = undefined; - } - if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; - } - }); var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { + if (enumSymbol.declarations.length > 1) { + var enumIsConst = ts.isConstEnumDeclaration(node); + ts.forEach(enumSymbol.declarations, function (decl) { + if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { + error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 171 /* EnumDeclaration */) { + if (declaration.kind !== 190 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -13269,7 +15577,7 @@ var ts; var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === 169 /* ClassDeclaration */ || (declaration.kind === 167 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 187 /* ClassDeclaration */ || (declaration.kind === 185 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -13278,9 +15586,10 @@ var ts; function checkModuleDeclaration(node) { if (fullTypeCheck) { checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { + if (symbol.flags & 512 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -13291,7 +15600,7 @@ var ts; } } } - if (node.name.kind === 3 /* StringLiteral */) { + if (node.name.kind === 7 /* StringLiteral */) { if (!isGlobalSourceFile(node.parent)) { error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); } @@ -13303,37 +15612,38 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 112 /* QualifiedName */) { + while (node.kind === 121 /* QualifiedName */) { node = node.left; } return node; } function checkImportDeclaration(node) { checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); var symbol = getSymbolOfNode(node); var target; if (node.entityName) { target = resolveImport(symbol); if (target !== unknownSymbol) { - if (target.flags & ts.SymbolFlags.Value) { + if (target.flags & 107455 /* Value */) { var moduleName = getFirstIdentifier(node.entityName); - if (resolveEntityName(node, moduleName, ts.SymbolFlags.Value | ts.SymbolFlags.Namespace).flags & ts.SymbolFlags.Namespace) { + if (resolveEntityName(node, moduleName, 107455 /* Value */ | 1536 /* Namespace */).flags & 1536 /* Namespace */) { checkExpression(node.entityName); } else { - error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.identifierToString(moduleName)); + error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName)); } } - if (target.flags & ts.SymbolFlags.Type) { + if (target.flags & 3152352 /* Type */) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); } } } else { - if (node.parent.kind === 177 /* SourceFile */) { + if (node.parent.kind === 196 /* SourceFile */) { target = resolveImport(symbol); } - else if (node.parent.kind === 173 /* ModuleBlock */ && node.parent.parent.name.kind === 3 /* StringLiteral */) { + else if (node.parent.kind === 192 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { if (isExternalModuleNameRelative(node.externalModuleName.text)) { error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); target = unknownSymbol; @@ -13347,7 +15657,7 @@ var ts; } } if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & ts.SymbolFlags.Value ? ts.SymbolFlags.Value : 0) | (symbol.flags & ts.SymbolFlags.Type ? ts.SymbolFlags.Type : 0) | (symbol.flags & ts.SymbolFlags.Namespace ? ts.SymbolFlags.Namespace : 0); + var excludedMeanings = (symbol.flags & 107455 /* Value */ ? 107455 /* Value */ : 0) | (symbol.flags & 3152352 /* Type */ ? 3152352 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); } @@ -13355,7 +15665,7 @@ var ts; } function checkExportAssignment(node) { var container = node.parent; - if (container.kind !== 177 /* SourceFile */) { + if (container.kind !== 196 /* SourceFile */) { container = container.parent; } checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); @@ -13364,91 +15674,170 @@ var ts; if (!node) return; switch (node.kind) { - case 113 /* TypeParameter */: + case 122 /* TypeParameter */: return checkTypeParameter(node); - case 114 /* Parameter */: + case 123 /* Parameter */: return checkParameter(node); - case 115 /* Property */: + case 124 /* Property */: return checkPropertyDeclaration(node); - case 120 /* CallSignature */: - case 121 /* ConstructSignature */: - case 122 /* IndexSignature */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return checkSignatureDeclaration(node); - case 116 /* Method */: + case 125 /* Method */: return checkMethodDeclaration(node); - case 117 /* Constructor */: + case 126 /* Constructor */: return checkConstructorDeclaration(node); - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return checkAccessorDeclaration(node); - case 123 /* TypeReference */: + case 132 /* TypeReference */: return checkTypeReference(node); - case 124 /* TypeQuery */: + case 135 /* TypeQuery */: return checkTypeQuery(node); - case 125 /* TypeLiteral */: + case 136 /* TypeLiteral */: return checkTypeLiteral(node); - case 126 /* ArrayType */: + case 137 /* ArrayType */: return checkArrayType(node); - case 167 /* FunctionDeclaration */: + case 138 /* TupleType */: + return checkTupleType(node); + case 139 /* UnionType */: + return checkUnionType(node); + case 140 /* ParenType */: + return checkSourceElement(node.type); + case 185 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 143 /* Block */: - case 168 /* FunctionBlock */: - case 173 /* ModuleBlock */: + case 161 /* Block */: return checkBlock(node); - case 144 /* VariableStatement */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + return checkBody(node); + case 162 /* VariableStatement */: return checkVariableStatement(node); - case 146 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return checkExpressionStatement(node); - case 147 /* IfStatement */: + case 165 /* IfStatement */: return checkIfStatement(node); - case 148 /* DoStatement */: + case 166 /* DoStatement */: return checkDoStatement(node); - case 149 /* WhileStatement */: + case 167 /* WhileStatement */: return checkWhileStatement(node); - case 150 /* ForStatement */: + case 168 /* ForStatement */: return checkForStatement(node); - case 151 /* ForInStatement */: + case 169 /* ForInStatement */: return checkForInStatement(node); - case 152 /* ContinueStatement */: - case 153 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 154 /* ReturnStatement */: + case 172 /* ReturnStatement */: return checkReturnStatement(node); - case 155 /* WithStatement */: + case 173 /* WithStatement */: return checkWithStatement(node); - case 156 /* SwitchStatement */: + case 174 /* SwitchStatement */: return checkSwitchStatement(node); - case 159 /* LabelledStatement */: - return checkLabelledStatement(node); - case 160 /* ThrowStatement */: + case 177 /* LabeledStatement */: + return checkLabeledStatement(node); + case 178 /* ThrowStatement */: return checkThrowStatement(node); - case 161 /* TryStatement */: + case 179 /* TryStatement */: return checkTryStatement(node); - case 166 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return ts.Debug.fail("Checker encountered variable declaration"); - case 169 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return checkClassDeclaration(node); - case 170 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 171 /* EnumDeclaration */: + case 189 /* TypeAliasDeclaration */: + return checkTypeAliasDeclaration(node); + case 190 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 172 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 174 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return checkImportDeclaration(node); - case 175 /* ExportAssignment */: + case 194 /* ExportAssignment */: return checkExportAssignment(node); } } + function checkFunctionExpressionBodies(node) { + switch (node.kind) { + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + ts.forEach(node.parameters, checkFunctionExpressionBodies); + checkFunctionExpressionBody(node); + break; + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + ts.forEach(node.parameters, checkFunctionExpressionBodies); + break; + case 173 /* WithStatement */: + checkFunctionExpressionBodies(node.expression); + break; + case 123 /* Parameter */: + case 124 /* Property */: + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 143 /* PropertyAssignment */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 149 /* TaggedTemplateExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 156 /* BinaryExpression */: + case 157 /* ConditionalExpression */: + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 162 /* VariableStatement */: + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: + case 172 /* ReturnStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 184 /* VariableDeclaration */: + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + case 195 /* EnumMember */: + case 196 /* SourceFile */: + ts.forEachChild(node, checkFunctionExpressionBodies); + break; + } + } + function checkBody(node) { + checkBlock(node); + checkFunctionExpressionBodies(node); + } function checkSourceFile(node) { var links = getNodeLinks(node); if (!(links.flags & 1 /* TypeChecked */)) { emitExtends = false; potentialThisCollisions.length = 0; - ts.forEach(node.statements, checkSourceElement); + checkBody(node); if (ts.isExternalModule(node)) { var symbol = getExportAssignmentSymbol(node.symbol); - if (symbol && symbol.flags & 4194304 /* Import */) { + if (symbol && symbol.flags & 33554432 /* Import */) { getSymbolLinks(symbol).referenced = true; } } @@ -13499,6 +15888,17 @@ var ts; position = sourceFile.end; return findChildAtPosition(sourceFile); } + function isInsideWithStatementBody(node) { + if (node) { + while (node.parent) { + if (node.parent.kind === 173 /* WithStatement */ && node.parent.statement === node) { + return true; + } + node = node.parent; + } + } + return false; + } function getSymbolsInScope(location, meaning) { var symbols = {}; var memberFlags = 0; @@ -13519,32 +15919,35 @@ var ts; } } } + if (isInsideWithStatementBody(location)) { + return []; + } while (location) { if (location.locals && !isGlobalSourceFile(location)) { copySymbols(location.locals, meaning); } switch (location.kind) { - case 177 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 172 /* ModuleDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); + case 191 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 35653619 /* ModuleMember */); break; - case 171 /* EnumDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 4 /* EnumMember */); + case 190 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - if (!(memberFlags & 64 /* Static */)) { - copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + if (!(memberFlags & 128 /* Static */)) { + copySymbols(getSymbolOfNode(location).members, meaning & 3152352 /* Type */); } break; - case 136 /* FunctionExpression */: + case 152 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } break; - case 163 /* CatchBlock */: + case 181 /* CatchBlock */: if (location.variable.text) { copySymbol(location.symbol, meaning); } @@ -13557,199 +15960,102 @@ var ts; return ts.mapToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 55 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; - } - function isDeclarationOrFunctionExpressionOrCatchVariableName(name) { - if (name.kind !== 55 /* Identifier */ && name.kind !== 3 /* StringLiteral */ && name.kind !== 2 /* NumericLiteral */) { - return false; - } - var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 136 /* FunctionExpression */) { - return parent.name === name; - } - if (parent.kind === 163 /* CatchBlock */) { - return parent.variable === name; - } - return false; + return name.kind == 63 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 113 /* TypeParameter */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 171 /* EnumDeclaration */: + case 122 /* TypeParameter */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 190 /* EnumDeclaration */: return true; } } - function isDeclaration(node) { - switch (node.kind) { - case 113 /* TypeParameter */: - case 114 /* Parameter */: - case 166 /* VariableDeclaration */: - case 115 /* Property */: - case 129 /* PropertyAssignment */: - case 176 /* EnumMember */: - case 116 /* Method */: - case 167 /* FunctionDeclaration */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 171 /* EnumDeclaration */: - case 172 /* ModuleDeclaration */: - case 174 /* ImportDeclaration */: - return true; - } - return false; - } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 112 /* QualifiedName */) + while (node.parent && node.parent.kind === 121 /* QualifiedName */) node = node.parent; - return node.parent && node.parent.kind === 123 /* TypeReference */; - } - function isExpression(node) { - switch (node.kind) { - case 83 /* ThisKeyword */: - case 81 /* SuperKeyword */: - case 79 /* NullKeyword */: - case 85 /* TrueKeyword */: - case 70 /* FalseKeyword */: - case 4 /* RegularExpressionLiteral */: - case 127 /* ArrayLiteral */: - case 128 /* ObjectLiteral */: - case 130 /* PropertyAccess */: - case 131 /* IndexedAccess */: - case 132 /* CallExpression */: - case 133 /* NewExpression */: - case 134 /* TypeAssertion */: - case 135 /* ParenExpression */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: - case 138 /* PrefixOperator */: - case 139 /* PostfixOperator */: - case 140 /* BinaryExpression */: - case 141 /* ConditionalExpression */: - case 142 /* OmittedExpression */: - return true; - case 112 /* QualifiedName */: - while (node.parent.kind === 112 /* QualifiedName */) - node = node.parent; - return node.parent.kind === 124 /* TypeQuery */; - case 55 /* Identifier */: - if (node.parent.kind === 124 /* TypeQuery */) { - return true; - } - case 2 /* NumericLiteral */: - case 3 /* StringLiteral */: - var parent = node.parent; - switch (parent.kind) { - case 166 /* VariableDeclaration */: - case 114 /* Parameter */: - case 115 /* Property */: - case 176 /* EnumMember */: - case 129 /* PropertyAssignment */: - return parent.initializer === node; - case 146 /* ExpressionStatement */: - case 147 /* IfStatement */: - case 148 /* DoStatement */: - case 149 /* WhileStatement */: - case 154 /* ReturnStatement */: - case 155 /* WithStatement */: - case 156 /* SwitchStatement */: - case 157 /* CaseClause */: - case 160 /* ThrowStatement */: - case 156 /* SwitchStatement */: - return parent.expression === node; - case 150 /* ForStatement */: - return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 151 /* ForInStatement */: - return parent.variable === node || parent.expression === node; - case 134 /* TypeAssertion */: - return node === parent.operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; + return node.parent && node.parent.kind === 132 /* TypeReference */; } function isTypeNode(node) { - if (node.kind >= ts.SyntaxKind.FirstTypeNode && node.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 140 /* LastTypeNode */) { return true; } switch (node.kind) { - case 101 /* AnyKeyword */: - case 108 /* NumberKeyword */: - case 110 /* StringKeyword */: - case 102 /* BooleanKeyword */: + case 109 /* AnyKeyword */: + case 116 /* NumberKeyword */: + case 118 /* StringKeyword */: + case 110 /* BooleanKeyword */: return true; - case 89 /* VoidKeyword */: - return node.parent.kind !== 138 /* PrefixOperator */; - case 3 /* StringLiteral */: - return node.parent.kind === 114 /* Parameter */; - case 55 /* Identifier */: - if (node.parent.kind === 112 /* QualifiedName */) { + case 97 /* VoidKeyword */: + return node.parent.kind !== 154 /* PrefixOperator */; + case 7 /* StringLiteral */: + return node.parent.kind === 123 /* Parameter */; + case 63 /* Identifier */: + if (node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - case 112 /* QualifiedName */: + case 121 /* QualifiedName */: + ts.Debug.assert(node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); var parent = node.parent; - if (parent.kind === 124 /* TypeQuery */) { + if (parent.kind === 135 /* TypeQuery */) { return false; } - if (parent.kind >= ts.SyntaxKind.FirstTypeNode && parent.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 140 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 113 /* TypeParameter */: + case 122 /* TypeParameter */: return node === parent.constraint; - case 115 /* Property */: - case 114 /* Parameter */: - case 166 /* VariableDeclaration */: + case 124 /* Property */: + case 123 /* Parameter */: + case 184 /* VariableDeclaration */: return node === parent.type; - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 137 /* ArrowFunction */: - case 117 /* Constructor */: - case 116 /* Method */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 126 /* Constructor */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node === parent.type; - case 120 /* CallSignature */: - case 121 /* ConstructSignature */: - case 122 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return node === parent.type; - case 134 /* TypeAssertion */: + case 150 /* TypeAssertion */: return node === parent.type; - case 132 /* CallExpression */: - case 133 /* NewExpression */: - return parent.typeArguments.indexOf(node) >= 0; + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; + case 149 /* TaggedTemplateExpression */: + return false; } } return false; } function isInRightSideOfImportOrExportAssignment(node) { - while (node.parent.kind === 112 /* QualifiedName */) { + while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - if (node.parent.kind === 174 /* ImportDeclaration */) { + if (node.parent.kind === 193 /* ImportDeclaration */) { return node.parent.entityName === node; } - if (node.parent.kind === 175 /* ExportAssignment */) { + if (node.parent.kind === 194 /* ExportAssignment */) { return node.parent.exportName === node; } return false; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 112 /* QualifiedName */ || node.parent.kind === 130 /* PropertyAccess */) && node.parent.right === node; + return (node.parent.kind === 121 /* QualifiedName */ || node.parent.kind === 145 /* PropertyAccess */) && node.parent.right === node; } function getSymbolOfEntityName(entityName) { - if (isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { + if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 175 /* ExportAssignment */) { - return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 4194304 /* Import */); + if (entityName.parent.kind === 194 /* ExportAssignment */) { + return resolveEntityName(entityName.parent.parent, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */ | 33554432 /* Import */); } if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImport(entityName); @@ -13757,12 +16063,12 @@ var ts; if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (isExpression(entityName)) { - if (entityName.kind === 55 /* Identifier */) { - var meaning = ts.SymbolFlags.Value | 4194304 /* Import */; + if (ts.isExpression(entityName)) { + if (entityName.kind === 63 /* Identifier */) { + var meaning = 107455 /* Value */ | 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } - else if (entityName.kind === 112 /* QualifiedName */ || entityName.kind === 130 /* PropertyAccess */) { + else if (entityName.kind === 121 /* QualifiedName */ || entityName.kind === 145 /* PropertyAccess */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccess(entityName); @@ -13774,52 +16080,68 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 123 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; - meaning |= 4194304 /* Import */; + var meaning = entityName.parent.kind === 132 /* TypeReference */ ? 3152352 /* Type */ : 1536 /* Namespace */; + meaning |= 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } return undefined; } function getSymbolInfo(node) { + if (isInsideWithStatementBody(node)) { + return undefined; + } + if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + return getSymbolOfNode(node.parent); + } + if (node.kind === 63 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 194 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); + } switch (node.kind) { - case 55 /* Identifier */: - case 130 /* PropertyAccess */: - case 112 /* QualifiedName */: + case 63 /* Identifier */: + case 145 /* PropertyAccess */: + case 121 /* QualifiedName */: return getSymbolOfEntityName(node); - case 83 /* ThisKeyword */: - case 81 /* SuperKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: var type = checkExpression(node); return type.symbol; - case 103 /* ConstructorKeyword */: + case 111 /* ConstructorKeyword */: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 117 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 126 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; - case 3 /* StringLiteral */: - if (node.parent.kind === 131 /* IndexedAccess */ && node.parent.index === node) { + case 7 /* StringLiteral */: + if (node.parent.kind === 193 /* ImportDeclaration */ && node.parent.externalModuleName === node) { + var importSymbol = getSymbolOfNode(node.parent); + var moduleType = getTypeOfSymbol(importSymbol); + return moduleType ? moduleType.symbol : undefined; + } + case 6 /* NumericLiteral */: + if (node.parent.kind == 146 /* IndexedAccess */ && node.parent.index === node) { var objectType = checkExpression(node.parent.object); if (objectType === unknownType) return undefined; var apparentType = getApparentType(objectType); if (apparentType === unknownType) return undefined; - return getPropertyOfApparentType(apparentType, node.text); - } - else if (node.parent.kind === 174 /* ImportDeclaration */ && node.parent.externalModuleName === node) { - var importSymbol = getSymbolOfNode(node.parent); - var moduleType = getTypeOfSymbol(importSymbol); - return moduleType ? moduleType.symbol : undefined; - } - else if (node.parent.kind === 172 /* ModuleDeclaration */) { - return getSymbolOfNode(node.parent); + return getPropertyOfType(apparentType, node.text); } break; } return undefined; } + function getShorthandAssignmentValueSymbol(location) { + if (location && location.kind === 144 /* ShorthandPropertyAssignment */) { + return resolveEntityName(location, location.name, 107455 /* Value */); + } + return undefined; + } function getTypeOfNode(node) { - if (isExpression(node)) { + if (isInsideWithStatementBody(node)) { + return unknownType; + } + if (ts.isExpression(node)) { return getTypeOfExpression(node); } if (isTypeNode(node)) { @@ -13831,19 +16153,19 @@ var ts; } if (isTypeDeclarationName(node)) { var symbol = getSymbolInfo(node); - return getDeclaredTypeOfSymbol(symbol); + return symbol && getDeclaredTypeOfSymbol(symbol); } - if (isDeclaration(node)) { + if (ts.isDeclaration(node)) { var symbol = getSymbolOfNode(node); return getTypeOfSymbol(symbol); } - if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { var symbol = getSymbolInfo(node); - return getTypeOfSymbol(symbol); + return symbol && getTypeOfSymbol(symbol); } if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolInfo(node); - var declaredType = getDeclaredTypeOfSymbol(symbol); + var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); } return unknownType; @@ -13854,38 +16176,37 @@ var ts; } return checkExpression(expr); } - function getAugmentedPropertiesOfApparentType(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & ts.TypeFlags.ObjectType) { - var propertiesByName = {}; - var results = []; - ts.forEach(getPropertiesOfType(apparentType), function (s) { - propertiesByName[s.name] = s; - results.push(s); - }); - var resolved = resolveObjectTypeMembers(type); - ts.forEachValue(resolved.members, function (s) { - if (symbolIsValue(s) && !propertiesByName[s.name]) { - propertiesByName[s.name] = s; - results.push(s); + function getAugmentedPropertiesOfType(type) { + var type = getApparentType(type); + var propsByName = createSymbolTable(getPropertiesOfType(type)); + if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) { + ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { + if (!ts.hasProperty(propsByName, p.name)) { + propsByName[p.name] = p; } }); - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - ts.forEach(getPropertiesOfType(globalFunctionType), function (s) { - if (!propertiesByName[s.name]) { - propertiesByName[s.name] = s; - results.push(s); - } - }); + } + return getNamedMembers(propsByName); + } + function getRootSymbols(symbol) { + if (symbol.flags & 1073741824 /* UnionProperty */) { + var symbols = []; + var name = symbol.name; + ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { + symbols.push(getPropertyOfType(t, name)); + }); + return symbols; + } + else if (symbol.flags & 268435456 /* Transient */) { + var target = getSymbolLinks(symbol).target; + if (target) { + return [target]; } - return results; - } - else { - return getPropertiesOfType(apparentType); } + return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 128 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 177 /* SourceFile */; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 196 /* SourceFile */; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -13897,7 +16218,7 @@ var ts; } function isUniqueLocalName(name, container) { for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 524288 /* ExportValue */)) { + if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (107455 /* Value */ | 4194304 /* ExportValue */)) { return false; } } @@ -13911,14 +16232,14 @@ var ts; while (!isUniqueLocalName(ts.escapeIdentifier(prefix + name), container)) { prefix += "_"; } - links.localModuleName = prefix + ts.getSourceTextOfNode(container.name); + links.localModuleName = prefix + ts.getTextOfNode(container.name); } return links.localModuleName; } function getLocalNameForSymbol(symbol, location) { var node = location; while (node) { - if ((node.kind === 172 /* ModuleDeclaration */ || node.kind === 171 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { + if ((node.kind === 191 /* ModuleDeclaration */ || node.kind === 190 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { return getLocalNameOfContainer(node); } node = node.parent; @@ -13929,7 +16250,7 @@ var ts; var symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (symbol !== exportSymbol && !(exportSymbol.flags & ts.SymbolFlags.ExportHasLocal)) { + if (symbol !== exportSymbol && !(exportSymbol.flags & 944 /* ExportHasLocal */)) { symbol = exportSymbol; } if (symbol.parent) { @@ -13937,30 +16258,31 @@ var ts; } } } - function getPropertyAccessSubstitution(node) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 4 /* EnumMember */)) { - var declaration = symbol.valueDeclaration; - var constantValue; - if (declaration.kind === 176 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { - return constantValue.toString() + " /* " + ts.identifierToString(declaration.name) + " */"; - } - } - } function getExportAssignmentName(node) { var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; + return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol) : undefined; } - function isTopLevelValueImportedViaEntityName(node) { - if (node.parent.kind !== 177 /* SourceFile */ || !node.entityName) { + function isTopLevelValueImportWithEntityName(node) { + if (node.parent.kind !== 196 /* SourceFile */ || !node.entityName) { return false; } - var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & ts.SymbolFlags.Value) !== 0); + return isImportResolvedToValue(getSymbolOfNode(node)); } - function shouldEmitDeclarations() { - return program.getCompilerOptions().declaration && !program.getDiagnostics().length && !getDiagnostics().length; + function hasSemanticErrors() { + return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; + } + function isEmitBlocked(sourceFile) { + return program.getDiagnostics(sourceFile).length !== 0 || hasEarlyErrors(sourceFile) || (compilerOptions.noEmitOnError && getDiagnostics(sourceFile).length !== 0); + } + function hasEarlyErrors(sourceFile) { + return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; }); + } + function isImportResolvedToValue(symbol) { + var target = resolveImport(symbol); + return target !== unknownSymbol && target.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); + } + function isConstEnumOrConstEnumOnlyModule(s) { + return isConstEnumSymbol(s) || s.constEnumOnlyModule; } function isReferencedImportDeclaration(node) { var symbol = getSymbolOfNode(node); @@ -13968,10 +16290,7 @@ var ts; return true; } if (node.flags & 1 /* Export */) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { - return true; - } + return isImportResolvedToValue(symbol); } return false; } @@ -13987,44 +16306,56 @@ var ts; return getNodeLinks(node).flags; } function getEnumMemberValue(node) { + computeEnumMemberValues(node.parent); return getNodeLinks(node).enumMemberValue; } + function getConstantValue(node) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol && (symbol.flags & 8 /* EnumMember */)) { + var declaration = symbol.valueDeclaration; + var constantValue; + if (declaration.kind === 195 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + return constantValue; + } + } + return undefined; + } function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 512 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); - writeTypeToTextWriter(type, enclosingDeclaration, flags, writer); + var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* CallSignature */ | 262144 /* ConstructSignature */)) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { var signature = getSignatureFromDeclaration(signatureDeclaration); - writeTypeToTextWriter(getReturnTypeOfSignature(signature), enclosingDeclaration, flags, writer); + getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } - function invokeEmitter() { + function invokeEmitter(targetSourceFile) { var resolver = { getProgram: function () { return program; }, getLocalNameOfContainer: getLocalNameOfContainer, getExpressionNamePrefix: getExpressionNamePrefix, - getPropertyAccessSubstitution: getPropertyAccessSubstitution, getExportAssignmentName: getExportAssignmentName, isReferencedImportDeclaration: isReferencedImportDeclaration, getNodeCheckFlags: getNodeCheckFlags, getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, - shouldEmitDeclarations: shouldEmitDeclarations, + isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, + hasSemanticErrors: hasSemanticErrors, + isEmitBlocked: isEmitBlocked, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, writeTypeAtLocation: writeTypeAtLocation, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, - writeSymbol: writeSymbolToTextWriter, isSymbolAccessible: isSymbolAccessible, - isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile + isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile, + getConstantValue: getConstantValue }; checkProgram(); - return ts.emitFiles(resolver); + return ts.emitFiles(resolver, targetSourceFile); } function initializeTypeChecker() { ts.forEach(program.getSourceFiles(), function (file) { ts.bindSourceFile(file); - ts.forEach(file.semanticErrors, addDiagnostic); + ts.forEach(file.semanticDiagnostics, addDiagnostic); }); ts.forEach(program.getSourceFiles(), function (file) { if (!ts.isExternalModule(file)) { @@ -14043,1801 +16374,19 @@ var ts; globalNumberType = getGlobalType("Number"); globalBooleanType = getGlobalType("Boolean"); globalRegExpType = getGlobalType("RegExp"); + globalTemplateStringsArrayType = compilerOptions.target >= 2 /* ES6 */ ? getGlobalType("TemplateStringsArray") : unknownType; } initializeTypeChecker(); return checker; } ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.DiagnosticCode = { - error_TS_0_1: "error TS{0}: {1}", - warning_TS_0_1: "warning TS{0}: {1}", - Unrecognized_escape_sequence: "Unrecognized escape sequence.", - Unexpected_character_0: "Unexpected character {0}.", - Missing_close_quote_character: "Missing close quote character.", - Identifier_expected: "Identifier expected.", - _0_keyword_expected: "'{0}' keyword expected.", - _0_expected: "'{0}' expected.", - Identifier_expected_0_is_a_keyword: "Identifier expected; '{0}' is a keyword.", - Automatic_semicolon_insertion_not_allowed: "Automatic semicolon insertion not allowed.", - Unexpected_token_0_expected: "Unexpected token; '{0}' expected.", - Trailing_comma_not_allowed: "Trailing comma not allowed.", - AsteriskSlash_expected: "'*/' expected.", - public_or_private_modifier_must_precede_static: "'public' or 'private' modifier must precede 'static'.", - Unexpected_token: "Unexpected token.", - Catch_clause_parameter_cannot_have_a_type_annotation: "Catch clause parameter cannot have a type annotation.", - A_rest_parameter_must_be_last_in_a_parameter_list: "A rest parameter must be last in a parameter list.", - Parameter_cannot_have_question_mark_and_initializer: "Parameter cannot have question mark and initializer.", - A_required_parameter_cannot_follow_an_optional_parameter: "A required parameter cannot follow an optional parameter.", - Index_signatures_cannot_have_rest_parameters: "Index signatures cannot have rest parameters.", - Index_signature_parameter_cannot_have_accessibility_modifiers: "Index signature parameter cannot have accessibility modifiers.", - Index_signature_parameter_cannot_have_a_question_mark: "Index signature parameter cannot have a question mark.", - Index_signature_parameter_cannot_have_an_initializer: "Index signature parameter cannot have an initializer.", - Index_signature_must_have_a_type_annotation: "Index signature must have a type annotation.", - Index_signature_parameter_must_have_a_type_annotation: "Index signature parameter must have a type annotation.", - Index_signature_parameter_type_must_be_string_or_number: "Index signature parameter type must be 'string' or 'number'.", - extends_clause_already_seen: "'extends' clause already seen.", - extends_clause_must_precede_implements_clause: "'extends' clause must precede 'implements' clause.", - Classes_can_only_extend_a_single_class: "Classes can only extend a single class.", - implements_clause_already_seen: "'implements' clause already seen.", - Accessibility_modifier_already_seen: "Accessibility modifier already seen.", - _0_modifier_must_precede_1_modifier: "'{0}' modifier must precede '{1}' modifier.", - _0_modifier_already_seen: "'{0}' modifier already seen.", - _0_modifier_cannot_appear_on_a_class_element: "'{0}' modifier cannot appear on a class element.", - Interface_declaration_cannot_have_implements_clause: "Interface declaration cannot have 'implements' clause.", - super_invocation_cannot_have_type_arguments: "'super' invocation cannot have type arguments.", - Only_ambient_modules_can_use_quoted_names: "Only ambient modules can use quoted names.", - Statements_are_not_allowed_in_ambient_contexts: "Statements are not allowed in ambient contexts.", - A_function_implementation_cannot_be_declared_in_an_ambient_context: "A function implementation cannot be declared in an ambient context.", - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: "A 'declare' modifier cannot be used in an already ambient context.", - Initializers_are_not_allowed_in_ambient_contexts: "Initializers are not allowed in ambient contexts.", - _0_modifier_cannot_appear_on_a_module_element: "'{0}' modifier cannot appear on a module element.", - A_declare_modifier_cannot_be_used_with_an_interface_declaration: "A 'declare' modifier cannot be used with an interface declaration.", - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: "A 'declare' modifier is required for a top level declaration in a .d.ts file.", - A_rest_parameter_cannot_be_optional: "A rest parameter cannot be optional.", - A_rest_parameter_cannot_have_an_initializer: "A rest parameter cannot have an initializer.", - set_accessor_must_have_exactly_one_parameter: "'set' accessor must have exactly one parameter.", - set_accessor_parameter_cannot_be_optional: "'set' accessor parameter cannot be optional.", - set_accessor_parameter_cannot_have_an_initializer: "'set' accessor parameter cannot have an initializer.", - set_accessor_cannot_have_rest_parameter: "'set' accessor cannot have rest parameter.", - get_accessor_cannot_have_parameters: "'get' accessor cannot have parameters.", - Modifiers_cannot_appear_here: "Modifiers cannot appear here.", - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: "Accessors are only available when targeting ECMAScript 5 and higher.", - Enum_member_must_have_initializer: "Enum member must have initializer.", - Export_assignment_cannot_be_used_in_internal_modules: "Export assignment cannot be used in internal modules.", - Ambient_enum_elements_can_only_have_integer_literal_initializers: "Ambient enum elements can only have integer literal initializers.", - module_class_interface_enum_import_or_statement: "module, class, interface, enum, import or statement", - constructor_function_accessor_or_variable: "constructor, function, accessor or variable", - statement: "statement", - case_or_default_clause: "case or default clause", - identifier: "identifier", - call_construct_index_property_or_function_signature: "call, construct, index, property or function signature", - expression: "expression", - type_name: "type name", - property_or_accessor: "property or accessor", - parameter: "parameter", - type: "type", - type_parameter: "type parameter", - A_declare_modifier_cannot_be_used_with_an_import_declaration: "A 'declare' modifier cannot be used with an import declaration.", - Invalid_reference_directive_syntax: "Invalid 'reference' directive syntax.", - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: "Octal literals are not available when targeting ECMAScript 5 and higher.", - Accessors_are_not_allowed_in_ambient_contexts: "Accessors are not allowed in ambient contexts.", - _0_modifier_cannot_appear_on_a_constructor_declaration: "'{0}' modifier cannot appear on a constructor declaration.", - _0_modifier_cannot_appear_on_a_parameter: "'{0}' modifier cannot appear on a parameter.", - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: "Only a single variable declaration is allowed in a 'for...in' statement.", - Type_parameters_cannot_appear_on_a_constructor_declaration: "Type parameters cannot appear on a constructor declaration.", - Type_annotation_cannot_appear_on_a_constructor_declaration: "Type annotation cannot appear on a constructor declaration.", - Type_parameters_cannot_appear_on_an_accessor: "Type parameters cannot appear on an accessor.", - Type_annotation_cannot_appear_on_a_set_accessor: "Type annotation cannot appear on a 'set' accessor.", - Index_signature_must_have_exactly_one_parameter: "Index signature must have exactly one parameter.", - _0_list_cannot_be_empty: "'{0}' list cannot be empty.", - variable_declaration: "variable declaration", - type_argument: "type argument", - Invalid_use_of_0_in_strict_mode: "Invalid use of '{0}' in strict mode.", - with_statements_are_not_allowed_in_strict_mode: "'with' statements are not allowed in strict mode.", - delete_cannot_be_called_on_an_identifier_in_strict_mode: "'delete' cannot be called on an identifier in strict mode.", - Invalid_left_hand_side_in_for_in_statement: "Invalid left-hand side in 'for...in' statement.", - continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: "'continue' statement can only be used within an enclosing iteration statement.", - break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: "'break' statement can only be used within an enclosing iteration or switch statement.", - Jump_target_not_found: "Jump target not found.", - Jump_target_cannot_cross_function_boundary: "Jump target cannot cross function boundary.", - return_statement_must_be_contained_within_a_function_body: "'return' statement must be contained within a function body.", - Expression_expected: "Expression expected.", - Type_expected: "Type expected.", - Duplicate_identifier_0: "Duplicate identifier '{0}'.", - The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.", - The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.", - super_can_only_be_used_inside_a_class_instance_method: "'super' can only be used inside a class instance method.", - The_left_hand_side_of_an_assignment_expression_must_be_a_variable_property_or_indexer: "The left-hand side of an assignment expression must be a variable, property or indexer.", - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: "Value of type '{0}' is not callable. Did you mean to include 'new'?", - Value_of_type_0_is_not_callable: "Value of type '{0}' is not callable.", - Value_of_type_0_is_not_newable: "Value of type '{0}' is not newable.", - An_index_expression_argument_must_be_string_number_or_any: "An index expression argument must be 'string', 'number', or 'any'.", - Operator_0_cannot_be_applied_to_types_1_and_2: "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - Type_0_is_not_assignable_to_type_1: "Type '{0}' is not assignable to type '{1}'.", - Type_0_is_not_assignable_to_type_1_NL_2: "Type '{0}' is not assignable to type '{1}':{NL}{2}", - Expected_var_class_interface_or_module: "Expected var, class, interface, or module.", - Getter_0_already_declared: "Getter '{0}' already declared.", - Setter_0_already_declared: "Setter '{0}' already declared.", - Exported_class_0_extends_private_class_1: "Exported class '{0}' extends private class '{1}'.", - Exported_class_0_implements_private_interface_1: "Exported class '{0}' implements private interface '{1}'.", - Exported_interface_0_extends_private_interface_1: "Exported interface '{0}' extends private interface '{1}'.", - Exported_class_0_extends_class_from_inaccessible_module_1: "Exported class '{0}' extends class from inaccessible module {1}.", - Exported_class_0_implements_interface_from_inaccessible_module_1: "Exported class '{0}' implements interface from inaccessible module {1}.", - Exported_interface_0_extends_interface_from_inaccessible_module_1: "Exported interface '{0}' extends interface from inaccessible module {1}.", - Public_static_property_0_of_exported_class_has_or_is_using_private_type_1: "Public static property '{0}' of exported class has or is using private type '{1}'.", - Public_property_0_of_exported_class_has_or_is_using_private_type_1: "Public property '{0}' of exported class has or is using private type '{1}'.", - Property_0_of_exported_interface_has_or_is_using_private_type_1: "Property '{0}' of exported interface has or is using private type '{1}'.", - Exported_variable_0_has_or_is_using_private_type_1: "Exported variable '{0}' has or is using private type '{1}'.", - Public_static_property_0_of_exported_class_is_using_inaccessible_module_1: "Public static property '{0}' of exported class is using inaccessible module {1}.", - Public_property_0_of_exported_class_is_using_inaccessible_module_1: "Public property '{0}' of exported class is using inaccessible module {1}.", - Property_0_of_exported_interface_is_using_inaccessible_module_1: "Property '{0}' of exported interface is using inaccessible module {1}.", - Exported_variable_0_is_using_inaccessible_module_1: "Exported variable '{0}' is using inaccessible module {1}.", - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - Parameter_0_of_exported_function_has_or_is_using_private_type_1: "Parameter '{0}' of exported function has or is using private type '{1}'.", - Parameter_0_of_constructor_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - Parameter_0_of_public_static_property_setter_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - Parameter_0_of_public_property_setter_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - Parameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - Parameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - Parameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - Parameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - Parameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - Parameter_0_of_exported_function_is_using_inaccessible_module_1: "Parameter '{0}' of exported function is using inaccessible module {1}.", - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_type_0: "Return type of public static property getter from exported class has or is using private type '{0}'.", - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_type_0: "Return type of public property getter from exported class has or is using private type '{0}'.", - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of constructor signature from exported interface has or is using private type '{0}'.", - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of call signature from exported interface has or is using private type '{0}'.", - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of index signature from exported interface has or is using private type '{0}'.", - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_type_0: "Return type of public static method from exported class has or is using private type '{0}'.", - Return_type_of_public_method_from_exported_class_has_or_is_using_private_type_0: "Return type of public method from exported class has or is using private type '{0}'.", - Return_type_of_method_from_exported_interface_has_or_is_using_private_type_0: "Return type of method from exported interface has or is using private type '{0}'.", - Return_type_of_exported_function_has_or_is_using_private_type_0: "Return type of exported function has or is using private type '{0}'.", - Return_type_of_public_static_property_getter_from_exported_class_is_using_inaccessible_module_0: "Return type of public static property getter from exported class is using inaccessible module {0}.", - Return_type_of_public_property_getter_from_exported_class_is_using_inaccessible_module_0: "Return type of public property getter from exported class is using inaccessible module {0}.", - Return_type_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of constructor signature from exported interface is using inaccessible module {0}.", - Return_type_of_call_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of call signature from exported interface is using inaccessible module {0}.", - Return_type_of_index_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of index signature from exported interface is using inaccessible module {0}.", - Return_type_of_public_static_method_from_exported_class_is_using_inaccessible_module_0: "Return type of public static method from exported class is using inaccessible module {0}.", - Return_type_of_public_method_from_exported_class_is_using_inaccessible_module_0: "Return type of public method from exported class is using inaccessible module {0}.", - Return_type_of_method_from_exported_interface_is_using_inaccessible_module_0: "Return type of method from exported interface is using inaccessible module {0}.", - Return_type_of_exported_function_is_using_inaccessible_module_0: "Return type of exported function is using inaccessible module {0}.", - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - A_parameter_list_must_follow_a_generic_type_argument_list_expected: "A parameter list must follow a generic type argument list. '(' expected.", - Multiple_constructor_implementations_are_not_allowed: "Multiple constructor implementations are not allowed.", - Cannot_find_external_module_0: "Cannot find external module '{0}'.", - Module_cannot_be_aliased_to_a_non_module_type: "Module cannot be aliased to a non-module type.", - A_class_may_only_extend_another_class: "A class may only extend another class.", - A_class_may_only_implement_another_class_or_interface: "A class may only implement another class or interface.", - An_interface_may_only_extend_a_class_or_another_interface: "An interface may only extend a class or another interface.", - Unable_to_resolve_type: "Unable to resolve type.", - Unable_to_resolve_type_of_0: "Unable to resolve type of '{0}'.", - Unable_to_resolve_type_parameter_constraint: "Unable to resolve type parameter constraint.", - Type_parameter_constraint_cannot_be_a_primitive_type: "Type parameter constraint cannot be a primitive type.", - Supplied_parameters_do_not_match_any_signature_of_call_target: "Supplied parameters do not match any signature of call target.", - Supplied_parameters_do_not_match_any_signature_of_call_target_NL_0: "Supplied parameters do not match any signature of call target:{NL}{0}", - Cannot_use_new_with_an_expression_whose_type_lacks_a_signature: "Cannot use 'new' with an expression whose type lacks a signature.", - Only_a_void_function_can_be_called_with_the_new_keyword: "Only a void function can be called with the 'new' keyword.", - Could_not_select_overload_for_new_expression: "Could not select overload for 'new' expression.", - Type_0_does_not_satisfy_the_constraint_1: "Type '{0}' does not satisfy the constraint '{1}'.", - Could_not_select_overload_for_call_expression: "Could not select overload for 'call' expression.", - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: "Cannot invoke an expression whose type lacks a call signature.", - Calls_to_super_are_only_valid_inside_a_class: "Calls to 'super' are only valid inside a class.", - Generic_type_0_requires_1_type_argument_s: "Generic type '{0}' requires {1} type argument(s).", - Type_of_array_literal_cannot_be_determined_Best_common_type_could_not_be_found_for_array_elements: "Type of array literal cannot be determined. Best common type could not be found for array elements.", - Could_not_find_enclosing_symbol_for_dotted_name_0: "Could not find enclosing symbol for dotted name '{0}'.", - Property_0_does_not_exist_on_value_of_type_1: "Property '{0}' does not exist on value of type '{1}'.", - Cannot_find_name_0: "Cannot find name '{0}'.", - get_and_set_accessor_must_have_the_same_type: "'get' and 'set' accessor must have the same type.", - this_cannot_be_referenced_in_current_location: "'this' cannot be referenced in current location.", - Static_members_cannot_reference_class_type_parameters: "Static members cannot reference class type parameters.", - Type_0_recursively_references_itself_as_a_base_type: "Type '{0}' recursively references itself as a base type.", - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.", - super_can_only_be_referenced_in_a_derived_class: "'super' can only be referenced in a derived class.", - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - Constructors_for_derived_classes_must_contain_a_super_call: "Constructors for derived classes must contain a 'super' call.", - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: "Super calls are not permitted outside constructors or in nested functions inside constructors.", - _0_1_is_inaccessible: "'{0}.{1}' is inaccessible.", - this_cannot_be_referenced_in_a_module_body: "'this' cannot be referenced in a module body.", - Invalid_expression_types_not_known_to_support_the_addition_operator: "Invalid '+' expression - types not known to support the addition operator.", - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: "An arithmetic operand must be of type 'any', 'number' or an enum type.", - Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation: "Variable declarations of a 'for' statement cannot use a type annotation.", - Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any: "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.", - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.", - Setters_cannot_return_a_value: "Setters cannot return a value.", - Tried_to_query_type_of_uninitialized_module_0: "Tried to query type of uninitialized module '{0}'.", - Tried_to_set_variable_type_to_uninitialized_module_type_0: "Tried to set variable type to uninitialized module type '{0}'.", - Type_0_is_not_generic: "Type '{0}' is not generic.", - Getters_must_return_a_value: "Getters must return a value.", - Getter_and_setter_accessors_do_not_agree_in_visibility: "Getter and setter accessors do not agree in visibility.", - Invalid_left_hand_side_of_assignment_expression: "Invalid left-hand side of assignment expression.", - Function_declared_a_non_void_return_type_but_has_no_return_expression: "Function declared a non-void return type, but has no return expression.", - Cannot_resolve_return_type_reference: "Cannot resolve return type reference.", - Constructors_cannot_have_a_return_type_of_void: "Constructors cannot have a return type of 'void'.", - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - All_symbols_within_a_with_block_will_be_resolved_to_any: "All symbols within a with block will be resolved to 'any'.", - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: "Import declarations in an internal module cannot reference an external module.", - Class_0_declares_interface_1_but_does_not_implement_it_NL_2: "Class {0} declares interface {1} but does not implement it:{NL}{2}", - Class_0_declares_class_1_as_an_interface_but_does_not_implement_it_NL_2: "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: "The operand of an increment or decrement operator must be a variable, property or indexer.", - this_cannot_be_referenced_in_a_static_property_initializer: "'this' cannot be referenced in a static property initializer.", - Class_0_cannot_extend_class_1_NL_2: "Class '{0}' cannot extend class '{1}':{NL}{2}", - Interface_0_cannot_extend_class_1_NL_2: "Interface '{0}' cannot extend class '{1}':{NL}{2}", - Interface_0_cannot_extend_interface_1_NL_2: "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - Overload_signature_is_not_compatible_with_function_definition: "Overload signature is not compatible with function definition.", - Overload_signature_is_not_compatible_with_function_definition_NL_0: "Overload signature is not compatible with function definition:{NL}{0}", - Overload_signatures_must_all_be_public_or_private: "Overload signatures must all be public or private.", - Overload_signatures_must_all_be_exported_or_not_exported: "Overload signatures must all be exported or not exported.", - Overload_signatures_must_all_be_ambient_or_non_ambient: "Overload signatures must all be ambient or non-ambient.", - Overload_signatures_must_all_be_optional_or_required: "Overload signatures must all be optional or required.", - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: "Specialized overload signature is not assignable to any non-specialized signature.", - this_cannot_be_referenced_in_constructor_arguments: "'this' cannot be referenced in constructor arguments.", - Instance_member_cannot_be_accessed_off_a_class: "Instance member cannot be accessed off a class.", - Untyped_function_calls_may_not_accept_type_arguments: "Untyped function calls may not accept type arguments.", - Non_generic_functions_may_not_accept_type_arguments: "Non-generic functions may not accept type arguments.", - A_generic_type_may_not_reference_itself_with_a_wrapped_form_of_its_own_type_parameters: "A generic type may not reference itself with a wrapped form of its own type parameters.", - A_rest_parameter_must_be_of_an_array_type: "A rest parameter must be of an array type.", - Overload_signature_implementation_cannot_use_specialized_type: "Overload signature implementation cannot use specialized type.", - Export_assignments_may_only_be_used_at_the_top_level_of_external_modules: "Export assignments may only be used at the top-level of external modules.", - Export_assignments_may_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules.", - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: "Only public methods of the base class are accessible via the 'super' keyword.", - Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1: "Numeric indexer type '{0}' must be assignable to string indexer type '{1}'.", - Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1_NL_2: "Numeric indexer type '{0}' must be assignable to string indexer type '{1}':{NL}{2}", - All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0: "All numerically named properties must be assignable to numeric indexer type '{0}'.", - All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0_NL_1: "All numerically named properties must be assignable to numeric indexer type '{0}':{NL}{1}", - All_named_properties_must_be_assignable_to_string_indexer_type_0: "All named properties must be assignable to string indexer type '{0}'.", - All_named_properties_must_be_assignable_to_string_indexer_type_0_NL_1: "All named properties must be assignable to string indexer type '{0}':{NL}{1}", - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: "A parameter initializer is only allowed in a function or constructor implementation.", - Function_expression_declared_a_non_void_return_type_but_has_no_return_expression: "Function expression declared a non-void return type, but has no return expression.", - Import_declaration_referencing_identifier_from_internal_module_can_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - Module_0_has_no_exported_member_1: "Module '{0}' has no exported member '{1}'.", - Unable_to_resolve_module_reference_0: "Unable to resolve module reference '{0}'.", - Could_not_find_module_0_in_module_1: "Could not find module '{0}' in module '{1}'.", - Exported_import_declaration_0_is_assigned_value_with_type_that_has_or_is_using_private_type_1: "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - Exported_import_declaration_0_is_assigned_value_with_type_that_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - Exported_import_declaration_0_is_assigned_type_that_has_or_is_using_private_type_1: "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - Exported_import_declaration_0_is_assigned_type_that_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - Exported_import_declaration_0_is_assigned_container_that_is_or_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_1: "Type name '{0}' in extends clause does not reference constructor function for '{1}'.", - Internal_module_reference_0_in_import_declaration_does_not_reference_module_instance_for_1: "Internal module reference '{0}' in import declaration does not reference module instance for '{1}'.", - Module_0_cannot_merge_with_previous_declaration_of_1_in_a_different_file_2: "Module '{0}' cannot merge with previous declaration of '{1}' in a different file '{2}'.", - Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':{NL}{3}", - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.", - Ambient_external_module_declaration_cannot_be_reopened: "Ambient external module declaration cannot be reopened.", - All_declarations_of_merged_declaration_0_must_be_exported_or_not_exported: "All declarations of merged declaration '{0}' must be exported or not exported.", - super_cannot_be_referenced_in_constructor_arguments: "'super' cannot be referenced in constructor arguments.", - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: "Return type of constructor signature must be assignable to the instance type of the class.", - Ambient_external_module_declaration_must_be_defined_in_global_context: "Ambient external module declaration must be defined in global context.", - Ambient_external_module_declaration_cannot_specify_relative_module_name: "Ambient external module declaration cannot specify relative module name.", - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.", - No_best_common_type_exists_among_return_expressions: "No best common type exists among return expressions.", - Import_declaration_cannot_refer_to_external_module_reference_when_noResolve_option_is_set: "Import declaration cannot refer to external module reference when --noResolve option is set.", - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.", - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.", - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.", - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: "Expression resolves to '_super' that compiler uses to capture base class reference.", - TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of public static method from exported class has or is using private type '{1}'.", - TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of public method from exported class has or is using private type '{1}'.", - TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of method from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_exported_function_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported function has or is using private type '{1}'.", - TypeParameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - TypeParameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of call signature from exported interface is using inaccessible module {1}", - TypeParameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of public static method from exported class is using inaccessible module {1}.", - TypeParameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of public method from exported class is using inaccessible module {1}.", - TypeParameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of method from exported interface is using inaccessible module {1}.", - TypeParameter_0_of_exported_function_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported function is using inaccessible module {1}.", - TypeParameter_0_of_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported class has or is using private type '{1}'.", - TypeParameter_0_of_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported interface has or is using private type '{1}'.", - TypeParameter_0_of_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported class is using inaccessible module {1}.", - TypeParameter_0_of_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported interface is using inaccessible module {1}.", - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.", - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", - No_best_common_type_exists_between_0_and_1: "No best common type exists between '{0}' and '{1}'.", - No_best_common_type_exists_between_0_1_and_2: "No best common type exists between '{0}', '{1}', and '{2}'.", - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.", - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.", - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.", - Parameter_0_cannot_be_referenced_in_its_initializer: "Parameter '{0}' cannot be referenced in its initializer.", - Duplicate_string_index_signature: "Duplicate string index signature.", - Duplicate_number_index_signature: "Duplicate number index signature.", - All_declarations_of_an_interface_must_have_identical_type_parameters: "All declarations of an interface must have identical type parameters.", - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.", - Neither_type_0_nor_type_1_is_assignable_to_the_other: "Neither type '{0}' nor type '{1}' is assignable to the other.", - Neither_type_0_nor_type_1_is_assignable_to_the_other_NL_2: "Neither type '{0}' nor type '{1}' is assignable to the other:{NL}{2}", - Duplicate_function_implementation: "Duplicate function implementation.", - Function_implementation_expected: "Function implementation expected.", - Function_overload_name_must_be_0: "Function overload name must be '{0}'.", - Constructor_implementation_expected: "Constructor implementation expected.", - Class_name_cannot_be_0: "Class name cannot be '{0}'.", - Interface_name_cannot_be_0: "Interface name cannot be '{0}'.", - Enum_name_cannot_be_0: "Enum name cannot be '{0}'.", - A_module_cannot_have_multiple_export_assignments: "A module cannot have multiple export assignments.", - Export_assignment_not_allowed_in_module_with_exported_element: "Export assignment not allowed in module with exported element.", - A_parameter_property_is_only_allowed_in_a_constructor_implementation: "A parameter property is only allowed in a constructor implementation.", - Function_overload_must_be_static: "Function overload must be static.", - Function_overload_must_not_be_static: "Function overload must not be static.", - Type_0_is_missing_property_1_from_type_2: "Type '{0}' is missing property '{1}' from type '{2}'.", - Types_of_property_0_of_types_1_and_2_are_incompatible: "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - Types_of_property_0_of_types_1_and_2_are_incompatible_NL_3: "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - Property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - Property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - Types_0_and_1_define_property_2_as_private: "Types '{0}' and '{1}' define property '{2}' as private.", - Call_signatures_of_types_0_and_1_are_incompatible: "Call signatures of types '{0}' and '{1}' are incompatible.", - Call_signatures_of_types_0_and_1_are_incompatible_NL_2: "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Type_0_requires_a_call_signature_but_type_1_lacks_one: "Type '{0}' requires a call signature, but type '{1}' lacks one.", - Construct_signatures_of_types_0_and_1_are_incompatible: "Construct signatures of types '{0}' and '{1}' are incompatible.", - Construct_signatures_of_types_0_and_1_are_incompatible_NL_2: "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Type_0_requires_a_construct_signature_but_type_1_lacks_one: "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - Index_signatures_of_types_0_and_1_are_incompatible: "Index signatures of types '{0}' and '{1}' are incompatible.", - Index_signatures_of_types_0_and_1_are_incompatible_NL_2: "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Call_signature_expects_0_or_fewer_parameters: "Call signature expects {0} or fewer parameters.", - Could_not_apply_type_0_to_argument_1_which_is_of_type_2: "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - Types_of_static_property_0_of_class_1_and_class_2_are_incompatible: "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - Types_of_static_property_0_of_class_1_and_class_2_are_incompatible_NL_3: "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - Type_reference_cannot_refer_to_container_0: "Type reference cannot refer to container '{0}'.", - Type_reference_must_refer_to_type: "Type reference must refer to type.", - In_enums_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_the_first_enum_element: "In enums with multiple declarations only one declaration can omit an initializer for the first enum element.", - _0_overload_s: " (+ {0} overload(s))", - Variable_declaration_cannot_have_the_same_name_as_an_import_declaration: "Variable declaration cannot have the same name as an import declaration.", - Signature_expected_0_type_arguments_got_1_instead: "Signature expected {0} type arguments, got {1} instead.", - Property_0_defined_as_optional_in_type_1_but_is_required_in_type_2: "Property '{0}' defined as optional in type '{1}', but is required in type '{2}'.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_do_not_refer_to_same_named_type: "Types '{0}' and '{1}' originating in infinitely expanding type reference do not refer to same named type.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments: "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments_NL_2: "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments:{NL}{2}", - Named_properties_0_of_types_1_and_2_are_not_identical: "Named properties '{0}' of types '{1}' and '{2}' are not identical.", - Types_of_string_indexer_of_types_0_and_1_are_not_identical: "Types of string indexer of types '{0}' and '{1}' are not identical.", - Types_of_number_indexer_of_types_0_and_1_are_not_identical: "Types of number indexer of types '{0}' and '{1}' are not identical.", - Type_of_number_indexer_in_type_0_is_not_assignable_to_string_indexer_type_in_type_1_NL_2: "Type of number indexer in type '{0}' is not assignable to string indexer type in type '{1}'.{NL}{2}", - Type_of_property_0_in_type_1_is_not_assignable_to_string_indexer_type_in_type_2_NL_3: "Type of property '{0}' in type '{1}' is not assignable to string indexer type in type '{2}'.{NL}{3}", - Type_of_property_0_in_type_1_is_not_assignable_to_number_indexer_type_in_type_2_NL_3: "Type of property '{0}' in type '{1}' is not assignable to number indexer type in type '{2}'.{NL}{3}", - Static_property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: "Static property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - Static_property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: "Static property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - Types_0_and_1_define_static_property_2_as_private: "Types '{0}' and '{1}' define static property '{2}' as private.", - Current_host_does_not_support_0_option: "Current host does not support '{0}' option.", - ECMAScript_target_version_0_not_supported_Specify_a_valid_target_version_1_default_or_2: "ECMAScript target version '{0}' not supported. Specify a valid target version: '{1}' (default), or '{2}'", - Argument_for_0_option_must_be_1_or_2: "Argument for '{0}' option must be '{1}' or '{2}'", - Could_not_find_file_0: "Could not find file: '{0}'.", - A_file_cannot_have_a_reference_to_itself: "A file cannot have a reference to itself.", - Cannot_resolve_referenced_file_0: "Cannot resolve referenced file: '{0}'.", - Cannot_find_the_common_subdirectory_path_for_the_input_files: "Cannot find the common subdirectory path for the input files.", - Emit_Error_0: "Emit Error: {0}.", - Cannot_read_file_0_1: "Cannot read file '{0}': {1}", - Unsupported_file_encoding: "Unsupported file encoding.", - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: "Locale must be of the form or -. For example '{0}' or '{1}'.", - Unsupported_locale_0: "Unsupported locale: '{0}'.", - Execution_Failed_NL: "Execution Failed.{NL}", - Invalid_call_to_up: "Invalid call to 'up'", - Invalid_call_to_down: "Invalid call to 'down'", - Base64_value_0_finished_with_a_continuation_bit: "Base64 value '{0}' finished with a continuation bit.", - Unknown_compiler_option_0: "Unknown compiler option '{0}'", - Expected_0_arguments_to_message_got_1_instead: "Expected {0} arguments to message, got {1} instead.", - Expected_the_message_0_to_have_1_arguments_but_it_had_2: "Expected the message '{0}' to have {1} arguments, but it had {2}", - Could_not_delete_file_0: "Could not delete file '{0}'", - Could_not_create_directory_0: "Could not create directory '{0}'", - Error_while_executing_file_0: "Error while executing file '{0}': ", - Cannot_compile_external_modules_unless_the_module_flag_is_provided: "Cannot compile external modules unless the '--module' flag is provided.", - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: "Option mapRoot cannot be specified without specifying sourcemap option.", - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: "Option sourceRoot cannot be specified without specifying sourcemap option.", - Options_mapRoot_and_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - Option_0_specified_without_1: "Option '{0}' specified without '{1}'", - codepage_option_not_supported_on_current_platform: "'codepage' option not supported on current platform.", - Concatenate_and_emit_output_to_single_file: "Concatenate and emit output to single file.", - Generates_corresponding_0_file: "Generates corresponding {0} file.", - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: "Specifies the location where debugger should locate map files instead of generated locations.", - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: "Specifies the location where debugger should locate TypeScript files instead of source locations.", - Watch_input_files: "Watch input files.", - Redirect_output_structure_to_the_directory: "Redirect output structure to the directory.", - Do_not_emit_comments_to_output: "Do not emit comments to output.", - Skip_resolution_and_preprocessing: "Skip resolution and preprocessing.", - Specify_ECMAScript_target_version_0_default_or_1: "Specify ECMAScript target version: '{0}' (default), or '{1}'", - Specify_module_code_generation_0_or_1: "Specify module code generation: '{0}' or '{1}'", - Print_this_message: "Print this message.", - Print_the_compiler_s_version_0: "Print the compiler's version: {0}", - Allow_use_of_deprecated_0_keyword_when_referencing_an_external_module: "Allow use of deprecated '{0}' keyword when referencing an external module.", - Specify_locale_for_errors_and_messages_For_example_0_or_1: "Specify locale for errors and messages. For example '{0}' or '{1}'", - Syntax_0: "Syntax: {0}", - options: "options", - file1: "file", - Examples: "Examples:", - Options: "Options:", - Insert_command_line_options_and_files_from_a_file: "Insert command line options and files from a file.", - Version_0: "Version {0}", - Use_the_0_flag_to_see_options: "Use the '{0}' flag to see options.", - NL_Recompiling_0: "{NL}Recompiling ({0}):", - STRING: "STRING", - KIND: "KIND", - file2: "FILE", - VERSION: "VERSION", - LOCATION: "LOCATION", - DIRECTORY: "DIRECTORY", - NUMBER: "NUMBER", - Specify_the_codepage_to_use_when_opening_source_files: "Specify the codepage to use when opening source files.", - Additional_locations: "Additional locations:", - This_version_of_the_Javascript_runtime_does_not_support_the_0_function: "This version of the Javascript runtime does not support the '{0}' function.", - Unknown_rule: "Unknown rule.", - Invalid_line_number_0: "Invalid line number ({0})", - Warn_on_expressions_and_declarations_with_an_implied_any_type: "Warn on expressions and declarations with an implied 'any' type.", - Variable_0_implicitly_has_an_any_type: "Variable '{0}' implicitly has an 'any' type.", - Parameter_0_of_1_implicitly_has_an_any_type: "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - Parameter_0_of_function_type_implicitly_has_an_any_type: "Parameter '{0}' of function type implicitly has an 'any' type.", - Member_0_of_object_type_implicitly_has_an_any_type: "Member '{0}' of object type implicitly has an 'any' type.", - new_expression_which_lacks_a_constructor_signature_implicitly_has_an_any_type: "'new' expression, which lacks a constructor signature, implicitly has an 'any' type.", - _0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - Parameter_0_of_lambda_function_implicitly_has_an_any_type: "Parameter '{0}' of lambda function implicitly has an 'any' type.", - Constructor_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - Lambda_Function_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - Array_Literal_implicitly_has_an_any_type_from_widening: "Array Literal implicitly has an 'any' type from widening.", - _0_which_lacks_get_accessor_and_parameter_type_annotation_on_set_accessor_implicitly_has_an_any_type: "'{0}', which lacks 'get' accessor and parameter type annotation on 'set' accessor, implicitly has an 'any' type.", - Index_signature_of_object_type_implicitly_has_an_any_type: "Index signature of object type implicitly has an 'any' type.", - Object_literal_s_property_0_implicitly_has_an_any_type_from_widening: "Object literal's property '{0}' implicitly has an 'any' type from widening." - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (DiagnosticCategory) { - DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; - DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - DiagnosticCategory[DiagnosticCategory["NoPrefix"] = 3] = "NoPrefix"; - })(TypeScript.DiagnosticCategory || (TypeScript.DiagnosticCategory = {})); - var DiagnosticCategory = TypeScript.DiagnosticCategory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.diagnosticInformationMap = { - "error TS{0}: {1}": { "code": 0, "category": 3 /* NoPrefix */ }, - "warning TS{0}: {1}": { "code": 1, "category": 3 /* NoPrefix */ }, - "Unrecognized escape sequence.": { "code": 1000, "category": 1 /* Error */ }, - "Unexpected character {0}.": { "code": 1001, "category": 1 /* Error */ }, - "Missing close quote character.": { "code": 1002, "category": 1 /* Error */ }, - "Identifier expected.": { "code": 1003, "category": 1 /* Error */ }, - "'{0}' keyword expected.": { "code": 1004, "category": 1 /* Error */ }, - "'{0}' expected.": { "code": 1005, "category": 1 /* Error */ }, - "Identifier expected; '{0}' is a keyword.": { "code": 1006, "category": 1 /* Error */ }, - "Automatic semicolon insertion not allowed.": { "code": 1007, "category": 1 /* Error */ }, - "Unexpected token; '{0}' expected.": { "code": 1008, "category": 1 /* Error */ }, - "Trailing comma not allowed.": { "code": 1009, "category": 1 /* Error */ }, - "'*/' expected.": { "code": 1010, "category": 1 /* Error */ }, - "'public' or 'private' modifier must precede 'static'.": { "code": 1011, "category": 1 /* Error */ }, - "Unexpected token.": { "code": 1012, "category": 1 /* Error */ }, - "Catch clause parameter cannot have a type annotation.": { "code": 1013, "category": 1 /* Error */ }, - "A rest parameter must be last in a parameter list.": { "code": 1014, "category": 1 /* Error */ }, - "Parameter cannot have question mark and initializer.": { "code": 1015, "category": 1 /* Error */ }, - "A required parameter cannot follow an optional parameter.": { "code": 1016, "category": 1 /* Error */ }, - "Index signatures cannot have rest parameters.": { "code": 1017, "category": 1 /* Error */ }, - "Index signature parameter cannot have accessibility modifiers.": { "code": 1018, "category": 1 /* Error */ }, - "Index signature parameter cannot have a question mark.": { "code": 1019, "category": 1 /* Error */ }, - "Index signature parameter cannot have an initializer.": { "code": 1020, "category": 1 /* Error */ }, - "Index signature must have a type annotation.": { "code": 1021, "category": 1 /* Error */ }, - "Index signature parameter must have a type annotation.": { "code": 1022, "category": 1 /* Error */ }, - "Index signature parameter type must be 'string' or 'number'.": { "code": 1023, "category": 1 /* Error */ }, - "'extends' clause already seen.": { "code": 1024, "category": 1 /* Error */ }, - "'extends' clause must precede 'implements' clause.": { "code": 1025, "category": 1 /* Error */ }, - "Classes can only extend a single class.": { "code": 1026, "category": 1 /* Error */ }, - "'implements' clause already seen.": { "code": 1027, "category": 1 /* Error */ }, - "Accessibility modifier already seen.": { "code": 1028, "category": 1 /* Error */ }, - "'{0}' modifier must precede '{1}' modifier.": { "code": 1029, "category": 1 /* Error */ }, - "'{0}' modifier already seen.": { "code": 1030, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a class element.": { "code": 1031, "category": 1 /* Error */ }, - "Interface declaration cannot have 'implements' clause.": { "code": 1032, "category": 1 /* Error */ }, - "'super' invocation cannot have type arguments.": { "code": 1034, "category": 1 /* Error */ }, - "Only ambient modules can use quoted names.": { "code": 1035, "category": 1 /* Error */ }, - "Statements are not allowed in ambient contexts.": { "code": 1036, "category": 1 /* Error */ }, - "A function implementation cannot be declared in an ambient context.": { "code": 1037, "category": 1 /* Error */ }, - "A 'declare' modifier cannot be used in an already ambient context.": { "code": 1038, "category": 1 /* Error */ }, - "Initializers are not allowed in ambient contexts.": { "code": 1039, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a module element.": { "code": 1044, "category": 1 /* Error */ }, - "A 'declare' modifier cannot be used with an interface declaration.": { "code": 1045, "category": 1 /* Error */ }, - "A 'declare' modifier is required for a top level declaration in a .d.ts file.": { "code": 1046, "category": 1 /* Error */ }, - "A rest parameter cannot be optional.": { "code": 1047, "category": 1 /* Error */ }, - "A rest parameter cannot have an initializer.": { "code": 1048, "category": 1 /* Error */ }, - "'set' accessor must have exactly one parameter.": { "code": 1049, "category": 1 /* Error */ }, - "'set' accessor parameter cannot be optional.": { "code": 1051, "category": 1 /* Error */ }, - "'set' accessor parameter cannot have an initializer.": { "code": 1052, "category": 1 /* Error */ }, - "'set' accessor cannot have rest parameter.": { "code": 1053, "category": 1 /* Error */ }, - "'get' accessor cannot have parameters.": { "code": 1054, "category": 1 /* Error */ }, - "Modifiers cannot appear here.": { "code": 1055, "category": 1 /* Error */ }, - "Accessors are only available when targeting ECMAScript 5 and higher.": { "code": 1056, "category": 1 /* Error */ }, - "Enum member must have initializer.": { "code": 1061, "category": 1 /* Error */ }, - "Export assignment cannot be used in internal modules.": { "code": 1063, "category": 1 /* Error */ }, - "Ambient enum elements can only have integer literal initializers.": { "code": 1066, "category": 1 /* Error */ }, - "module, class, interface, enum, import or statement": { "code": 1067, "category": 3 /* NoPrefix */ }, - "constructor, function, accessor or variable": { "code": 1068, "category": 3 /* NoPrefix */ }, - "statement": { "code": 1069, "category": 3 /* NoPrefix */ }, - "case or default clause": { "code": 1070, "category": 3 /* NoPrefix */ }, - "identifier": { "code": 1071, "category": 3 /* NoPrefix */ }, - "call, construct, index, property or function signature": { "code": 1072, "category": 3 /* NoPrefix */ }, - "expression": { "code": 1073, "category": 3 /* NoPrefix */ }, - "type name": { "code": 1074, "category": 3 /* NoPrefix */ }, - "property or accessor": { "code": 1075, "category": 3 /* NoPrefix */ }, - "parameter": { "code": 1076, "category": 3 /* NoPrefix */ }, - "type": { "code": 1077, "category": 3 /* NoPrefix */ }, - "type parameter": { "code": 1078, "category": 3 /* NoPrefix */ }, - "A 'declare' modifier cannot be used with an import declaration.": { "code": 1079, "category": 1 /* Error */ }, - "Invalid 'reference' directive syntax.": { "code": 1084, "category": 1 /* Error */ }, - "Octal literals are not available when targeting ECMAScript 5 and higher.": { "code": 1085, "category": 1 /* Error */ }, - "Accessors are not allowed in ambient contexts.": { "code": 1086, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a constructor declaration.": { "code": 1089, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a parameter.": { "code": 1090, "category": 1 /* Error */ }, - "Only a single variable declaration is allowed in a 'for...in' statement.": { "code": 1091, "category": 1 /* Error */ }, - "Type parameters cannot appear on a constructor declaration.": { "code": 1092, "category": 1 /* Error */ }, - "Type annotation cannot appear on a constructor declaration.": { "code": 1093, "category": 1 /* Error */ }, - "Type parameters cannot appear on an accessor.": { "code": 1094, "category": 1 /* Error */ }, - "Type annotation cannot appear on a 'set' accessor.": { "code": 1095, "category": 1 /* Error */ }, - "Index signature must have exactly one parameter.": { "code": 1096, "category": 1 /* Error */ }, - "'{0}' list cannot be empty.": { "code": 1097, "category": 1 /* Error */ }, - "variable declaration": { "code": 1098, "category": 3 /* NoPrefix */ }, - "type argument": { "code": 1099, "category": 3 /* NoPrefix */ }, - "Invalid use of '{0}' in strict mode.": { "code": 1100, "category": 1 /* Error */ }, - "'with' statements are not allowed in strict mode.": { "code": 1101, "category": 1 /* Error */ }, - "'delete' cannot be called on an identifier in strict mode.": { "code": 1102, "category": 1 /* Error */ }, - "Invalid left-hand side in 'for...in' statement.": { "code": 1103, "category": 1 /* Error */ }, - "'continue' statement can only be used within an enclosing iteration statement.": { "code": 1104, "category": 1 /* Error */ }, - "'break' statement can only be used within an enclosing iteration or switch statement.": { "code": 1105, "category": 1 /* Error */ }, - "Jump target not found.": { "code": 1106, "category": 1 /* Error */ }, - "Jump target cannot cross function boundary.": { "code": 1107, "category": 1 /* Error */ }, - "'return' statement must be contained within a function body.": { "code": 1108, "category": 1 /* Error */ }, - "Expression expected.": { "code": 1109, "category": 1 /* Error */ }, - "Type expected.": { "code": 1110, "category": 1 /* Error */ }, - "Duplicate identifier '{0}'.": { "code": 2000, "category": 1 /* Error */ }, - "The name '{0}' does not exist in the current scope.": { "code": 2001, "category": 1 /* Error */ }, - "The name '{0}' does not refer to a value.": { "code": 2002, "category": 1 /* Error */ }, - "'super' can only be used inside a class instance method.": { "code": 2003, "category": 1 /* Error */ }, - "The left-hand side of an assignment expression must be a variable, property or indexer.": { "code": 2004, "category": 1 /* Error */ }, - "Value of type '{0}' is not callable. Did you mean to include 'new'?": { "code": 2161, "category": 1 /* Error */ }, - "Value of type '{0}' is not callable.": { "code": 2006, "category": 1 /* Error */ }, - "Value of type '{0}' is not newable.": { "code": 2007, "category": 1 /* Error */ }, - "An index expression argument must be 'string', 'number', or 'any'.": { "code": 2008, "category": 1 /* Error */ }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { "code": 2009, "category": 1 /* Error */ }, - "Type '{0}' is not assignable to type '{1}'.": { "code": 2011, "category": 1 /* Error */ }, - "Type '{0}' is not assignable to type '{1}':{NL}{2}": { "code": 2012, "category": 1 /* Error */ }, - "Expected var, class, interface, or module.": { "code": 2013, "category": 1 /* Error */ }, - "Getter '{0}' already declared.": { "code": 2015, "category": 1 /* Error */ }, - "Setter '{0}' already declared.": { "code": 2016, "category": 1 /* Error */ }, - "Exported class '{0}' extends private class '{1}'.": { "code": 2018, "category": 1 /* Error */ }, - "Exported class '{0}' implements private interface '{1}'.": { "code": 2019, "category": 1 /* Error */ }, - "Exported interface '{0}' extends private interface '{1}'.": { "code": 2020, "category": 1 /* Error */ }, - "Exported class '{0}' extends class from inaccessible module {1}.": { "code": 2021, "category": 1 /* Error */ }, - "Exported class '{0}' implements interface from inaccessible module {1}.": { "code": 2022, "category": 1 /* Error */ }, - "Exported interface '{0}' extends interface from inaccessible module {1}.": { "code": 2023, "category": 1 /* Error */ }, - "Public static property '{0}' of exported class has or is using private type '{1}'.": { "code": 2024, "category": 1 /* Error */ }, - "Public property '{0}' of exported class has or is using private type '{1}'.": { "code": 2025, "category": 1 /* Error */ }, - "Property '{0}' of exported interface has or is using private type '{1}'.": { "code": 2026, "category": 1 /* Error */ }, - "Exported variable '{0}' has or is using private type '{1}'.": { "code": 2027, "category": 1 /* Error */ }, - "Public static property '{0}' of exported class is using inaccessible module {1}.": { "code": 2028, "category": 1 /* Error */ }, - "Public property '{0}' of exported class is using inaccessible module {1}.": { "code": 2029, "category": 1 /* Error */ }, - "Property '{0}' of exported interface is using inaccessible module {1}.": { "code": 2030, "category": 1 /* Error */ }, - "Exported variable '{0}' is using inaccessible module {1}.": { "code": 2031, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": { "code": 2032, "category": 1 /* Error */ }, - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": { "code": 2033, "category": 1 /* Error */ }, - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": { "code": 2034, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": { "code": 2035, "category": 1 /* Error */ }, - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": { "code": 2036, "category": 1 /* Error */ }, - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": { "code": 2037, "category": 1 /* Error */ }, - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": { "code": 2038, "category": 1 /* Error */ }, - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": { "code": 2039, "category": 1 /* Error */ }, - "Parameter '{0}' of exported function has or is using private type '{1}'.": { "code": 2040, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": { "code": 2041, "category": 1 /* Error */ }, - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": { "code": 2042, "category": 1 /* Error */ }, - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": { "code": 2043, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": { "code": 2044, "category": 1 /* Error */ }, - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": { "code": 2045, "category": 1 /* Error */ }, - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": { "code": 2046, "category": 1 /* Error */ }, - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": { "code": 2047, "category": 1 /* Error */ }, - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": { "code": 2048, "category": 1 /* Error */ }, - "Parameter '{0}' of exported function is using inaccessible module {1}.": { "code": 2049, "category": 1 /* Error */ }, - "Return type of public static property getter from exported class has or is using private type '{0}'.": { "code": 2050, "category": 1 /* Error */ }, - "Return type of public property getter from exported class has or is using private type '{0}'.": { "code": 2051, "category": 1 /* Error */ }, - "Return type of constructor signature from exported interface has or is using private type '{0}'.": { "code": 2052, "category": 1 /* Error */ }, - "Return type of call signature from exported interface has or is using private type '{0}'.": { "code": 2053, "category": 1 /* Error */ }, - "Return type of index signature from exported interface has or is using private type '{0}'.": { "code": 2054, "category": 1 /* Error */ }, - "Return type of public static method from exported class has or is using private type '{0}'.": { "code": 2055, "category": 1 /* Error */ }, - "Return type of public method from exported class has or is using private type '{0}'.": { "code": 2056, "category": 1 /* Error */ }, - "Return type of method from exported interface has or is using private type '{0}'.": { "code": 2057, "category": 1 /* Error */ }, - "Return type of exported function has or is using private type '{0}'.": { "code": 2058, "category": 1 /* Error */ }, - "Return type of public static property getter from exported class is using inaccessible module {0}.": { "code": 2059, "category": 1 /* Error */ }, - "Return type of public property getter from exported class is using inaccessible module {0}.": { "code": 2060, "category": 1 /* Error */ }, - "Return type of constructor signature from exported interface is using inaccessible module {0}.": { "code": 2061, "category": 1 /* Error */ }, - "Return type of call signature from exported interface is using inaccessible module {0}.": { "code": 2062, "category": 1 /* Error */ }, - "Return type of index signature from exported interface is using inaccessible module {0}.": { "code": 2063, "category": 1 /* Error */ }, - "Return type of public static method from exported class is using inaccessible module {0}.": { "code": 2064, "category": 1 /* Error */ }, - "Return type of public method from exported class is using inaccessible module {0}.": { "code": 2065, "category": 1 /* Error */ }, - "Return type of method from exported interface is using inaccessible module {0}.": { "code": 2066, "category": 1 /* Error */ }, - "Return type of exported function is using inaccessible module {0}.": { "code": 2067, "category": 1 /* Error */ }, - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { "code": 2068, "category": 1 /* Error */ }, - "A parameter list must follow a generic type argument list. '(' expected.": { "code": 2069, "category": 1 /* Error */ }, - "Multiple constructor implementations are not allowed.": { "code": 2070, "category": 1 /* Error */ }, - "Cannot find external module '{0}'.": { "code": 2071, "category": 1 /* Error */ }, - "Module cannot be aliased to a non-module type.": { "code": 2072, "category": 1 /* Error */ }, - "A class may only extend another class.": { "code": 2073, "category": 1 /* Error */ }, - "A class may only implement another class or interface.": { "code": 2074, "category": 1 /* Error */ }, - "An interface may only extend a class or another interface.": { "code": 2075, "category": 1 /* Error */ }, - "Unable to resolve type.": { "code": 2077, "category": 1 /* Error */ }, - "Unable to resolve type of '{0}'.": { "code": 2078, "category": 1 /* Error */ }, - "Unable to resolve type parameter constraint.": { "code": 2079, "category": 1 /* Error */ }, - "Type parameter constraint cannot be a primitive type.": { "code": 2080, "category": 1 /* Error */ }, - "Supplied parameters do not match any signature of call target.": { "code": 2081, "category": 1 /* Error */ }, - "Supplied parameters do not match any signature of call target:{NL}{0}": { "code": 2082, "category": 1 /* Error */ }, - "Cannot use 'new' with an expression whose type lacks a signature.": { "code": 2083, "category": 1 /* Error */ }, - "Only a void function can be called with the 'new' keyword.": { "code": 2084, "category": 1 /* Error */ }, - "Could not select overload for 'new' expression.": { "code": 2085, "category": 1 /* Error */ }, - "Type '{0}' does not satisfy the constraint '{1}'.": { "code": 2086, "category": 1 /* Error */ }, - "Could not select overload for 'call' expression.": { "code": 2087, "category": 1 /* Error */ }, - "Cannot invoke an expression whose type lacks a call signature.": { "code": 2088, "category": 1 /* Error */ }, - "Calls to 'super' are only valid inside a class.": { "code": 2089, "category": 1 /* Error */ }, - "Generic type '{0}' requires {1} type argument(s).": { "code": 2090, "category": 1 /* Error */ }, - "Type of array literal cannot be determined. Best common type could not be found for array elements.": { "code": 2092, "category": 1 /* Error */ }, - "Could not find enclosing symbol for dotted name '{0}'.": { "code": 2093, "category": 1 /* Error */ }, - "Property '{0}' does not exist on value of type '{1}'.": { "code": 2094, "category": 1 /* Error */ }, - "Cannot find name '{0}'.": { "code": 2095, "category": 1 /* Error */ }, - "'get' and 'set' accessor must have the same type.": { "code": 2096, "category": 1 /* Error */ }, - "'this' cannot be referenced in current location.": { "code": 2097, "category": 1 /* Error */ }, - "Static members cannot reference class type parameters.": { "code": 2099, "category": 1 /* Error */ }, - "Type '{0}' recursively references itself as a base type.": { "code": 2100, "category": 1 /* Error */ }, - "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.": { "code": 2102, "category": 1 /* Error */ }, - "'super' can only be referenced in a derived class.": { "code": 2103, "category": 1 /* Error */ }, - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { "code": 2104, "category": 1 /* Error */ }, - "Constructors for derived classes must contain a 'super' call.": { "code": 2105, "category": 1 /* Error */ }, - "Super calls are not permitted outside constructors or in nested functions inside constructors.": { "code": 2106, "category": 1 /* Error */ }, - "'{0}.{1}' is inaccessible.": { "code": 2107, "category": 1 /* Error */ }, - "'this' cannot be referenced in a module body.": { "code": 2108, "category": 1 /* Error */ }, - "Invalid '+' expression - types not known to support the addition operator.": { "code": 2111, "category": 1 /* Error */ }, - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { "code": 2112, "category": 1 /* Error */ }, - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { "code": 2113, "category": 1 /* Error */ }, - "An arithmetic operand must be of type 'any', 'number' or an enum type.": { "code": 2114, "category": 1 /* Error */ }, - "Variable declarations of a 'for' statement cannot use a type annotation.": { "code": 2115, "category": 1 /* Error */ }, - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": { "code": 2116, "category": 1 /* Error */ }, - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { "code": 2117, "category": 1 /* Error */ }, - "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { "code": 2118, "category": 1 /* Error */ }, - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": { "code": 2119, "category": 1 /* Error */ }, - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { "code": 2120, "category": 1 /* Error */ }, - "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { "code": 2121, "category": 1 /* Error */ }, - "Setters cannot return a value.": { "code": 2122, "category": 1 /* Error */ }, - "Tried to query type of uninitialized module '{0}'.": { "code": 2123, "category": 1 /* Error */ }, - "Tried to set variable type to uninitialized module type '{0}'.": { "code": 2124, "category": 1 /* Error */ }, - "Type '{0}' is not generic.": { "code": 2125, "category": 1 /* Error */ }, - "Getters must return a value.": { "code": 2126, "category": 1 /* Error */ }, - "Getter and setter accessors do not agree in visibility.": { "code": 2127, "category": 1 /* Error */ }, - "Invalid left-hand side of assignment expression.": { "code": 2130, "category": 1 /* Error */ }, - "Function declared a non-void return type, but has no return expression.": { "code": 2131, "category": 1 /* Error */ }, - "Cannot resolve return type reference.": { "code": 2132, "category": 1 /* Error */ }, - "Constructors cannot have a return type of 'void'.": { "code": 2133, "category": 1 /* Error */ }, - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { "code": 2134, "category": 1 /* Error */ }, - "All symbols within a with block will be resolved to 'any'.": { "code": 2135, "category": 1 /* Error */ }, - "Import declarations in an internal module cannot reference an external module.": { "code": 2136, "category": 1 /* Error */ }, - "Class {0} declares interface {1} but does not implement it:{NL}{2}": { "code": 2137, "category": 1 /* Error */ }, - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": { "code": 2138, "category": 1 /* Error */ }, - "The operand of an increment or decrement operator must be a variable, property or indexer.": { "code": 2139, "category": 1 /* Error */ }, - "'this' cannot be referenced in a static property initializer.": { "code": 2140, "category": 1 /* Error */ }, - "Class '{0}' cannot extend class '{1}':{NL}{2}": { "code": 2141, "category": 1 /* Error */ }, - "Interface '{0}' cannot extend class '{1}':{NL}{2}": { "code": 2142, "category": 1 /* Error */ }, - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": { "code": 2143, "category": 1 /* Error */ }, - "Overload signature is not compatible with function definition.": { "code": 2148, "category": 1 /* Error */ }, - "Overload signature is not compatible with function definition:{NL}{0}": { "code": 2149, "category": 1 /* Error */ }, - "Overload signatures must all be public or private.": { "code": 2150, "category": 1 /* Error */ }, - "Overload signatures must all be exported or not exported.": { "code": 2151, "category": 1 /* Error */ }, - "Overload signatures must all be ambient or non-ambient.": { "code": 2152, "category": 1 /* Error */ }, - "Overload signatures must all be optional or required.": { "code": 2153, "category": 1 /* Error */ }, - "Specialized overload signature is not assignable to any non-specialized signature.": { "code": 2154, "category": 1 /* Error */ }, - "'this' cannot be referenced in constructor arguments.": { "code": 2155, "category": 1 /* Error */ }, - "Instance member cannot be accessed off a class.": { "code": 2157, "category": 1 /* Error */ }, - "Untyped function calls may not accept type arguments.": { "code": 2158, "category": 1 /* Error */ }, - "Non-generic functions may not accept type arguments.": { "code": 2159, "category": 1 /* Error */ }, - "A generic type may not reference itself with a wrapped form of its own type parameters.": { "code": 2160, "category": 1 /* Error */ }, - "A rest parameter must be of an array type.": { "code": 2162, "category": 1 /* Error */ }, - "Overload signature implementation cannot use specialized type.": { "code": 2163, "category": 1 /* Error */ }, - "Export assignments may only be used at the top-level of external modules.": { "code": 2164, "category": 1 /* Error */ }, - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules.": { "code": 2165, "category": 1 /* Error */ }, - "Only public methods of the base class are accessible via the 'super' keyword.": { "code": 2166, "category": 1 /* Error */ }, - "Numeric indexer type '{0}' must be assignable to string indexer type '{1}'.": { "code": 2167, "category": 1 /* Error */ }, - "Numeric indexer type '{0}' must be assignable to string indexer type '{1}':{NL}{2}": { "code": 2168, "category": 1 /* Error */ }, - "All numerically named properties must be assignable to numeric indexer type '{0}'.": { "code": 2169, "category": 1 /* Error */ }, - "All numerically named properties must be assignable to numeric indexer type '{0}':{NL}{1}": { "code": 2170, "category": 1 /* Error */ }, - "All named properties must be assignable to string indexer type '{0}'.": { "code": 2171, "category": 1 /* Error */ }, - "All named properties must be assignable to string indexer type '{0}':{NL}{1}": { "code": 2172, "category": 1 /* Error */ }, - "A parameter initializer is only allowed in a function or constructor implementation.": { "code": 2174, "category": 1 /* Error */ }, - "Function expression declared a non-void return type, but has no return expression.": { "code": 2176, "category": 1 /* Error */ }, - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": { "code": 2177, "category": 1 /* Error */ }, - "Module '{0}' has no exported member '{1}'.": { "code": 2178, "category": 1 /* Error */ }, - "Unable to resolve module reference '{0}'.": { "code": 2179, "category": 1 /* Error */ }, - "Could not find module '{0}' in module '{1}'.": { "code": 2180, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": { "code": 2181, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": { "code": 2182, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": { "code": 2183, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": { "code": 2184, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": { "code": 2185, "category": 1 /* Error */ }, - "Type name '{0}' in extends clause does not reference constructor function for '{1}'.": { "code": 2186, "category": 1 /* Error */ }, - "Internal module reference '{0}' in import declaration does not reference module instance for '{1}'.": { "code": 2187, "category": 1 /* Error */ }, - "Module '{0}' cannot merge with previous declaration of '{1}' in a different file '{2}'.": { "code": 2188, "category": 1 /* Error */ }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':{NL}{3}": { "code": 2189, "category": 1 /* Error */ }, - "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { "code": 2190, "category": 1 /* Error */ }, - "Ambient external module declaration cannot be reopened.": { "code": 2191, "category": 1 /* Error */ }, - "All declarations of merged declaration '{0}' must be exported or not exported.": { "code": 2192, "category": 1 /* Error */ }, - "'super' cannot be referenced in constructor arguments.": { "code": 2193, "category": 1 /* Error */ }, - "Return type of constructor signature must be assignable to the instance type of the class.": { "code": 2194, "category": 1 /* Error */ }, - "Ambient external module declaration must be defined in global context.": { "code": 2195, "category": 1 /* Error */ }, - "Ambient external module declaration cannot specify relative module name.": { "code": 2196, "category": 1 /* Error */ }, - "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { "code": 2197, "category": 1 /* Error */ }, - "No best common type exists among return expressions.": { "code": 2198, "category": 1 /* Error */ }, - "Import declaration cannot refer to external module reference when --noResolve option is set.": { "code": 2199, "category": 1 /* Error */ }, - "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { "code": 2200, "category": 1 /* Error */ }, - "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { "code": 2205, "category": 1 /* Error */ }, - "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { "code": 2206, "category": 1 /* Error */ }, - "Expression resolves to '_super' that compiler uses to capture base class reference.": { "code": 2207, "category": 1 /* Error */ }, - "TypeParameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": { "code": 2208, "category": 1 /* Error */ }, - "TypeParameter '{0}' of call signature from exported interface has or is using private type '{1}'.": { "code": 2209, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public static method from exported class has or is using private type '{1}'.": { "code": 2210, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public method from exported class has or is using private type '{1}'.": { "code": 2211, "category": 1 /* Error */ }, - "TypeParameter '{0}' of method from exported interface has or is using private type '{1}'.": { "code": 2212, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported function has or is using private type '{1}'.": { "code": 2213, "category": 1 /* Error */ }, - "TypeParameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": { "code": 2214, "category": 1 /* Error */ }, - "TypeParameter '{0}' of call signature from exported interface is using inaccessible module {1}": { "code": 2215, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public static method from exported class is using inaccessible module {1}.": { "code": 2216, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public method from exported class is using inaccessible module {1}.": { "code": 2217, "category": 1 /* Error */ }, - "TypeParameter '{0}' of method from exported interface is using inaccessible module {1}.": { "code": 2218, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported function is using inaccessible module {1}.": { "code": 2219, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported class has or is using private type '{1}'.": { "code": 2220, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported interface has or is using private type '{1}'.": { "code": 2221, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported class is using inaccessible module {1}.": { "code": 2222, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported interface is using inaccessible module {1}.": { "code": 2223, "category": 1 /* Error */ }, - "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.": { "code": 2224, "category": 1 /* Error */ }, - "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { "code": 2225, "category": 1 /* Error */ }, - "No best common type exists between '{0}' and '{1}'.": { "code": 2226, "category": 1 /* Error */ }, - "No best common type exists between '{0}', '{1}', and '{2}'.": { "code": 2227, "category": 1 /* Error */ }, - "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.": { "code": 2228, "category": 1 /* Error */ }, - "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { "code": 2229, "category": 1 /* Error */ }, - "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { "code": 2230, "category": 1 /* Error */ }, - "Parameter '{0}' cannot be referenced in its initializer.": { "code": 2231, "category": 1 /* Error */ }, - "Duplicate string index signature.": { "code": 2232, "category": 1 /* Error */ }, - "Duplicate number index signature.": { "code": 2233, "category": 1 /* Error */ }, - "All declarations of an interface must have identical type parameters.": { "code": 2234, "category": 1 /* Error */ }, - "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.": { "code": 2235, "category": 1 /* Error */ }, - "Neither type '{0}' nor type '{1}' is assignable to the other.": { "code": 2236, "category": 1 /* Error */ }, - "Neither type '{0}' nor type '{1}' is assignable to the other:{NL}{2}": { "code": 2237, "category": 1 /* Error */ }, - "Duplicate function implementation.": { "code": 2237, "category": 1 /* Error */ }, - "Function implementation expected.": { "code": 2238, "category": 1 /* Error */ }, - "Function overload name must be '{0}'.": { "code": 2239, "category": 1 /* Error */ }, - "Constructor implementation expected.": { "code": 2240, "category": 1 /* Error */ }, - "Class name cannot be '{0}'.": { "code": 2241, "category": 1 /* Error */ }, - "Interface name cannot be '{0}'.": { "code": 2242, "category": 1 /* Error */ }, - "Enum name cannot be '{0}'.": { "code": 2243, "category": 1 /* Error */ }, - "A module cannot have multiple export assignments.": { "code": 2244, "category": 1 /* Error */ }, - "Export assignment not allowed in module with exported element.": { "code": 2245, "category": 1 /* Error */ }, - "A parameter property is only allowed in a constructor implementation.": { "code": 2246, "category": 1 /* Error */ }, - "Function overload must be static.": { "code": 2247, "category": 1 /* Error */ }, - "Function overload must not be static.": { "code": 2248, "category": 1 /* Error */ }, - "Type '{0}' is missing property '{1}' from type '{2}'.": { "code": 4000, "category": 3 /* NoPrefix */ }, - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": { "code": 4001, "category": 3 /* NoPrefix */ }, - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": { "code": 4002, "category": 3 /* NoPrefix */ }, - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": { "code": 4003, "category": 3 /* NoPrefix */ }, - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": { "code": 4004, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' define property '{2}' as private.": { "code": 4005, "category": 3 /* NoPrefix */ }, - "Call signatures of types '{0}' and '{1}' are incompatible.": { "code": 4006, "category": 3 /* NoPrefix */ }, - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { "code": 4007, "category": 3 /* NoPrefix */ }, - "Type '{0}' requires a call signature, but type '{1}' lacks one.": { "code": 4008, "category": 3 /* NoPrefix */ }, - "Construct signatures of types '{0}' and '{1}' are incompatible.": { "code": 4009, "category": 3 /* NoPrefix */ }, - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { "code": 4010, "category": 3 /* NoPrefix */ }, - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": { "code": 4011, "category": 3 /* NoPrefix */ }, - "Index signatures of types '{0}' and '{1}' are incompatible.": { "code": 4012, "category": 3 /* NoPrefix */ }, - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { "code": 4013, "category": 3 /* NoPrefix */ }, - "Call signature expects {0} or fewer parameters.": { "code": 4014, "category": 3 /* NoPrefix */ }, - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": { "code": 4015, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { "code": 4016, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { "code": 4017, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { "code": 4018, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { "code": 4019, "category": 3 /* NoPrefix */ }, - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": { "code": 4020, "category": 3 /* NoPrefix */ }, - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": { "code": 4021, "category": 3 /* NoPrefix */ }, - "Type reference cannot refer to container '{0}'.": { "code": 4022, "category": 1 /* Error */ }, - "Type reference must refer to type.": { "code": 4023, "category": 1 /* Error */ }, - "In enums with multiple declarations only one declaration can omit an initializer for the first enum element.": { "code": 4024, "category": 1 /* Error */ }, - " (+ {0} overload(s))": { "code": 4025, "category": 2 /* Message */ }, - "Variable declaration cannot have the same name as an import declaration.": { "code": 4026, "category": 1 /* Error */ }, - "Signature expected {0} type arguments, got {1} instead.": { "code": 4027, "category": 1 /* Error */ }, - "Property '{0}' defined as optional in type '{1}', but is required in type '{2}'.": { "code": 4028, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference do not refer to same named type.": { "code": 4029, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments.": { "code": 4030, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments:{NL}{2}": { "code": 4031, "category": 3 /* NoPrefix */ }, - "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { "code": 4032, "category": 3 /* NoPrefix */ }, - "Types of string indexer of types '{0}' and '{1}' are not identical.": { "code": 4033, "category": 3 /* NoPrefix */ }, - "Types of number indexer of types '{0}' and '{1}' are not identical.": { "code": 4034, "category": 3 /* NoPrefix */ }, - "Type of number indexer in type '{0}' is not assignable to string indexer type in type '{1}'.{NL}{2}": { "code": 4035, "category": 3 /* NoPrefix */ }, - "Type of property '{0}' in type '{1}' is not assignable to string indexer type in type '{2}'.{NL}{3}": { "code": 4036, "category": 3 /* NoPrefix */ }, - "Type of property '{0}' in type '{1}' is not assignable to number indexer type in type '{2}'.{NL}{3}": { "code": 4037, "category": 3 /* NoPrefix */ }, - "Static property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": { "code": 4038, "category": 3 /* NoPrefix */ }, - "Static property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": { "code": 4039, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' define static property '{2}' as private.": { "code": 4040, "category": 3 /* NoPrefix */ }, - "Current host does not support '{0}' option.": { "code": 5001, "category": 1 /* Error */ }, - "ECMAScript target version '{0}' not supported. Specify a valid target version: '{1}' (default), or '{2}'": { "code": 5002, "category": 1 /* Error */ }, - "Argument for '{0}' option must be '{1}' or '{2}'": { "code": 5003, "category": 1 /* Error */ }, - "Could not find file: '{0}'.": { "code": 5004, "category": 1 /* Error */ }, - "A file cannot have a reference to itself.": { "code": 5006, "category": 1 /* Error */ }, - "Cannot resolve referenced file: '{0}'.": { "code": 5007, "category": 1 /* Error */ }, - "Cannot find the common subdirectory path for the input files.": { "code": 5009, "category": 1 /* Error */ }, - "Emit Error: {0}.": { "code": 5011, "category": 1 /* Error */ }, - "Cannot read file '{0}': {1}": { "code": 5012, "category": 1 /* Error */ }, - "Unsupported file encoding.": { "code": 5013, "category": 3 /* NoPrefix */ }, - "Locale must be of the form or -. For example '{0}' or '{1}'.": { "code": 5014, "category": 1 /* Error */ }, - "Unsupported locale: '{0}'.": { "code": 5015, "category": 1 /* Error */ }, - "Execution Failed.{NL}": { "code": 5016, "category": 1 /* Error */ }, - "Invalid call to 'up'": { "code": 5019, "category": 1 /* Error */ }, - "Invalid call to 'down'": { "code": 5020, "category": 1 /* Error */ }, - "Base64 value '{0}' finished with a continuation bit.": { "code": 5021, "category": 1 /* Error */ }, - "Unknown compiler option '{0}'": { "code": 5023, "category": 1 /* Error */ }, - "Expected {0} arguments to message, got {1} instead.": { "code": 5024, "category": 1 /* Error */ }, - "Expected the message '{0}' to have {1} arguments, but it had {2}": { "code": 5025, "category": 1 /* Error */ }, - "Could not delete file '{0}'": { "code": 5034, "category": 1 /* Error */ }, - "Could not create directory '{0}'": { "code": 5035, "category": 1 /* Error */ }, - "Error while executing file '{0}': ": { "code": 5036, "category": 1 /* Error */ }, - "Cannot compile external modules unless the '--module' flag is provided.": { "code": 5037, "category": 1 /* Error */ }, - "Option mapRoot cannot be specified without specifying sourcemap option.": { "code": 5038, "category": 1 /* Error */ }, - "Option sourceRoot cannot be specified without specifying sourcemap option.": { "code": 5039, "category": 1 /* Error */ }, - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": { "code": 5040, "category": 1 /* Error */ }, - "Option '{0}' specified without '{1}'": { "code": 5041, "category": 1 /* Error */ }, - "'codepage' option not supported on current platform.": { "code": 5042, "category": 1 /* Error */ }, - "Concatenate and emit output to single file.": { "code": 6001, "category": 2 /* Message */ }, - "Generates corresponding {0} file.": { "code": 6002, "category": 2 /* Message */ }, - "Specifies the location where debugger should locate map files instead of generated locations.": { "code": 6003, "category": 2 /* Message */ }, - "Specifies the location where debugger should locate TypeScript files instead of source locations.": { "code": 6004, "category": 2 /* Message */ }, - "Watch input files.": { "code": 6005, "category": 2 /* Message */ }, - "Redirect output structure to the directory.": { "code": 6006, "category": 2 /* Message */ }, - "Do not emit comments to output.": { "code": 6009, "category": 2 /* Message */ }, - "Skip resolution and preprocessing.": { "code": 6010, "category": 2 /* Message */ }, - "Specify ECMAScript target version: '{0}' (default), or '{1}'": { "code": 6015, "category": 2 /* Message */ }, - "Specify module code generation: '{0}' or '{1}'": { "code": 6016, "category": 2 /* Message */ }, - "Print this message.": { "code": 6017, "category": 2 /* Message */ }, - "Print the compiler's version: {0}": { "code": 6019, "category": 2 /* Message */ }, - "Allow use of deprecated '{0}' keyword when referencing an external module.": { "code": 6021, "category": 2 /* Message */ }, - "Specify locale for errors and messages. For example '{0}' or '{1}'": { "code": 6022, "category": 2 /* Message */ }, - "Syntax: {0}": { "code": 6023, "category": 2 /* Message */ }, - "options": { "code": 6024, "category": 2 /* Message */ }, - "file1": { "code": 6025, "category": 2 /* Message */ }, - "Examples:": { "code": 6026, "category": 2 /* Message */ }, - "Options:": { "code": 6027, "category": 2 /* Message */ }, - "Insert command line options and files from a file.": { "code": 6030, "category": 2 /* Message */ }, - "Version {0}": { "code": 6029, "category": 2 /* Message */ }, - "Use the '{0}' flag to see options.": { "code": 6031, "category": 2 /* Message */ }, - "{NL}Recompiling ({0}):": { "code": 6032, "category": 2 /* Message */ }, - "STRING": { "code": 6033, "category": 2 /* Message */ }, - "KIND": { "code": 6034, "category": 2 /* Message */ }, - "file2": { "code": 6035, "category": 2 /* Message */ }, - "VERSION": { "code": 6036, "category": 2 /* Message */ }, - "LOCATION": { "code": 6037, "category": 2 /* Message */ }, - "DIRECTORY": { "code": 6038, "category": 2 /* Message */ }, - "NUMBER": { "code": 6039, "category": 2 /* Message */ }, - "Specify the codepage to use when opening source files.": { "code": 6040, "category": 2 /* Message */ }, - "Additional locations:": { "code": 6041, "category": 2 /* Message */ }, - "This version of the Javascript runtime does not support the '{0}' function.": { "code": 7000, "category": 1 /* Error */ }, - "Unknown rule.": { "code": 7002, "category": 1 /* Error */ }, - "Invalid line number ({0})": { "code": 7003, "category": 1 /* Error */ }, - "Warn on expressions and declarations with an implied 'any' type.": { "code": 7004, "category": 2 /* Message */ }, - "Variable '{0}' implicitly has an 'any' type.": { "code": 7005, "category": 1 /* Error */ }, - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": { "code": 7006, "category": 1 /* Error */ }, - "Parameter '{0}' of function type implicitly has an 'any' type.": { "code": 7007, "category": 1 /* Error */ }, - "Member '{0}' of object type implicitly has an 'any' type.": { "code": 7008, "category": 1 /* Error */ }, - "'new' expression, which lacks a constructor signature, implicitly has an 'any' type.": { "code": 7009, "category": 1 /* Error */ }, - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7010, "category": 1 /* Error */ }, - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7011, "category": 1 /* Error */ }, - "Parameter '{0}' of lambda function implicitly has an 'any' type.": { "code": 7012, "category": 1 /* Error */ }, - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7013, "category": 1 /* Error */ }, - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7014, "category": 1 /* Error */ }, - "Array Literal implicitly has an 'any' type from widening.": { "code": 7015, "category": 1 /* Error */ }, - "'{0}', which lacks 'get' accessor and parameter type annotation on 'set' accessor, implicitly has an 'any' type.": { "code": 7016, "category": 1 /* Error */ }, - "Index signature of object type implicitly has an 'any' type.": { "code": 7017, "category": 1 /* Error */ }, - "Object literal's property '{0}' implicitly has an 'any' type from widening.": { "code": 7018, "category": 1 /* Error */ } - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ArrayUtilities = (function () { - function ArrayUtilities() { - } - ArrayUtilities.sequenceEquals = function (array1, array2, equals) { - if (array1 === array2) { - return true; - } - if (array1 === null || array2 === null) { - return false; - } - if (array1.length !== array2.length) { - return false; - } - for (var i = 0, n = array1.length; i < n; i++) { - if (!equals(array1[i], array2[i])) { - return false; - } - } - return true; - }; - ArrayUtilities.contains = function (array, value) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return true; - } - } - return false; - }; - ArrayUtilities.distinct = function (array, equalsFn) { - var result = []; - for (var i = 0, n = array.length; i < n; i++) { - var current = array[i]; - for (var j = 0; j < result.length; j++) { - if (equalsFn(result[j], current)) { - break; - } - } - if (j === result.length) { - result.push(current); - } - } - return result; - }; - ArrayUtilities.last = function (array) { - if (array.length === 0) { - throw TypeScript.Errors.argumentOutOfRange('array'); - } - return array[array.length - 1]; - }; - ArrayUtilities.lastOrDefault = function (array, predicate) { - for (var i = array.length - 1; i >= 0; i--) { - var v = array[i]; - if (predicate(v, i)) { - return v; - } - } - return null; - }; - ArrayUtilities.firstOrDefault = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - var value = array[i]; - if (func(value, i)) { - return value; - } - } - return null; - }; - ArrayUtilities.first = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - var value = array[i]; - if (!func || func(value, i)) { - return value; - } - } - throw TypeScript.Errors.invalidOperation(); - }; - ArrayUtilities.sum = function (array, func) { - var result = 0; - for (var i = 0, n = array.length; i < n; i++) { - result += func(array[i]); - } - return result; - }; - ArrayUtilities.select = function (values, func) { - var result = new Array(values.length); - for (var i = 0; i < values.length; i++) { - result[i] = func(values[i]); - } - return result; - }; - ArrayUtilities.where = function (values, func) { - var result = new Array(); - for (var i = 0; i < values.length; i++) { - if (func(values[i])) { - result.push(values[i]); - } - } - return result; - }; - ArrayUtilities.any = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - if (func(array[i])) { - return true; - } - } - return false; - }; - ArrayUtilities.all = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - if (!func(array[i])) { - return false; - } - } - return true; - }; - ArrayUtilities.binarySearch = function (array, value) { - var low = 0; - var high = array.length - 1; - while (low <= high) { - var middle = low + ((high - low) >> 1); - var midValue = array[middle]; - if (midValue === value) { - return middle; - } - else if (midValue > value) { - high = middle - 1; - } - else { - low = middle + 1; - } - } - return ~low; - }; - ArrayUtilities.createArray = function (length, defaultValue) { - var result = new Array(length); - for (var i = 0; i < length; i++) { - result[i] = defaultValue; - } - return result; - }; - ArrayUtilities.grow = function (array, length, defaultValue) { - var count = length - array.length; - for (var i = 0; i < count; i++) { - array.push(defaultValue); - } - }; - ArrayUtilities.copy = function (sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (var i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - }; - ArrayUtilities.indexOf = function (array, predicate) { - for (var i = 0, n = array.length; i < n; i++) { - if (predicate(array[i])) { - return i; - } - } - return -1; - }; - return ArrayUtilities; - })(); - TypeScript.ArrayUtilities = ArrayUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(TypeScript.AssertionLevel || (TypeScript.AssertionLevel = {})); - var AssertionLevel = TypeScript.AssertionLevel; - var Debug = (function () { - function Debug() { - } - Debug.shouldAssert = function (level) { - return this.currentAssertionLevel >= level; - }; - Debug.assert = function (expression, message, verboseDebugInfo) { - if (message === void 0) { message = ""; } - if (verboseDebugInfo === void 0) { verboseDebugInfo = null; } - if (!expression) { - var verboseDebugString = ""; - if (verboseDebugInfo) { - verboseDebugString = "\r\nVerbose Debug Information:" + verboseDebugInfo(); - } - throw new Error("Debug Failure. False expression: " + message + verboseDebugString); - } - }; - Debug.fail = function (message) { - Debug.assert(false, message); - }; - Debug.currentAssertionLevel = 0 /* None */; - return Debug; - })(); - TypeScript.Debug = Debug; -})(TypeScript || (TypeScript = {})); -var __extends = this.__extends || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -var TypeScript; -(function (TypeScript) { - TypeScript.LocalizedDiagnosticMessages = null; - var Location = (function () { - function Location(fileName, lineMap, start, length) { - this._fileName = fileName; - this._lineMap = lineMap; - this._start = start; - this._length = length; - } - Location.prototype.fileName = function () { - return this._fileName; - }; - Location.prototype.lineMap = function () { - return this._lineMap; - }; - Location.prototype.line = function () { - return this._lineMap ? this._lineMap.getLineNumberFromPosition(this.start()) : 0; - }; - Location.prototype.character = function () { - return this._lineMap ? this._lineMap.getLineAndCharacterFromPosition(this.start()).character() : 0; - }; - Location.prototype.start = function () { - return this._start; - }; - Location.prototype.length = function () { - return this._length; - }; - Location.equals = function (location1, location2) { - return location1._fileName === location2._fileName && location1._start === location2._start && location1._length === location2._length; - }; - return Location; - })(); - TypeScript.Location = Location; - var Diagnostic = (function (_super) { - __extends(Diagnostic, _super); - function Diagnostic(fileName, lineMap, start, length, diagnosticKey, _arguments, additionalLocations) { - if (_arguments === void 0) { _arguments = null; } - if (additionalLocations === void 0) { additionalLocations = null; } - _super.call(this, fileName, lineMap, start, length); - this._diagnosticKey = diagnosticKey; - this._arguments = (_arguments && _arguments.length > 0) ? _arguments : null; - this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : null; - } - Diagnostic.prototype.toJSON = function (key) { - var result = {}; - result.start = this.start(); - result.length = this.length(); - result.diagnosticCode = this._diagnosticKey; - var _arguments = this.arguments(); - if (_arguments && _arguments.length > 0) { - result.arguments = _arguments; - } - return result; - }; - Diagnostic.prototype.diagnosticKey = function () { - return this._diagnosticKey; - }; - Diagnostic.prototype.arguments = function () { - return this._arguments; - }; - Diagnostic.prototype.text = function () { - return TypeScript.getLocalizedText(this._diagnosticKey, this._arguments); - }; - Diagnostic.prototype.message = function () { - return TypeScript.getDiagnosticMessage(this._diagnosticKey, this._arguments); - }; - Diagnostic.prototype.additionalLocations = function () { - return this._additionalLocations || []; - }; - Diagnostic.equals = function (diagnostic1, diagnostic2) { - return Location.equals(diagnostic1, diagnostic2) && diagnostic1._diagnosticKey === diagnostic2._diagnosticKey && TypeScript.ArrayUtilities.sequenceEquals(diagnostic1._arguments, diagnostic2._arguments, function (v1, v2) { return v1 === v2; }); - }; - Diagnostic.prototype.info = function () { - return getDiagnosticInfoFromKey(this.diagnosticKey()); - }; - return Diagnostic; - })(Location); - TypeScript.Diagnostic = Diagnostic; - function newLine() { - return "\r\n"; - } - TypeScript.newLine = newLine; - function getLargestIndex(diagnostic) { - var largest = -1; - var regex = /\{(\d+)\}/g; - var match; - while (match = regex.exec(diagnostic)) { - var val = parseInt(match[1]); - if (!isNaN(val) && val > largest) { - largest = val; - } - } - return largest; - } - function getDiagnosticInfoFromKey(diagnosticKey) { - var result = TypeScript.diagnosticInformationMap[diagnosticKey]; - TypeScript.Debug.assert(result); - return result; - } - function getLocalizedText(diagnosticKey, args) { - var diagnosticMessageText = diagnosticKey; - TypeScript.Debug.assert(diagnosticMessageText !== undefined && diagnosticMessageText !== null); - var actualCount = args ? args.length : 0; - var expectedCount = 1 + getLargestIndex(diagnosticKey); - if (expectedCount !== actualCount) { - throw new Error(getLocalizedText(TypeScript.DiagnosticCode.Expected_0_arguments_to_message_got_1_instead, [expectedCount, actualCount])); - } - var valueCount = 1 + getLargestIndex(diagnosticMessageText); - if (valueCount !== expectedCount) { - throw new Error(getLocalizedText(TypeScript.DiagnosticCode.Expected_the_message_0_to_have_1_arguments_but_it_had_2, [diagnosticMessageText, expectedCount, valueCount])); - } - diagnosticMessageText = diagnosticMessageText.replace(/{(\d+)}/g, function (match, num) { - return typeof args[num] !== 'undefined' ? args[num] : match; - }); - diagnosticMessageText = diagnosticMessageText.replace(/{(NL)}/g, function (match) { - return TypeScript.newLine(); - }); - return diagnosticMessageText; - } - TypeScript.getLocalizedText = getLocalizedText; - function getDiagnosticMessage(diagnosticKey, args) { - var diagnostic = getDiagnosticInfoFromKey(diagnosticKey); - var diagnosticMessageText = getLocalizedText(diagnosticKey, args); - var message; - if (diagnostic.category === 1 /* Error */) { - message = getLocalizedText(TypeScript.DiagnosticCode.error_TS_0_1, [diagnostic.code, diagnosticMessageText]); - } - else if (diagnostic.category === 0 /* Warning */) { - message = getLocalizedText(TypeScript.DiagnosticCode.warning_TS_0_1, [diagnostic.code, diagnosticMessageText]); - } - else { - message = diagnosticMessageText; - } - return message; - } - TypeScript.getDiagnosticMessage = getDiagnosticMessage; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Errors = (function () { - function Errors() { - } - Errors.argument = function (argument, message) { - return new Error("Invalid argument: " + argument + ". " + message); - }; - Errors.argumentOutOfRange = function (argument) { - return new Error("Argument out of range: " + argument); - }; - Errors.argumentNull = function (argument) { - return new Error("Argument null: " + argument); - }; - Errors.abstract = function () { - return new Error("Operation not implemented properly by subclass."); - }; - Errors.notYetImplemented = function () { - return new Error("Not yet implemented."); - }; - Errors.invalidOperation = function (message) { - return new Error("Invalid operation: " + message); - }; - return Errors; - })(); - TypeScript.Errors = Errors; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Hash = (function () { - function Hash() { - } - Hash.computeFnv1aCharArrayHashCode = function (text, start, len) { - var hashCode = Hash.FNV_BASE; - var end = start + len; - for (var i = start; i < end; i++) { - hashCode = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(hashCode ^ text[i], Hash.FNV_PRIME); - } - return hashCode; - }; - Hash.computeSimple31BitCharArrayHashCode = function (key, start, len) { - var hash = 0; - for (var i = 0; i < len; i++) { - var ch = key[start + i]; - hash = ((((hash << 5) - hash) | 0) + ch) | 0; - } - return hash & 0x7FFFFFFF; - }; - Hash.computeSimple31BitStringHashCode = function (key) { - var hash = 0; - var start = 0; - var len = key.length; - for (var i = 0; i < len; i++) { - var ch = key.charCodeAt(start + i); - hash = ((((hash << 5) - hash) | 0) + ch) | 0; - } - return hash & 0x7FFFFFFF; - }; - Hash.computeMurmur2StringHashCode = function (key, seed) { - var m = 0x5bd1e995; - var r = 24; - var numberOfCharsLeft = key.length; - var h = Math.abs(seed ^ numberOfCharsLeft); - var index = 0; - while (numberOfCharsLeft >= 2) { - var c1 = key.charCodeAt(index); - var c2 = key.charCodeAt(index + 1); - var k = Math.abs(c1 | (c2 << 16)); - k = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(k, m); - k ^= k >> r; - k = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(k, m); - h = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(h, m); - h ^= k; - index += 2; - numberOfCharsLeft -= 2; - } - if (numberOfCharsLeft === 1) { - h ^= key.charCodeAt(index); - h = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(h, m); - } - h ^= h >> 13; - h = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(h, m); - h ^= h >> 15; - return h; - }; - Hash.combine = function (value, currentHash) { - return (((currentHash << 5) + currentHash) + value) & 0x7FFFFFFF; - }; - Hash.FNV_BASE = 2166136261; - Hash.FNV_PRIME = 16777619; - return Hash; - })(); - TypeScript.Hash = Hash; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (IntegerUtilities) { - function integerDivide(numerator, denominator) { - return (numerator / denominator) >> 0; - } - IntegerUtilities.integerDivide = integerDivide; - function integerMultiplyLow32Bits(n1, n2) { - var n1Low16 = n1 & 0x0000ffff; - var n1High16 = n1 >>> 16; - var n2Low16 = n2 & 0x0000ffff; - var n2High16 = n2 >>> 16; - var resultLow32 = (((n1 & 0xffff0000) * n2) >>> 0) + (((n1 & 0x0000ffff) * n2) >>> 0) >>> 0; - return resultLow32; - } - IntegerUtilities.integerMultiplyLow32Bits = integerMultiplyLow32Bits; - function isInteger(text) { - return /^[0-9]+$/.test(text); - } - IntegerUtilities.isInteger = isInteger; - function isHexInteger(text) { - return /^0(x|X)[0-9a-fA-F]+$/.test(text); - } - IntegerUtilities.isHexInteger = isHexInteger; - })(TypeScript.IntegerUtilities || (TypeScript.IntegerUtilities = {})); - var IntegerUtilities = TypeScript.IntegerUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineMap = (function () { - function LineMap(_computeLineStarts, length) { - this._computeLineStarts = _computeLineStarts; - this.length = length; - this._lineStarts = null; - } - LineMap.prototype.toJSON = function (key) { - return { lineStarts: this.lineStarts(), length: this.length }; - }; - LineMap.prototype.equals = function (other) { - return this.length === other.length && TypeScript.ArrayUtilities.sequenceEquals(this.lineStarts(), other.lineStarts(), function (v1, v2) { return v1 === v2; }); - }; - LineMap.prototype.lineStarts = function () { - if (this._lineStarts === null) { - this._lineStarts = this._computeLineStarts(); - } - return this._lineStarts; - }; - LineMap.prototype.lineCount = function () { - return this.lineStarts().length; - }; - LineMap.prototype.getPosition = function (line, character) { - return this.lineStarts()[line] + character; - }; - LineMap.prototype.getLineNumberFromPosition = function (position) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - if (position === this.length) { - return this.lineCount() - 1; - } - var lineNumber = TypeScript.ArrayUtilities.binarySearch(this.lineStarts(), position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - return lineNumber; - }; - LineMap.prototype.getLineStartPosition = function (lineNumber) { - return this.lineStarts()[lineNumber]; - }; - LineMap.prototype.fillLineAndCharacterFromPosition = function (position, lineAndCharacter) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - var lineNumber = this.getLineNumberFromPosition(position); - lineAndCharacter.line = lineNumber; - lineAndCharacter.character = position - this.lineStarts()[lineNumber]; - }; - LineMap.prototype.getLineAndCharacterFromPosition = function (position) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - var lineNumber = this.getLineNumberFromPosition(position); - return new TypeScript.LineAndCharacter(lineNumber, position - this.lineStarts()[lineNumber]); - }; - LineMap.empty = new LineMap(function () { return [0]; }, 0); - return LineMap; - })(); - TypeScript.LineMap = LineMap; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineAndCharacter = (function () { - function LineAndCharacter(line, character) { - this._line = 0; - this._character = 0; - if (line < 0) { - throw TypeScript.Errors.argumentOutOfRange("line"); - } - if (character < 0) { - throw TypeScript.Errors.argumentOutOfRange("character"); - } - this._line = line; - this._character = character; - } - LineAndCharacter.prototype.line = function () { - return this._line; - }; - LineAndCharacter.prototype.character = function () { - return this._character; - }; - return LineAndCharacter; - })(); - TypeScript.LineAndCharacter = LineAndCharacter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var StringUtilities = (function () { - function StringUtilities() { - } - StringUtilities.isString = function (value) { - return Object.prototype.toString.apply(value, []) === '[object String]'; - }; - StringUtilities.endsWith = function (string, value) { - return string.substring(string.length - value.length, string.length) === value; - }; - StringUtilities.startsWith = function (string, value) { - return string.substr(0, value.length) === value; - }; - StringUtilities.repeat = function (value, count) { - return Array(count + 1).join(value); - }; - return StringUtilities; - })(); - TypeScript.StringUtilities = StringUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - CharacterCodes[CharacterCodes["_"] = 95] = "_"; - CharacterCodes[CharacterCodes["$"] = 36] = "$"; - CharacterCodes[CharacterCodes["_0"] = 48] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 49] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 50] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 51] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 52] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 53] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 54] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 55] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 56] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 57] = "_9"; - CharacterCodes[CharacterCodes["a"] = 97] = "a"; - CharacterCodes[CharacterCodes["b"] = 98] = "b"; - CharacterCodes[CharacterCodes["c"] = 99] = "c"; - CharacterCodes[CharacterCodes["d"] = 100] = "d"; - CharacterCodes[CharacterCodes["e"] = 101] = "e"; - CharacterCodes[CharacterCodes["f"] = 102] = "f"; - CharacterCodes[CharacterCodes["g"] = 103] = "g"; - CharacterCodes[CharacterCodes["h"] = 104] = "h"; - CharacterCodes[CharacterCodes["i"] = 105] = "i"; - CharacterCodes[CharacterCodes["j"] = 106] = "j"; - CharacterCodes[CharacterCodes["k"] = 107] = "k"; - CharacterCodes[CharacterCodes["l"] = 108] = "l"; - CharacterCodes[CharacterCodes["m"] = 109] = "m"; - CharacterCodes[CharacterCodes["n"] = 110] = "n"; - CharacterCodes[CharacterCodes["o"] = 111] = "o"; - CharacterCodes[CharacterCodes["p"] = 112] = "p"; - CharacterCodes[CharacterCodes["q"] = 113] = "q"; - CharacterCodes[CharacterCodes["r"] = 114] = "r"; - CharacterCodes[CharacterCodes["s"] = 115] = "s"; - CharacterCodes[CharacterCodes["t"] = 116] = "t"; - CharacterCodes[CharacterCodes["u"] = 117] = "u"; - CharacterCodes[CharacterCodes["v"] = 118] = "v"; - CharacterCodes[CharacterCodes["w"] = 119] = "w"; - CharacterCodes[CharacterCodes["x"] = 120] = "x"; - CharacterCodes[CharacterCodes["y"] = 121] = "y"; - CharacterCodes[CharacterCodes["z"] = 122] = "z"; - CharacterCodes[CharacterCodes["A"] = 65] = "A"; - CharacterCodes[CharacterCodes["B"] = 66] = "B"; - CharacterCodes[CharacterCodes["C"] = 67] = "C"; - CharacterCodes[CharacterCodes["D"] = 68] = "D"; - CharacterCodes[CharacterCodes["E"] = 69] = "E"; - CharacterCodes[CharacterCodes["F"] = 70] = "F"; - CharacterCodes[CharacterCodes["G"] = 71] = "G"; - CharacterCodes[CharacterCodes["H"] = 72] = "H"; - CharacterCodes[CharacterCodes["I"] = 73] = "I"; - CharacterCodes[CharacterCodes["J"] = 74] = "J"; - CharacterCodes[CharacterCodes["K"] = 75] = "K"; - CharacterCodes[CharacterCodes["L"] = 76] = "L"; - CharacterCodes[CharacterCodes["M"] = 77] = "M"; - CharacterCodes[CharacterCodes["N"] = 78] = "N"; - CharacterCodes[CharacterCodes["O"] = 79] = "O"; - CharacterCodes[CharacterCodes["P"] = 80] = "P"; - CharacterCodes[CharacterCodes["Q"] = 81] = "Q"; - CharacterCodes[CharacterCodes["R"] = 82] = "R"; - CharacterCodes[CharacterCodes["S"] = 83] = "S"; - CharacterCodes[CharacterCodes["T"] = 84] = "T"; - CharacterCodes[CharacterCodes["U"] = 85] = "U"; - CharacterCodes[CharacterCodes["V"] = 86] = "V"; - CharacterCodes[CharacterCodes["W"] = 87] = "W"; - CharacterCodes[CharacterCodes["X"] = 88] = "X"; - CharacterCodes[CharacterCodes["Y"] = 89] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 90] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 64] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 58] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 44] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 46] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 61] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 45] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 37] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 43] = "plus"; - CharacterCodes[CharacterCodes["question"] = 63] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 47] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 9] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab"; - })(TypeScript.CharacterCodes || (TypeScript.CharacterCodes = {})); - var CharacterCodes = TypeScript.CharacterCodes; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (ScriptSnapshot) { - var StringScriptSnapshot = (function () { - function StringScriptSnapshot(text) { - this.text = text; - this._lineStartPositions = null; - } - StringScriptSnapshot.prototype.getText = function (start, end) { - return this.text.substring(start, end); - }; - StringScriptSnapshot.prototype.getLength = function () { - return this.text.length; - }; - StringScriptSnapshot.prototype.getLineStartPositions = function () { - if (!this._lineStartPositions) { - this._lineStartPositions = TypeScript.TextUtilities.parseLineStarts(this.text); - } - return this._lineStartPositions; - }; - StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) { - throw TypeScript.Errors.notYetImplemented(); - }; - return StringScriptSnapshot; - })(); - function fromString(text) { - return new StringScriptSnapshot(text); - } - ScriptSnapshot.fromString = fromString; - })(TypeScript.ScriptSnapshot || (TypeScript.ScriptSnapshot = {})); - var ScriptSnapshot = TypeScript.ScriptSnapshot; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (LineMap1) { - function fromSimpleText(text) { - return new TypeScript.LineMap(function () { return TypeScript.TextUtilities.parseLineStarts({ charCodeAt: function (index) { return text.charCodeAt(index); }, length: text.length() }); }, text.length()); - } - LineMap1.fromSimpleText = fromSimpleText; - function fromScriptSnapshot(scriptSnapshot) { - return new TypeScript.LineMap(function () { return scriptSnapshot.getLineStartPositions(); }, scriptSnapshot.getLength()); - } - LineMap1.fromScriptSnapshot = fromScriptSnapshot; - function fromString(text) { - return new TypeScript.LineMap(function () { return TypeScript.TextUtilities.parseLineStarts(text); }, text.length); - } - LineMap1.fromString = fromString; - })(TypeScript.LineMap1 || (TypeScript.LineMap1 = {})); - var LineMap1 = TypeScript.LineMap1; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SimpleText) { - var SimpleStringText = (function () { - function SimpleStringText(value) { - this.value = value; - this._lineMap = null; - } - SimpleStringText.prototype.length = function () { - return this.value.length; - }; - SimpleStringText.prototype.substr = function (start, length) { - return this.value.substr(start, length); - }; - SimpleStringText.prototype.charCodeAt = function (index) { - return this.value.charCodeAt(index); - }; - SimpleStringText.prototype.lineMap = function () { - if (!this._lineMap) { - this._lineMap = TypeScript.LineMap1.fromString(this.value); - } - return this._lineMap; - }; - return SimpleStringText; - })(); - var SimpleScriptSnapshotText = (function () { - function SimpleScriptSnapshotText(scriptSnapshot) { - this.scriptSnapshot = scriptSnapshot; - this._lineMap = null; - } - SimpleScriptSnapshotText.prototype.charCodeAt = function (index) { - return this.scriptSnapshot.getText(index, index + 1).charCodeAt(0); - }; - SimpleScriptSnapshotText.prototype.length = function () { - return this.scriptSnapshot.getLength(); - }; - SimpleScriptSnapshotText.prototype.substr = function (start, length) { - return this.scriptSnapshot.getText(start, start + length); - }; - SimpleScriptSnapshotText.prototype.lineMap = function () { - var _this = this; - if (this._lineMap === null) { - this._lineMap = new TypeScript.LineMap(function () { return _this.scriptSnapshot.getLineStartPositions(); }, this.length()); - } - return this._lineMap; - }; - return SimpleScriptSnapshotText; - })(); - function fromString(value) { - return new SimpleStringText(value); - } - SimpleText.fromString = fromString; - function fromScriptSnapshot(scriptSnapshot) { - return new SimpleScriptSnapshotText(scriptSnapshot); - } - SimpleText.fromScriptSnapshot = fromScriptSnapshot; - })(TypeScript.SimpleText || (TypeScript.SimpleText = {})); - var SimpleText = TypeScript.SimpleText; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (TextUtilities) { - function parseLineStarts(text) { - var length = text.length; - if (0 === length) { - var result = new Array(); - result.push(0); - return result; - } - var position = 0; - var index = 0; - var arrayBuilder = new Array(); - var lineNumber = 0; - while (index < length) { - var c = text.charCodeAt(index); - var lineBreakLength; - if (c > 13 /* carriageReturn */ && c <= 127) { - index++; - continue; - } - else if (c === 13 /* carriageReturn */ && index + 1 < length && text.charCodeAt(index + 1) === 10 /* lineFeed */) { - lineBreakLength = 2; - } - else if (c === 10 /* lineFeed */) { - lineBreakLength = 1; - } - else { - lineBreakLength = TextUtilities.getLengthOfLineBreak(text, index); - } - if (0 === lineBreakLength) { - index++; - } - else { - arrayBuilder.push(position); - index += lineBreakLength; - position = index; - lineNumber++; - } - } - arrayBuilder.push(position); - return arrayBuilder; - } - TextUtilities.parseLineStarts = parseLineStarts; - function getLengthOfLineBreakSlow(text, index, c) { - if (c === 13 /* carriageReturn */) { - var next = index + 1; - return (next < text.length) && 10 /* lineFeed */ === text.charCodeAt(next) ? 2 : 1; - } - else if (isAnyLineBreakCharacter(c)) { - return 1; - } - else { - return 0; - } - } - TextUtilities.getLengthOfLineBreakSlow = getLengthOfLineBreakSlow; - function getLengthOfLineBreak(text, index) { - var c = text.charCodeAt(index); - if (c > 13 /* carriageReturn */ && c <= 127) { - return 0; - } - return getLengthOfLineBreakSlow(text, index, c); - } - TextUtilities.getLengthOfLineBreak = getLengthOfLineBreak; - function isAnyLineBreakCharacter(c) { - return c === 10 /* lineFeed */ || c === 13 /* carriageReturn */ || c === 133 /* nextLine */ || c === 8232 /* lineSeparator */ || c === 8233 /* paragraphSeparator */; - } - TextUtilities.isAnyLineBreakCharacter = isAnyLineBreakCharacter; - })(TypeScript.TextUtilities || (TypeScript.TextUtilities = {})); - var TextUtilities = TypeScript.TextUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { +var ts; +(function (ts) { var TextSpan = (function () { function TextSpan(start, length) { - if (start < 0) { - TypeScript.Errors.argument("start"); - } - if (length < 0) { - TypeScript.Errors.argument("length"); - } + ts.Debug.assert(start >= 0, "start"); + ts.Debug.assert(length >= 0, "length"); this._start = start; this._length = length; } @@ -15873,7 +16422,7 @@ var TypeScript; if (overlapStart < overlapEnd) { return TextSpan.fromBounds(overlapStart, overlapEnd); } - return null; + return undefined; }; TextSpan.prototype.intersectsWithTextSpan = function (span) { return span._start <= this.end() && span.end() >= this._start; @@ -15891,24 +16440,19 @@ var TypeScript; if (intersectStart <= intersectEnd) { return TextSpan.fromBounds(intersectStart, intersectEnd); } - return null; + return undefined; }; TextSpan.fromBounds = function (start, end) { - TypeScript.Debug.assert(start >= 0); - TypeScript.Debug.assert(end - start >= 0); + ts.Debug.assert(start >= 0); + ts.Debug.assert(end - start >= 0); return new TextSpan(start, end - start); }; return TextSpan; })(); - TypeScript.TextSpan = TextSpan; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { + ts.TextSpan = TextSpan; var TextChangeRange = (function () { function TextChangeRange(span, newLength) { - if (newLength < 0) { - throw TypeScript.Errors.argumentOutOfRange("newLength"); - } + ts.Debug.assert(newLength >= 0, "newLength"); this._span = span; this._newLength = newLength; } @@ -15919,7 +16463,7 @@ var TypeScript; return this._newLength; }; TextChangeRange.prototype.newSpan = function () { - return new TypeScript.TextSpan(this.span().start(), this.newLength()); + return new TextSpan(this.span().start(), this.newLength()); }; TextChangeRange.prototype.isUnchanged = function () { return this.span().isEmpty() && this.newLength() === 0; @@ -15947,9904 +16491,41 @@ var TypeScript; oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); } - return new TextChangeRange(TypeScript.TextSpan.fromBounds(oldStartN, oldEndN), newEndN - oldStartN); + return new TextChangeRange(TextSpan.fromBounds(oldStartN, oldEndN), newEndN - oldStartN); }; - TextChangeRange.unchanged = new TextChangeRange(new TypeScript.TextSpan(0, 0), 0); + TextChangeRange.unchanged = new TextChangeRange(new TextSpan(0, 0), 0); return TextChangeRange; })(); - TypeScript.TextChangeRange = TextChangeRange; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (CharacterInfo) { - function isDecimalDigit(c) { - return c >= 48 /* _0 */ && c <= 57 /* _9 */; - } - CharacterInfo.isDecimalDigit = isDecimalDigit; - function isOctalDigit(c) { - return c >= 48 /* _0 */ && c <= 55 /* _7 */; - } - CharacterInfo.isOctalDigit = isOctalDigit; - function isHexDigit(c) { - return CharacterInfo.isDecimalDigit(c) || (c >= 65 /* A */ && c <= 70 /* F */) || (c >= 97 /* a */ && c <= 102 /* f */); - } - CharacterInfo.isHexDigit = isHexDigit; - function hexValue(c) { - return CharacterInfo.isDecimalDigit(c) ? (c - 48 /* _0 */) : (c >= 65 /* A */ && c <= 70 /* F */) ? c - 65 /* A */ + 10 : c - 97 /* a */ + 10; - } - CharacterInfo.hexValue = hexValue; - function isWhitespace(ch) { - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - return true; - } - return false; - } - CharacterInfo.isWhitespace = isWhitespace; - function isLineTerminator(ch) { - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - return true; - } - return false; - } - CharacterInfo.isLineTerminator = isLineTerminator; - })(TypeScript.CharacterInfo || (TypeScript.CharacterInfo = {})); - var CharacterInfo = TypeScript.CharacterInfo; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxConstants) { - SyntaxConstants[SyntaxConstants["None"] = 0] = "None"; - SyntaxConstants[SyntaxConstants["NodeDataComputed"] = 0x00000001] = "NodeDataComputed"; - SyntaxConstants[SyntaxConstants["NodeIncrementallyUnusableMask"] = 0x00000002] = "NodeIncrementallyUnusableMask"; - SyntaxConstants[SyntaxConstants["NodeParsedInStrictModeMask"] = 0x00000004] = "NodeParsedInStrictModeMask"; - SyntaxConstants[SyntaxConstants["NodeFullWidthShift"] = 3] = "NodeFullWidthShift"; - })(TypeScript.SyntaxConstants || (TypeScript.SyntaxConstants = {})); - var SyntaxConstants = TypeScript.SyntaxConstants; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var FormattingOptions = (function () { - function FormattingOptions(useTabs, spacesPerTab, indentSpaces, newLineCharacter) { - this.useTabs = useTabs; - this.spacesPerTab = spacesPerTab; - this.indentSpaces = indentSpaces; - this.newLineCharacter = newLineCharacter; - } - FormattingOptions.defaultOptions = new FormattingOptions(false, 4, 4, "\r\n"); - return FormattingOptions; - })(); - TypeScript.FormattingOptions = FormattingOptions; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["None"] = 0] = "None"; - SyntaxKind[SyntaxKind["List"] = 1] = "List"; - SyntaxKind[SyntaxKind["SeparatedList"] = 2] = "SeparatedList"; - SyntaxKind[SyntaxKind["TriviaList"] = 3] = "TriviaList"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 4] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 5] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 6] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 7] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["SkippedTokenTrivia"] = 8] = "SkippedTokenTrivia"; - SyntaxKind[SyntaxKind["ErrorToken"] = 9] = "ErrorToken"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 10] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["IdentifierName"] = 11] = "IdentifierName"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 12] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 13] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 14] = "StringLiteral"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 15] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 16] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 17] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 18] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 19] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 20] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 21] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 22] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 23] = "ElseKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 24] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 25] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 26] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 27] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 28] = "IfKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 29] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 30] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 31] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 32] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 33] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 34] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 35] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 36] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 37] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 38] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 39] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 40] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 41] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 42] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 43] = "WithKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 44] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 45] = "ConstKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 46] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 47] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 48] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 49] = "ImportKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 50] = "SuperKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 51] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 52] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 53] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 54] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 55] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 56] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 57] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 58] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 59] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 60] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 61] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 62] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 63] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 64] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 65] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 66] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 67] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 68] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 69] = "StringKeyword"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 70] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 71] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 72] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 73] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 74] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 75] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 76] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 77] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 78] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 79] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 80] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 81] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 82] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 83] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 84] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 85] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 86] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 87] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 88] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 89] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 90] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 91] = "AsteriskToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 92] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 93] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 94] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 95] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 96] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 97] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 98] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 99] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 100] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 101] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 102] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 103] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 104] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 105] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 106] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 107] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 108] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 109] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 110] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 111] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 112] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 113] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 114] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 115] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 116] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 117] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 118] = "SlashToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 119] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["SourceUnit"] = 120] = "SourceUnit"; - SyntaxKind[SyntaxKind["QualifiedName"] = 121] = "QualifiedName"; - SyntaxKind[SyntaxKind["ObjectType"] = 122] = "ObjectType"; - SyntaxKind[SyntaxKind["FunctionType"] = 123] = "FunctionType"; - SyntaxKind[SyntaxKind["ArrayType"] = 124] = "ArrayType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 125] = "ConstructorType"; - SyntaxKind[SyntaxKind["GenericType"] = 126] = "GenericType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 127] = "TypeQuery"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 128] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 129] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 130] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 131] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 132] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 133] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 134] = "ExportAssignment"; - SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 135] = "MemberFunctionDeclaration"; - SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 136] = "MemberVariableDeclaration"; - SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 137] = "ConstructorDeclaration"; - SyntaxKind[SyntaxKind["IndexMemberDeclaration"] = 138] = "IndexMemberDeclaration"; - SyntaxKind[SyntaxKind["GetAccessor"] = 139] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 140] = "SetAccessor"; - SyntaxKind[SyntaxKind["PropertySignature"] = 141] = "PropertySignature"; - SyntaxKind[SyntaxKind["CallSignature"] = 142] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 143] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 144] = "IndexSignature"; - SyntaxKind[SyntaxKind["MethodSignature"] = 145] = "MethodSignature"; - SyntaxKind[SyntaxKind["Block"] = 146] = "Block"; - SyntaxKind[SyntaxKind["IfStatement"] = 147] = "IfStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 148] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 149] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 150] = "ReturnStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 151] = "SwitchStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 152] = "BreakStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 153] = "ContinueStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 154] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 155] = "ForInStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 156] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 157] = "ThrowStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 158] = "WhileStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 159] = "TryStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 160] = "LabeledStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 161] = "DoStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 162] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 163] = "WithStatement"; - SyntaxKind[SyntaxKind["PlusExpression"] = 164] = "PlusExpression"; - SyntaxKind[SyntaxKind["NegateExpression"] = 165] = "NegateExpression"; - SyntaxKind[SyntaxKind["BitwiseNotExpression"] = 166] = "BitwiseNotExpression"; - SyntaxKind[SyntaxKind["LogicalNotExpression"] = 167] = "LogicalNotExpression"; - SyntaxKind[SyntaxKind["PreIncrementExpression"] = 168] = "PreIncrementExpression"; - SyntaxKind[SyntaxKind["PreDecrementExpression"] = 169] = "PreDecrementExpression"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 170] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 171] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 172] = "VoidExpression"; - SyntaxKind[SyntaxKind["CommaExpression"] = 173] = "CommaExpression"; - SyntaxKind[SyntaxKind["AssignmentExpression"] = 174] = "AssignmentExpression"; - SyntaxKind[SyntaxKind["AddAssignmentExpression"] = 175] = "AddAssignmentExpression"; - SyntaxKind[SyntaxKind["SubtractAssignmentExpression"] = 176] = "SubtractAssignmentExpression"; - SyntaxKind[SyntaxKind["MultiplyAssignmentExpression"] = 177] = "MultiplyAssignmentExpression"; - SyntaxKind[SyntaxKind["DivideAssignmentExpression"] = 178] = "DivideAssignmentExpression"; - SyntaxKind[SyntaxKind["ModuloAssignmentExpression"] = 179] = "ModuloAssignmentExpression"; - SyntaxKind[SyntaxKind["AndAssignmentExpression"] = 180] = "AndAssignmentExpression"; - SyntaxKind[SyntaxKind["ExclusiveOrAssignmentExpression"] = 181] = "ExclusiveOrAssignmentExpression"; - SyntaxKind[SyntaxKind["OrAssignmentExpression"] = 182] = "OrAssignmentExpression"; - SyntaxKind[SyntaxKind["LeftShiftAssignmentExpression"] = 183] = "LeftShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftAssignmentExpression"] = 184] = "SignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftAssignmentExpression"] = 185] = "UnsignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 186] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["LogicalOrExpression"] = 187] = "LogicalOrExpression"; - SyntaxKind[SyntaxKind["LogicalAndExpression"] = 188] = "LogicalAndExpression"; - SyntaxKind[SyntaxKind["BitwiseOrExpression"] = 189] = "BitwiseOrExpression"; - SyntaxKind[SyntaxKind["BitwiseExclusiveOrExpression"] = 190] = "BitwiseExclusiveOrExpression"; - SyntaxKind[SyntaxKind["BitwiseAndExpression"] = 191] = "BitwiseAndExpression"; - SyntaxKind[SyntaxKind["EqualsWithTypeConversionExpression"] = 192] = "EqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["NotEqualsWithTypeConversionExpression"] = 193] = "NotEqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["EqualsExpression"] = 194] = "EqualsExpression"; - SyntaxKind[SyntaxKind["NotEqualsExpression"] = 195] = "NotEqualsExpression"; - SyntaxKind[SyntaxKind["LessThanExpression"] = 196] = "LessThanExpression"; - SyntaxKind[SyntaxKind["GreaterThanExpression"] = 197] = "GreaterThanExpression"; - SyntaxKind[SyntaxKind["LessThanOrEqualExpression"] = 198] = "LessThanOrEqualExpression"; - SyntaxKind[SyntaxKind["GreaterThanOrEqualExpression"] = 199] = "GreaterThanOrEqualExpression"; - SyntaxKind[SyntaxKind["InstanceOfExpression"] = 200] = "InstanceOfExpression"; - SyntaxKind[SyntaxKind["InExpression"] = 201] = "InExpression"; - SyntaxKind[SyntaxKind["LeftShiftExpression"] = 202] = "LeftShiftExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftExpression"] = 203] = "SignedRightShiftExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftExpression"] = 204] = "UnsignedRightShiftExpression"; - SyntaxKind[SyntaxKind["MultiplyExpression"] = 205] = "MultiplyExpression"; - SyntaxKind[SyntaxKind["DivideExpression"] = 206] = "DivideExpression"; - SyntaxKind[SyntaxKind["ModuloExpression"] = 207] = "ModuloExpression"; - SyntaxKind[SyntaxKind["AddExpression"] = 208] = "AddExpression"; - SyntaxKind[SyntaxKind["SubtractExpression"] = 209] = "SubtractExpression"; - SyntaxKind[SyntaxKind["PostIncrementExpression"] = 210] = "PostIncrementExpression"; - SyntaxKind[SyntaxKind["PostDecrementExpression"] = 211] = "PostDecrementExpression"; - SyntaxKind[SyntaxKind["MemberAccessExpression"] = 212] = "MemberAccessExpression"; - SyntaxKind[SyntaxKind["InvocationExpression"] = 213] = "InvocationExpression"; - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 214] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 215] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectCreationExpression"] = 216] = "ObjectCreationExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 217] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["ParenthesizedArrowFunctionExpression"] = 218] = "ParenthesizedArrowFunctionExpression"; - SyntaxKind[SyntaxKind["SimpleArrowFunctionExpression"] = 219] = "SimpleArrowFunctionExpression"; - SyntaxKind[SyntaxKind["CastExpression"] = 220] = "CastExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 221] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 222] = "FunctionExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 223] = "OmittedExpression"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 224] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarator"] = 225] = "VariableDeclarator"; - SyntaxKind[SyntaxKind["ArgumentList"] = 226] = "ArgumentList"; - SyntaxKind[SyntaxKind["ParameterList"] = 227] = "ParameterList"; - SyntaxKind[SyntaxKind["TypeArgumentList"] = 228] = "TypeArgumentList"; - SyntaxKind[SyntaxKind["TypeParameterList"] = 229] = "TypeParameterList"; - SyntaxKind[SyntaxKind["ExtendsHeritageClause"] = 230] = "ExtendsHeritageClause"; - SyntaxKind[SyntaxKind["ImplementsHeritageClause"] = 231] = "ImplementsHeritageClause"; - SyntaxKind[SyntaxKind["EqualsValueClause"] = 232] = "EqualsValueClause"; - SyntaxKind[SyntaxKind["CaseSwitchClause"] = 233] = "CaseSwitchClause"; - SyntaxKind[SyntaxKind["DefaultSwitchClause"] = 234] = "DefaultSwitchClause"; - SyntaxKind[SyntaxKind["ElseClause"] = 235] = "ElseClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 236] = "CatchClause"; - SyntaxKind[SyntaxKind["FinallyClause"] = 237] = "FinallyClause"; - SyntaxKind[SyntaxKind["TypeParameter"] = 238] = "TypeParameter"; - SyntaxKind[SyntaxKind["Constraint"] = 239] = "Constraint"; - SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 240] = "SimplePropertyAssignment"; - SyntaxKind[SyntaxKind["FunctionPropertyAssignment"] = 241] = "FunctionPropertyAssignment"; - SyntaxKind[SyntaxKind["Parameter"] = 242] = "Parameter"; - SyntaxKind[SyntaxKind["EnumElement"] = 243] = "EnumElement"; - SyntaxKind[SyntaxKind["TypeAnnotation"] = 244] = "TypeAnnotation"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 245] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 246] = "ModuleNameModuleReference"; - SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword"; - SyntaxKind[SyntaxKind["LastStandardKeyword"] = SyntaxKind.WithKeyword] = "LastStandardKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedKeyword"] = SyntaxKind.ClassKeyword] = "FirstFutureReservedKeyword"; - SyntaxKind[SyntaxKind["LastFutureReservedKeyword"] = SyntaxKind.SuperKeyword] = "LastFutureReservedKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedStrictKeyword"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedStrictKeyword"; - SyntaxKind[SyntaxKind["LastFutureReservedStrictKeyword"] = SyntaxKind.YieldKeyword] = "LastFutureReservedStrictKeyword"; - SyntaxKind[SyntaxKind["FirstTypeScriptKeyword"] = SyntaxKind.AnyKeyword] = "FirstTypeScriptKeyword"; - SyntaxKind[SyntaxKind["LastTypeScriptKeyword"] = SyntaxKind.StringKeyword] = "LastTypeScriptKeyword"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.FirstStandardKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.LastTypeScriptKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.ErrorToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.SlashEqualsToken] = "LastToken"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.SlashEqualsToken] = "LastPunctuation"; - SyntaxKind[SyntaxKind["FirstFixedWidth"] = SyntaxKind.FirstKeyword] = "FirstFixedWidth"; - SyntaxKind[SyntaxKind["LastFixedWidth"] = SyntaxKind.LastPunctuation] = "LastFixedWidth"; - SyntaxKind[SyntaxKind["FirstTrivia"] = SyntaxKind.WhitespaceTrivia] = "FirstTrivia"; - SyntaxKind[SyntaxKind["LastTrivia"] = SyntaxKind.SkippedTokenTrivia] = "LastTrivia"; - SyntaxKind[SyntaxKind["FirstNode"] = SyntaxKind.SourceUnit] = "FirstNode"; - SyntaxKind[SyntaxKind["LastNode"] = SyntaxKind.ModuleNameModuleReference] = "LastNode"; - })(TypeScript.SyntaxKind || (TypeScript.SyntaxKind = {})); - var SyntaxKind = TypeScript.SyntaxKind; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxFacts) { - var textToKeywordKind = { - "any": 60 /* AnyKeyword */, - "boolean": 61 /* BooleanKeyword */, - "break": 15 /* BreakKeyword */, - "case": 16 /* CaseKeyword */, - "catch": 17 /* CatchKeyword */, - "class": 44 /* ClassKeyword */, - "continue": 18 /* ContinueKeyword */, - "const": 45 /* ConstKeyword */, - "constructor": 62 /* ConstructorKeyword */, - "debugger": 19 /* DebuggerKeyword */, - "declare": 63 /* DeclareKeyword */, - "default": 20 /* DefaultKeyword */, - "delete": 21 /* DeleteKeyword */, - "do": 22 /* DoKeyword */, - "else": 23 /* ElseKeyword */, - "enum": 46 /* EnumKeyword */, - "export": 47 /* ExportKeyword */, - "extends": 48 /* ExtendsKeyword */, - "false": 24 /* FalseKeyword */, - "finally": 25 /* FinallyKeyword */, - "for": 26 /* ForKeyword */, - "function": 27 /* FunctionKeyword */, - "get": 64 /* GetKeyword */, - "if": 28 /* IfKeyword */, - "implements": 51 /* ImplementsKeyword */, - "import": 49 /* ImportKeyword */, - "in": 29 /* InKeyword */, - "instanceof": 30 /* InstanceOfKeyword */, - "interface": 52 /* InterfaceKeyword */, - "let": 53 /* LetKeyword */, - "module": 65 /* ModuleKeyword */, - "new": 31 /* NewKeyword */, - "null": 32 /* NullKeyword */, - "number": 67 /* NumberKeyword */, - "package": 54 /* PackageKeyword */, - "private": 55 /* PrivateKeyword */, - "protected": 56 /* ProtectedKeyword */, - "public": 57 /* PublicKeyword */, - "require": 66 /* RequireKeyword */, - "return": 33 /* ReturnKeyword */, - "set": 68 /* SetKeyword */, - "static": 58 /* StaticKeyword */, - "string": 69 /* StringKeyword */, - "super": 50 /* SuperKeyword */, - "switch": 34 /* SwitchKeyword */, - "this": 35 /* ThisKeyword */, - "throw": 36 /* ThrowKeyword */, - "true": 37 /* TrueKeyword */, - "try": 38 /* TryKeyword */, - "typeof": 39 /* TypeOfKeyword */, - "var": 40 /* VarKeyword */, - "void": 41 /* VoidKeyword */, - "while": 42 /* WhileKeyword */, - "with": 43 /* WithKeyword */, - "yield": 59 /* YieldKeyword */, - "{": 70 /* OpenBraceToken */, - "}": 71 /* CloseBraceToken */, - "(": 72 /* OpenParenToken */, - ")": 73 /* CloseParenToken */, - "[": 74 /* OpenBracketToken */, - "]": 75 /* CloseBracketToken */, - ".": 76 /* DotToken */, - "...": 77 /* DotDotDotToken */, - ";": 78 /* SemicolonToken */, - ",": 79 /* CommaToken */, - "<": 80 /* LessThanToken */, - ">": 81 /* GreaterThanToken */, - "<=": 82 /* LessThanEqualsToken */, - ">=": 83 /* GreaterThanEqualsToken */, - "==": 84 /* EqualsEqualsToken */, - "=>": 85 /* EqualsGreaterThanToken */, - "!=": 86 /* ExclamationEqualsToken */, - "===": 87 /* EqualsEqualsEqualsToken */, - "!==": 88 /* ExclamationEqualsEqualsToken */, - "+": 89 /* PlusToken */, - "-": 90 /* MinusToken */, - "*": 91 /* AsteriskToken */, - "%": 92 /* PercentToken */, - "++": 93 /* PlusPlusToken */, - "--": 94 /* MinusMinusToken */, - "<<": 95 /* LessThanLessThanToken */, - ">>": 96 /* GreaterThanGreaterThanToken */, - ">>>": 97 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 98 /* AmpersandToken */, - "|": 99 /* BarToken */, - "^": 100 /* CaretToken */, - "!": 101 /* ExclamationToken */, - "~": 102 /* TildeToken */, - "&&": 103 /* AmpersandAmpersandToken */, - "||": 104 /* BarBarToken */, - "?": 105 /* QuestionToken */, - ":": 106 /* ColonToken */, - "=": 107 /* EqualsToken */, - "+=": 108 /* PlusEqualsToken */, - "-=": 109 /* MinusEqualsToken */, - "*=": 110 /* AsteriskEqualsToken */, - "%=": 111 /* PercentEqualsToken */, - "<<=": 112 /* LessThanLessThanEqualsToken */, - ">>=": 113 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 115 /* AmpersandEqualsToken */, - "|=": 116 /* BarEqualsToken */, - "^=": 117 /* CaretEqualsToken */, - "/": 118 /* SlashToken */, - "/=": 119 /* SlashEqualsToken */ - }; - var kindToText = new Array(); - for (var name in textToKeywordKind) { - if (textToKeywordKind.hasOwnProperty(name)) { - kindToText[textToKeywordKind[name]] = name; - } - } - kindToText[62 /* ConstructorKeyword */] = "constructor"; - function getTokenKind(text) { - if (textToKeywordKind.hasOwnProperty(text)) { - return textToKeywordKind[text]; - } - return 0 /* None */; - } - SyntaxFacts.getTokenKind = getTokenKind; - function getText(kind) { - var result = kindToText[kind]; - return result !== undefined ? result : null; - } - SyntaxFacts.getText = getText; - function isAnyKeyword(kind) { - return kind >= TypeScript.SyntaxKind.FirstKeyword && kind <= TypeScript.SyntaxKind.LastKeyword; - } - SyntaxFacts.isAnyKeyword = isAnyKeyword; - function isAnyPunctuation(kind) { - return kind >= TypeScript.SyntaxKind.FirstPunctuation && kind <= TypeScript.SyntaxKind.LastPunctuation; - } - SyntaxFacts.isAnyPunctuation = isAnyPunctuation; - function isPrefixUnaryExpressionOperatorToken(tokenKind) { - return getPrefixUnaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; - } - SyntaxFacts.isPrefixUnaryExpressionOperatorToken = isPrefixUnaryExpressionOperatorToken; - function isBinaryExpressionOperatorToken(tokenKind) { - return getBinaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; - } - SyntaxFacts.isBinaryExpressionOperatorToken = isBinaryExpressionOperatorToken; - function getPrefixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 89 /* PlusToken */: - return 164 /* PlusExpression */; - case 90 /* MinusToken */: - return 165 /* NegateExpression */; - case 102 /* TildeToken */: - return 166 /* BitwiseNotExpression */; - case 101 /* ExclamationToken */: - return 167 /* LogicalNotExpression */; - case 93 /* PlusPlusToken */: - return 168 /* PreIncrementExpression */; - case 94 /* MinusMinusToken */: - return 169 /* PreDecrementExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken = getPrefixUnaryExpressionFromOperatorToken; - function getPostfixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 93 /* PlusPlusToken */: - return 210 /* PostIncrementExpression */; - case 94 /* MinusMinusToken */: - return 211 /* PostDecrementExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken = getPostfixUnaryExpressionFromOperatorToken; - function getBinaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 91 /* AsteriskToken */: - return 205 /* MultiplyExpression */; - case 118 /* SlashToken */: - return 206 /* DivideExpression */; - case 92 /* PercentToken */: - return 207 /* ModuloExpression */; - case 89 /* PlusToken */: - return 208 /* AddExpression */; - case 90 /* MinusToken */: - return 209 /* SubtractExpression */; - case 95 /* LessThanLessThanToken */: - return 202 /* LeftShiftExpression */; - case 96 /* GreaterThanGreaterThanToken */: - return 203 /* SignedRightShiftExpression */; - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - return 204 /* UnsignedRightShiftExpression */; - case 80 /* LessThanToken */: - return 196 /* LessThanExpression */; - case 81 /* GreaterThanToken */: - return 197 /* GreaterThanExpression */; - case 82 /* LessThanEqualsToken */: - return 198 /* LessThanOrEqualExpression */; - case 83 /* GreaterThanEqualsToken */: - return 199 /* GreaterThanOrEqualExpression */; - case 30 /* InstanceOfKeyword */: - return 200 /* InstanceOfExpression */; - case 29 /* InKeyword */: - return 201 /* InExpression */; - case 84 /* EqualsEqualsToken */: - return 192 /* EqualsWithTypeConversionExpression */; - case 86 /* ExclamationEqualsToken */: - return 193 /* NotEqualsWithTypeConversionExpression */; - case 87 /* EqualsEqualsEqualsToken */: - return 194 /* EqualsExpression */; - case 88 /* ExclamationEqualsEqualsToken */: - return 195 /* NotEqualsExpression */; - case 98 /* AmpersandToken */: - return 191 /* BitwiseAndExpression */; - case 100 /* CaretToken */: - return 190 /* BitwiseExclusiveOrExpression */; - case 99 /* BarToken */: - return 189 /* BitwiseOrExpression */; - case 103 /* AmpersandAmpersandToken */: - return 188 /* LogicalAndExpression */; - case 104 /* BarBarToken */: - return 187 /* LogicalOrExpression */; - case 116 /* BarEqualsToken */: - return 182 /* OrAssignmentExpression */; - case 115 /* AmpersandEqualsToken */: - return 180 /* AndAssignmentExpression */; - case 117 /* CaretEqualsToken */: - return 181 /* ExclusiveOrAssignmentExpression */; - case 112 /* LessThanLessThanEqualsToken */: - return 183 /* LeftShiftAssignmentExpression */; - case 113 /* GreaterThanGreaterThanEqualsToken */: - return 184 /* SignedRightShiftAssignmentExpression */; - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - return 185 /* UnsignedRightShiftAssignmentExpression */; - case 108 /* PlusEqualsToken */: - return 175 /* AddAssignmentExpression */; - case 109 /* MinusEqualsToken */: - return 176 /* SubtractAssignmentExpression */; - case 110 /* AsteriskEqualsToken */: - return 177 /* MultiplyAssignmentExpression */; - case 119 /* SlashEqualsToken */: - return 178 /* DivideAssignmentExpression */; - case 111 /* PercentEqualsToken */: - return 179 /* ModuloAssignmentExpression */; - case 107 /* EqualsToken */: - return 174 /* AssignmentExpression */; - case 79 /* CommaToken */: - return 173 /* CommaExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getBinaryExpressionFromOperatorToken = getBinaryExpressionFromOperatorToken; - function getOperatorTokenFromBinaryExpression(tokenKind) { - switch (tokenKind) { - case 205 /* MultiplyExpression */: - return 91 /* AsteriskToken */; - case 206 /* DivideExpression */: - return 118 /* SlashToken */; - case 207 /* ModuloExpression */: - return 92 /* PercentToken */; - case 208 /* AddExpression */: - return 89 /* PlusToken */; - case 209 /* SubtractExpression */: - return 90 /* MinusToken */; - case 202 /* LeftShiftExpression */: - return 95 /* LessThanLessThanToken */; - case 203 /* SignedRightShiftExpression */: - return 96 /* GreaterThanGreaterThanToken */; - case 204 /* UnsignedRightShiftExpression */: - return 97 /* GreaterThanGreaterThanGreaterThanToken */; - case 196 /* LessThanExpression */: - return 80 /* LessThanToken */; - case 197 /* GreaterThanExpression */: - return 81 /* GreaterThanToken */; - case 198 /* LessThanOrEqualExpression */: - return 82 /* LessThanEqualsToken */; - case 199 /* GreaterThanOrEqualExpression */: - return 83 /* GreaterThanEqualsToken */; - case 200 /* InstanceOfExpression */: - return 30 /* InstanceOfKeyword */; - case 201 /* InExpression */: - return 29 /* InKeyword */; - case 192 /* EqualsWithTypeConversionExpression */: - return 84 /* EqualsEqualsToken */; - case 193 /* NotEqualsWithTypeConversionExpression */: - return 86 /* ExclamationEqualsToken */; - case 194 /* EqualsExpression */: - return 87 /* EqualsEqualsEqualsToken */; - case 195 /* NotEqualsExpression */: - return 88 /* ExclamationEqualsEqualsToken */; - case 191 /* BitwiseAndExpression */: - return 98 /* AmpersandToken */; - case 190 /* BitwiseExclusiveOrExpression */: - return 100 /* CaretToken */; - case 189 /* BitwiseOrExpression */: - return 99 /* BarToken */; - case 188 /* LogicalAndExpression */: - return 103 /* AmpersandAmpersandToken */; - case 187 /* LogicalOrExpression */: - return 104 /* BarBarToken */; - case 182 /* OrAssignmentExpression */: - return 116 /* BarEqualsToken */; - case 180 /* AndAssignmentExpression */: - return 115 /* AmpersandEqualsToken */; - case 181 /* ExclusiveOrAssignmentExpression */: - return 117 /* CaretEqualsToken */; - case 183 /* LeftShiftAssignmentExpression */: - return 112 /* LessThanLessThanEqualsToken */; - case 184 /* SignedRightShiftAssignmentExpression */: - return 113 /* GreaterThanGreaterThanEqualsToken */; - case 185 /* UnsignedRightShiftAssignmentExpression */: - return 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - case 175 /* AddAssignmentExpression */: - return 108 /* PlusEqualsToken */; - case 176 /* SubtractAssignmentExpression */: - return 109 /* MinusEqualsToken */; - case 177 /* MultiplyAssignmentExpression */: - return 110 /* AsteriskEqualsToken */; - case 178 /* DivideAssignmentExpression */: - return 119 /* SlashEqualsToken */; - case 179 /* ModuloAssignmentExpression */: - return 111 /* PercentEqualsToken */; - case 174 /* AssignmentExpression */: - return 107 /* EqualsToken */; - case 173 /* CommaExpression */: - return 79 /* CommaToken */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getOperatorTokenFromBinaryExpression = getOperatorTokenFromBinaryExpression; - function isAssignmentOperatorToken(tokenKind) { - switch (tokenKind) { - case 116 /* BarEqualsToken */: - case 115 /* AmpersandEqualsToken */: - case 117 /* CaretEqualsToken */: - case 112 /* LessThanLessThanEqualsToken */: - case 113 /* GreaterThanGreaterThanEqualsToken */: - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 108 /* PlusEqualsToken */: - case 109 /* MinusEqualsToken */: - case 110 /* AsteriskEqualsToken */: - case 119 /* SlashEqualsToken */: - case 111 /* PercentEqualsToken */: - case 107 /* EqualsToken */: - return true; - default: - return false; - } - } - SyntaxFacts.isAssignmentOperatorToken = isAssignmentOperatorToken; - function isType(kind) { - switch (kind) { - case 124 /* ArrayType */: - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - case 123 /* FunctionType */: - case 122 /* ObjectType */: - case 125 /* ConstructorType */: - case 127 /* TypeQuery */: - case 126 /* GenericType */: - case 121 /* QualifiedName */: - case 11 /* IdentifierName */: - return true; - } - return false; - } - SyntaxFacts.isType = isType; - })(TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); - var SyntaxFacts = TypeScript.SyntaxFacts; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Scanner) { - TypeScript.Debug.assert(TypeScript.SyntaxKind.LastToken <= 127); - var ScannerConstants; - (function (ScannerConstants) { - ScannerConstants[ScannerConstants["LargeTokenFullStartShift"] = 4] = "LargeTokenFullStartShift"; - ScannerConstants[ScannerConstants["LargeTokenFullWidthShift"] = 7] = "LargeTokenFullWidthShift"; - ScannerConstants[ScannerConstants["LargeTokenLeadingTriviaBitMask"] = 0x01] = "LargeTokenLeadingTriviaBitMask"; - ScannerConstants[ScannerConstants["LargeTokenLeadingCommentBitMask"] = 0x02] = "LargeTokenLeadingCommentBitMask"; - ScannerConstants[ScannerConstants["LargeTokenTrailingTriviaBitMask"] = 0x04] = "LargeTokenTrailingTriviaBitMask"; - ScannerConstants[ScannerConstants["LargeTokenTrailingCommentBitMask"] = 0x08] = "LargeTokenTrailingCommentBitMask"; - ScannerConstants[ScannerConstants["LargeTokenTriviaBitMask"] = 0x0F] = "LargeTokenTriviaBitMask"; - ScannerConstants[ScannerConstants["FixedWidthTokenFullStartShift"] = 7] = "FixedWidthTokenFullStartShift"; - ScannerConstants[ScannerConstants["FixedWidthTokenMaxFullStart"] = 0x7FFFFF] = "FixedWidthTokenMaxFullStart"; - ScannerConstants[ScannerConstants["SmallTokenFullWidthShift"] = 7] = "SmallTokenFullWidthShift"; - ScannerConstants[ScannerConstants["SmallTokenFullStartShift"] = 12] = "SmallTokenFullStartShift"; - ScannerConstants[ScannerConstants["SmallTokenMaxFullStart"] = 0x3FFFF] = "SmallTokenMaxFullStart"; - ScannerConstants[ScannerConstants["SmallTokenMaxFullWidth"] = 0x1F] = "SmallTokenMaxFullWidth"; - ScannerConstants[ScannerConstants["SmallTokenFullWidthMask"] = 0x1F] = "SmallTokenFullWidthMask"; - ScannerConstants[ScannerConstants["KindMask"] = 0x7F] = "KindMask"; - ScannerConstants[ScannerConstants["IsVariableWidthMask"] = 0x80] = "IsVariableWidthMask"; - })(ScannerConstants || (ScannerConstants = {})); - TypeScript.Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(1 << 26, 3)) === (1 << 26)); - TypeScript.Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(3 << 25, 1)) === (3 << 25)); - TypeScript.Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(10 << 23, 2)) === (10 << 23)); - function fixedWidthTokenPackData(fullStart, kind) { - return (fullStart << 7 /* FixedWidthTokenFullStartShift */) | kind; - } - function fixedWidthTokenUnpackFullStart(packedData) { - return packedData >> 7 /* FixedWidthTokenFullStartShift */; - } - function smallTokenPackData(fullStart, fullWidth, kind) { - return (fullStart << 12 /* SmallTokenFullStartShift */) | (fullWidth << 7 /* SmallTokenFullWidthShift */) | kind; - } - function smallTokenUnpackFullWidth(packedData) { - return (packedData >> 7 /* SmallTokenFullWidthShift */) & 31 /* SmallTokenFullWidthMask */; - } - function smallTokenUnpackFullStart(packedData) { - return packedData >> 12 /* SmallTokenFullStartShift */; - } - function largeTokenPackFullStartAndInfo(fullStart, triviaInfo) { - return (fullStart << 4 /* LargeTokenFullStartShift */) | triviaInfo; - } - function largeTokenUnpackFullWidth(packedFullWidthAndKind) { - return packedFullWidthAndKind >> 7 /* LargeTokenFullWidthShift */; - } - function largeTokenUnpackFullStart(packedFullStartAndInfo) { - return packedFullStartAndInfo >> 4 /* LargeTokenFullStartShift */; - } - function largeTokenUnpackHasLeadingTrivia(packed) { - return (packed & 1 /* LargeTokenLeadingTriviaBitMask */) !== 0; - } - function largeTokenUnpackHasTrailingTrivia(packed) { - return (packed & 4 /* LargeTokenTrailingTriviaBitMask */) !== 0; - } - function largeTokenUnpackHasLeadingComment(packed) { - return (packed & 2 /* LargeTokenLeadingCommentBitMask */) !== 0; - } - function largeTokenUnpackHasTrailingComment(packed) { - return (packed & 8 /* LargeTokenTrailingCommentBitMask */) !== 0; - } - function largeTokenUnpackTriviaInfo(packed) { - return packed & 15 /* LargeTokenTriviaBitMask */; - } - var isKeywordStartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, 0); - var isIdentifierStartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - var isIdentifierPartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - for (var character = 0; character < 127 /* maxAsciiCharacter */; character++) { - if ((character >= 97 /* a */ && character <= 122 /* z */) || (character >= 65 /* A */ && character <= 90 /* Z */) || character === 95 /* _ */ || character === 36 /* $ */) { - isIdentifierStartCharacter[character] = true; - isIdentifierPartCharacter[character] = true; - } - else if (character >= 48 /* _0 */ && character <= 57 /* _9 */) { - isIdentifierPartCharacter[character] = true; - } - } - for (var keywordKind = TypeScript.SyntaxKind.FirstKeyword; keywordKind <= TypeScript.SyntaxKind.LastKeyword; keywordKind++) { - var keyword = TypeScript.SyntaxFacts.getText(keywordKind); - isKeywordStartCharacter[keyword.charCodeAt(0)] = 1; - } - function isContextualToken(token) { - switch (token.kind()) { - case 12 /* RegularExpressionLiteral */: - case 96 /* GreaterThanGreaterThanToken */: - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - case 83 /* GreaterThanEqualsToken */: - case 113 /* GreaterThanGreaterThanEqualsToken */: - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - return true; - default: - return token.isKeywordConvertedToIdentifier(); - } - } - Scanner.isContextualToken = isContextualToken; - var lastTokenInfo = { leadingTriviaWidth: -1, width: -1 }; - var lastTokenInfoTokenID = -1; - var triviaScanner = createScannerInternal(1 /* ES5 */, TypeScript.SimpleText.fromString(""), function () { - }); - function fillSizeInfo(token, text) { - if (lastTokenInfoTokenID !== TypeScript.syntaxID(token)) { - triviaScanner.fillTokenInfo(token, text, lastTokenInfo); - lastTokenInfoTokenID = TypeScript.syntaxID(token); - } - } - function fullText(token, text) { - return text.substr(token.fullStart(), token.fullWidth()); - } - function leadingTrivia(token, text) { - if (!token.hasLeadingTrivia()) { - return TypeScript.Syntax.emptyTriviaList; - } - return triviaScanner.scanTrivia(token, text, false); - } - function trailingTrivia(token, text) { - if (!token.hasTrailingTrivia()) { - return TypeScript.Syntax.emptyTriviaList; - } - return triviaScanner.scanTrivia(token, text, true); - } - function leadingTriviaWidth(token, text) { - if (!token.hasLeadingTrivia()) { - return 0; - } - fillSizeInfo(token, text); - return lastTokenInfo.leadingTriviaWidth; - } - function trailingTriviaWidth(token, text) { - if (!token.hasTrailingTrivia()) { - return 0; - } - fillSizeInfo(token, text); - return token.fullWidth() - lastTokenInfo.leadingTriviaWidth - lastTokenInfo.width; - } - function tokenIsIncrementallyUnusable(token) { - return false; - } - var FixedWidthTokenWithNoTrivia = (function () { - function FixedWidthTokenWithNoTrivia(_packedData) { - this._packedData = _packedData; - } - FixedWidthTokenWithNoTrivia.prototype.setFullStart = function (fullStart) { - this._packedData = fixedWidthTokenPackData(fullStart, this.kind()); - }; - FixedWidthTokenWithNoTrivia.prototype.isIncrementallyUnusable = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.isKeywordConvertedToIdentifier = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.fullText = function () { - return TypeScript.SyntaxFacts.getText(this.kind()); - }; - FixedWidthTokenWithNoTrivia.prototype.text = function () { - return this.fullText(); - }; - FixedWidthTokenWithNoTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - FixedWidthTokenWithNoTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - FixedWidthTokenWithNoTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.kind = function () { - return this._packedData & 127 /* KindMask */; - }; - FixedWidthTokenWithNoTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - FixedWidthTokenWithNoTrivia.prototype.fullStart = function () { - return fixedWidthTokenUnpackFullStart(this._packedData); - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingComment = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingComment = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.clone = function () { - return new FixedWidthTokenWithNoTrivia(this._packedData); - }; - return FixedWidthTokenWithNoTrivia; - })(); - var LargeScannerToken = (function () { - function LargeScannerToken(_packedFullStartAndInfo, _packedFullWidthAndKind, cachedText) { - this._packedFullStartAndInfo = _packedFullStartAndInfo; - this._packedFullWidthAndKind = _packedFullWidthAndKind; - if (cachedText !== undefined) { - this.cachedText = cachedText; - } - } - LargeScannerToken.prototype.setFullStart = function (fullStart) { - this._packedFullStartAndInfo = largeTokenPackFullStartAndInfo(fullStart, largeTokenUnpackTriviaInfo(this._packedFullStartAndInfo)); - }; - LargeScannerToken.prototype.syntaxTreeText = function (text) { - var result = text || TypeScript.syntaxTree(this).text; - TypeScript.Debug.assert(result); - return result; - }; - LargeScannerToken.prototype.isIncrementallyUnusable = function () { - return tokenIsIncrementallyUnusable(this); - }; - LargeScannerToken.prototype.isKeywordConvertedToIdentifier = function () { - return false; - }; - LargeScannerToken.prototype.hasSkippedToken = function () { - return false; - }; - LargeScannerToken.prototype.fullText = function (text) { - return fullText(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.text = function () { - var cachedText = this.cachedText; - return cachedText !== undefined ? cachedText : TypeScript.SyntaxFacts.getText(this.kind()); - }; - LargeScannerToken.prototype.leadingTrivia = function (text) { - return leadingTrivia(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.trailingTrivia = function (text) { - return trailingTrivia(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.leadingTriviaWidth = function (text) { - return leadingTriviaWidth(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.trailingTriviaWidth = function (text) { - return trailingTriviaWidth(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.kind = function () { - return this._packedFullWidthAndKind & 127 /* KindMask */; - }; - LargeScannerToken.prototype.fullWidth = function () { - return largeTokenUnpackFullWidth(this._packedFullWidthAndKind); - }; - LargeScannerToken.prototype.fullStart = function () { - return largeTokenUnpackFullStart(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasLeadingTrivia = function () { - return largeTokenUnpackHasLeadingTrivia(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasTrailingTrivia = function () { - return largeTokenUnpackHasTrailingTrivia(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasLeadingComment = function () { - return largeTokenUnpackHasLeadingComment(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasTrailingComment = function () { - return largeTokenUnpackHasTrailingComment(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.clone = function () { - return new LargeScannerToken(this._packedFullStartAndInfo, this._packedFullWidthAndKind, this.cachedText); - }; - return LargeScannerToken; - })(); - function createScanner(languageVersion, text, reportDiagnostic) { - var scanner = createScannerInternal(languageVersion, text, reportDiagnostic); - return { - setIndex: scanner.setIndex, - scan: scanner.scan - }; - } - Scanner.createScanner = createScanner; - function createScannerInternal(languageVersion, text, reportDiagnostic) { - var str; - var index; - var start; - var end; - function setIndex(_index) { - index = _index; - } - function reset(_text, _start, _end) { - TypeScript.Debug.assert(_start <= _text.length(), "Token's start was not within the bounds of text: " + _start + " - [0, " + _text.length() + ")"); - TypeScript.Debug.assert(_end <= _text.length(), "Token's end was not within the bounds of text: " + _end + " - [0, " + _text.length() + ")"); - if (!str || text !== _text) { - text = _text; - str = _text.substr(0, _text.length()); - } - start = _start; - end = _end; - index = _start; - } - function scan(allowContextualToken) { - var fullStart = index; - var leadingTriviaInfo = scanTriviaInfo(false); - var start = index; - var kindAndIsVariableWidth = scanSyntaxKind(allowContextualToken); - var end = index; - var trailingTriviaInfo = scanTriviaInfo(true); - var fullWidth = index - fullStart; - var kind = kindAndIsVariableWidth & 127 /* KindMask */; - var isFixedWidth = kind >= TypeScript.SyntaxKind.FirstFixedWidth && kind <= TypeScript.SyntaxKind.LastFixedWidth && ((kindAndIsVariableWidth & 128 /* IsVariableWidthMask */) === 0); - if (isFixedWidth && leadingTriviaInfo === 0 && trailingTriviaInfo === 0 && fullStart <= 8388607 /* FixedWidthTokenMaxFullStart */ && (kindAndIsVariableWidth & 128 /* IsVariableWidthMask */) === 0) { - return new FixedWidthTokenWithNoTrivia((fullStart << 7 /* FixedWidthTokenFullStartShift */) | kind); - } - else { - var packedFullStartAndTriviaInfo = (fullStart << 4 /* LargeTokenFullStartShift */) | leadingTriviaInfo | (trailingTriviaInfo << 2); - var packedFullWidthAndKind = (fullWidth << 7 /* LargeTokenFullWidthShift */) | kind; - var cachedText = isFixedWidth ? undefined : text.substr(start, end - start); - return new LargeScannerToken(packedFullStartAndTriviaInfo, packedFullWidthAndKind, cachedText); - } - } - function scanTrivia(parent, text, isTrailing) { - var tokenFullStart = parent.fullStart(); - var tokenStart = tokenFullStart + leadingTriviaWidth(parent, text); - if (isTrailing) { - reset(text, tokenStart + parent.text().length, tokenFullStart + parent.fullWidth()); - } - else { - reset(text, tokenFullStart, tokenStart); - } - var trivia = []; - while (true) { - if (index < end) { - var ch = str.charCodeAt(index); - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - trivia.push(scanWhitespaceTrivia()); - continue; - case 47 /* slash */: - var ch2 = str.charCodeAt(index + 1); - if (ch2 === 47 /* slash */) { - trivia.push(scanSingleLineCommentTrivia()); - continue; - } - if (ch2 === 42 /* asterisk */) { - trivia.push(scanMultiLineCommentTrivia()); - continue; - } - throw TypeScript.Errors.invalidOperation(); - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - trivia.push(scanLineTerminatorSequenceTrivia(ch)); - if (!isTrailing) { - continue; - } - break; - default: - throw TypeScript.Errors.invalidOperation(); - } - } - var triviaList = TypeScript.Syntax.triviaList(trivia); - triviaList.parent = parent; - return triviaList; - } - } - function scanTriviaInfo(isTrailing) { - var result = 0; - var _end = end; - while (index < _end) { - var ch = str.charCodeAt(index); - switch (ch) { - case 9 /* tab */: - case 32 /* space */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - index++; - result |= 1; - continue; - case 13 /* carriageReturn */: - if ((index + 1) < end && str.charCodeAt(index + 1) === 10 /* lineFeed */) { - index++; - } - case 10 /* lineFeed */: - index++; - result |= 1; - if (isTrailing) { - return result; - } - continue; - case 47 /* slash */: - if ((index + 1) < _end) { - var ch2 = str.charCodeAt(index + 1); - if (ch2 === 47 /* slash */) { - result |= 3; - skipSingleLineCommentTrivia(); - continue; - } - if (ch2 === 42 /* asterisk */) { - result |= 3; - skipMultiLineCommentTrivia(); - continue; - } - } - return result; - default: - if (ch > 127 /* maxAsciiCharacter */ && slowScanTriviaInfo(ch)) { - result |= 1; - continue; - } - return result; - } - } - return result; - } - function slowScanTriviaInfo(ch) { - switch (ch) { - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 65279 /* byteOrderMark */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - index++; - return true; - default: - return false; - } - } - function isNewLineCharacter(ch) { - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - return true; - default: - return false; - } - } - function scanWhitespaceTrivia() { - var absoluteStartIndex = index; - while (true) { - var ch = str.charCodeAt(index); - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - index++; - continue; - } - break; - } - return createTrivia(4 /* WhitespaceTrivia */, absoluteStartIndex); - } - function createTrivia(kind, absoluteStartIndex) { - var fullWidth = index - absoluteStartIndex; - return TypeScript.Syntax.deferredTrivia(kind, text, absoluteStartIndex, fullWidth); - } - function scanSingleLineCommentTrivia() { - var absoluteStartIndex = index; - skipSingleLineCommentTrivia(); - return createTrivia(7 /* SingleLineCommentTrivia */, absoluteStartIndex); - } - function skipSingleLineCommentTrivia() { - index += 2; - while (index < end) { - if (isNewLineCharacter(str.charCodeAt(index))) { - return; - } - index++; - } - } - function scanMultiLineCommentTrivia() { - var absoluteStartIndex = index; - skipMultiLineCommentTrivia(); - return createTrivia(6 /* MultiLineCommentTrivia */, absoluteStartIndex); - } - function skipMultiLineCommentTrivia() { - index += 2; - while (true) { - if (index === end) { - reportDiagnostic(end, 0, TypeScript.DiagnosticCode.AsteriskSlash_expected, null); - return; - } - if ((index + 1) < end && str.charCodeAt(index) === 42 /* asterisk */ && str.charCodeAt(index + 1) === 47 /* slash */) { - index += 2; - return; - } - index++; - } - } - function scanLineTerminatorSequenceTrivia(ch) { - var absoluteStartIndex = index; - skipLineTerminatorSequence(ch); - return createTrivia(5 /* NewLineTrivia */, absoluteStartIndex); - } - function skipLineTerminatorSequence(ch) { - index++; - if (ch === 13 /* carriageReturn */ && str.charCodeAt(index) === 10 /* lineFeed */) { - index++; - } - } - function scanSyntaxKind(allowContextualToken) { - if (index >= end) { - return 10 /* EndOfFileToken */; - } - var character = str.charCodeAt(index); - index++; - switch (character) { - case 33 /* exclamation */: - return scanExclamationToken(); - case 34 /* doubleQuote */: - return scanStringLiteral(character); - case 37 /* percent */: - return scanPercentToken(); - case 38 /* ampersand */: - return scanAmpersandToken(); - case 39 /* singleQuote */: - return scanStringLiteral(character); - case 40 /* openParen */: - return 72 /* OpenParenToken */; - case 41 /* closeParen */: - return 73 /* CloseParenToken */; - case 42 /* asterisk */: - return scanAsteriskToken(); - case 43 /* plus */: - return scanPlusToken(); - case 44 /* comma */: - return 79 /* CommaToken */; - case 45 /* minus */: - return scanMinusToken(); - case 46 /* dot */: - return scanDotToken(); - case 47 /* slash */: - return scanSlashToken(allowContextualToken); - case 48 /* _0 */: - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - return scanNumericLiteral(character); - case 58 /* colon */: - return 106 /* ColonToken */; - case 59 /* semicolon */: - return 78 /* SemicolonToken */; - case 60 /* lessThan */: - return scanLessThanToken(); - case 61 /* equals */: - return scanEqualsToken(); - case 62 /* greaterThan */: - return scanGreaterThanToken(allowContextualToken); - case 63 /* question */: - return 105 /* QuestionToken */; - case 91 /* openBracket */: - return 74 /* OpenBracketToken */; - case 93 /* closeBracket */: - return 75 /* CloseBracketToken */; - case 94 /* caret */: - return scanCaretToken(); - case 123 /* openBrace */: - return 70 /* OpenBraceToken */; - case 124 /* bar */: - return scanBarToken(); - case 125 /* closeBrace */: - return 71 /* CloseBraceToken */; - case 126 /* tilde */: - return 102 /* TildeToken */; - } - if (isIdentifierStartCharacter[character]) { - var result = tryFastScanIdentifierOrKeyword(character); - if (result !== 0 /* None */) { - return result; - } - } - index--; - if (isIdentifierStart(peekCharOrUnicodeEscape())) { - return slowScanIdentifierOrKeyword(); - } - var text = String.fromCharCode(character); - var messageText = getErrorMessageText(text); - reportDiagnostic(index, 1, TypeScript.DiagnosticCode.Unexpected_character_0, [messageText]); - index++; - return 9 /* ErrorToken */; - } - function isIdentifierStart(interpretedChar) { - if (isIdentifierStartCharacter[interpretedChar]) { - return true; - } - return interpretedChar > 127 /* maxAsciiCharacter */ && TypeScript.Unicode.isIdentifierStart(interpretedChar, languageVersion); - } - function isIdentifierPart(interpretedChar) { - if (isIdentifierPartCharacter[interpretedChar]) { - return true; - } - return interpretedChar > 127 /* maxAsciiCharacter */ && TypeScript.Unicode.isIdentifierPart(interpretedChar, languageVersion); - } - function tryFastScanIdentifierOrKeyword(firstCharacter) { - var startIndex = index; - var character = firstCharacter; - while (index < end) { - character = str.charCodeAt(index); - if (!isIdentifierPartCharacter[character]) { - break; - } - index++; - } - if (index < end && (character === 92 /* backslash */ || character > 127 /* maxAsciiCharacter */)) { - index = startIndex; - return 0 /* None */; - } - else { - if (isKeywordStartCharacter[firstCharacter]) { - return TypeScript.ScannerUtilities.identifierKind(str, startIndex - 1, index - startIndex + 1); - } - else { - return 11 /* IdentifierName */; - } - } - } - function slowScanIdentifierOrKeyword() { - var startIndex = index; - do { - scanCharOrUnicodeEscape(); - } while (isIdentifierPart(peekCharOrUnicodeEscape())); - var length = index - startIndex; - var text = str.substr(startIndex, length); - var valueText = TypeScript.massageEscapes(text); - var keywordKind = TypeScript.SyntaxFacts.getTokenKind(valueText); - if (keywordKind >= TypeScript.SyntaxKind.FirstKeyword && keywordKind <= TypeScript.SyntaxKind.LastKeyword) { - return keywordKind | 128 /* IsVariableWidthMask */; - } - return 11 /* IdentifierName */; - } - function scanNumericLiteral(ch) { - if (isHexNumericLiteral(ch)) { - scanHexNumericLiteral(); - } - else if (isOctalNumericLiteral(ch)) { - scanOctalNumericLiteral(); - } - else { - scanDecimalNumericLiteral(); - } - return 13 /* NumericLiteral */; - } - function isOctalNumericLiteral(ch) { - return ch === 48 /* _0 */ && TypeScript.CharacterInfo.isOctalDigit(str.charCodeAt(index)); - } - function scanOctalNumericLiteral() { - var start = index - 1; - while (TypeScript.CharacterInfo.isOctalDigit(str.charCodeAt(index))) { - index++; - } - if (languageVersion >= 1 /* ES5 */) { - reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, null); - } - } - function scanDecimalDigits() { - while (TypeScript.CharacterInfo.isDecimalDigit(str.charCodeAt(index))) { - index++; - } - } - function scanDecimalNumericLiteral() { - scanDecimalDigits(); - if (str.charCodeAt(index) === 46 /* dot */) { - index++; - } - scanDecimalNumericLiteralAfterDot(); - } - function scanDecimalNumericLiteralAfterDot() { - scanDecimalDigits(); - var ch = str.charCodeAt(index); - if (ch === 101 /* e */ || ch === 69 /* E */) { - var nextChar1 = str.charCodeAt(index + 1); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar1)) { - index++; - scanDecimalDigits(); - } - else if (nextChar1 === 45 /* minus */ || nextChar1 === 43 /* plus */) { - var nextChar2 = str.charCodeAt(index + 2); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar2)) { - index += 2; - scanDecimalDigits(); - } - } - } - } - function scanHexNumericLiteral() { - index++; - while (TypeScript.CharacterInfo.isHexDigit(str.charCodeAt(index))) { - index++; - } - } - function isHexNumericLiteral(ch) { - if (ch === 48 /* _0 */) { - var ch = str.charCodeAt(index); - if (ch === 120 /* x */ || ch === 88 /* X */) { - return TypeScript.CharacterInfo.isHexDigit(str.charCodeAt(index + 1)); - } - } - return false; - } - function scanLessThanToken() { - var ch0 = str.charCodeAt(index); - if (ch0 === 61 /* equals */) { - index++; - return 82 /* LessThanEqualsToken */; - } - else if (ch0 === 60 /* lessThan */) { - index++; - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 112 /* LessThanLessThanEqualsToken */; - } - else { - return 95 /* LessThanLessThanToken */; - } - } - else { - return 80 /* LessThanToken */; - } - } - function scanGreaterThanToken(allowContextualToken) { - if (allowContextualToken) { - var ch0 = str.charCodeAt(index); - if (ch0 === 62 /* greaterThan */) { - index++; - var ch1 = str.charCodeAt(index); - if (ch1 === 62 /* greaterThan */) { - index++; - var ch2 = str.charCodeAt(index); - if (ch2 === 61 /* equals */) { - index++; - return 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - } - else { - return 97 /* GreaterThanGreaterThanGreaterThanToken */; - } - } - else if (ch1 === 61 /* equals */) { - index++; - return 113 /* GreaterThanGreaterThanEqualsToken */; - } - else { - return 96 /* GreaterThanGreaterThanToken */; - } - } - else if (ch0 === 61 /* equals */) { - index++; - return 83 /* GreaterThanEqualsToken */; - } - } - return 81 /* GreaterThanToken */; - } - function scanBarToken() { - var ch = str.charCodeAt(index); - if (ch === 61 /* equals */) { - index++; - return 116 /* BarEqualsToken */; - } - else if (ch === 124 /* bar */) { - index++; - return 104 /* BarBarToken */; - } - else { - return 99 /* BarToken */; - } - } - function scanCaretToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 117 /* CaretEqualsToken */; - } - else { - return 100 /* CaretToken */; - } - } - function scanAmpersandToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - return 115 /* AmpersandEqualsToken */; - } - else if (character === 38 /* ampersand */) { - index++; - return 103 /* AmpersandAmpersandToken */; - } - else { - return 98 /* AmpersandToken */; - } - } - function scanPercentToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 111 /* PercentEqualsToken */; - } - else { - return 92 /* PercentToken */; - } - } - function scanMinusToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - return 109 /* MinusEqualsToken */; - } - else if (character === 45 /* minus */) { - index++; - return 94 /* MinusMinusToken */; - } - else { - return 90 /* MinusToken */; - } - } - function scanPlusToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - return 108 /* PlusEqualsToken */; - } - else if (character === 43 /* plus */) { - index++; - return 93 /* PlusPlusToken */; - } - else { - return 89 /* PlusToken */; - } - } - function scanAsteriskToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 110 /* AsteriskEqualsToken */; - } - else { - return 91 /* AsteriskToken */; - } - } - function scanEqualsToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 87 /* EqualsEqualsEqualsToken */; - } - else { - return 84 /* EqualsEqualsToken */; - } - } - else if (character === 62 /* greaterThan */) { - index++; - return 85 /* EqualsGreaterThanToken */; - } - else { - return 107 /* EqualsToken */; - } - } - function scanDotToken() { - var nextChar = str.charCodeAt(index); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar)) { - scanDecimalNumericLiteralAfterDot(); - return 13 /* NumericLiteral */; - } - if (nextChar === 46 /* dot */ && str.charCodeAt(index + 1) === 46 /* dot */) { - index += 2; - return 77 /* DotDotDotToken */; - } - else { - return 76 /* DotToken */; - } - } - function scanSlashToken(allowContextualToken) { - if (allowContextualToken) { - var result = tryScanRegularExpressionToken(); - if (result !== 0 /* None */) { - return result; - } - } - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 119 /* SlashEqualsToken */; - } - else { - return 118 /* SlashToken */; - } - } - function tryScanRegularExpressionToken() { - var startIndex = index; - var inEscape = false; - var inCharacterClass = false; - while (true) { - var ch = str.charCodeAt(index); - if (isNaN(ch) || isNewLineCharacter(ch)) { - index = startIndex; - return 0 /* None */; - } - index++; - if (inEscape) { - inEscape = false; - continue; - } - switch (ch) { - case 92 /* backslash */: - inEscape = true; - continue; - case 91 /* openBracket */: - inCharacterClass = true; - continue; - case 93 /* closeBracket */: - inCharacterClass = false; - continue; - case 47 /* slash */: - if (inCharacterClass) { - continue; - } - break; - default: - continue; - } - break; - } - while (isIdentifierPartCharacter[str.charCodeAt(index)]) { - index++; - } - return 12 /* RegularExpressionLiteral */; - } - function scanExclamationToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 88 /* ExclamationEqualsEqualsToken */; - } - else { - return 86 /* ExclamationEqualsToken */; - } - } - else { - return 101 /* ExclamationToken */; - } - } - function getErrorMessageText(text) { - if (text === "\\") { - return '"\\"'; - } - return JSON.stringify(text); - } - function skipEscapeSequence() { - var rewindPoint = index; - index++; - var ch = str.charCodeAt(index); - if (isNaN(ch)) { - return; - } - index++; - switch (ch) { - case 120 /* x */: - case 117 /* u */: - index = rewindPoint; - var value = scanUnicodeOrHexEscape(true); - break; - case 13 /* carriageReturn */: - if (str.charCodeAt(index) === 10 /* lineFeed */) { - index++; - } - break; - default: - break; - } - } - function scanStringLiteral(quoteCharacter) { - while (true) { - var ch = str.charCodeAt(index); - if (ch === 92 /* backslash */) { - skipEscapeSequence(); - } - else if (ch === quoteCharacter) { - index++; - break; - } - else if (isNaN(ch) || isNewLineCharacter(ch)) { - reportDiagnostic(Math.min(index, end), 1, TypeScript.DiagnosticCode.Missing_close_quote_character, null); - break; - } - else { - index++; - } - } - return 14 /* StringLiteral */; - } - function isUnicodeEscape(character) { - return character === 92 /* backslash */ && str.charCodeAt(index + 1) === 117 /* u */; - } - function peekCharOrUnicodeEscape() { - var character = str.charCodeAt(index); - if (isUnicodeEscape(character)) { - return peekUnicodeOrHexEscape(); - } - else { - return character; - } - } - function peekUnicodeOrHexEscape() { - var startIndex = index; - var ch = scanUnicodeOrHexEscape(false); - index = startIndex; - return ch; - } - function scanCharOrUnicodeEscape() { - if (str.charCodeAt(index) === 92 /* backslash */ && str.charCodeAt(index + 1) === 117 /* u */) { - scanUnicodeOrHexEscape(true); - } - else { - index++; - } - } - function scanUnicodeOrHexEscape(report) { - var start = index; - var character = str.charCodeAt(index); - index++; - character = str.charCodeAt(index); - var intChar = 0; - index++; - var count = character === 117 /* u */ ? 4 : 2; - for (var i = 0; i < count; i++) { - var ch2 = str.charCodeAt(index); - if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { - if (report) { - reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Unrecognized_escape_sequence, null); - } - break; - } - intChar = (intChar << 4) + TypeScript.CharacterInfo.hexValue(ch2); - index++; - } - return intChar; - } - function fillTokenInfo(token, text, tokenInfo) { - var fullStart = token.fullStart(); - var fullEnd = fullStart + token.fullWidth(); - reset(text, fullStart, fullEnd); - scanTriviaInfo(false); - var start = index; - scanSyntaxKind(isContextualToken(token)); - var end = index; - tokenInfo.leadingTriviaWidth = start - fullStart; - tokenInfo.width = end - start; - } - reset(text, 0, text.length()); - return { - setIndex: setIndex, - scan: scan, - fillTokenInfo: fillTokenInfo, - scanTrivia: scanTrivia - }; - } - function isValidIdentifier(text, languageVersion) { - var hadError = false; - var scanner = createScanner(languageVersion, text, function () { return hadError = true; }); - var token = scanner.scan(false); - return !hadError && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token) && TypeScript.width(token) === text.length(); - } - Scanner.isValidIdentifier = isValidIdentifier; - function createParserSource(fileName, text, languageVersion) { - var _absolutePosition = 0; - var _tokenDiagnostics = []; - var rewindPointPool = []; - var rewindPointPoolCount = 0; - var lastDiagnostic = null; - var reportDiagnostic = function (position, fullWidth, diagnosticKey, args) { - lastDiagnostic = new TypeScript.Diagnostic(fileName, text.lineMap(), position, fullWidth, diagnosticKey, args); - }; - var slidingWindow = new TypeScript.SlidingWindow(fetchNextItem, TypeScript.ArrayUtilities.createArray(1024, null), null); - var scanner = createScanner(languageVersion, text, reportDiagnostic); - function release() { - slidingWindow = null; - scanner = null; - _tokenDiagnostics = []; - rewindPointPool = []; - lastDiagnostic = null; - reportDiagnostic = null; - } - function currentNode() { - return null; - } - function consumeNode(node) { - throw TypeScript.Errors.invalidOperation(); - } - function absolutePosition() { - return _absolutePosition; - } - function tokenDiagnostics() { - return _tokenDiagnostics; - } - function getOrCreateRewindPoint() { - if (rewindPointPoolCount === 0) { - return {}; - } - rewindPointPoolCount--; - var result = rewindPointPool[rewindPointPoolCount]; - rewindPointPool[rewindPointPoolCount] = null; - return result; - } - function getRewindPoint() { - var slidingWindowIndex = slidingWindow.getAndPinAbsoluteIndex(); - var rewindPoint = getOrCreateRewindPoint(); - rewindPoint.slidingWindowIndex = slidingWindowIndex; - rewindPoint.absolutePosition = _absolutePosition; - return rewindPoint; - } - function rewind(rewindPoint) { - slidingWindow.rewindToPinnedIndex(rewindPoint.slidingWindowIndex); - _absolutePosition = rewindPoint.absolutePosition; - } - function releaseRewindPoint(rewindPoint) { - slidingWindow.releaseAndUnpinAbsoluteIndex(rewindPoint.absoluteIndex); - rewindPointPool[rewindPointPoolCount] = rewindPoint; - rewindPointPoolCount++; - } - function fetchNextItem(allowContextualToken) { - var token = scanner.scan(allowContextualToken); - if (lastDiagnostic === null) { - return token; - } - _tokenDiagnostics.push(lastDiagnostic); - lastDiagnostic = null; - return TypeScript.Syntax.realizeToken(token, text); - } - function peekToken(n) { - return slidingWindow.peekItemN(n); - } - function consumeToken(token) { - _absolutePosition += token.fullWidth(); - slidingWindow.moveToNextItem(); - } - function currentToken() { - return slidingWindow.currentItem(false); - } - function removeDiagnosticsOnOrAfterPosition(position) { - var tokenDiagnosticsLength = _tokenDiagnostics.length; - while (tokenDiagnosticsLength > 0) { - var diagnostic = _tokenDiagnostics[tokenDiagnosticsLength - 1]; - if (diagnostic.start() >= position) { - tokenDiagnosticsLength--; - } - else { - break; - } - } - _tokenDiagnostics.length = tokenDiagnosticsLength; - } - function resetToPosition(absolutePosition) { - TypeScript.Debug.assert(absolutePosition <= text.length(), "Trying to set the position outside the bounds of the text!"); - _absolutePosition = absolutePosition; - removeDiagnosticsOnOrAfterPosition(absolutePosition); - slidingWindow.disgardAllItemsFromCurrentIndexOnwards(); - scanner.setIndex(absolutePosition); - } - function currentContextualToken() { - resetToPosition(_absolutePosition); - var token = slidingWindow.currentItem(true); - return token; - } - return { - text: text, - fileName: fileName, - languageVersion: languageVersion, - currentNode: currentNode, - currentToken: currentToken, - currentContextualToken: currentContextualToken, - peekToken: peekToken, - consumeNode: consumeNode, - consumeToken: consumeToken, - getRewindPoint: getRewindPoint, - rewind: rewind, - releaseRewindPoint: releaseRewindPoint, - tokenDiagnostics: tokenDiagnostics, - release: release, - absolutePosition: absolutePosition, - resetToPosition: resetToPosition - }; - } - Scanner.createParserSource = createParserSource; - })(TypeScript.Scanner || (TypeScript.Scanner = {})); - var Scanner = TypeScript.Scanner; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ScannerUtilities = (function () { - function ScannerUtilities() { - } - ScannerUtilities.identifierKind = function (str, start, length) { - switch (length) { - case 2: - switch (str.charCodeAt(start)) { - case 100 /* d */: - return (str.charCodeAt(start + 1) === 111 /* o */) ? 22 /* DoKeyword */ : 11 /* IdentifierName */; - case 105 /* i */: - switch (str.charCodeAt(start + 1)) { - case 102 /* f */: - return 28 /* IfKeyword */; - case 110 /* n */: - return 29 /* InKeyword */; - default: - return 11 /* IdentifierName */; - } - default: - return 11 /* IdentifierName */; - } - case 3: - switch (str.charCodeAt(start)) { - case 97 /* a */: - return (str.charCodeAt(start + 1) === 110 /* n */ && str.charCodeAt(start + 2) === 121 /* y */) ? 60 /* AnyKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 114 /* r */) ? 26 /* ForKeyword */ : 11 /* IdentifierName */; - case 103 /* g */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 64 /* GetKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 53 /* LetKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 119 /* w */) ? 31 /* NewKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 68 /* SetKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 121 /* y */) ? 38 /* TryKeyword */ : 11 /* IdentifierName */; - case 118 /* v */: - return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 114 /* r */) ? 40 /* VarKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 4: - switch (str.charCodeAt(start)) { - case 99 /* c */: - return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 101 /* e */) ? 16 /* CaseKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - switch (str.charCodeAt(start + 1)) { - case 108 /* l */: - return (str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 101 /* e */) ? 23 /* ElseKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 109 /* m */) ? 46 /* EnumKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 110 /* n */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 108 /* l */) ? 32 /* NullKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - switch (str.charCodeAt(start + 1)) { - case 104 /* h */: - return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 115 /* s */) ? 35 /* ThisKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 101 /* e */) ? 37 /* TrueKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 118 /* v */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 100 /* d */) ? 41 /* VoidKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 104 /* h */) ? 43 /* WithKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 5: - switch (str.charCodeAt(start)) { - case 98 /* b */: - return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 101 /* e */ && str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 107 /* k */) ? 15 /* BreakKeyword */ : 11 /* IdentifierName */; - case 99 /* c */: - switch (str.charCodeAt(start + 1)) { - case 97 /* a */: - return (str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 99 /* c */ && str.charCodeAt(start + 4) === 104 /* h */) ? 17 /* CatchKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (str.charCodeAt(start + 2) === 97 /* a */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 115 /* s */) ? 44 /* ClassKeyword */ : 11 /* IdentifierName */; - case 111 /* o */: - return (str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */) ? 45 /* ConstKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 102 /* f */: - return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 101 /* e */) ? 24 /* FalseKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 114 /* r */) ? 50 /* SuperKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (str.charCodeAt(start + 1) === 104 /* h */ && str.charCodeAt(start + 2) === 114 /* r */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 119 /* w */) ? 36 /* ThrowKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (str.charCodeAt(start + 1) === 104 /* h */ && str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */) ? 42 /* WhileKeyword */ : 11 /* IdentifierName */; - case 121 /* y */: - return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 101 /* e */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 100 /* d */) ? 59 /* YieldKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 6: - switch (str.charCodeAt(start)) { - case 100 /* d */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 101 /* e */) ? 21 /* DeleteKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - return (str.charCodeAt(start + 1) === 120 /* x */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 116 /* t */) ? 47 /* ExportKeyword */ : 11 /* IdentifierName */; - case 105 /* i */: - return (str.charCodeAt(start + 1) === 109 /* m */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 116 /* t */) ? 49 /* ImportKeyword */ : 11 /* IdentifierName */; - case 109 /* m */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 100 /* d */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 108 /* l */ && str.charCodeAt(start + 5) === 101 /* e */) ? 65 /* ModuleKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 109 /* m */ && str.charCodeAt(start + 3) === 98 /* b */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 114 /* r */) ? 67 /* NumberKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 98 /* b */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 99 /* c */) ? 57 /* PublicKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 110 /* n */) ? 33 /* ReturnKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - switch (str.charCodeAt(start + 1)) { - case 116 /* t */: - switch (str.charCodeAt(start + 2)) { - case 97 /* a */: - return (str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 99 /* c */) ? 58 /* StaticKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 3) === 105 /* i */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 103 /* g */) ? 69 /* StringKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 119 /* w */: - return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 99 /* c */ && str.charCodeAt(start + 5) === 104 /* h */) ? 34 /* SwitchKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 116 /* t */: - return (str.charCodeAt(start + 1) === 121 /* y */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 111 /* o */ && str.charCodeAt(start + 5) === 102 /* f */) ? 39 /* TypeOfKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 7: - switch (str.charCodeAt(start)) { - case 98 /* b */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 111 /* o */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 97 /* a */ && str.charCodeAt(start + 6) === 110 /* n */) ? 61 /* BooleanKeyword */ : 11 /* IdentifierName */; - case 100 /* d */: - switch (str.charCodeAt(start + 1)) { - case 101 /* e */: - switch (str.charCodeAt(start + 2)) { - case 99 /* c */: - return (str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 101 /* e */) ? 63 /* DeclareKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 117 /* u */ && str.charCodeAt(start + 5) === 108 /* l */ && str.charCodeAt(start + 6) === 116 /* t */) ? 20 /* DefaultKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - default: - return 11 /* IdentifierName */; - } - case 101 /* e */: - return (str.charCodeAt(start + 1) === 120 /* x */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 100 /* d */ && str.charCodeAt(start + 6) === 115 /* s */) ? 48 /* ExtendsKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 108 /* l */ && str.charCodeAt(start + 5) === 108 /* l */ && str.charCodeAt(start + 6) === 121 /* y */) ? 25 /* FinallyKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - switch (str.charCodeAt(start + 1)) { - case 97 /* a */: - return (str.charCodeAt(start + 2) === 99 /* c */ && str.charCodeAt(start + 3) === 107 /* k */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 103 /* g */ && str.charCodeAt(start + 6) === 101 /* e */) ? 54 /* PackageKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 118 /* v */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 116 /* t */ && str.charCodeAt(start + 6) === 101 /* e */) ? 55 /* PrivateKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 114 /* r */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 113 /* q */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 101 /* e */) ? 66 /* RequireKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 8: - switch (str.charCodeAt(start)) { - case 99 /* c */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 110 /* n */ && str.charCodeAt(start + 6) === 117 /* u */ && str.charCodeAt(start + 7) === 101 /* e */) ? 18 /* ContinueKeyword */ : 11 /* IdentifierName */; - case 100 /* d */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 98 /* b */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 103 /* g */ && str.charCodeAt(start + 5) === 103 /* g */ && str.charCodeAt(start + 6) === 101 /* e */ && str.charCodeAt(start + 7) === 114 /* r */) ? 19 /* DebuggerKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 99 /* c */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 105 /* i */ && str.charCodeAt(start + 6) === 111 /* o */ && str.charCodeAt(start + 7) === 110 /* n */) ? 27 /* FunctionKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 9: - switch (str.charCodeAt(start)) { - case 105 /* i */: - return (str.charCodeAt(start + 1) === 110 /* n */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 102 /* f */ && str.charCodeAt(start + 6) === 97 /* a */ && str.charCodeAt(start + 7) === 99 /* c */ && str.charCodeAt(start + 8) === 101 /* e */) ? 52 /* InterfaceKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 111 /* o */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 99 /* c */ && str.charCodeAt(start + 6) === 116 /* t */ && str.charCodeAt(start + 7) === 101 /* e */ && str.charCodeAt(start + 8) === 100 /* d */) ? 56 /* ProtectedKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 10: - switch (str.charCodeAt(start)) { - case 105 /* i */: - switch (str.charCodeAt(start + 1)) { - case 109 /* m */: - return (str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 109 /* m */ && str.charCodeAt(start + 6) === 101 /* e */ && str.charCodeAt(start + 7) === 110 /* n */ && str.charCodeAt(start + 8) === 116 /* t */ && str.charCodeAt(start + 9) === 115 /* s */) ? 51 /* ImplementsKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 110 /* n */ && str.charCodeAt(start + 6) === 99 /* c */ && str.charCodeAt(start + 7) === 101 /* e */ && str.charCodeAt(start + 8) === 111 /* o */ && str.charCodeAt(start + 9) === 102 /* f */) ? 30 /* InstanceOfKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - default: - return 11 /* IdentifierName */; - } - case 11: - return (str.charCodeAt(start) === 99 /* c */ && str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 117 /* u */ && str.charCodeAt(start + 7) === 99 /* c */ && str.charCodeAt(start + 8) === 116 /* t */ && str.charCodeAt(start + 9) === 111 /* o */ && str.charCodeAt(start + 10) === 114 /* r */) ? 62 /* ConstructorKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - }; - return ScannerUtilities; - })(); - TypeScript.ScannerUtilities = ScannerUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SlidingWindow = (function () { - function SlidingWindow(fetchNextItem, window, defaultValue, sourceLength) { - if (sourceLength === void 0) { sourceLength = -1; } - this.fetchNextItem = fetchNextItem; - this.window = window; - this.defaultValue = defaultValue; - this.sourceLength = sourceLength; - this.windowCount = 0; - this.windowAbsoluteStartIndex = 0; - this.currentRelativeItemIndex = 0; - this._pinCount = 0; - this.firstPinnedAbsoluteIndex = -1; - } - SlidingWindow.prototype.addMoreItemsToWindow = function (argument) { - var sourceLength = this.sourceLength; - if (sourceLength >= 0 && this.absoluteIndex() >= sourceLength) { - return false; - } - if (this.windowCount >= this.window.length) { - this.tryShiftOrGrowWindow(); - } - var item = this.fetchNextItem(argument); - this.window[this.windowCount] = item; - this.windowCount++; - return true; - }; - SlidingWindow.prototype.tryShiftOrGrowWindow = function () { - var currentIndexIsPastWindowHalfwayPoint = this.currentRelativeItemIndex > (this.window.length >>> 1); - var isAllowedToShift = this.firstPinnedAbsoluteIndex === -1 || this.firstPinnedAbsoluteIndex > this.windowAbsoluteStartIndex; - if (currentIndexIsPastWindowHalfwayPoint && isAllowedToShift) { - var shiftStartIndex = this.firstPinnedAbsoluteIndex === -1 ? this.currentRelativeItemIndex : this.firstPinnedAbsoluteIndex - this.windowAbsoluteStartIndex; - var shiftCount = this.windowCount - shiftStartIndex; - if (shiftCount > 0) { - TypeScript.ArrayUtilities.copy(this.window, shiftStartIndex, this.window, 0, shiftCount); - } - this.windowAbsoluteStartIndex += shiftStartIndex; - this.windowCount -= shiftStartIndex; - this.currentRelativeItemIndex -= shiftStartIndex; - } - else { - TypeScript.ArrayUtilities.grow(this.window, this.window.length * 2, this.defaultValue); - } - }; - SlidingWindow.prototype.absoluteIndex = function () { - return this.windowAbsoluteStartIndex + this.currentRelativeItemIndex; - }; - SlidingWindow.prototype.isAtEndOfSource = function () { - return this.absoluteIndex() >= this.sourceLength; - }; - SlidingWindow.prototype.getAndPinAbsoluteIndex = function () { - var absoluteIndex = this.absoluteIndex(); - var pinCount = this._pinCount++; - if (pinCount === 0) { - this.firstPinnedAbsoluteIndex = absoluteIndex; - } - return absoluteIndex; - }; - SlidingWindow.prototype.releaseAndUnpinAbsoluteIndex = function (absoluteIndex) { - this._pinCount--; - if (this._pinCount === 0) { - this.firstPinnedAbsoluteIndex = -1; - } - }; - SlidingWindow.prototype.rewindToPinnedIndex = function (absoluteIndex) { - var relativeIndex = absoluteIndex - this.windowAbsoluteStartIndex; - this.currentRelativeItemIndex = relativeIndex; - }; - SlidingWindow.prototype.currentItem = function (argument) { - if (this.currentRelativeItemIndex >= this.windowCount) { - if (!this.addMoreItemsToWindow(argument)) { - return this.defaultValue; - } - } - return this.window[this.currentRelativeItemIndex]; - }; - SlidingWindow.prototype.peekItemN = function (n) { - while (this.currentRelativeItemIndex + n >= this.windowCount) { - if (!this.addMoreItemsToWindow(null)) { - return this.defaultValue; - } - } - return this.window[this.currentRelativeItemIndex + n]; - }; - SlidingWindow.prototype.moveToNextItem = function () { - this.currentRelativeItemIndex++; - }; - SlidingWindow.prototype.disgardAllItemsFromCurrentIndexOnwards = function () { - this.windowCount = this.currentRelativeItemIndex; - }; - return SlidingWindow; - })(); - TypeScript.SlidingWindow = SlidingWindow; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - Syntax._nextSyntaxID = 1; - function childIndex(parent, child) { - for (var i = 0, n = TypeScript.childCount(parent); i < n; i++) { - var current = TypeScript.childAt(parent, i); - if (current === child) { - return i; - } - } - throw TypeScript.Errors.invalidOperation(); - } - Syntax.childIndex = childIndex; - function nodeHasSkippedOrMissingTokens(node) { - for (var i = 0; i < TypeScript.childCount(node); i++) { - var child = TypeScript.childAt(node, i); - if (TypeScript.isToken(child)) { - var token = child; - if (token.hasSkippedToken() || (TypeScript.width(token) === 0 && token.kind() !== 10 /* EndOfFileToken */)) { - return true; - } - } - } - return false; - } - Syntax.nodeHasSkippedOrMissingTokens = nodeHasSkippedOrMissingTokens; - function isUnterminatedStringLiteral(token) { - if (token && token.kind() === 14 /* StringLiteral */) { - var text = token.text(); - return text.length < 2 || text.charCodeAt(text.length - 1) !== text.charCodeAt(0); - } - return false; - } - Syntax.isUnterminatedStringLiteral = isUnterminatedStringLiteral; - function isUnterminatedMultilineCommentTrivia(trivia) { - if (trivia && trivia.kind() === 6 /* MultiLineCommentTrivia */) { - var text = trivia.fullText(); - return text.length < 4 || text.substring(text.length - 2) !== "*/"; - } - return false; - } - Syntax.isUnterminatedMultilineCommentTrivia = isUnterminatedMultilineCommentTrivia; - function isEntirelyInsideCommentTrivia(trivia, fullStart, position) { - if (trivia && trivia.isComment() && position > fullStart) { - var end = fullStart + trivia.fullWidth(); - if (position < end) { - return true; - } - else if (position === end) { - return trivia.kind() === 7 /* SingleLineCommentTrivia */ || isUnterminatedMultilineCommentTrivia(trivia); - } - } - return false; - } - Syntax.isEntirelyInsideCommentTrivia = isEntirelyInsideCommentTrivia; - function isEntirelyInsideComment(sourceUnit, position) { - var positionedToken = TypeScript.findToken(sourceUnit, position); - var fullStart = positionedToken.fullStart(); - var triviaList = null; - var lastTriviaBeforeToken = null; - if (positionedToken.kind() === 10 /* EndOfFileToken */) { - if (positionedToken.hasLeadingTrivia()) { - triviaList = positionedToken.leadingTrivia(); - } - else { - positionedToken = TypeScript.previousToken(positionedToken); - if (positionedToken) { - if (positionedToken && positionedToken.hasTrailingTrivia()) { - triviaList = positionedToken.trailingTrivia(); - fullStart = TypeScript.end(positionedToken); - } - } - } - } - else { - if (position <= (fullStart + positionedToken.leadingTriviaWidth())) { - triviaList = positionedToken.leadingTrivia(); - } - else if (position >= (fullStart + TypeScript.width(positionedToken))) { - triviaList = positionedToken.trailingTrivia(); - fullStart = TypeScript.end(positionedToken); - } - } - if (triviaList) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (position <= fullStart) { - break; - } - else if (position <= fullStart + trivia.fullWidth() && trivia.isComment()) { - lastTriviaBeforeToken = trivia; - break; - } - fullStart += trivia.fullWidth(); - } - } - return lastTriviaBeforeToken && isEntirelyInsideCommentTrivia(lastTriviaBeforeToken, fullStart, position); - } - Syntax.isEntirelyInsideComment = isEntirelyInsideComment; - function isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) { - var positionedToken = TypeScript.findToken(sourceUnit, position); - if (positionedToken) { - if (positionedToken.kind() === 10 /* EndOfFileToken */) { - positionedToken = TypeScript.previousToken(positionedToken); - return positionedToken && positionedToken.trailingTriviaWidth() === 0 && isUnterminatedStringLiteral(positionedToken); - } - else if (position > TypeScript.start(positionedToken)) { - return (position < TypeScript.end(positionedToken) && (positionedToken.kind() === 14 /* StringLiteral */ || positionedToken.kind() === 12 /* RegularExpressionLiteral */)) || (position <= TypeScript.end(positionedToken) && isUnterminatedStringLiteral(positionedToken)); - } - } - return false; - } - Syntax.isEntirelyInStringOrRegularExpressionLiteral = isEntirelyInStringOrRegularExpressionLiteral; - function findSkippedTokenOnLeftInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; - var fullEnd; - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullEnd = positionedToken.fullStart() + triviaList.fullWidth(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullEnd = TypeScript.fullEnd(positionedToken); - } - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - if (trivia.isSkippedToken() && position >= fullEnd) { - return trivia.skippedToken(); - } - fullEnd -= triviaWidth; - } - } - return null; - } - function findSkippedTokenOnLeft(positionedToken, position) { - var positionInLeadingTriviaList = (position < TypeScript.start(positionedToken)); - return findSkippedTokenOnLeftInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - Syntax.findSkippedTokenOnLeft = findSkippedTokenOnLeft; - function getAncestorOfKind(positionedToken, kind) { - while (positionedToken && positionedToken.parent) { - if (positionedToken.parent.kind() === kind) { - return positionedToken.parent; - } - positionedToken = positionedToken.parent; - } - return null; - } - Syntax.getAncestorOfKind = getAncestorOfKind; - function hasAncestorOfKind(positionedToken, kind) { - return getAncestorOfKind(positionedToken, kind) !== null; - } - Syntax.hasAncestorOfKind = hasAncestorOfKind; - function isIntegerLiteral(expression) { - if (expression) { - switch (expression.kind()) { - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - expression = expression.operand; - return TypeScript.isToken(expression) && TypeScript.IntegerUtilities.isInteger(expression.text()); - case 13 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - return false; - } - Syntax.isIntegerLiteral = isIntegerLiteral; - function containingNode(element) { - var current = element.parent; - while (current !== null && !TypeScript.isNode(current)) { - current = current.parent; - } - return current; - } - Syntax.containingNode = containingNode; - function findTokenOnLeft(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var positionedToken = TypeScript.findToken(element, position, false); - var _start = TypeScript.start(positionedToken); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - if (position > _start) { - return positionedToken; - } - if (positionedToken.fullStart() === 0) { - return null; - } - return TypeScript.previousToken(positionedToken, includeSkippedTokens); - } - Syntax.findTokenOnLeft = findTokenOnLeft; - function findCompleteTokenOnLeft(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var positionedToken = TypeScript.findToken(element, position, false); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - if (TypeScript.width(positionedToken) > 0 && position >= TypeScript.end(positionedToken)) { - return positionedToken; - } - return TypeScript.previousToken(positionedToken, includeSkippedTokens); - } - Syntax.findCompleteTokenOnLeft = findCompleteTokenOnLeft; - function firstTokenInLineContainingPosition(syntaxTree, position) { - var current = TypeScript.findToken(syntaxTree.sourceUnit(), position); - while (true) { - if (isFirstTokenInLine(current, syntaxTree.lineMap())) { - break; - } - current = TypeScript.previousToken(current); - } - return current; - } - Syntax.firstTokenInLineContainingPosition = firstTokenInLineContainingPosition; - function isFirstTokenInLine(token, lineMap) { - var _previousToken = TypeScript.previousToken(token); - if (_previousToken === null) { - return true; - } - return lineMap.getLineNumberFromPosition(TypeScript.end(_previousToken)) !== lineMap.getLineNumberFromPosition(TypeScript.start(token)); - } - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function isShared(element) { - var kind = element.kind(); - return (kind === 1 /* List */ || kind === 2 /* SeparatedList */) && element.length === 0; - } - TypeScript.isShared = isShared; - function childCount(element) { - var kind = element.kind(); - if (kind === 1 /* List */) { - return element.length; - } - else if (kind === 2 /* SeparatedList */) { - return element.length + element.separators.length; - } - else if (kind >= TypeScript.SyntaxKind.FirstToken && kind <= TypeScript.SyntaxKind.LastToken) { - return 0; - } - else { - return TypeScript.nodeMetadata[kind].length; - } - } - TypeScript.childCount = childCount; - function childAt(element, index) { - var kind = element.kind(); - if (kind === 1 /* List */) { - return element[index]; - } - else if (kind === 2 /* SeparatedList */) { - return (index % 2 === 0) ? element[index / 2] : element.separators[(index - 1) / 2]; - } - else { - return element[TypeScript.nodeMetadata[element.kind()][index]]; - } - } - TypeScript.childAt = childAt; - function syntaxTree(element) { - if (element) { - TypeScript.Debug.assert(!isShared(element)); - while (element) { - if (element.kind() === 120 /* SourceUnit */) { - return element.syntaxTree; - } - element = element.parent; - } - } - return null; - } - TypeScript.syntaxTree = syntaxTree; - function parsedInStrictMode(node) { - var info = node.data; - if (info === undefined) { - return false; - } - return (info & 4 /* NodeParsedInStrictModeMask */) !== 0; - } - TypeScript.parsedInStrictMode = parsedInStrictMode; - function previousToken(token, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - if (includeSkippedTokens) { - var triviaList = token.leadingTrivia(); - if (triviaList && triviaList.hasSkippedToken()) { - var currentTriviaEndPosition = TypeScript.start(token); - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - currentTriviaEndPosition -= trivia.fullWidth(); - } - } - } - var start = token.fullStart(); - if (start === 0) { - return null; - } - return findToken(syntaxTree(token).sourceUnit(), start - 1, includeSkippedTokens); - } - TypeScript.previousToken = previousToken; - function findToken(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var endOfFileToken = tryGetEndOfFileAt(element, position); - if (endOfFileToken !== null) { - return endOfFileToken; - } - if (position < 0 || position >= fullWidth(element)) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - var positionedToken = findTokenWorker(element, position); - if (includeSkippedTokens) { - return findSkippedTokenInPositionedToken(positionedToken, position) || positionedToken; - } - return positionedToken; - } - TypeScript.findToken = findToken; - function findSkippedTokenInPositionedToken(positionedToken, position) { - var positionInLeadingTriviaList = (position < start(positionedToken)); - return findSkippedTokenInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - TypeScript.findSkippedTokenInPositionedToken = findSkippedTokenInPositionedToken; - function findSkippedTokenInLeadingTriviaList(positionedToken, position) { - return findSkippedTokenInTriviaList(positionedToken, position, true); - } - TypeScript.findSkippedTokenInLeadingTriviaList = findSkippedTokenInLeadingTriviaList; - function findSkippedTokenInTrailingTriviaList(positionedToken, position) { - return findSkippedTokenInTriviaList(positionedToken, position, false); - } - TypeScript.findSkippedTokenInTrailingTriviaList = findSkippedTokenInTrailingTriviaList; - function findSkippedTokenInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; - var fullStart; - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullStart = positionedToken.fullStart(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullStart = end(positionedToken); - } - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - if (trivia.isSkippedToken() && position >= fullStart && position <= fullStart + triviaWidth) { - return trivia.skippedToken(); - } - fullStart += triviaWidth; - } - } - return null; - } - function findTokenWorker(element, position) { - if (isToken(element)) { - TypeScript.Debug.assert(fullWidth(element) > 0); - return element; - } - if (isShared(element)) { - throw TypeScript.Errors.invalidOperation(); - } - for (var i = 0, n = childCount(element); i < n; i++) { - var child = childAt(element, i); - if (child !== null) { - var childFullWidth = fullWidth(child); - if (childFullWidth > 0) { - var childFullStart = fullStart(child); - if (position >= childFullStart) { - var childFullEnd = childFullStart + childFullWidth; - if (position < childFullEnd) { - return findTokenWorker(child, position); - } - } - } - } - } - throw TypeScript.Errors.invalidOperation(); - } - function tryGetEndOfFileAt(element, position) { - if (element.kind() === 120 /* SourceUnit */ && position === fullWidth(element)) { - var sourceUnit = element; - return sourceUnit.endOfFileToken; - } - return null; - } - function nextToken(token, text, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - if (token.kind() === 10 /* EndOfFileToken */) { - return null; - } - if (includeSkippedTokens) { - var triviaList = token.trailingTrivia(text); - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - } - } - } - return findToken(syntaxTree(token).sourceUnit(), fullEnd(token), includeSkippedTokens); - } - TypeScript.nextToken = nextToken; - function isNode(element) { - if (element !== null) { - var kind = element.kind(); - return kind >= TypeScript.SyntaxKind.FirstNode && kind <= TypeScript.SyntaxKind.LastNode; - } - return false; - } - TypeScript.isNode = isNode; - function isTokenKind(kind) { - return kind >= TypeScript.SyntaxKind.FirstToken && kind <= TypeScript.SyntaxKind.LastToken; - } - function isToken(element) { - if (element !== null) { - return isTokenKind(element.kind()); - } - return false; - } - TypeScript.isToken = isToken; - function isList(element) { - return element !== null && element.kind() === 1 /* List */; - } - TypeScript.isList = isList; - function isSeparatedList(element) { - return element !== null && element.kind() === 2 /* SeparatedList */; - } - TypeScript.isSeparatedList = isSeparatedList; - function syntaxID(element) { - if (isShared(element)) { - throw TypeScript.Errors.invalidOperation("Should not use shared syntax element as a key."); - } - var obj = element; - if (obj._syntaxID === undefined) { - obj._syntaxID = TypeScript.Syntax._nextSyntaxID++; - } - return obj._syntaxID; - } - TypeScript.syntaxID = syntaxID; - function collectTextElements(element, elements, text) { - if (element) { - if (isToken(element)) { - elements.push(element.fullText(text)); - } - else { - for (var i = 0, n = childCount(element); i < n; i++) { - collectTextElements(childAt(element, i), elements, text); - } - } - } - } - function fullText(element, text) { - if (isToken(element)) { - return element.fullText(text); - } - var elements = []; - collectTextElements(element, elements, text); - return elements.join(""); - } - TypeScript.fullText = fullText; - function leadingTriviaWidth(element, text) { - var token = firstToken(element); - return token ? token.leadingTriviaWidth(text) : 0; - } - TypeScript.leadingTriviaWidth = leadingTriviaWidth; - function trailingTriviaWidth(element, text) { - var token = lastToken(element); - return token ? token.trailingTriviaWidth(text) : 0; - } - TypeScript.trailingTriviaWidth = trailingTriviaWidth; - function firstToken(element) { - if (element) { - var kind = element.kind(); - if (isTokenKind(kind)) { - return fullWidth(element) > 0 || element.kind() === 10 /* EndOfFileToken */ ? element : null; - } - if (kind === 1 /* List */) { - var array = element; - for (var i = 0, n = array.length; i < n; i++) { - var token = firstToken(array[i]); - if (token) { - return token; - } - } - } - else if (kind === 2 /* SeparatedList */) { - var array = element; - var separators = array.separators; - for (var i = 0, n = array.length + separators.length; i < n; i++) { - var token = firstToken(i % 2 === 0 ? array[i / 2] : separators[(i - 1) / 2]); - if (token) { - return token; - } - } - } - else { - var metadata = TypeScript.nodeMetadata[kind]; - for (var i = 0, n = metadata.length; i < n; i++) { - var child = element[metadata[i]]; - var token = firstToken(child); - if (token) { - return token; - } - } - if (element.kind() === 120 /* SourceUnit */) { - return element.endOfFileToken; - } - } - } - return null; - } - TypeScript.firstToken = firstToken; - function lastToken(element) { - if (isToken(element)) { - return fullWidth(element) > 0 || element.kind() === 10 /* EndOfFileToken */ ? element : null; - } - if (element.kind() === 120 /* SourceUnit */) { - return element.endOfFileToken; - } - for (var i = childCount(element) - 1; i >= 0; i--) { - var child = childAt(element, i); - if (child !== null) { - var token = lastToken(child); - if (token) { - return token; - } - } - } - return null; - } - TypeScript.lastToken = lastToken; - function fullStart(element) { - TypeScript.Debug.assert(!isShared(element)); - var token = isToken(element) ? element : firstToken(element); - return token ? token.fullStart() : -1; - } - TypeScript.fullStart = fullStart; - function fullWidth(element) { - if (isToken(element)) { - return element.fullWidth(); - } - if (isShared(element)) { - return 0; - } - var info = data(element); - return info >>> 3 /* NodeFullWidthShift */; - } - TypeScript.fullWidth = fullWidth; - function isIncrementallyUnusable(element) { - if (isToken(element)) { - return element.isIncrementallyUnusable(); - } - if (isShared(element)) { - return false; - } - return (data(element) & 2 /* NodeIncrementallyUnusableMask */) !== 0; - } - TypeScript.isIncrementallyUnusable = isIncrementallyUnusable; - function data(element) { - TypeScript.Debug.assert(isNode(element) || isList(element) || isSeparatedList(element)); - var dataElement = element; - var info = dataElement.data; - if (info === undefined) { - info = 0; - } - if ((info & 1 /* NodeDataComputed */) === 0) { - info |= computeData(element); - dataElement.data = info; - } - return info; - } - function computeData(element) { - var slotCount = childCount(element); - var fullWidth = 0; - var isIncrementallyUnusable = slotCount === 0; - for (var i = 0, n = slotCount; i < n; i++) { - var child = childAt(element, i); - if (child) { - fullWidth += TypeScript.fullWidth(child); - isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); - } - } - return (fullWidth << 3 /* NodeFullWidthShift */) | (isIncrementallyUnusable ? 2 /* NodeIncrementallyUnusableMask */ : 0) | 1 /* NodeDataComputed */; - } - function start(element, text) { - var token = isToken(element) ? element : firstToken(element); - return token ? token.fullStart() + token.leadingTriviaWidth(text) : -1; - } - TypeScript.start = start; - function end(element, text) { - var token = isToken(element) ? element : lastToken(element); - return token ? fullEnd(token) - token.trailingTriviaWidth(text) : -1; - } - TypeScript.end = end; - function width(element, text) { - if (isToken(element)) { - return element.text().length; - } - return fullWidth(element) - leadingTriviaWidth(element, text) - trailingTriviaWidth(element, text); - } - TypeScript.width = width; - function fullEnd(element) { - return fullStart(element) + fullWidth(element); - } - TypeScript.fullEnd = fullEnd; - function existsNewLineBetweenTokens(token1, token2, text) { - if (token1 === token2) { - return false; - } - if (token1 === null || token2 === null) { - return true; - } - var lineMap = text.lineMap(); - return lineMap.getLineNumberFromPosition(end(token1, text)) !== lineMap.getLineNumberFromPosition(start(token2, text)); - } - TypeScript.existsNewLineBetweenTokens = existsNewLineBetweenTokens; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxFacts) { - function isDirectivePrologueElement(node) { - if (node.kind() === 149 /* ExpressionStatement */) { - var expressionStatement = node; - var expression = expressionStatement.expression; - if (expression.kind() === 14 /* StringLiteral */) { - return true; - } - } - return false; - } - SyntaxFacts.isDirectivePrologueElement = isDirectivePrologueElement; - function isUseStrictDirective(node) { - var expressionStatement = node; - var stringLiteral = expressionStatement.expression; - var text = stringLiteral.text(); - return text === '"use strict"' || text === "'use strict'"; - } - SyntaxFacts.isUseStrictDirective = isUseStrictDirective; - function isIdentifierNameOrAnyKeyword(token) { - var tokenKind = token.kind(); - return tokenKind === 11 /* IdentifierName */ || SyntaxFacts.isAnyKeyword(tokenKind); - } - SyntaxFacts.isIdentifierNameOrAnyKeyword = isIdentifierNameOrAnyKeyword; - })(TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); - var SyntaxFacts = TypeScript.SyntaxFacts; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var _emptyList = []; - var _emptySeparatedList = []; - var _emptySeparators = []; - _emptySeparatedList.separators = _emptySeparators; - function assertEmptyLists() { - } - Array.prototype.kind = function () { - return this.separators === undefined ? 1 /* List */ : 2 /* SeparatedList */; - }; - Array.prototype.separatorCount = function () { - assertEmptyLists(); - return this.separators.length; - }; - Array.prototype.separatorAt = function (index) { - assertEmptyLists(); - return this.separators[index]; - }; - function emptyList() { - return _emptyList; - } - Syntax.emptyList = emptyList; - function emptySeparatedList() { - return _emptySeparatedList; - } - Syntax.emptySeparatedList = emptySeparatedList; - function list(nodes) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptyList(); - } - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - return nodes; - } - Syntax.list = list; - function separatedList(nodes, separators) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptySeparatedList(); - } - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - for (var i = 0, n = separators.length; i < n; i++) { - separators[i].parent = nodes; - } - nodes.separators = separators.length === 0 ? _emptySeparators : separators; - return nodes; - } - Syntax.separatedList = separatedList; - function nonSeparatorIndexOf(list, ast) { - for (var i = 0, n = list.length; i < n; i++) { - if (list[i] === ast) { - return i; - } - } - return -1; - } - Syntax.nonSeparatorIndexOf = nonSeparatorIndexOf; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxNode = (function () { - function SyntaxNode(data) { - if (data) { - this.data = data; - } - } - SyntaxNode.prototype.kind = function () { - return this.__kind; - }; - return SyntaxNode; - })(); - TypeScript.SyntaxNode = SyntaxNode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.nodeMetadata = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], ["moduleElements", "endOfFileToken"], ["left", "dotToken", "right"], ["openBraceToken", "typeMembers", "closeBraceToken"], ["typeParameterList", "parameterList", "equalsGreaterThanToken", "type"], ["type", "openBracketToken", "closeBracketToken"], ["newKeyword", "typeParameterList", "parameterList", "equalsGreaterThanToken", "type"], ["name", "typeArgumentList"], ["typeOfKeyword", "name"], ["modifiers", "interfaceKeyword", "identifier", "typeParameterList", "heritageClauses", "body"], ["modifiers", "functionKeyword", "identifier", "callSignature", "block", "semicolonToken"], ["modifiers", "moduleKeyword", "name", "stringLiteral", "openBraceToken", "moduleElements", "closeBraceToken"], ["modifiers", "classKeyword", "identifier", "typeParameterList", "heritageClauses", "openBraceToken", "classElements", "closeBraceToken"], ["modifiers", "enumKeyword", "identifier", "openBraceToken", "enumElements", "closeBraceToken"], ["modifiers", "importKeyword", "identifier", "equalsToken", "moduleReference", "semicolonToken"], ["exportKeyword", "equalsToken", "identifier", "semicolonToken"], ["modifiers", "propertyName", "callSignature", "block", "semicolonToken"], ["modifiers", "variableDeclarator", "semicolonToken"], ["modifiers", "constructorKeyword", "callSignature", "block", "semicolonToken"], ["modifiers", "indexSignature", "semicolonToken"], ["modifiers", "getKeyword", "propertyName", "callSignature", "block"], ["modifiers", "setKeyword", "propertyName", "callSignature", "block"], ["propertyName", "questionToken", "typeAnnotation"], ["typeParameterList", "parameterList", "typeAnnotation"], ["newKeyword", "callSignature"], ["openBracketToken", "parameters", "closeBracketToken", "typeAnnotation"], ["propertyName", "questionToken", "callSignature"], ["openBraceToken", "statements", "closeBraceToken"], ["ifKeyword", "openParenToken", "condition", "closeParenToken", "statement", "elseClause"], ["modifiers", "variableDeclaration", "semicolonToken"], ["expression", "semicolonToken"], ["returnKeyword", "expression", "semicolonToken"], ["switchKeyword", "openParenToken", "expression", "closeParenToken", "openBraceToken", "switchClauses", "closeBraceToken"], ["breakKeyword", "identifier", "semicolonToken"], ["continueKeyword", "identifier", "semicolonToken"], ["forKeyword", "openParenToken", "variableDeclaration", "initializer", "firstSemicolonToken", "condition", "secondSemicolonToken", "incrementor", "closeParenToken", "statement"], ["forKeyword", "openParenToken", "variableDeclaration", "left", "inKeyword", "expression", "closeParenToken", "statement"], ["semicolonToken"], ["throwKeyword", "expression", "semicolonToken"], ["whileKeyword", "openParenToken", "condition", "closeParenToken", "statement"], ["tryKeyword", "block", "catchClause", "finallyClause"], ["identifier", "colonToken", "statement"], ["doKeyword", "statement", "whileKeyword", "openParenToken", "condition", "closeParenToken", "semicolonToken"], ["debuggerKeyword", "semicolonToken"], ["withKeyword", "openParenToken", "condition", "closeParenToken", "statement"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["deleteKeyword", "expression"], ["typeOfKeyword", "expression"], ["voidKeyword", "expression"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["condition", "questionToken", "whenTrue", "colonToken", "whenFalse"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["operand", "operatorToken"], ["operand", "operatorToken"], ["expression", "dotToken", "name"], ["expression", "argumentList"], ["openBracketToken", "expressions", "closeBracketToken"], ["openBraceToken", "propertyAssignments", "closeBraceToken"], ["newKeyword", "expression", "argumentList"], ["openParenToken", "expression", "closeParenToken"], ["callSignature", "equalsGreaterThanToken", "block", "expression"], ["parameter", "equalsGreaterThanToken", "block", "expression"], ["lessThanToken", "type", "greaterThanToken", "expression"], ["expression", "openBracketToken", "argumentExpression", "closeBracketToken"], ["functionKeyword", "identifier", "callSignature", "block"], [], ["varKeyword", "variableDeclarators"], ["propertyName", "typeAnnotation", "equalsValueClause"], ["typeArgumentList", "openParenToken", "arguments", "closeParenToken"], ["openParenToken", "parameters", "closeParenToken"], ["lessThanToken", "typeArguments", "greaterThanToken"], ["lessThanToken", "typeParameters", "greaterThanToken"], ["extendsOrImplementsKeyword", "typeNames"], ["extendsOrImplementsKeyword", "typeNames"], ["equalsToken", "value"], ["caseKeyword", "expression", "colonToken", "statements"], ["defaultKeyword", "colonToken", "statements"], ["elseKeyword", "statement"], ["catchKeyword", "openParenToken", "identifier", "typeAnnotation", "closeParenToken", "block"], ["finallyKeyword", "block"], ["identifier", "constraint"], ["extendsKeyword", "typeOrExpression"], ["propertyName", "colonToken", "expression"], ["propertyName", "callSignature", "block"], ["dotDotDotToken", "modifiers", "identifier", "questionToken", "typeAnnotation", "equalsValueClause"], ["propertyName", "equalsValueClause"], ["colonToken", "type"], ["requireKeyword", "openParenToken", "stringLiteral", "closeParenToken"], ["moduleName"], ]; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function tokenValue(token) { - if (token.fullWidth() === 0) { - return null; - } - var kind = token.kind(); - var text = token.text(); - if (kind === 11 /* IdentifierName */) { - return massageEscapes(text); - } - switch (kind) { - case 37 /* TrueKeyword */: - return true; - case 24 /* FalseKeyword */: - return false; - case 32 /* NullKeyword */: - return null; - } - if (TypeScript.SyntaxFacts.isAnyKeyword(kind) || TypeScript.SyntaxFacts.isAnyPunctuation(kind)) { - return TypeScript.SyntaxFacts.getText(kind); - } - if (kind === 13 /* NumericLiteral */) { - return TypeScript.IntegerUtilities.isHexInteger(text) ? parseInt(text, 16) : parseFloat(text); - } - else if (kind === 14 /* StringLiteral */) { - if (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) { - return massageEscapes(text.substr(1, text.length - 2)); - } - else { - return massageEscapes(text.substr(1)); - } - } - else if (kind === 12 /* RegularExpressionLiteral */) { - return regularExpressionValue(text); - } - else if (kind === 10 /* EndOfFileToken */ || kind === 9 /* ErrorToken */) { - return null; - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - TypeScript.tokenValue = tokenValue; - function tokenValueText(token) { - var value = tokenValue(token); - return value === null ? "" : massageDisallowedIdentifiers(value.toString()); - } - TypeScript.tokenValueText = tokenValueText; - function massageEscapes(text) { - return text.indexOf("\\") >= 0 ? convertEscapes(text) : text; - } - TypeScript.massageEscapes = massageEscapes; - function regularExpressionValue(text) { - try { - var lastSlash = text.lastIndexOf("/"); - var body = text.substring(1, lastSlash); - var flags = text.substring(lastSlash + 1); - return new RegExp(body, flags); - } - catch (e) { - return null; - } - } - function massageDisallowedIdentifiers(text) { - if (text.charCodeAt(0) === 95 /* _ */ && text.charCodeAt(1) === 95 /* _ */) { - return "_" + text; - } - return text; - } - var characterArray = []; - function convertEscapes(text) { - characterArray.length = 0; - var result = ""; - for (var i = 0, n = text.length; i < n; i++) { - var ch = text.charCodeAt(i); - if (ch === 92 /* backslash */) { - i++; - if (i < n) { - ch = text.charCodeAt(i); - switch (ch) { - case 48 /* _0 */: - characterArray.push(0 /* nullCharacter */); - continue; - case 98 /* b */: - characterArray.push(8 /* backspace */); - continue; - case 102 /* f */: - characterArray.push(12 /* formFeed */); - continue; - case 110 /* n */: - characterArray.push(10 /* lineFeed */); - continue; - case 114 /* r */: - characterArray.push(13 /* carriageReturn */); - continue; - case 116 /* t */: - characterArray.push(9 /* tab */); - continue; - case 118 /* v */: - characterArray.push(11 /* verticalTab */); - continue; - case 120 /* x */: - characterArray.push(hexValue(text, i + 1, 2)); - i += 2; - continue; - case 117 /* u */: - characterArray.push(hexValue(text, i + 1, 4)); - i += 4; - continue; - case 13 /* carriageReturn */: - var nextIndex = i + 1; - if (nextIndex < text.length && text.charCodeAt(nextIndex) === 10 /* lineFeed */) { - i++; - } - continue; - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - continue; - default: - } - } - } - characterArray.push(ch); - if (i && !(i % 1024)) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); - characterArray.length = 0; - } - } - if (characterArray.length) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); - } - return result; - } - function hexValue(text, start, length) { - var intChar = 0; - for (var i = 0; i < length; i++) { - var ch2 = text.charCodeAt(start + i); - if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { - break; - } - intChar = (intChar << 4) + TypeScript.CharacterInfo.hexValue(ch2); - } - return intChar; - } -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - function realizeToken(token, text) { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), token.trailingTrivia(text)); - } - Syntax.realizeToken = realizeToken; - function convertKeywordToIdentifier(token) { - return new ConvertedKeywordToken(token); - } - Syntax.convertKeywordToIdentifier = convertKeywordToIdentifier; - function withLeadingTrivia(token, leadingTrivia, text) { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text(), token.trailingTrivia(text)); - } - Syntax.withLeadingTrivia = withLeadingTrivia; - function withTrailingTrivia(token, trailingTrivia, text) { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), trailingTrivia); - } - Syntax.withTrailingTrivia = withTrailingTrivia; - function emptyToken(kind) { - return new EmptyToken(kind); - } - Syntax.emptyToken = emptyToken; - var EmptyToken = (function () { - function EmptyToken(_kind) { - this._kind = _kind; - } - EmptyToken.prototype.setFullStart = function (fullStart) { - }; - EmptyToken.prototype.kind = function () { - return this._kind; - }; - EmptyToken.prototype.clone = function () { - return new EmptyToken(this.kind()); - }; - EmptyToken.prototype.isIncrementallyUnusable = function () { - return true; - }; - EmptyToken.prototype.isKeywordConvertedToIdentifier = function () { - return false; - }; - EmptyToken.prototype.fullWidth = function () { - return 0; - }; - EmptyToken.prototype.position = function () { - var previousElement = this.previousNonZeroWidthElement(); - return previousElement === null ? 0 : TypeScript.fullStart(previousElement) + TypeScript.fullWidth(previousElement); - }; - EmptyToken.prototype.previousNonZeroWidthElement = function () { - var current = this; - while (true) { - var parent = current.parent; - if (parent === null) { - TypeScript.Debug.assert(current.kind() === 120 /* SourceUnit */, "We had a node without a parent that was not the root node!"); - return null; - } - for (var i = 0, n = TypeScript.childCount(parent); i < n; i++) { - if (TypeScript.childAt(parent, i) === current) { - break; - } - } - TypeScript.Debug.assert(i !== n, "Could not find current element in parent's child list!"); - for (var j = i - 1; j >= 0; j--) { - var sibling = TypeScript.childAt(parent, j); - if (sibling && TypeScript.fullWidth(sibling) > 0) { - return sibling; - } - } - current = current.parent; - } - }; - EmptyToken.prototype.fullStart = function () { - return this.position(); - }; - EmptyToken.prototype.text = function () { - return ""; - }; - EmptyToken.prototype.fullText = function () { - return ""; - }; - EmptyToken.prototype.hasLeadingTrivia = function () { - return false; - }; - EmptyToken.prototype.hasTrailingTrivia = function () { - return false; - }; - EmptyToken.prototype.hasLeadingComment = function () { - return false; - }; - EmptyToken.prototype.hasTrailingComment = function () { - return false; - }; - EmptyToken.prototype.hasSkippedToken = function () { - return false; - }; - EmptyToken.prototype.leadingTriviaWidth = function () { - return 0; - }; - EmptyToken.prototype.trailingTriviaWidth = function () { - return 0; - }; - EmptyToken.prototype.leadingTrivia = function () { - return Syntax.emptyTriviaList; - }; - EmptyToken.prototype.trailingTrivia = function () { - return Syntax.emptyTriviaList; - }; - return EmptyToken; - })(); - var RealizedToken = (function () { - function RealizedToken(fullStart, kind, isKeywordConvertedToIdentifier, leadingTrivia, text, trailingTrivia) { - this._fullStart = fullStart; - this._kind = kind; - this._isKeywordConvertedToIdentifier = isKeywordConvertedToIdentifier; - this._text = text; - this._leadingTrivia = leadingTrivia.clone(); - this._trailingTrivia = trailingTrivia.clone(); - if (!this._leadingTrivia.isShared()) { - this._leadingTrivia.parent = this; - } - if (!this._trailingTrivia.isShared()) { - this._trailingTrivia.parent = this; - } - } - RealizedToken.prototype.setFullStart = function (fullStart) { - this._fullStart = fullStart; - }; - RealizedToken.prototype.kind = function () { - return this._kind; - }; - RealizedToken.prototype.clone = function () { - return new RealizedToken(this._fullStart, this.kind(), this._isKeywordConvertedToIdentifier, this._leadingTrivia, this._text, this._trailingTrivia); - }; - RealizedToken.prototype.isIncrementallyUnusable = function () { - return true; - }; - RealizedToken.prototype.isKeywordConvertedToIdentifier = function () { - return this._isKeywordConvertedToIdentifier; - }; - RealizedToken.prototype.fullStart = function () { - return this._fullStart; - }; - RealizedToken.prototype.fullWidth = function () { - return this._leadingTrivia.fullWidth() + this._text.length + this._trailingTrivia.fullWidth(); - }; - RealizedToken.prototype.text = function () { - return this._text; - }; - RealizedToken.prototype.fullText = function () { - return this._leadingTrivia.fullText() + this.text() + this._trailingTrivia.fullText(); - }; - RealizedToken.prototype.hasLeadingTrivia = function () { - return this._leadingTrivia.count() > 0; - }; - RealizedToken.prototype.hasTrailingTrivia = function () { - return this._trailingTrivia.count() > 0; - }; - RealizedToken.prototype.hasLeadingComment = function () { - return this._leadingTrivia.hasComment(); - }; - RealizedToken.prototype.hasTrailingComment = function () { - return this._trailingTrivia.hasComment(); - }; - RealizedToken.prototype.leadingTriviaWidth = function () { - return this._leadingTrivia.fullWidth(); - }; - RealizedToken.prototype.trailingTriviaWidth = function () { - return this._trailingTrivia.fullWidth(); - }; - RealizedToken.prototype.hasSkippedToken = function () { - return this._leadingTrivia.hasSkippedToken() || this._trailingTrivia.hasSkippedToken(); - }; - RealizedToken.prototype.leadingTrivia = function () { - return this._leadingTrivia; - }; - RealizedToken.prototype.trailingTrivia = function () { - return this._trailingTrivia; - }; - return RealizedToken; - })(); - var ConvertedKeywordToken = (function () { - function ConvertedKeywordToken(underlyingToken) { - this.underlyingToken = underlyingToken; - } - ConvertedKeywordToken.prototype.kind = function () { - return 11 /* IdentifierName */; - }; - ConvertedKeywordToken.prototype.setFullStart = function (fullStart) { - this.underlyingToken.setFullStart(fullStart); - }; - ConvertedKeywordToken.prototype.fullStart = function () { - return this.underlyingToken.fullStart(); - }; - ConvertedKeywordToken.prototype.fullWidth = function () { - return this.underlyingToken.fullWidth(); - }; - ConvertedKeywordToken.prototype.text = function () { - return this.underlyingToken.text(); - }; - ConvertedKeywordToken.prototype.syntaxTreeText = function (text) { - var result = text || TypeScript.syntaxTree(this).text; - TypeScript.Debug.assert(result); - return result; - }; - ConvertedKeywordToken.prototype.fullText = function (text) { - return this.underlyingToken.fullText(this.syntaxTreeText(text)); - }; - ConvertedKeywordToken.prototype.hasLeadingTrivia = function () { - return this.underlyingToken.hasLeadingTrivia(); - }; - ConvertedKeywordToken.prototype.hasTrailingTrivia = function () { - return this.underlyingToken.hasTrailingTrivia(); - }; - ConvertedKeywordToken.prototype.hasLeadingComment = function () { - return this.underlyingToken.hasLeadingComment(); - }; - ConvertedKeywordToken.prototype.hasTrailingComment = function () { - return this.underlyingToken.hasTrailingComment(); - }; - ConvertedKeywordToken.prototype.hasSkippedToken = function () { - return this.underlyingToken.hasSkippedToken(); - }; - ConvertedKeywordToken.prototype.leadingTrivia = function (text) { - var result = this.underlyingToken.leadingTrivia(this.syntaxTreeText(text)); - result.parent = this; - return result; - }; - ConvertedKeywordToken.prototype.trailingTrivia = function (text) { - var result = this.underlyingToken.trailingTrivia(this.syntaxTreeText(text)); - result.parent = this; - return result; - }; - ConvertedKeywordToken.prototype.leadingTriviaWidth = function (text) { - return this.underlyingToken.leadingTriviaWidth(this.syntaxTreeText(text)); - }; - ConvertedKeywordToken.prototype.trailingTriviaWidth = function (text) { - return this.underlyingToken.trailingTriviaWidth(this.syntaxTreeText(text)); - }; - ConvertedKeywordToken.prototype.isKeywordConvertedToIdentifier = function () { - return true; - }; - ConvertedKeywordToken.prototype.isIncrementallyUnusable = function () { - return this.underlyingToken.isIncrementallyUnusable(); - }; - ConvertedKeywordToken.prototype.clone = function () { - return new ConvertedKeywordToken(this.underlyingToken); - }; - return ConvertedKeywordToken; - })(); - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var AbstractTrivia = (function () { - function AbstractTrivia(_kind) { - this._kind = _kind; - } - AbstractTrivia.prototype.kind = function () { - return this._kind; - }; - AbstractTrivia.prototype.clone = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.fullStart = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.fullWidth = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.fullText = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.isWhitespace = function () { - return this.kind() === 4 /* WhitespaceTrivia */; - }; - AbstractTrivia.prototype.isComment = function () { - return this.kind() === 7 /* SingleLineCommentTrivia */ || this.kind() === 6 /* MultiLineCommentTrivia */; - }; - AbstractTrivia.prototype.isNewLine = function () { - return this.kind() === 5 /* NewLineTrivia */; - }; - AbstractTrivia.prototype.isSkippedToken = function () { - return this.kind() === 8 /* SkippedTokenTrivia */; - }; - return AbstractTrivia; - })(); - var SkippedTokenTrivia = (function (_super) { - __extends(SkippedTokenTrivia, _super); - function SkippedTokenTrivia(_skippedToken, _fullText) { - _super.call(this, 8 /* SkippedTokenTrivia */); - this._skippedToken = _skippedToken; - this._fullText = _fullText; - _skippedToken.parent = this; - } - SkippedTokenTrivia.prototype.clone = function () { - return new SkippedTokenTrivia(this._skippedToken.clone(), this._fullText); - }; - SkippedTokenTrivia.prototype.fullStart = function () { - return this._skippedToken.fullStart(); - }; - SkippedTokenTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - SkippedTokenTrivia.prototype.fullText = function () { - return this._fullText; - }; - SkippedTokenTrivia.prototype.skippedToken = function () { - return this._skippedToken; - }; - return SkippedTokenTrivia; - })(AbstractTrivia); - var DeferredTrivia = (function (_super) { - __extends(DeferredTrivia, _super); - function DeferredTrivia(kind, _text, _fullStart, _fullWidth) { - _super.call(this, kind); - this._text = _text; - this._fullStart = _fullStart; - this._fullWidth = _fullWidth; - } - DeferredTrivia.prototype.clone = function () { - return new DeferredTrivia(this.kind(), this._text, this._fullStart, this._fullWidth); - }; - DeferredTrivia.prototype.fullStart = function () { - return this._fullStart; - }; - DeferredTrivia.prototype.fullWidth = function () { - return this._fullWidth; - }; - DeferredTrivia.prototype.fullText = function () { - return this._text.substr(this._fullStart, this._fullWidth); - }; - DeferredTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.invalidOperation(); - }; - return DeferredTrivia; - })(AbstractTrivia); - function deferredTrivia(kind, text, fullStart, fullWidth) { - return new DeferredTrivia(kind, text, fullStart, fullWidth); - } - Syntax.deferredTrivia = deferredTrivia; - function skippedTokenTrivia(token, text) { - TypeScript.Debug.assert(!token.hasLeadingTrivia()); - TypeScript.Debug.assert(!token.hasTrailingTrivia()); - TypeScript.Debug.assert(token.fullWidth() > 0); - return new SkippedTokenTrivia(token, token.fullText(text)); - } - Syntax.skippedTokenTrivia = skippedTokenTrivia; - function splitMultiLineCommentTriviaIntoMultipleLines(trivia) { - var result = []; - var triviaText = trivia.fullText(); - var currentIndex = 0; - for (var i = 0; i < triviaText.length; i++) { - var ch = triviaText.charCodeAt(i); - var isCarriageReturnLineFeed = false; - switch (ch) { - case 13 /* carriageReturn */: - if (i < triviaText.length - 1 && triviaText.charCodeAt(i + 1) === 10 /* lineFeed */) { - i++; - } - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - result.push(triviaText.substring(currentIndex, i + 1)); - currentIndex = i + 1; - continue; - } - } - result.push(triviaText.substring(currentIndex)); - return result; - } - Syntax.splitMultiLineCommentTriviaIntoMultipleLines = splitMultiLineCommentTriviaIntoMultipleLines; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var EmptyTriviaList = (function () { - function EmptyTriviaList() { - } - EmptyTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; - EmptyTriviaList.prototype.isShared = function () { - return true; - }; - EmptyTriviaList.prototype.count = function () { - return 0; - }; - EmptyTriviaList.prototype.syntaxTriviaAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - EmptyTriviaList.prototype.last = function () { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - EmptyTriviaList.prototype.fullWidth = function () { - return 0; - }; - EmptyTriviaList.prototype.fullText = function () { - return ""; - }; - EmptyTriviaList.prototype.hasComment = function () { - return false; - }; - EmptyTriviaList.prototype.hasNewLine = function () { - return false; - }; - EmptyTriviaList.prototype.hasSkippedToken = function () { - return false; - }; - EmptyTriviaList.prototype.toArray = function () { - return []; - }; - EmptyTriviaList.prototype.clone = function () { - return this; - }; - return EmptyTriviaList; - })(); - ; - Syntax.emptyTriviaList = new EmptyTriviaList(); - function isComment(trivia) { - return trivia.kind() === 6 /* MultiLineCommentTrivia */ || trivia.kind() === 7 /* SingleLineCommentTrivia */; - } - var SingletonSyntaxTriviaList = (function () { - function SingletonSyntaxTriviaList(item) { - this.item = item.clone(); - this.item.parent = this; - } - SingletonSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; - SingletonSyntaxTriviaList.prototype.isShared = function () { - return false; - }; - SingletonSyntaxTriviaList.prototype.count = function () { - return 1; - }; - SingletonSyntaxTriviaList.prototype.syntaxTriviaAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - return this.item; - }; - SingletonSyntaxTriviaList.prototype.last = function () { - return this.item; - }; - SingletonSyntaxTriviaList.prototype.fullWidth = function () { - return this.item.fullWidth(); - }; - SingletonSyntaxTriviaList.prototype.fullText = function () { - return this.item.fullText(); - }; - SingletonSyntaxTriviaList.prototype.hasComment = function () { - return isComment(this.item); - }; - SingletonSyntaxTriviaList.prototype.hasNewLine = function () { - return this.item.kind() === 5 /* NewLineTrivia */; - }; - SingletonSyntaxTriviaList.prototype.hasSkippedToken = function () { - return this.item.kind() === 8 /* SkippedTokenTrivia */; - }; - SingletonSyntaxTriviaList.prototype.toArray = function () { - return [this.item]; - }; - SingletonSyntaxTriviaList.prototype.clone = function () { - return new SingletonSyntaxTriviaList(this.item.clone()); - }; - return SingletonSyntaxTriviaList; - })(); - var NormalSyntaxTriviaList = (function () { - function NormalSyntaxTriviaList(trivia) { - var _this = this; - this.trivia = trivia.map(function (t) { - var cloned = t.clone(); - cloned.parent = _this; - return cloned; - }); - } - NormalSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; - NormalSyntaxTriviaList.prototype.isShared = function () { - return false; - }; - NormalSyntaxTriviaList.prototype.count = function () { - return this.trivia.length; - }; - NormalSyntaxTriviaList.prototype.syntaxTriviaAt = function (index) { - if (index < 0 || index >= this.trivia.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - return this.trivia[index]; - }; - NormalSyntaxTriviaList.prototype.last = function () { - return this.trivia[this.trivia.length - 1]; - }; - NormalSyntaxTriviaList.prototype.fullWidth = function () { - return TypeScript.ArrayUtilities.sum(this.trivia, function (t) { return t.fullWidth(); }); - }; - NormalSyntaxTriviaList.prototype.fullText = function () { - var result = []; - for (var i = 0, n = this.trivia.length; i < n; i++) { - result.push(this.trivia[i].fullText()); - } - return result.join(""); - }; - NormalSyntaxTriviaList.prototype.hasComment = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (isComment(this.trivia[i])) { - return true; - } - } - return false; - }; - NormalSyntaxTriviaList.prototype.hasNewLine = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 5 /* NewLineTrivia */) { - return true; - } - } - return false; - }; - NormalSyntaxTriviaList.prototype.hasSkippedToken = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 8 /* SkippedTokenTrivia */) { - return true; - } - } - return false; - }; - NormalSyntaxTriviaList.prototype.toArray = function () { - return this.trivia.slice(0); - }; - NormalSyntaxTriviaList.prototype.clone = function () { - return new NormalSyntaxTriviaList(this.trivia.map(function (t) { return t.clone(); })); - }; - return NormalSyntaxTriviaList; - })(); - function triviaList(trivia) { - if (trivia === undefined || trivia === null || trivia.length === 0) { - return Syntax.emptyTriviaList; - } - if (trivia.length === 1) { - return new SingletonSyntaxTriviaList(trivia[0]); - } - return new NormalSyntaxTriviaList(trivia); - } - Syntax.triviaList = triviaList; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxUtilities = (function () { - function SyntaxUtilities() { - } - SyntaxUtilities.isAnyFunctionExpressionOrDeclaration = function (ast) { - switch (ast.kind()) { - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 222 /* FunctionExpression */: - case 129 /* FunctionDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 241 /* FunctionPropertyAssignment */: - case 137 /* ConstructorDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - return true; - } - return false; - }; - SyntaxUtilities.isLastTokenOnLine = function (token, text) { - var _nextToken = TypeScript.nextToken(token, text); - if (_nextToken === null) { - return true; - } - var lineMap = text.lineMap(); - var tokenLine = lineMap.getLineNumberFromPosition(TypeScript.end(token, text)); - var nextTokenLine = lineMap.getLineNumberFromPosition(TypeScript.start(_nextToken, text)); - return tokenLine !== nextTokenLine; - }; - SyntaxUtilities.isLeftHandSizeExpression = function (element) { - if (element) { - switch (element.kind()) { - case 212 /* MemberAccessExpression */: - case 221 /* ElementAccessExpression */: - case 216 /* ObjectCreationExpression */: - case 213 /* InvocationExpression */: - case 214 /* ArrayLiteralExpression */: - case 217 /* ParenthesizedExpression */: - case 215 /* ObjectLiteralExpression */: - case 222 /* FunctionExpression */: - case 11 /* IdentifierName */: - case 12 /* RegularExpressionLiteral */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 50 /* SuperKeyword */: - return true; - } - } - return false; - }; - SyntaxUtilities.isExpression = function (element) { - if (element) { - switch (element.kind()) { - case 11 /* IdentifierName */: - case 12 /* RegularExpressionLiteral */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 50 /* SuperKeyword */: - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - case 166 /* BitwiseNotExpression */: - case 167 /* LogicalNotExpression */: - case 168 /* PreIncrementExpression */: - case 169 /* PreDecrementExpression */: - case 170 /* DeleteExpression */: - case 171 /* TypeOfExpression */: - case 172 /* VoidExpression */: - case 173 /* CommaExpression */: - case 174 /* AssignmentExpression */: - case 175 /* AddAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - case 186 /* ConditionalExpression */: - case 187 /* LogicalOrExpression */: - case 188 /* LogicalAndExpression */: - case 189 /* BitwiseOrExpression */: - case 190 /* BitwiseExclusiveOrExpression */: - case 191 /* BitwiseAndExpression */: - case 192 /* EqualsWithTypeConversionExpression */: - case 193 /* NotEqualsWithTypeConversionExpression */: - case 194 /* EqualsExpression */: - case 195 /* NotEqualsExpression */: - case 196 /* LessThanExpression */: - case 197 /* GreaterThanExpression */: - case 198 /* LessThanOrEqualExpression */: - case 199 /* GreaterThanOrEqualExpression */: - case 200 /* InstanceOfExpression */: - case 201 /* InExpression */: - case 202 /* LeftShiftExpression */: - case 203 /* SignedRightShiftExpression */: - case 204 /* UnsignedRightShiftExpression */: - case 205 /* MultiplyExpression */: - case 206 /* DivideExpression */: - case 207 /* ModuloExpression */: - case 208 /* AddExpression */: - case 209 /* SubtractExpression */: - case 210 /* PostIncrementExpression */: - case 211 /* PostDecrementExpression */: - case 212 /* MemberAccessExpression */: - case 213 /* InvocationExpression */: - case 214 /* ArrayLiteralExpression */: - case 215 /* ObjectLiteralExpression */: - case 216 /* ObjectCreationExpression */: - case 217 /* ParenthesizedExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 219 /* SimpleArrowFunctionExpression */: - case 220 /* CastExpression */: - case 221 /* ElementAccessExpression */: - case 222 /* FunctionExpression */: - case 223 /* OmittedExpression */: - return true; - } - } - return false; - }; - SyntaxUtilities.isSwitchClause = function (element) { - if (element) { - switch (element.kind()) { - case 233 /* CaseSwitchClause */: - case 234 /* DefaultSwitchClause */: - return true; - } - } - return false; - }; - SyntaxUtilities.isTypeMember = function (element) { - if (element) { - switch (element.kind()) { - case 143 /* ConstructSignature */: - case 145 /* MethodSignature */: - case 144 /* IndexSignature */: - case 141 /* PropertySignature */: - case 142 /* CallSignature */: - return true; - } - } - return false; - }; - SyntaxUtilities.isClassElement = function (element) { - if (element) { - switch (element.kind()) { - case 137 /* ConstructorDeclaration */: - case 138 /* IndexMemberDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 135 /* MemberFunctionDeclaration */: - case 136 /* MemberVariableDeclaration */: - return true; - } - } - return false; - }; - SyntaxUtilities.isModuleElement = function (element) { - if (element) { - switch (element.kind()) { - case 133 /* ImportDeclaration */: - case 134 /* ExportAssignment */: - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 130 /* ModuleDeclaration */: - case 132 /* EnumDeclaration */: - case 129 /* FunctionDeclaration */: - case 148 /* VariableStatement */: - case 146 /* Block */: - case 147 /* IfStatement */: - case 149 /* ExpressionStatement */: - case 157 /* ThrowStatement */: - case 150 /* ReturnStatement */: - case 151 /* SwitchStatement */: - case 152 /* BreakStatement */: - case 153 /* ContinueStatement */: - case 155 /* ForInStatement */: - case 154 /* ForStatement */: - case 158 /* WhileStatement */: - case 163 /* WithStatement */: - case 156 /* EmptyStatement */: - case 159 /* TryStatement */: - case 160 /* LabeledStatement */: - case 161 /* DoStatement */: - case 162 /* DebuggerStatement */: - return true; - } - } - return false; - }; - SyntaxUtilities.isStatement = function (element) { - if (element) { - switch (element.kind()) { - case 129 /* FunctionDeclaration */: - case 148 /* VariableStatement */: - case 146 /* Block */: - case 147 /* IfStatement */: - case 149 /* ExpressionStatement */: - case 157 /* ThrowStatement */: - case 150 /* ReturnStatement */: - case 151 /* SwitchStatement */: - case 152 /* BreakStatement */: - case 153 /* ContinueStatement */: - case 155 /* ForInStatement */: - case 154 /* ForStatement */: - case 158 /* WhileStatement */: - case 163 /* WithStatement */: - case 156 /* EmptyStatement */: - case 159 /* TryStatement */: - case 160 /* LabeledStatement */: - case 161 /* DoStatement */: - case 162 /* DebuggerStatement */: - return true; - } - } - return false; - }; - SyntaxUtilities.isAngleBracket = function (positionedElement) { - var element = positionedElement; - var parent = positionedElement.parent; - if (parent !== null && (element.kind() === 80 /* LessThanToken */ || element.kind() === 81 /* GreaterThanToken */)) { - switch (parent.kind()) { - case 228 /* TypeArgumentList */: - case 229 /* TypeParameterList */: - case 220 /* CastExpression */: - return true; - } - } - return false; - }; - SyntaxUtilities.getToken = function (list, kind) { - for (var i = 0, n = list.length; i < n; i++) { - var token = list[i]; - if (token.kind() === kind) { - return token; - } - } - return null; - }; - SyntaxUtilities.containsToken = function (list, kind) { - return SyntaxUtilities.getToken(list, kind) !== null; - }; - SyntaxUtilities.hasExportKeyword = function (moduleElement) { - return SyntaxUtilities.getExportKeyword(moduleElement) !== null; - }; - SyntaxUtilities.getExportKeyword = function (moduleElement) { - switch (moduleElement.kind()) { - case 130 /* ModuleDeclaration */: - case 131 /* ClassDeclaration */: - case 129 /* FunctionDeclaration */: - case 148 /* VariableStatement */: - case 132 /* EnumDeclaration */: - case 128 /* InterfaceDeclaration */: - case 133 /* ImportDeclaration */: - return SyntaxUtilities.getToken(moduleElement.modifiers, 47 /* ExportKeyword */); - default: - return null; - } - }; - SyntaxUtilities.isAmbientDeclarationSyntax = function (positionNode) { - if (!positionNode) { - return false; - } - var node = positionNode; - switch (node.kind()) { - case 130 /* ModuleDeclaration */: - case 131 /* ClassDeclaration */: - case 129 /* FunctionDeclaration */: - case 148 /* VariableStatement */: - case 132 /* EnumDeclaration */: - if (SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { - return true; - } - case 133 /* ImportDeclaration */: - case 137 /* ConstructorDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 136 /* MemberVariableDeclaration */: - if (SyntaxUtilities.isClassElement(node) || SyntaxUtilities.isModuleElement(node)) { - return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(positionNode)); - } - case 243 /* EnumElement */: - return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(TypeScript.Syntax.containingNode(positionNode))); - default: - return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(positionNode)); - } - }; - return SyntaxUtilities; - })(); - TypeScript.SyntaxUtilities = SyntaxUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function visitNodeOrToken(visitor, element) { - if (element === null) { - return null; - } - if (TypeScript.isToken(element)) { - return visitor.visitToken(element); - } - switch (element.kind()) { - case 120 /* SourceUnit */: - return visitor.visitSourceUnit(element); - case 121 /* QualifiedName */: - return visitor.visitQualifiedName(element); - case 122 /* ObjectType */: - return visitor.visitObjectType(element); - case 123 /* FunctionType */: - return visitor.visitFunctionType(element); - case 124 /* ArrayType */: - return visitor.visitArrayType(element); - case 125 /* ConstructorType */: - return visitor.visitConstructorType(element); - case 126 /* GenericType */: - return visitor.visitGenericType(element); - case 127 /* TypeQuery */: - return visitor.visitTypeQuery(element); - case 128 /* InterfaceDeclaration */: - return visitor.visitInterfaceDeclaration(element); - case 129 /* FunctionDeclaration */: - return visitor.visitFunctionDeclaration(element); - case 130 /* ModuleDeclaration */: - return visitor.visitModuleDeclaration(element); - case 131 /* ClassDeclaration */: - return visitor.visitClassDeclaration(element); - case 132 /* EnumDeclaration */: - return visitor.visitEnumDeclaration(element); - case 133 /* ImportDeclaration */: - return visitor.visitImportDeclaration(element); - case 134 /* ExportAssignment */: - return visitor.visitExportAssignment(element); - case 135 /* MemberFunctionDeclaration */: - return visitor.visitMemberFunctionDeclaration(element); - case 136 /* MemberVariableDeclaration */: - return visitor.visitMemberVariableDeclaration(element); - case 137 /* ConstructorDeclaration */: - return visitor.visitConstructorDeclaration(element); - case 138 /* IndexMemberDeclaration */: - return visitor.visitIndexMemberDeclaration(element); - case 139 /* GetAccessor */: - return visitor.visitGetAccessor(element); - case 140 /* SetAccessor */: - return visitor.visitSetAccessor(element); - case 141 /* PropertySignature */: - return visitor.visitPropertySignature(element); - case 142 /* CallSignature */: - return visitor.visitCallSignature(element); - case 143 /* ConstructSignature */: - return visitor.visitConstructSignature(element); - case 144 /* IndexSignature */: - return visitor.visitIndexSignature(element); - case 145 /* MethodSignature */: - return visitor.visitMethodSignature(element); - case 146 /* Block */: - return visitor.visitBlock(element); - case 147 /* IfStatement */: - return visitor.visitIfStatement(element); - case 148 /* VariableStatement */: - return visitor.visitVariableStatement(element); - case 149 /* ExpressionStatement */: - return visitor.visitExpressionStatement(element); - case 150 /* ReturnStatement */: - return visitor.visitReturnStatement(element); - case 151 /* SwitchStatement */: - return visitor.visitSwitchStatement(element); - case 152 /* BreakStatement */: - return visitor.visitBreakStatement(element); - case 153 /* ContinueStatement */: - return visitor.visitContinueStatement(element); - case 154 /* ForStatement */: - return visitor.visitForStatement(element); - case 155 /* ForInStatement */: - return visitor.visitForInStatement(element); - case 156 /* EmptyStatement */: - return visitor.visitEmptyStatement(element); - case 157 /* ThrowStatement */: - return visitor.visitThrowStatement(element); - case 158 /* WhileStatement */: - return visitor.visitWhileStatement(element); - case 159 /* TryStatement */: - return visitor.visitTryStatement(element); - case 160 /* LabeledStatement */: - return visitor.visitLabeledStatement(element); - case 161 /* DoStatement */: - return visitor.visitDoStatement(element); - case 162 /* DebuggerStatement */: - return visitor.visitDebuggerStatement(element); - case 163 /* WithStatement */: - return visitor.visitWithStatement(element); - case 168 /* PreIncrementExpression */: - case 169 /* PreDecrementExpression */: - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - case 166 /* BitwiseNotExpression */: - case 167 /* LogicalNotExpression */: - return visitor.visitPrefixUnaryExpression(element); - case 170 /* DeleteExpression */: - return visitor.visitDeleteExpression(element); - case 171 /* TypeOfExpression */: - return visitor.visitTypeOfExpression(element); - case 172 /* VoidExpression */: - return visitor.visitVoidExpression(element); - case 186 /* ConditionalExpression */: - return visitor.visitConditionalExpression(element); - case 205 /* MultiplyExpression */: - case 206 /* DivideExpression */: - case 207 /* ModuloExpression */: - case 208 /* AddExpression */: - case 209 /* SubtractExpression */: - case 202 /* LeftShiftExpression */: - case 203 /* SignedRightShiftExpression */: - case 204 /* UnsignedRightShiftExpression */: - case 196 /* LessThanExpression */: - case 197 /* GreaterThanExpression */: - case 198 /* LessThanOrEqualExpression */: - case 199 /* GreaterThanOrEqualExpression */: - case 200 /* InstanceOfExpression */: - case 201 /* InExpression */: - case 192 /* EqualsWithTypeConversionExpression */: - case 193 /* NotEqualsWithTypeConversionExpression */: - case 194 /* EqualsExpression */: - case 195 /* NotEqualsExpression */: - case 191 /* BitwiseAndExpression */: - case 190 /* BitwiseExclusiveOrExpression */: - case 189 /* BitwiseOrExpression */: - case 188 /* LogicalAndExpression */: - case 187 /* LogicalOrExpression */: - case 182 /* OrAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - case 175 /* AddAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 174 /* AssignmentExpression */: - case 173 /* CommaExpression */: - return visitor.visitBinaryExpression(element); - case 210 /* PostIncrementExpression */: - case 211 /* PostDecrementExpression */: - return visitor.visitPostfixUnaryExpression(element); - case 212 /* MemberAccessExpression */: - return visitor.visitMemberAccessExpression(element); - case 213 /* InvocationExpression */: - return visitor.visitInvocationExpression(element); - case 214 /* ArrayLiteralExpression */: - return visitor.visitArrayLiteralExpression(element); - case 215 /* ObjectLiteralExpression */: - return visitor.visitObjectLiteralExpression(element); - case 216 /* ObjectCreationExpression */: - return visitor.visitObjectCreationExpression(element); - case 217 /* ParenthesizedExpression */: - return visitor.visitParenthesizedExpression(element); - case 218 /* ParenthesizedArrowFunctionExpression */: - return visitor.visitParenthesizedArrowFunctionExpression(element); - case 219 /* SimpleArrowFunctionExpression */: - return visitor.visitSimpleArrowFunctionExpression(element); - case 220 /* CastExpression */: - return visitor.visitCastExpression(element); - case 221 /* ElementAccessExpression */: - return visitor.visitElementAccessExpression(element); - case 222 /* FunctionExpression */: - return visitor.visitFunctionExpression(element); - case 223 /* OmittedExpression */: - return visitor.visitOmittedExpression(element); - case 224 /* VariableDeclaration */: - return visitor.visitVariableDeclaration(element); - case 225 /* VariableDeclarator */: - return visitor.visitVariableDeclarator(element); - case 226 /* ArgumentList */: - return visitor.visitArgumentList(element); - case 227 /* ParameterList */: - return visitor.visitParameterList(element); - case 228 /* TypeArgumentList */: - return visitor.visitTypeArgumentList(element); - case 229 /* TypeParameterList */: - return visitor.visitTypeParameterList(element); - case 230 /* ExtendsHeritageClause */: - case 231 /* ImplementsHeritageClause */: - return visitor.visitHeritageClause(element); - case 232 /* EqualsValueClause */: - return visitor.visitEqualsValueClause(element); - case 233 /* CaseSwitchClause */: - return visitor.visitCaseSwitchClause(element); - case 234 /* DefaultSwitchClause */: - return visitor.visitDefaultSwitchClause(element); - case 235 /* ElseClause */: - return visitor.visitElseClause(element); - case 236 /* CatchClause */: - return visitor.visitCatchClause(element); - case 237 /* FinallyClause */: - return visitor.visitFinallyClause(element); - case 238 /* TypeParameter */: - return visitor.visitTypeParameter(element); - case 239 /* Constraint */: - return visitor.visitConstraint(element); - case 240 /* SimplePropertyAssignment */: - return visitor.visitSimplePropertyAssignment(element); - case 241 /* FunctionPropertyAssignment */: - return visitor.visitFunctionPropertyAssignment(element); - case 242 /* Parameter */: - return visitor.visitParameter(element); - case 243 /* EnumElement */: - return visitor.visitEnumElement(element); - case 244 /* TypeAnnotation */: - return visitor.visitTypeAnnotation(element); - case 245 /* ExternalModuleReference */: - return visitor.visitExternalModuleReference(element); - case 246 /* ModuleNameModuleReference */: - return visitor.visitModuleNameModuleReference(element); - } - throw TypeScript.Errors.invalidOperation(); - } - TypeScript.visitNodeOrToken = visitNodeOrToken; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxWalker = (function () { - function SyntaxWalker() { - } - SyntaxWalker.prototype.visitToken = function (token) { - }; - SyntaxWalker.prototype.visitNode = function (node) { - TypeScript.visitNodeOrToken(this, node); - }; - SyntaxWalker.prototype.visitNodeOrToken = function (nodeOrToken) { - if (TypeScript.isToken(nodeOrToken)) { - this.visitToken(nodeOrToken); - } - else { - this.visitNode(nodeOrToken); - } - }; - SyntaxWalker.prototype.visitOptionalToken = function (token) { - if (token === null) { - return; - } - this.visitToken(token); - }; - SyntaxWalker.prototype.visitOptionalNode = function (node) { - if (node === null) { - return; - } - this.visitNode(node); - }; - SyntaxWalker.prototype.visitOptionalNodeOrToken = function (nodeOrToken) { - if (nodeOrToken === null) { - return; - } - this.visitNodeOrToken(nodeOrToken); - }; - SyntaxWalker.prototype.visitList = function (list) { - for (var i = 0, n = list.length; i < n; i++) { - this.visitNodeOrToken(list[i]); - } - }; - SyntaxWalker.prototype.visitSeparatedList = function (list) { - for (var i = 0, n = TypeScript.childCount(list); i < n; i++) { - var item = TypeScript.childAt(list, i); - this.visitNodeOrToken(item); - } - }; - SyntaxWalker.prototype.visitSourceUnit = function (node) { - this.visitList(node.moduleElements); - this.visitToken(node.endOfFileToken); - }; - SyntaxWalker.prototype.visitQualifiedName = function (node) { - this.visitNodeOrToken(node.left); - this.visitToken(node.dotToken); - this.visitToken(node.right); - }; - SyntaxWalker.prototype.visitObjectType = function (node) { - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.typeMembers); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitFunctionType = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); - }; - SyntaxWalker.prototype.visitArrayType = function (node) { - this.visitNodeOrToken(node.type); - this.visitToken(node.openBracketToken); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitConstructorType = function (node) { - this.visitToken(node.newKeyword); - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); - }; - SyntaxWalker.prototype.visitGenericType = function (node) { - this.visitNodeOrToken(node.name); - this.visitNode(node.typeArgumentList); - }; - SyntaxWalker.prototype.visitTypeQuery = function (node) { - this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.name); - }; - SyntaxWalker.prototype.visitInterfaceDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.interfaceKeyword); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); - this.visitList(node.heritageClauses); - this.visitNode(node.body); - }; - SyntaxWalker.prototype.visitFunctionDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.functionKeyword); - this.visitToken(node.identifier); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitModuleDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.moduleKeyword); - this.visitOptionalNodeOrToken(node.name); - this.visitOptionalToken(node.stringLiteral); - this.visitToken(node.openBraceToken); - this.visitList(node.moduleElements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitClassDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.classKeyword); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); - this.visitList(node.heritageClauses); - this.visitToken(node.openBraceToken); - this.visitList(node.classElements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitEnumDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.enumKeyword); - this.visitToken(node.identifier); - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.enumElements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitImportDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.importKeyword); - this.visitToken(node.identifier); - this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.moduleReference); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitExportAssignment = function (node) { - this.visitToken(node.exportKeyword); - this.visitToken(node.equalsToken); - this.visitToken(node.identifier); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitMemberFunctionDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitMemberVariableDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.variableDeclarator); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitConstructorDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.constructorKeyword); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitIndexMemberDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.indexSignature); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitGetAccessor = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.getKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitSetAccessor = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.setKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitPropertySignature = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - }; - SyntaxWalker.prototype.visitCallSignature = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitOptionalNode(node.typeAnnotation); - }; - SyntaxWalker.prototype.visitConstructSignature = function (node) { - this.visitToken(node.newKeyword); - this.visitNode(node.callSignature); - }; - SyntaxWalker.prototype.visitIndexSignature = function (node) { - this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.parameters); - this.visitToken(node.closeBracketToken); - this.visitOptionalNode(node.typeAnnotation); - }; - SyntaxWalker.prototype.visitMethodSignature = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalToken(node.questionToken); - this.visitNode(node.callSignature); - }; - SyntaxWalker.prototype.visitBlock = function (node) { - this.visitToken(node.openBraceToken); - this.visitList(node.statements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitIfStatement = function (node) { - this.visitToken(node.ifKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - this.visitOptionalNode(node.elseClause); - }; - SyntaxWalker.prototype.visitVariableStatement = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.variableDeclaration); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitExpressionStatement = function (node) { - this.visitNodeOrToken(node.expression); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitReturnStatement = function (node) { - this.visitToken(node.returnKeyword); - this.visitOptionalNodeOrToken(node.expression); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitSwitchStatement = function (node) { - this.visitToken(node.switchKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - this.visitToken(node.openBraceToken); - this.visitList(node.switchClauses); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitBreakStatement = function (node) { - this.visitToken(node.breakKeyword); - this.visitOptionalToken(node.identifier); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitContinueStatement = function (node) { - this.visitToken(node.continueKeyword); - this.visitOptionalToken(node.identifier); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitForStatement = function (node) { - this.visitToken(node.forKeyword); - this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.initializer); - this.visitToken(node.firstSemicolonToken); - this.visitOptionalNodeOrToken(node.condition); - this.visitToken(node.secondSemicolonToken); - this.visitOptionalNodeOrToken(node.incrementor); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitForInStatement = function (node) { - this.visitToken(node.forKeyword); - this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.left); - this.visitToken(node.inKeyword); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitEmptyStatement = function (node) { - this.visitToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitThrowStatement = function (node) { - this.visitToken(node.throwKeyword); - this.visitNodeOrToken(node.expression); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitWhileStatement = function (node) { - this.visitToken(node.whileKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitTryStatement = function (node) { - this.visitToken(node.tryKeyword); - this.visitNode(node.block); - this.visitOptionalNode(node.catchClause); - this.visitOptionalNode(node.finallyClause); - }; - SyntaxWalker.prototype.visitLabeledStatement = function (node) { - this.visitToken(node.identifier); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitDoStatement = function (node) { - this.visitToken(node.doKeyword); - this.visitNodeOrToken(node.statement); - this.visitToken(node.whileKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitDebuggerStatement = function (node) { - this.visitToken(node.debuggerKeyword); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitWithStatement = function (node) { - this.visitToken(node.withKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitPrefixUnaryExpression = function (node) { - this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.operand); - }; - SyntaxWalker.prototype.visitDeleteExpression = function (node) { - this.visitToken(node.deleteKeyword); - this.visitNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitTypeOfExpression = function (node) { - this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitVoidExpression = function (node) { - this.visitToken(node.voidKeyword); - this.visitNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitConditionalExpression = function (node) { - this.visitNodeOrToken(node.condition); - this.visitToken(node.questionToken); - this.visitNodeOrToken(node.whenTrue); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.whenFalse); - }; - SyntaxWalker.prototype.visitBinaryExpression = function (node) { - this.visitNodeOrToken(node.left); - this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.right); - }; - SyntaxWalker.prototype.visitPostfixUnaryExpression = function (node) { - this.visitNodeOrToken(node.operand); - this.visitToken(node.operatorToken); - }; - SyntaxWalker.prototype.visitMemberAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitToken(node.dotToken); - this.visitToken(node.name); - }; - SyntaxWalker.prototype.visitInvocationExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitNode(node.argumentList); - }; - SyntaxWalker.prototype.visitArrayLiteralExpression = function (node) { - this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.expressions); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitObjectLiteralExpression = function (node) { - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.propertyAssignments); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitObjectCreationExpression = function (node) { - this.visitToken(node.newKeyword); - this.visitNodeOrToken(node.expression); - this.visitOptionalNode(node.argumentList); - }; - SyntaxWalker.prototype.visitParenthesizedExpression = function (node) { - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - this.visitNode(node.callSignature); - this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitSimpleArrowFunctionExpression = function (node) { - this.visitNode(node.parameter); - this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitCastExpression = function (node) { - this.visitToken(node.lessThanToken); - this.visitNodeOrToken(node.type); - this.visitToken(node.greaterThanToken); - this.visitNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitElementAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitToken(node.openBracketToken); - this.visitNodeOrToken(node.argumentExpression); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitFunctionExpression = function (node) { - this.visitToken(node.functionKeyword); - this.visitOptionalToken(node.identifier); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitOmittedExpression = function (node) { - }; - SyntaxWalker.prototype.visitVariableDeclaration = function (node) { - this.visitToken(node.varKeyword); - this.visitSeparatedList(node.variableDeclarators); - }; - SyntaxWalker.prototype.visitVariableDeclarator = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); - }; - SyntaxWalker.prototype.visitArgumentList = function (node) { - this.visitOptionalNode(node.typeArgumentList); - this.visitToken(node.openParenToken); - this.visitSeparatedList(node.arguments); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitParameterList = function (node) { - this.visitToken(node.openParenToken); - this.visitSeparatedList(node.parameters); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitTypeArgumentList = function (node) { - this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeArguments); - this.visitToken(node.greaterThanToken); - }; - SyntaxWalker.prototype.visitTypeParameterList = function (node) { - this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeParameters); - this.visitToken(node.greaterThanToken); - }; - SyntaxWalker.prototype.visitHeritageClause = function (node) { - this.visitToken(node.extendsOrImplementsKeyword); - this.visitSeparatedList(node.typeNames); - }; - SyntaxWalker.prototype.visitEqualsValueClause = function (node) { - this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.value); - }; - SyntaxWalker.prototype.visitCaseSwitchClause = function (node) { - this.visitToken(node.caseKeyword); - this.visitNodeOrToken(node.expression); - this.visitToken(node.colonToken); - this.visitList(node.statements); - }; - SyntaxWalker.prototype.visitDefaultSwitchClause = function (node) { - this.visitToken(node.defaultKeyword); - this.visitToken(node.colonToken); - this.visitList(node.statements); - }; - SyntaxWalker.prototype.visitElseClause = function (node) { - this.visitToken(node.elseKeyword); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitCatchClause = function (node) { - this.visitToken(node.catchKeyword); - this.visitToken(node.openParenToken); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeAnnotation); - this.visitToken(node.closeParenToken); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitFinallyClause = function (node) { - this.visitToken(node.finallyKeyword); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitTypeParameter = function (node) { - this.visitToken(node.identifier); - this.visitOptionalNode(node.constraint); - }; - SyntaxWalker.prototype.visitConstraint = function (node) { - this.visitToken(node.extendsKeyword); - this.visitNodeOrToken(node.typeOrExpression); - }; - SyntaxWalker.prototype.visitSimplePropertyAssignment = function (node) { - this.visitToken(node.propertyName); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitFunctionPropertyAssignment = function (node) { - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitParameter = function (node) { - this.visitOptionalToken(node.dotDotDotToken); - this.visitList(node.modifiers); - this.visitToken(node.identifier); - this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); - }; - SyntaxWalker.prototype.visitEnumElement = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.equalsValueClause); - }; - SyntaxWalker.prototype.visitTypeAnnotation = function (node) { - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.type); - }; - SyntaxWalker.prototype.visitExternalModuleReference = function (node) { - this.visitToken(node.requireKeyword); - this.visitToken(node.openParenToken); - this.visitToken(node.stringLiteral); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitModuleNameModuleReference = function (node) { - this.visitNodeOrToken(node.moduleName); - }; - return SyntaxWalker; - })(); - TypeScript.SyntaxWalker = SyntaxWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var DepthLimitedWalker = (function (_super) { - __extends(DepthLimitedWalker, _super); - function DepthLimitedWalker(maximumDepth) { - _super.call(this); - this._depth = 0; - this._maximumDepth = 0; - this._maximumDepth = maximumDepth; - } - DepthLimitedWalker.prototype.visitNode = function (node) { - if (this._depth < this._maximumDepth) { - this._depth++; - _super.prototype.visitNode.call(this, node); - this._depth--; - } - }; - return DepthLimitedWalker; - })(TypeScript.SyntaxWalker); - TypeScript.DepthLimitedWalker = DepthLimitedWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Parser) { - Parser.syntaxFactory; - var arrayPool = []; - var arrayPoolCount = 0; - function getArray() { - if (arrayPoolCount === 0) { - return []; - } - arrayPoolCount--; - var result = arrayPool[arrayPoolCount]; - arrayPool[arrayPoolCount] = null; - return result; - } - function returnZeroLengthArray(array) { - if (array.length === 0) { - returnArray(array); - } - } - function returnArray(array) { - array.length = 0; - arrayPool[arrayPoolCount] = array; - arrayPoolCount++; - } - function createParseSyntaxTree() { - var fileName; - var source; - var languageVersion; - var listParsingState = 0; - var isInStrictMode = false; - var diagnostics = []; - var parseNodeData = 0; - function parseSyntaxTree(_source, isDeclaration) { - fileName = _source.fileName; - source = _source; - languageVersion = source.languageVersion; - var result = parseSyntaxTreeWorker(isDeclaration); - diagnostics = []; - parseNodeData = 0 /* None */; - fileName = null; - source.release(); - source = null; - _source = null; - return result; - } - function parseSyntaxTreeWorker(isDeclaration) { - var sourceUnit = parseSourceUnit(); - var allDiagnostics = source.tokenDiagnostics().concat(diagnostics); - allDiagnostics.sort(function (a, b) { return a.start() - b.start(); }); - return new TypeScript.SyntaxTree(Parser.syntaxFactory.isConcrete, sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); - } - function getRewindPoint() { - var rewindPoint = source.getRewindPoint(); - rewindPoint.diagnosticsCount = diagnostics.length; - rewindPoint.isInStrictMode = isInStrictMode; - rewindPoint.listParsingState = listParsingState; - return rewindPoint; - } - function rewind(rewindPoint) { - source.rewind(rewindPoint); - diagnostics.length = rewindPoint.diagnosticsCount; - } - function releaseRewindPoint(rewindPoint) { - source.releaseRewindPoint(rewindPoint); - } - function currentNode() { - var node = source.currentNode(); - if (node === null || TypeScript.parsedInStrictMode(node) !== isInStrictMode) { - return null; - } - return node; - } - function currentToken() { - return source.currentToken(); - } - function currentContextualToken() { - return source.currentContextualToken(); - } - function peekToken(n) { - return source.peekToken(n); - } - function consumeToken(token) { - source.consumeToken(token); - return token; - } - function consumeNode(node) { - source.consumeNode(node); - } - function eatToken(kind) { - var token = currentToken(); - if (token.kind() === kind) { - return consumeToken(token); - } - return createMissingToken(kind, token); - } - function tryEatToken(kind) { - var _currentToken = currentToken(); - if (_currentToken.kind() === kind) { - return consumeToken(_currentToken); - } - return null; - } - function isIdentifier(token) { - var tokenKind = token.kind(); - if (tokenKind === 11 /* IdentifierName */) { - return true; - } - if (tokenKind >= TypeScript.SyntaxKind.FirstFutureReservedStrictKeyword) { - if (tokenKind <= TypeScript.SyntaxKind.LastFutureReservedStrictKeyword) { - return !isInStrictMode; - } - return tokenKind <= TypeScript.SyntaxKind.LastTypeScriptKeyword; - } - return false; - } - function eatIdentifierNameToken() { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 11 /* IdentifierName */) { - return consumeToken(token); - } - if (TypeScript.SyntaxFacts.isAnyKeyword(tokenKind)) { - return TypeScript.Syntax.convertKeywordToIdentifier(consumeToken(token)); - } - return createMissingToken(11 /* IdentifierName */, token); - } - function eatOptionalIdentifierToken() { - return isIdentifier(currentToken()) ? eatIdentifierToken() : null; - } - function eatIdentifierToken(diagnosticCode) { - var token = currentToken(); - if (isIdentifier(token)) { - consumeToken(token); - if (token.kind() === 11 /* IdentifierName */) { - return token; - } - return TypeScript.Syntax.convertKeywordToIdentifier(token); - } - return createMissingToken(11 /* IdentifierName */, token, diagnosticCode); - } - function previousTokenHasTrailingNewLine(token) { - var tokenFullStart = token.fullStart(); - if (tokenFullStart === 0) { - return false; - } - var lineNumber = source.text.lineMap().getLineNumberFromPosition(tokenFullStart); - var lineStart = source.text.lineMap().getLineStartPosition(lineNumber); - return lineStart == tokenFullStart; - } - function canEatAutomaticSemicolon(allowWithoutNewLine) { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 10 /* EndOfFileToken */) { - return true; - } - if (tokenKind === 71 /* CloseBraceToken */) { - return true; - } - if (allowWithoutNewLine) { - return true; - } - if (previousTokenHasTrailingNewLine(token)) { - return true; - } - return false; - } - function canEatExplicitOrAutomaticSemicolon(allowWithoutNewline) { - var token = currentToken(); - if (token.kind() === 78 /* SemicolonToken */) { - return true; - } - return canEatAutomaticSemicolon(allowWithoutNewline); - } - function eatExplicitOrAutomaticSemicolon(allowWithoutNewline) { - var token = currentToken(); - if (token.kind() === 78 /* SemicolonToken */) { - return consumeToken(token); - } - if (canEatAutomaticSemicolon(allowWithoutNewline)) { - return null; - } - return eatToken(78 /* SemicolonToken */); - } - function createMissingToken(expectedKind, actual, diagnosticCode) { - var diagnostic = getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode); - addDiagnostic(diagnostic); - return TypeScript.Syntax.emptyToken(expectedKind); - } - function getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode) { - var token = currentToken(); - var args = null; - if (!diagnosticCode) { - if (TypeScript.SyntaxFacts.isAnyKeyword(expectedKind) || TypeScript.SyntaxFacts.isAnyPunctuation(expectedKind)) { - diagnosticCode = TypeScript.DiagnosticCode._0_expected; - args = [TypeScript.SyntaxFacts.getText(expectedKind)]; - } - else { - if (actual !== null && TypeScript.SyntaxFacts.isAnyKeyword(actual.kind())) { - diagnosticCode = TypeScript.DiagnosticCode.Identifier_expected_0_is_a_keyword; - args = [TypeScript.SyntaxFacts.getText(actual.kind())]; - } - else { - diagnosticCode = TypeScript.DiagnosticCode.Identifier_expected; - } - } - } - return new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token, source.text), TypeScript.width(token), diagnosticCode, args); - } - function getBinaryExpressionPrecedence(tokenKind) { - switch (tokenKind) { - case 104 /* BarBarToken */: - return 2 /* LogicalOrExpressionPrecedence */; - case 103 /* AmpersandAmpersandToken */: - return 3 /* LogicalAndExpressionPrecedence */; - case 99 /* BarToken */: - return 4 /* BitwiseOrExpressionPrecedence */; - case 100 /* CaretToken */: - return 5 /* BitwiseExclusiveOrExpressionPrecedence */; - case 98 /* AmpersandToken */: - return 6 /* BitwiseAndExpressionPrecedence */; - case 84 /* EqualsEqualsToken */: - case 86 /* ExclamationEqualsToken */: - case 87 /* EqualsEqualsEqualsToken */: - case 88 /* ExclamationEqualsEqualsToken */: - return 7 /* EqualityExpressionPrecedence */; - case 80 /* LessThanToken */: - case 81 /* GreaterThanToken */: - case 82 /* LessThanEqualsToken */: - case 83 /* GreaterThanEqualsToken */: - case 30 /* InstanceOfKeyword */: - case 29 /* InKeyword */: - return 8 /* RelationalExpressionPrecedence */; - case 95 /* LessThanLessThanToken */: - case 96 /* GreaterThanGreaterThanToken */: - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - return 9 /* ShiftExpressionPrecdence */; - case 89 /* PlusToken */: - case 90 /* MinusToken */: - return 10 /* AdditiveExpressionPrecedence */; - case 91 /* AsteriskToken */: - case 118 /* SlashToken */: - case 92 /* PercentToken */: - return 11 /* MultiplicativeExpressionPrecedence */; - } - throw TypeScript.Errors.invalidOperation(); - } - function addSkippedTokenAfterNodeOrToken(nodeOrToken, skippedToken) { - if (TypeScript.isToken(nodeOrToken)) { - return addSkippedTokenAfterToken(nodeOrToken, skippedToken); - } - else if (TypeScript.isNode(nodeOrToken)) { - return addSkippedTokenAfterNode(nodeOrToken, skippedToken); - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - function replaceTokenInParent(oldToken, newToken) { - replaceTokenInParentWorker(oldToken, newToken); - var parent = oldToken.parent; - newToken.parent = parent; - TypeScript.Debug.assert(TypeScript.isNode(parent) || TypeScript.isList(parent) || TypeScript.isSeparatedList(parent)); - var dataElement = parent; - if (dataElement.data) { - dataElement.data &= 4 /* NodeParsedInStrictModeMask */; - } - } - function replaceTokenInParentWorker(oldToken, newToken) { - var parent = oldToken.parent; - if (TypeScript.isNode(parent)) { - var node = parent; - for (var key in node) { - if (node[key] === oldToken) { - node[key] = newToken; - return; - } - } - } - else if (TypeScript.isList(parent)) { - var list1 = parent; - for (var i = 0, n = list1.length; i < n; i++) { - if (list1[i] === oldToken) { - list1[i] = newToken; - return; - } - } - } - else if (TypeScript.isSeparatedList(parent)) { - var list2 = parent; - for (var i = 0, n = TypeScript.childCount(list2); i < n; i++) { - if (TypeScript.childAt(list2, i) === oldToken) { - if (i % 2 === 0) { - list2[i / 2] = newToken; - } - else { - list2.separators[(i - 1) / 2] = newToken; - } - return; - } - } - } - throw TypeScript.Errors.invalidOperation(); - } - function addSkippedTokenAfterNode(node, skippedToken) { - var oldToken = TypeScript.lastToken(node); - var newToken = addSkippedTokenAfterToken(oldToken, skippedToken); - replaceTokenInParent(oldToken, newToken); - return node; - } - function addSkippedTokensBeforeNode(node, skippedTokens) { - if (skippedTokens.length > 0) { - var oldToken = TypeScript.firstToken(node); - var newToken = addSkippedTokensBeforeToken(oldToken, skippedTokens); - replaceTokenInParent(oldToken, newToken); - } - return node; - } - function addSkippedTokensBeforeToken(token, skippedTokens) { - var leadingTrivia = []; - for (var i = 0, n = skippedTokens.length; i < n; i++) { - var skippedToken = skippedTokens[i]; - addSkippedTokenToTriviaArray(leadingTrivia, skippedToken); - } - addTriviaTo(token.leadingTrivia(source.text), leadingTrivia); - var updatedToken = TypeScript.Syntax.withLeadingTrivia(token, TypeScript.Syntax.triviaList(leadingTrivia), source.text); - updatedToken.setFullStart(skippedTokens[0].fullStart()); - returnArray(skippedTokens); - return updatedToken; - } - function addSkippedTokensAfterToken(token, skippedTokens) { - if (skippedTokens.length === 0) { - returnArray(skippedTokens); - return token; - } - var trailingTrivia = token.trailingTrivia(source.text).toArray(); - for (var i = 0, n = skippedTokens.length; i < n; i++) { - addSkippedTokenToTriviaArray(trailingTrivia, skippedTokens[i]); - } - returnArray(skippedTokens); - return TypeScript.Syntax.withTrailingTrivia(token, TypeScript.Syntax.triviaList(trailingTrivia), source.text); - } - function addSkippedTokenAfterToken(token, skippedToken) { - var trailingTrivia = token.trailingTrivia(source.text).toArray(); - addSkippedTokenToTriviaArray(trailingTrivia, skippedToken); - return TypeScript.Syntax.withTrailingTrivia(token, TypeScript.Syntax.triviaList(trailingTrivia), source.text); - } - function addSkippedTokenToTriviaArray(array, skippedToken) { - addTriviaTo(skippedToken.leadingTrivia(source.text), array); - var trimmedToken = TypeScript.Syntax.withTrailingTrivia(TypeScript.Syntax.withLeadingTrivia(skippedToken, TypeScript.Syntax.emptyTriviaList, source.text), TypeScript.Syntax.emptyTriviaList, source.text); - trimmedToken.setFullStart(TypeScript.start(skippedToken, source.text)); - array.push(TypeScript.Syntax.skippedTokenTrivia(trimmedToken, source.text)); - addTriviaTo(skippedToken.trailingTrivia(source.text), array); - } - function addTriviaTo(list, array) { - for (var i = 0, n = list.count(); i < n; i++) { - array.push(list.syntaxTriviaAt(i)); - } - } - function setStrictMode(_isInStrictMode) { - isInStrictMode = _isInStrictMode; - parseNodeData = _isInStrictMode ? 4 /* NodeParsedInStrictModeMask */ : 0; - } - function parseSourceUnit() { - var savedIsInStrictMode = isInStrictMode; - var skippedTokens = getArray(); - var moduleElements = parseSyntaxList(0 /* SourceUnit_ModuleElements */, skippedTokens, updateStrictModeState); - setStrictMode(savedIsInStrictMode); - var sourceUnit = new Parser.syntaxFactory.SourceUnitSyntax(parseNodeData, moduleElements, currentToken()); - sourceUnit = addSkippedTokensBeforeNode(sourceUnit, skippedTokens); - if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { - TypeScript.Debug.assert(TypeScript.fullWidth(sourceUnit) === source.text.length()); - if (TypeScript.Debug.shouldAssert(3 /* VeryAggressive */)) { - TypeScript.Debug.assert(TypeScript.fullText(sourceUnit) === source.text.substr(0, source.text.length())); - } - } - return sourceUnit; - } - function updateStrictModeState(items) { - if (!isInStrictMode) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - if (!TypeScript.SyntaxFacts.isDirectivePrologueElement(item)) { - return; - } - } - setStrictMode(TypeScript.SyntaxFacts.isUseStrictDirective(items[items.length - 1])); - } - } - function isModuleElement(inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isModuleElement(currentNode())) { - return true; - } - var _modifierCount = modifierCount(); - return isInterfaceEnumClassModuleImportOrExport(_modifierCount) || isStatement(_modifierCount, inErrorRecovery); - } - function tryParseModuleElement(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isModuleElement(node)) { - consumeNode(node); - return node; - } - var _currentToken = currentToken(); - var _modifierCount = modifierCount(); - if (_modifierCount) { - switch (peekToken(_modifierCount).kind()) { - case 49 /* ImportKeyword */: - return parseImportDeclaration(); - case 65 /* ModuleKeyword */: - return parseModuleDeclaration(); - case 52 /* InterfaceKeyword */: - return parseInterfaceDeclaration(); - case 44 /* ClassKeyword */: - return parseClassDeclaration(); - case 46 /* EnumKeyword */: - return parseEnumDeclaration(); - } - } - var nextToken = peekToken(1); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 65 /* ModuleKeyword */: - if (isIdentifier(nextToken) || nextToken.kind() === 14 /* StringLiteral */) { - return parseModuleDeclaration(); - } - break; - case 49 /* ImportKeyword */: - if (isIdentifier(nextToken)) { - return parseImportDeclaration(); - } - break; - case 44 /* ClassKeyword */: - if (isIdentifier(nextToken)) { - return parseClassDeclaration(); - } - break; - case 46 /* EnumKeyword */: - if (isIdentifier(nextToken)) { - return parseEnumDeclaration(); - } - break; - case 52 /* InterfaceKeyword */: - if (isIdentifier(nextToken)) { - return parseInterfaceDeclaration(); - } - break; - case 47 /* ExportKeyword */: - if (nextToken.kind() === 107 /* EqualsToken */) { - return parseExportAssignment(); - } - break; - } - return tryParseStatementWorker(_currentToken, currentTokenKind, _modifierCount, inErrorRecovery); - } - function parseImportDeclaration() { - return new Parser.syntaxFactory.ImportDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(49 /* ImportKeyword */), eatIdentifierToken(), eatToken(107 /* EqualsToken */), parseModuleReference(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseExportAssignment() { - return new Parser.syntaxFactory.ExportAssignmentSyntax(parseNodeData, eatToken(47 /* ExportKeyword */), eatToken(107 /* EqualsToken */), eatIdentifierToken(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseModuleReference() { - return isExternalModuleReference() ? parseExternalModuleReference() : parseModuleNameModuleReference(); - } - function isExternalModuleReference() { - return currentToken().kind() === 66 /* RequireKeyword */ && peekToken(1).kind() === 72 /* OpenParenToken */; - } - function parseExternalModuleReference() { - return new Parser.syntaxFactory.ExternalModuleReferenceSyntax(parseNodeData, eatToken(66 /* RequireKeyword */), eatToken(72 /* OpenParenToken */), eatToken(14 /* StringLiteral */), eatToken(73 /* CloseParenToken */)); - } - function parseModuleNameModuleReference() { - return new Parser.syntaxFactory.ModuleNameModuleReferenceSyntax(parseNodeData, parseName(false)); - } - function tryParseTypeArgumentList(inExpression) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 80 /* LessThanToken */) { - return null; - } - if (!inExpression) { - var lessThanToken = consumeToken(_currentToken); - var skippedTokens = getArray(); - var typeArguments = parseSeparatedSyntaxList(19 /* TypeArgumentList_Types */, skippedTokens); - lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - return new Parser.syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, eatToken(81 /* GreaterThanToken */)); - } - var rewindPoint = getRewindPoint(); - var lessThanToken = consumeToken(_currentToken); - var skippedTokens = getArray(); - var typeArguments = parseSeparatedSyntaxList(19 /* TypeArgumentList_Types */, skippedTokens); - var lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - var greaterThanToken = eatToken(81 /* GreaterThanToken */); - if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind())) { - rewind(rewindPoint); - releaseRewindPoint(rewindPoint); - return null; - } - else { - releaseRewindPoint(rewindPoint); - return new Parser.syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); - } - } - function canFollowTypeArgumentListInExpression(kind) { - switch (kind) { - case 72 /* OpenParenToken */: - case 76 /* DotToken */: - case 73 /* CloseParenToken */: - case 75 /* CloseBracketToken */: - case 106 /* ColonToken */: - case 78 /* SemicolonToken */: - case 79 /* CommaToken */: - case 105 /* QuestionToken */: - case 84 /* EqualsEqualsToken */: - case 87 /* EqualsEqualsEqualsToken */: - case 86 /* ExclamationEqualsToken */: - case 88 /* ExclamationEqualsEqualsToken */: - case 103 /* AmpersandAmpersandToken */: - case 104 /* BarBarToken */: - case 100 /* CaretToken */: - case 98 /* AmpersandToken */: - case 99 /* BarToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: - return true; - default: - return false; - } - } - function parseName(allowIdentifierName) { - return tryParseName(allowIdentifierName) || eatIdentifierToken(); - } - function eatRightSideOfName(allowIdentifierNames) { - var _currentToken = currentToken(); - if (TypeScript.SyntaxFacts.isAnyKeyword(_currentToken.kind()) && previousTokenHasTrailingNewLine(_currentToken)) { - var token1 = peekToken(1); - if (!TypeScript.existsNewLineBetweenTokens(_currentToken, token1, source.text) && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token1)) { - return createMissingToken(11 /* IdentifierName */, _currentToken); - } - } - return allowIdentifierNames ? eatIdentifierNameToken() : eatIdentifierToken(); - } - function tryParseName(allowIdentifierNames) { - var token0 = currentToken(); - var shouldContinue = isIdentifier(token0); - if (!shouldContinue) { - return null; - } - var current = eatIdentifierToken(); - while (shouldContinue && currentToken().kind() === 76 /* DotToken */) { - var dotToken = consumeToken(currentToken()); - var identifierName = eatRightSideOfName(allowIdentifierNames); - current = new Parser.syntaxFactory.QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); - shouldContinue = identifierName.fullWidth() > 0; - } - return current; - } - function parseEnumDeclaration() { - var modifiers = parseModifiers(); - var enumKeyword = eatToken(46 /* EnumKeyword */); - var identifier = eatIdentifierToken(); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var enumElements = TypeScript.Syntax.emptySeparatedList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - enumElements = parseSeparatedSyntaxList(8 /* EnumDeclaration_EnumElements */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new Parser.syntaxFactory.EnumDeclarationSyntax(parseNodeData, modifiers, enumKeyword, identifier, openBraceToken, enumElements, eatToken(71 /* CloseBraceToken */)); - } - function isEnumElement(inErrorRecovery) { - var node = currentNode(); - if (node !== null && node.kind() === 243 /* EnumElement */) { - return true; - } - return isPropertyName(currentToken(), inErrorRecovery); - } - function tryParseEnumElementEqualsValueClause() { - return isEqualsValueClause(false) ? parseEqualsValueClause(true) : null; - } - function tryParseEnumElement(inErrorRecovery) { - var node = currentNode(); - if (node !== null && node.kind() === 243 /* EnumElement */) { - consumeNode(node); - return node; - } - if (!isPropertyName(currentToken(), inErrorRecovery)) { - return null; - } - return new Parser.syntaxFactory.EnumElementSyntax(parseNodeData, eatPropertyName(), tryParseEnumElementEqualsValueClause()); - } - function isModifierKind(kind) { - switch (kind) { - case 47 /* ExportKeyword */: - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 58 /* StaticKeyword */: - case 63 /* DeclareKeyword */: - return true; - } - return false; - } - function isModifier(token, index) { - if (isModifierKind(token.kind())) { - var nextToken = peekToken(index + 1); - var nextTokenKind = nextToken.kind(); - switch (nextTokenKind) { - case 11 /* IdentifierName */: - case 74 /* OpenBracketToken */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - return true; - default: - return TypeScript.SyntaxFacts.isAnyKeyword(nextTokenKind); - } - } - return false; - } - function modifierCount() { - var modifierCount = 0; - while (isModifier(peekToken(modifierCount), modifierCount)) { - modifierCount++; - } - return modifierCount; - } - function parseModifiers() { - var tokens = getArray(); - while (true) { - var token = currentToken(); - if (isModifier(token, 0)) { - tokens.push(consumeToken(token)); - continue; - } - break; - } - var result = TypeScript.Syntax.list(tokens); - returnZeroLengthArray(tokens); - return result; - } - function parseHeritageClauses() { - var heritageClauses = TypeScript.Syntax.emptyList(); - if (isHeritageClause()) { - heritageClauses = parseSyntaxList(10 /* ClassOrInterfaceDeclaration_HeritageClauses */, null); - } - return heritageClauses; - } - function tryParseHeritageClauseTypeName() { - return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : null; - } - function parseClassDeclaration() { - var modifiers = parseModifiers(); - var classKeyword = eatToken(44 /* ClassKeyword */); - var identifier = eatIdentifierToken(); - var typeParameterList = tryParseTypeParameterList(false); - var heritageClauses = parseHeritageClauses(); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var classElements = TypeScript.Syntax.emptyList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - classElements = parseSyntaxList(1 /* ClassDeclaration_ClassElements */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - ; - return new Parser.syntaxFactory.ClassDeclarationSyntax(parseNodeData, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, eatToken(71 /* CloseBraceToken */)); - } - function isAccessor(modifierCount, inErrorRecovery) { - var tokenKind = peekToken(modifierCount).kind(); - if (tokenKind !== 64 /* GetKeyword */ && tokenKind !== 68 /* SetKeyword */) { - return false; - } - return isPropertyName(peekToken(modifierCount + 1), inErrorRecovery); - } - function parseAccessor(checkForStrictMode) { - var modifiers = parseModifiers(); - var _currenToken = currentToken(); - var tokenKind = _currenToken.kind(); - if (tokenKind === 64 /* GetKeyword */) { - return parseGetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); - } - else if (tokenKind === 68 /* SetKeyword */) { - return parseSetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - function parseGetMemberAccessorDeclaration(modifiers, getKeyword, checkForStrictMode) { - return new Parser.syntaxFactory.GetAccessorSyntax(parseNodeData, modifiers, consumeToken(getKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); - } - function parseSetMemberAccessorDeclaration(modifiers, setKeyword, checkForStrictMode) { - return new Parser.syntaxFactory.SetAccessorSyntax(parseNodeData, modifiers, consumeToken(setKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); - } - function isClassElement(inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isClassElement(currentNode())) { - return true; - } - var _modifierCount = modifierCount(); - return isConstructorDeclaration(_modifierCount) || isMemberFunctionDeclaration(_modifierCount, inErrorRecovery) || isAccessor(_modifierCount, inErrorRecovery) || isMemberVariableDeclaration(_modifierCount, inErrorRecovery) || isIndexMemberDeclaration(_modifierCount); - } - function tryParseClassElement(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isClassElement(node)) { - consumeNode(node); - return node; - } - var _modifierCount = modifierCount(); - if (isConstructorDeclaration(_modifierCount)) { - return parseConstructorDeclaration(); - } - else if (isMemberFunctionDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberFunctionDeclaration(); - } - else if (isAccessor(_modifierCount, inErrorRecovery)) { - return parseAccessor(false); - } - else if (isMemberVariableDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberVariableDeclaration(); - } - else if (isIndexMemberDeclaration(_modifierCount)) { - return parseIndexMemberDeclaration(); - } - else { - return null; - } - } - function isConstructorDeclaration(modifierCount) { - return peekToken(modifierCount).kind() === 62 /* ConstructorKeyword */; - } - function parseConstructorDeclaration() { - var modifiers = parseModifiers(); - var constructorKeyword = eatToken(62 /* ConstructorKeyword */); - var callSignature = parseCallSignature(false); - var semicolonToken = null; - var block = null; - if (isBlock()) { - block = parseBlock(false, true); - } - else { - semicolonToken = eatExplicitOrAutomaticSemicolon(false); - } - return new Parser.syntaxFactory.ConstructorDeclarationSyntax(parseNodeData, modifiers, constructorKeyword, callSignature, block, semicolonToken); - } - function isMemberFunctionDeclaration(modifierCount, inErrorRecovery) { - return isPropertyName(peekToken(modifierCount), inErrorRecovery) && isCallSignature(modifierCount + 1); - } - function parseMemberFunctionDeclaration() { - var modifiers = parseModifiers(); - var propertyName = eatPropertyName(); - var callSignature = parseCallSignature(false); - var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - var block = null; - var semicolon = null; - if (parseBlockEvenWithNoOpenBrace || isBlock()) { - block = parseBlock(parseBlockEvenWithNoOpenBrace, true); - } - else { - semicolon = eatExplicitOrAutomaticSemicolon(false); - } - return new Parser.syntaxFactory.MemberFunctionDeclarationSyntax(parseNodeData, modifiers, propertyName, callSignature, block, semicolon); - } - function isDefinitelyMemberVariablePropertyName(index) { - if (TypeScript.SyntaxFacts.isAnyKeyword(peekToken(index).kind())) { - var nextToken = peekToken(index + 1); - switch (nextToken.kind()) { - case 78 /* SemicolonToken */: - case 107 /* EqualsToken */: - case 106 /* ColonToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: - return true; - default: - return previousTokenHasTrailingNewLine(nextToken); - } - } - else { - return true; - } - } - function isMemberVariableDeclaration(modifierCount, inErrorRecover) { - return isPropertyName(peekToken(modifierCount), inErrorRecover) && isDefinitelyMemberVariablePropertyName(modifierCount); - } - function parseMemberVariableDeclaration() { - return new Parser.syntaxFactory.MemberVariableDeclarationSyntax(parseNodeData, parseModifiers(), tryParseVariableDeclarator(true, true), eatExplicitOrAutomaticSemicolon(false)); - } - function isIndexMemberDeclaration(modifierCount) { - return isIndexSignature(modifierCount); - } - function parseIndexMemberDeclaration() { - return new Parser.syntaxFactory.IndexMemberDeclarationSyntax(parseNodeData, parseModifiers(), parseIndexSignature(), eatExplicitOrAutomaticSemicolon(false)); - } - function tryAddUnexpectedEqualsGreaterThanToken(callSignature) { - var token0 = currentToken(); - var hasEqualsGreaterThanToken = token0.kind() === 85 /* EqualsGreaterThanToken */; - if (hasEqualsGreaterThanToken) { - var _lastToken = TypeScript.lastToken(callSignature); - if (_lastToken && _lastToken.fullWidth() > 0) { - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token0, source.text), TypeScript.width(token0), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [TypeScript.SyntaxFacts.getText(70 /* OpenBraceToken */)]); - addDiagnostic(diagnostic); - consumeToken(token0); - if (Parser.syntaxFactory.isConcrete) { - addSkippedTokenAfterNode(callSignature, token0); - } - return true; - } - } - return false; - } - function isFunctionDeclaration(modifierCount) { - return peekToken(modifierCount).kind() === 27 /* FunctionKeyword */; - } - function parseFunctionDeclaration() { - var modifiers = parseModifiers(); - var functionKeyword = eatToken(27 /* FunctionKeyword */); - var identifier = eatIdentifierToken(); - var callSignature = parseCallSignature(false); - var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - var semicolonToken = null; - var block = null; - if (parseBlockEvenWithNoOpenBrace || isBlock()) { - block = parseBlock(parseBlockEvenWithNoOpenBrace, true); - } - else { - semicolonToken = eatExplicitOrAutomaticSemicolon(false); - } - return new Parser.syntaxFactory.FunctionDeclarationSyntax(parseNodeData, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); - } - function parseModuleDeclaration() { - var modifiers = parseModifiers(); - var moduleKeyword = eatToken(65 /* ModuleKeyword */); - var moduleName = null; - var stringLiteral = null; - if (currentToken().kind() === 14 /* StringLiteral */) { - stringLiteral = eatToken(14 /* StringLiteral */); - } - else { - moduleName = parseName(false); - } - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var moduleElements = TypeScript.Syntax.emptyList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - moduleElements = parseSyntaxList(2 /* ModuleDeclaration_ModuleElements */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new Parser.syntaxFactory.ModuleDeclarationSyntax(parseNodeData, modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements, eatToken(71 /* CloseBraceToken */)); - } - function parseInterfaceDeclaration() { - return new Parser.syntaxFactory.InterfaceDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(52 /* InterfaceKeyword */), eatIdentifierToken(), tryParseTypeParameterList(false), parseHeritageClauses(), parseObjectType()); - } - function parseObjectType() { - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var typeMembers = TypeScript.Syntax.emptySeparatedList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - typeMembers = parseSeparatedSyntaxList(9 /* ObjectType_TypeMembers */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new Parser.syntaxFactory.ObjectTypeSyntax(parseNodeData, openBraceToken, typeMembers, eatToken(71 /* CloseBraceToken */)); - } - function isTypeMember(inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isTypeMember(currentNode())) { - return true; - } - return isCallSignature(0) || isConstructSignature() || isIndexSignature(0) || isMethodSignature(inErrorRecovery) || isPropertySignature(inErrorRecovery); - } - function tryParseTypeMember(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isTypeMember(node)) { - consumeNode(node); - return node; - } - if (isCallSignature(0)) { - return parseCallSignature(false); - } - else if (isConstructSignature()) { - return parseConstructSignature(); - } - else if (isIndexSignature(0)) { - return parseIndexSignature(); - } - else if (isMethodSignature(inErrorRecovery)) { - return parseMethodSignature(); - } - else if (isPropertySignature(inErrorRecovery)) { - return parsePropertySignature(); - } - else { - return null; - } - } - function parseConstructSignature() { - return new Parser.syntaxFactory.ConstructSignatureSyntax(parseNodeData, eatToken(31 /* NewKeyword */), parseCallSignature(false)); - } - function parseIndexSignature() { - var openBracketToken = eatToken(74 /* OpenBracketToken */); - var skippedTokens = getArray(); - var parameters = parseSeparatedSyntaxList(18 /* IndexSignature_Parameters */, skippedTokens); - openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - return new Parser.syntaxFactory.IndexSignatureSyntax(parseNodeData, openBracketToken, parameters, eatToken(75 /* CloseBracketToken */), parseOptionalTypeAnnotation(false)); - } - function parseMethodSignature() { - return new Parser.syntaxFactory.MethodSignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(105 /* QuestionToken */), parseCallSignature(false)); - } - function parsePropertySignature() { - return new Parser.syntaxFactory.PropertySignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(105 /* QuestionToken */), parseOptionalTypeAnnotation(false)); - } - function isCallSignature(peekIndex) { - var tokenKind = peekToken(peekIndex).kind(); - return tokenKind === 72 /* OpenParenToken */ || tokenKind === 80 /* LessThanToken */; - } - function isConstructSignature() { - if (currentToken().kind() !== 31 /* NewKeyword */) { - return false; - } - return isCallSignature(1); - } - function isIndexSignature(peekIndex) { - return peekToken(peekIndex).kind() === 74 /* OpenBracketToken */; - } - function isMethodSignature(inErrorRecovery) { - if (isPropertyName(currentToken(), inErrorRecovery)) { - if (isCallSignature(1)) { - return true; - } - if (peekToken(1).kind() === 105 /* QuestionToken */ && isCallSignature(2)) { - return true; - } - } - return false; - } - function isPropertySignature(inErrorRecovery) { - var _currentToken = currentToken(); - if (isModifier(_currentToken, 0)) { - if (!TypeScript.existsNewLineBetweenTokens(_currentToken, peekToken(1), source.text) && isPropertyName(peekToken(1), inErrorRecovery)) { - return false; - } - } - return isPropertyName(_currentToken, inErrorRecovery); - } - function isHeritageClause() { - var tokenKind = currentToken().kind(); - return tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */; - } - function isNotHeritageClauseTypeName() { - var tokenKind = currentToken().kind(); - if (tokenKind === 51 /* ImplementsKeyword */ || tokenKind === 48 /* ExtendsKeyword */) { - return isIdentifier(peekToken(1)); - } - return false; - } - function isHeritageClauseTypeName() { - if (isIdentifier(currentToken())) { - return !isNotHeritageClauseTypeName(); - } - return false; - } - function tryParseHeritageClause() { - var extendsOrImplementsKeyword = currentToken(); - var tokenKind = extendsOrImplementsKeyword.kind(); - if (tokenKind !== 48 /* ExtendsKeyword */ && tokenKind !== 51 /* ImplementsKeyword */) { - return null; - } - consumeToken(extendsOrImplementsKeyword); - var skippedTokens = getArray(); - var typeNames = parseSeparatedSyntaxList(11 /* HeritageClause_TypeNameList */, skippedTokens); - extendsOrImplementsKeyword = addSkippedTokensAfterToken(extendsOrImplementsKeyword, skippedTokens); - return new Parser.syntaxFactory.HeritageClauseSyntax(parseNodeData, extendsOrImplementsKeyword, typeNames); - } - function isInterfaceEnumClassModuleImportOrExport(modifierCount) { - var _currentToken = currentToken(); - if (modifierCount) { - switch (peekToken(modifierCount).kind()) { - case 49 /* ImportKeyword */: - case 65 /* ModuleKeyword */: - case 52 /* InterfaceKeyword */: - case 44 /* ClassKeyword */: - case 46 /* EnumKeyword */: - return true; - } - } - var nextToken = peekToken(1); - switch (_currentToken.kind()) { - case 65 /* ModuleKeyword */: - if (isIdentifier(nextToken) || nextToken.kind() === 14 /* StringLiteral */) { - return true; - } - break; - case 49 /* ImportKeyword */: - case 44 /* ClassKeyword */: - case 46 /* EnumKeyword */: - case 52 /* InterfaceKeyword */: - if (isIdentifier(nextToken)) { - return true; - } - break; - case 47 /* ExportKeyword */: - if (nextToken.kind() === 107 /* EqualsToken */) { - return true; - } - break; - } - return false; - } - function isStatement(modifierCount, inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isStatement(currentNode())) { - return true; - } - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 58 /* StaticKeyword */: - var token1 = peekToken(1); - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token1)) { - return false; - } - break; - case 28 /* IfKeyword */: - case 70 /* OpenBraceToken */: - case 33 /* ReturnKeyword */: - case 34 /* SwitchKeyword */: - case 36 /* ThrowKeyword */: - case 15 /* BreakKeyword */: - case 18 /* ContinueKeyword */: - case 26 /* ForKeyword */: - case 42 /* WhileKeyword */: - case 43 /* WithKeyword */: - case 22 /* DoKeyword */: - case 38 /* TryKeyword */: - case 19 /* DebuggerKeyword */: - return true; - } - if (isInterfaceEnumClassModuleImportOrExport(modifierCount)) { - return false; - } - return isLabeledStatement(_currentToken) || isVariableStatement(modifierCount) || isFunctionDeclaration(modifierCount) || isEmptyStatement(_currentToken, inErrorRecovery) || isExpressionStatement(_currentToken); - } - function parseStatement(inErrorRecovery) { - return tryParseStatement(inErrorRecovery) || parseExpressionStatement(); - } - function tryParseStatement(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isStatement(node)) { - consumeNode(node); - return node; - } - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - return tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount(), inErrorRecovery); - } - function tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount, inErrorRecovery) { - switch (currentTokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 58 /* StaticKeyword */: - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(peekToken(1))) { - return null; - } - else { - break; - } - case 28 /* IfKeyword */: - return parseIfStatement(_currentToken); - case 70 /* OpenBraceToken */: - return parseBlock(false, false); - case 33 /* ReturnKeyword */: - return parseReturnStatement(_currentToken); - case 34 /* SwitchKeyword */: - return parseSwitchStatement(_currentToken); - case 36 /* ThrowKeyword */: - return parseThrowStatement(_currentToken); - case 15 /* BreakKeyword */: - return parseBreakStatement(_currentToken); - case 18 /* ContinueKeyword */: - return parseContinueStatement(_currentToken); - case 26 /* ForKeyword */: - return parseForOrForInStatement(_currentToken); - case 42 /* WhileKeyword */: - return parseWhileStatement(_currentToken); - case 43 /* WithKeyword */: - return parseWithStatement(_currentToken); - case 22 /* DoKeyword */: - return parseDoStatement(_currentToken); - case 38 /* TryKeyword */: - return parseTryStatement(_currentToken); - case 19 /* DebuggerKeyword */: - return parseDebuggerStatement(_currentToken); - } - if (isInterfaceEnumClassModuleImportOrExport(modifierCount)) { - return null; - } - else if (isVariableStatement(modifierCount)) { - return parseVariableStatement(); - } - else if (isLabeledStatement(_currentToken)) { - return parseLabeledStatement(_currentToken); - } - else if (isFunctionDeclaration(modifierCount)) { - return parseFunctionDeclaration(); - } - else if (isEmptyStatement(_currentToken, inErrorRecovery)) { - return parseEmptyStatement(_currentToken); - } - else if (isExpressionStatement(_currentToken)) { - return parseExpressionStatement(); - } - else { - return null; - } - } - function parseDebuggerStatement(debuggerKeyword) { - return new Parser.syntaxFactory.DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(false)); - } - function parseDoStatement(doKeyword) { - return new Parser.syntaxFactory.DoStatementSyntax(parseNodeData, consumeToken(doKeyword), parseStatement(false), eatToken(42 /* WhileKeyword */), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), eatExplicitOrAutomaticSemicolon(true)); - } - function isLabeledStatement(currentToken) { - return isIdentifier(currentToken) && peekToken(1).kind() === 106 /* ColonToken */; - } - function parseLabeledStatement(identifierToken) { - return new Parser.syntaxFactory.LabeledStatementSyntax(parseNodeData, consumeToken(identifierToken), eatToken(106 /* ColonToken */), parseStatement(false)); - } - function parseTryStatement(tryKeyword) { - var tryKeyword = consumeToken(tryKeyword); - var savedListParsingState = listParsingState; - listParsingState |= (1 << 6 /* TryBlock_Statements */); - var block = parseBlock(false, false); - listParsingState = savedListParsingState; - var catchClause = null; - if (currentToken().kind() === 17 /* CatchKeyword */) { - catchClause = parseCatchClause(); - } - var finallyClause = null; - if (catchClause === null || currentToken().kind() === 25 /* FinallyKeyword */) { - finallyClause = parseFinallyClause(); - } - return new Parser.syntaxFactory.TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); - } - function parseCatchClauseBlock() { - var savedListParsingState = listParsingState; - listParsingState |= (1 << 7 /* CatchBlock_Statements */); - var block = parseBlock(false, false); - listParsingState = savedListParsingState; - return block; - } - function parseCatchClause() { - return new Parser.syntaxFactory.CatchClauseSyntax(parseNodeData, eatToken(17 /* CatchKeyword */), eatToken(72 /* OpenParenToken */), eatIdentifierToken(), parseOptionalTypeAnnotation(false), eatToken(73 /* CloseParenToken */), parseCatchClauseBlock()); - } - function parseFinallyClause() { - return new Parser.syntaxFactory.FinallyClauseSyntax(parseNodeData, eatToken(25 /* FinallyKeyword */), parseBlock(false, false)); - } - function parseWithStatement(withKeyword) { - return new Parser.syntaxFactory.WithStatementSyntax(parseNodeData, consumeToken(withKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); - } - function parseWhileStatement(whileKeyword) { - return new Parser.syntaxFactory.WhileStatementSyntax(parseNodeData, consumeToken(whileKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); - } - function isEmptyStatement(currentToken, inErrorRecovery) { - if (inErrorRecovery) { - return false; - } - return currentToken.kind() === 78 /* SemicolonToken */; - } - function parseEmptyStatement(semicolonToken) { - return new Parser.syntaxFactory.EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); - } - function parseForOrForInStatement(forKeyword) { - consumeToken(forKeyword); - var openParenToken = eatToken(72 /* OpenParenToken */); - var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); - if (tokenKind === 40 /* VarKeyword */) { - return parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken); - } - else if (tokenKind === 78 /* SemicolonToken */) { - return parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken); - } - else { - return parseForOrForInStatementWithInitializer(forKeyword, openParenToken); - } - } - function parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken) { - var variableDeclaration = parseVariableDeclaration(false); - return currentToken().kind() === 29 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null); - } - function parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, initializer) { - return new Parser.syntaxFactory.ForInStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(29 /* InKeyword */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); - } - function parseForOrForInStatementWithInitializer(forKeyword, openParenToken) { - var initializer = parseExpression(false); - return currentToken().kind() === 29 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer); - } - function parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken) { - return parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, null); - } - function tryParseForStatementCondition() { - var tokenKind = currentToken().kind(); - if (tokenKind !== 78 /* SemicolonToken */ && tokenKind !== 73 /* CloseParenToken */ && tokenKind !== 10 /* EndOfFileToken */) { - return parseExpression(true); - } - return null; - } - function tryParseForStatementIncrementor() { - var tokenKind = currentToken().kind(); - if (tokenKind !== 73 /* CloseParenToken */ && tokenKind !== 10 /* EndOfFileToken */) { - return parseExpression(true); - } - return null; - } - function parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, initializer) { - return new Parser.syntaxFactory.ForStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(78 /* SemicolonToken */), tryParseForStatementCondition(), eatToken(78 /* SemicolonToken */), tryParseForStatementIncrementor(), eatToken(73 /* CloseParenToken */), parseStatement(false)); - } - function tryEatBreakOrContinueLabel() { - var identifier = null; - if (!canEatExplicitOrAutomaticSemicolon(false)) { - if (isIdentifier(currentToken())) { - return eatIdentifierToken(); - } - } - return null; - } - function parseBreakStatement(breakKeyword) { - return new Parser.syntaxFactory.BreakStatementSyntax(parseNodeData, consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseContinueStatement(continueKeyword) { - return new Parser.syntaxFactory.ContinueStatementSyntax(parseNodeData, consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseSwitchStatement(switchKeyword) { - consumeToken(switchKeyword); - var openParenToken = eatToken(72 /* OpenParenToken */); - var expression = parseExpression(true); - var closeParenToken = eatToken(73 /* CloseParenToken */); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var switchClauses = TypeScript.Syntax.emptyList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - switchClauses = parseSyntaxList(3 /* SwitchStatement_SwitchClauses */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new Parser.syntaxFactory.SwitchStatementSyntax(parseNodeData, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, eatToken(71 /* CloseBraceToken */)); - } - function isSwitchClause() { - if (TypeScript.SyntaxUtilities.isSwitchClause(currentNode())) { - return true; - } - var currentTokenKind = currentToken().kind(); - return currentTokenKind === 16 /* CaseKeyword */ || currentTokenKind === 20 /* DefaultKeyword */; - } - function tryParseSwitchClause() { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isSwitchClause(node)) { - consumeNode(node); - return node; - } - var _currentToken = currentToken(); - var kind = _currentToken.kind(); - if (kind === 16 /* CaseKeyword */) { - return parseCaseSwitchClause(_currentToken); - } - else if (kind === 20 /* DefaultKeyword */) { - return parseDefaultSwitchClause(_currentToken); - } - else { - return null; - } - } - function parseCaseSwitchClause(caseKeyword) { - consumeToken(caseKeyword); - var expression = parseExpression(true); - var colonToken = eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList(); - if (colonToken.fullWidth() > 0) { - var skippedTokens = getArray(); - statements = parseSyntaxList(4 /* SwitchClause_Statements */, skippedTokens); - colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); - } - return new Parser.syntaxFactory.CaseSwitchClauseSyntax(parseNodeData, caseKeyword, expression, colonToken, statements); - } - function parseDefaultSwitchClause(defaultKeyword) { - consumeToken(defaultKeyword); - var colonToken = eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList(); - if (colonToken.fullWidth() > 0) { - var skippedTokens = getArray(); - statements = parseSyntaxList(4 /* SwitchClause_Statements */, skippedTokens); - colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); - } - return new Parser.syntaxFactory.DefaultSwitchClauseSyntax(parseNodeData, defaultKeyword, colonToken, statements); - } - function parseThrowStatementExpression() { - return canEatExplicitOrAutomaticSemicolon(false) ? createMissingToken(11 /* IdentifierName */, null) : parseExpression(true); - } - function parseThrowStatement(throwKeyword) { - return new Parser.syntaxFactory.ThrowStatementSyntax(parseNodeData, consumeToken(throwKeyword), parseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); - } - function tryParseReturnStatementExpression() { - return !canEatExplicitOrAutomaticSemicolon(false) ? parseExpression(true) : null; - } - function parseReturnStatement(returnKeyword) { - return new Parser.syntaxFactory.ReturnStatementSyntax(parseNodeData, consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); - } - function isExpressionStatement(currentToken) { - var tokenKind = currentToken.kind(); - return tokenKind !== 70 /* OpenBraceToken */ && tokenKind !== 27 /* FunctionKeyword */ && isExpression(currentToken); - } - function isAssignmentOrOmittedExpression() { - var _currentToken = currentToken(); - return _currentToken.kind() === 79 /* CommaToken */ || isExpression(_currentToken); - } - function tryParseAssignmentOrOmittedExpression() { - if (currentToken().kind() === 79 /* CommaToken */) { - return new Parser.syntaxFactory.OmittedExpressionSyntax(parseNodeData); - } - return tryParseAssignmentExpressionOrHigher(false, true); - } - function isExpression(currentToken) { - switch (currentToken.kind()) { - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 12 /* RegularExpressionLiteral */: - case 74 /* OpenBracketToken */: - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - case 89 /* PlusToken */: - case 90 /* MinusToken */: - case 102 /* TildeToken */: - case 101 /* ExclamationToken */: - case 70 /* OpenBraceToken */: - case 85 /* EqualsGreaterThanToken */: - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - case 50 /* SuperKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 31 /* NewKeyword */: - case 21 /* DeleteKeyword */: - case 41 /* VoidKeyword */: - case 39 /* TypeOfKeyword */: - case 27 /* FunctionKeyword */: - return true; - } - return isIdentifier(currentToken); - } - function parseExpressionStatement() { - return new Parser.syntaxFactory.ExpressionStatementSyntax(parseNodeData, parseExpression(true), eatExplicitOrAutomaticSemicolon(false)); - } - function parseIfStatement(ifKeyword) { - return new Parser.syntaxFactory.IfStatementSyntax(parseNodeData, consumeToken(ifKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false), parseOptionalElseClause()); - } - function parseOptionalElseClause() { - return currentToken().kind() === 23 /* ElseKeyword */ ? parseElseClause() : null; - } - function parseElseClause() { - return new Parser.syntaxFactory.ElseClauseSyntax(parseNodeData, eatToken(23 /* ElseKeyword */), parseStatement(false)); - } - function isVariableStatement(modifierCount) { - return peekToken(modifierCount).kind() === 40 /* VarKeyword */; - } - function parseVariableStatement() { - return new Parser.syntaxFactory.VariableStatementSyntax(parseNodeData, parseModifiers(), parseVariableDeclaration(true), eatExplicitOrAutomaticSemicolon(false)); - } - function parseVariableDeclaration(allowIn) { - var varKeyword = eatToken(40 /* VarKeyword */); - var listParsingState = allowIn ? 12 /* VariableDeclaration_VariableDeclarators_AllowIn */ : 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */; - var skippedTokens = getArray(); - var variableDeclarators = parseSeparatedSyntaxList(listParsingState, skippedTokens); - varKeyword = addSkippedTokensAfterToken(varKeyword, skippedTokens); - return new Parser.syntaxFactory.VariableDeclarationSyntax(parseNodeData, varKeyword, variableDeclarators); - } - function isVariableDeclarator() { - var node = currentNode(); - if (node !== null && node.kind() === 225 /* VariableDeclarator */) { - return true; - } - return isIdentifier(currentToken()); - } - function canReuseVariableDeclaratorNode(node) { - if (node === null || node.kind() !== 225 /* VariableDeclarator */) { - return false; - } - var variableDeclarator = node; - return variableDeclarator.equalsValueClause === null; - } - function tryParseVariableDeclarator(allowIn, allowPropertyName) { - var node = currentNode(); - if (canReuseVariableDeclaratorNode(node)) { - consumeNode(node); - return node; - } - if (allowPropertyName) { - } - if (!allowPropertyName && !isIdentifier(currentToken())) { - return null; - } - var propertyName = allowPropertyName ? eatPropertyName() : eatIdentifierToken(); - var equalsValueClause = null; - var typeAnnotation = null; - if (propertyName.fullWidth() > 0) { - typeAnnotation = parseOptionalTypeAnnotation(false); - if (isEqualsValueClause(false)) { - equalsValueClause = parseEqualsValueClause(allowIn); - } - } - return new Parser.syntaxFactory.VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); - } - function isEqualsValueClause(inParameter) { - var token0 = currentToken(); - if (token0.kind() === 107 /* EqualsToken */) { - return true; - } - if (!previousTokenHasTrailingNewLine(token0)) { - var tokenKind = token0.kind(); - if (tokenKind === 85 /* EqualsGreaterThanToken */) { - return false; - } - if (tokenKind === 70 /* OpenBraceToken */ && inParameter) { - return false; - } - return isExpression(token0); - } - return false; - } - function parseEqualsValueClause(allowIn) { - return new Parser.syntaxFactory.EqualsValueClauseSyntax(parseNodeData, eatToken(107 /* EqualsToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - function parseExpression(allowIn) { - var leftOperand = tryParseAssignmentExpressionOrHigher(true, allowIn); - while (true) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 79 /* CommaToken */) { - break; - } - leftOperand = new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - return leftOperand; - } - function tryParseAssignmentExpressionOrHigher(force, allowIn) { - var _currentToken = currentToken(); - var arrowFunction = tryParseAnyArrowFunctionExpression(_currentToken); - if (arrowFunction !== null) { - return arrowFunction; - } - var leftOperand = tryParseBinaryExpressionOrHigher(_currentToken, force, 1 /* Lowest */, allowIn); - if (leftOperand === null) { - return null; - } - if (TypeScript.SyntaxUtilities.isLeftHandSizeExpression(leftOperand)) { - var operatorToken = currentOperatorToken(); - if (TypeScript.SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind())) { - return new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - } - return parseConditionalExpressionRest(allowIn, leftOperand); - } - function tryParseAnyArrowFunctionExpression(_currentToken) { - return isSimpleArrowFunctionExpression(_currentToken) ? parseSimpleArrowFunctionExpression() : tryParseParenthesizedArrowFunctionExpression(); - } - function tryParseUnaryExpressionOrHigher(_currentToken, force) { - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 89 /* PlusToken */: - case 90 /* MinusToken */: - case 102 /* TildeToken */: - case 101 /* ExclamationToken */: - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - return new Parser.syntaxFactory.PrefixUnaryExpressionSyntax(parseNodeData, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), true)); - case 39 /* TypeOfKeyword */: - return parseTypeOfExpression(_currentToken); - case 41 /* VoidKeyword */: - return parseVoidExpression(_currentToken); - case 21 /* DeleteKeyword */: - return parseDeleteExpression(_currentToken); - case 80 /* LessThanToken */: - return parseCastExpression(_currentToken); - default: - return tryParsePostfixExpressionOrHigher(_currentToken, force); - } - } - function tryParseBinaryExpressionOrHigher(_currentToken, force, precedence, allowIn) { - var leftOperand = tryParseUnaryExpressionOrHigher(_currentToken, force); - if (leftOperand === null) { - return null; - } - return parseBinaryExpressionRest(precedence, allowIn, leftOperand); - } - function parseConditionalExpressionRest(allowIn, leftOperand) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 105 /* QuestionToken */) { - return leftOperand; - } - return new Parser.syntaxFactory.ConditionalExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, true), eatToken(106 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - function parseBinaryExpressionRest(precedence, allowIn, leftOperand) { - while (true) { - var operatorToken = currentOperatorToken(); - var tokenKind = operatorToken.kind(); - if (!TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(tokenKind) || tokenKind === 79 /* CommaToken */ || TypeScript.SyntaxFacts.isAssignmentOperatorToken(tokenKind)) { - break; - } - if (tokenKind === 29 /* InKeyword */ && !allowIn) { - break; - } - var newPrecedence = getBinaryExpressionPrecedence(tokenKind); - if (newPrecedence <= precedence) { - break; - } - leftOperand = new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseBinaryExpressionOrHigher(currentToken(), true, newPrecedence, allowIn)); - } - return leftOperand; - } - function currentOperatorToken() { - var token0 = currentToken(); - if (token0.kind() === 81 /* GreaterThanToken */) { - return currentContextualToken(); - } - return token0; - } - function tryParseMemberExpressionOrHigher(_currentToken, force, inObjectCreation) { - var expression = tryParsePrimaryExpression(_currentToken, force); - if (expression === null) { - return null; - } - return parseMemberExpressionRest(expression, inObjectCreation); - } - function parseCallExpressionRest(expression) { - while (true) { - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 72 /* OpenParenToken */: - expression = new Parser.syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(null)); - continue; - case 80 /* LessThanToken */: - var argumentList = tryParseArgumentList(); - if (argumentList === null) { - break; - } - expression = new Parser.syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, argumentList); - continue; - case 74 /* OpenBracketToken */: - expression = parseElementAccessExpression(expression, _currentToken, false); - continue; - case 76 /* DotToken */: - expression = new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); - continue; - } - return expression; - } - } - function parseMemberExpressionRest(expression, inObjectCreation) { - while (true) { - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 74 /* OpenBracketToken */: - expression = parseElementAccessExpression(expression, _currentToken, inObjectCreation); - continue; - case 76 /* DotToken */: - expression = new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); - continue; - } - return expression; - } - } - function tryParseLeftHandSideExpressionOrHigher(_currentToken, force) { - var expression = null; - if (_currentToken.kind() === 50 /* SuperKeyword */) { - expression = parseSuperExpression(_currentToken); - } - else { - expression = tryParseMemberExpressionOrHigher(_currentToken, force, false); - if (expression === null) { - return null; - } - } - return parseCallExpressionRest(expression); - } - function parseSuperExpression(superToken) { - var expression = consumeToken(superToken); - var currentTokenKind = currentToken().kind(); - return currentTokenKind === 72 /* OpenParenToken */ || currentTokenKind === 76 /* DotToken */ ? expression : new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(76 /* DotToken */), eatIdentifierNameToken()); - } - function tryParsePostfixExpressionOrHigher(_currentToken, force) { - var expression = tryParseLeftHandSideExpressionOrHigher(_currentToken, force); - if (expression === null) { - return null; - } - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - if (previousTokenHasTrailingNewLine(_currentToken)) { - break; - } - return new Parser.syntaxFactory.PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); - } - return expression; - } - function tryParseGenericArgumentList() { - var rewindPoint = getRewindPoint(); - var typeArgumentList = tryParseTypeArgumentList(true); - var token0 = currentToken(); - var tokenKind = token0.kind(); - var isOpenParen = tokenKind === 72 /* OpenParenToken */; - var isDot = tokenKind === 76 /* DotToken */; - var isOpenParenOrDot = isOpenParen || isDot; - var argumentList = null; - if (typeArgumentList === null || !isOpenParenOrDot) { - rewind(rewindPoint); - releaseRewindPoint(rewindPoint); - return null; - } - else { - releaseRewindPoint(rewindPoint); - if (isDot) { - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token0, source.text), TypeScript.width(token0), TypeScript.DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, null); - addDiagnostic(diagnostic); - return new Parser.syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, TypeScript.Syntax.emptyToken(72 /* OpenParenToken */), TypeScript.Syntax.emptySeparatedList(), TypeScript.Syntax.emptyToken(73 /* CloseParenToken */)); - } - else { - return parseArgumentList(typeArgumentList); - } - } - } - function tryParseArgumentList() { - var tokenKind = currentToken().kind(); - if (tokenKind === 80 /* LessThanToken */) { - return tryParseGenericArgumentList(); - } - if (tokenKind === 72 /* OpenParenToken */) { - return parseArgumentList(null); - } - return null; - } - function parseArgumentList(typeArgumentList) { - var openParenToken = eatToken(72 /* OpenParenToken */); - var _arguments = TypeScript.Syntax.emptySeparatedList(); - if (openParenToken.fullWidth() > 0) { - var skippedTokens = getArray(); - _arguments = parseSeparatedSyntaxList(14 /* ArgumentList_AssignmentExpressions */, skippedTokens); - openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); - } - return new Parser.syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, openParenToken, _arguments, eatToken(73 /* CloseParenToken */)); - } - function tryParseArgumentListExpression() { - var force = currentToken().kind() === 79 /* CommaToken */; - return tryParseAssignmentExpressionOrHigher(force, true); - } - function parseElementAccessArgumentExpression(openBracketToken, inObjectCreation) { - if (inObjectCreation && currentToken().kind() === 75 /* CloseBracketToken */) { - var errorStart = TypeScript.start(openBracketToken, source.text); - var errorEnd = TypeScript.end(currentToken(), source.text); - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), errorStart, errorEnd - errorStart, TypeScript.DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, null); - addDiagnostic(diagnostic); - return TypeScript.Syntax.emptyToken(11 /* IdentifierName */); - } - else { - return parseExpression(true); - } - } - function parseElementAccessExpression(expression, openBracketToken, inObjectCreation) { - return new Parser.syntaxFactory.ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(75 /* CloseBracketToken */)); - } - function tryParsePrimaryExpression(_currentToken, force) { - if (isIdentifier(_currentToken)) { - return eatIdentifierToken(); - } - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 13 /* NumericLiteral */: - case 12 /* RegularExpressionLiteral */: - case 14 /* StringLiteral */: - return consumeToken(_currentToken); - case 27 /* FunctionKeyword */: - return parseFunctionExpression(_currentToken); - case 74 /* OpenBracketToken */: - return parseArrayLiteralExpression(_currentToken); - case 70 /* OpenBraceToken */: - return parseObjectLiteralExpression(_currentToken); - case 72 /* OpenParenToken */: - return parseParenthesizedExpression(_currentToken); - case 31 /* NewKeyword */: - return parseObjectCreationExpression(_currentToken); - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - var result = tryReparseDivideAsRegularExpression(); - return result || eatIdentifierToken(TypeScript.DiagnosticCode.Expression_expected); - } - if (!force) { - return null; - } - return eatIdentifierToken(TypeScript.DiagnosticCode.Expression_expected); - } - function tryReparseDivideAsRegularExpression() { - var currentToken = currentContextualToken(); - var tokenKind = currentToken.kind(); - if (tokenKind === 118 /* SlashToken */ || tokenKind === 119 /* SlashEqualsToken */) { - return null; - } - else if (tokenKind === 12 /* RegularExpressionLiteral */) { - return consumeToken(currentToken); - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - function parseTypeOfExpression(typeOfKeyword) { - return new Parser.syntaxFactory.TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseDeleteExpression(deleteKeyword) { - return new Parser.syntaxFactory.DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseVoidExpression(voidKeyword) { - return new Parser.syntaxFactory.VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseFunctionExpression(functionKeyword) { - return new Parser.syntaxFactory.FunctionExpressionSyntax(parseNodeData, consumeToken(functionKeyword), eatOptionalIdentifierToken(), parseCallSignature(false), parseBlock(false, true)); - } - function parseObjectCreationExpression(newKeyword) { - return new Parser.syntaxFactory.ObjectCreationExpressionSyntax(parseNodeData, consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), true, true), tryParseArgumentList()); - } - function parseCastExpression(lessThanToken) { - return new Parser.syntaxFactory.CastExpressionSyntax(parseNodeData, consumeToken(lessThanToken), parseType(), eatToken(81 /* GreaterThanToken */), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseParenthesizedExpression(openParenToken) { - return new Parser.syntaxFactory.ParenthesizedExpressionSyntax(parseNodeData, consumeToken(openParenToken), parseExpression(true), eatToken(73 /* CloseParenToken */)); - } - function tryParseParenthesizedArrowFunctionExpression() { - var tokenKind = currentToken().kind(); - if (tokenKind !== 72 /* OpenParenToken */ && tokenKind !== 80 /* LessThanToken */) { - return null; - } - if (isDefinitelyArrowFunctionExpression()) { - return tryParseParenthesizedArrowFunctionExpressionWorker(false); - } - if (!isPossiblyArrowFunctionExpression()) { - return null; - } - var rewindPoint = getRewindPoint(); - var arrowFunction = tryParseParenthesizedArrowFunctionExpressionWorker(true); - if (arrowFunction === null) { - rewind(rewindPoint); - } - releaseRewindPoint(rewindPoint); - return arrowFunction; - } - function tryParseParenthesizedArrowFunctionExpressionWorker(requireArrow) { - var _currentToken = currentToken(); - var callSignature = parseCallSignature(true); - if (requireArrow && currentToken().kind() !== 85 /* EqualsGreaterThanToken */) { - return null; - } - var equalsGreaterThanToken = eatToken(85 /* EqualsGreaterThanToken */); - var block = tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { - expression = tryParseAssignmentExpressionOrHigher(true, true); - } - return new Parser.syntaxFactory.ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, callSignature, equalsGreaterThanToken, block, expression); - } - function tryParseArrowFunctionBlock() { - if (isBlock()) { - return parseBlock(false, false); - } - else { - var _modifierCount = modifierCount(); - if (isStatement(_modifierCount, false) && !isExpressionStatement(currentToken()) && !isFunctionDeclaration(_modifierCount)) { - return parseBlock(true, false); - } - else { - return null; - } - } - } - function isSimpleArrowFunctionExpression(_currentToken) { - if (_currentToken.kind() === 85 /* EqualsGreaterThanToken */) { - return true; - } - return isIdentifier(_currentToken) && peekToken(1).kind() === 85 /* EqualsGreaterThanToken */; - } - function parseSimpleArrowFunctionExpression() { - var parameter = eatSimpleParameter(); - var equalsGreaterThanToken = eatToken(85 /* EqualsGreaterThanToken */); - var block = tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { - expression = tryParseAssignmentExpressionOrHigher(true, true); - } - return new Parser.syntaxFactory.SimpleArrowFunctionExpressionSyntax(parseNodeData, parameter, equalsGreaterThanToken, block, expression); - } - function isBlock() { - return currentToken().kind() === 70 /* OpenBraceToken */; - } - function isDefinitelyArrowFunctionExpression() { - var token0 = currentToken(); - if (token0.kind() !== 72 /* OpenParenToken */) { - return false; - } - var token1 = peekToken(1); - var token1Kind = token1.kind(); - var token2; - if (token1Kind === 73 /* CloseParenToken */) { - token2 = peekToken(2); - var token2Kind = token2.kind(); - return token2Kind === 106 /* ColonToken */ || token2Kind === 85 /* EqualsGreaterThanToken */ || token2Kind === 70 /* OpenBraceToken */; - } - if (token1Kind === 77 /* DotDotDotToken */) { - return true; - } - token2 = peekToken(2); - token2Kind = token2.kind(); - if (token1Kind === 57 /* PublicKeyword */ || token1Kind === 55 /* PrivateKeyword */) { - if (isIdentifier(token2)) { - return true; - } - } - if (!isIdentifier(token1)) { - return false; - } - if (token2Kind === 106 /* ColonToken */) { - return true; - } - var token3 = peekToken(3); - var token3Kind = token3.kind(); - if (token2Kind === 105 /* QuestionToken */) { - if (token3Kind === 106 /* ColonToken */ || token3Kind === 73 /* CloseParenToken */ || token3Kind === 79 /* CommaToken */) { - return true; - } - } - if (token2Kind === 73 /* CloseParenToken */) { - if (token3Kind === 85 /* EqualsGreaterThanToken */) { - return true; - } - } - return false; - } - function isPossiblyArrowFunctionExpression() { - var token0 = currentToken(); - if (token0.kind() !== 72 /* OpenParenToken */) { - return true; - } - var token1 = peekToken(1); - if (!isIdentifier(token1)) { - return false; - } - var token2 = peekToken(2); - var token2Kind = token2.kind(); - if (token2Kind === 107 /* EqualsToken */) { - return true; - } - if (token2Kind === 79 /* CommaToken */) { - return true; - } - if (token2Kind === 73 /* CloseParenToken */) { - var token3 = peekToken(3); - if (token3.kind() === 106 /* ColonToken */) { - return true; - } - } - return false; - } - function parseObjectLiteralExpression(openBraceToken) { - consumeToken(openBraceToken); - var skippedTokens = getArray(); - var propertyAssignments = parseSeparatedSyntaxList(15 /* ObjectLiteralExpression_PropertyAssignments */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - return new Parser.syntaxFactory.ObjectLiteralExpressionSyntax(parseNodeData, openBraceToken, propertyAssignments, eatToken(71 /* CloseBraceToken */)); - } - function tryParsePropertyAssignment(inErrorRecovery) { - if (isAccessor(modifierCount(), inErrorRecovery)) { - return parseAccessor(true); - } - else if (isFunctionPropertyAssignment(inErrorRecovery)) { - return parseFunctionPropertyAssignment(); - } - else if (isSimplePropertyAssignment(inErrorRecovery)) { - return parseSimplePropertyAssignment(); - } - else { - return null; - } - } - function isPropertyAssignment(inErrorRecovery) { - return isAccessor(modifierCount(), inErrorRecovery) || isFunctionPropertyAssignment(inErrorRecovery) || isSimplePropertyAssignment(inErrorRecovery); - } - function eatPropertyName() { - var _currentToken = currentToken(); - return TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(_currentToken) ? eatIdentifierNameToken() : consumeToken(_currentToken); - } - function isFunctionPropertyAssignment(inErrorRecovery) { - return isPropertyName(currentToken(), inErrorRecovery) && isCallSignature(1); - } - function parseFunctionPropertyAssignment() { - return new Parser.syntaxFactory.FunctionPropertyAssignmentSyntax(parseNodeData, eatPropertyName(), parseCallSignature(false), parseBlock(false, true)); - } - function isSimplePropertyAssignment(inErrorRecovery) { - return isPropertyName(currentToken(), inErrorRecovery); - } - function parseSimplePropertyAssignment() { - return new Parser.syntaxFactory.SimplePropertyAssignmentSyntax(parseNodeData, eatPropertyName(), eatToken(106 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, true)); - } - function isPropertyName(token, inErrorRecovery) { - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - if (inErrorRecovery) { - return isIdentifier(token); - } - else { - return true; - } - } - var kind = token.kind(); - return kind === 14 /* StringLiteral */ || kind === 13 /* NumericLiteral */; - } - function parseArrayLiteralExpression(openBracketToken) { - consumeToken(openBracketToken); - var skippedTokens = getArray(); - var expressions = parseSeparatedSyntaxList(16 /* ArrayLiteralExpression_AssignmentExpressions */, skippedTokens); - openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - return new Parser.syntaxFactory.ArrayLiteralExpressionSyntax(parseNodeData, openBracketToken, expressions, eatToken(75 /* CloseBracketToken */)); - } - function parseBlock(parseBlockEvenWithNoOpenBrace, checkForStrictMode) { - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var statements = TypeScript.Syntax.emptyList(); - if (parseBlockEvenWithNoOpenBrace || openBraceToken.fullWidth() > 0) { - var savedIsInStrictMode = isInStrictMode; - var processItems = checkForStrictMode ? updateStrictModeState : null; - var skippedTokens = getArray(); - var statements = parseSyntaxList(5 /* Block_Statements */, skippedTokens, processItems); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - setStrictMode(savedIsInStrictMode); - } - return new Parser.syntaxFactory.BlockSyntax(parseNodeData, openBraceToken, statements, eatToken(71 /* CloseBraceToken */)); - } - function parseCallSignature(requireCompleteTypeParameterList) { - return new Parser.syntaxFactory.CallSignatureSyntax(parseNodeData, tryParseTypeParameterList(requireCompleteTypeParameterList), parseParameterList(), parseOptionalTypeAnnotation(false)); - } - function tryParseTypeParameterList(requireCompleteTypeParameterList) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 80 /* LessThanToken */) { - return null; - } - var rewindPoint = getRewindPoint(); - var lessThanToken = consumeToken(_currentToken); - var skippedTokens = getArray(); - var typeParameters = parseSeparatedSyntaxList(20 /* TypeParameterList_TypeParameters */, skippedTokens); - lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - var greaterThanToken = eatToken(81 /* GreaterThanToken */); - if (requireCompleteTypeParameterList && greaterThanToken.fullWidth() === 0) { - rewind(rewindPoint); - releaseRewindPoint(rewindPoint); - return null; - } - else { - releaseRewindPoint(rewindPoint); - return new Parser.syntaxFactory.TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); - } - } - function isTypeParameter() { - return isIdentifier(currentToken()); - } - function tryParseTypeParameter() { - if (!isIdentifier(currentToken())) { - return null; - } - return new Parser.syntaxFactory.TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); - } - function tryParseConstraint() { - if (currentToken().kind() !== 48 /* ExtendsKeyword */) { - return null; - } - return new Parser.syntaxFactory.ConstraintSyntax(parseNodeData, eatToken(48 /* ExtendsKeyword */), parseTypeOrExpression()); - } - function tryParseParameterList() { - if (currentToken().kind() === 72 /* OpenParenToken */) { - var token1 = peekToken(1); - if (token1.kind() === 73 /* CloseParenToken */ || isParameterHelper(token1)) { - return parseParameterList(); - } - } - return null; - } - function parseParameterList() { - var openParenToken = eatToken(72 /* OpenParenToken */); - var parameters = TypeScript.Syntax.emptySeparatedList(); - if (openParenToken.fullWidth() > 0) { - var skippedTokens = getArray(); - parameters = parseSeparatedSyntaxList(17 /* ParameterList_Parameters */, skippedTokens); - openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); - } - return new Parser.syntaxFactory.ParameterListSyntax(parseNodeData, openParenToken, parameters, eatToken(73 /* CloseParenToken */)); - } - function parseOptionalTypeAnnotation(allowStringLiteral) { - return currentToken().kind() === 106 /* ColonToken */ ? parseTypeAnnotation(allowStringLiteral) : null; - } - function parseTypeAnnotationType(allowStringLiteral) { - if (allowStringLiteral) { - var _currentToken = currentToken(); - if (_currentToken.kind() === 14 /* StringLiteral */) { - return consumeToken(_currentToken); - } - } - return parseType(); - } - function parseTypeAnnotation(allowStringLiteral) { - return new Parser.syntaxFactory.TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); - } - function isType() { - var _currentToken = currentToken(); - switch (_currentToken.kind()) { - case 39 /* TypeOfKeyword */: - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - case 70 /* OpenBraceToken */: - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - case 31 /* NewKeyword */: - return true; - default: - return isIdentifier(_currentToken); - } - } - function parseTypeOrExpression() { - var result = tryParseType(); - if (result) { - return result; - } - var _currentToken = currentToken(); - if (isExpression(_currentToken)) { - return tryParseUnaryExpressionOrHigher(_currentToken, true); - } - return eatIdentifierToken(TypeScript.DiagnosticCode.Type_expected); - } - function parseType() { - return tryParseType() || eatIdentifierToken(TypeScript.DiagnosticCode.Type_expected); - } - function tryParseType() { - var type = tryParseNonArrayType(); - while (type) { - var _currentToken = currentToken(); - if (previousTokenHasTrailingNewLine(_currentToken) || _currentToken.kind() !== 74 /* OpenBracketToken */) { - break; - } - type = new Parser.syntaxFactory.ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(75 /* CloseBracketToken */)); - } - return type; - } - function parseTypeQuery(typeOfKeyword) { - return new Parser.syntaxFactory.TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(true)); - } - function tryParseNonArrayType() { - var _currentToken = currentToken(); - switch (_currentToken.kind()) { - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - if (peekToken(1).kind() === 76 /* DotToken */) { - break; - } - return consumeToken(_currentToken); - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - return tryParseFunctionType(); - case 41 /* VoidKeyword */: - return consumeToken(_currentToken); - case 70 /* OpenBraceToken */: - return parseObjectType(); - case 31 /* NewKeyword */: - return parseConstructorType(); - case 39 /* TypeOfKeyword */: - return parseTypeQuery(_currentToken); - } - return tryParseNameOrGenericType(); - } - function tryParseNameOrGenericType() { - var name = tryParseName(false); - if (name === null) { - return null; - } - if (previousTokenHasTrailingNewLine(currentToken())) { - return name; - } - var typeArgumentList = tryParseTypeArgumentList(false); - return typeArgumentList === null ? name : new Parser.syntaxFactory.GenericTypeSyntax(parseNodeData, name, typeArgumentList); - } - function tryParseFunctionType() { - var typeParameterList = tryParseTypeParameterList(false); - var parameterList = null; - if (typeParameterList === null) { - parameterList = tryParseParameterList(); - if (parameterList === null) { - return null; - } - } - else { - parameterList = parseParameterList(); - } - return new Parser.syntaxFactory.FunctionTypeSyntax(parseNodeData, typeParameterList, parameterList, eatToken(85 /* EqualsGreaterThanToken */), parseType()); - } - function parseConstructorType() { - return new Parser.syntaxFactory.ConstructorTypeSyntax(parseNodeData, eatToken(31 /* NewKeyword */), tryParseTypeParameterList(false), parseParameterList(), eatToken(85 /* EqualsGreaterThanToken */), parseType()); - } - function isParameter() { - if (currentNode() !== null && currentNode().kind() === 242 /* Parameter */) { - return true; - } - return isParameterHelper(currentToken()); - } - function isParameterHelper(token) { - var tokenKind = token.kind(); - return tokenKind === 77 /* DotDotDotToken */ || isModifierKind(tokenKind) || isIdentifier(token); - } - function eatSimpleParameter() { - return new Parser.syntaxFactory.ParameterSyntax(parseNodeData, null, TypeScript.Syntax.emptyList(), eatIdentifierToken(), null, null, null); - } - function tryParseParameter() { - var node = currentNode(); - if (node !== null && node.kind() === 242 /* Parameter */) { - consumeNode(node); - return node; - } - var dotDotDotToken = tryEatToken(77 /* DotDotDotToken */); - var modifiers = parseModifiers(); - var _currentToken = currentToken(); - if (!isIdentifier(_currentToken) && dotDotDotToken === null && modifiers.length === 0) { - if (isModifierKind(_currentToken.kind())) { - modifiers = TypeScript.Syntax.list([consumeToken(_currentToken)]); - } - else { - return null; - } - } - var identifier = eatIdentifierToken(); - var questionToken = tryEatToken(105 /* QuestionToken */); - var typeAnnotation = parseOptionalTypeAnnotation(true); - var equalsValueClause = null; - if (isEqualsValueClause(true)) { - equalsValueClause = parseEqualsValueClause(true); - } - return new Parser.syntaxFactory.ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); - } - function parseSyntaxList(currentListType, skippedTokens, processItems) { - if (processItems === void 0) { processItems = null; } - var savedListParsingState = listParsingState; - listParsingState |= (1 << currentListType); - var result = parseSyntaxListWorker(currentListType, skippedTokens, processItems); - listParsingState = savedListParsingState; - return result; - } - function parseSeparatedSyntaxList(currentListType, skippedTokens) { - var savedListParsingState = listParsingState; - listParsingState |= (1 << currentListType); - var result = parseSeparatedSyntaxListWorker(currentListType, skippedTokens); - listParsingState = savedListParsingState; - return result; - } - function abortParsingListOrMoveToNextToken(currentListType, nodes, separators, skippedTokens) { - reportUnexpectedTokenDiagnostic(currentListType); - for (var state = ListParsingState.LastListParsingState; state >= ListParsingState.FirstListParsingState; state--) { - if ((listParsingState & (1 << state)) !== 0) { - if (isExpectedListTerminator(state) || isExpectedListItem(state, true)) { - return true; - } - } - } - addSkippedTokenToList(nodes, separators, skippedTokens, consumeToken(currentToken())); - return false; - } - function addSkippedTokenToList(nodes, separators, skippedTokens, skippedToken) { - if (Parser.syntaxFactory.isConcrete) { - var length = nodes.length + (separators ? separators.length : 0); - for (var i = length - 1; i >= 0; i--) { - var array = separators && (i % 2 === 1) ? separators : nodes; - var arrayIndex = separators ? TypeScript.IntegerUtilities.integerDivide(i, 2) : i; - var item = array[arrayIndex]; - var _lastToken = TypeScript.lastToken(item); - if (_lastToken && _lastToken.fullWidth() > 0) { - array[arrayIndex] = addSkippedTokenAfterNodeOrToken(item, skippedToken); - return; - } - } - skippedTokens.push(skippedToken); - } - } - function tryParseExpectedListItem(currentListType, inErrorRecovery, items, processItems) { - var item = tryParseExpectedListItemWorker(currentListType, inErrorRecovery); - if (item === null) { - return false; - } - items.push(item); - if (processItems !== null) { - processItems(items); - } - return true; - } - function listIsTerminated(currentListType) { - return isExpectedListTerminator(currentListType) || currentToken().kind() === 10 /* EndOfFileToken */; - } - function parseSyntaxListWorker(currentListType, skippedTokens, processItems) { - var items = getArray(); - while (true) { - var succeeded = tryParseExpectedListItem(currentListType, false, items, processItems); - if (!succeeded) { - if (listIsTerminated(currentListType)) { - break; - } - var abort = abortParsingListOrMoveToNextToken(currentListType, items, null, skippedTokens); - if (abort) { - break; - } - } - } - var result = TypeScript.Syntax.list(items); - returnZeroLengthArray(items); - return result; - } - function parseSeparatedSyntaxListWorker(currentListType, skippedTokens) { - var nodes = getArray(); - var separators = getArray(); - var _separatorKind = currentListType === 9 /* ObjectType_TypeMembers */ ? 78 /* SemicolonToken */ : 79 /* CommaToken */; - var allowAutomaticSemicolonInsertion = _separatorKind === 78 /* SemicolonToken */; - var inErrorRecovery = false; - while (true) { - var succeeded = tryParseExpectedListItem(currentListType, inErrorRecovery, nodes, null); - if (!succeeded) { - if (listIsTerminated(currentListType)) { - break; - } - var abort = abortParsingListOrMoveToNextToken(currentListType, nodes, separators, skippedTokens); - if (abort) { - break; - } - else { - inErrorRecovery = true; - continue; - } - } - inErrorRecovery = false; - var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); - if (tokenKind === _separatorKind || tokenKind === 79 /* CommaToken */) { - separators.push(consumeToken(_currentToken)); - continue; - } - if (listIsTerminated(currentListType)) { - break; - } - if (allowAutomaticSemicolonInsertion && canEatAutomaticSemicolon(false)) { - var semicolonToken = eatExplicitOrAutomaticSemicolon(false) || TypeScript.Syntax.emptyToken(78 /* SemicolonToken */); - separators.push(semicolonToken); - continue; - } - separators.push(eatToken(_separatorKind)); - inErrorRecovery = true; - } - var result = TypeScript.Syntax.separatedList(nodes, separators); - returnZeroLengthArray(nodes); - returnZeroLengthArray(separators); - return result; - } - function reportUnexpectedTokenDiagnostic(listType) { - var token = currentToken(); - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token, source.text), TypeScript.width(token), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [getExpectedListElementType(listType)]); - addDiagnostic(diagnostic); - } - function addDiagnostic(diagnostic) { - if (diagnostics.length > 0 && diagnostics[diagnostics.length - 1].start() === diagnostic.start()) { - return; - } - diagnostics.push(diagnostic); - } - function isExpectedListTerminator(currentListType) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return isExpectedSourceUnit_ModuleElementsTerminator(); - case 1 /* ClassDeclaration_ClassElements */: - return isExpectedClassDeclaration_ClassElementsTerminator(); - case 2 /* ModuleDeclaration_ModuleElements */: - return isExpectedModuleDeclaration_ModuleElementsTerminator(); - case 3 /* SwitchStatement_SwitchClauses */: - return isExpectedSwitchStatement_SwitchClausesTerminator(); - case 4 /* SwitchClause_Statements */: - return isExpectedSwitchClause_StatementsTerminator(); - case 5 /* Block_Statements */: - return isExpectedBlock_StatementsTerminator(); - case 6 /* TryBlock_Statements */: - return isExpectedTryBlock_StatementsTerminator(); - case 7 /* CatchBlock_Statements */: - return isExpectedCatchBlock_StatementsTerminator(); - case 8 /* EnumDeclaration_EnumElements */: - return isExpectedEnumDeclaration_EnumElementsTerminator(); - case 9 /* ObjectType_TypeMembers */: - return isExpectedObjectType_TypeMembersTerminator(); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(); - case 11 /* HeritageClause_TypeNameList */: - return isExpectedHeritageClause_TypeNameListTerminator(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(); - case 14 /* ArgumentList_AssignmentExpressions */: - return isExpectedArgumentList_AssignmentExpressionsTerminator(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return isExpectedLiteralExpression_AssignmentExpressionsTerminator(); - case 17 /* ParameterList_Parameters */: - return isExpectedParameterList_ParametersTerminator(); - case 18 /* IndexSignature_Parameters */: - return isExpectedIndexSignature_ParametersTerminator(); - case 19 /* TypeArgumentList_Types */: - return isExpectedTypeArgumentList_TypesTerminator(); - case 20 /* TypeParameterList_TypeParameters */: - return isExpectedTypeParameterList_TypeParametersTerminator(); - default: - throw TypeScript.Errors.invalidOperation(); - } - } - function isExpectedSourceUnit_ModuleElementsTerminator() { - return currentToken().kind() === 10 /* EndOfFileToken */; - } - function isExpectedEnumDeclaration_EnumElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedModuleDeclaration_ModuleElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedObjectType_TypeMembersTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedLiteralExpression_AssignmentExpressionsTerminator() { - return currentToken().kind() === 75 /* CloseBracketToken */; - } - function isExpectedTypeArgumentList_TypesTerminator() { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 81 /* GreaterThanToken */) { - return true; - } - if (canFollowTypeArgumentListInExpression(tokenKind)) { - return true; - } - return false; - } - function isExpectedTypeParameterList_TypeParametersTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 81 /* GreaterThanToken */) { - return true; - } - if (tokenKind === 72 /* OpenParenToken */ || tokenKind === 70 /* OpenBraceToken */ || tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */) { - return true; - } - return false; - } - function isExpectedParameterList_ParametersTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 73 /* CloseParenToken */) { - return true; - } - if (tokenKind === 70 /* OpenBraceToken */) { - return true; - } - if (tokenKind === 85 /* EqualsGreaterThanToken */) { - return true; - } - return false; - } - function isExpectedIndexSignature_ParametersTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 75 /* CloseBracketToken */) { - return true; - } - if (tokenKind === 70 /* OpenBraceToken */) { - return true; - } - return false; - } - function isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 78 /* SemicolonToken */ || tokenKind === 73 /* CloseParenToken */) { - return true; - } - if (tokenKind === 29 /* InKeyword */) { - return true; - } - return false; - } - function isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator() { - if (currentToken().kind() === 85 /* EqualsGreaterThanToken */) { - return true; - } - return canEatExplicitOrAutomaticSemicolon(false); - } - function isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 70 /* OpenBraceToken */ || tokenKind === 71 /* CloseBraceToken */) { - return true; - } - return false; - } - function isExpectedHeritageClause_TypeNameListTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */) { - return true; - } - if (isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator()) { - return true; - } - return false; - } - function isExpectedArgumentList_AssignmentExpressionsTerminator() { - var token0 = currentToken(); - var tokenKind = token0.kind(); - return tokenKind === 73 /* CloseParenToken */ || tokenKind === 78 /* SemicolonToken */; - } - function isExpectedClassDeclaration_ClassElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedSwitchStatement_SwitchClausesTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedSwitchClause_StatementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */ || isSwitchClause(); - } - function isExpectedBlock_StatementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedTryBlock_StatementsTerminator() { - var tokenKind = currentToken().kind(); - return tokenKind === 17 /* CatchKeyword */ || tokenKind === 25 /* FinallyKeyword */; - } - function isExpectedCatchBlock_StatementsTerminator() { - return currentToken().kind() === 25 /* FinallyKeyword */; - } - function isExpectedListItem(currentListType, inErrorRecovery) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return isModuleElement(inErrorRecovery); - case 1 /* ClassDeclaration_ClassElements */: - return isClassElement(inErrorRecovery); - case 2 /* ModuleDeclaration_ModuleElements */: - return isModuleElement(inErrorRecovery); - case 3 /* SwitchStatement_SwitchClauses */: - return isSwitchClause(); - case 4 /* SwitchClause_Statements */: - return isStatement(modifierCount(), inErrorRecovery); - case 5 /* Block_Statements */: - return isStatement(modifierCount(), inErrorRecovery); - case 6 /* TryBlock_Statements */: - return false; - case 7 /* CatchBlock_Statements */: - return false; - case 8 /* EnumDeclaration_EnumElements */: - return isEnumElement(inErrorRecovery); - case 9 /* ObjectType_TypeMembers */: - return isTypeMember(inErrorRecovery); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return isHeritageClause(); - case 11 /* HeritageClause_TypeNameList */: - return isHeritageClauseTypeName(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return isVariableDeclarator(); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return isVariableDeclarator(); - case 14 /* ArgumentList_AssignmentExpressions */: - return isExpectedArgumentList_AssignmentExpression(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return isPropertyAssignment(inErrorRecovery); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return isAssignmentOrOmittedExpression(); - case 17 /* ParameterList_Parameters */: - return isParameter(); - case 18 /* IndexSignature_Parameters */: - return isParameter(); - case 19 /* TypeArgumentList_Types */: - return isType(); - case 20 /* TypeParameterList_TypeParameters */: - return isTypeParameter(); - default: - throw TypeScript.Errors.invalidOperation(); - } - } - function isExpectedArgumentList_AssignmentExpression() { - var _currentToken = currentToken(); - if (isExpression(_currentToken)) { - return true; - } - if (_currentToken.kind() === 79 /* CommaToken */) { - return true; - } - return false; - } - function tryParseExpectedListItemWorker(currentListType, inErrorRecovery) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return tryParseModuleElement(inErrorRecovery); - case 1 /* ClassDeclaration_ClassElements */: - return tryParseClassElement(inErrorRecovery); - case 2 /* ModuleDeclaration_ModuleElements */: - return tryParseModuleElement(inErrorRecovery); - case 3 /* SwitchStatement_SwitchClauses */: - return tryParseSwitchClause(); - case 4 /* SwitchClause_Statements */: - return tryParseStatement(inErrorRecovery); - case 5 /* Block_Statements */: - return tryParseStatement(inErrorRecovery); - case 6 /* TryBlock_Statements */: - return tryParseStatement(inErrorRecovery); - case 7 /* CatchBlock_Statements */: - return tryParseStatement(inErrorRecovery); - case 8 /* EnumDeclaration_EnumElements */: - return tryParseEnumElement(inErrorRecovery); - case 9 /* ObjectType_TypeMembers */: - return tryParseTypeMember(inErrorRecovery); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return tryParseHeritageClause(); - case 11 /* HeritageClause_TypeNameList */: - return tryParseHeritageClauseTypeName(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return tryParseVariableDeclarator(true, false); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return tryParseVariableDeclarator(false, false); - case 14 /* ArgumentList_AssignmentExpressions */: - return tryParseArgumentListExpression(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return tryParsePropertyAssignment(inErrorRecovery); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return tryParseAssignmentOrOmittedExpression(); - case 17 /* ParameterList_Parameters */: - return tryParseParameter(); - case 18 /* IndexSignature_Parameters */: - return tryParseParameter(); - case 19 /* TypeArgumentList_Types */: - return tryParseType(); - case 20 /* TypeParameterList_TypeParameters */: - return tryParseTypeParameter(); - default: - throw TypeScript.Errors.invalidOperation(); - } - } - function getExpectedListElementType(currentListType) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return '{'; - case 1 /* ClassDeclaration_ClassElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.constructor_function_accessor_or_variable, null); - case 2 /* ModuleDeclaration_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case 3 /* SwitchStatement_SwitchClauses */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.case_or_default_clause, null); - case 4 /* SwitchClause_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - case 5 /* Block_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 8 /* EnumDeclaration_EnumElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 9 /* ObjectType_TypeMembers */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.call_construct_index_property_or_function_signature, null); - case 14 /* ArgumentList_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - case 11 /* HeritageClause_TypeNameList */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_name, null); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.property_or_accessor, null); - case 17 /* ParameterList_Parameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, null); - case 18 /* IndexSignature_Parameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, null); - case 19 /* TypeArgumentList_Types */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null); - case 20 /* TypeParameterList_TypeParameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, null); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - default: - throw TypeScript.Errors.invalidOperation(); - } - } - return parseSyntaxTree; - } - var BinaryExpressionPrecedence; - (function (BinaryExpressionPrecedence) { - BinaryExpressionPrecedence[BinaryExpressionPrecedence["Lowest"] = 1] = "Lowest"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["LogicalOrExpressionPrecedence"] = 2] = "LogicalOrExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["LogicalAndExpressionPrecedence"] = 3] = "LogicalAndExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["BitwiseOrExpressionPrecedence"] = 4] = "BitwiseOrExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["BitwiseExclusiveOrExpressionPrecedence"] = 5] = "BitwiseExclusiveOrExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["BitwiseAndExpressionPrecedence"] = 6] = "BitwiseAndExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["EqualityExpressionPrecedence"] = 7] = "EqualityExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["RelationalExpressionPrecedence"] = 8] = "RelationalExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["ShiftExpressionPrecdence"] = 9] = "ShiftExpressionPrecdence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["AdditiveExpressionPrecedence"] = 10] = "AdditiveExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["MultiplicativeExpressionPrecedence"] = 11] = "MultiplicativeExpressionPrecedence"; - })(BinaryExpressionPrecedence || (BinaryExpressionPrecedence = {})); - var ListParsingState; - (function (ListParsingState) { - ListParsingState[ListParsingState["SourceUnit_ModuleElements"] = 0] = "SourceUnit_ModuleElements"; - ListParsingState[ListParsingState["ClassDeclaration_ClassElements"] = 1] = "ClassDeclaration_ClassElements"; - ListParsingState[ListParsingState["ModuleDeclaration_ModuleElements"] = 2] = "ModuleDeclaration_ModuleElements"; - ListParsingState[ListParsingState["SwitchStatement_SwitchClauses"] = 3] = "SwitchStatement_SwitchClauses"; - ListParsingState[ListParsingState["SwitchClause_Statements"] = 4] = "SwitchClause_Statements"; - ListParsingState[ListParsingState["Block_Statements"] = 5] = "Block_Statements"; - ListParsingState[ListParsingState["TryBlock_Statements"] = 6] = "TryBlock_Statements"; - ListParsingState[ListParsingState["CatchBlock_Statements"] = 7] = "CatchBlock_Statements"; - ListParsingState[ListParsingState["EnumDeclaration_EnumElements"] = 8] = "EnumDeclaration_EnumElements"; - ListParsingState[ListParsingState["ObjectType_TypeMembers"] = 9] = "ObjectType_TypeMembers"; - ListParsingState[ListParsingState["ClassOrInterfaceDeclaration_HeritageClauses"] = 10] = "ClassOrInterfaceDeclaration_HeritageClauses"; - ListParsingState[ListParsingState["HeritageClause_TypeNameList"] = 11] = "HeritageClause_TypeNameList"; - ListParsingState[ListParsingState["VariableDeclaration_VariableDeclarators_AllowIn"] = 12] = "VariableDeclaration_VariableDeclarators_AllowIn"; - ListParsingState[ListParsingState["VariableDeclaration_VariableDeclarators_DisallowIn"] = 13] = "VariableDeclaration_VariableDeclarators_DisallowIn"; - ListParsingState[ListParsingState["ArgumentList_AssignmentExpressions"] = 14] = "ArgumentList_AssignmentExpressions"; - ListParsingState[ListParsingState["ObjectLiteralExpression_PropertyAssignments"] = 15] = "ObjectLiteralExpression_PropertyAssignments"; - ListParsingState[ListParsingState["ArrayLiteralExpression_AssignmentExpressions"] = 16] = "ArrayLiteralExpression_AssignmentExpressions"; - ListParsingState[ListParsingState["ParameterList_Parameters"] = 17] = "ParameterList_Parameters"; - ListParsingState[ListParsingState["IndexSignature_Parameters"] = 18] = "IndexSignature_Parameters"; - ListParsingState[ListParsingState["TypeArgumentList_Types"] = 19] = "TypeArgumentList_Types"; - ListParsingState[ListParsingState["TypeParameterList_TypeParameters"] = 20] = "TypeParameterList_TypeParameters"; - ListParsingState[ListParsingState["FirstListParsingState"] = ListParsingState.SourceUnit_ModuleElements] = "FirstListParsingState"; - ListParsingState[ListParsingState["LastListParsingState"] = ListParsingState.TypeParameterList_TypeParameters] = "LastListParsingState"; - })(ListParsingState || (ListParsingState = {})); - var parseSyntaxTree = createParseSyntaxTree(); - function parse(fileName, text, languageVersion, isDeclaration) { - return parseSource(TypeScript.Scanner.createParserSource(fileName, text, languageVersion), isDeclaration); - } - Parser.parse = parse; - function parseSource(source, isDeclaration) { - return parseSyntaxTree(source, isDeclaration); - } - Parser.parseSource = parseSource; - })(TypeScript.Parser || (TypeScript.Parser = {})); - var Parser = TypeScript.Parser; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - (function (Concrete) { - TypeScript.Parser.syntaxFactory = Concrete; - Concrete.isConcrete = true; - var SourceUnitSyntax = (function (_super) { - __extends(SourceUnitSyntax, _super); - function SourceUnitSyntax(data, moduleElements, endOfFileToken) { - _super.call(this, data); - this.syntaxTree = null; - this.parent = null, this.moduleElements = moduleElements, this.endOfFileToken = endOfFileToken, !TypeScript.isShared(moduleElements) && (moduleElements.parent = this), endOfFileToken.parent = this; - } - return SourceUnitSyntax; - })(TypeScript.SyntaxNode); - Concrete.SourceUnitSyntax = SourceUnitSyntax; - var QualifiedNameSyntax = (function (_super) { - __extends(QualifiedNameSyntax, _super); - function QualifiedNameSyntax(data, left, dotToken, right) { - _super.call(this, data); - this.left = left, this.dotToken = dotToken, this.right = right, left.parent = this, dotToken.parent = this, right.parent = this; - } - return QualifiedNameSyntax; - })(TypeScript.SyntaxNode); - Concrete.QualifiedNameSyntax = QualifiedNameSyntax; - var ObjectTypeSyntax = (function (_super) { - __extends(ObjectTypeSyntax, _super); - function ObjectTypeSyntax(data, openBraceToken, typeMembers, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.typeMembers = typeMembers, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(typeMembers) && (typeMembers.parent = this), closeBraceToken.parent = this; - } - return ObjectTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectTypeSyntax = ObjectTypeSyntax; - var FunctionTypeSyntax = (function (_super) { - __extends(FunctionTypeSyntax, _super); - function FunctionTypeSyntax(data, typeParameterList, parameterList, equalsGreaterThanToken, type) { - _super.call(this, data); - this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.equalsGreaterThanToken = equalsGreaterThanToken, this.type = type, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, equalsGreaterThanToken.parent = this, type.parent = this; - } - return FunctionTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionTypeSyntax = FunctionTypeSyntax; - var ArrayTypeSyntax = (function (_super) { - __extends(ArrayTypeSyntax, _super); - function ArrayTypeSyntax(data, type, openBracketToken, closeBracketToken) { - _super.call(this, data); - this.type = type, this.openBracketToken = openBracketToken, this.closeBracketToken = closeBracketToken, type.parent = this, openBracketToken.parent = this, closeBracketToken.parent = this; - } - return ArrayTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArrayTypeSyntax = ArrayTypeSyntax; - var ConstructorTypeSyntax = (function (_super) { - __extends(ConstructorTypeSyntax, _super); - function ConstructorTypeSyntax(data, newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - _super.call(this, data); - this.newKeyword = newKeyword, this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.equalsGreaterThanToken = equalsGreaterThanToken, this.type = type, newKeyword.parent = this, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, equalsGreaterThanToken.parent = this, type.parent = this; - } - return ConstructorTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructorTypeSyntax = ConstructorTypeSyntax; - var GenericTypeSyntax = (function (_super) { - __extends(GenericTypeSyntax, _super); - function GenericTypeSyntax(data, name, typeArgumentList) { - _super.call(this, data); - this.name = name, this.typeArgumentList = typeArgumentList, name.parent = this, typeArgumentList.parent = this; - } - return GenericTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.GenericTypeSyntax = GenericTypeSyntax; - var TypeQuerySyntax = (function (_super) { - __extends(TypeQuerySyntax, _super); - function TypeQuerySyntax(data, typeOfKeyword, name) { - _super.call(this, data); - this.typeOfKeyword = typeOfKeyword, this.name = name, typeOfKeyword.parent = this, name.parent = this; - } - return TypeQuerySyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeQuerySyntax = TypeQuerySyntax; - var InterfaceDeclarationSyntax = (function (_super) { - __extends(InterfaceDeclarationSyntax, _super); - function InterfaceDeclarationSyntax(data, modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - _super.call(this, data); - this.modifiers = modifiers, this.interfaceKeyword = interfaceKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.body = body, !TypeScript.isShared(modifiers) && (modifiers.parent = this), interfaceKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), !TypeScript.isShared(heritageClauses) && (heritageClauses.parent = this), body.parent = this; - } - return InterfaceDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.InterfaceDeclarationSyntax = InterfaceDeclarationSyntax; - var FunctionDeclarationSyntax = (function (_super) { - __extends(FunctionDeclarationSyntax, _super); - function FunctionDeclarationSyntax(data, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), functionKeyword.parent = this, identifier.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return FunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionDeclarationSyntax = FunctionDeclarationSyntax; - var ModuleDeclarationSyntax = (function (_super) { - __extends(ModuleDeclarationSyntax, _super); - function ModuleDeclarationSyntax(data, modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.moduleKeyword = moduleKeyword, this.name = name, this.stringLiteral = stringLiteral, this.openBraceToken = openBraceToken, this.moduleElements = moduleElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), moduleKeyword.parent = this, name && (name.parent = this), stringLiteral && (stringLiteral.parent = this), openBraceToken.parent = this, !TypeScript.isShared(moduleElements) && (moduleElements.parent = this), closeBraceToken.parent = this; - } - return ModuleDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ModuleDeclarationSyntax = ModuleDeclarationSyntax; - var ClassDeclarationSyntax = (function (_super) { - __extends(ClassDeclarationSyntax, _super); - function ClassDeclarationSyntax(data, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.classKeyword = classKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.openBraceToken = openBraceToken, this.classElements = classElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), classKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), !TypeScript.isShared(heritageClauses) && (heritageClauses.parent = this), openBraceToken.parent = this, !TypeScript.isShared(classElements) && (classElements.parent = this), closeBraceToken.parent = this; - } - return ClassDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ClassDeclarationSyntax = ClassDeclarationSyntax; - var EnumDeclarationSyntax = (function (_super) { - __extends(EnumDeclarationSyntax, _super); - function EnumDeclarationSyntax(data, modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.enumKeyword = enumKeyword, this.identifier = identifier, this.openBraceToken = openBraceToken, this.enumElements = enumElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), enumKeyword.parent = this, identifier.parent = this, openBraceToken.parent = this, !TypeScript.isShared(enumElements) && (enumElements.parent = this), closeBraceToken.parent = this; - } - return EnumDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.EnumDeclarationSyntax = EnumDeclarationSyntax; - var ImportDeclarationSyntax = (function (_super) { - __extends(ImportDeclarationSyntax, _super); - function ImportDeclarationSyntax(data, modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.importKeyword = importKeyword, this.identifier = identifier, this.equalsToken = equalsToken, this.moduleReference = moduleReference, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), importKeyword.parent = this, identifier.parent = this, equalsToken.parent = this, moduleReference.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ImportDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ImportDeclarationSyntax = ImportDeclarationSyntax; - var ExportAssignmentSyntax = (function (_super) { - __extends(ExportAssignmentSyntax, _super); - function ExportAssignmentSyntax(data, exportKeyword, equalsToken, identifier, semicolonToken) { - _super.call(this, data); - this.exportKeyword = exportKeyword, this.equalsToken = equalsToken, this.identifier = identifier, this.semicolonToken = semicolonToken, exportKeyword.parent = this, equalsToken.parent = this, identifier.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ExportAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExportAssignmentSyntax = ExportAssignmentSyntax; - var MemberFunctionDeclarationSyntax = (function (_super) { - __extends(MemberFunctionDeclarationSyntax, _super); - function MemberFunctionDeclarationSyntax(data, modifiers, propertyName, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), propertyName.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return MemberFunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberFunctionDeclarationSyntax = MemberFunctionDeclarationSyntax; - var MemberVariableDeclarationSyntax = (function (_super) { - __extends(MemberVariableDeclarationSyntax, _super); - function MemberVariableDeclarationSyntax(data, modifiers, variableDeclarator, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.variableDeclarator = variableDeclarator, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), variableDeclarator.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return MemberVariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberVariableDeclarationSyntax = MemberVariableDeclarationSyntax; - var ConstructorDeclarationSyntax = (function (_super) { - __extends(ConstructorDeclarationSyntax, _super); - function ConstructorDeclarationSyntax(data, modifiers, constructorKeyword, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.constructorKeyword = constructorKeyword, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), constructorKeyword.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ConstructorDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructorDeclarationSyntax = ConstructorDeclarationSyntax; - var IndexMemberDeclarationSyntax = (function (_super) { - __extends(IndexMemberDeclarationSyntax, _super); - function IndexMemberDeclarationSyntax(data, modifiers, indexSignature, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.indexSignature = indexSignature, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), indexSignature.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return IndexMemberDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.IndexMemberDeclarationSyntax = IndexMemberDeclarationSyntax; - var GetAccessorSyntax = (function (_super) { - __extends(GetAccessorSyntax, _super); - function GetAccessorSyntax(data, modifiers, getKeyword, propertyName, callSignature, block) { - _super.call(this, data); - this.modifiers = modifiers, this.getKeyword = getKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, !TypeScript.isShared(modifiers) && (modifiers.parent = this), getKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return GetAccessorSyntax; - })(TypeScript.SyntaxNode); - Concrete.GetAccessorSyntax = GetAccessorSyntax; - var SetAccessorSyntax = (function (_super) { - __extends(SetAccessorSyntax, _super); - function SetAccessorSyntax(data, modifiers, setKeyword, propertyName, callSignature, block) { - _super.call(this, data); - this.modifiers = modifiers, this.setKeyword = setKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, !TypeScript.isShared(modifiers) && (modifiers.parent = this), setKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return SetAccessorSyntax; - })(TypeScript.SyntaxNode); - Concrete.SetAccessorSyntax = SetAccessorSyntax; - var PropertySignatureSyntax = (function (_super) { - __extends(PropertySignatureSyntax, _super); - function PropertySignatureSyntax(data, propertyName, questionToken, typeAnnotation) { - _super.call(this, data); - this.propertyName = propertyName, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation, propertyName.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this); - } - return PropertySignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.PropertySignatureSyntax = PropertySignatureSyntax; - var CallSignatureSyntax = (function (_super) { - __extends(CallSignatureSyntax, _super); - function CallSignatureSyntax(data, typeParameterList, parameterList, typeAnnotation) { - _super.call(this, data); - this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.typeAnnotation = typeAnnotation, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, typeAnnotation && (typeAnnotation.parent = this); - } - return CallSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.CallSignatureSyntax = CallSignatureSyntax; - var ConstructSignatureSyntax = (function (_super) { - __extends(ConstructSignatureSyntax, _super); - function ConstructSignatureSyntax(data, newKeyword, callSignature) { - _super.call(this, data); - this.newKeyword = newKeyword, this.callSignature = callSignature, newKeyword.parent = this, callSignature.parent = this; - } - return ConstructSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructSignatureSyntax = ConstructSignatureSyntax; - var IndexSignatureSyntax = (function (_super) { - __extends(IndexSignatureSyntax, _super); - function IndexSignatureSyntax(data, openBracketToken, parameters, closeBracketToken, typeAnnotation) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.parameters = parameters, this.closeBracketToken = closeBracketToken, this.typeAnnotation = typeAnnotation, openBracketToken.parent = this, !TypeScript.isShared(parameters) && (parameters.parent = this), closeBracketToken.parent = this, typeAnnotation && (typeAnnotation.parent = this); - } - return IndexSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.IndexSignatureSyntax = IndexSignatureSyntax; - var MethodSignatureSyntax = (function (_super) { - __extends(MethodSignatureSyntax, _super); - function MethodSignatureSyntax(data, propertyName, questionToken, callSignature) { - _super.call(this, data); - this.propertyName = propertyName, this.questionToken = questionToken, this.callSignature = callSignature, propertyName.parent = this, questionToken && (questionToken.parent = this), callSignature.parent = this; - } - return MethodSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.MethodSignatureSyntax = MethodSignatureSyntax; - var BlockSyntax = (function (_super) { - __extends(BlockSyntax, _super); - function BlockSyntax(data, openBraceToken, statements, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.statements = statements, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this), closeBraceToken.parent = this; - } - return BlockSyntax; - })(TypeScript.SyntaxNode); - Concrete.BlockSyntax = BlockSyntax; - var IfStatementSyntax = (function (_super) { - __extends(IfStatementSyntax, _super); - function IfStatementSyntax(data, ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - _super.call(this, data); - this.ifKeyword = ifKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, this.elseClause = elseClause, ifKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this, elseClause && (elseClause.parent = this); - } - return IfStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.IfStatementSyntax = IfStatementSyntax; - var VariableStatementSyntax = (function (_super) { - __extends(VariableStatementSyntax, _super); - function VariableStatementSyntax(data, modifiers, variableDeclaration, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.variableDeclaration = variableDeclaration, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), variableDeclaration.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return VariableStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableStatementSyntax = VariableStatementSyntax; - var ExpressionStatementSyntax = (function (_super) { - __extends(ExpressionStatementSyntax, _super); - function ExpressionStatementSyntax(data, expression, semicolonToken) { - _super.call(this, data); - this.expression = expression, this.semicolonToken = semicolonToken, expression.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ExpressionStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExpressionStatementSyntax = ExpressionStatementSyntax; - var ReturnStatementSyntax = (function (_super) { - __extends(ReturnStatementSyntax, _super); - function ReturnStatementSyntax(data, returnKeyword, expression, semicolonToken) { - _super.call(this, data); - this.returnKeyword = returnKeyword, this.expression = expression, this.semicolonToken = semicolonToken, returnKeyword.parent = this, expression && (expression.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ReturnStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ReturnStatementSyntax = ReturnStatementSyntax; - var SwitchStatementSyntax = (function (_super) { - __extends(SwitchStatementSyntax, _super); - function SwitchStatementSyntax(data, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - _super.call(this, data); - this.switchKeyword = switchKeyword, this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken, this.openBraceToken = openBraceToken, this.switchClauses = switchClauses, this.closeBraceToken = closeBraceToken, switchKeyword.parent = this, openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this, openBraceToken.parent = this, !TypeScript.isShared(switchClauses) && (switchClauses.parent = this), closeBraceToken.parent = this; - } - return SwitchStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.SwitchStatementSyntax = SwitchStatementSyntax; - var BreakStatementSyntax = (function (_super) { - __extends(BreakStatementSyntax, _super); - function BreakStatementSyntax(data, breakKeyword, identifier, semicolonToken) { - _super.call(this, data); - this.breakKeyword = breakKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken, breakKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return BreakStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.BreakStatementSyntax = BreakStatementSyntax; - var ContinueStatementSyntax = (function (_super) { - __extends(ContinueStatementSyntax, _super); - function ContinueStatementSyntax(data, continueKeyword, identifier, semicolonToken) { - _super.call(this, data); - this.continueKeyword = continueKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken, continueKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ContinueStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ContinueStatementSyntax = ContinueStatementSyntax; - var ForStatementSyntax = (function (_super) { - __extends(ForStatementSyntax, _super); - function ForStatementSyntax(data, forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - _super.call(this, data); - this.forKeyword = forKeyword, this.openParenToken = openParenToken, this.variableDeclaration = variableDeclaration, this.initializer = initializer, this.firstSemicolonToken = firstSemicolonToken, this.condition = condition, this.secondSemicolonToken = secondSemicolonToken, this.incrementor = incrementor, this.closeParenToken = closeParenToken, this.statement = statement, forKeyword.parent = this, openParenToken.parent = this, variableDeclaration && (variableDeclaration.parent = this), initializer && (initializer.parent = this), firstSemicolonToken.parent = this, condition && (condition.parent = this), secondSemicolonToken.parent = this, incrementor && (incrementor.parent = this), closeParenToken.parent = this, statement.parent = this; - } - return ForStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ForStatementSyntax = ForStatementSyntax; - var ForInStatementSyntax = (function (_super) { - __extends(ForInStatementSyntax, _super); - function ForInStatementSyntax(data, forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - _super.call(this, data); - this.forKeyword = forKeyword, this.openParenToken = openParenToken, this.variableDeclaration = variableDeclaration, this.left = left, this.inKeyword = inKeyword, this.expression = expression, this.closeParenToken = closeParenToken, this.statement = statement, forKeyword.parent = this, openParenToken.parent = this, variableDeclaration && (variableDeclaration.parent = this), left && (left.parent = this), inKeyword.parent = this, expression.parent = this, closeParenToken.parent = this, statement.parent = this; - } - return ForInStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ForInStatementSyntax = ForInStatementSyntax; - var EmptyStatementSyntax = (function (_super) { - __extends(EmptyStatementSyntax, _super); - function EmptyStatementSyntax(data, semicolonToken) { - _super.call(this, data); - this.semicolonToken = semicolonToken, semicolonToken.parent = this; - } - return EmptyStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.EmptyStatementSyntax = EmptyStatementSyntax; - var ThrowStatementSyntax = (function (_super) { - __extends(ThrowStatementSyntax, _super); - function ThrowStatementSyntax(data, throwKeyword, expression, semicolonToken) { - _super.call(this, data); - this.throwKeyword = throwKeyword, this.expression = expression, this.semicolonToken = semicolonToken, throwKeyword.parent = this, expression.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ThrowStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ThrowStatementSyntax = ThrowStatementSyntax; - var WhileStatementSyntax = (function (_super) { - __extends(WhileStatementSyntax, _super); - function WhileStatementSyntax(data, whileKeyword, openParenToken, condition, closeParenToken, statement) { - _super.call(this, data); - this.whileKeyword = whileKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, whileKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this; - } - return WhileStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.WhileStatementSyntax = WhileStatementSyntax; - var TryStatementSyntax = (function (_super) { - __extends(TryStatementSyntax, _super); - function TryStatementSyntax(data, tryKeyword, block, catchClause, finallyClause) { - _super.call(this, data); - this.tryKeyword = tryKeyword, this.block = block, this.catchClause = catchClause, this.finallyClause = finallyClause, tryKeyword.parent = this, block.parent = this, catchClause && (catchClause.parent = this), finallyClause && (finallyClause.parent = this); - } - return TryStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.TryStatementSyntax = TryStatementSyntax; - var LabeledStatementSyntax = (function (_super) { - __extends(LabeledStatementSyntax, _super); - function LabeledStatementSyntax(data, identifier, colonToken, statement) { - _super.call(this, data); - this.identifier = identifier, this.colonToken = colonToken, this.statement = statement, identifier.parent = this, colonToken.parent = this, statement.parent = this; - } - return LabeledStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.LabeledStatementSyntax = LabeledStatementSyntax; - var DoStatementSyntax = (function (_super) { - __extends(DoStatementSyntax, _super); - function DoStatementSyntax(data, doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - _super.call(this, data); - this.doKeyword = doKeyword, this.statement = statement, this.whileKeyword = whileKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.semicolonToken = semicolonToken, doKeyword.parent = this, statement.parent = this, whileKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return DoStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.DoStatementSyntax = DoStatementSyntax; - var DebuggerStatementSyntax = (function (_super) { - __extends(DebuggerStatementSyntax, _super); - function DebuggerStatementSyntax(data, debuggerKeyword, semicolonToken) { - _super.call(this, data); - this.debuggerKeyword = debuggerKeyword, this.semicolonToken = semicolonToken, debuggerKeyword.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return DebuggerStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.DebuggerStatementSyntax = DebuggerStatementSyntax; - var WithStatementSyntax = (function (_super) { - __extends(WithStatementSyntax, _super); - function WithStatementSyntax(data, withKeyword, openParenToken, condition, closeParenToken, statement) { - _super.call(this, data); - this.withKeyword = withKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, withKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this; - } - return WithStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.WithStatementSyntax = WithStatementSyntax; - var PrefixUnaryExpressionSyntax = (function (_super) { - __extends(PrefixUnaryExpressionSyntax, _super); - function PrefixUnaryExpressionSyntax(data, operatorToken, operand) { - _super.call(this, data); - this.operatorToken = operatorToken, this.operand = operand, operatorToken.parent = this, operand.parent = this; - } - PrefixUnaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return PrefixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.PrefixUnaryExpressionSyntax = PrefixUnaryExpressionSyntax; - var DeleteExpressionSyntax = (function (_super) { - __extends(DeleteExpressionSyntax, _super); - function DeleteExpressionSyntax(data, deleteKeyword, expression) { - _super.call(this, data); - this.deleteKeyword = deleteKeyword, this.expression = expression, deleteKeyword.parent = this, expression.parent = this; - } - return DeleteExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.DeleteExpressionSyntax = DeleteExpressionSyntax; - var TypeOfExpressionSyntax = (function (_super) { - __extends(TypeOfExpressionSyntax, _super); - function TypeOfExpressionSyntax(data, typeOfKeyword, expression) { - _super.call(this, data); - this.typeOfKeyword = typeOfKeyword, this.expression = expression, typeOfKeyword.parent = this, expression.parent = this; - } - return TypeOfExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeOfExpressionSyntax = TypeOfExpressionSyntax; - var VoidExpressionSyntax = (function (_super) { - __extends(VoidExpressionSyntax, _super); - function VoidExpressionSyntax(data, voidKeyword, expression) { - _super.call(this, data); - this.voidKeyword = voidKeyword, this.expression = expression, voidKeyword.parent = this, expression.parent = this; - } - return VoidExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.VoidExpressionSyntax = VoidExpressionSyntax; - var ConditionalExpressionSyntax = (function (_super) { - __extends(ConditionalExpressionSyntax, _super); - function ConditionalExpressionSyntax(data, condition, questionToken, whenTrue, colonToken, whenFalse) { - _super.call(this, data); - this.condition = condition, this.questionToken = questionToken, this.whenTrue = whenTrue, this.colonToken = colonToken, this.whenFalse = whenFalse, condition.parent = this, questionToken.parent = this, whenTrue.parent = this, colonToken.parent = this, whenFalse.parent = this; - } - return ConditionalExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConditionalExpressionSyntax = ConditionalExpressionSyntax; - var BinaryExpressionSyntax = (function (_super) { - __extends(BinaryExpressionSyntax, _super); - function BinaryExpressionSyntax(data, left, operatorToken, right) { - _super.call(this, data); - this.left = left, this.operatorToken = operatorToken, this.right = right, left.parent = this, operatorToken.parent = this, right.parent = this; - } - BinaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getBinaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return BinaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.BinaryExpressionSyntax = BinaryExpressionSyntax; - var PostfixUnaryExpressionSyntax = (function (_super) { - __extends(PostfixUnaryExpressionSyntax, _super); - function PostfixUnaryExpressionSyntax(data, operand, operatorToken) { - _super.call(this, data); - this.operand = operand, this.operatorToken = operatorToken, operand.parent = this, operatorToken.parent = this; - } - PostfixUnaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return PostfixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.PostfixUnaryExpressionSyntax = PostfixUnaryExpressionSyntax; - var MemberAccessExpressionSyntax = (function (_super) { - __extends(MemberAccessExpressionSyntax, _super); - function MemberAccessExpressionSyntax(data, expression, dotToken, name) { - _super.call(this, data); - this.expression = expression, this.dotToken = dotToken, this.name = name, expression.parent = this, dotToken.parent = this, name.parent = this; - } - return MemberAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberAccessExpressionSyntax = MemberAccessExpressionSyntax; - var InvocationExpressionSyntax = (function (_super) { - __extends(InvocationExpressionSyntax, _super); - function InvocationExpressionSyntax(data, expression, argumentList) { - _super.call(this, data); - this.expression = expression, this.argumentList = argumentList, expression.parent = this, argumentList.parent = this; - } - return InvocationExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.InvocationExpressionSyntax = InvocationExpressionSyntax; - var ArrayLiteralExpressionSyntax = (function (_super) { - __extends(ArrayLiteralExpressionSyntax, _super); - function ArrayLiteralExpressionSyntax(data, openBracketToken, expressions, closeBracketToken) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.expressions = expressions, this.closeBracketToken = closeBracketToken, openBracketToken.parent = this, !TypeScript.isShared(expressions) && (expressions.parent = this), closeBracketToken.parent = this; - } - return ArrayLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArrayLiteralExpressionSyntax = ArrayLiteralExpressionSyntax; - var ObjectLiteralExpressionSyntax = (function (_super) { - __extends(ObjectLiteralExpressionSyntax, _super); - function ObjectLiteralExpressionSyntax(data, openBraceToken, propertyAssignments, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.propertyAssignments = propertyAssignments, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(propertyAssignments) && (propertyAssignments.parent = this), closeBraceToken.parent = this; - } - return ObjectLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectLiteralExpressionSyntax = ObjectLiteralExpressionSyntax; - var ObjectCreationExpressionSyntax = (function (_super) { - __extends(ObjectCreationExpressionSyntax, _super); - function ObjectCreationExpressionSyntax(data, newKeyword, expression, argumentList) { - _super.call(this, data); - this.newKeyword = newKeyword, this.expression = expression, this.argumentList = argumentList, newKeyword.parent = this, expression.parent = this, argumentList && (argumentList.parent = this); - } - return ObjectCreationExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectCreationExpressionSyntax = ObjectCreationExpressionSyntax; - var ParenthesizedExpressionSyntax = (function (_super) { - __extends(ParenthesizedExpressionSyntax, _super); - function ParenthesizedExpressionSyntax(data, openParenToken, expression, closeParenToken) { - _super.call(this, data); - this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken, openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this; - } - return ParenthesizedExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParenthesizedExpressionSyntax = ParenthesizedExpressionSyntax; - var ParenthesizedArrowFunctionExpressionSyntax = (function (_super) { - __extends(ParenthesizedArrowFunctionExpressionSyntax, _super); - function ParenthesizedArrowFunctionExpressionSyntax(data, callSignature, equalsGreaterThanToken, block, expression) { - _super.call(this, data); - this.callSignature = callSignature, this.equalsGreaterThanToken = equalsGreaterThanToken, this.block = block, this.expression = expression, callSignature.parent = this, equalsGreaterThanToken.parent = this, block && (block.parent = this), expression && (expression.parent = this); - } - return ParenthesizedArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParenthesizedArrowFunctionExpressionSyntax = ParenthesizedArrowFunctionExpressionSyntax; - var SimpleArrowFunctionExpressionSyntax = (function (_super) { - __extends(SimpleArrowFunctionExpressionSyntax, _super); - function SimpleArrowFunctionExpressionSyntax(data, parameter, equalsGreaterThanToken, block, expression) { - _super.call(this, data); - this.parameter = parameter, this.equalsGreaterThanToken = equalsGreaterThanToken, this.block = block, this.expression = expression, parameter.parent = this, equalsGreaterThanToken.parent = this, block && (block.parent = this), expression && (expression.parent = this); - } - return SimpleArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.SimpleArrowFunctionExpressionSyntax = SimpleArrowFunctionExpressionSyntax; - var CastExpressionSyntax = (function (_super) { - __extends(CastExpressionSyntax, _super); - function CastExpressionSyntax(data, lessThanToken, type, greaterThanToken, expression) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.type = type, this.greaterThanToken = greaterThanToken, this.expression = expression, lessThanToken.parent = this, type.parent = this, greaterThanToken.parent = this, expression.parent = this; - } - return CastExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.CastExpressionSyntax = CastExpressionSyntax; - var ElementAccessExpressionSyntax = (function (_super) { - __extends(ElementAccessExpressionSyntax, _super); - function ElementAccessExpressionSyntax(data, expression, openBracketToken, argumentExpression, closeBracketToken) { - _super.call(this, data); - this.expression = expression, this.openBracketToken = openBracketToken, this.argumentExpression = argumentExpression, this.closeBracketToken = closeBracketToken, expression.parent = this, openBracketToken.parent = this, argumentExpression.parent = this, closeBracketToken.parent = this; - } - return ElementAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ElementAccessExpressionSyntax = ElementAccessExpressionSyntax; - var FunctionExpressionSyntax = (function (_super) { - __extends(FunctionExpressionSyntax, _super); - function FunctionExpressionSyntax(data, functionKeyword, identifier, callSignature, block) { - _super.call(this, data); - this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block, functionKeyword.parent = this, identifier && (identifier.parent = this), callSignature.parent = this, block.parent = this; - } - return FunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionExpressionSyntax = FunctionExpressionSyntax; - var OmittedExpressionSyntax = (function (_super) { - __extends(OmittedExpressionSyntax, _super); - function OmittedExpressionSyntax(data) { - _super.call(this, data); - } - return OmittedExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.OmittedExpressionSyntax = OmittedExpressionSyntax; - var VariableDeclarationSyntax = (function (_super) { - __extends(VariableDeclarationSyntax, _super); - function VariableDeclarationSyntax(data, varKeyword, variableDeclarators) { - _super.call(this, data); - this.varKeyword = varKeyword, this.variableDeclarators = variableDeclarators, varKeyword.parent = this, !TypeScript.isShared(variableDeclarators) && (variableDeclarators.parent = this); - } - return VariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableDeclarationSyntax = VariableDeclarationSyntax; - var VariableDeclaratorSyntax = (function (_super) { - __extends(VariableDeclaratorSyntax, _super); - function VariableDeclaratorSyntax(data, propertyName, typeAnnotation, equalsValueClause) { - _super.call(this, data); - this.propertyName = propertyName, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause, propertyName.parent = this, typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); - } - return VariableDeclaratorSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableDeclaratorSyntax = VariableDeclaratorSyntax; - var ArgumentListSyntax = (function (_super) { - __extends(ArgumentListSyntax, _super); - function ArgumentListSyntax(data, typeArgumentList, openParenToken, _arguments, closeParenToken) { - _super.call(this, data); - this.typeArgumentList = typeArgumentList, this.openParenToken = openParenToken, this.arguments = _arguments, this.closeParenToken = closeParenToken, typeArgumentList && (typeArgumentList.parent = this), openParenToken.parent = this, !TypeScript.isShared(_arguments) && (_arguments.parent = this), closeParenToken.parent = this; - } - return ArgumentListSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArgumentListSyntax = ArgumentListSyntax; - var ParameterListSyntax = (function (_super) { - __extends(ParameterListSyntax, _super); - function ParameterListSyntax(data, openParenToken, parameters, closeParenToken) { - _super.call(this, data); - this.openParenToken = openParenToken, this.parameters = parameters, this.closeParenToken = closeParenToken, openParenToken.parent = this, !TypeScript.isShared(parameters) && (parameters.parent = this), closeParenToken.parent = this; - } - return ParameterListSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParameterListSyntax = ParameterListSyntax; - var TypeArgumentListSyntax = (function (_super) { - __extends(TypeArgumentListSyntax, _super); - function TypeArgumentListSyntax(data, lessThanToken, typeArguments, greaterThanToken) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.typeArguments = typeArguments, this.greaterThanToken = greaterThanToken, lessThanToken.parent = this, !TypeScript.isShared(typeArguments) && (typeArguments.parent = this), greaterThanToken.parent = this; - } - return TypeArgumentListSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeArgumentListSyntax = TypeArgumentListSyntax; - var TypeParameterListSyntax = (function (_super) { - __extends(TypeParameterListSyntax, _super); - function TypeParameterListSyntax(data, lessThanToken, typeParameters, greaterThanToken) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.typeParameters = typeParameters, this.greaterThanToken = greaterThanToken, lessThanToken.parent = this, !TypeScript.isShared(typeParameters) && (typeParameters.parent = this), greaterThanToken.parent = this; - } - return TypeParameterListSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeParameterListSyntax = TypeParameterListSyntax; - var HeritageClauseSyntax = (function (_super) { - __extends(HeritageClauseSyntax, _super); - function HeritageClauseSyntax(data, extendsOrImplementsKeyword, typeNames) { - _super.call(this, data); - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, this.typeNames = typeNames, extendsOrImplementsKeyword.parent = this, !TypeScript.isShared(typeNames) && (typeNames.parent = this); - } - HeritageClauseSyntax.prototype.kind = function () { - return this.extendsOrImplementsKeyword.kind() === 48 /* ExtendsKeyword */ ? 230 /* ExtendsHeritageClause */ : 231 /* ImplementsHeritageClause */; - }; - return HeritageClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.HeritageClauseSyntax = HeritageClauseSyntax; - var EqualsValueClauseSyntax = (function (_super) { - __extends(EqualsValueClauseSyntax, _super); - function EqualsValueClauseSyntax(data, equalsToken, value) { - _super.call(this, data); - this.equalsToken = equalsToken, this.value = value, equalsToken.parent = this, value.parent = this; - } - return EqualsValueClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.EqualsValueClauseSyntax = EqualsValueClauseSyntax; - var CaseSwitchClauseSyntax = (function (_super) { - __extends(CaseSwitchClauseSyntax, _super); - function CaseSwitchClauseSyntax(data, caseKeyword, expression, colonToken, statements) { - _super.call(this, data); - this.caseKeyword = caseKeyword, this.expression = expression, this.colonToken = colonToken, this.statements = statements, caseKeyword.parent = this, expression.parent = this, colonToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this); - } - return CaseSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.CaseSwitchClauseSyntax = CaseSwitchClauseSyntax; - var DefaultSwitchClauseSyntax = (function (_super) { - __extends(DefaultSwitchClauseSyntax, _super); - function DefaultSwitchClauseSyntax(data, defaultKeyword, colonToken, statements) { - _super.call(this, data); - this.defaultKeyword = defaultKeyword, this.colonToken = colonToken, this.statements = statements, defaultKeyword.parent = this, colonToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this); - } - return DefaultSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.DefaultSwitchClauseSyntax = DefaultSwitchClauseSyntax; - var ElseClauseSyntax = (function (_super) { - __extends(ElseClauseSyntax, _super); - function ElseClauseSyntax(data, elseKeyword, statement) { - _super.call(this, data); - this.elseKeyword = elseKeyword, this.statement = statement, elseKeyword.parent = this, statement.parent = this; - } - return ElseClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.ElseClauseSyntax = ElseClauseSyntax; - var CatchClauseSyntax = (function (_super) { - __extends(CatchClauseSyntax, _super); - function CatchClauseSyntax(data, catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - _super.call(this, data); - this.catchKeyword = catchKeyword, this.openParenToken = openParenToken, this.identifier = identifier, this.typeAnnotation = typeAnnotation, this.closeParenToken = closeParenToken, this.block = block, catchKeyword.parent = this, openParenToken.parent = this, identifier.parent = this, typeAnnotation && (typeAnnotation.parent = this), closeParenToken.parent = this, block.parent = this; - } - return CatchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.CatchClauseSyntax = CatchClauseSyntax; - var FinallyClauseSyntax = (function (_super) { - __extends(FinallyClauseSyntax, _super); - function FinallyClauseSyntax(data, finallyKeyword, block) { - _super.call(this, data); - this.finallyKeyword = finallyKeyword, this.block = block, finallyKeyword.parent = this, block.parent = this; - } - return FinallyClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.FinallyClauseSyntax = FinallyClauseSyntax; - var TypeParameterSyntax = (function (_super) { - __extends(TypeParameterSyntax, _super); - function TypeParameterSyntax(data, identifier, constraint) { - _super.call(this, data); - this.identifier = identifier, this.constraint = constraint, identifier.parent = this, constraint && (constraint.parent = this); - } - return TypeParameterSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeParameterSyntax = TypeParameterSyntax; - var ConstraintSyntax = (function (_super) { - __extends(ConstraintSyntax, _super); - function ConstraintSyntax(data, extendsKeyword, typeOrExpression) { - _super.call(this, data); - this.extendsKeyword = extendsKeyword, this.typeOrExpression = typeOrExpression, extendsKeyword.parent = this, typeOrExpression.parent = this; - } - return ConstraintSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstraintSyntax = ConstraintSyntax; - var SimplePropertyAssignmentSyntax = (function (_super) { - __extends(SimplePropertyAssignmentSyntax, _super); - function SimplePropertyAssignmentSyntax(data, propertyName, colonToken, expression) { - _super.call(this, data); - this.propertyName = propertyName, this.colonToken = colonToken, this.expression = expression, propertyName.parent = this, colonToken.parent = this, expression.parent = this; - } - return SimplePropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.SimplePropertyAssignmentSyntax = SimplePropertyAssignmentSyntax; - var FunctionPropertyAssignmentSyntax = (function (_super) { - __extends(FunctionPropertyAssignmentSyntax, _super); - function FunctionPropertyAssignmentSyntax(data, propertyName, callSignature, block) { - _super.call(this, data); - this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return FunctionPropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionPropertyAssignmentSyntax = FunctionPropertyAssignmentSyntax; - var ParameterSyntax = (function (_super) { - __extends(ParameterSyntax, _super); - function ParameterSyntax(data, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - _super.call(this, data); - this.dotDotDotToken = dotDotDotToken, this.modifiers = modifiers, this.identifier = identifier, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause, dotDotDotToken && (dotDotDotToken.parent = this), !TypeScript.isShared(modifiers) && (modifiers.parent = this), identifier.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); - } - return ParameterSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParameterSyntax = ParameterSyntax; - var EnumElementSyntax = (function (_super) { - __extends(EnumElementSyntax, _super); - function EnumElementSyntax(data, propertyName, equalsValueClause) { - _super.call(this, data); - this.propertyName = propertyName, this.equalsValueClause = equalsValueClause, propertyName.parent = this, equalsValueClause && (equalsValueClause.parent = this); - } - return EnumElementSyntax; - })(TypeScript.SyntaxNode); - Concrete.EnumElementSyntax = EnumElementSyntax; - var TypeAnnotationSyntax = (function (_super) { - __extends(TypeAnnotationSyntax, _super); - function TypeAnnotationSyntax(data, colonToken, type) { - _super.call(this, data); - this.colonToken = colonToken, this.type = type, colonToken.parent = this, type.parent = this; - } - return TypeAnnotationSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeAnnotationSyntax = TypeAnnotationSyntax; - var ExternalModuleReferenceSyntax = (function (_super) { - __extends(ExternalModuleReferenceSyntax, _super); - function ExternalModuleReferenceSyntax(data, requireKeyword, openParenToken, stringLiteral, closeParenToken) { - _super.call(this, data); - this.requireKeyword = requireKeyword, this.openParenToken = openParenToken, this.stringLiteral = stringLiteral, this.closeParenToken = closeParenToken, requireKeyword.parent = this, openParenToken.parent = this, stringLiteral.parent = this, closeParenToken.parent = this; - } - return ExternalModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExternalModuleReferenceSyntax = ExternalModuleReferenceSyntax; - var ModuleNameModuleReferenceSyntax = (function (_super) { - __extends(ModuleNameModuleReferenceSyntax, _super); - function ModuleNameModuleReferenceSyntax(data, moduleName) { - _super.call(this, data); - this.moduleName = moduleName, moduleName.parent = this; - } - return ModuleNameModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - Concrete.ModuleNameModuleReferenceSyntax = ModuleNameModuleReferenceSyntax; - SourceUnitSyntax.prototype.__kind = 120 /* SourceUnit */, QualifiedNameSyntax.prototype.__kind = 121 /* QualifiedName */, ObjectTypeSyntax.prototype.__kind = 122 /* ObjectType */, FunctionTypeSyntax.prototype.__kind = 123 /* FunctionType */, ArrayTypeSyntax.prototype.__kind = 124 /* ArrayType */, ConstructorTypeSyntax.prototype.__kind = 125 /* ConstructorType */, GenericTypeSyntax.prototype.__kind = 126 /* GenericType */, TypeQuerySyntax.prototype.__kind = 127 /* TypeQuery */, InterfaceDeclarationSyntax.prototype.__kind = 128 /* InterfaceDeclaration */, FunctionDeclarationSyntax.prototype.__kind = 129 /* FunctionDeclaration */, ModuleDeclarationSyntax.prototype.__kind = 130 /* ModuleDeclaration */, ClassDeclarationSyntax.prototype.__kind = 131 /* ClassDeclaration */, EnumDeclarationSyntax.prototype.__kind = 132 /* EnumDeclaration */, ImportDeclarationSyntax.prototype.__kind = 133 /* ImportDeclaration */, ExportAssignmentSyntax.prototype.__kind = 134 /* ExportAssignment */, MemberFunctionDeclarationSyntax.prototype.__kind = 135 /* MemberFunctionDeclaration */, MemberVariableDeclarationSyntax.prototype.__kind = 136 /* MemberVariableDeclaration */, ConstructorDeclarationSyntax.prototype.__kind = 137 /* ConstructorDeclaration */, IndexMemberDeclarationSyntax.prototype.__kind = 138 /* IndexMemberDeclaration */, GetAccessorSyntax.prototype.__kind = 139 /* GetAccessor */, SetAccessorSyntax.prototype.__kind = 140 /* SetAccessor */, PropertySignatureSyntax.prototype.__kind = 141 /* PropertySignature */, CallSignatureSyntax.prototype.__kind = 142 /* CallSignature */, ConstructSignatureSyntax.prototype.__kind = 143 /* ConstructSignature */, IndexSignatureSyntax.prototype.__kind = 144 /* IndexSignature */, MethodSignatureSyntax.prototype.__kind = 145 /* MethodSignature */, BlockSyntax.prototype.__kind = 146 /* Block */, IfStatementSyntax.prototype.__kind = 147 /* IfStatement */, VariableStatementSyntax.prototype.__kind = 148 /* VariableStatement */, ExpressionStatementSyntax.prototype.__kind = 149 /* ExpressionStatement */, ReturnStatementSyntax.prototype.__kind = 150 /* ReturnStatement */, SwitchStatementSyntax.prototype.__kind = 151 /* SwitchStatement */, BreakStatementSyntax.prototype.__kind = 152 /* BreakStatement */, ContinueStatementSyntax.prototype.__kind = 153 /* ContinueStatement */, ForStatementSyntax.prototype.__kind = 154 /* ForStatement */, ForInStatementSyntax.prototype.__kind = 155 /* ForInStatement */, EmptyStatementSyntax.prototype.__kind = 156 /* EmptyStatement */, ThrowStatementSyntax.prototype.__kind = 157 /* ThrowStatement */, WhileStatementSyntax.prototype.__kind = 158 /* WhileStatement */, TryStatementSyntax.prototype.__kind = 159 /* TryStatement */, LabeledStatementSyntax.prototype.__kind = 160 /* LabeledStatement */, DoStatementSyntax.prototype.__kind = 161 /* DoStatement */, DebuggerStatementSyntax.prototype.__kind = 162 /* DebuggerStatement */, WithStatementSyntax.prototype.__kind = 163 /* WithStatement */, DeleteExpressionSyntax.prototype.__kind = 170 /* DeleteExpression */, TypeOfExpressionSyntax.prototype.__kind = 171 /* TypeOfExpression */, VoidExpressionSyntax.prototype.__kind = 172 /* VoidExpression */, ConditionalExpressionSyntax.prototype.__kind = 186 /* ConditionalExpression */, MemberAccessExpressionSyntax.prototype.__kind = 212 /* MemberAccessExpression */, InvocationExpressionSyntax.prototype.__kind = 213 /* InvocationExpression */, ArrayLiteralExpressionSyntax.prototype.__kind = 214 /* ArrayLiteralExpression */, ObjectLiteralExpressionSyntax.prototype.__kind = 215 /* ObjectLiteralExpression */, ObjectCreationExpressionSyntax.prototype.__kind = 216 /* ObjectCreationExpression */, ParenthesizedExpressionSyntax.prototype.__kind = 217 /* ParenthesizedExpression */, ParenthesizedArrowFunctionExpressionSyntax.prototype.__kind = 218 /* ParenthesizedArrowFunctionExpression */, SimpleArrowFunctionExpressionSyntax.prototype.__kind = 219 /* SimpleArrowFunctionExpression */, CastExpressionSyntax.prototype.__kind = 220 /* CastExpression */, ElementAccessExpressionSyntax.prototype.__kind = 221 /* ElementAccessExpression */, FunctionExpressionSyntax.prototype.__kind = 222 /* FunctionExpression */, OmittedExpressionSyntax.prototype.__kind = 223 /* OmittedExpression */, VariableDeclarationSyntax.prototype.__kind = 224 /* VariableDeclaration */, VariableDeclaratorSyntax.prototype.__kind = 225 /* VariableDeclarator */, ArgumentListSyntax.prototype.__kind = 226 /* ArgumentList */, ParameterListSyntax.prototype.__kind = 227 /* ParameterList */, TypeArgumentListSyntax.prototype.__kind = 228 /* TypeArgumentList */, TypeParameterListSyntax.prototype.__kind = 229 /* TypeParameterList */, EqualsValueClauseSyntax.prototype.__kind = 232 /* EqualsValueClause */, CaseSwitchClauseSyntax.prototype.__kind = 233 /* CaseSwitchClause */, DefaultSwitchClauseSyntax.prototype.__kind = 234 /* DefaultSwitchClause */, ElseClauseSyntax.prototype.__kind = 235 /* ElseClause */, CatchClauseSyntax.prototype.__kind = 236 /* CatchClause */, FinallyClauseSyntax.prototype.__kind = 237 /* FinallyClause */, TypeParameterSyntax.prototype.__kind = 238 /* TypeParameter */, ConstraintSyntax.prototype.__kind = 239 /* Constraint */, SimplePropertyAssignmentSyntax.prototype.__kind = 240 /* SimplePropertyAssignment */, FunctionPropertyAssignmentSyntax.prototype.__kind = 241 /* FunctionPropertyAssignment */, ParameterSyntax.prototype.__kind = 242 /* Parameter */, EnumElementSyntax.prototype.__kind = 243 /* EnumElement */, TypeAnnotationSyntax.prototype.__kind = 244 /* TypeAnnotation */, ExternalModuleReferenceSyntax.prototype.__kind = 245 /* ExternalModuleReference */, ModuleNameModuleReferenceSyntax.prototype.__kind = 246 /* ModuleNameModuleReference */; - })(Syntax.Concrete || (Syntax.Concrete = {})); - var Concrete = Syntax.Concrete; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.syntaxDiagnosticsTime = 0; - var SyntaxTree = (function () { - function SyntaxTree(isConcrete, sourceUnit, isDeclaration, diagnostics, fileName, text, languageVersion) { - this.text = text; - this._allDiagnostics = null; - this._isConcrete = isConcrete; - this._sourceUnit = sourceUnit; - this._isDeclaration = isDeclaration; - this._parserDiagnostics = diagnostics; - this._fileName = fileName; - this._lineMap = text.lineMap(); - this._languageVersion = languageVersion; - sourceUnit.syntaxTree = this; - } - SyntaxTree.prototype.isConcrete = function () { - return this._isConcrete; - }; - SyntaxTree.prototype.sourceUnit = function () { - return this._sourceUnit; - }; - SyntaxTree.prototype.isDeclaration = function () { - return this._isDeclaration; - }; - SyntaxTree.prototype.computeDiagnostics = function () { - if (this._parserDiagnostics.length > 0) { - return this._parserDiagnostics; - } - var diagnostics = []; - TypeScript.visitNodeOrToken(new GrammarCheckerWalker(this, diagnostics), this.sourceUnit()); - return diagnostics; - }; - SyntaxTree.prototype.diagnostics = function () { - if (this._allDiagnostics === null) { - var start = new Date().getTime(); - this._allDiagnostics = this.computeDiagnostics(); - TypeScript.syntaxDiagnosticsTime += new Date().getTime() - start; - } - return this._allDiagnostics; - }; - SyntaxTree.prototype.fileName = function () { - return this._fileName; - }; - SyntaxTree.prototype.lineMap = function () { - return this._lineMap; - }; - SyntaxTree.prototype.languageVersion = function () { - return this._languageVersion; - }; - SyntaxTree.prototype.cacheSyntaxTreeInfo = function () { - var sourceUnit = this.sourceUnit(); - var firstToken = firstSyntaxTreeToken(this); - var leadingTrivia = firstToken.leadingTrivia(this.text); - this._isExternalModule = externalModuleIndicatorSpanWorker(this, firstToken) !== null; - var amdDependencies = []; - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.isComment()) { - var amdDependency = this.getAmdDependency(trivia.fullText()); - if (amdDependency) { - amdDependencies.push(amdDependency); - } - } - } - this._amdDependencies = amdDependencies; - }; - SyntaxTree.prototype.getAmdDependency = function (comment) { - var amdDependencyRegEx = /^\/\/\/\s* 0) { - var modifiers = parameter.modifiers; - for (var i = 0, n = modifiers.length; i < n; i++) { - var modifier = modifiers[i]; - if (this.checkParameterAccessibilityModifier(parameterList, modifier, i)) { - return true; - } - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkParameterAccessibilityModifier = function (parameterList, modifier, modifierIndex) { - if (modifier.kind() !== 57 /* PublicKeyword */ && modifier.kind() !== 55 /* PrivateKeyword */) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_parameter, [modifier.text()]); - return true; - } - else { - if (modifierIndex > 0) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForTrailingComma = function (list) { - if (TypeScript.childCount(list) === 0 || TypeScript.childCount(list) % 2 === 1) { - return false; - } - var child = TypeScript.childAt(list, TypeScript.childCount(list) - 1); - this.pushDiagnostic(child, TypeScript.DiagnosticCode.Trailing_comma_not_allowed); - return true; - }; - GrammarCheckerWalker.prototype.checkForAtLeastOneElement = function (parent, list, reportToken, listKind) { - if (TypeScript.childCount(list) > 0) { - return false; - } - this.pushDiagnostic(reportToken, TypeScript.DiagnosticCode._0_list_cannot_be_empty, [listKind]); - return true; - }; - GrammarCheckerWalker.prototype.visitParameterList = function (node) { - if (this.checkParameterListAcessibilityModifiers(node) || this.checkParameterListOrder(node) || this.checkForTrailingComma(node.parameters)) { - return; - } - _super.prototype.visitParameterList.call(this, node); - }; - GrammarCheckerWalker.prototype.visitHeritageClause = function (node) { - if (this.checkForTrailingComma(node.typeNames) || this.checkForAtLeastOneElement(node, node.typeNames, node.extendsOrImplementsKeyword, TypeScript.SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind()))) { - return; - } - _super.prototype.visitHeritageClause.call(this, node); - }; - GrammarCheckerWalker.prototype.visitArgumentList = function (node) { - if (this.checkForTrailingComma(node.arguments)) { - return; - } - _super.prototype.visitArgumentList.call(this, node); - }; - GrammarCheckerWalker.prototype.visitVariableDeclaration = function (node) { - if (this.checkForAtLeastOneElement(node, node.variableDeclarators, node.varKeyword, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.variable_declaration, null)) || this.checkForTrailingComma(node.variableDeclarators)) { - return; - } - _super.prototype.visitVariableDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTypeArgumentList = function (node) { - if (this.checkForTrailingComma(node.typeArguments) || this.checkForAtLeastOneElement(node, node.typeArguments, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_argument, null))) { - return; - } - _super.prototype.visitTypeArgumentList.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTypeParameterList = function (node) { - if (this.checkForTrailingComma(node.typeParameters) || this.checkForAtLeastOneElement(node, node.typeParameters, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, null))) { - return; - } - _super.prototype.visitTypeParameterList.call(this, node); - }; - GrammarCheckerWalker.prototype.checkIndexSignatureParameter = function (node) { - if (node.parameters.length !== 1) { - this.pushDiagnostic(node.openBracketToken, TypeScript.DiagnosticCode.Index_signature_must_have_exactly_one_parameter); - return true; - } - var parameter = node.parameters[0]; - if (parameter.dotDotDotToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signatures_cannot_have_rest_parameters); - return true; - } - else if (parameter.modifiers.length > 0) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_accessibility_modifiers); - return true; - } - else if (parameter.questionToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_a_question_mark); - return true; - } - else if (parameter.equalsValueClause) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_an_initializer); - return true; - } - else if (!parameter.typeAnnotation) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_must_have_a_type_annotation); - return true; - } - else if (parameter.typeAnnotation.type.kind() !== 69 /* StringKeyword */ && parameter.typeAnnotation.type.kind() !== 67 /* NumberKeyword */) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_type_must_be_string_or_number); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitIndexSignature = function (node) { - if (this.checkIndexSignatureParameter(node)) { - return; - } - if (!node.typeAnnotation) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Index_signature_must_have_a_type_annotation); - return; - } - _super.prototype.visitIndexSignature.call(this, node); - }; - GrammarCheckerWalker.prototype.checkClassDeclarationHeritageClauses = function (node) { - var seenExtendsClause = false; - var seenImplementsClause = false; - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - TypeScript.Debug.assert(i <= 2); - var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === 48 /* ExtendsKeyword */) { - if (seenExtendsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); - return true; - } - if (seenImplementsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_must_precede_implements_clause); - return true; - } - if (heritageClause.typeNames.length > 1) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.Classes_can_only_extend_a_single_class); - return true; - } - seenExtendsClause = true; - } - else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 51 /* ImplementsKeyword */); - if (seenImplementsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.implements_clause_already_seen); - return true; - } - seenImplementsClause = true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifier = function (modifiers) { - if (this.inAmbientDeclaration) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); - if (declareToken) { - this.pushDiagnostic(declareToken, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForRequiredDeclareModifier = function (moduleElement, reportToken, modifiers) { - if (!this.inAmbientDeclaration && this.syntaxTree.isDeclaration()) { - if (!TypeScript.SyntaxUtilities.containsToken(modifiers, 63 /* DeclareKeyword */)) { - this.pushDiagnostic(reportToken, TypeScript.DiagnosticCode.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - return true; - } - } - }; - GrammarCheckerWalker.prototype.visitClassDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkClassDeclarationHeritageClauses(node)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitClassDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkInterfaceDeclarationHeritageClauses = function (node) { - var seenExtendsClause = false; - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - TypeScript.Debug.assert(i <= 1); - var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === 48 /* ExtendsKeyword */) { - if (seenExtendsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); - return true; - } - seenExtendsClause = true; - } - else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 51 /* ImplementsKeyword */); - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.Interface_declaration_cannot_have_implements_clause); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkInterfaceModifiers = function (modifiers) { - for (var i = 0, n = modifiers.length; i < n; i++) { - var modifier = modifiers[i]; - if (modifier.kind() === 63 /* DeclareKeyword */) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_interface_declaration); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitInterfaceDeclaration = function (node) { - if (this.checkInterfaceModifiers(node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkInterfaceDeclarationHeritageClauses(node)) { - return; - } - _super.prototype.visitInterfaceDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkClassElementModifiers = function (list) { - var seenAccessibilityModifier = false; - var seenStaticModifier = false; - for (var i = 0, n = list.length; i < n; i++) { - var modifier = list[i]; - if (modifier.kind() === 57 /* PublicKeyword */ || modifier.kind() === 55 /* PrivateKeyword */) { - if (seenAccessibilityModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return true; - } - if (seenStaticModifier) { - var previousToken = list[i - 1]; - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [modifier.text(), previousToken.text()]); - return true; - } - seenAccessibilityModifier = true; - } - else if (modifier.kind() === 58 /* StaticKeyword */) { - if (seenStaticModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); - return true; - } - seenStaticModifier = true; - } - else { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_class_element, [modifier.text()]); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitMemberVariableDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers)) { - return; - } - _super.prototype.visitMemberVariableDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.visitMemberFunctionDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers)) { - return; - } - _super.prototype.visitMemberFunctionDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkGetAccessorParameter = function (node) { - if (node.callSignature.parameterList.parameters.length !== 0) { - this.pushDiagnostic(node.propertyName, TypeScript.DiagnosticCode.get_accessor_cannot_have_parameters); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitIndexMemberDeclaration = function (node) { - if (this.checkIndexMemberModifiers(node)) { - return; - } - _super.prototype.visitIndexMemberDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkIndexMemberModifiers = function (node) { - if (node.modifiers.length > 0) { - this.pushDiagnostic(TypeScript.childAt(node.modifiers, 0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkEcmaScriptVersionIsAtLeast = function (parent, reportToken, languageVersion, diagnosticKey) { - if (this.syntaxTree.languageVersion() < languageVersion) { - this.pushDiagnostic(reportToken, diagnosticKey); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitObjectLiteralExpression = function (node) { - var savedInObjectLiteralExpression = this.inObjectLiteralExpression; - this.inObjectLiteralExpression = true; - _super.prototype.visitObjectLiteralExpression.call(this, node); - this.inObjectLiteralExpression = savedInObjectLiteralExpression; - }; - GrammarCheckerWalker.prototype.visitGetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkGetAccessorParameter(node)) { - return; - } - _super.prototype.visitGetAccessor.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForDisallowedSetAccessorTypeAnnotation = function (accessor) { - if (accessor.callSignature.typeAnnotation) { - this.pushDiagnostic(accessor.callSignature.typeAnnotation, TypeScript.DiagnosticCode.Type_annotation_cannot_appear_on_a_set_accessor); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedAccessorTypeParameters = function (callSignature) { - if (callSignature.typeParameterList !== null) { - this.pushDiagnostic(callSignature.typeParameterList, TypeScript.DiagnosticCode.Type_parameters_cannot_appear_on_an_accessor); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForAccessorDeclarationInAmbientContext = function (accessor) { - if (this.inAmbientDeclaration) { - this.pushDiagnostic(accessor, TypeScript.DiagnosticCode.Accessors_are_not_allowed_in_ambient_contexts); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkSetAccessorParameter = function (node) { - var parameters = node.callSignature.parameterList.parameters; - if (TypeScript.childCount(parameters) !== 1) { - this.pushDiagnostic(node.propertyName, TypeScript.DiagnosticCode.set_accessor_must_have_exactly_one_parameter); - return true; - } - var parameter = parameters[0]; - if (parameter.questionToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_be_optional); - return true; - } - if (parameter.equalsValueClause) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_have_an_initializer); - return true; - } - if (parameter.dotDotDotToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_cannot_have_rest_parameter); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitSetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkForDisallowedSetAccessorTypeAnnotation(node) || this.checkSetAccessorParameter(node)) { - return; - } - _super.prototype.visitSetAccessor.call(this, node); - }; - GrammarCheckerWalker.prototype.visitEnumDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers), this.checkEnumElements(node)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitEnumDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkEnumElements = function (node) { - var previousValueWasComputed = false; - for (var i = 0, n = TypeScript.childCount(node.enumElements); i < n; i++) { - var child = TypeScript.childAt(node.enumElements, i); - if (i % 2 === 0) { - var enumElement = child; - if (!enumElement.equalsValueClause && previousValueWasComputed) { - this.pushDiagnostic(enumElement, TypeScript.DiagnosticCode.Enum_member_must_have_initializer); - return true; - } - if (enumElement.equalsValueClause) { - var value = enumElement.equalsValueClause.value; - previousValueWasComputed = !TypeScript.Syntax.isIntegerLiteral(value); - } - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitEnumElement = function (node) { - if (this.inAmbientDeclaration && node.equalsValueClause) { - var expression = node.equalsValueClause.value; - if (!TypeScript.Syntax.isIntegerLiteral(expression)) { - this.pushDiagnostic(node.equalsValueClause.value, TypeScript.DiagnosticCode.Ambient_enum_elements_can_only_have_integer_literal_initializers); - return; - } - } - _super.prototype.visitEnumElement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitInvocationExpression = function (node) { - if (node.expression.kind() === 50 /* SuperKeyword */ && node.argumentList.typeArgumentList !== null) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.super_invocation_cannot_have_type_arguments); - } - _super.prototype.visitInvocationExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.checkModuleElementModifiers = function (modifiers) { - var seenExportModifier = false; - var seenDeclareModifier = false; - for (var i = 0, n = modifiers.length; i < n; i++) { - var modifier = modifiers[i]; - if (modifier.kind() === 57 /* PublicKeyword */ || modifier.kind() === 55 /* PrivateKeyword */ || modifier.kind() === 58 /* StaticKeyword */) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_module_element, [modifier.text()]); - return true; - } - if (modifier.kind() === 63 /* DeclareKeyword */) { - if (seenDeclareModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return; - } - seenDeclareModifier = true; - } - else if (modifier.kind() === 47 /* ExportKeyword */) { - if (seenExportModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); - return; - } - if (seenDeclareModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [TypeScript.SyntaxFacts.getText(47 /* ExportKeyword */), TypeScript.SyntaxFacts.getText(63 /* DeclareKeyword */)]); - return; - } - seenExportModifier = true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedImportDeclaration = function (node) { - if (!node.stringLiteral) { - for (var i = 0, n = node.moduleElements.length; i < n; i++) { - var child = node.moduleElements[i]; - if (child.kind() === 133 /* ImportDeclaration */) { - var importDeclaration = child; - if (importDeclaration.moduleReference.kind() === 245 /* ExternalModuleReference */) { - this.pushDiagnostic(importDeclaration, TypeScript.DiagnosticCode.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - } - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifierOnImportDeclaration = function (modifiers) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); - if (declareToken) { - this.pushDiagnostic(declareToken, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_import_declaration); - return true; - } - }; - GrammarCheckerWalker.prototype.visitImportDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifierOnImportDeclaration(node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - return; - } - _super.prototype.visitImportDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.visitModuleDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.stringLiteral ? node.stringLiteral : TypeScript.firstToken(node.name), node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedImportDeclaration(node)) { - return; - } - if (node.stringLiteral) { - if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { - this.pushDiagnostic(node.stringLiteral, TypeScript.DiagnosticCode.Only_ambient_modules_can_use_quoted_names); - return; - } - } - if (!node.stringLiteral && this.checkForDisallowedExportAssignment(node)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitModuleDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkForDisallowedExportAssignment = function (node) { - for (var i = 0, n = node.moduleElements.length; i < n; i++) { - var child = node.moduleElements[i]; - if (child.kind() === 134 /* ExportAssignment */) { - this.pushDiagnostic(child, TypeScript.DiagnosticCode.Export_assignment_cannot_be_used_in_internal_modules); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitBlock = function (node) { - if (this.checkForBlockInAmbientContext(node)) { - return; - } - var savedInBlock = this.inBlock; - this.inBlock = true; - _super.prototype.visitBlock.call(this, node); - this.inBlock = savedInBlock; - }; - GrammarCheckerWalker.prototype.checkForBlockInAmbientContext = function (node) { - if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { - if (node.parent.kind() === 1 /* List */) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); - } - else { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.A_function_implementation_cannot_be_declared_in_an_ambient_context); - } - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForStatementInAmbientContxt = function (node) { - if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitBreakStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkBreakStatementTarget(node)) { - return; - } - _super.prototype.visitBreakStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitContinueStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkContinueStatementTarget(node)) { - return; - } - _super.prototype.visitContinueStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkBreakStatementTarget = function (node) { - if (node.identifier) { - var breakableLabels = this.getEnclosingLabels(node, true, false); - if (!TypeScript.ArrayUtilities.any(breakableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - var breakableLabels = this.getEnclosingLabels(node, true, true); - if (TypeScript.ArrayUtilities.any(breakableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_not_found); - } - return true; - } - } - else if (!this.inIterationStatement(node, false) && !this.inSwitchStatement(node)) { - if (this.inIterationStatement(node, true)) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - } - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.inSwitchStatement = function (ast) { - while (ast) { - if (ast.kind() === 151 /* SwitchStatement */) { - return true; - } - if (TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(ast)) { - return false; - } - ast = ast.parent; - } - return false; - }; - GrammarCheckerWalker.prototype.isIterationStatement = function (ast) { - switch (ast.kind()) { - case 154 /* ForStatement */: - case 155 /* ForInStatement */: - case 158 /* WhileStatement */: - case 161 /* DoStatement */: - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.inIterationStatement = function (element, crossFunctions) { - while (element) { - if (this.isIterationStatement(element)) { - return true; - } - if (!crossFunctions && TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(element)) { - return false; - } - element = element.parent; - } - return false; - }; - GrammarCheckerWalker.prototype.getEnclosingLabels = function (element, breakable, crossFunctions) { - var result = []; - element = element.parent; - while (element) { - if (element.kind() === 160 /* LabeledStatement */) { - var labeledStatement = element; - if (breakable) { - result.push(labeledStatement); - } - else { - if (this.labelIsOnContinuableConstruct(labeledStatement.statement)) { - result.push(labeledStatement); - } - } - } - if (!crossFunctions && TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(element)) { - break; - } - element = element.parent; - } - return result; - }; - GrammarCheckerWalker.prototype.labelIsOnContinuableConstruct = function (statement) { - switch (statement.kind()) { - case 160 /* LabeledStatement */: - return this.labelIsOnContinuableConstruct(statement.statement); - case 158 /* WhileStatement */: - case 154 /* ForStatement */: - case 155 /* ForInStatement */: - case 161 /* DoStatement */: - return true; - default: - return false; - } - }; - GrammarCheckerWalker.prototype.checkContinueStatementTarget = function (node) { - if (!this.inIterationStatement(node, false)) { - if (this.inIterationStatement(node, true)) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - } - return true; - } - else if (node.identifier) { - var continuableLabels = this.getEnclosingLabels(node, false, false); - if (!TypeScript.ArrayUtilities.any(continuableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - var continuableLabels = this.getEnclosingLabels(node, false, true); - if (TypeScript.ArrayUtilities.any(continuableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_not_found); - } - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitDebuggerStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitDebuggerStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitDoStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitDoStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitEmptyStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitEmptyStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitExpressionStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitExpressionStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitForInStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForInStatementVariableDeclaration(node) || this.checkForInLeftHandSideExpression(node)) { - return; - } - _super.prototype.visitForInStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForInLeftHandSideExpression = function (node) { - if (node.left && !TypeScript.SyntaxUtilities.isLeftHandSizeExpression(node.left)) { - this.pushDiagnostic(node.left, TypeScript.DiagnosticCode.Invalid_left_hand_side_in_for_in_statement); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForInStatementVariableDeclaration = function (node) { - if (node.variableDeclaration && node.variableDeclaration.variableDeclarators.length > 1) { - this.pushDiagnostic(node.variableDeclaration, TypeScript.DiagnosticCode.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitForStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitForStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitIfStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitIfStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitLabeledStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForInvalidLabelIdentifier(node)) { - return; - } - _super.prototype.visitLabeledStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForInvalidLabelIdentifier = function (node) { - var labelIdentifier = TypeScript.tokenValueText(node.identifier); - var breakableLabels = this.getEnclosingLabels(node, true, false); - var matchingLabel = TypeScript.ArrayUtilities.firstOrDefault(breakableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === labelIdentifier; }); - if (matchingLabel) { - this.pushDiagnostic(node.identifier, TypeScript.DiagnosticCode.Duplicate_identifier_0, [labelIdentifier]); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitReturnStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForReturnStatementNotInFunctionBody(node)) { - return; - } - _super.prototype.visitReturnStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForReturnStatementNotInFunctionBody = function (node) { - for (var element = node; element; element = element.parent) { - if (TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(element)) { - return false; - } - } - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.return_statement_must_be_contained_within_a_function_body); - return true; - }; - GrammarCheckerWalker.prototype.visitSwitchStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitSwitchStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitThrowStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitThrowStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTryStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitTryStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitWhileStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitWhileStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitWithStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForWithInStrictMode(node)) { - return; - } - _super.prototype.visitWithStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForWithInStrictMode = function (node) { - if (TypeScript.parsedInStrictMode(node)) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.with_statements_are_not_allowed_in_strict_mode); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedModifiers = function (parent, modifiers) { - if (this.inBlock || this.inObjectLiteralExpression) { - if (modifiers.length > 0) { - this.pushDiagnostic(TypeScript.childAt(modifiers, 0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitFunctionDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedEvalOrArguments(node, node.identifier)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitFunctionDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitFunctionExpression = function (node) { - if (this.checkForDisallowedEvalOrArguments(node, node.identifier)) { - return; - } - _super.prototype.visitFunctionExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitVariableStatement = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.variableDeclaration.varKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitVariableStatement.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkListSeparators = function (parent, list, kind) { - for (var i = 0, n = TypeScript.childCount(list); i < n; i++) { - var child = TypeScript.childAt(list, i); - if (i % 2 === 1 && child.kind() !== kind) { - this.pushDiagnostic(child, TypeScript.DiagnosticCode._0_expected, [TypeScript.SyntaxFacts.getText(kind)]); - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitObjectType = function (node) { - if (this.checkListSeparators(node, node.typeMembers, 78 /* SemicolonToken */)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitObjectType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitArrayType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitArrayType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitFunctionType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitFunctionType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitConstructorType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitConstructorType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitVariableDeclarator = function (node) { - if (this.checkVariableDeclaratorInitializer(node) || this.checkVariableDeclaratorIdentifier(node)) { - return; - } - _super.prototype.visitVariableDeclarator.call(this, node); - }; - GrammarCheckerWalker.prototype.checkVariableDeclaratorIdentifier = function (node) { - if (node.parent.kind() !== 136 /* MemberVariableDeclaration */) { - if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkVariableDeclaratorInitializer = function (node) { - if (this.inAmbientDeclaration && node.equalsValueClause) { - this.pushDiagnostic(TypeScript.firstToken(node.equalsValueClause.value), TypeScript.DiagnosticCode.Initializers_are_not_allowed_in_ambient_contexts); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitConstructorDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers) || this.checkConstructorModifiers(node.modifiers) || this.checkConstructorTypeParameterList(node) || this.checkConstructorTypeAnnotation(node)) { - return; - } - _super.prototype.visitConstructorDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkConstructorModifiers = function (modifiers) { - for (var i = 0, n = modifiers.length; i < n; i++) { - var child = modifiers[i]; - if (child.kind() !== 57 /* PublicKeyword */) { - this.pushDiagnostic(child, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [TypeScript.SyntaxFacts.getText(child.kind())]); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkConstructorTypeParameterList = function (node) { - if (node.callSignature.typeParameterList) { - this.pushDiagnostic(node.callSignature.typeParameterList, TypeScript.DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkConstructorTypeAnnotation = function (node) { - if (node.callSignature.typeAnnotation) { - this.pushDiagnostic(node.callSignature.typeAnnotation, TypeScript.DiagnosticCode.Type_annotation_cannot_appear_on_a_constructor_declaration); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitBinaryExpression = function (node) { - if (this.checkIllegalAssignment(node)) { - return; - } - _super.prototype.visitBinaryExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitPrefixUnaryExpression = function (node) { - if (TypeScript.parsedInStrictMode(node) && this.isPreIncrementOrDecrementExpression(node) && this.isEvalOrArguments(node.operand)) { - this.pushDiagnostic(node.operatorToken, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.operand)]); - } - _super.prototype.visitPrefixUnaryExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitPostfixUnaryExpression = function (node) { - if (TypeScript.parsedInStrictMode(node) && this.isEvalOrArguments(node.operand)) { - this.pushDiagnostic(node.operatorToken, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.operand)]); - } - _super.prototype.visitPostfixUnaryExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitParameter = function (node) { - if (this.checkForDisallowedEvalOrArguments(node, node.identifier)) { - return; - } - _super.prototype.visitParameter.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForDisallowedEvalOrArguments = function (node, token) { - if (token) { - if (TypeScript.parsedInStrictMode(node) && this.isEvalOrArguments(token)) { - this.pushDiagnostic(token, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(token)]); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.isPreIncrementOrDecrementExpression = function (node) { - switch (node.kind()) { - case 169 /* PreDecrementExpression */: - case 168 /* PreIncrementExpression */: - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitDeleteExpression = function (node) { - if (TypeScript.parsedInStrictMode(node) && node.expression.kind() === 11 /* IdentifierName */) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.delete_cannot_be_called_on_an_identifier_in_strict_mode); - return; - } - _super.prototype.visitDeleteExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.checkIllegalAssignment = function (node) { - if (TypeScript.parsedInStrictMode(node) && TypeScript.SyntaxFacts.isAssignmentOperatorToken(node.operatorToken.kind()) && this.isEvalOrArguments(node.left)) { - this.pushDiagnostic(node.operatorToken, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.left)]); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.getEvalOrArguments = function (expr) { - if (expr.kind() === 11 /* IdentifierName */) { - var text = TypeScript.tokenValueText(expr); - if (text === "eval" || text === "arguments") { - return text; - } - } - return null; - }; - GrammarCheckerWalker.prototype.isEvalOrArguments = function (expr) { - return this.getEvalOrArguments(expr) !== null; - }; - GrammarCheckerWalker.prototype.visitConstraint = function (node) { - if (this.checkConstraintType(node)) { - return; - } - _super.prototype.visitConstraint.call(this, node); - }; - GrammarCheckerWalker.prototype.checkConstraintType = function (node) { - if (!TypeScript.SyntaxFacts.isType(node.typeOrExpression.kind())) { - this.pushDiagnostic(node.typeOrExpression, TypeScript.DiagnosticCode.Type_expected); - return true; - } - return false; - }; - return GrammarCheckerWalker; - })(TypeScript.SyntaxWalker); - function firstSyntaxTreeToken(syntaxTree) { - var scanner = TypeScript.Scanner.createScanner(syntaxTree.languageVersion(), syntaxTree.text, function () { - }); - return scanner.scan(false); - } - function externalModuleIndicatorSpan(syntaxTree) { - var firstToken = firstSyntaxTreeToken(syntaxTree); - return externalModuleIndicatorSpanWorker(syntaxTree, firstToken); - } - TypeScript.externalModuleIndicatorSpan = externalModuleIndicatorSpan; - function externalModuleIndicatorSpanWorker(syntaxTree, firstToken) { - var leadingTrivia = firstToken.leadingTrivia(syntaxTree.text); - return implicitImportSpan(leadingTrivia) || topLevelImportOrExportSpan(syntaxTree.sourceUnit()); - } - TypeScript.externalModuleIndicatorSpanWorker = externalModuleIndicatorSpanWorker; - function implicitImportSpan(sourceUnitLeadingTrivia) { - for (var i = 0, n = sourceUnitLeadingTrivia.count(); i < n; i++) { - var trivia = sourceUnitLeadingTrivia.syntaxTriviaAt(i); - if (trivia.isComment()) { - var span = implicitImportSpanWorker(trivia); - if (span) { - return span; - } - } - } - return null; - } - function implicitImportSpanWorker(trivia) { - var implicitImportRegEx = /^(\/\/\/\s*/gim; - var match = implicitImportRegEx.exec(trivia.fullText()); - if (match) { - return new TypeScript.TextSpan(trivia.fullStart(), trivia.fullWidth()); - } - return null; - } - function topLevelImportOrExportSpan(node) { - for (var i = 0, n = node.moduleElements.length; i < n; i++) { - var moduleElement = node.moduleElements[i]; - var _firstToken = TypeScript.firstToken(moduleElement); - if (_firstToken !== null && _firstToken.kind() === 47 /* ExportKeyword */) { - return new TypeScript.TextSpan(TypeScript.start(_firstToken), TypeScript.width(_firstToken)); - } - if (moduleElement.kind() === 133 /* ImportDeclaration */) { - var importDecl = moduleElement; - if (importDecl.moduleReference.kind() === 245 /* ExternalModuleReference */) { - var literal = importDecl.moduleReference.stringLiteral; - return new TypeScript.TextSpan(TypeScript.start(literal), TypeScript.width(literal)); - } - } - } - return null; - } -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Unicode = (function () { - function Unicode() { - } - Unicode.lookupInUnicodeMap = function (code, map) { - if (code < map[0]) { - return false; - } - var lo = 0; - var hi = map.length; - var mid; - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - if (code < map[mid]) { - hi = mid; - } - else { - lo = mid + 2; - } - } - return false; - }; - Unicode.isIdentifierStart = function (code, languageVersion) { - if (languageVersion === 0 /* ES3 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierStart); - } - else if (languageVersion === 1 /* ES5 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierStart); - } - else { - throw TypeScript.Errors.argumentOutOfRange("languageVersion"); - } - }; - Unicode.isIdentifierPart = function (code, languageVersion) { - if (languageVersion === 0 /* ES3 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierPart); - } - else if (languageVersion === 1 /* ES5 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierPart); - } - else { - throw TypeScript.Errors.argumentOutOfRange("languageVersion"); - } - }; - Unicode.unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - Unicode.unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - Unicode.unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - Unicode.unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - return Unicode; - })(); - TypeScript.Unicode = Unicode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (IncrementalParser) { - function createParserSource(oldSyntaxTree, textChangeRange, text) { - var fileName = oldSyntaxTree.fileName(); - var languageVersion = oldSyntaxTree.languageVersion(); - var _scannerParserSource; - var _changeRange; - var _changeRangeNewSpan; - var _changeDelta = 0; - var _oldSourceUnitCursor = getSyntaxCursor(); - var oldSourceUnit = oldSyntaxTree.sourceUnit(); - var _outstandingRewindPointCount = 0; - if (oldSourceUnit.moduleElements.length > 0) { - _oldSourceUnitCursor.pushElement(TypeScript.childAt(oldSourceUnit.moduleElements, 0), 0); - } - _changeRange = extendToAffectedRange(textChangeRange, oldSourceUnit); - _changeRangeNewSpan = _changeRange.newSpan(); - if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { - TypeScript.Debug.assert((TypeScript.fullWidth(oldSourceUnit) - _changeRange.span().length() + _changeRange.newLength()) === text.length()); - } - _scannerParserSource = TypeScript.Scanner.createParserSource(oldSyntaxTree.fileName(), text, oldSyntaxTree.languageVersion()); - function release() { - _scannerParserSource.release(); - _scannerParserSource = null; - _oldSourceUnitCursor = null; - _outstandingRewindPointCount = 0; - } - function extendToAffectedRange(changeRange, sourceUnit) { - var maxLookahead = 1; - var start = changeRange.span().start(); - for (var i = 0; start > 0 && i <= maxLookahead; i++) { - var token = TypeScript.findToken(sourceUnit, start); - var position = token.fullStart(); - start = Math.max(0, position - 1); - } - var finalSpan = TypeScript.TextSpan.fromBounds(start, changeRange.span().end()); - var finalLength = changeRange.newLength() + (changeRange.span().start() - start); - return new TypeScript.TextChangeRange(finalSpan, finalLength); - } - function absolutePosition() { - return _scannerParserSource.absolutePosition(); - } - function tokenDiagnostics() { - return _scannerParserSource.tokenDiagnostics(); - } - function getRewindPoint() { - var rewindPoint = _scannerParserSource.getRewindPoint(); - var oldSourceUnitCursorClone = cloneSyntaxCursor(_oldSourceUnitCursor); - rewindPoint.changeDelta = _changeDelta; - rewindPoint.changeRange = _changeRange; - rewindPoint.oldSourceUnitCursor = _oldSourceUnitCursor; - _oldSourceUnitCursor = oldSourceUnitCursorClone; - _outstandingRewindPointCount++; - return rewindPoint; - } - function rewind(rewindPoint) { - _changeRange = rewindPoint.changeRange; - _changeDelta = rewindPoint.changeDelta; - returnSyntaxCursor(_oldSourceUnitCursor); - _oldSourceUnitCursor = rewindPoint.oldSourceUnitCursor; - rewindPoint.oldSourceUnitCursor = null; - _scannerParserSource.rewind(rewindPoint); - } - function releaseRewindPoint(rewindPoint) { - if (rewindPoint.oldSourceUnitCursor !== null) { - returnSyntaxCursor(rewindPoint.oldSourceUnitCursor); - } - _scannerParserSource.releaseRewindPoint(rewindPoint); - _outstandingRewindPointCount--; - TypeScript.Debug.assert(_outstandingRewindPointCount >= 0); - } - function isPinned() { - return _outstandingRewindPointCount > 0; - } - function canReadFromOldSourceUnit() { - if (isPinned()) { - return false; - } - if (_changeRange !== null && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { - return false; - } - syncCursorToNewTextIfBehind(); - return _changeDelta === 0 && !_oldSourceUnitCursor.isFinished(); - } - function updateTokens(nodeOrToken) { - var position = absolutePosition(); - var tokenWasMoved = isPastChangeRange() && TypeScript.fullStart(nodeOrToken) !== position; - if (tokenWasMoved) { - setTokenFullStartWalker.position = position; - TypeScript.visitNodeOrToken(setTokenFullStartWalker, nodeOrToken); - } - } - function currentNode() { - if (canReadFromOldSourceUnit()) { - var node = tryGetNodeFromOldSourceUnit(); - if (node !== null) { - updateTokens(node); - return node; - } - } - return null; - } - function currentToken() { - if (canReadFromOldSourceUnit()) { - var token = tryGetTokenFromOldSourceUnit(); - if (token !== null) { - updateTokens(token); - return token; - } - } - return _scannerParserSource.currentToken(); - } - function currentContextualToken() { - return _scannerParserSource.currentContextualToken(); - } - function syncCursorToNewTextIfBehind() { - while (true) { - if (_oldSourceUnitCursor.isFinished()) { - break; - } - if (_changeDelta >= 0) { - break; - } - var currentNodeOrToken = _oldSourceUnitCursor.currentNodeOrToken(); - if (TypeScript.isNode(currentNodeOrToken) && (TypeScript.fullWidth(currentNodeOrToken) > Math.abs(_changeDelta))) { - _oldSourceUnitCursor.moveToFirstChild(); - } - else { - _oldSourceUnitCursor.moveToNextSibling(); - _changeDelta += TypeScript.fullWidth(currentNodeOrToken); - } - } - } - function intersectsWithChangeRangeSpanInOriginalText(start, length) { - return !isPastChangeRange() && _changeRange.span().intersectsWith(start, length); - } - function tryGetNodeFromOldSourceUnit() { - while (true) { - var node = _oldSourceUnitCursor.currentNode(); - if (node === null) { - return null; - } - if (!intersectsWithChangeRangeSpanInOriginalText(absolutePosition(), TypeScript.fullWidth(node))) { - var isIncrementallyUnusuable = TypeScript.isIncrementallyUnusable(node); - if (!isIncrementallyUnusuable) { - return node; - } - } - _oldSourceUnitCursor.moveToFirstChild(); - } - } - function canReuseTokenFromOldSourceUnit(position, token) { - if (token !== null) { - if (!intersectsWithChangeRangeSpanInOriginalText(position, token.fullWidth())) { - if (!token.isIncrementallyUnusable() && !TypeScript.Scanner.isContextualToken(token)) { - return true; - } - } - } - return false; - } - function tryGetTokenFromOldSourceUnit() { - var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(absolutePosition(), token) ? token : null; - } - function peekToken(n) { - if (canReadFromOldSourceUnit()) { - var token = tryPeekTokenFromOldSourceUnit(n); - if (token !== null) { - return token; - } - } - return _scannerParserSource.peekToken(n); - } - function tryPeekTokenFromOldSourceUnit(n) { - var cursorClone = cloneSyntaxCursor(_oldSourceUnitCursor); - var token = tryPeekTokenFromOldSourceUnitWorker(n); - returnSyntaxCursor(_oldSourceUnitCursor); - _oldSourceUnitCursor = cursorClone; - return token; - } - function tryPeekTokenFromOldSourceUnitWorker(n) { - var currentPosition = absolutePosition(); - _oldSourceUnitCursor.moveToFirstToken(); - for (var i = 0; i < n; i++) { - var interimToken = _oldSourceUnitCursor.currentToken(); - if (!canReuseTokenFromOldSourceUnit(currentPosition, interimToken)) { - return null; - } - currentPosition += interimToken.fullWidth(); - _oldSourceUnitCursor.moveToNextSibling(); - } - var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(currentPosition, token) ? token : null; - } - function consumeNode(node) { - _oldSourceUnitCursor.moveToNextSibling(); - var _absolutePosition = absolutePosition() + TypeScript.fullWidth(node); - _scannerParserSource.resetToPosition(_absolutePosition); - } - function consumeToken(currentToken) { - if (_oldSourceUnitCursor.currentToken() === currentToken) { - _oldSourceUnitCursor.moveToNextSibling(); - var _absolutePosition = absolutePosition() + currentToken.fullWidth(); - _scannerParserSource.resetToPosition(_absolutePosition); - } - else { - _changeDelta -= currentToken.fullWidth(); - _scannerParserSource.consumeToken(currentToken); - if (!isPastChangeRange()) { - if (absolutePosition() >= _changeRangeNewSpan.end()) { - _changeDelta += _changeRange.newLength() - _changeRange.span().length(); - _changeRange = null; - } - } - } - } - function isPastChangeRange() { - return _changeRange === null; - } - return { - text: text, - fileName: fileName, - languageVersion: languageVersion, - currentNode: currentNode, - currentToken: currentToken, - currentContextualToken: currentContextualToken, - peekToken: peekToken, - consumeNode: consumeNode, - consumeToken: consumeToken, - getRewindPoint: getRewindPoint, - rewind: rewind, - releaseRewindPoint: releaseRewindPoint, - tokenDiagnostics: tokenDiagnostics, - release: release - }; - } - function createSyntaxCursorPiece(element, indexInParent) { - return { element: element, indexInParent: indexInParent }; - } - var syntaxCursorPool = []; - var syntaxCursorPoolCount = 0; - function returnSyntaxCursor(cursor) { - cursor.clean(); - syntaxCursorPool[syntaxCursorPoolCount] = cursor; - syntaxCursorPoolCount++; - } - function getSyntaxCursor() { - var cursor = syntaxCursorPoolCount > 0 ? syntaxCursorPool[syntaxCursorPoolCount - 1] : createSyntaxCursor(); - if (syntaxCursorPoolCount > 0) { - syntaxCursorPoolCount--; - syntaxCursorPool[syntaxCursorPoolCount] = null; - } - return cursor; - } - function cloneSyntaxCursor(cursor) { - var newCursor = getSyntaxCursor(); - newCursor.deepCopyFrom(cursor); - return newCursor; - } - function createSyntaxCursor() { - var pieces = []; - var currentPieceIndex = -1; - function clean() { - for (var i = 0, n = pieces.length; i < n; i++) { - var piece = pieces[i]; - if (piece.element === null) { - break; - } - piece.element = null; - piece.indexInParent = -1; - } - currentPieceIndex = -1; - } - function deepCopyFrom(other) { - for (var i = 0, n = other.pieces.length; i < n; i++) { - var piece = other.pieces[i]; - if (piece.element === null) { - break; - } - pushElement(piece.element, piece.indexInParent); - } - } - function isFinished() { - return currentPieceIndex < 0; - } - function currentNodeOrToken() { - if (isFinished()) { - return null; - } - var result = pieces[currentPieceIndex].element; - return result; - } - function currentNode() { - var element = currentNodeOrToken(); - return TypeScript.isNode(element) ? element : null; - } - function moveToFirstChild() { - var nodeOrToken = currentNodeOrToken(); - if (nodeOrToken === null) { - return; - } - if (TypeScript.isToken(nodeOrToken)) { - return; - } - for (var i = 0, n = TypeScript.childCount(nodeOrToken); i < n; i++) { - var child = TypeScript.childAt(nodeOrToken, i); - if (child !== null && !TypeScript.isShared(child)) { - pushElement(child, i); - moveToFirstChildIfList(); - return; - } - } - moveToNextSibling(); - } - function moveToNextSibling() { - while (!isFinished()) { - var currentPiece = pieces[currentPieceIndex]; - var parent = currentPiece.element.parent; - for (var i = currentPiece.indexInParent + 1, n = TypeScript.childCount(parent); i < n; i++) { - var sibling = TypeScript.childAt(parent, i); - if (sibling !== null && !TypeScript.isShared(sibling)) { - currentPiece.element = sibling; - currentPiece.indexInParent = i; - moveToFirstChildIfList(); - return; - } - } - currentPiece.element = null; - currentPiece.indexInParent = -1; - currentPieceIndex--; - } - } - function moveToFirstChildIfList() { - var element = pieces[currentPieceIndex].element; - if (TypeScript.isList(element) || TypeScript.isSeparatedList(element)) { - pushElement(TypeScript.childAt(element, 0), 0); - } - } - function pushElement(element, indexInParent) { - currentPieceIndex++; - if (currentPieceIndex === pieces.length) { - pieces.push(createSyntaxCursorPiece(element, indexInParent)); - } - else { - var piece = pieces[currentPieceIndex]; - piece.element = element; - piece.indexInParent = indexInParent; - } - } - function moveToFirstToken() { - while (!isFinished()) { - var element = pieces[currentPieceIndex].element; - if (TypeScript.isNode(element)) { - moveToFirstChild(); - continue; - } - return; - } - } - function currentToken() { - moveToFirstToken(); - var element = currentNodeOrToken(); - return element === null ? null : element; - } - return { - pieces: pieces, - clean: clean, - isFinished: isFinished, - moveToFirstChild: moveToFirstChild, - moveToFirstToken: moveToFirstToken, - moveToNextSibling: moveToNextSibling, - currentNodeOrToken: currentNodeOrToken, - currentNode: currentNode, - currentToken: currentToken, - pushElement: pushElement, - deepCopyFrom: deepCopyFrom - }; - } - var SetTokenFullStartWalker = (function (_super) { - __extends(SetTokenFullStartWalker, _super); - function SetTokenFullStartWalker() { - _super.apply(this, arguments); - } - SetTokenFullStartWalker.prototype.visitToken = function (token) { - var position = this.position; - token.setFullStart(position); - this.position = position + token.fullWidth(); - }; - return SetTokenFullStartWalker; - })(TypeScript.SyntaxWalker); - var setTokenFullStartWalker = new SetTokenFullStartWalker(); - function parse(oldSyntaxTree, textChangeRange, newText) { - TypeScript.Debug.assert(oldSyntaxTree.isConcrete(), "Can only incrementally parse a concrete syntax tree."); - if (textChangeRange.isUnchanged()) { - return oldSyntaxTree; - } - return TypeScript.Parser.parseSource(createParserSource(oldSyntaxTree, textChangeRange, newText), oldSyntaxTree.isDeclaration()); - } - IncrementalParser.parse = parse; - })(TypeScript.IncrementalParser || (TypeScript.IncrementalParser = {})); - var IncrementalParser = TypeScript.IncrementalParser; -})(TypeScript || (TypeScript = {})); + ts.TextChangeRange = TextChangeRange; +})(ts || (ts = {})); var ts; (function (ts) { + var OutliningElementsCollector; (function (OutliningElementsCollector) { function collectElements(sourceFile) { var elements = []; - function addOutlineRange(hintSpanNode, startElement, endElement) { + var collapseText = "..."; + function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { if (hintSpanNode && startElement && endElement) { var span = { - textSpan: TypeScript.TextSpan.fromBounds(startElement.pos, endElement.end), - hintSpan: TypeScript.TextSpan.fromBounds(hintSpanNode.getStart(), hintSpanNode.end), - bannerText: "...", - autoCollapse: false + textSpan: ts.TextSpan.fromBounds(startElement.pos, endElement.end), + hintSpan: ts.TextSpan.fromBounds(hintSpanNode.getStart(), hintSpanNode.end), + bannerText: collapseText, + autoCollapse: autoCollapse }; elements.push(span); } } + function autoCollapse(node) { + switch (node.kind) { + case 192 /* ModuleBlock */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + return false; + } + return true; + } var depth = 0; var maxDepth = 20; function walk(n) { @@ -25852,24 +16533,45 @@ var ts; return; } switch (n.kind) { - case 143 /* Block */: - case 168 /* FunctionBlock */: - case 173 /* ModuleBlock */: - case 162 /* TryBlock */: - case 162 /* TryBlock */: - case 163 /* CatchBlock */: - case 164 /* FinallyBlock */: - var openBrace = ts.forEach(n.getChildren(), function (c) { return c.kind === 5 /* OpenBraceToken */ && c; }); - var closeBrace = ts.forEach(n.getChildren(), function (c) { return c.kind === 6 /* CloseBraceToken */ && c; }); - addOutlineRange(n.parent, openBrace, closeBrace); + case 161 /* Block */: + var parent = n.parent; + var openBrace = ts.findChildOfKind(n, 13 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 14 /* CloseBraceToken */, sourceFile); + if (parent.kind === 166 /* DoStatement */ || parent.kind === 169 /* ForInStatement */ || parent.kind === 168 /* ForStatement */ || parent.kind === 165 /* IfStatement */ || parent.kind === 167 /* WhileStatement */ || parent.kind === 173 /* WithStatement */) { + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + } + else { + var span = ts.TextSpan.fromBounds(n.getStart(), n.end); + elements.push({ + textSpan: span, + hintSpan: span, + bannerText: collapseText, + autoCollapse: autoCollapse(n) + }); + } break; - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 171 /* EnumDeclaration */: - case 128 /* ObjectLiteral */: - var openBrace = ts.forEach(n.getChildren(), function (c) { return c.kind === 5 /* OpenBraceToken */ && c; }); - var closeBrace = ts.forEach(n.getChildren(), function (c) { return c.kind === 6 /* CloseBraceToken */ && c; }); - addOutlineRange(n, openBrace, closeBrace); + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + var openBrace = ts.findChildOfKind(n, 13 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 14 /* CloseBraceToken */, sourceFile); + addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + break; + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 142 /* ObjectLiteral */: + case 174 /* SwitchStatement */: + var openBrace = ts.findChildOfKind(n, 13 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 14 /* CloseBraceToken */, sourceFile); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + break; + case 141 /* ArrayLiteral */: + var openBracket = ts.findChildOfKind(n, 17 /* OpenBracketToken */, sourceFile); + var closeBracket = ts.findChildOfKind(n, 18 /* CloseBracketToken */, sourceFile); + addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); break; } depth++; @@ -25880,98 +16582,119 @@ var ts; return elements; } OutliningElementsCollector.collectElements = collectElements; - })(ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); - var OutliningElementsCollector = ts.OutliningElementsCollector; + })(OutliningElementsCollector = ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); })(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - var NavigationBarItemGetter = (function () { - function NavigationBarItemGetter() { - this.hasGlobalNode = false; - } - NavigationBarItemGetter.prototype.getIndent = function (node) { - var indent = this.hasGlobalNode ? 1 : 0; +var ts; +(function (ts) { + var NavigationBar; + (function (NavigationBar) { + function getNavigationBarItems(sourceFile) { + var hasGlobalNode = false; + return getItemsWorker(getTopLevelNodes(sourceFile), createTopLevelItem); + function getIndent(node) { + var indent = hasGlobalNode ? 1 : 0; var current = node.parent; - while (current != null) { - if (current.kind() == 130 /* ModuleDeclaration */ || current.kind() === 129 /* FunctionDeclaration */) { - indent++; + while (current) { + switch (current.kind) { + case 191 /* ModuleDeclaration */: + do { + current = current.parent; + } while (current.kind === 191 /* ModuleDeclaration */); + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + case 188 /* InterfaceDeclaration */: + case 185 /* FunctionDeclaration */: + indent++; } current = current.parent; } return indent; - }; - NavigationBarItemGetter.prototype.getKindModifiers = function (modifiers) { - var result = []; - for (var i = 0, n = modifiers.length; i < n; i++) { - result.push(modifiers[i].text()); - } - return result.length > 0 ? result.join(',') : ts.ScriptElementKindModifier.none; - }; - NavigationBarItemGetter.prototype.getItems = function (node) { - var _this = this; - return this.getItemsWorker(function () { return _this.getTopLevelNodes(node); }, function (n) { return _this.createTopLevelItem(n); }); - }; - NavigationBarItemGetter.prototype.getChildNodes = function (nodes) { + } + function getChildNodes(nodes) { var childNodes = []; for (var i = 0, n = nodes.length; i < n; i++) { var node = nodes[i]; - if (node.kind() === 129 /* FunctionDeclaration */) { + if (node.kind === 187 /* ClassDeclaration */ || node.kind === 190 /* EnumDeclaration */ || node.kind === 188 /* InterfaceDeclaration */ || node.kind === 191 /* ModuleDeclaration */ || node.kind === 185 /* FunctionDeclaration */) { childNodes.push(node); } - else if (node.kind() === 148 /* VariableStatement */) { - var variableDeclaration = node.variableDeclaration; - childNodes.push.apply(childNodes, variableDeclaration.variableDeclarators); + else if (node.kind === 162 /* VariableStatement */) { + childNodes.push.apply(childNodes, node.declarations); } } - return childNodes; - }; - NavigationBarItemGetter.prototype.getTopLevelNodes = function (node) { + return sortNodes(childNodes); + } + function getTopLevelNodes(node) { var topLevelNodes = []; topLevelNodes.push(node); - this.addTopLevelNodes(node.moduleElements, topLevelNodes); + addTopLevelNodes(node.statements, topLevelNodes); return topLevelNodes; - }; - NavigationBarItemGetter.prototype.addTopLevelNodes = function (nodes, topLevelNodes) { + } + function sortNodes(nodes) { + return nodes.slice(0).sort(function (n1, n2) { + if (n1.name && n2.name) { + return n1.name.text.localeCompare(n2.name.text); + } + else if (n1.name) { + return 1; + } + else if (n2.name) { + return -1; + } + else { + return n1.kind - n2.kind; + } + }); + } + function addTopLevelNodes(nodes, topLevelNodes) { + nodes = sortNodes(nodes); for (var i = 0, n = nodes.length; i < n; i++) { var node = nodes[i]; - switch (node.kind()) { - case 131 /* ClassDeclaration */: - case 132 /* EnumDeclaration */: - case 128 /* InterfaceDeclaration */: + switch (node.kind) { + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + case 188 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 130 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); - this.addTopLevelNodes(moduleDeclaration.moduleElements, topLevelNodes); + addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 129 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: var functionDeclaration = node; - if (this.isTopLevelFunctionDeclaration(functionDeclaration)) { + if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); - this.addTopLevelNodes(functionDeclaration.block.statements, topLevelNodes); + addTopLevelNodes(functionDeclaration.body.statements, topLevelNodes); } break; } } - }; - NavigationBarItemGetter.prototype.isTopLevelFunctionDeclaration = function (functionDeclaration) { - return functionDeclaration.block && TypeScript.ArrayUtilities.any(functionDeclaration.block.statements, function (s) { return s.kind() === 129 /* FunctionDeclaration */; }); - }; - NavigationBarItemGetter.prototype.getItemsWorker = function (getNodes, createItem) { + } + function isTopLevelFunctionDeclaration(functionDeclaration) { + if (functionDeclaration.kind === 185 /* FunctionDeclaration */) { + if (functionDeclaration.body && functionDeclaration.body.kind === 186 /* FunctionBlock */) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 185 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + return true; + } + if (functionDeclaration.parent.kind !== 186 /* FunctionBlock */) { + return true; + } + } + } + return false; + } + function getItemsWorker(nodes, createItem) { var items = []; - var keyToItem = TypeScript.createIntrinsicsObject(); - var nodes = getNodes(); + var keyToItem = {}; for (var i = 0, n = nodes.length; i < n; i++) { var child = nodes[i]; var item = createItem(child); - if (item != null) { + if (item !== undefined) { if (item.text.length > 0) { - var key = item.text + "-" + item.kind; + var key = item.text + "-" + item.kind + "-" + item.indent; var itemWithSameName = keyToItem[key]; if (itemWithSameName) { - this.merge(itemWithSameName, item); + merge(itemWithSameName, item); } else { keyToItem[key] = item; @@ -25981,8 +16704,8 @@ var TypeScript; } } return items; - }; - NavigationBarItemGetter.prototype.merge = function (target, source) { + } + function merge(target, source) { target.spans.push.apply(target.spans, source.spans); if (source.childItems) { if (!target.childItems) { @@ -25993,4667 +16716,2628 @@ var TypeScript; for (var j = 0, m = target.childItems.length; j < m; j++) { var targetChild = target.childItems[j]; if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { - this.merge(targetChild, sourceChild); + merge(targetChild, sourceChild); continue outer; } } target.childItems.push(sourceChild); } } - }; - NavigationBarItemGetter.prototype.createChildItem = function (node) { - switch (node.kind()) { - case 242 /* Parameter */: - var parameter = node; - if (parameter.modifiers.length === 0) { - return null; - } - return new ts.NavigationBarItem(parameter.identifier.text(), ts.ScriptElementKind.memberVariableElement, this.getKindModifiers(parameter.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - case 135 /* MemberFunctionDeclaration */: - var memberFunction = node; - return new ts.NavigationBarItem(memberFunction.propertyName.text(), ts.ScriptElementKind.memberFunctionElement, this.getKindModifiers(memberFunction.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - case 139 /* GetAccessor */: - var getAccessor = node; - return new ts.NavigationBarItem(getAccessor.propertyName.text(), ts.ScriptElementKind.memberGetAccessorElement, this.getKindModifiers(getAccessor.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - case 140 /* SetAccessor */: - var setAccessor = node; - return new ts.NavigationBarItem(setAccessor.propertyName.text(), ts.ScriptElementKind.memberSetAccessorElement, this.getKindModifiers(setAccessor.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - case 144 /* IndexSignature */: - var indexSignature = node; - return new ts.NavigationBarItem("[]", ts.ScriptElementKind.indexSignatureElement, ts.ScriptElementKindModifier.none, [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - case 243 /* EnumElement */: - var enumElement = node; - return new ts.NavigationBarItem(enumElement.propertyName.text(), ts.ScriptElementKind.memberVariableElement, ts.ScriptElementKindModifier.none, [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - case 142 /* CallSignature */: - var callSignature = node; - return new ts.NavigationBarItem("()", ts.ScriptElementKind.callSignatureElement, ts.ScriptElementKindModifier.none, [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - case 143 /* ConstructSignature */: - var constructSignature = node; - return new ts.NavigationBarItem("new()", ts.ScriptElementKind.constructSignatureElement, ts.ScriptElementKindModifier.none, [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - case 145 /* MethodSignature */: - var methodSignature = node; - return new ts.NavigationBarItem(methodSignature.propertyName.text(), ts.ScriptElementKind.memberFunctionElement, ts.ScriptElementKindModifier.none, [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - case 141 /* PropertySignature */: - var propertySignature = node; - return new ts.NavigationBarItem(propertySignature.propertyName.text(), ts.ScriptElementKind.memberVariableElement, ts.ScriptElementKindModifier.none, [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - case 129 /* FunctionDeclaration */: - var functionDeclaration = node; - if (!this.isTopLevelFunctionDeclaration(functionDeclaration)) { - return new ts.NavigationBarItem(functionDeclaration.identifier.text(), ts.ScriptElementKind.functionElement, this.getKindModifiers(functionDeclaration.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - } - break; - case 136 /* MemberVariableDeclaration */: - var memberVariableDeclaration = node; - return new ts.NavigationBarItem(memberVariableDeclaration.variableDeclarator.propertyName.text(), ts.ScriptElementKind.memberVariableElement, this.getKindModifiers(memberVariableDeclaration.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(memberVariableDeclaration.variableDeclarator), TypeScript.end(memberVariableDeclaration.variableDeclarator))]); - case 225 /* VariableDeclarator */: - var variableDeclarator = node; - return new ts.NavigationBarItem(variableDeclarator.propertyName.text(), ts.ScriptElementKind.variableElement, ts.ScriptElementKindModifier.none, [TypeScript.TextSpan.fromBounds(TypeScript.start(variableDeclarator), TypeScript.end(variableDeclarator))]); - case 137 /* ConstructorDeclaration */: - var constructorDeclaration = node; - return new ts.NavigationBarItem("constructor", ts.ScriptElementKind.constructorImplementationElement, ts.ScriptElementKindModifier.none, [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))]); - } - return null; - }; - NavigationBarItemGetter.prototype.createTopLevelItem = function (node) { - switch (node.kind()) { - case 120 /* SourceUnit */: - return this.createSourceUnitItem(node); - case 131 /* ClassDeclaration */: - return this.createClassItem(node); - case 132 /* EnumDeclaration */: - return this.createEnumItem(node); - case 128 /* InterfaceDeclaration */: - return this.createIterfaceItem(node); - case 130 /* ModuleDeclaration */: - return this.createModuleItem(node); - case 129 /* FunctionDeclaration */: - return this.createFunctionItem(node); - } - return null; - }; - NavigationBarItemGetter.prototype.getModuleNames = function (node) { - var result = []; - if (node.stringLiteral) { - result.push(node.stringLiteral.text()); - } - else { - this.getModuleNamesHelper(node.name, result); - } - return result; - }; - NavigationBarItemGetter.prototype.getModuleNamesHelper = function (name, result) { - if (name.kind() === 121 /* QualifiedName */) { - var qualifiedName = name; - this.getModuleNamesHelper(qualifiedName.left, result); - result.push(qualifiedName.right.text()); - } - else { - result.push(name.text()); - } - }; - NavigationBarItemGetter.prototype.createModuleItem = function (node) { - var _this = this; - var moduleNames = this.getModuleNames(node); - var childItems = this.getItemsWorker(function () { return _this.getChildNodes(node.moduleElements); }, function (n) { return _this.createChildItem(n); }); - return new ts.NavigationBarItem(moduleNames.join("."), ts.ScriptElementKind.moduleElement, this.getKindModifiers(node.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))], childItems, this.getIndent(node)); - }; - NavigationBarItemGetter.prototype.createFunctionItem = function (node) { - var _this = this; - var childItems = this.getItemsWorker(function () { return node.block.statements; }, function (n) { return _this.createChildItem(n); }); - return new ts.NavigationBarItem(node.identifier.text(), ts.ScriptElementKind.functionElement, this.getKindModifiers(node.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))], childItems, this.getIndent(node)); - }; - NavigationBarItemGetter.prototype.createSourceUnitItem = function (node) { - var _this = this; - var childItems = this.getItemsWorker(function () { return _this.getChildNodes(node.moduleElements); }, function (n) { return _this.createChildItem(n); }); - if (childItems === null || childItems.length === 0) { - return null; - } - this.hasGlobalNode = true; - return new ts.NavigationBarItem("", ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))], childItems); - }; - NavigationBarItemGetter.prototype.createClassItem = function (node) { - var _this = this; - var constructor = TypeScript.ArrayUtilities.firstOrDefault(node.classElements, function (n) { return n.kind() === 137 /* ConstructorDeclaration */; }); - var nodes = constructor ? constructor.callSignature.parameterList.parameters.concat(node.classElements) : node.classElements; - var childItems = this.getItemsWorker(function () { return nodes; }, function (n) { return _this.createChildItem(n); }); - return new ts.NavigationBarItem(node.identifier.text(), ts.ScriptElementKind.classElement, this.getKindModifiers(node.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))], childItems, this.getIndent(node)); - }; - NavigationBarItemGetter.prototype.createEnumItem = function (node) { - var _this = this; - var childItems = this.getItemsWorker(function () { return node.enumElements; }, function (n) { return _this.createChildItem(n); }); - return new ts.NavigationBarItem(node.identifier.text(), ts.ScriptElementKind.enumElement, this.getKindModifiers(node.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))], childItems, this.getIndent(node)); - }; - NavigationBarItemGetter.prototype.createIterfaceItem = function (node) { - var _this = this; - var childItems = this.getItemsWorker(function () { return node.body.typeMembers; }, function (n) { return _this.createChildItem(n); }); - return new ts.NavigationBarItem(node.identifier.text(), ts.ScriptElementKind.interfaceElement, this.getKindModifiers(node.modifiers), [TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node))], childItems, this.getIndent(node)); - }; - return NavigationBarItemGetter; - })(); - Services.NavigationBarItemGetter = NavigationBarItemGetter; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - var BraceMatcher = (function () { - function BraceMatcher() { } - BraceMatcher.getMatchSpans = function (syntaxTree, position) { - var result = []; - var token = TypeScript.findToken(syntaxTree.sourceUnit(), position); - if (TypeScript.start(token) === position) { - var matchKind = BraceMatcher.getMatchingTokenKind(token); - if (matchKind !== null) { - var parentElement = token.parent; - for (var i = 0, n = TypeScript.childCount(parentElement); i < n; i++) { - var current = TypeScript.childAt(parentElement, i); - if (current !== null && TypeScript.fullWidth(current) > 0) { - if (current.kind() === matchKind) { - var range1 = new TypeScript.TextSpan(TypeScript.start(token), TypeScript.width(token)); - var range2 = new TypeScript.TextSpan(TypeScript.start(current), TypeScript.width(current)); - if (range1.start() < range2.start()) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - break; - } - } + function createChildItem(node) { + switch (node.kind) { + case 123 /* Parameter */: + if ((node.flags & 243 /* Modifier */) === 0) { + return undefined; } - } - } - return result; - }; - BraceMatcher.getMatchingTokenKind = function (token) { - switch (token.kind()) { - case 70 /* OpenBraceToken */: - return 71 /* CloseBraceToken */; - case 72 /* OpenParenToken */: - return 73 /* CloseParenToken */; - case 74 /* OpenBracketToken */: - return 75 /* CloseBracketToken */; - case 80 /* LessThanToken */: - return 81 /* GreaterThanToken */; - case 71 /* CloseBraceToken */: - return 70 /* OpenBraceToken */; - case 73 /* CloseParenToken */: - return 72 /* OpenParenToken */; - case 75 /* CloseBracketToken */: - return 74 /* OpenBracketToken */; - case 81 /* GreaterThanToken */: - return 80 /* LessThanToken */; - } - return null; - }; - return BraceMatcher; - })(); - Services.BraceMatcher = BraceMatcher; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Breakpoints) { - function createBreakpointSpanInfo(parentElement) { - var childElements = []; - for (var _i = 1; _i < arguments.length; _i++) { - childElements[_i - 1] = arguments[_i]; - } - if (!parentElement) { - return null; - } - if (childElements.length == 0) { - return TypeScript.TextSpan.fromBounds(TypeScript.start(parentElement), TypeScript.end(parentElement)); - } - var start; - var end; - for (var i = 0; i < childElements.length; i++) { - var element = childElements[i]; - if (element && !TypeScript.isShared(element)) { - if (start == undefined) { - start = TypeScript.start(element); - } - end = TypeScript.end(element); - } - } - return TypeScript.TextSpan.fromBounds(start, end); - } - function createBreakpointSpanInfoWithLimChar(startElement, limChar) { - return TypeScript.TextSpan.fromBounds(TypeScript.start(startElement), limChar); - } - var BreakpointResolver = (function () { - function BreakpointResolver(posLine, lineMap) { - this.posLine = posLine; - this.lineMap = lineMap; - } - BreakpointResolver.prototype.breakpointSpanOfToken = function (positionedToken) { - switch (positionedToken.kind()) { - case 70 /* OpenBraceToken */: - return this.breakpointSpanOfOpenBrace(positionedToken); - case 71 /* CloseBraceToken */: - return this.breakpointSpanOfCloseBrace(positionedToken); - case 79 /* CommaToken */: - return this.breakpointSpanOfComma(positionedToken); - case 78 /* SemicolonToken */: - case 10 /* EndOfFileToken */: - return this.breakpointSpanIfStartsOnSameLine(TypeScript.previousToken(positionedToken)); - case 73 /* CloseParenToken */: - return this.breakpointSpanOfCloseParen(positionedToken); - case 22 /* DoKeyword */: - var parentElement = positionedToken.parent; - if (parentElement && parentElement.kind() == 161 /* DoStatement */) { - return this.breakpointSpanIfStartsOnSameLine(TypeScript.nextToken(positionedToken)); - } - break; - } - return this.breakpointSpanOfContainingNode(positionedToken); - }; - BreakpointResolver.prototype.breakpointSpanOfOpenBrace = function (openBraceToken) { - var container = TypeScript.Syntax.containingNode(openBraceToken); - if (container) { - var originalContainer = container; - if (container && container.kind() == 146 /* Block */) { - container = TypeScript.Syntax.containingNode(container); - if (!container) { - container = originalContainer; - } - } - switch (container.kind()) { - case 146 /* Block */: - if (!this.canHaveBreakpointInBlock(container)) { - return null; - } - return this.breakpointSpanOfFirstStatementInBlock(container); - break; - case 130 /* ModuleDeclaration */: - case 131 /* ClassDeclaration */: - case 129 /* FunctionDeclaration */: - case 137 /* ConstructorDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 222 /* FunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 219 /* SimpleArrowFunctionExpression */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstChildOfSyntaxList(this.getSyntaxListOfDeclarationWithElements(container)); - } - else { - return this.breakpointSpanOf(container); - } - case 132 /* EnumDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstEnumElement(container); - } - else { - return this.breakpointSpanOf(container); - } - case 147 /* IfStatement */: - case 155 /* ForInStatement */: - case 158 /* WhileStatement */: - case 236 /* CatchClause */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - } - else { - return this.breakpointSpanOf(container); - } - case 161 /* DoStatement */: - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - case 154 /* ForStatement */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - } - else { - return this.breakpointSpanOf(TypeScript.previousToken(openBraceToken)); - } - case 235 /* ElseClause */: - case 233 /* CaseSwitchClause */: - case 234 /* DefaultSwitchClause */: - case 163 /* WithStatement */: - case 159 /* TryStatement */: - case 237 /* FinallyClause */: - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - case 151 /* SwitchStatement */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementOfFirstCaseClause(container); - } - else { - return this.breakpointSpanOf(container); - } - } - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfCloseBrace = function (closeBraceToken) { - var container = TypeScript.Syntax.containingNode(closeBraceToken); - if (container) { - var originalContainer = container; - if (container.kind() == 146 /* Block */) { - container = TypeScript.Syntax.containingNode(container); - if (!container) { - container = originalContainer; - } - } - switch (container.kind()) { - case 146 /* Block */: - if (!this.canHaveBreakpointInBlock(container)) { - return null; - } - return this.breakpointSpanOfLastStatementInBlock(container); - break; - case 130 /* ModuleDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - var moduleSyntax = container; - if (moduleSyntax.moduleElements && moduleSyntax.moduleElements.length > 0) { - return createBreakpointSpanInfo(closeBraceToken); - } - else { - return null; - } - case 131 /* ClassDeclaration */: - case 129 /* FunctionDeclaration */: - case 137 /* ConstructorDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 222 /* FunctionExpression */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - return createBreakpointSpanInfo(closeBraceToken); - case 132 /* EnumDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - return createBreakpointSpanInfo(closeBraceToken); - case 147 /* IfStatement */: - case 235 /* ElseClause */: - case 155 /* ForInStatement */: - case 154 /* ForStatement */: - case 158 /* WhileStatement */: - case 161 /* DoStatement */: - case 233 /* CaseSwitchClause */: - case 234 /* DefaultSwitchClause */: - case 163 /* WithStatement */: - case 159 /* TryStatement */: - case 236 /* CatchClause */: - case 237 /* FinallyClause */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 219 /* SimpleArrowFunctionExpression */: - return this.breakpointSpanOfLastStatementInBlock(originalContainer); - case 151 /* SwitchStatement */: - return this.breakpointSpanOfLastStatementOfLastCaseClause(container); - } - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfComma = function (commaToken) { - var commaParent = commaToken.parent; - if (TypeScript.isSeparatedList(commaParent)) { - var grandParent = commaParent.parent; - if (grandParent) { - switch (grandParent.kind()) { - case 224 /* VariableDeclaration */: - case 132 /* EnumDeclaration */: - case 227 /* ParameterList */: - var index = TypeScript.Syntax.childIndex(commaParent, commaToken); - if (index > 0) { - var child = TypeScript.childAt(commaParent, index - 1); - return this.breakpointSpanOf(child); - } - if (grandParent.kind() == 132 /* EnumDeclaration */) { - return null; - } - break; - } - } - } - return this.breakpointSpanOfContainingNode(commaToken); - }; - BreakpointResolver.prototype.breakpointSpanOfCloseParen = function (closeParenToken) { - var closeParenParent = closeParenToken.parent; - if (closeParenParent) { - switch (closeParenParent.kind()) { - case 154 /* ForStatement */: - case 227 /* ParameterList */: - return this.breakpointSpanOf(TypeScript.previousToken(closeParenToken)); - } - } - return this.breakpointSpanOfContainingNode(closeParenToken); - }; - BreakpointResolver.prototype.canHaveBreakpointInBlock = function (blockNode) { - if (!blockNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(blockNode)) { - return false; - } - var blockSyntax = blockNode; - return blockSyntax.statements && blockSyntax.statements.length != 0; - }; - BreakpointResolver.prototype.breakpointSpanOfFirstStatementInBlock = function (blockNode) { - if (!blockNode) { - return null; - } - var blockSyntax = blockNode; - var statementsNode = blockSyntax.statements; - if (!statementsNode || statementsNode.length == 0) { - return null; - } - var firstStatement = TypeScript.childAt(statementsNode, 0); - if (firstStatement && firstStatement.kind() == 146 /* Block */) { - if (this.canHaveBreakpointInBlock(firstStatement)) { - return this.breakpointSpanOfFirstStatementInBlock(firstStatement); - } - return null; - } - else { - return this.breakpointSpanOf(firstStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfLastStatementInBlock = function (blockNode) { - if (!blockNode) { - return null; - } - var blockSyntax = blockNode; - var statementsNode = blockSyntax.statements; - if (!statementsNode || statementsNode.length == 0) { - return null; - } - var lastStatement = TypeScript.childAt(statementsNode, statementsNode.length - 1); - if (lastStatement && lastStatement.kind() == 146 /* Block */) { - if (this.canHaveBreakpointInBlock(lastStatement)) { - return this.breakpointSpanOfLastStatementInBlock(lastStatement); - } - return null; - } - else { - return this.breakpointSpanOf(lastStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfFirstChildOfSyntaxList = function (positionedList) { - if (!positionedList) { - return null; - } - var listSyntax = positionedList; - if (listSyntax.length == 0) { - return null; - } - var firstStatement = TypeScript.childAt(positionedList, 0); - if (firstStatement && firstStatement.kind() == 146 /* Block */) { - if (this.canHaveBreakpointInBlock(firstStatement)) { - return this.breakpointSpanOfFirstStatementInBlock(firstStatement); - } - return null; - } - else { - return this.breakpointSpanOf(firstStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfLastChildOfSyntaxList = function (positionedList) { - if (!positionedList) { - return null; - } - var listSyntax = positionedList; - if (listSyntax.length == 0) { - return null; - } - var lastStatement = TypeScript.childAt(positionedList, 0); - if (lastStatement && lastStatement.kind() == 146 /* Block */) { - if (this.canHaveBreakpointInBlock(lastStatement)) { - return this.breakpointSpanOfLastStatementInBlock(lastStatement); - } - return null; - } - else { - return this.breakpointSpanOf(lastStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfNode = function (positionedNode) { - var node = positionedNode; - switch (node.kind()) { - case 130 /* ModuleDeclaration */: - case 131 /* ClassDeclaration */: - case 129 /* FunctionDeclaration */: - case 137 /* ConstructorDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 222 /* FunctionExpression */: - return this.breakpointSpanOfDeclarationWithElements(positionedNode); - case 225 /* VariableDeclarator */: - return this.breakpointSpanOfVariableDeclarator(positionedNode); - case 224 /* VariableDeclaration */: - return this.breakpointSpanOfVariableDeclaration(positionedNode); - case 148 /* VariableStatement */: - return this.breakpointSpanOfVariableStatement(positionedNode); - case 242 /* Parameter */: - return this.breakpointSpanOfParameter(positionedNode); - case 136 /* MemberVariableDeclaration */: - return this.breakpointSpanOfMemberVariableDeclaration(positionedNode); - case 133 /* ImportDeclaration */: - return this.breakpointSpanOfImportDeclaration(positionedNode); - case 132 /* EnumDeclaration */: - return this.breakpointSpanOfEnumDeclaration(positionedNode); - case 243 /* EnumElement */: - return this.breakpointSpanOfEnumElement(positionedNode); - case 147 /* IfStatement */: - return this.breakpointSpanOfIfStatement(positionedNode); - case 235 /* ElseClause */: - return this.breakpointSpanOfElseClause(positionedNode); - case 155 /* ForInStatement */: - return this.breakpointSpanOfForInStatement(positionedNode); - case 154 /* ForStatement */: - return this.breakpointSpanOfForStatement(positionedNode); - case 158 /* WhileStatement */: - return this.breakpointSpanOfWhileStatement(positionedNode); - case 161 /* DoStatement */: - return this.breakpointSpanOfDoStatement(positionedNode); - case 151 /* SwitchStatement */: - return this.breakpointSpanOfSwitchStatement(positionedNode); - case 233 /* CaseSwitchClause */: - return this.breakpointSpanOfCaseSwitchClause(positionedNode); - case 234 /* DefaultSwitchClause */: - return this.breakpointSpanOfDefaultSwitchClause(positionedNode); - case 163 /* WithStatement */: - return this.breakpointSpanOfWithStatement(positionedNode); - case 159 /* TryStatement */: - return this.breakpointSpanOfTryStatement(positionedNode); - case 236 /* CatchClause */: - return this.breakpointSpanOfCatchClause(positionedNode); - case 237 /* FinallyClause */: - return this.breakpointSpanOfFinallyClause(positionedNode); - case 218 /* ParenthesizedArrowFunctionExpression */: - return this.breakpointSpanOfParenthesizedArrowFunctionExpression(positionedNode); - case 219 /* SimpleArrowFunctionExpression */: - return this.breakpointSpanOfSimpleArrowFunctionExpression(positionedNode); - default: - if (TypeScript.SyntaxUtilities.isStatement(node)) { - return this.breakpointSpanOfStatement(positionedNode); - } - else { - return this.breakpointOfExpression(positionedNode); - } - } - }; - BreakpointResolver.prototype.isExpressionOfArrowExpressions = function (expression) { - if (!expression) { - return false; - } - var expressionParent = expression.parent; - if (expressionParent) { - if (expressionParent.kind() == 218 /* ParenthesizedArrowFunctionExpression */) { - var parenthesizedArrowExpression = expressionParent; - var expressionOfParenthesizedArrowExpression = parenthesizedArrowExpression.expression; - return expressionOfParenthesizedArrowExpression == expression; - } - else if (expressionParent.kind() == 219 /* SimpleArrowFunctionExpression */) { - var simpleArrowExpression = expressionParent; - var expressionOfSimpleArrowExpression = simpleArrowExpression.expression; - return expressionOfSimpleArrowExpression == expression; - } - else if (expressionParent.kind() == 173 /* CommaExpression */) { - return this.isExpressionOfArrowExpressions(expressionParent); - } - } - return false; - }; - BreakpointResolver.prototype.isInitializerOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 154 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var initializer = forStatement.initializer; - return initializer === expression; - } - else if (expressionParent && expressionParent.kind() == 173 /* CommaExpression */) { - return this.isInitializerOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.isConditionOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 154 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var condition = forStatement.condition; - return condition === expression; - } - else if (expressionParent && expressionParent.kind() == 173 /* CommaExpression */) { - return this.isConditionOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.isIncrememtorOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 154 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var incrementor = forStatement.incrementor; - return incrementor === expression; - } - else if (expressionParent && expressionParent.kind() == 173 /* CommaExpression */) { - return this.isIncrememtorOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.breakpointOfLeftOfCommaExpression = function (commaExpressionNode) { - var commaExpression = commaExpressionNode; - return this.breakpointSpanOf(commaExpression.left); - }; - BreakpointResolver.prototype.breakpointOfExpression = function (expressionNode) { - if (this.isInitializerOfForStatement(expressionNode) || this.isConditionOfForStatement(expressionNode) || this.isIncrememtorOfForStatement(expressionNode)) { - if (expressionNode.kind() == 173 /* CommaExpression */) { - return this.breakpointOfLeftOfCommaExpression(expressionNode); - } - return createBreakpointSpanInfo(expressionNode); - } - if (this.isExpressionOfArrowExpressions(expressionNode)) { - if (expressionNode.kind() == 173 /* CommaExpression */) { - return this.breakpointOfLeftOfCommaExpression(expressionNode); - } - return createBreakpointSpanInfo(expressionNode); - } - if (expressionNode.kind() == 134 /* ExportAssignment */) { - var exportAssignmentSyntax = expressionNode; - return createBreakpointSpanInfo(expressionNode, exportAssignmentSyntax.exportKeyword, exportAssignmentSyntax.equalsToken, exportAssignmentSyntax.identifier); - } - return this.breakpointSpanOfContainingNode(expressionNode); - }; - BreakpointResolver.prototype.breakpointSpanOfStatement = function (statementNode) { - var statement = statementNode; - if (statement.kind() == 156 /* EmptyStatement */) { - return null; - } - var containingNode = TypeScript.Syntax.containingNode(statementNode); - if (TypeScript.SyntaxUtilities.isStatement(containingNode)) { - var useNodeForBreakpoint = false; - switch (containingNode.kind()) { - case 130 /* ModuleDeclaration */: - case 131 /* ClassDeclaration */: - case 129 /* FunctionDeclaration */: - case 137 /* ConstructorDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 146 /* Block */: - case 147 /* IfStatement */: - case 235 /* ElseClause */: - case 155 /* ForInStatement */: - case 154 /* ForStatement */: - case 158 /* WhileStatement */: - case 161 /* DoStatement */: - case 151 /* SwitchStatement */: - case 233 /* CaseSwitchClause */: - case 234 /* DefaultSwitchClause */: - case 163 /* WithStatement */: - case 159 /* TryStatement */: - case 236 /* CatchClause */: - case 237 /* FinallyClause */: - case 146 /* Block */: - useNodeForBreakpoint = true; - } - if (!useNodeForBreakpoint) { - return this.breakpointSpanOfContainingNode(statementNode); - } - } - switch (statement.kind()) { - case 149 /* ExpressionStatement */: - var expressionSyntax = statement; - return createBreakpointSpanInfo(expressionSyntax.expression); - case 150 /* ReturnStatement */: - var returnStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, returnStatementSyntax.returnKeyword, returnStatementSyntax.expression); - case 157 /* ThrowStatement */: - var throwStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, throwStatementSyntax.throwKeyword, throwStatementSyntax.expression); - case 152 /* BreakStatement */: - var breakStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, breakStatementSyntax.breakKeyword, breakStatementSyntax.identifier); - case 153 /* ContinueStatement */: - var continueStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, continueStatementSyntax.continueKeyword, continueStatementSyntax.identifier); - case 162 /* DebuggerStatement */: - var debuggerStatementSyntax = statement; - return createBreakpointSpanInfo(debuggerStatementSyntax.debuggerKeyword); - case 160 /* LabeledStatement */: - var labeledStatementSyntax = statement; - return this.breakpointSpanOf(labeledStatementSyntax.statement); - } - return null; - }; - BreakpointResolver.prototype.getSyntaxListOfDeclarationWithElements = function (positionedNode) { - var node = positionedNode; - var elementsList; - var block; - switch (node.kind()) { - case 130 /* ModuleDeclaration */: - elementsList = node.moduleElements; - break; - case 131 /* ClassDeclaration */: - elementsList = node.classElements; - break; - case 129 /* FunctionDeclaration */: - block = node.block; - break; - case 137 /* ConstructorDeclaration */: - block = node.block; - break; - case 135 /* MemberFunctionDeclaration */: - block = node.block; - break; - case 139 /* GetAccessor */: - block = node.block; - break; - case 140 /* SetAccessor */: - block = node.block; - break; - case 222 /* FunctionExpression */: - block = node.block; - break; - case 218 /* ParenthesizedArrowFunctionExpression */: - block = node.block; - break; - case 219 /* SimpleArrowFunctionExpression */: - block = node.block; - break; - default: - throw TypeScript.Errors.argument('positionNode', 'unknown node kind in getSyntaxListOfDeclarationWithElements'); - } - var parentElement = positionedNode; - if (block) { - parentElement = block; - elementsList = block.statements; - } - return elementsList; - }; - BreakpointResolver.prototype.canHaveBreakpointInDeclaration = function (positionedNode) { - return positionedNode && !TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(positionedNode); - }; - BreakpointResolver.prototype.breakpointSpanOfDeclarationWithElements = function (positionedNode) { - if (!this.canHaveBreakpointInDeclaration(positionedNode)) { - return null; - } - var node = positionedNode; - var moduleSyntax = positionedNode; - if ((TypeScript.SyntaxUtilities.isModuleElement(node) && TypeScript.Syntax.containingNode(positionedNode).kind() != 120 /* SourceUnit */) || TypeScript.SyntaxUtilities.isClassElement(node) || (moduleSyntax.kind() == 130 /* ModuleDeclaration */ && moduleSyntax.name && moduleSyntax.name.kind() == 121 /* QualifiedName */)) { - return createBreakpointSpanInfo(positionedNode); - } - else { - return this.breakpointSpanOfFirstChildOfSyntaxList(this.getSyntaxListOfDeclarationWithElements(positionedNode)); - } - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableDeclarator = function (varDeclaratorNode) { - if (!varDeclaratorNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varDeclaratorNode)) { - return false; - } - var varDeclaratorSyntax = varDeclaratorNode; - return !!varDeclaratorSyntax.equalsValueClause; - }; - BreakpointResolver.prototype.breakpointSpanOfVariableDeclarator = function (varDeclaratorNode) { - if (!this.canHaveBreakpointInVariableDeclarator(varDeclaratorNode)) { - return null; - } - var container = TypeScript.Syntax.containingNode(varDeclaratorNode); - if (container && container.kind() == 224 /* VariableDeclaration */) { - var parentDeclaratorsList = varDeclaratorNode.parent; - if (parentDeclaratorsList && TypeScript.childAt(parentDeclaratorsList, 0) == varDeclaratorNode) { - return this.breakpointSpanOfVariableDeclaration(container); - } - if (this.canHaveBreakpointInVariableDeclarator(varDeclaratorNode)) { - return createBreakpointSpanInfo(varDeclaratorNode); + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + case 125 /* Method */: + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); + case 127 /* GetAccessor */: + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); + case 128 /* SetAccessor */: + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); + case 131 /* IndexSignature */: + return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); + case 195 /* EnumMember */: + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + case 129 /* CallSignature */: + return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); + case 130 /* ConstructSignature */: + return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); + case 124 /* Property */: + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + case 185 /* FunctionDeclaration */: + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); + case 184 /* VariableDeclaration */: + if (node.flags & 4096 /* Const */) { + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.constantElement); } else { - return null; + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.variableElement); } - } - else if (container) { - return this.breakpointSpanOfMemberVariableDeclaration(container); - } - return null; - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableDeclaration = function (varDeclarationNode) { - if (!varDeclarationNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varDeclarationNode)) { - return false; - } - var varDeclarationSyntax = varDeclarationNode; - var containerChildren = varDeclarationSyntax.variableDeclarators; - if (!containerChildren || TypeScript.childCount(containerChildren) == 0) { - return false; - } - var child = TypeScript.childAt(containerChildren, 0); - if (TypeScript.isNode(child)) { - return this.canHaveBreakpointInVariableDeclarator(child); - } - return false; - }; - BreakpointResolver.prototype.breakpointSpanOfVariableDeclaration = function (varDeclarationNode) { - if (!this.canHaveBreakpointInDeclaration(varDeclarationNode)) { - return null; - } - var container = TypeScript.Syntax.containingNode(varDeclarationNode); - var varDeclarationSyntax = varDeclarationNode; - var varDeclarators = varDeclarationSyntax.variableDeclarators; - var varDeclaratorsCount = TypeScript.childCount(varDeclarators); - if (container && container.kind() == 148 /* VariableStatement */) { - return this.breakpointSpanOfVariableStatement(container); - } - if (this.canHaveBreakpointInVariableDeclaration(varDeclarationNode)) { - return createBreakpointSpanInfoWithLimChar(varDeclarationNode, TypeScript.end(TypeScript.childAt(varDeclarators, 0))); - } - else { - return null; - } - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableStatement = function (varStatementNode) { - if (!varStatementNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varStatementNode)) { - return false; - } - var variableStatement = varStatementNode; - return this.canHaveBreakpointInVariableDeclaration(variableStatement.variableDeclaration); - }; - BreakpointResolver.prototype.breakpointSpanOfVariableStatement = function (varStatementNode) { - if (!this.canHaveBreakpointInVariableStatement(varStatementNode)) { - return null; - } - var variableStatement = varStatementNode; - var variableDeclaration = variableStatement.variableDeclaration; - var varDeclarationSyntax = variableDeclaration; - var varDeclarators = varDeclarationSyntax.variableDeclarators; - return createBreakpointSpanInfoWithLimChar(varStatementNode, TypeScript.end(TypeScript.childAt(varDeclarators, 0))); - }; - BreakpointResolver.prototype.breakpointSpanOfParameter = function (parameterNode) { - if (parameterNode.parent.kind() === 219 /* SimpleArrowFunctionExpression */) { - return this.breakpointSpanOfNode(parameterNode.parent); - } - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(parameterNode)) { - return null; - } - var parameterSyntax = parameterNode; - if (parameterSyntax.dotDotDotToken || parameterSyntax.equalsValueClause || parameterSyntax.modifiers.length > 0) { - return createBreakpointSpanInfo(parameterNode); - } - else { - return null; - } - }; - BreakpointResolver.prototype.breakpointSpanOfMemberVariableDeclaration = function (memberVarDeclarationNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(memberVarDeclarationNode)) { - return null; - } - var memberVariableDeclaration = memberVarDeclarationNode; - if (this.canHaveBreakpointInVariableDeclarator(memberVariableDeclaration.variableDeclarator)) { - return createBreakpointSpanInfo(memberVarDeclarationNode, memberVariableDeclaration.modifiers, memberVariableDeclaration.variableDeclarator); - } - else { - return null; - } - }; - BreakpointResolver.prototype.breakpointSpanOfImportDeclaration = function (importDeclarationNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(importDeclarationNode)) { - return null; - } - var importSyntax = importDeclarationNode; - return createBreakpointSpanInfo(importDeclarationNode, importSyntax.modifiers, importSyntax.importKeyword, importSyntax.identifier, importSyntax.equalsToken, importSyntax.moduleReference); - }; - BreakpointResolver.prototype.breakpointSpanOfEnumDeclaration = function (enumDeclarationNode) { - if (!this.canHaveBreakpointInDeclaration(enumDeclarationNode)) { - return null; - } - return createBreakpointSpanInfo(enumDeclarationNode); - }; - BreakpointResolver.prototype.breakpointSpanOfFirstEnumElement = function (enumDeclarationNode) { - var enumDeclarationSyntax = enumDeclarationNode; - var enumElements = enumDeclarationSyntax.enumElements; - if (enumElements && TypeScript.childCount(enumElements)) { - return this.breakpointSpanOf(TypeScript.childAt(enumElements, 0)); - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfEnumElement = function (enumElementNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(enumElementNode)) { - return null; - } - return createBreakpointSpanInfo(enumElementNode); - }; - BreakpointResolver.prototype.breakpointSpanOfIfStatement = function (ifStatementNode) { - var ifStatement = ifStatementNode; - return createBreakpointSpanInfo(ifStatementNode, ifStatement.ifKeyword, ifStatement.openParenToken, ifStatement.condition, ifStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfElseClause = function (elseClauseNode) { - var elseClause = elseClauseNode; - return this.breakpointSpanOf(elseClause.statement); - }; - BreakpointResolver.prototype.breakpointSpanOfForInStatement = function (forInStatementNode) { - var forInStatement = forInStatementNode; - return createBreakpointSpanInfo(forInStatementNode, forInStatement.forKeyword, forInStatement.openParenToken, forInStatement.variableDeclaration, forInStatement.left, forInStatement.inKeyword, forInStatement.expression, forInStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfForStatement = function (forStatementNode) { - var forStatement = forStatementNode; - return this.breakpointSpanOf(forStatement.variableDeclaration ? forStatement.variableDeclaration : forStatement.initializer); - }; - BreakpointResolver.prototype.breakpointSpanOfWhileStatement = function (whileStatementNode) { - var whileStatement = whileStatementNode; - return createBreakpointSpanInfo(whileStatementNode, whileStatement.whileKeyword, whileStatement.openParenToken, whileStatement.condition, whileStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfDoStatement = function (doStatementNode) { - var doStatement = doStatementNode; - return createBreakpointSpanInfo(doStatementNode, doStatement.whileKeyword, doStatement.openParenToken, doStatement.condition, doStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfSwitchStatement = function (switchStatementNode) { - var switchStatement = switchStatementNode; - return createBreakpointSpanInfo(switchStatementNode, switchStatement.switchKeyword, switchStatement.openParenToken, switchStatement.expression, switchStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfFirstStatementOfFirstCaseClause = function (switchStatementNode) { - var switchStatement = switchStatementNode; - if (switchStatement.switchClauses && switchStatement.switchClauses.length == 0) { - return null; - } - var switchClauses = switchStatement.switchClauses; - if (switchClauses.length == 0) { - return null; - } - var firstCaseClause = switchClauses[0]; - var statements = firstCaseClause.statements; - return this.breakpointSpanOfFirstChildOfSyntaxList(statements); - }; - BreakpointResolver.prototype.breakpointSpanOfLastStatementOfLastCaseClause = function (switchStatementNode) { - var switchStatement = switchStatementNode; - if (switchStatement.switchClauses && switchStatement.switchClauses.length == 0) { - return null; - } - var switchClauses = switchStatement.switchClauses; - if (switchClauses.length == 0) { - return null; - } - var lastClauseNode = switchClauses[switchClauses.length - 1]; - var statements = lastClauseNode.statements; - return this.breakpointSpanOfLastChildOfSyntaxList(statements); - }; - BreakpointResolver.prototype.breakpointSpanOfCaseSwitchClause = function (caseClauseNode) { - var caseSwitchClause = caseClauseNode; - return this.breakpointSpanOfFirstChildOfSyntaxList(caseSwitchClause.statements); - }; - BreakpointResolver.prototype.breakpointSpanOfDefaultSwitchClause = function (defaultSwithClauseNode) { - var defaultSwitchClause = defaultSwithClauseNode; - return this.breakpointSpanOfFirstChildOfSyntaxList(defaultSwitchClause.statements); - }; - BreakpointResolver.prototype.breakpointSpanOfWithStatement = function (withStatementNode) { - var withStatement = withStatementNode; - return this.breakpointSpanOf(withStatement.statement); - }; - BreakpointResolver.prototype.breakpointSpanOfTryStatement = function (tryStatementNode) { - var tryStatement = tryStatementNode; - return this.breakpointSpanOfFirstStatementInBlock(tryStatement.block); - }; - BreakpointResolver.prototype.breakpointSpanOfCatchClause = function (catchClauseNode) { - var catchClause = catchClauseNode; - return createBreakpointSpanInfo(catchClauseNode, catchClause.catchKeyword, catchClause.openParenToken, catchClause.identifier, catchClause.typeAnnotation, catchClause.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfFinallyClause = function (finallyClauseNode) { - var finallyClause = finallyClauseNode; - return this.breakpointSpanOfFirstStatementInBlock(finallyClause.block); - }; - BreakpointResolver.prototype.breakpointSpanOfParenthesizedArrowFunctionExpression = function (arrowFunctionExpression) { - if (arrowFunctionExpression.block) { - return this.breakpointSpanOfFirstStatementInBlock(arrowFunctionExpression.block); - } - else { - return this.breakpointSpanOf(arrowFunctionExpression.expression); - } - }; - BreakpointResolver.prototype.breakpointSpanOfSimpleArrowFunctionExpression = function (arrowFunctionExpression) { - if (arrowFunctionExpression.block) { - return this.breakpointSpanOfFirstStatementInBlock(arrowFunctionExpression.block); - } - else { - return this.breakpointSpanOf(arrowFunctionExpression.expression); - } - }; - BreakpointResolver.prototype.breakpointSpanOfContainingNode = function (positionedElement) { - var current = positionedElement.parent; - while (!TypeScript.isNode(current)) { - current = current.parent; - } - return this.breakpointSpanOf(current); - }; - BreakpointResolver.prototype.breakpointSpanIfStartsOnSameLine = function (positionedElement) { - if (positionedElement && this.posLine == this.lineMap.getLineNumberFromPosition(TypeScript.start(positionedElement))) { - return this.breakpointSpanOf(positionedElement); - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOf = function (positionedElement) { - if (!positionedElement) { - return null; - } - for (var containingNode = TypeScript.Syntax.containingNode(positionedElement); containingNode != null; containingNode = TypeScript.Syntax.containingNode(containingNode)) { - if (containingNode.kind() == 244 /* TypeAnnotation */) { - return this.breakpointSpanIfStartsOnSameLine(containingNode); - } - } - var element = positionedElement; - if (TypeScript.isNode(element)) { - return this.breakpointSpanOfNode(positionedElement); - } - if (TypeScript.isToken(element)) { - return this.breakpointSpanOfToken(positionedElement); - } - return this.breakpointSpanOfContainingNode(positionedElement); - }; - return BreakpointResolver; - })(); - function getBreakpointLocation(syntaxTree, askedPos) { - if (TypeScript.isDTSFile(syntaxTree.fileName())) { - return null; + case 126 /* Constructor */: + return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); } - var sourceUnit = syntaxTree.sourceUnit(); - var positionedToken = TypeScript.findToken(sourceUnit, askedPos); - var lineMap = syntaxTree.lineMap(); - var posLine = lineMap.getLineNumberFromPosition(askedPos); - var tokenStartLine = lineMap.getLineNumberFromPosition(TypeScript.start(positionedToken)); - if (posLine < tokenStartLine) { - return null; - } - var breakpointResolver = new BreakpointResolver(posLine, lineMap); - return breakpointResolver.breakpointSpanOf(positionedToken); - } - Breakpoints.getBreakpointLocation = getBreakpointLocation; - })(Services.Breakpoints || (Services.Breakpoints = {})); - var Breakpoints = Services.Breakpoints; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Indentation) { - function columnForEndOfTokenAtPosition(syntaxTree, position, options) { - var token = TypeScript.findToken(syntaxTree.sourceUnit(), position); - return columnForStartOfTokenAtPosition(syntaxTree, position, options) + TypeScript.width(token); - } - Indentation.columnForEndOfTokenAtPosition = columnForEndOfTokenAtPosition; - function columnForStartOfTokenAtPosition(syntaxTree, position, options) { - var token = TypeScript.findToken(syntaxTree.sourceUnit(), position); - var firstTokenInLine = TypeScript.Syntax.firstTokenInLineContainingPosition(syntaxTree, token.fullStart()); - var leadingTextInReverse = []; - var current = token; - while (current !== firstTokenInLine) { - current = TypeScript.previousToken(current); - if (current === firstTokenInLine) { - leadingTextInReverse.push(current.trailingTrivia().fullText()); - leadingTextInReverse.push(current.text()); - } - else { - leadingTextInReverse.push(current.fullText()); + return undefined; + function createItem(node, name, scriptElementKind) { + return getNavigationBarItem(name, scriptElementKind, ts.getNodeModifiers(node), [getNodeSpan(node)]); } } - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - Indentation.columnForStartOfTokenAtPosition = columnForStartOfTokenAtPosition; - function columnForStartOfFirstTokenInLineContainingPosition(syntaxTree, position, options) { - var firstTokenInLine = TypeScript.Syntax.firstTokenInLineContainingPosition(syntaxTree, position); - var leadingTextInReverse = []; - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - Indentation.columnForStartOfFirstTokenInLineContainingPosition = columnForStartOfFirstTokenInLineContainingPosition; - function collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse) { - var leadingTrivia = firstTokenInLine.leadingTrivia(); - for (var i = leadingTrivia.count() - 1; i >= 0; i--) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 5 /* NewLineTrivia */) { - break; - } - if (trivia.kind() === 6 /* MultiLineCommentTrivia */) { - var lineSegments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - leadingTextInReverse.push(TypeScript.ArrayUtilities.last(lineSegments)); - if (lineSegments.length > 0) { - break; - } - } - leadingTextInReverse.push(trivia.fullText()); + function isEmpty(text) { + return !text || text.trim() === ""; } - } - function columnForLeadingTextInReverse(leadingTextInReverse, options) { - var column = 0; - for (var i = leadingTextInReverse.length - 1; i >= 0; i--) { - var text = leadingTextInReverse[i]; - column = columnForPositionInStringWorker(text, text.length, column, options); + function getNavigationBarItem(text, kind, kindModifiers, spans, childItems, indent) { + if (childItems === void 0) { childItems = []; } + if (indent === void 0) { indent = 0; } + if (isEmpty(text)) { + return undefined; + } + return { + text: text, + kind: kind, + kindModifiers: kindModifiers, + spans: spans, + childItems: childItems, + indent: indent, + bolded: false, + grayed: false + }; } - return column; - } - function columnForPositionInString(input, position, options) { - return columnForPositionInStringWorker(input, position, 0, options); - } - Indentation.columnForPositionInString = columnForPositionInString; - function columnForPositionInStringWorker(input, position, startColumn, options) { - var column = startColumn; - var spacesPerTab = options.spacesPerTab; - for (var j = 0; j < position; j++) { - var ch = input.charCodeAt(j); - if (ch === 9 /* tab */) { - column += spacesPerTab - column % spacesPerTab; + function createTopLevelItem(node) { + switch (node.kind) { + case 196 /* SourceFile */: + return createSourceFileItem(node); + case 187 /* ClassDeclaration */: + return createClassItem(node); + case 190 /* EnumDeclaration */: + return createEnumItem(node); + case 188 /* InterfaceDeclaration */: + return createIterfaceItem(node); + case 191 /* ModuleDeclaration */: + return createModuleItem(node); + case 185 /* FunctionDeclaration */: + return createFunctionItem(node); } - else { - column++; - } - } - return column; - } - function indentationString(column, options) { - var numberOfTabs = 0; - var numberOfSpaces = Math.max(0, column); - if (options.useTabs) { - numberOfTabs = Math.floor(column / options.spacesPerTab); - numberOfSpaces -= numberOfTabs * options.spacesPerTab; - } - return TypeScript.StringUtilities.repeat('\t', numberOfTabs) + TypeScript.StringUtilities.repeat(' ', numberOfSpaces); - } - Indentation.indentationString = indentationString; - function firstNonWhitespacePosition(value) { - for (var i = 0; i < value.length; i++) { - var ch = value.charCodeAt(i); - if (!TypeScript.CharacterInfo.isWhitespace(ch)) { - return i; - } - } - return value.length; - } - Indentation.firstNonWhitespacePosition = firstNonWhitespacePosition; - })(TypeScript.Indentation || (TypeScript.Indentation = {})); - var Indentation = TypeScript.Indentation; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var TextSnapshot = (function () { - function TextSnapshot(snapshot) { - this.snapshot = snapshot; - this.lines = []; - } - TextSnapshot.prototype.getLength = function () { - return this.snapshot.length(); - }; - TextSnapshot.prototype.getText = function (span) { - return this.snapshot.substr(span.start(), span.length()); - }; - TextSnapshot.prototype.getLineNumberFromPosition = function (position) { - return this.snapshot.lineMap().getLineNumberFromPosition(position); - }; - TextSnapshot.prototype.getLineFromPosition = function (position) { - var lineNumber = this.getLineNumberFromPosition(position); - return this.getLineFromLineNumber(lineNumber); - }; - TextSnapshot.prototype.getLineFromLineNumber = function (lineNumber) { - var line = this.lines[lineNumber]; - if (line === undefined) { - line = this.getLineFromLineNumberWorker(lineNumber); - this.lines[lineNumber] = line; + return undefined; + function getModuleName(moduleDeclaration) { + if (moduleDeclaration.name.kind === 7 /* StringLiteral */) { + return getTextOfNode(moduleDeclaration.name); } - return line; - }; - TextSnapshot.prototype.getLineFromLineNumberWorker = function (lineNumber) { - var lineMap = this.snapshot.lineMap().lineStarts(); - var lineMapIndex = lineNumber; - if (lineMapIndex < 0 || lineMapIndex >= lineMap.length) - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Invalid_line_number_0, [lineMapIndex])); - var start = lineMap[lineMapIndex]; - var end; - var endIncludingLineBreak; - var lineBreak = ""; - if (lineMapIndex == lineMap.length) { - end = endIncludingLineBreak = this.snapshot.length(); - } - else { - endIncludingLineBreak = (lineMapIndex >= lineMap.length - 1 ? this.snapshot.length() : lineMap[lineMapIndex + 1]); - for (var p = endIncludingLineBreak - 1; p >= start; p--) { - var c = this.snapshot.substr(p, 1); - if (c != "\r" && c != "\n") { - break; - } - } - end = p + 1; - lineBreak = this.snapshot.substr(end, endIncludingLineBreak - end); - } - var result = new Formatting.TextSnapshotLine(this, lineNumber, start, end, lineBreak); - return result; - }; - return TextSnapshot; - })(); - Formatting.TextSnapshot = TextSnapshot; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var TextSnapshotLine = (function () { - function TextSnapshotLine(_snapshot, _lineNumber, _start, _end, _lineBreak) { - this._snapshot = _snapshot; - this._lineNumber = _lineNumber; - this._start = _start; - this._end = _end; - this._lineBreak = _lineBreak; - } - TextSnapshotLine.prototype.snapshot = function () { - return this._snapshot; - }; - TextSnapshotLine.prototype.start = function () { - return new Formatting.SnapshotPoint(this._snapshot, this._start); - }; - TextSnapshotLine.prototype.startPosition = function () { - return this._start; - }; - TextSnapshotLine.prototype.end = function () { - return new Formatting.SnapshotPoint(this._snapshot, this._end); - }; - TextSnapshotLine.prototype.endPosition = function () { - return this._end; - }; - TextSnapshotLine.prototype.endIncludingLineBreak = function () { - return new Formatting.SnapshotPoint(this._snapshot, this._end + this._lineBreak.length); - }; - TextSnapshotLine.prototype.endIncludingLineBreakPosition = function () { - return this._end + this._lineBreak.length; - }; - TextSnapshotLine.prototype.length = function () { - return this._end - this._start; - }; - TextSnapshotLine.prototype.lineNumber = function () { - return this._lineNumber; - }; - TextSnapshotLine.prototype.getText = function () { - return this._snapshot.getText(TypeScript.TextSpan.fromBounds(this._start, this._end)); - }; - return TextSnapshotLine; - })(); - Formatting.TextSnapshotLine = TextSnapshotLine; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var SnapshotPoint = (function () { - function SnapshotPoint(snapshot, position) { - this.snapshot = snapshot; - this.position = position; - } - SnapshotPoint.prototype.getContainingLine = function () { - return this.snapshot.getLineFromPosition(this.position); - }; - SnapshotPoint.prototype.add = function (offset) { - return new SnapshotPoint(this.snapshot, this.position + offset); - }; - return SnapshotPoint; - })(); - Formatting.SnapshotPoint = SnapshotPoint; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var FormattingContext = (function () { - function FormattingContext(snapshot, formattingRequestKind) { - this.snapshot = snapshot; - this.formattingRequestKind = formattingRequestKind; - this.currentTokenSpan = null; - this.nextTokenSpan = null; - this.contextNode = null; - this.currentTokenParent = null; - this.nextTokenParent = null; - this.contextNodeAllOnSameLine = null; - this.nextNodeAllOnSameLine = null; - this.tokensAreOnSameLine = null; - this.contextNodeBlockIsOnOneLine = null; - this.nextNodeBlockIsOnOneLine = null; - TypeScript.Debug.assert(this.snapshot != null, "snapshot is null"); - } - FormattingContext.prototype.updateContext = function (currentTokenSpan, currentTokenParent, nextTokenSpan, nextTokenParent, commonParent) { - TypeScript.Debug.assert(currentTokenSpan != null, "currentTokenSpan is null"); - TypeScript.Debug.assert(currentTokenParent != null, "currentTokenParent is null"); - TypeScript.Debug.assert(nextTokenSpan != null, "nextTokenSpan is null"); - TypeScript.Debug.assert(nextTokenParent != null, "nextTokenParent is null"); - TypeScript.Debug.assert(commonParent != null, "commonParent is null"); - this.currentTokenSpan = currentTokenSpan; - this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextTokenSpan; - this.nextTokenParent = nextTokenParent; - this.contextNode = commonParent; - this.contextNodeAllOnSameLine = null; - this.nextNodeAllOnSameLine = null; - this.tokensAreOnSameLine = null; - this.contextNodeBlockIsOnOneLine = null; - this.nextNodeBlockIsOnOneLine = null; - }; - FormattingContext.prototype.ContextNodeAllOnSameLine = function () { - if (this.contextNodeAllOnSameLine === null) { - this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); - } - return this.contextNodeAllOnSameLine; - }; - FormattingContext.prototype.NextNodeAllOnSameLine = function () { - if (this.nextNodeAllOnSameLine === null) { - this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); - } - return this.nextNodeAllOnSameLine; - }; - FormattingContext.prototype.TokensAreOnSameLine = function () { - if (this.tokensAreOnSameLine === null) { - var startLine = this.snapshot.getLineNumberFromPosition(this.currentTokenSpan.start()); - var endLine = this.snapshot.getLineNumberFromPosition(this.nextTokenSpan.start()); - this.tokensAreOnSameLine = (startLine == endLine); - } - return this.tokensAreOnSameLine; - }; - FormattingContext.prototype.ContextNodeBlockIsOnOneLine = function () { - if (this.contextNodeBlockIsOnOneLine === null) { - this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); - } - return this.contextNodeBlockIsOnOneLine; - }; - FormattingContext.prototype.NextNodeBlockIsOnOneLine = function () { - if (this.nextNodeBlockIsOnOneLine === null) { - this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); - } - return this.nextNodeBlockIsOnOneLine; - }; - FormattingContext.prototype.NodeIsOnOneLine = function (node) { - var startLine = this.snapshot.getLineNumberFromPosition(node.start()); - var endLine = this.snapshot.getLineNumberFromPosition(node.end()); - return startLine == endLine; - }; - FormattingContext.prototype.BlockIsOnOneLine = function (node) { - var block = node.node(); - return this.snapshot.getLineNumberFromPosition(TypeScript.end(block.openBraceToken)) === this.snapshot.getLineNumberFromPosition(TypeScript.start(block.closeBraceToken)); - }; - return FormattingContext; - })(); - Formatting.FormattingContext = FormattingContext; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var FormattingManager = (function () { - function FormattingManager(syntaxTree, snapshot, rulesProvider, editorOptions) { - this.syntaxTree = syntaxTree; - this.snapshot = snapshot; - this.rulesProvider = rulesProvider; - this.options = new TypeScript.FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter); - } - FormattingManager.prototype.formatSelection = function (minChar, limChar) { - var span = TypeScript.TextSpan.fromBounds(minChar, limChar); - return this.formatSpan(span, 1 /* FormatSelection */); - }; - FormattingManager.prototype.formatDocument = function () { - var span = TypeScript.TextSpan.fromBounds(0, this.snapshot.getLength()); - return this.formatSpan(span, 0 /* FormatDocument */); - }; - FormattingManager.prototype.formatOnSemicolon = function (caretPosition) { - var sourceUnit = this.syntaxTree.sourceUnit(); - var semicolonPositionedToken = TypeScript.findToken(sourceUnit, caretPosition - 1); - if (semicolonPositionedToken.kind() === 78 /* SemicolonToken */) { - var current = semicolonPositionedToken; - while (current.parent !== null && TypeScript.end(current.parent) === TypeScript.end(semicolonPositionedToken) && current.parent.kind() !== 1 /* List */) { - current = current.parent; - } - var span = new TypeScript.TextSpan(TypeScript.fullStart(current), TypeScript.fullWidth(current)); - return this.formatSpan(span, 3 /* FormatOnSemicolon */); - } - return []; - }; - FormattingManager.prototype.formatOnClosingCurlyBrace = function (caretPosition) { - var sourceUnit = this.syntaxTree.sourceUnit(); - var closeBracePositionedToken = TypeScript.findToken(sourceUnit, caretPosition - 1); - if (closeBracePositionedToken.kind() === 71 /* CloseBraceToken */) { - var current = closeBracePositionedToken; - while (current.parent !== null && TypeScript.end(current.parent) === TypeScript.end(closeBracePositionedToken) && current.parent.kind() !== 1 /* List */) { - current = current.parent; - } - var span = new TypeScript.TextSpan(TypeScript.fullStart(current), TypeScript.fullWidth(current)); - return this.formatSpan(span, 4 /* FormatOnClosingCurlyBrace */); - } - return []; - }; - FormattingManager.prototype.formatOnEnter = function (caretPosition) { - var lineNumber = this.snapshot.getLineNumberFromPosition(caretPosition); - if (lineNumber > 0) { - var prevLine = this.snapshot.getLineFromLineNumber(lineNumber - 1); - var currentLine = this.snapshot.getLineFromLineNumber(lineNumber); - var span = TypeScript.TextSpan.fromBounds(prevLine.startPosition(), currentLine.endPosition()); - return this.formatSpan(span, 2 /* FormatOnEnter */); - } - return []; - }; - FormattingManager.prototype.formatSpan = function (span, formattingRequestKind) { - var startLine = this.snapshot.getLineFromPosition(span.start()); - span = TypeScript.TextSpan.fromBounds(startLine.startPosition(), span.end()); var result = []; - var formattingEdits = Formatting.Formatter.getEdits(span, this.syntaxTree.sourceUnit(), this.options, true, this.snapshot, this.rulesProvider, formattingRequestKind); - formattingEdits.forEach(function (item) { - var edit = new ts.TextChange(new TypeScript.TextSpan(item.position, item.length), item.replaceWith); - result.push(edit); - }); - return result; - }; - return FormattingManager; - })(); - Formatting.FormattingManager = FormattingManager; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - (function (FormattingRequestKind) { - FormattingRequestKind[FormattingRequestKind["FormatDocument"] = 0] = "FormatDocument"; - FormattingRequestKind[FormattingRequestKind["FormatSelection"] = 1] = "FormatSelection"; - FormattingRequestKind[FormattingRequestKind["FormatOnEnter"] = 2] = "FormatOnEnter"; - FormattingRequestKind[FormattingRequestKind["FormatOnSemicolon"] = 3] = "FormatOnSemicolon"; - FormattingRequestKind[FormattingRequestKind["FormatOnClosingCurlyBrace"] = 4] = "FormatOnClosingCurlyBrace"; - FormattingRequestKind[FormattingRequestKind["FormatOnPaste"] = 5] = "FormatOnPaste"; - })(Formatting.FormattingRequestKind || (Formatting.FormattingRequestKind = {})); - var FormattingRequestKind = Formatting.FormattingRequestKind; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var Rule = (function () { - function Rule(Descriptor, Operation, Flag) { - if (Flag === void 0) { Flag = 0 /* None */; } - this.Descriptor = Descriptor; - this.Operation = Operation; - this.Flag = Flag; + result.push(moduleDeclaration.name.text); + while (moduleDeclaration.body && moduleDeclaration.body.kind === 191 /* ModuleDeclaration */) { + moduleDeclaration = moduleDeclaration.body; + result.push(moduleDeclaration.name.text); + } + return result.join("."); } - Rule.prototype.toString = function () { - return "[desc=" + this.Descriptor + "," + "operation=" + this.Operation + "," + "flag=" + this.Flag + "]"; - }; - return Rule; - })(); - Formatting.Rule = Rule; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - (function (RuleAction) { - RuleAction[RuleAction["Ignore"] = 0] = "Ignore"; - RuleAction[RuleAction["Space"] = 1] = "Space"; - RuleAction[RuleAction["NewLine"] = 2] = "NewLine"; - RuleAction[RuleAction["Delete"] = 3] = "Delete"; - })(Formatting.RuleAction || (Formatting.RuleAction = {})); - var RuleAction = Formatting.RuleAction; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var RuleDescriptor = (function () { - function RuleDescriptor(LeftTokenRange, RightTokenRange) { - this.LeftTokenRange = LeftTokenRange; - this.RightTokenRange = RightTokenRange; + function createModuleItem(node) { + var moduleName = getModuleName(node); + var childItems = getItemsWorker(getChildNodes(getInnermostModule(node).body.statements), createChildItem); + return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } - RuleDescriptor.prototype.toString = function () { - return "[leftRange=" + this.LeftTokenRange + "," + "rightRange=" + this.RightTokenRange + "]"; - }; - RuleDescriptor.create1 = function (left, right) { - return RuleDescriptor.create4(Formatting.Shared.TokenRange.FromToken(left), Formatting.Shared.TokenRange.FromToken(right)); - }; - RuleDescriptor.create2 = function (left, right) { - return RuleDescriptor.create4(left, Formatting.Shared.TokenRange.FromToken(right)); - }; - RuleDescriptor.create3 = function (left, right) { - return RuleDescriptor.create4(Formatting.Shared.TokenRange.FromToken(left), right); - }; - RuleDescriptor.create4 = function (left, right) { - return new RuleDescriptor(left, right); - }; - return RuleDescriptor; - })(); - Formatting.RuleDescriptor = RuleDescriptor; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - (function (RuleFlags) { - RuleFlags[RuleFlags["None"] = 0] = "None"; - RuleFlags[RuleFlags["CanDeleteNewLines"] = 1] = "CanDeleteNewLines"; - })(Formatting.RuleFlags || (Formatting.RuleFlags = {})); - var RuleFlags = Formatting.RuleFlags; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var RuleOperation = (function () { - function RuleOperation() { - this.Context = null; - this.Action = null; + function createFunctionItem(node) { + if (node.name && node.body && node.body.kind === 186 /* FunctionBlock */) { + var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + } + return undefined; } - RuleOperation.prototype.toString = function () { - return "[context=" + this.Context + "," + "action=" + this.Action + "]"; - }; - RuleOperation.create1 = function (action) { - return RuleOperation.create2(Formatting.RuleOperationContext.Any, action); - }; - RuleOperation.create2 = function (context, action) { - var result = new RuleOperation(); - result.Context = context; - result.Action = action; - return result; - }; - return RuleOperation; - })(); - Formatting.RuleOperation = RuleOperation; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var RuleOperationContext = (function () { - function RuleOperationContext() { - var funcs = []; - for (var _i = 0; _i < arguments.length; _i++) { - funcs[_i - 0] = arguments[_i]; + function createSourceFileItem(node) { + var childItems = getItemsWorker(getChildNodes(node.statements), createChildItem); + if (childItems === undefined || childItems.length === 0) { + return undefined; } - this.customContextChecks = funcs; + hasGlobalNode = true; + var rootName = ts.isExternalModule(node) ? "\"" + ts.escapeString(ts.getBaseFilename(ts.removeFileExtension(ts.normalizePath(node.filename)))) + "\"" : ""; + return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [getNodeSpan(node)], childItems); } - RuleOperationContext.prototype.IsAny = function () { - return this == RuleOperationContext.Any; - }; - RuleOperationContext.prototype.InContext = function (context) { - if (this.IsAny()) { - return true; - } - for (var i = 0, len = this.customContextChecks.length; i < len; i++) { - if (!this.customContextChecks[i](context)) { - return false; - } - } - return true; - }; - RuleOperationContext.Any = new RuleOperationContext(); - return RuleOperationContext; - })(); - Formatting.RuleOperationContext = RuleOperationContext; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var Rules = (function () { - function Rules() { - this.IgnoreBeforeComment = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.Comments), Formatting.RuleOperation.create1(0 /* Ignore */)); - this.IgnoreAfterLineComment = new Formatting.Rule(Formatting.RuleDescriptor.create3(7 /* SingleLineCommentTrivia */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create1(0 /* Ignore */)); - this.NoSpaceBeforeSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 78 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeColon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 106 /* ColonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceBeforeQMark = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 105 /* QuestionToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.SpaceAfterColon = new Formatting.Rule(Formatting.RuleDescriptor.create3(106 /* ColonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 1 /* Space */)); - this.SpaceAfterQMark = new Formatting.Rule(Formatting.RuleDescriptor.create3(105 /* QuestionToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(71 /* CloseBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 1 /* Space */)); - this.SpaceBetweenCloseBraceAndElse = new Formatting.Rule(Formatting.RuleDescriptor.create1(71 /* CloseBraceToken */, 23 /* ElseKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBetweenCloseBraceAndWhile = new Formatting.Rule(Formatting.RuleDescriptor.create1(71 /* CloseBraceToken */, 42 /* WhileKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(71 /* CloseBraceToken */, Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 75 /* CloseBracketToken */, 79 /* CommaToken */, 78 /* SemicolonToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeDot = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 76 /* DotToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterDot = new Formatting.Rule(Formatting.RuleDescriptor.create3(76 /* DotToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 74 /* OpenBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(74 /* OpenBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 75 /* CloseBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(75 /* CloseBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.FunctionOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.AnyIncludingMultilineComments; - this.SpaceBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.TypeScriptOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([11 /* IdentifierName */, 6 /* MultiLineCommentTrivia */]); - this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.ControlOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 6 /* MultiLineCommentTrivia */, 22 /* DoKeyword */, 38 /* TryKeyword */, 25 /* FinallyKeyword */, 23 /* ElseKeyword */]); - this.SpaceBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.SpaceAfterOpenBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(70 /* OpenBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); - this.SpaceBeforeCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); - this.NoSpaceBetweenEmptyBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(70 /* OpenBraceToken */, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 3 /* Delete */)); - this.NewLineAfterOpenBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create3(70 /* OpenBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); - this.NewLineBeforeCloseBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.AnyIncludingMultilineComments, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); - this.NoSpaceAfterUnaryPrefixOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.UnaryPrefixOperators, Formatting.Shared.TokenRange.UnaryPrefixExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceAfterUnaryPreincrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(93 /* PlusPlusToken */, Formatting.Shared.TokenRange.UnaryPreincrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterUnaryPredecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(94 /* MinusMinusToken */, Formatting.Shared.TokenRange.UnaryPredecrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeUnaryPostincrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostincrementExpressions, 93 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeUnaryPostdecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 94 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterPostincrementWhenFollowedByAdd = new Formatting.Rule(Formatting.RuleDescriptor.create1(93 /* PlusPlusToken */, 89 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterAddWhenFollowedByUnaryPlus = new Formatting.Rule(Formatting.RuleDescriptor.create1(89 /* PlusToken */, 89 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterAddWhenFollowedByPreincrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(89 /* PlusToken */, 93 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterPostdecrementWhenFollowedBySubtract = new Formatting.Rule(Formatting.RuleDescriptor.create1(94 /* MinusMinusToken */, 90 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new Formatting.Rule(Formatting.RuleDescriptor.create1(90 /* MinusToken */, 90 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByPredecrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(90 /* MinusToken */, 94 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceBeforeComma = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 79 /* CommaToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterCertainKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([40 /* VarKeyword */, 36 /* ThrowKeyword */, 31 /* NewKeyword */, 21 /* DeleteKeyword */, 33 /* ReturnKeyword */, 39 /* TypeOfKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncCall = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext), 3 /* Delete */)); - this.SpaceAfterFunctionInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create3(27 /* FunctionKeyword */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 3 /* Delete */)); - this.SpaceAfterVoidOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(41 /* VoidKeyword */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 1 /* Space */)); - this.NoSpaceBetweenReturnAndSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create1(33 /* ReturnKeyword */, 78 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceBetweenStatements = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 22 /* DoKeyword */, 23 /* ElseKeyword */, 16 /* CaseKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 1 /* Space */)); - this.SpaceAfterTryFinally = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([38 /* TryKeyword */, 25 /* FinallyKeyword */]), 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterGetSetInMember = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([64 /* GetKeyword */, 68 /* SetKeyword */]), 11 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.SpaceBeforeBinaryKeywordOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryKeywordOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterBinaryKeywordOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryKeywordOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceAfterConstructor = new Formatting.Rule(Formatting.RuleDescriptor.create1(62 /* ConstructorKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterModuleImport = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([65 /* ModuleKeyword */, 66 /* RequireKeyword */]), 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([44 /* ClassKeyword */, 63 /* DeclareKeyword */, 46 /* EnumKeyword */, 47 /* ExportKeyword */, 48 /* ExtendsKeyword */, 64 /* GetKeyword */, 51 /* ImplementsKeyword */, 49 /* ImportKeyword */, 52 /* InterfaceKeyword */, 65 /* ModuleKeyword */, 55 /* PrivateKeyword */, 57 /* PublicKeyword */, 68 /* SetKeyword */, 58 /* StaticKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBeforeCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.FromTokens([48 /* ExtendsKeyword */, 51 /* ImplementsKeyword */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterModuleName = new Formatting.Rule(Formatting.RuleDescriptor.create1(14 /* StringLiteral */, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsModuleDeclContext), 1 /* Space */)); - this.SpaceAfterArrow = new Formatting.Rule(Formatting.RuleDescriptor.create3(85 /* EqualsGreaterThanToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterEllipsis = new Formatting.Rule(Formatting.RuleDescriptor.create1(77 /* DotDotDotToken */, 11 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOptionalParameters = new Formatting.Rule(Formatting.RuleDescriptor.create3(105 /* QuestionToken */, Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 79 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceBeforeOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.TypeNames, 80 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBetweenCloseParenAndAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create1(73 /* CloseParenToken */, 80 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceAfterOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(80 /* LessThanToken */, Formatting.Shared.TokenRange.TypeNames), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 81 /* GreaterThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceAfterCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(81 /* GreaterThanToken */, Formatting.Shared.TokenRange.FromTokens([72 /* OpenParenToken */, 74 /* OpenBracketToken */, 81 /* GreaterThanToken */, 79 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(70 /* OpenBraceToken */, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 3 /* Delete */)); - this.HighPriorityCommonRules = [ - this.IgnoreBeforeComment, - this.IgnoreAfterLineComment, - this.NoSpaceBeforeColon, - this.SpaceAfterColon, - this.NoSpaceBeforeQMark, - this.SpaceAfterQMark, - this.NoSpaceBeforeDot, - this.NoSpaceAfterDot, - this.NoSpaceAfterUnaryPrefixOperator, - this.NoSpaceAfterUnaryPreincrementOperator, - this.NoSpaceAfterUnaryPredecrementOperator, - this.NoSpaceBeforeUnaryPostincrementOperator, - this.NoSpaceBeforeUnaryPostdecrementOperator, - this.SpaceAfterPostincrementWhenFollowedByAdd, - this.SpaceAfterAddWhenFollowedByUnaryPlus, - this.SpaceAfterAddWhenFollowedByPreincrement, - this.SpaceAfterPostdecrementWhenFollowedBySubtract, - this.SpaceAfterSubtractWhenFollowedByUnaryMinus, - this.SpaceAfterSubtractWhenFollowedByPredecrement, - this.NoSpaceAfterCloseBrace, - this.SpaceAfterOpenBrace, - this.SpaceBeforeCloseBrace, - this.NewLineBeforeCloseBraceInBlockContext, - this.SpaceAfterCloseBrace, - this.SpaceBetweenCloseBraceAndElse, - this.SpaceBetweenCloseBraceAndWhile, - this.NoSpaceBetweenEmptyBraceBrackets, - this.SpaceAfterFunctionInFuncDecl, - this.NewLineAfterOpenBraceInBlockContext, - this.SpaceAfterGetSetInMember, - this.NoSpaceBetweenReturnAndSemicolon, - this.SpaceAfterCertainKeywords, - this.NoSpaceBeforeOpenParenInFuncCall, - this.SpaceBeforeBinaryKeywordOperator, - this.SpaceAfterBinaryKeywordOperator, - this.SpaceAfterVoidOperator, - this.NoSpaceAfterConstructor, - this.NoSpaceAfterModuleImport, - this.SpaceAfterCertainTypeScriptKeywords, - this.SpaceBeforeCertainTypeScriptKeywords, - this.SpaceAfterModuleName, - this.SpaceAfterArrow, - this.NoSpaceAfterEllipsis, - this.NoSpaceAfterOptionalParameters, - this.NoSpaceBetweenEmptyInterfaceBraceBrackets, - this.NoSpaceBeforeOpenAngularBracket, - this.NoSpaceBetweenCloseParenAndAngularBracket, - this.NoSpaceAfterOpenAngularBracket, - this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket - ]; - this.LowPriorityCommonRules = [ - this.NoSpaceBeforeSemicolon, - this.SpaceBeforeOpenBraceInControl, - this.SpaceBeforeOpenBraceInFunction, - this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, - this.NoSpaceBeforeComma, - this.NoSpaceBeforeOpenBracket, - this.NoSpaceAfterOpenBracket, - this.NoSpaceBeforeCloseBracket, - this.NoSpaceAfterCloseBracket, - this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, - this.SpaceBetweenStatements, - this.SpaceAfterTryFinally - ]; - this.SpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(79 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(79 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceBeforeBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceBeforeBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 3 /* Delete */)); - this.NoSpaceAfterBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 3 /* Delete */)); - this.SpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 1 /* Space */)); - this.NoSpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 3 /* Delete */)); - this.NewLineBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.NewLineBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.SpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 1 /* Space */)); - this.NoSpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 3 /* Delete */)); - this.SpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* OpenParenToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBeforeCloseParen = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceBetweenParens = new Formatting.Rule(Formatting.RuleDescriptor.create1(72 /* OpenParenToken */, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* OpenParenToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseParen = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(27 /* FunctionKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.NoSpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(27 /* FunctionKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 3 /* Delete */)); - } - Rules.prototype.getRuleName = function (rule) { - var o = this; - for (var name in o) { - if (o[name] === rule) { - return name; - } - } - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Unknown_rule, null)); - }; - Rules.IsForContext = function (context) { - return context.contextNode.kind() === 154 /* ForStatement */; - }; - Rules.IsNotForContext = function (context) { - return !Rules.IsForContext(context); - }; - Rules.IsBinaryOpContext = function (context) { - switch (context.contextNode.kind()) { - case 174 /* AssignmentExpression */: - case 175 /* AddAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - case 186 /* ConditionalExpression */: - case 187 /* LogicalOrExpression */: - case 188 /* LogicalAndExpression */: - case 189 /* BitwiseOrExpression */: - case 190 /* BitwiseExclusiveOrExpression */: - case 191 /* BitwiseAndExpression */: - case 192 /* EqualsWithTypeConversionExpression */: - case 193 /* NotEqualsWithTypeConversionExpression */: - case 194 /* EqualsExpression */: - case 195 /* NotEqualsExpression */: - case 196 /* LessThanExpression */: - case 197 /* GreaterThanExpression */: - case 198 /* LessThanOrEqualExpression */: - case 199 /* GreaterThanOrEqualExpression */: - case 200 /* InstanceOfExpression */: - case 201 /* InExpression */: - case 202 /* LeftShiftExpression */: - case 203 /* SignedRightShiftExpression */: - case 204 /* UnsignedRightShiftExpression */: - case 205 /* MultiplyExpression */: - case 206 /* DivideExpression */: - case 207 /* ModuloExpression */: - case 208 /* AddExpression */: - case 209 /* SubtractExpression */: - return true; - case 133 /* ImportDeclaration */: - case 225 /* VariableDeclarator */: - case 232 /* EqualsValueClause */: - return context.currentTokenSpan.kind === 107 /* EqualsToken */ || context.nextTokenSpan.kind === 107 /* EqualsToken */; - case 155 /* ForInStatement */: - return context.currentTokenSpan.kind === 29 /* InKeyword */ || context.nextTokenSpan.kind === 29 /* InKeyword */; - } - return false; - }; - Rules.IsNotBinaryOpContext = function (context) { - return !Rules.IsBinaryOpContext(context); - }; - Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { - return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); - }; - Rules.IsBeforeMultilineBlockContext = function (context) { - return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); - }; - Rules.IsMultilineBlockContext = function (context) { - return Rules.IsBlockContext(context) && !(context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); - }; - Rules.IsSingleLineBlockContext = function (context) { - return Rules.IsBlockContext(context) && (context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); - }; - Rules.IsBlockContext = function (context) { - return Rules.NodeIsBlockContext(context.contextNode); - }; - Rules.IsBeforeBlockContext = function (context) { - return Rules.NodeIsBlockContext(context.nextTokenParent); - }; - Rules.NodeIsBlockContext = function (node) { - if (Rules.NodeIsTypeScriptDeclWithBlockContext(node)) { - return true; - } - switch (node.kind()) { - case 146 /* Block */: - case 151 /* SwitchStatement */: - case 215 /* ObjectLiteralExpression */: - return true; - } - return false; - }; - Rules.IsFunctionDeclContext = function (context) { - switch (context.contextNode.kind()) { - case 129 /* FunctionDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 145 /* MethodSignature */: - case 142 /* CallSignature */: - case 222 /* FunctionExpression */: - case 137 /* ConstructorDeclaration */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 128 /* InterfaceDeclaration */: - return true; - } - return false; - }; - Rules.IsTypeScriptDeclWithBlockContext = function (context) { - return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); - }; - Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { - switch (node.kind()) { - case 131 /* ClassDeclaration */: - case 132 /* EnumDeclaration */: - case 122 /* ObjectType */: - case 130 /* ModuleDeclaration */: - return true; - } - return false; - }; - Rules.IsAfterCodeBlockContext = function (context) { - switch (context.currentTokenParent.kind()) { - case 131 /* ClassDeclaration */: - case 130 /* ModuleDeclaration */: - case 132 /* EnumDeclaration */: - case 146 /* Block */: - case 151 /* SwitchStatement */: - return true; - } - return false; - }; - Rules.IsControlDeclContext = function (context) { - switch (context.contextNode.kind()) { - case 147 /* IfStatement */: - case 151 /* SwitchStatement */: - case 154 /* ForStatement */: - case 155 /* ForInStatement */: - case 158 /* WhileStatement */: - case 159 /* TryStatement */: - case 161 /* DoStatement */: - case 163 /* WithStatement */: - case 235 /* ElseClause */: - case 236 /* CatchClause */: - case 237 /* FinallyClause */: - return true; - default: - return false; - } - }; - Rules.IsObjectContext = function (context) { - return context.contextNode.kind() === 215 /* ObjectLiteralExpression */; - }; - Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind() === 213 /* InvocationExpression */; - }; - Rules.IsNewContext = function (context) { - return context.contextNode.kind() === 216 /* ObjectCreationExpression */; - }; - Rules.IsFunctionCallOrNewContext = function (context) { - return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); - }; - Rules.IsSameLineTokenContext = function (context) { - return context.TokensAreOnSameLine(); - }; - Rules.IsNotFormatOnEnter = function (context) { - return context.formattingRequestKind != 2 /* FormatOnEnter */; - }; - Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind() === 130 /* ModuleDeclaration */; - }; - Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind() === 122 /* ObjectType */ && context.contextNode.parent().kind() !== 128 /* InterfaceDeclaration */; - }; - Rules.IsTypeArgumentOrParameter = function (tokenKind, parentKind) { - return ((tokenKind === 80 /* LessThanToken */ || tokenKind === 81 /* GreaterThanToken */) && (parentKind === 229 /* TypeParameterList */ || parentKind === 228 /* TypeArgumentList */)); - }; - Rules.IsTypeArgumentOrParameterContext = function (context) { - return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan.kind, context.currentTokenParent.kind()) || Rules.IsTypeArgumentOrParameter(context.nextTokenSpan.kind, context.nextTokenParent.kind()); - }; - Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 41 /* VoidKeyword */ && context.currentTokenParent.kind() === 172 /* VoidExpression */; - }; - return Rules; - })(); - Formatting.Rules = Rules; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var RulesMap = (function () { - function RulesMap() { - this.map = []; - this.mapRowLength = 0; - } - RulesMap.create = function (rules) { - var result = new RulesMap(); - result.Initialize(rules); - return result; - }; - RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = TypeScript.SyntaxKind.LastToken + 1; - this.map = new Array(this.mapRowLength * this.mapRowLength); - var rulesBucketConstructionStateList = new Array(this.map.length); - this.FillRules(rules, rulesBucketConstructionStateList); - return this.map; - }; - RulesMap.prototype.FillRules = function (rules, rulesBucketConstructionStateList) { - var _this = this; - rules.forEach(function (rule) { - _this.FillRule(rule, rulesBucketConstructionStateList); - }); - }; - RulesMap.prototype.GetRuleBucketIndex = function (row, column) { - var rulesBucketIndex = (row * this.mapRowLength) + column; - return rulesBucketIndex; - }; - RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { - var _this = this; - var specificRule = rule.Descriptor.LeftTokenRange != Formatting.Shared.TokenRange.Any && rule.Descriptor.RightTokenRange != Formatting.Shared.TokenRange.Any; - rule.Descriptor.LeftTokenRange.GetTokens().forEach(function (left) { - rule.Descriptor.RightTokenRange.GetTokens().forEach(function (right) { - var rulesBucketIndex = _this.GetRuleBucketIndex(left, right); - var rulesBucket = _this.map[rulesBucketIndex]; - if (rulesBucket == undefined) { - rulesBucket = _this.map[rulesBucketIndex] = new RulesBucket(); - } - rulesBucket.AddRule(rule, specificRule, rulesBucketConstructionStateList, rulesBucketIndex); + function createClassItem(node) { + var childItems; + if (node.members) { + var constructor = ts.forEach(node.members, function (member) { + return member.kind === 126 /* Constructor */ && member; }); - }); - }; - RulesMap.prototype.GetRule = function (context) { - var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); - var bucket = this.map[bucketIndex]; - if (bucket != null) { - for (var i = 0, len = bucket.Rules().length; i < len; i++) { - var rule = bucket.Rules()[i]; - if (rule.Operation.Context.InContext(context)) - return rule; - } + var nodes = constructor ? node.members.concat(constructor.parameters) : node.members; + var childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - return null; - }; - return RulesMap; - })(); - Formatting.RulesMap = RulesMap; - var MaskBitSize = 5; - var Mask = 0x1f; - (function (RulesPosition) { - RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; - RulesPosition[RulesPosition["IgnoreRulesAny"] = MaskBitSize * 1] = "IgnoreRulesAny"; - RulesPosition[RulesPosition["ContextRulesSpecific"] = MaskBitSize * 2] = "ContextRulesSpecific"; - RulesPosition[RulesPosition["ContextRulesAny"] = MaskBitSize * 3] = "ContextRulesAny"; - RulesPosition[RulesPosition["NoContextRulesSpecific"] = MaskBitSize * 4] = "NoContextRulesSpecific"; - RulesPosition[RulesPosition["NoContextRulesAny"] = MaskBitSize * 5] = "NoContextRulesAny"; - })(Formatting.RulesPosition || (Formatting.RulesPosition = {})); - var RulesPosition = Formatting.RulesPosition; - var RulesBucketConstructionState = (function () { - function RulesBucketConstructionState() { - this.rulesInsertionIndexBitmap = 0; + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } - RulesBucketConstructionState.prototype.GetInsertionIndex = function (maskPosition) { - var index = 0; - var pos = 0; - var indexBitmap = this.rulesInsertionIndexBitmap; - while (pos <= maskPosition) { - index += (indexBitmap & Mask); - indexBitmap >>= MaskBitSize; - pos += MaskBitSize; - } - return index; - }; - RulesBucketConstructionState.prototype.IncreaseInsertionIndex = function (maskPosition) { - var value = (this.rulesInsertionIndexBitmap >> maskPosition) & Mask; - value++; - TypeScript.Debug.assert((value & Mask) == value, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); - var temp = this.rulesInsertionIndexBitmap & ~(Mask << maskPosition); - temp |= value << maskPosition; - this.rulesInsertionIndexBitmap = temp; - }; - return RulesBucketConstructionState; - })(); - Formatting.RulesBucketConstructionState = RulesBucketConstructionState; - var RulesBucket = (function () { - function RulesBucket() { - this.rules = []; + function createEnumItem(node) { + var childItems = getItemsWorker(sortNodes(node.members), createChildItem); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.enumElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } - RulesBucket.prototype.Rules = function () { - return this.rules; - }; - RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { - var position; - if (rule.Operation.Action == 0 /* Ignore */) { - position = specificTokens ? 0 /* IgnoreRulesSpecific */ : RulesPosition.IgnoreRulesAny; - } - else if (!rule.Operation.Context.IsAny()) { - position = specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny; - } - else { - position = specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; - } - var state = constructionState[rulesBucketIndex]; - if (state === undefined) { - state = constructionState[rulesBucketIndex] = new RulesBucketConstructionState(); - } - var index = state.GetInsertionIndex(position); - this.rules.splice(index, 0, rule); - state.IncreaseInsertionIndex(position); - }; - return RulesBucket; - })(); - Formatting.RulesBucket = RulesBucket; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var RulesProvider = (function () { - function RulesProvider(logger) { - this.logger = logger; - this.globalRules = new Formatting.Rules(); - } - RulesProvider.prototype.getRuleName = function (rule) { - return this.globalRules.getRuleName(rule); - }; - RulesProvider.prototype.getRuleByName = function (name) { - return this.globalRules[name]; - }; - RulesProvider.prototype.getRulesMap = function () { - return this.rulesMap; - }; - RulesProvider.prototype.ensureUpToDate = function (options) { - if (this.options == null || !ts.compareDataObjects(this.options, options)) { - var activeRules = this.createActiveRules(options); - var rulesMap = Formatting.RulesMap.create(activeRules); - this.activeRules = activeRules; - this.rulesMap = rulesMap; - this.options = ts.clone(options); - } - }; - RulesProvider.prototype.createActiveRules = function (options) { - var rules = this.globalRules.HighPriorityCommonRules.slice(0); - if (options.InsertSpaceAfterCommaDelimiter) { - rules.push(this.globalRules.SpaceAfterComma); - } - else { - rules.push(this.globalRules.NoSpaceAfterComma); - } - if (options.InsertSpaceAfterFunctionKeywordForAnonymousFunctions) { - rules.push(this.globalRules.SpaceAfterAnonymousFunctionKeyword); - } - else { - rules.push(this.globalRules.NoSpaceAfterAnonymousFunctionKeyword); - } - if (options.InsertSpaceAfterKeywordsInControlFlowStatements) { - rules.push(this.globalRules.SpaceAfterKeywordInControl); - } - else { - rules.push(this.globalRules.NoSpaceAfterKeywordInControl); - } - if (options.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis) { - rules.push(this.globalRules.SpaceAfterOpenParen); - rules.push(this.globalRules.SpaceBeforeCloseParen); - rules.push(this.globalRules.NoSpaceBetweenParens); - } - else { - rules.push(this.globalRules.NoSpaceAfterOpenParen); - rules.push(this.globalRules.NoSpaceBeforeCloseParen); - rules.push(this.globalRules.NoSpaceBetweenParens); - } - if (options.InsertSpaceAfterSemicolonInForStatements) { - rules.push(this.globalRules.SpaceAfterSemicolonInFor); - } - else { - rules.push(this.globalRules.NoSpaceAfterSemicolonInFor); - } - if (options.InsertSpaceBeforeAndAfterBinaryOperators) { - rules.push(this.globalRules.SpaceBeforeBinaryOperator); - rules.push(this.globalRules.SpaceAfterBinaryOperator); - } - else { - rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); - rules.push(this.globalRules.NoSpaceAfterBinaryOperator); - } - if (options.PlaceOpenBraceOnNewLineForControlBlocks) { - rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); - } - if (options.PlaceOpenBraceOnNewLineForFunctions) { - rules.push(this.globalRules.NewLineBeforeOpenBraceInFunction); - rules.push(this.globalRules.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock); - } - rules = rules.concat(this.globalRules.LowPriorityCommonRules); - return rules; - }; - return RulesProvider; - })(); - Formatting.RulesProvider = RulesProvider; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var TextEditInfo = (function () { - function TextEditInfo(position, length, replaceWith) { - this.position = position; - this.length = length; - this.replaceWith = replaceWith; - } - TextEditInfo.prototype.toString = function () { - return "[ position: " + this.position + ", length: " + this.length + ", replaceWith: '" + this.replaceWith + "' ]"; - }; - return TextEditInfo; - })(); - Formatting.TextEditInfo = TextEditInfo; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - (function (Shared) { - var TokenRangeAccess = (function () { - function TokenRangeAccess(from, to, except) { - this.tokens = []; - for (var token = from; token <= to; token++) { - if (except.indexOf(token) < 0) { - this.tokens.push(token); - } - } - } - TokenRangeAccess.prototype.GetTokens = function () { - return this.tokens; - }; - TokenRangeAccess.prototype.Contains = function (token) { - return this.tokens.indexOf(token) >= 0; - }; - TokenRangeAccess.prototype.toString = function () { - return "[tokenRangeStart=" + TypeScript.SyntaxKind[this.tokens[0]] + "," + "tokenRangeEnd=" + TypeScript.SyntaxKind[this.tokens[this.tokens.length - 1]] + "]"; - }; - return TokenRangeAccess; - })(); - Shared.TokenRangeAccess = TokenRangeAccess; - var TokenValuesAccess = (function () { - function TokenValuesAccess(tks) { - this.tokens = tks && tks.length ? tks : []; - } - TokenValuesAccess.prototype.GetTokens = function () { - return this.tokens; - }; - TokenValuesAccess.prototype.Contains = function (token) { - return this.tokens.indexOf(token) >= 0; - }; - return TokenValuesAccess; - })(); - Shared.TokenValuesAccess = TokenValuesAccess; - var TokenSingleValueAccess = (function () { - function TokenSingleValueAccess(token) { - this.token = token; - } - TokenSingleValueAccess.prototype.GetTokens = function () { - return [this.token]; - }; - TokenSingleValueAccess.prototype.Contains = function (tokenValue) { - return tokenValue == this.token; - }; - TokenSingleValueAccess.prototype.toString = function () { - return "[singleTokenKind=" + TypeScript.SyntaxKind[this.token] + "]"; - }; - return TokenSingleValueAccess; - })(); - Shared.TokenSingleValueAccess = TokenSingleValueAccess; - var TokenAllAccess = (function () { - function TokenAllAccess() { - } - TokenAllAccess.prototype.GetTokens = function () { - var result = []; - for (var token = TypeScript.SyntaxKind.FirstToken; token <= TypeScript.SyntaxKind.LastToken; token++) { - result.push(token); - } - return result; - }; - TokenAllAccess.prototype.Contains = function (tokenValue) { - return true; - }; - TokenAllAccess.prototype.toString = function () { - return "[allTokens]"; - }; - return TokenAllAccess; - })(); - Shared.TokenAllAccess = TokenAllAccess; - var TokenRange = (function () { - function TokenRange(tokenAccess) { - this.tokenAccess = tokenAccess; - } - TokenRange.FromToken = function (token) { - return new TokenRange(new TokenSingleValueAccess(token)); - }; - TokenRange.FromTokens = function (tokens) { - return new TokenRange(new TokenValuesAccess(tokens)); - }; - TokenRange.FromRange = function (f, to, except) { - if (except === void 0) { except = []; } - return new TokenRange(new TokenRangeAccess(f, to, except)); - }; - TokenRange.AllTokens = function () { - return new TokenRange(new TokenAllAccess()); - }; - TokenRange.prototype.GetTokens = function () { - return this.tokenAccess.GetTokens(); - }; - TokenRange.prototype.Contains = function (token) { - return this.tokenAccess.Contains(token); - }; - TokenRange.prototype.toString = function () { - return this.tokenAccess.toString(); - }; - TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([6 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(TypeScript.SyntaxKind.FirstKeyword, TypeScript.SyntaxKind.LastKeyword); - TokenRange.Operators = TokenRange.FromRange(78 /* SemicolonToken */, 119 /* SlashEqualsToken */); - TokenRange.BinaryOperators = TokenRange.FromRange(80 /* LessThanToken */, 119 /* SlashEqualsToken */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([29 /* InKeyword */, 30 /* InstanceOfKeyword */]); - TokenRange.ReservedKeywords = TokenRange.FromRange(TypeScript.SyntaxKind.FirstFutureReservedStrictKeyword, TypeScript.SyntaxKind.LastFutureReservedStrictKeyword); - TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([93 /* PlusPlusToken */, 94 /* MinusMinusToken */, 102 /* TildeToken */, 101 /* ExclamationToken */]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([13 /* NumericLiteral */, 11 /* IdentifierName */, 72 /* OpenParenToken */, 74 /* OpenBracketToken */, 70 /* OpenBraceToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 72 /* OpenParenToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 73 /* CloseParenToken */, 75 /* CloseBracketToken */, 31 /* NewKeyword */]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 72 /* OpenParenToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 73 /* CloseParenToken */, 75 /* CloseBracketToken */, 31 /* NewKeyword */]); - TokenRange.Comments = TokenRange.FromTokens([7 /* SingleLineCommentTrivia */, 6 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([11 /* IdentifierName */, 67 /* NumberKeyword */, 69 /* StringKeyword */, 61 /* BooleanKeyword */, 41 /* VoidKeyword */, 60 /* AnyKeyword */]); - return TokenRange; - })(); - Shared.TokenRange = TokenRange; - })(Formatting.Shared || (Formatting.Shared = {})); - var Shared = Formatting.Shared; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var TokenSpan = (function (_super) { - __extends(TokenSpan, _super); - function TokenSpan(kind, start, length) { - _super.call(this, start, length); - this.kind = kind; - } - return TokenSpan; - })(TypeScript.TextSpan); - Formatting.TokenSpan = TokenSpan; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var IndentationNodeContext = (function () { - function IndentationNodeContext(parent, node, fullStart, indentationAmount, childIndentationAmountDelta) { - this.update(parent, node, fullStart, indentationAmount, childIndentationAmountDelta); - } - IndentationNodeContext.prototype.parent = function () { - return this._parent; - }; - IndentationNodeContext.prototype.node = function () { - return this._node; - }; - IndentationNodeContext.prototype.fullStart = function () { - return this._fullStart; - }; - IndentationNodeContext.prototype.fullWidth = function () { - return TypeScript.fullWidth(this._node); - }; - IndentationNodeContext.prototype.start = function () { - return this._fullStart + TypeScript.leadingTriviaWidth(this._node); - }; - IndentationNodeContext.prototype.end = function () { - return this._fullStart + TypeScript.leadingTriviaWidth(this._node) + TypeScript.width(this._node); - }; - IndentationNodeContext.prototype.indentationAmount = function () { - return this._indentationAmount; - }; - IndentationNodeContext.prototype.childIndentationAmountDelta = function () { - return this._childIndentationAmountDelta; - }; - IndentationNodeContext.prototype.depth = function () { - return this._depth; - }; - IndentationNodeContext.prototype.kind = function () { - return this._node.kind(); - }; - IndentationNodeContext.prototype.hasSkippedOrMissingTokenChild = function () { - if (this._hasSkippedOrMissingTokenChild === null) { - this._hasSkippedOrMissingTokenChild = TypeScript.Syntax.nodeHasSkippedOrMissingTokens(this._node); - } - return this._hasSkippedOrMissingTokenChild; - }; - IndentationNodeContext.prototype.clone = function (pool) { - var parent = null; - if (this._parent) { - parent = this._parent.clone(pool); - } - return pool.getNode(parent, this._node, this._fullStart, this._indentationAmount, this._childIndentationAmountDelta); - }; - IndentationNodeContext.prototype.update = function (parent, node, fullStart, indentationAmount, childIndentationAmountDelta) { - this._parent = parent; - this._node = node; - this._fullStart = fullStart; - this._indentationAmount = indentationAmount; - this._childIndentationAmountDelta = childIndentationAmountDelta; - this._hasSkippedOrMissingTokenChild = null; - if (parent) { - this._depth = parent.depth() + 1; - } - else { - this._depth = 0; - } - }; - return IndentationNodeContext; - })(); - Formatting.IndentationNodeContext = IndentationNodeContext; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var IndentationNodeContextPool = (function () { - function IndentationNodeContextPool() { - this.nodes = []; - } - IndentationNodeContextPool.prototype.getNode = function (parent, node, fullStart, indentationLevel, childIndentationLevelDelta) { - if (this.nodes.length > 0) { - var cachedNode = this.nodes.pop(); - cachedNode.update(parent, node, fullStart, indentationLevel, childIndentationLevelDelta); - return cachedNode; - } - return new Formatting.IndentationNodeContext(parent, node, fullStart, indentationLevel, childIndentationLevelDelta); - }; - IndentationNodeContextPool.prototype.releaseNode = function (node, recursive) { - if (recursive === void 0) { recursive = false; } - this.nodes.push(node); - if (recursive) { - var parent = node.parent(); - if (parent) { - this.releaseNode(parent, recursive); - } - } - }; - return IndentationNodeContextPool; - })(); - Formatting.IndentationNodeContextPool = IndentationNodeContextPool; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var IndentationTrackingWalker = (function (_super) { - __extends(IndentationTrackingWalker, _super); - function IndentationTrackingWalker(textSpan, sourceUnit, snapshot, indentFirstToken, options) { - _super.call(this); - this.options = options; - this._position = 0; - this._parent = null; - this._indentationNodeContextPool = new Formatting.IndentationNodeContextPool(); - this._textSpan = textSpan; - this._text = sourceUnit.syntaxTree.text; - this._snapshot = snapshot; - this._parent = this._indentationNodeContextPool.getNode(null, sourceUnit, 0, 0, 0); - this._lastTriviaWasNewLine = indentFirstToken; - } - IndentationTrackingWalker.prototype.position = function () { - return this._position; - }; - IndentationTrackingWalker.prototype.parent = function () { - return this._parent; - }; - IndentationTrackingWalker.prototype.textSpan = function () { - return this._textSpan; - }; - IndentationTrackingWalker.prototype.snapshot = function () { - return this._snapshot; - }; - IndentationTrackingWalker.prototype.indentationNodeContextPool = function () { - return this._indentationNodeContextPool; - }; - IndentationTrackingWalker.prototype.forceIndentNextToken = function (tokenStart) { - this._lastTriviaWasNewLine = true; - this.forceRecomputeIndentationOfParent(tokenStart, true); - }; - IndentationTrackingWalker.prototype.forceSkipIndentingNextToken = function (tokenStart) { - this._lastTriviaWasNewLine = false; - this.forceRecomputeIndentationOfParent(tokenStart, false); - }; - IndentationTrackingWalker.prototype.indentToken = function (token, indentationAmount, commentIndentationAmount) { - throw TypeScript.Errors.abstract(); - }; - IndentationTrackingWalker.prototype.visitTokenInSpan = function (token) { - if (this._lastTriviaWasNewLine) { - var indentationAmount = this.getTokenIndentationAmount(token); - var commentIndentationAmount = this.getCommentIndentationAmount(token); - this.indentToken(token, indentationAmount, commentIndentationAmount); - } - }; - IndentationTrackingWalker.prototype.visitToken = function (token) { - var tokenSpan = new TypeScript.TextSpan(this._position, token.fullWidth()); - if (tokenSpan.intersectsWithTextSpan(this._textSpan)) { - this.visitTokenInSpan(token); - var trivia = token.trailingTrivia(); - this._lastTriviaWasNewLine = trivia.hasNewLine() && trivia.syntaxTriviaAt(trivia.count() - 1).kind() == 5 /* NewLineTrivia */; - } - this._position += token.fullWidth(); - }; - IndentationTrackingWalker.prototype.visitNode = function (node) { - var nodeSpan = new TypeScript.TextSpan(this._position, TypeScript.fullWidth(node)); - if (nodeSpan.intersectsWithTextSpan(this._textSpan)) { - var indentation = this.getNodeIndentation(node); - var currentParent = this._parent; - this._parent = this._indentationNodeContextPool.getNode(currentParent, node, this._position, indentation.indentationAmount, indentation.indentationAmountDelta); - TypeScript.visitNodeOrToken(this, node); - this._indentationNodeContextPool.releaseNode(this._parent); - this._parent = currentParent; - } - else { - this._position += TypeScript.fullWidth(node); - } - }; - IndentationTrackingWalker.prototype.getTokenIndentationAmount = function (token) { - if (TypeScript.firstToken(this._parent.node()) === token || token.kind() === 70 /* OpenBraceToken */ || token.kind() === 71 /* CloseBraceToken */ || token.kind() === 74 /* OpenBracketToken */ || token.kind() === 75 /* CloseBracketToken */ || (token.kind() === 42 /* WhileKeyword */ && this._parent.node().kind() == 161 /* DoStatement */)) { - return this._parent.indentationAmount(); - } - return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); - }; - IndentationTrackingWalker.prototype.getCommentIndentationAmount = function (token) { - if (token.kind() === 71 /* CloseBraceToken */ || token.kind() === 75 /* CloseBracketToken */) { - return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); - } - return this._parent.indentationAmount(); - }; - IndentationTrackingWalker.prototype.getNodeIndentation = function (node, newLineInsertedByFormatting) { - var parent = this._parent; - var parentIndentationAmount; - if (this._textSpan.containsPosition(parent.start())) { - parentIndentationAmount = parent.indentationAmount(); - } - else { - if (parent.kind() === 146 /* Block */ && !this.shouldIndentBlockInParent(this._parent.parent())) { - parent = this._parent.parent(); - } - var line = this._snapshot.getLineFromPosition(parent.start()).getText(); - var firstNonWhiteSpacePosition = TypeScript.Indentation.firstNonWhitespacePosition(line); - parentIndentationAmount = TypeScript.Indentation.columnForPositionInString(line, firstNonWhiteSpacePosition, this.options); - } - var parentIndentationAmountDelta = parent.childIndentationAmountDelta(); - var indentationAmount; - var indentationAmountDelta; - var parentNode = parent.node(); - switch (node.kind()) { - default: - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - indentationAmountDelta = 0; - break; - case 131 /* ClassDeclaration */: - case 130 /* ModuleDeclaration */: - case 122 /* ObjectType */: - case 132 /* EnumDeclaration */: - case 151 /* SwitchStatement */: - case 215 /* ObjectLiteralExpression */: - case 137 /* ConstructorDeclaration */: - case 129 /* FunctionDeclaration */: - case 222 /* FunctionExpression */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 138 /* IndexMemberDeclaration */: - case 236 /* CatchClause */: - case 214 /* ArrayLiteralExpression */: - case 124 /* ArrayType */: - case 221 /* ElementAccessExpression */: - case 144 /* IndexSignature */: - case 154 /* ForStatement */: - case 155 /* ForInStatement */: - case 158 /* WhileStatement */: - case 161 /* DoStatement */: - case 163 /* WithStatement */: - case 233 /* CaseSwitchClause */: - case 234 /* DefaultSwitchClause */: - case 150 /* ReturnStatement */: - case 157 /* ThrowStatement */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 224 /* VariableDeclaration */: - case 134 /* ExportAssignment */: - case 213 /* InvocationExpression */: - case 216 /* ObjectCreationExpression */: - case 142 /* CallSignature */: - case 143 /* ConstructSignature */: - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - indentationAmountDelta = this.options.indentSpaces; - break; - case 147 /* IfStatement */: - if (parent.kind() === 235 /* ElseClause */ && !TypeScript.SyntaxUtilities.isLastTokenOnLine(parentNode.elseKeyword, this._text)) { - indentationAmount = parentIndentationAmount; - } - else { - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - } - indentationAmountDelta = this.options.indentSpaces; - break; - case 235 /* ElseClause */: - indentationAmount = parentIndentationAmount; - indentationAmountDelta = this.options.indentSpaces; - break; - case 146 /* Block */: - if (this.shouldIndentBlockInParent(parent)) { - indentationAmount = parentIndentationAmount + parentIndentationAmountDelta; - } - else { - indentationAmount = parentIndentationAmount; - } - indentationAmountDelta = this.options.indentSpaces; - break; - } - if (parentNode) { - if (!newLineInsertedByFormatting) { - var parentStartLine = this._snapshot.getLineNumberFromPosition(parent.start()); - var currentNodeStartLine = this._snapshot.getLineNumberFromPosition(this._position + TypeScript.leadingTriviaWidth(node)); - if (parentStartLine === currentNodeStartLine || newLineInsertedByFormatting === false) { - indentationAmount = parentIndentationAmount; - indentationAmountDelta = Math.min(this.options.indentSpaces, parentIndentationAmountDelta + indentationAmountDelta); - } - } - } - return { - indentationAmount: indentationAmount, - indentationAmountDelta: indentationAmountDelta - }; - }; - IndentationTrackingWalker.prototype.shouldIndentBlockInParent = function (parent) { - switch (parent.kind()) { - case 120 /* SourceUnit */: - case 130 /* ModuleDeclaration */: - case 146 /* Block */: - case 233 /* CaseSwitchClause */: - case 234 /* DefaultSwitchClause */: - return true; - default: - return false; - } - }; - IndentationTrackingWalker.prototype.forceRecomputeIndentationOfParent = function (tokenStart, newLineAdded) { - var parent = this._parent; - if (parent.fullStart() === tokenStart) { - this._parent = parent.parent(); - var indentation = this.getNodeIndentation(parent.node(), newLineAdded); - parent.update(parent.parent(), parent.node(), parent.fullStart(), indentation.indentationAmount, indentation.indentationAmountDelta); - this._parent = parent; - } - }; - return IndentationTrackingWalker; - })(TypeScript.SyntaxWalker); - Formatting.IndentationTrackingWalker = IndentationTrackingWalker; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var MultipleTokenIndenter = (function (_super) { - __extends(MultipleTokenIndenter, _super); - function MultipleTokenIndenter(textSpan, sourceUnit, snapshot, indentFirstToken, options) { - _super.call(this, textSpan, sourceUnit, snapshot, indentFirstToken, options); - this._edits = []; - } - MultipleTokenIndenter.prototype.indentToken = function (token, indentationAmount, commentIndentationAmount) { - if (token.fullWidth() === 0) { - return; - } - if (this.parent().hasSkippedOrMissingTokenChild()) { - return; - } - var tokenSpan = new TypeScript.TextSpan(this.position() + token.leadingTriviaWidth(), TypeScript.width(token)); - if (!this.textSpan().containsTextSpan(tokenSpan)) { - return; - } - var indentationString = TypeScript.Indentation.indentationString(indentationAmount, this.options); - var commentIndentationString = TypeScript.Indentation.indentationString(commentIndentationAmount, this.options); - this.recordIndentationEditsForToken(token, indentationString, commentIndentationString); - }; - MultipleTokenIndenter.prototype.edits = function () { - return this._edits; - }; - MultipleTokenIndenter.prototype.recordEdit = function (position, length, replaceWith) { - this._edits.push(new Formatting.TextEditInfo(position, length, replaceWith)); - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForToken = function (token, indentationString, commentIndentationString) { - var position = this.position(); - var indentNextTokenOrTrivia = true; - var leadingWhiteSpace = ""; - var triviaList = token.leadingTrivia(); - if (triviaList) { - for (var i = 0, length = triviaList.count(); i < length; i++, position += trivia.fullWidth()) { - var trivia = triviaList.syntaxTriviaAt(i); - if (!this.textSpan().containsTextSpan(new TypeScript.TextSpan(position, trivia.fullWidth()))) { - continue; - } - switch (trivia.kind()) { - case 6 /* MultiLineCommentTrivia */: - this.recordIndentationEditsForMultiLineComment(trivia, position, commentIndentationString, leadingWhiteSpace, !indentNextTokenOrTrivia); - indentNextTokenOrTrivia = false; - leadingWhiteSpace = ""; - break; - case 7 /* SingleLineCommentTrivia */: - case 8 /* SkippedTokenTrivia */: - if (indentNextTokenOrTrivia) { - this.recordIndentationEditsForSingleLineOrSkippedText(trivia, position, commentIndentationString); - indentNextTokenOrTrivia = false; - } - break; - case 4 /* WhitespaceTrivia */: - var nextTrivia = length > i + 1 && triviaList.syntaxTriviaAt(i + 1); - var whiteSpaceIndentationString = nextTrivia && nextTrivia.isComment() ? commentIndentationString : indentationString; - if (indentNextTokenOrTrivia) { - if (!(nextTrivia && nextTrivia.isNewLine())) { - this.recordIndentationEditsForWhitespace(trivia, position, whiteSpaceIndentationString); - } - indentNextTokenOrTrivia = false; - } - leadingWhiteSpace += trivia.fullText(); - break; - case 5 /* NewLineTrivia */: - indentNextTokenOrTrivia = true; - leadingWhiteSpace = ""; - break; - default: - throw TypeScript.Errors.invalidOperation(); - } - } - } - if (token.kind() !== 10 /* EndOfFileToken */ && indentNextTokenOrTrivia) { - if (indentationString.length > 0) { - this.recordEdit(position, 0, indentationString); - } - } - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForSingleLineOrSkippedText = function (trivia, fullStart, indentationString) { - if (indentationString.length > 0) { - this.recordEdit(fullStart, 0, indentationString); - } - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForWhitespace = function (trivia, fullStart, indentationString) { - var text = trivia.fullText(); - if (indentationString === text) { - return; - } - this.recordEdit(fullStart, text.length, indentationString); - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForMultiLineComment = function (trivia, fullStart, indentationString, leadingWhiteSpace, firstLineAlreadyIndented) { - var position = fullStart; - var segments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - if (segments.length <= 1) { - if (!firstLineAlreadyIndented) { - this.recordIndentationEditsForSingleLineOrSkippedText(trivia, fullStart, indentationString); - } - return; - } - var whiteSpaceColumnsInFirstSegment = TypeScript.Indentation.columnForPositionInString(leadingWhiteSpace, leadingWhiteSpace.length, this.options); - var indentationColumns = TypeScript.Indentation.columnForPositionInString(indentationString, indentationString.length, this.options); - var startIndex = 0; - if (firstLineAlreadyIndented) { - startIndex = 1; - position += segments[0].length; - } - for (var i = startIndex; i < segments.length; i++) { - var segment = segments[i]; - this.recordIndentationEditsForSegment(segment, position, indentationColumns, whiteSpaceColumnsInFirstSegment); - position += segment.length; - } - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForSegment = function (segment, fullStart, indentationColumns, whiteSpaceColumnsInFirstSegment) { - var firstNonWhitespacePosition = TypeScript.Indentation.firstNonWhitespacePosition(segment); - var leadingWhiteSpaceColumns = TypeScript.Indentation.columnForPositionInString(segment, firstNonWhitespacePosition, this.options); - var deltaFromFirstSegment = leadingWhiteSpaceColumns - whiteSpaceColumnsInFirstSegment; - var finalColumns = indentationColumns + deltaFromFirstSegment; - if (finalColumns < 0) { - finalColumns = 0; - } - var indentationString = TypeScript.Indentation.indentationString(finalColumns, this.options); - if (firstNonWhitespacePosition < segment.length && TypeScript.CharacterInfo.isLineTerminator(segment.charCodeAt(firstNonWhitespacePosition))) { - return; - } - if (indentationString === segment.substring(0, firstNonWhitespacePosition)) { - return; - } - this.recordEdit(fullStart, firstNonWhitespacePosition, indentationString); - }; - return MultipleTokenIndenter; - })(Formatting.IndentationTrackingWalker); - Formatting.MultipleTokenIndenter = MultipleTokenIndenter; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var SingleTokenIndenter = (function (_super) { - __extends(SingleTokenIndenter, _super); - function SingleTokenIndenter(indentationPosition, sourceUnit, snapshot, indentFirstToken, options) { - _super.call(this, new TypeScript.TextSpan(indentationPosition, 1), sourceUnit, snapshot, indentFirstToken, options); - this.indentationAmount = null; - this.indentationPosition = indentationPosition; - } - SingleTokenIndenter.getIndentationAmount = function (position, sourceUnit, snapshot, options) { - var walker = new SingleTokenIndenter(position, sourceUnit, snapshot, true, options); - TypeScript.visitNodeOrToken(walker, sourceUnit); - return walker.indentationAmount; - }; - SingleTokenIndenter.prototype.indentToken = function (token, indentationAmount, commentIndentationAmount) { - if (token.fullWidth() === 0 || (this.indentationPosition - this.position() < token.leadingTriviaWidth())) { - this.indentationAmount = commentIndentationAmount; - } - else { - this.indentationAmount = indentationAmount; - } - }; - return SingleTokenIndenter; - })(Formatting.IndentationTrackingWalker); - Formatting.SingleTokenIndenter = SingleTokenIndenter; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - (function (Formatting) { - var Formatter = (function (_super) { - __extends(Formatter, _super); - function Formatter(textSpan, sourceUnit, indentFirstToken, options, snapshot, rulesProvider, formattingRequestKind) { - _super.call(this, textSpan, sourceUnit, snapshot, indentFirstToken, options); - this.previousTokenSpan = null; - this.previousTokenParent = null; - this.scriptHasErrors = false; - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - this.rulesProvider = rulesProvider; - this.formattingRequestKind = formattingRequestKind; - this.formattingContext = new Formatting.FormattingContext(this.snapshot(), this.formattingRequestKind); - } - Formatter.getEdits = function (textSpan, sourceUnit, options, indentFirstToken, snapshot, rulesProvider, formattingRequestKind) { - var walker = new Formatter(textSpan, sourceUnit, indentFirstToken, options, snapshot, rulesProvider, formattingRequestKind); - TypeScript.visitNodeOrToken(walker, sourceUnit); - return walker.edits(); - }; - Formatter.prototype.visitTokenInSpan = function (token) { - if (token.fullWidth() !== 0) { - var tokenSpan = new TypeScript.TextSpan(this.position() + token.leadingTriviaWidth(), TypeScript.width(token)); - if (this.textSpan().containsTextSpan(tokenSpan)) { - this.processToken(token); - } - } - _super.prototype.visitTokenInSpan.call(this, token); - }; - Formatter.prototype.processToken = function (token) { - var position = this.position(); - if (token.leadingTriviaWidth() !== 0) { - this.processTrivia(token.leadingTrivia(), position); - position += token.leadingTriviaWidth(); - } - var currentTokenSpan = new Formatting.TokenSpan(token.kind(), position, TypeScript.width(token)); - if (!this.parent().hasSkippedOrMissingTokenChild()) { - if (this.previousTokenSpan) { - this.formatPair(this.previousTokenSpan, this.previousTokenParent, currentTokenSpan, this.parent()); - } - else { - this.trimWhitespaceInLineRange(this.getLineNumber(this.textSpan()), this.getLineNumber(currentTokenSpan)); - } - } - this.previousTokenSpan = currentTokenSpan; - if (this.previousTokenParent) { - this.indentationNodeContextPool().releaseNode(this.previousTokenParent, true); - } - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - position += TypeScript.width(token); - if (token.trailingTriviaWidth() !== 0) { - this.processTrivia(token.trailingTrivia(), position); - } - }; - Formatter.prototype.processTrivia = function (triviaList, fullStart) { - var position = fullStart; - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isComment() || trivia.isSkippedToken()) { - var currentTokenSpan = new Formatting.TokenSpan(trivia.kind(), position, trivia.fullWidth()); - if (this.textSpan().containsTextSpan(currentTokenSpan)) { - if (trivia.isComment() && this.previousTokenSpan) { - this.formatPair(this.previousTokenSpan, this.previousTokenParent, currentTokenSpan, this.parent()); - } - else { - var startLine = this.getLineNumber(this.previousTokenSpan || this.textSpan()); - this.trimWhitespaceInLineRange(startLine, this.getLineNumber(currentTokenSpan)); - } - this.previousTokenSpan = currentTokenSpan; - if (this.previousTokenParent) { - this.indentationNodeContextPool().releaseNode(this.previousTokenParent, true); - } - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - } - } - position += trivia.fullWidth(); - } - }; - Formatter.prototype.findCommonParents = function (parent1, parent2) { - var shallowParent; - var shallowParentDepth; - var deepParent; - var deepParentDepth; - if (parent1.depth() < parent2.depth()) { - shallowParent = parent1; - shallowParentDepth = parent1.depth(); - deepParent = parent2; - deepParentDepth = parent2.depth(); - } - else { - shallowParent = parent2; - shallowParentDepth = parent2.depth(); - deepParent = parent1; - deepParentDepth = parent1.depth(); - } - TypeScript.Debug.assert(shallowParentDepth >= 0, "Expected shallowParentDepth >= 0"); - TypeScript.Debug.assert(deepParentDepth >= 0, "Expected deepParentDepth >= 0"); - TypeScript.Debug.assert(deepParentDepth >= shallowParentDepth, "Expected deepParentDepth >= shallowParentDepth"); - while (deepParentDepth > shallowParentDepth) { - deepParent = deepParent.parent(); - deepParentDepth--; - } - TypeScript.Debug.assert(deepParentDepth === shallowParentDepth, "Expected deepParentDepth === shallowParentDepth"); - while (deepParent.node() && shallowParent.node()) { - if (deepParent.node() === shallowParent.node()) { - return deepParent; - } - deepParent = deepParent.parent(); - shallowParent = shallowParent.parent(); - } - throw TypeScript.Errors.invalidOperation(); - }; - Formatter.prototype.formatPair = function (t1, t1Parent, t2, t2Parent) { - var token1Line = this.getLineNumber(t1); - var token2Line = this.getLineNumber(t2); - var commonParent = this.findCommonParents(t1Parent, t2Parent); - this.formattingContext.updateContext(t1, t1Parent, t2, t2Parent, commonParent); - var rule = this.rulesProvider.getRulesMap().GetRule(this.formattingContext); - if (rule != null) { - this.RecordRuleEdits(rule, t1, t2); - if ((rule.Operation.Action == 1 /* Space */ || rule.Operation.Action == 3 /* Delete */) && token1Line != token2Line) { - this.forceSkipIndentingNextToken(t2.start()); - } - if (rule.Operation.Action == 2 /* NewLine */ && token1Line == token2Line) { - this.forceIndentNextToken(t2.start()); - } - } - if (token1Line != token2Line && (!rule || (rule.Operation.Action != 3 /* Delete */ && rule.Flag != 1 /* CanDeleteNewLines */))) { - this.trimWhitespaceInLineRange(token1Line, token2Line, t1); - } - }; - Formatter.prototype.getLineNumber = function (span) { - return this.snapshot().getLineNumberFromPosition(span.start()); - }; - Formatter.prototype.trimWhitespaceInLineRange = function (startLine, endLine, token) { - for (var lineNumber = startLine; lineNumber < endLine; ++lineNumber) { - var line = this.snapshot().getLineFromLineNumber(lineNumber); - this.trimWhitespace(line, token); - } - }; - Formatter.prototype.trimWhitespace = function (line, token) { - if (token && (token.kind == 6 /* MultiLineCommentTrivia */ || token.kind == 7 /* SingleLineCommentTrivia */) && token.start() <= line.endPosition() && token.end() >= line.endPosition()) - return; - var text = line.getText(); - var index = 0; - for (index = text.length - 1; index >= 0; --index) { - if (!TypeScript.CharacterInfo.isWhitespace(text.charCodeAt(index))) { - break; - } - } - ++index; - if (index < text.length) { - this.recordEdit(line.startPosition() + index, line.length() - index, ""); - } - }; - Formatter.prototype.RecordRuleEdits = function (rule, t1, t2) { - if (rule.Operation.Action == 0 /* Ignore */) { - return; - } - var betweenSpan; - switch (rule.Operation.Action) { - case 3 /* Delete */: - { - betweenSpan = new TypeScript.TextSpan(t1.end(), t2.start() - t1.end()); - if (betweenSpan.length() > 0) { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), ""); - return; - } - } - break; - case 2 /* NewLine */: - { - if (!(rule.Flag == 1 /* CanDeleteNewLines */ || this.getLineNumber(t1) == this.getLineNumber(t2))) { - return; - } - betweenSpan = new TypeScript.TextSpan(t1.end(), t2.start() - t1.end()); - var doEdit = false; - var betweenText = this.snapshot().getText(betweenSpan); - var lineFeedLoc = betweenText.indexOf(this.options.newLineCharacter); - if (lineFeedLoc < 0) { - doEdit = true; - } - else { - lineFeedLoc = betweenText.indexOf(this.options.newLineCharacter, lineFeedLoc + 1); - if (lineFeedLoc >= 0) { - doEdit = true; - } - } - if (doEdit) { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), this.options.newLineCharacter); - return; - } - } - break; - case 1 /* Space */: - { - if (!(rule.Flag == 1 /* CanDeleteNewLines */ || this.getLineNumber(t1) == this.getLineNumber(t2))) { - return; - } - betweenSpan = new TypeScript.TextSpan(t1.end(), t2.start() - t1.end()); - if (betweenSpan.length() > 1 || this.snapshot().getText(betweenSpan) != " ") { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), " "); - return; - } - } - break; - } - }; - return Formatter; - })(Formatting.MultipleTokenIndenter); - Formatting.Formatter = Formatter; - })(Services.Formatting || (Services.Formatting = {})); - var Formatting = Services.Formatting; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var BloomFilter = (function () { - function BloomFilter(expectedCount) { - var m = Math.max(1, BloomFilter.computeM(expectedCount)); - var k = Math.max(1, BloomFilter.computeK(expectedCount)); - ; - var sizeInEvenBytes = (m + 7) & ~7; - this.bitArray = []; - for (var i = 0, len = sizeInEvenBytes; i < len; i++) { - this.bitArray[i] = false; - } - this.hashFunctionCount = k; - } - BloomFilter.computeM = function (expectedCount) { - var p = BloomFilter.falsePositiveProbability; - var n = expectedCount; - var numerator = n * Math.log(p); - var denominator = Math.log(1.0 / Math.pow(2.0, Math.log(2.0))); - return Math.ceil(numerator / denominator); - }; - BloomFilter.computeK = function (expectedCount) { - var n = expectedCount; - var m = BloomFilter.computeM(expectedCount); - var temp = Math.log(2.0) * m / n; - return Math.round(temp); - }; - BloomFilter.prototype.computeHash = function (key, seed) { - return TypeScript.Hash.computeMurmur2StringHashCode(key, seed); - }; - BloomFilter.prototype.addKeys = function (keys) { - for (var name in keys) { - if (ts.lookUp(keys, name)) { - this.add(name); + function createIterfaceItem(node) { + var childItems = getItemsWorker(sortNodes(node.members), createChildItem); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.interfaceElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } } - }; - BloomFilter.prototype.add = function (value) { - for (var i = 0; i < this.hashFunctionCount; i++) { - var hash = this.computeHash(value, i); - hash = hash % this.bitArray.length; - this.bitArray[Math.abs(hash)] = true; - } - }; - BloomFilter.prototype.probablyContains = function (value) { - for (var i = 0; i < this.hashFunctionCount; i++) { - var hash = this.computeHash(value, i); - hash = hash % this.bitArray.length; - if (!this.bitArray[Math.abs(hash)]) { - return false; + function getInnermostModule(node) { + while (node.body.kind === 191 /* ModuleDeclaration */) { + node = node.body; } + return node; } - return true; - }; - BloomFilter.prototype.isEquivalent = function (filter) { - return BloomFilter.isEquivalent(this.bitArray, filter.bitArray) && this.hashFunctionCount === filter.hashFunctionCount; - }; - BloomFilter.isEquivalent = function (array1, array2) { - if (array1.length !== array2.length) { - return false; + function getNodeSpan(node) { + return node.kind === 196 /* SourceFile */ ? ts.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) : ts.TextSpan.fromBounds(node.getStart(), node.getEnd()); } - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; - }; - BloomFilter.falsePositiveProbability = 0.0001; - return BloomFilter; - })(); - TypeScript.BloomFilter = BloomFilter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var NullLogger = (function () { - function NullLogger() { - } - NullLogger.prototype.log = function (s) { - }; - return NullLogger; - })(); - TypeScript.NullLogger = NullLogger; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var proto = "__proto__"; - var BlockIntrinsics = (function () { - function BlockIntrinsics() { - this.prototype = undefined; - this.toString = undefined; - this.toLocaleString = undefined; - this.valueOf = undefined; - this.hasOwnProperty = undefined; - this.propertyIsEnumerable = undefined; - this.isPrototypeOf = undefined; - this["constructor"] = undefined; - this[proto] = null; - this[proto] = undefined; - } - return BlockIntrinsics; - })(); - function createIntrinsicsObject() { - return new BlockIntrinsics(); - } - TypeScript.createIntrinsicsObject = createIntrinsicsObject; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Comment = (function () { - function Comment(_trivia, endsLine, _start, _end) { - this._trivia = _trivia; - this.endsLine = endsLine; - this._start = _start; - this._end = _end; - } - Comment.prototype.start = function () { - return this._start; - }; - Comment.prototype.end = function () { - return this._end; - }; - Comment.prototype.fullText = function () { - return this._trivia.fullText(); - }; - Comment.prototype.kind = function () { - return this._trivia.kind(); - }; - Comment.prototype.structuralEquals = function (ast, includingPosition) { - if (includingPosition) { - if (this.start() !== ast.start() || this.end() !== ast.end()) { - return false; - } - } - return this._trivia.fullText() === ast._trivia.fullText() && this.endsLine === ast.endsLine; - }; - return Comment; - })(); - TypeScript.Comment = Comment; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function walkListChildren(preAst, walker) { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - function walkThrowStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkPrefixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - function walkPostfixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - function walkDeleteExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkTypeArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArguments); - } - function walkTypeOfExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkVoidExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArgumentList); - walker.walk(preAst.arguments); - } - function walkArrayLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.expressions); - } - function walkSimplePropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.expression); - } - function walkFunctionPropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkGetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkSeparatedListChildren(preAst, walker) { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - function walkSetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkObjectLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.propertyAssignments); - } - function walkCastExpressionChildren(preAst, walker) { - walker.walk(preAst.type); - walker.walk(preAst.expression); - } - function walkParenthesizedExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkElementAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentExpression); - } - function walkMemberAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.name); - } - function walkQualifiedNameChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - function walkBinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - function walkEqualsValueClauseChildren(preAst, walker) { - walker.walk(preAst.value); - } - function walkTypeParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.constraint); - } - function walkTypeParameterListChildren(preAst, walker) { - walker.walk(preAst.typeParameters); - } - function walkGenericTypeChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.typeArgumentList); - } - function walkTypeAnnotationChildren(preAst, walker) { - walker.walk(preAst.type); - } - function walkTypeQueryChildren(preAst, walker) { - walker.walk(preAst.name); - } - function walkInvocationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - function walkObjectCreationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - function walkTrinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.whenTrue); - walker.walk(preAst.whenFalse); - } - function walkFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkFunctionTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - function walkParenthesizedArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - function walkSimpleArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.parameter); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - function walkMemberFunctionDeclarationChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkFuncDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkIndexMemberDeclarationChildren(preAst, walker) { - walker.walk(preAst.indexSignature); - } - function walkIndexSignatureChildren(preAst, walker) { - walker.walk(preAst.parameters); - walker.walk(preAst.typeAnnotation); - } - function walkCallSignatureChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.typeAnnotation); - } - function walkConstraintChildren(preAst, walker) { - walker.walk(preAst.typeOrExpression); - } - function walkConstructorDeclarationChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkConstructorTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - function walkConstructSignatureChildren(preAst, walker) { - walker.walk(preAst.callSignature); - } - function walkParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - function walkParameterListChildren(preAst, walker) { - walker.walk(preAst.parameters); - } - function walkPropertySignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - } - function walkVariableDeclaratorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - function walkMemberVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.variableDeclarator); - } - function walkMethodSignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - } - function walkReturnStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkForStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.initializer); - walker.walk(preAst.condition); - walker.walk(preAst.incrementor); - walker.walk(preAst.statement); - } - function walkForInStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.left); - walker.walk(preAst.expression); - walker.walk(preAst.statement); - } - function walkIfStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - walker.walk(preAst.elseClause); - } - function walkElseClauseChildren(preAst, walker) { - walker.walk(preAst.statement); - } - function walkWhileStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkDoStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkBlockChildren(preAst, walker) { - walker.walk(preAst.statements); - } - function walkVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.variableDeclarators); - } - function walkCaseSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.statements); - } - function walkDefaultSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.statements); - } - function walkSwitchStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.switchClauses); - } - function walkTryStatementChildren(preAst, walker) { - walker.walk(preAst.block); - walker.walk(preAst.catchClause); - walker.walk(preAst.finallyClause); - } - function walkCatchClauseChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.block); - } - function walkExternalModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.stringLiteral); - } - function walkFinallyClauseChildren(preAst, walker) { - walker.walk(preAst.block); - } - function walkClassDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.classElements); - } - function walkScriptChildren(preAst, walker) { - walker.walk(preAst.moduleElements); - } - function walkHeritageClauseChildren(preAst, walker) { - walker.walk(preAst.typeNames); - } - function walkInterfaceDeclerationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.body); - } - function walkObjectTypeChildren(preAst, walker) { - walker.walk(preAst.typeMembers); - } - function walkArrayTypeChildren(preAst, walker) { - walker.walk(preAst.type); - } - function walkModuleDeclarationChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.stringLiteral); - walker.walk(preAst.moduleElements); - } - function walkModuleNameModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.moduleName); - } - function walkEnumDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.enumElements); - } - function walkEnumElementChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.equalsValueClause); - } - function walkImportDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.moduleReference); - } - function walkExportAssignmentChildren(preAst, walker) { - walker.walk(preAst.identifier); - } - function walkWithStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkExpressionStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkLabeledStatementChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.statement); - } - function walkVariableStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - } - var childrenWalkers = new Array(TypeScript.SyntaxKind.LastNode + 1); - for (var i = TypeScript.SyntaxKind.FirstToken, n = TypeScript.SyntaxKind.LastToken; i <= n; i++) { - childrenWalkers[i] = null; - } - for (var i = TypeScript.SyntaxKind.FirstTrivia, n = TypeScript.SyntaxKind.LastTrivia; i <= n; i++) { - childrenWalkers[i] = null; - } - childrenWalkers[175 /* AddAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[208 /* AddExpression */] = walkBinaryExpressionChildren; - childrenWalkers[180 /* AndAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[60 /* AnyKeyword */] = null; - childrenWalkers[226 /* ArgumentList */] = walkArgumentListChildren; - childrenWalkers[214 /* ArrayLiteralExpression */] = walkArrayLiteralExpressionChildren; - childrenWalkers[124 /* ArrayType */] = walkArrayTypeChildren; - childrenWalkers[219 /* SimpleArrowFunctionExpression */] = walkSimpleArrowFunctionExpressionChildren; - childrenWalkers[218 /* ParenthesizedArrowFunctionExpression */] = walkParenthesizedArrowFunctionExpressionChildren; - childrenWalkers[174 /* AssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[191 /* BitwiseAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[190 /* BitwiseExclusiveOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[166 /* BitwiseNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[189 /* BitwiseOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[146 /* Block */] = walkBlockChildren; - childrenWalkers[61 /* BooleanKeyword */] = null; - childrenWalkers[152 /* BreakStatement */] = null; - childrenWalkers[142 /* CallSignature */] = walkCallSignatureChildren; - childrenWalkers[233 /* CaseSwitchClause */] = walkCaseSwitchClauseChildren; - childrenWalkers[220 /* CastExpression */] = walkCastExpressionChildren; - childrenWalkers[236 /* CatchClause */] = walkCatchClauseChildren; - childrenWalkers[131 /* ClassDeclaration */] = walkClassDeclChildren; - childrenWalkers[173 /* CommaExpression */] = walkBinaryExpressionChildren; - childrenWalkers[186 /* ConditionalExpression */] = walkTrinaryExpressionChildren; - childrenWalkers[239 /* Constraint */] = walkConstraintChildren; - childrenWalkers[137 /* ConstructorDeclaration */] = walkConstructorDeclarationChildren; - childrenWalkers[143 /* ConstructSignature */] = walkConstructSignatureChildren; - childrenWalkers[153 /* ContinueStatement */] = null; - childrenWalkers[125 /* ConstructorType */] = walkConstructorTypeChildren; - childrenWalkers[162 /* DebuggerStatement */] = null; - childrenWalkers[234 /* DefaultSwitchClause */] = walkDefaultSwitchClauseChildren; - childrenWalkers[170 /* DeleteExpression */] = walkDeleteExpressionChildren; - childrenWalkers[178 /* DivideAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[206 /* DivideExpression */] = walkBinaryExpressionChildren; - childrenWalkers[161 /* DoStatement */] = walkDoStatementChildren; - childrenWalkers[221 /* ElementAccessExpression */] = walkElementAccessExpressionChildren; - childrenWalkers[235 /* ElseClause */] = walkElseClauseChildren; - childrenWalkers[156 /* EmptyStatement */] = null; - childrenWalkers[132 /* EnumDeclaration */] = walkEnumDeclarationChildren; - childrenWalkers[243 /* EnumElement */] = walkEnumElementChildren; - childrenWalkers[194 /* EqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[232 /* EqualsValueClause */] = walkEqualsValueClauseChildren; - childrenWalkers[192 /* EqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[181 /* ExclusiveOrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[134 /* ExportAssignment */] = walkExportAssignmentChildren; - childrenWalkers[149 /* ExpressionStatement */] = walkExpressionStatementChildren; - childrenWalkers[230 /* ExtendsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[245 /* ExternalModuleReference */] = walkExternalModuleReferenceChildren; - childrenWalkers[24 /* FalseKeyword */] = null; - childrenWalkers[237 /* FinallyClause */] = walkFinallyClauseChildren; - childrenWalkers[155 /* ForInStatement */] = walkForInStatementChildren; - childrenWalkers[154 /* ForStatement */] = walkForStatementChildren; - childrenWalkers[129 /* FunctionDeclaration */] = walkFuncDeclChildren; - childrenWalkers[222 /* FunctionExpression */] = walkFunctionExpressionChildren; - childrenWalkers[241 /* FunctionPropertyAssignment */] = walkFunctionPropertyAssignmentChildren; - childrenWalkers[123 /* FunctionType */] = walkFunctionTypeChildren; - childrenWalkers[126 /* GenericType */] = walkGenericTypeChildren; - childrenWalkers[139 /* GetAccessor */] = walkGetAccessorChildren; - childrenWalkers[197 /* GreaterThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[199 /* GreaterThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[147 /* IfStatement */] = walkIfStatementChildren; - childrenWalkers[231 /* ImplementsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[133 /* ImportDeclaration */] = walkImportDeclarationChildren; - childrenWalkers[138 /* IndexMemberDeclaration */] = walkIndexMemberDeclarationChildren; - childrenWalkers[144 /* IndexSignature */] = walkIndexSignatureChildren; - childrenWalkers[201 /* InExpression */] = walkBinaryExpressionChildren; - childrenWalkers[200 /* InstanceOfExpression */] = walkBinaryExpressionChildren; - childrenWalkers[128 /* InterfaceDeclaration */] = walkInterfaceDeclerationChildren; - childrenWalkers[213 /* InvocationExpression */] = walkInvocationExpressionChildren; - childrenWalkers[160 /* LabeledStatement */] = walkLabeledStatementChildren; - childrenWalkers[183 /* LeftShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[202 /* LeftShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[196 /* LessThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[198 /* LessThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[1 /* List */] = walkListChildren; - childrenWalkers[188 /* LogicalAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[167 /* LogicalNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[187 /* LogicalOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[212 /* MemberAccessExpression */] = walkMemberAccessExpressionChildren; - childrenWalkers[135 /* MemberFunctionDeclaration */] = walkMemberFunctionDeclarationChildren; - childrenWalkers[136 /* MemberVariableDeclaration */] = walkMemberVariableDeclarationChildren; - childrenWalkers[145 /* MethodSignature */] = walkMethodSignatureChildren; - childrenWalkers[130 /* ModuleDeclaration */] = walkModuleDeclarationChildren; - childrenWalkers[246 /* ModuleNameModuleReference */] = walkModuleNameModuleReferenceChildren; - childrenWalkers[179 /* ModuloAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[207 /* ModuloExpression */] = walkBinaryExpressionChildren; - childrenWalkers[177 /* MultiplyAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[205 /* MultiplyExpression */] = walkBinaryExpressionChildren; - childrenWalkers[11 /* IdentifierName */] = null; - childrenWalkers[165 /* NegateExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[0 /* None */] = null; - childrenWalkers[195 /* NotEqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[193 /* NotEqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[32 /* NullKeyword */] = null; - childrenWalkers[67 /* NumberKeyword */] = null; - childrenWalkers[13 /* NumericLiteral */] = null; - childrenWalkers[216 /* ObjectCreationExpression */] = walkObjectCreationExpressionChildren; - childrenWalkers[215 /* ObjectLiteralExpression */] = walkObjectLiteralExpressionChildren; - childrenWalkers[122 /* ObjectType */] = walkObjectTypeChildren; - childrenWalkers[223 /* OmittedExpression */] = null; - childrenWalkers[182 /* OrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[242 /* Parameter */] = walkParameterChildren; - childrenWalkers[227 /* ParameterList */] = walkParameterListChildren; - childrenWalkers[217 /* ParenthesizedExpression */] = walkParenthesizedExpressionChildren; - childrenWalkers[164 /* PlusExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[211 /* PostDecrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[210 /* PostIncrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[169 /* PreDecrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[168 /* PreIncrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[141 /* PropertySignature */] = walkPropertySignatureChildren; - childrenWalkers[121 /* QualifiedName */] = walkQualifiedNameChildren; - childrenWalkers[12 /* RegularExpressionLiteral */] = null; - childrenWalkers[150 /* ReturnStatement */] = walkReturnStatementChildren; - childrenWalkers[120 /* SourceUnit */] = walkScriptChildren; - childrenWalkers[2 /* SeparatedList */] = walkSeparatedListChildren; - childrenWalkers[140 /* SetAccessor */] = walkSetAccessorChildren; - childrenWalkers[184 /* SignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[203 /* SignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[240 /* SimplePropertyAssignment */] = walkSimplePropertyAssignmentChildren; - childrenWalkers[14 /* StringLiteral */] = null; - childrenWalkers[69 /* StringKeyword */] = null; - childrenWalkers[176 /* SubtractAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[209 /* SubtractExpression */] = walkBinaryExpressionChildren; - childrenWalkers[50 /* SuperKeyword */] = null; - childrenWalkers[151 /* SwitchStatement */] = walkSwitchStatementChildren; - childrenWalkers[35 /* ThisKeyword */] = null; - childrenWalkers[157 /* ThrowStatement */] = walkThrowStatementChildren; - childrenWalkers[3 /* TriviaList */] = null; - childrenWalkers[37 /* TrueKeyword */] = null; - childrenWalkers[159 /* TryStatement */] = walkTryStatementChildren; - childrenWalkers[244 /* TypeAnnotation */] = walkTypeAnnotationChildren; - childrenWalkers[228 /* TypeArgumentList */] = walkTypeArgumentListChildren; - childrenWalkers[171 /* TypeOfExpression */] = walkTypeOfExpressionChildren; - childrenWalkers[238 /* TypeParameter */] = walkTypeParameterChildren; - childrenWalkers[229 /* TypeParameterList */] = walkTypeParameterListChildren; - childrenWalkers[127 /* TypeQuery */] = walkTypeQueryChildren; - childrenWalkers[185 /* UnsignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[204 /* UnsignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[224 /* VariableDeclaration */] = walkVariableDeclarationChildren; - childrenWalkers[225 /* VariableDeclarator */] = walkVariableDeclaratorChildren; - childrenWalkers[148 /* VariableStatement */] = walkVariableStatementChildren; - childrenWalkers[172 /* VoidExpression */] = walkVoidExpressionChildren; - childrenWalkers[41 /* VoidKeyword */] = null; - childrenWalkers[158 /* WhileStatement */] = walkWhileStatementChildren; - childrenWalkers[163 /* WithStatement */] = walkWithStatementChildren; - for (var e in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind.hasOwnProperty(e) && TypeScript.StringUtilities.isString(TypeScript.SyntaxKind[e])) { - TypeScript.Debug.assert(childrenWalkers[e] !== undefined, "Fix initWalkers: " + TypeScript.SyntaxKind[e]); - } - } - var AstWalkOptions = (function () { - function AstWalkOptions() { - this.goChildren = true; - this.stopWalking = false; - } - return AstWalkOptions; - })(); - TypeScript.AstWalkOptions = AstWalkOptions; - var SimplePreAstWalker = (function () { - function SimplePreAstWalker(pre, state) { - this.pre = pre; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePreAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - this.pre(ast, this.state); - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - }; - return SimplePreAstWalker; - })(); - var SimplePrePostAstWalker = (function () { - function SimplePrePostAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePrePostAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - this.pre(ast, this.state); - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - this.post(ast, this.state); - }; - return SimplePrePostAstWalker; - })(); - var NormalAstWalker = (function () { - function NormalAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - NormalAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - if (this.options.stopWalking) { - return; - } - this.pre(ast, this); - if (this.options.stopWalking) { - return; - } - if (this.options.goChildren) { - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - } - else { - this.options.goChildren = true; - } - if (this.post) { - this.post(ast, this); - } - }; - return NormalAstWalker; - })(); - var AstWalkerFactory = (function () { - function AstWalkerFactory() { - } - AstWalkerFactory.prototype.walk = function (ast, pre, post, state) { - new NormalAstWalker(pre, post, state).walk(ast); - }; - AstWalkerFactory.prototype.simpleWalk = function (ast, pre, post, state) { - if (post) { - new SimplePrePostAstWalker(pre, post, state).walk(ast); - } - else { - new SimplePreAstWalker(pre, state).walk(ast); - } - }; - return AstWalkerFactory; - })(); - TypeScript.AstWalkerFactory = AstWalkerFactory; - var globalAstWalkerFactory = new AstWalkerFactory(); - function getAstWalkerFactory() { - return globalAstWalkerFactory; - } - TypeScript.getAstWalkerFactory = getAstWalkerFactory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (ASTHelpers) { - var sentinelEmptyArray = []; - function isValidAstNode(ast) { - return ast && !TypeScript.isShared(ast) && TypeScript.start(ast) !== -1 && TypeScript.end(ast) !== -1; - } - ASTHelpers.isValidAstNode = isValidAstNode; - function isValidSpan(ast) { - if (!ast) - return false; - if (ast.start() === -1 || ast.end() === -1) - return false; - return true; - } - ASTHelpers.isValidSpan = isValidSpan; - function getAstAtPosition(script, pos, useTrailingTriviaAsLimChar, forceInclusive) { - if (useTrailingTriviaAsLimChar === void 0) { useTrailingTriviaAsLimChar = true; } - if (forceInclusive === void 0) { forceInclusive = false; } - var top = null; - var pre = function (cur, walker) { - if (!TypeScript.isShared(cur) && isValidAstNode(cur)) { - var isInvalid1 = cur.kind() === 149 /* ExpressionStatement */ && TypeScript.width(cur) === 0; - if (isInvalid1) { - walker.options.goChildren = false; - } - else { - var inclusive = forceInclusive || cur.kind() === 11 /* IdentifierName */ || cur.kind() === 212 /* MemberAccessExpression */ || cur.kind() === 121 /* QualifiedName */ || cur.kind() === 224 /* VariableDeclaration */ || cur.kind() === 225 /* VariableDeclarator */ || cur.kind() === 213 /* InvocationExpression */ || pos === TypeScript.end(script) + TypeScript.lastToken(script).trailingTriviaWidth(); - var minChar = TypeScript.start(cur); - var limChar = TypeScript.end(cur) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(cur) : 0) + (inclusive ? 1 : 0); - if (pos >= minChar && pos < limChar) { - if ((cur.kind() !== 1 /* List */ && cur.kind() !== 2 /* SeparatedList */) || TypeScript.end(cur) > TypeScript.start(cur)) { - if (top === null) { - top = cur; - } - else if (TypeScript.start(cur) >= TypeScript.start(top) && (TypeScript.end(cur) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(cur) : 0)) <= (TypeScript.end(top) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(top) : 0))) { - if (TypeScript.width(top) !== 0 || TypeScript.width(cur) !== 0) { - top = cur; - } - } - } - } - walker.options.goChildren = (minChar <= pos && pos <= limChar); - } - } - }; - TypeScript.getAstWalkerFactory().walk(script, pre); - return top; - } - ASTHelpers.getAstAtPosition = getAstAtPosition; - function getExtendsHeritageClause(clauses) { - return getHeritageClause(clauses, 230 /* ExtendsHeritageClause */); - } - ASTHelpers.getExtendsHeritageClause = getExtendsHeritageClause; - function getImplementsHeritageClause(clauses) { - return getHeritageClause(clauses, 231 /* ImplementsHeritageClause */); - } - ASTHelpers.getImplementsHeritageClause = getImplementsHeritageClause; - function getHeritageClause(clauses, kind) { - if (clauses) { - for (var i = 0, n = clauses.length; i < n; i++) { - var child = clauses[i]; - if (child.typeNames.length > 0 && child.kind() === kind) { - return child; - } - } - } - return null; - } - function isCallExpression(ast) { - return (ast && ast.kind() === 213 /* InvocationExpression */) || (ast && ast.kind() === 216 /* ObjectCreationExpression */); - } - ASTHelpers.isCallExpression = isCallExpression; - function isCallExpressionTarget(ast) { - return !!getCallExpressionTarget(ast); - } - ASTHelpers.isCallExpressionTarget = isCallExpressionTarget; - function getCallExpressionTarget(ast) { - if (!ast) { - return null; - } - var current = ast; - while (current && current.parent) { - if (current.parent.kind() === 212 /* MemberAccessExpression */ && current.parent.name === current) { - current = current.parent; - continue; - } - break; - } - if (current && current.parent) { - if (current.parent.kind() === 213 /* InvocationExpression */ || current.parent.kind() === 216 /* ObjectCreationExpression */) { - return current === current.parent.expression ? current : null; - } - } - return null; - } - ASTHelpers.getCallExpressionTarget = getCallExpressionTarget; - function isNameOfSomeDeclaration(ast) { - if (ast === null || ast.parent === null) { - return false; - } - if (ast.kind() !== 11 /* IdentifierName */) { - return false; - } - switch (ast.parent.kind()) { - case 131 /* ClassDeclaration */: - return ast.parent.identifier === ast; - case 128 /* InterfaceDeclaration */: - return ast.parent.identifier === ast; - case 132 /* EnumDeclaration */: - return ast.parent.identifier === ast; - case 130 /* ModuleDeclaration */: - return ast.parent.name === ast || ast.parent.stringLiteral === ast; - case 225 /* VariableDeclarator */: - return ast.parent.propertyName === ast; - case 129 /* FunctionDeclaration */: - return ast.parent.identifier === ast; - case 135 /* MemberFunctionDeclaration */: - return ast.parent.propertyName === ast; - case 242 /* Parameter */: - return ast.parent.identifier === ast; - case 238 /* TypeParameter */: - return ast.parent.identifier === ast; - case 240 /* SimplePropertyAssignment */: - return ast.parent.propertyName === ast; - case 241 /* FunctionPropertyAssignment */: - return ast.parent.propertyName === ast; - case 243 /* EnumElement */: - return ast.parent.propertyName === ast; - case 133 /* ImportDeclaration */: - return ast.parent.identifier === ast; - case 145 /* MethodSignature */: - return ast.parent.propertyName === ast; - case 141 /* PropertySignature */: - return ast.parent.propertyName === ast; - } - return false; - } - function isDeclarationASTOrDeclarationNameAST(ast) { - return isNameOfSomeDeclaration(ast) || ASTHelpers.isDeclarationAST(ast); - } - ASTHelpers.isDeclarationASTOrDeclarationNameAST = isDeclarationASTOrDeclarationNameAST; - function getEnclosingParameterForInitializer(ast) { - var current = ast; - while (current) { - switch (current.kind()) { - case 232 /* EqualsValueClause */: - if (current.parent && current.parent.kind() === 242 /* Parameter */) { - return current.parent; - } - break; - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 130 /* ModuleDeclaration */: - return null; - } - current = current.parent; - } - return null; - } - ASTHelpers.getEnclosingParameterForInitializer = getEnclosingParameterForInitializer; - function getEnclosingMemberDeclaration(ast) { - var current = ast; - while (current) { - switch (current.kind()) { - case 136 /* MemberVariableDeclaration */: - case 145 /* MethodSignature */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - return current; - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 130 /* ModuleDeclaration */: - return null; - } - current = current.parent; - } - return null; - } - ASTHelpers.getEnclosingMemberDeclaration = getEnclosingMemberDeclaration; - function isNameOfFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 129 /* FunctionDeclaration */ && ast.parent.identifier === ast; - } - ASTHelpers.isNameOfFunction = isNameOfFunction; - function isNameOfMemberFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 135 /* MemberFunctionDeclaration */ && ast.parent.propertyName === ast; - } - ASTHelpers.isNameOfMemberFunction = isNameOfMemberFunction; - function isNameOfMemberAccessExpression(ast) { - if (ast && ast.parent && ast.parent.kind() === 212 /* MemberAccessExpression */ && ast.parent.name === ast) { - return true; - } - return false; - } - ASTHelpers.isNameOfMemberAccessExpression = isNameOfMemberAccessExpression; - function isRightSideOfQualifiedName(ast) { - if (ast && ast.parent && ast.parent.kind() === 121 /* QualifiedName */ && ast.parent.right === ast) { - return true; - } - return false; - } - ASTHelpers.isRightSideOfQualifiedName = isRightSideOfQualifiedName; - function parentIsModuleDeclaration(ast) { - return ast.parent && ast.parent.kind() === 130 /* ModuleDeclaration */; - } - ASTHelpers.parentIsModuleDeclaration = parentIsModuleDeclaration; - function isDeclarationAST(ast) { - switch (ast.kind()) { - case 225 /* VariableDeclarator */: - return getVariableStatement(ast) !== null; - case 133 /* ImportDeclaration */: - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 242 /* Parameter */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 144 /* IndexSignature */: - case 129 /* FunctionDeclaration */: - case 130 /* ModuleDeclaration */: - case 124 /* ArrayType */: - case 122 /* ObjectType */: - case 238 /* TypeParameter */: - case 137 /* ConstructorDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 136 /* MemberVariableDeclaration */: - case 138 /* IndexMemberDeclaration */: - case 132 /* EnumDeclaration */: - case 243 /* EnumElement */: - case 240 /* SimplePropertyAssignment */: - case 241 /* FunctionPropertyAssignment */: - case 222 /* FunctionExpression */: - case 142 /* CallSignature */: - case 143 /* ConstructSignature */: - case 145 /* MethodSignature */: - case 141 /* PropertySignature */: - return true; - default: - return false; + function getTextOfNode(node) { + return ts.getTextOfNodeFromSourceText(sourceFile.text, node); } } - ASTHelpers.isDeclarationAST = isDeclarationAST; - function preComments(element, text) { - if (element) { - switch (element.kind()) { - case 148 /* VariableStatement */: - case 149 /* ExpressionStatement */: - case 131 /* ClassDeclaration */: - case 133 /* ImportDeclaration */: - case 129 /* FunctionDeclaration */: - case 130 /* ModuleDeclaration */: - case 132 /* EnumDeclaration */: - case 147 /* IfStatement */: - case 240 /* SimplePropertyAssignment */: - case 135 /* MemberFunctionDeclaration */: - case 128 /* InterfaceDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 150 /* ReturnStatement */: - case 137 /* ConstructorDeclaration */: - case 136 /* MemberVariableDeclaration */: - case 243 /* EnumElement */: - case 142 /* CallSignature */: - case 143 /* ConstructSignature */: - case 144 /* IndexSignature */: - case 141 /* PropertySignature */: - case 145 /* MethodSignature */: - case 241 /* FunctionPropertyAssignment */: - case 242 /* Parameter */: - return convertNodeLeadingComments(element, text); - } - } - return null; - } - ASTHelpers.preComments = preComments; - function postComments(element, text) { - if (element) { - switch (element.kind()) { - case 149 /* ExpressionStatement */: - return convertNodeTrailingComments(element, text, true); - case 148 /* VariableStatement */: - case 131 /* ClassDeclaration */: - case 133 /* ImportDeclaration */: - case 129 /* FunctionDeclaration */: - case 130 /* ModuleDeclaration */: - case 132 /* EnumDeclaration */: - case 147 /* IfStatement */: - case 240 /* SimplePropertyAssignment */: - case 135 /* MemberFunctionDeclaration */: - case 128 /* InterfaceDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 150 /* ReturnStatement */: - case 137 /* ConstructorDeclaration */: - case 136 /* MemberVariableDeclaration */: - case 243 /* EnumElement */: - case 142 /* CallSignature */: - case 143 /* ConstructSignature */: - case 144 /* IndexSignature */: - case 141 /* PropertySignature */: - case 145 /* MethodSignature */: - case 241 /* FunctionPropertyAssignment */: - case 242 /* Parameter */: - return convertNodeTrailingComments(element, text); - } - } - return null; - } - ASTHelpers.postComments = postComments; - function convertNodeTrailingComments(node, text, allowWithNewLine) { - if (allowWithNewLine === void 0) { allowWithNewLine = false; } - var _lastToken = TypeScript.lastToken(node); - if (_lastToken === null || !_lastToken.hasTrailingTrivia()) { - return null; - } - if (!allowWithNewLine && TypeScript.SyntaxUtilities.isLastTokenOnLine(_lastToken, text)) { - return null; - } - return convertComments(_lastToken.trailingTrivia(text), TypeScript.fullStart(node) + TypeScript.fullWidth(node) - _lastToken.trailingTriviaWidth(text)); - } - function convertNodeLeadingComments(element, text) { - if (element) { - return convertTokenLeadingComments(TypeScript.firstToken(element), text); - } - return null; - } - function convertTokenLeadingComments(token, text) { - if (token === null) { - return null; - } - return token.hasLeadingTrivia() ? convertComments(token.leadingTrivia(text), token.fullStart()) : null; - } - ASTHelpers.convertTokenLeadingComments = convertTokenLeadingComments; - function convertTokenTrailingComments(token, text) { - if (token === null) { - return null; - } - return token.hasTrailingTrivia() ? convertComments(token.trailingTrivia(text), TypeScript.fullEnd(token) - token.trailingTriviaWidth(text)) : null; - } - ASTHelpers.convertTokenTrailingComments = convertTokenTrailingComments; - function convertComments(triviaList, commentStartPosition) { - var result = null; - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isComment()) { - var hasTrailingNewLine = ((i + 1) < n) && triviaList.syntaxTriviaAt(i + 1).isNewLine(); - result = result || []; - result.push(convertComment(trivia, commentStartPosition, hasTrailingNewLine)); - } - commentStartPosition += trivia.fullWidth(); - } - return result; - } - function convertComment(trivia, commentStartPosition, hasTrailingNewLine) { - var comment = new TypeScript.Comment(trivia, hasTrailingNewLine, commentStartPosition, commentStartPosition + trivia.fullWidth()); - return comment; - } - function docComments(ast, text) { - if (isDeclarationAST(ast)) { - var comments = null; - if (ast.kind() === 225 /* VariableDeclarator */) { - comments = TypeScript.ASTHelpers.preComments(getVariableStatement(ast), text); - } - else if (ast.kind() === 242 /* Parameter */) { - comments = TypeScript.ASTHelpers.preComments(ast, text); - if (!comments) { - var previousToken = TypeScript.findToken(TypeScript.syntaxTree(ast).sourceUnit(), TypeScript.firstToken(ast).fullStart() - 1); - if (previousToken && (previousToken.kind() === 72 /* OpenParenToken */ || previousToken.kind() === 79 /* CommaToken */)) { - comments = convertTokenTrailingComments(previousToken, text); - } - } - } - else { - comments = TypeScript.ASTHelpers.preComments(ast, text); - } - if (comments && comments.length > 0) { - return comments.filter(function (c) { return isDocComment(c); }); - } - } - return sentinelEmptyArray; - } - ASTHelpers.docComments = docComments; - function isDocComment(comment) { - if (comment.kind() === 6 /* MultiLineCommentTrivia */) { - var fullText = comment.fullText(); - return fullText.charAt(2) === "*" && fullText.charAt(3) !== "/"; - } - return false; - } - ASTHelpers.isDocComment = isDocComment; - function getParameterList(ast) { - if (ast) { - switch (ast.kind()) { - case 137 /* ConstructorDeclaration */: - return getParameterList(ast.callSignature); - case 129 /* FunctionDeclaration */: - return getParameterList(ast.callSignature); - case 218 /* ParenthesizedArrowFunctionExpression */: - return getParameterList(ast.callSignature); - case 143 /* ConstructSignature */: - return getParameterList(ast.callSignature); - case 135 /* MemberFunctionDeclaration */: - return getParameterList(ast.callSignature); - case 241 /* FunctionPropertyAssignment */: - return getParameterList(ast.callSignature); - case 222 /* FunctionExpression */: - return getParameterList(ast.callSignature); - case 145 /* MethodSignature */: - return getParameterList(ast.callSignature); - case 125 /* ConstructorType */: - return ast.parameterList; - case 123 /* FunctionType */: - return ast.parameterList; - case 142 /* CallSignature */: - return ast.parameterList; - case 139 /* GetAccessor */: - return getParameterList(ast.callSignature); - case 140 /* SetAccessor */: - return getParameterList(ast.callSignature); - } - } - return null; - } - ASTHelpers.getParameterList = getParameterList; - function getType(ast) { - if (ast) { - switch (ast.kind()) { - case 129 /* FunctionDeclaration */: - return getType(ast.callSignature); - case 218 /* ParenthesizedArrowFunctionExpression */: - return getType(ast.callSignature); - case 143 /* ConstructSignature */: - return getType(ast.callSignature); - case 135 /* MemberFunctionDeclaration */: - return getType(ast.callSignature); - case 241 /* FunctionPropertyAssignment */: - return getType(ast.callSignature); - case 222 /* FunctionExpression */: - return getType(ast.callSignature); - case 145 /* MethodSignature */: - return getType(ast.callSignature); - case 142 /* CallSignature */: - return getType(ast.typeAnnotation); - case 144 /* IndexSignature */: - return getType(ast.typeAnnotation); - case 141 /* PropertySignature */: - return getType(ast.typeAnnotation); - case 139 /* GetAccessor */: - return getType(ast.callSignature); - case 242 /* Parameter */: - return getType(ast.typeAnnotation); - case 136 /* MemberVariableDeclaration */: - return getType(ast.variableDeclarator); - case 225 /* VariableDeclarator */: - return getType(ast.typeAnnotation); - case 236 /* CatchClause */: - return getType(ast.typeAnnotation); - case 125 /* ConstructorType */: - return ast.type; - case 123 /* FunctionType */: - return ast.type; - case 244 /* TypeAnnotation */: - return ast.type; - } - } - return null; - } - ASTHelpers.getType = getType; - function getVariableStatement(variableDeclarator) { - if (variableDeclarator && variableDeclarator.parent && variableDeclarator.parent.parent && variableDeclarator.parent.parent.parent && variableDeclarator.parent.kind() === 2 /* SeparatedList */ && variableDeclarator.parent.parent.kind() === 224 /* VariableDeclaration */ && variableDeclarator.parent.parent.parent.kind() === 148 /* VariableStatement */) { - return variableDeclarator.parent.parent.parent; - } - return null; - } - function getVariableDeclaratorModifiers(variableDeclarator) { - var variableStatement = getVariableStatement(variableDeclarator); - return variableStatement ? variableStatement.modifiers : TypeScript.Syntax.emptyList(); - } - ASTHelpers.getVariableDeclaratorModifiers = getVariableDeclaratorModifiers; - function isIntegerLiteralAST(expression) { - if (expression) { - switch (expression.kind()) { - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - expression = expression.operand; - return expression.kind() === 13 /* NumericLiteral */ && TypeScript.IntegerUtilities.isInteger(expression.text()); - case 13 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - return false; - } - ASTHelpers.isIntegerLiteralAST = isIntegerLiteralAST; - function getEnclosingModuleDeclaration(ast) { - while (ast) { - if (ast.kind() === 130 /* ModuleDeclaration */) { - return ast; - } - ast = ast.parent; - } - return null; - } - ASTHelpers.getEnclosingModuleDeclaration = getEnclosingModuleDeclaration; - function isEntireNameOfModuleDeclaration(nameAST) { - return parentIsModuleDeclaration(nameAST) && nameAST.parent.name === nameAST; - } - function getModuleDeclarationFromNameAST(ast) { - if (ast) { - switch (ast.kind()) { - case 14 /* StringLiteral */: - if (parentIsModuleDeclaration(ast) && ast.parent.stringLiteral === ast) { - return ast.parent; - } - return null; - case 11 /* IdentifierName */: - case 121 /* QualifiedName */: - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - break; - default: - return null; - } - for (ast = ast.parent; ast && ast.kind() === 121 /* QualifiedName */; ast = ast.parent) { - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - } - } - return null; - } - ASTHelpers.getModuleDeclarationFromNameAST = getModuleDeclarationFromNameAST; - function isLastNameOfModule(ast, astName) { - if (ast) { - if (ast.stringLiteral) { - return astName === ast.stringLiteral; - } - else if (ast.name.kind() === 121 /* QualifiedName */) { - return astName === ast.name.right; - } - else { - return astName === ast.name; - } - } - return false; - } - ASTHelpers.isLastNameOfModule = isLastNameOfModule; - function getNameOfIdentifierOrQualifiedName(name) { - if (name.kind() === 11 /* IdentifierName */) { - return name.text(); - } - else { - TypeScript.Debug.assert(name.kind() == 121 /* QualifiedName */); - var dotExpr = name; - return getNameOfIdentifierOrQualifiedName(dotExpr.left) + "." + getNameOfIdentifierOrQualifiedName(dotExpr.right); - } - } - ASTHelpers.getNameOfIdentifierOrQualifiedName = getNameOfIdentifierOrQualifiedName; - function getModuleNames(name, result) { - result = result || []; - if (name.kind() === 121 /* QualifiedName */) { - getModuleNames(name.left, result); - result.push(name.right); - } - else { - result.push(name); - } - return result; - } - ASTHelpers.getModuleNames = getModuleNames; - })(TypeScript.ASTHelpers || (TypeScript.ASTHelpers = {})); - var ASTHelpers = TypeScript.ASTHelpers; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var MemberName = (function () { - function MemberName() { - this.prefix = ""; - this.suffix = ""; - } - MemberName.prototype.isString = function () { - return false; - }; - MemberName.prototype.isArray = function () { - return false; - }; - MemberName.prototype.isMarker = function () { - return !this.isString() && !this.isArray(); - }; - MemberName.prototype.toString = function () { - return MemberName.memberNameToString(this); - }; - MemberName.memberNameToString = function (memberName, markerInfo, markerBaseLength) { - if (markerBaseLength === void 0) { markerBaseLength = 0; } - var result = memberName.prefix; - if (memberName.isString()) { - result += memberName.text; - } - else if (memberName.isArray()) { - var ar = memberName; - for (var index = 0; index < ar.entries.length; index++) { - if (ar.entries[index].isMarker()) { - if (markerInfo) { - markerInfo.push(markerBaseLength + result.length); - } - continue; - } - result += MemberName.memberNameToString(ar.entries[index], markerInfo, markerBaseLength + result.length); - result += ar.delim; - } - } - result += memberName.suffix; - return result; - }; - MemberName.create = function (arg1, arg2, arg3) { - if (typeof arg1 === "string") { - return new MemberNameString(arg1); - } - else { - var result = new MemberNameArray(); - if (arg2) - result.prefix = arg2; - if (arg3) - result.suffix = arg3; - result.entries.push(arg1); - return result; - } - }; - return MemberName; - })(); - TypeScript.MemberName = MemberName; - var MemberNameString = (function (_super) { - __extends(MemberNameString, _super); - function MemberNameString(text) { - _super.call(this); - this.text = text; - } - MemberNameString.prototype.isString = function () { - return true; - }; - return MemberNameString; - })(MemberName); - TypeScript.MemberNameString = MemberNameString; - var MemberNameArray = (function (_super) { - __extends(MemberNameArray, _super); - function MemberNameArray() { - _super.call(this); - this.delim = ""; - this.entries = []; - } - MemberNameArray.prototype.isArray = function () { - return true; - }; - MemberNameArray.prototype.add = function (entry) { - this.entries.push(entry); - }; - MemberNameArray.prototype.addAll = function (entries) { - for (var i = 0; i < entries.length; i++) { - this.entries.push(entries[i]); - } - }; - return MemberNameArray; - })(MemberName); - TypeScript.MemberNameArray = MemberNameArray; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function stripStartAndEndQuotes(str) { - var firstCharCode = str && str.charCodeAt(0); - if (str && str.length >= 2 && firstCharCode === str.charCodeAt(str.length - 1) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { - return str.substring(1, str.length - 1); - } - return str; - } - TypeScript.stripStartAndEndQuotes = stripStartAndEndQuotes; - function isSingleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 39 /* singleQuote */; - } - TypeScript.isSingleQuoted = isSingleQuoted; - function isDoubleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 34 /* doubleQuote */; - } - TypeScript.isDoubleQuoted = isDoubleQuoted; - function isQuoted(str) { - return isDoubleQuoted(str) || isSingleQuoted(str); - } - TypeScript.isQuoted = isQuoted; - function quoteStr(str) { - return "\"" + str + "\""; - } - TypeScript.quoteStr = quoteStr; - var switchToForwardSlashesRegEx = /\\/g; - function switchToForwardSlashes(path) { - return path.replace(switchToForwardSlashesRegEx, "/"); - } - TypeScript.switchToForwardSlashes = switchToForwardSlashes; - function trimModName(modName) { - if (modName.length > 5 && modName.substring(modName.length - 5, modName.length) === ".d.ts") { - return modName.substring(0, modName.length - 5); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".ts") { - return modName.substring(0, modName.length - 3); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".js") { - return modName.substring(0, modName.length - 3); - } - return modName; - } - TypeScript.trimModName = trimModName; - function getDeclareFilePath(fname) { - return isTSFile(fname) ? changePathToDTS(fname) : changePathToDTS(fname); - } - TypeScript.getDeclareFilePath = getDeclareFilePath; - function isFileOfExtension(fname, ext) { - var invariantFname = fname.toLocaleUpperCase(); - var invariantExt = ext.toLocaleUpperCase(); - var extLength = invariantExt.length; - return invariantFname.length > extLength && invariantFname.substring(invariantFname.length - extLength, invariantFname.length) === invariantExt; - } - function isTSFile(fname) { - return isFileOfExtension(fname, ".ts"); - } - TypeScript.isTSFile = isTSFile; - function isDTSFile(fname) { - return isFileOfExtension(fname, ".d.ts"); - } - TypeScript.isDTSFile = isDTSFile; - function getPrettyName(modPath, quote, treatAsFileName) { - if (quote === void 0) { quote = true; } - if (treatAsFileName === void 0) { treatAsFileName = false; } - var modName = treatAsFileName ? switchToForwardSlashes(modPath) : trimModName(stripStartAndEndQuotes(modPath)); - var components = this.getPathComponents(modName); - return components.length ? (quote ? quoteStr(components[components.length - 1]) : components[components.length - 1]) : modPath; - } - TypeScript.getPrettyName = getPrettyName; - function getPathComponents(path) { - return path.split("/"); - } - TypeScript.getPathComponents = getPathComponents; - function getRelativePathToFixedPath(fixedModFilePath, absoluteModPath, isAbsoultePathURL) { - if (isAbsoultePathURL === void 0) { isAbsoultePathURL = true; } - absoluteModPath = switchToForwardSlashes(absoluteModPath); - var modComponents = this.getPathComponents(absoluteModPath); - var fixedModComponents = this.getPathComponents(fixedModFilePath); - var joinStartIndex = 0; - for (; joinStartIndex < modComponents.length && joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== modComponents[joinStartIndex]) { - break; - } - } - if (joinStartIndex !== 0) { - var relativePath = ""; - var relativePathComponents = modComponents.slice(joinStartIndex, modComponents.length); - for (; joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== "") { - relativePath = relativePath + "../"; - } - } - return relativePath + relativePathComponents.join("/"); - } - if (isAbsoultePathURL && absoluteModPath.indexOf("://") === -1) { - absoluteModPath = "file:///" + absoluteModPath; - } - return absoluteModPath; - } - TypeScript.getRelativePathToFixedPath = getRelativePathToFixedPath; - function changePathToDTS(modPath) { - return trimModName(stripStartAndEndQuotes(modPath)) + ".d.ts"; - } - TypeScript.changePathToDTS = changePathToDTS; - function isRelative(path) { - return path.length > 0 && path.charAt(0) === "."; - } - TypeScript.isRelative = isRelative; - function isRooted(path) { - return path.length > 0 && (path.charAt(0) === "\\" || path.charAt(0) === "/" || (path.indexOf(":\\") !== -1) || (path.indexOf(":/") !== -1)); - } - TypeScript.isRooted = isRooted; - function getRootFilePath(outFname) { - if (outFname === "") { - return outFname; - } - else { - var isPath = outFname.indexOf("/") !== -1; - return isPath ? filePath(outFname) : ""; - } - } - TypeScript.getRootFilePath = getRootFilePath; - function filePathComponents(fullPath) { - fullPath = switchToForwardSlashes(fullPath); - var components = getPathComponents(fullPath); - return components.slice(0, components.length - 1); - } - TypeScript.filePathComponents = filePathComponents; - function filePath(fullPath) { - var path = filePathComponents(fullPath); - return path.join("/") + "/"; - } - TypeScript.filePath = filePath; - function convertToDirectoryPath(dirPath) { - if (dirPath && dirPath.charAt(dirPath.length - 1) !== "/") { - dirPath += "/"; - } - return dirPath; - } - TypeScript.convertToDirectoryPath = convertToDirectoryPath; - var normalizePathRegEx = /^\\\\[^\\]/; - function normalizePath(path) { - if (normalizePathRegEx.test(path)) { - path = "file:" + path; - } - var parts = this.getPathComponents(switchToForwardSlashes(path)); - var normalizedParts = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part === ".") { - continue; - } - if (normalizedParts.length > 0 && TypeScript.ArrayUtilities.last(normalizedParts) !== ".." && part === "..") { - normalizedParts.pop(); - continue; - } - normalizedParts.push(part); - } - return normalizedParts.join("/"); - } - TypeScript.normalizePath = normalizePath; -})(TypeScript || (TypeScript = {})); + NavigationBar.getNavigationBarItems = getNavigationBarItems; + })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); +})(ts || (ts = {})); var ts; (function (ts) { - var scanner = ts.createScanner(1 /* ES5 */); + var SignatureHelp; + (function (SignatureHelp) { + var emptyArray = []; + function getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken) { + var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position); + if (!startingToken) { + return undefined; + } + var argumentInfo = getContainingArgumentInfo(startingToken); + cancellationToken.throwIfCancellationRequested(); + if (!argumentInfo) { + return undefined; + } + var call = argumentInfo.list.parent; + var candidates = []; + var resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates); + cancellationToken.throwIfCancellationRequested(); + if (!candidates.length) { + return undefined; + } + return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); + function getImmediatelyContainingArgumentInfo(node) { + if (node.parent.kind !== 147 /* CallExpression */ && node.parent.kind !== 148 /* NewExpression */) { + return undefined; + } + var parent = node.parent; + if (node.kind === 23 /* LessThanToken */ || node.kind === 15 /* OpenParenToken */) { + var list = getChildListThatStartsWithOpenerToken(parent, node, sourceFile); + ts.Debug.assert(list !== undefined); + return { + list: list, + listItemIndex: 0 + }; + } + return ts.findListItemInfo(node); + } + function getContainingArgumentInfo(node) { + for (var n = node; n.kind !== 196 /* SourceFile */; n = n.parent) { + if (n.kind === 186 /* FunctionBlock */) { + return undefined; + } + if (n.pos < n.parent.pos || n.end > n.parent.end) { + ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); + } + var argumentInfo = getImmediatelyContainingArgumentInfo(n); + if (argumentInfo) { + return argumentInfo; + } + } + return undefined; + } + function getChildListThatStartsWithOpenerToken(parent, openerToken, sourceFile) { + var children = parent.getChildren(sourceFile); + var indexOfOpenerToken = children.indexOf(openerToken); + ts.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); + return children[indexOfOpenerToken + 1]; + } + function selectBestInvalidOverloadIndex(candidates, argumentCount) { + var maxParamsSignatureIndex = -1; + var maxParams = -1; + for (var i = 0; i < candidates.length; i++) { + var candidate = candidates[i]; + if (candidate.hasRestParameter || candidate.parameters.length >= argumentCount) { + return i; + } + if (candidate.parameters.length > maxParams) { + maxParams = candidate.parameters.length; + maxParamsSignatureIndex = i; + } + } + return maxParamsSignatureIndex; + } + function createSignatureHelpItems(candidates, bestSignature, argumentInfoOrTypeArgumentInfo) { + var argumentListOrTypeArgumentList = argumentInfoOrTypeArgumentInfo.list; + var parent = argumentListOrTypeArgumentList.parent; + var isTypeParameterHelp = parent.typeArguments && parent.typeArguments.pos === argumentListOrTypeArgumentList.pos; + ts.Debug.assert(isTypeParameterHelp || parent.arguments.pos === argumentListOrTypeArgumentList.pos); + var callTargetNode = argumentListOrTypeArgumentList.parent.func; + var callTargetSymbol = typeInfoResolver.getSymbolInfo(callTargetNode); + var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined); + var items = ts.map(candidates, function (candidateSignature) { + var signatureHelpParameters; + var prefixDisplayParts = []; + var suffixDisplayParts = []; + if (callTargetDisplayParts) { + prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); + } + if (isTypeParameterHelp) { + prefixDisplayParts.push(ts.punctuationPart(23 /* LessThanToken */)); + var typeParameters = candidateSignature.typeParameters; + signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; + suffixDisplayParts.push(ts.punctuationPart(24 /* GreaterThanToken */)); + var parameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, argumentListOrTypeArgumentList); }); + suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); + } + else { + var typeParameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, argumentListOrTypeArgumentList); }); + prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); + prefixDisplayParts.push(ts.punctuationPart(15 /* OpenParenToken */)); + var parameters = candidateSignature.parameters; + signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray; + suffixDisplayParts.push(ts.punctuationPart(16 /* CloseParenToken */)); + } + var returnTypeParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, argumentListOrTypeArgumentList); }); + suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); + return { + isVariadic: candidateSignature.hasRestParameter, + prefixDisplayParts: prefixDisplayParts, + suffixDisplayParts: suffixDisplayParts, + separatorDisplayParts: [ts.punctuationPart(22 /* CommaToken */), ts.spacePart()], + parameters: signatureHelpParameters, + documentation: candidateSignature.getDocumentationComment() + }; + }); + var applicableSpanStart = argumentListOrTypeArgumentList.getFullStart(); + var applicableSpanEnd = ts.skipTrivia(sourceFile.text, argumentListOrTypeArgumentList.end, false); + var applicableSpan = new ts.TextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + var argumentIndex = (argumentInfoOrTypeArgumentInfo.listItemIndex + 1) >> 1; + var argumentCount = argumentListOrTypeArgumentList.getChildCount() === 0 ? 0 : 1 + ts.countWhere(argumentListOrTypeArgumentList.getChildren(), function (arg) { return arg.kind === 22 /* CommaToken */; }); + var selectedItemIndex = candidates.indexOf(bestSignature); + if (selectedItemIndex < 0) { + selectedItemIndex = selectBestInvalidOverloadIndex(candidates, argumentCount); + } + return { + items: items, + applicableSpan: applicableSpan, + selectedItemIndex: selectedItemIndex, + argumentIndex: argumentIndex, + argumentCount: argumentCount + }; + function createSignatureHelpParameterForParameter(parameter) { + var displayParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, argumentListOrTypeArgumentList); }); + var isOptional = !!(parameter.valueDeclaration.flags & 4 /* QuestionMark */); + return { + name: parameter.name, + documentation: parameter.getDocumentationComment(), + displayParts: displayParts, + isOptional: isOptional + }; + } + function createSignatureHelpParameterForTypeParameter(typeParameter) { + var displayParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, argumentListOrTypeArgumentList); }); + return { + name: typeParameter.symbol.name, + documentation: emptyArray, + displayParts: displayParts, + isOptional: false + }; + } + } + } + SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; + })(SignatureHelp = ts.SignatureHelp || (ts.SignatureHelp = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + function getEndLinePosition(line, sourceFile) { + ts.Debug.assert(line >= 1); + var lineStarts = sourceFile.getLineStarts(); + var lineIndex = line - 1; + if (lineIndex === lineStarts.length - 1) { + return sourceFile.text.length - 1; + } + else { + var start = lineStarts[lineIndex]; + var pos = lineStarts[lineIndex + 1] - 1; + ts.Debug.assert(ts.isLineBreak(sourceFile.text.charCodeAt(pos))); + while (start <= pos && ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { + pos--; + } + return pos; + } + } + ts.getEndLinePosition = getEndLinePosition; + function getStartPositionOfLine(line, sourceFile) { + ts.Debug.assert(line >= 1); + return sourceFile.getLineStarts()[line - 1]; + } + ts.getStartPositionOfLine = getStartPositionOfLine; + function getStartLinePositionForPosition(position, sourceFile) { + var lineStarts = sourceFile.getLineStarts(); + var line = sourceFile.getLineAndCharacterFromPosition(position).line; + return lineStarts[line - 1]; + } + ts.getStartLinePositionForPosition = getStartLinePositionForPosition; + function rangeContainsRange(r1, r2) { + return startEndContainsRange(r1.pos, r1.end, r2); + } + ts.rangeContainsRange = rangeContainsRange; + function startEndContainsRange(start, end, range) { + return start <= range.pos && end >= range.end; + } + ts.startEndContainsRange = startEndContainsRange; + function rangeContainsStartEnd(range, start, end) { + return range.pos <= start && range.end >= end; + } + ts.rangeContainsStartEnd = rangeContainsStartEnd; + function rangeOverlapsWithStartEnd(r1, start, end) { + return startEndOverlapsWithStartEnd(r1.pos, r1.end, start, end); + } + ts.rangeOverlapsWithStartEnd = rangeOverlapsWithStartEnd; + function startEndOverlapsWithStartEnd(start1, end1, start2, end2) { + var start = Math.max(start1, start2); + var end = Math.min(end1, end2); + return start < end; + } + ts.startEndOverlapsWithStartEnd = startEndOverlapsWithStartEnd; + function findListItemInfo(node) { + var list = findContainingList(node); + if (!list) { + return undefined; + } + var children = list.getChildren(); + var listItemIndex = ts.indexOf(children, node); + return { + listItemIndex: listItemIndex, + list: list + }; + } + ts.findListItemInfo = findListItemInfo; + function findChildOfKind(n, kind, sourceFile) { + return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); + } + ts.findChildOfKind = findChildOfKind; + function findContainingList(node) { + var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { + if (c.kind === 198 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + return c; + } + }); + return syntaxList; + } + ts.findContainingList = findContainingList; + function findListItemIndexContainingPosition(list, position) { + ts.Debug.assert(list.kind === 198 /* SyntaxList */); + var children = list.getChildren(); + for (var i = 0; i < children.length; i++) { + if (children[i].pos <= position && children[i].end > position) { + return i; + } + } + return -1; + } + ts.findListItemIndexContainingPosition = findListItemIndexContainingPosition; + function getTouchingWord(sourceFile, position) { + return getTouchingToken(sourceFile, position, function (n) { return isWord(n.kind); }); + } + ts.getTouchingWord = getTouchingWord; + function getTouchingPropertyName(sourceFile, position) { + return getTouchingToken(sourceFile, position, function (n) { return isPropertyName(n.kind); }); + } + ts.getTouchingPropertyName = getTouchingPropertyName; + function getTouchingToken(sourceFile, position, includeItemAtEndPosition) { + return getTokenAtPositionWorker(sourceFile, position, false, includeItemAtEndPosition); + } + ts.getTouchingToken = getTouchingToken; + function getTokenAtPosition(sourceFile, position) { + return getTokenAtPositionWorker(sourceFile, position, true, undefined); + } + ts.getTokenAtPosition = getTokenAtPosition; + function getTokenAtPositionWorker(sourceFile, position, allowPositionInLeadingTrivia, includeItemAtEndPosition) { + var current = sourceFile; + outer: while (true) { + if (isToken(current)) { + return current; + } + for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { + var child = current.getChildAt(i); + var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile); + if (start <= position) { + var end = child.getEnd(); + if (position < end || (position === end && child.kind === 1 /* EndOfFileToken */)) { + current = child; + continue outer; + } + else if (includeItemAtEndPosition && end === position) { + var previousToken = findPrecedingToken(position, sourceFile, child); + if (previousToken && includeItemAtEndPosition(previousToken)) { + return previousToken; + } + } + } + } + return current; + } + } + function findTokenOnLeftOfPosition(file, position) { + var tokenAtPosition = getTokenAtPosition(file, position); + if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { + return tokenAtPosition; + } + return findPrecedingToken(position, file); + } + ts.findTokenOnLeftOfPosition = findTokenOnLeftOfPosition; + function findNextToken(previousToken, parent) { + return find(parent); + function find(n) { + if (isToken(n) && n.pos === previousToken.end) { + return n; + } + var children = n.getChildren(); + for (var i = 0, len = children.length; i < len; ++i) { + var child = children[i]; + var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || (child.pos === previousToken.end); + if (shouldDiveInChildNode && nodeHasTokens(child)) { + return find(child); + } + } + return undefined; + } + } + ts.findNextToken = findNextToken; + function findPrecedingToken(position, sourceFile, startNode) { + return find(startNode || sourceFile); + function findRightmostToken(n) { + if (isToken(n)) { + return n; + } + var children = n.getChildren(); + var candidate = findRightmostChildNodeWithTokens(children, children.length); + return candidate && findRightmostToken(candidate); + } + function find(n) { + if (isToken(n)) { + return n; + } + var children = n.getChildren(); + for (var i = 0, len = children.length; i < len; ++i) { + var child = children[i]; + if (nodeHasTokens(child)) { + if (position <= child.end) { + if (child.getStart(sourceFile) >= position) { + var candidate = findRightmostChildNodeWithTokens(children, i); + return candidate && findRightmostToken(candidate); + } + else { + return find(child); + } + } + } + } + ts.Debug.assert(startNode !== undefined || n.kind === 196 /* SourceFile */); + if (children.length) { + var candidate = findRightmostChildNodeWithTokens(children, children.length); + return candidate && findRightmostToken(candidate); + } + } + function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { + for (var i = exclusiveStartPosition - 1; i >= 0; --i) { + if (nodeHasTokens(children[i])) { + return children[i]; + } + } + } + } + ts.findPrecedingToken = findPrecedingToken; + function nodeHasTokens(n) { + if (n.kind === 0 /* Unknown */) { + return false; + } + return n.getWidth() !== 0; + } + function getTypeArgumentOrTypeParameterList(node) { + if (node.kind === 132 /* TypeReference */ || node.kind === 147 /* CallExpression */) { + return node.typeArguments; + } + if (ts.isAnyFunction(node) || node.kind === 187 /* ClassDeclaration */ || node.kind === 188 /* InterfaceDeclaration */) { + return node.typeParameters; + } + return undefined; + } + ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; + function isToken(n) { + return n.kind >= 1 /* FirstToken */ && n.kind <= 119 /* LastToken */; + } + ts.isToken = isToken; + function isWord(kind) { + return kind === 63 /* Identifier */ || ts.isKeyword(kind); + } + function isPropertyName(kind) { + return kind === 7 /* StringLiteral */ || kind === 6 /* NumericLiteral */ || isWord(kind); + } + function isComment(kind) { + return kind === 2 /* SingleLineCommentTrivia */ || kind === 3 /* MultiLineCommentTrivia */; + } + ts.isComment = isComment; + function isPunctuation(kind) { + return 13 /* FirstPunctuation */ <= kind && kind <= 62 /* LastPunctuation */; + } + ts.isPunctuation = isPunctuation; +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var SmartIndenter; + (function (SmartIndenter) { + function getIndentation(position, sourceFile, options) { + if (position > sourceFile.text.length) { + return 0; + } + var precedingToken = ts.findPrecedingToken(position, sourceFile); + if (!precedingToken) { + return 0; + } + if ((precedingToken.kind === 7 /* StringLiteral */ || precedingToken.kind === 8 /* RegularExpressionLiteral */) && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { + return 0; + } + var lineAtPosition = sourceFile.getLineAndCharacterFromPosition(position).line; + if (precedingToken.kind === 22 /* CommaToken */ && precedingToken.parent.kind !== 156 /* BinaryExpression */) { + var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation; + } + } + var previous; + var current = precedingToken; + var currentStart; + var indentationDelta; + while (current) { + if (positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0 /* Unknown */)) { + currentStart = getStartLineAndCharacterForNode(current, sourceFile); + if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { + indentationDelta = 0; + } + else { + indentationDelta = lineAtPosition !== currentStart.line ? options.IndentSize : 0; + } + break; + } + var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation; + } + previous = current; + current = current.parent; + } + if (!current) { + return 0; + } + return getIndentationForNodeWorker(current, currentStart, undefined, indentationDelta, sourceFile, options); + } + SmartIndenter.getIndentation = getIndentation; + function getIndentationForNode(n, ignoreActualIndentationRange, sourceFile, options) { + var start = sourceFile.getLineAndCharacterFromPosition(n.getStart(sourceFile)); + return getIndentationForNodeWorker(n, start, ignoreActualIndentationRange, 0, sourceFile, options); + } + SmartIndenter.getIndentationForNode = getIndentationForNode; + function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { + var parent = current.parent; + var parentStart; + while (parent) { + var useActualIndentation = true; + if (ignoreActualIndentationRange) { + var start = current.getStart(sourceFile); + useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; + } + if (useActualIndentation) { + var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } + } + parentStart = getParentStart(parent, current, sourceFile); + var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); + if (useActualIndentation) { + var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } + } + if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { + indentationDelta += options.IndentSize; + } + current = parent; + currentStart = parentStart; + parent = current.parent; + } + return indentationDelta; + } + function getParentStart(parent, child, sourceFile) { + var containingList = getContainingList(child, sourceFile); + if (containingList) { + return sourceFile.getLineAndCharacterFromPosition(containingList.pos); + } + return sourceFile.getLineAndCharacterFromPosition(parent.getStart(sourceFile)); + } + function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) { + var commaItemInfo = ts.findListItemInfo(commaToken); + ts.Debug.assert(commaItemInfo && commaItemInfo.listItemIndex > 0); + return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); + } + function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 196 /* SourceFile */ || !parentAndChildShareLine); + if (!useActualIndentation) { + return -1; + } + return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); + } + function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { + var nextToken = ts.findNextToken(precedingToken, current); + if (!nextToken) { + return false; + } + if (nextToken.kind === 13 /* OpenBraceToken */) { + return true; + } + else if (nextToken.kind === 14 /* CloseBraceToken */) { + var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; + return lineAtPosition === nextTokenStartLine; + } + return false; + } + function getStartLineAndCharacterForNode(n, sourceFile) { + return sourceFile.getLineAndCharacterFromPosition(n.getStart(sourceFile)); + } + function positionBelongsToNode(candidate, position, sourceFile) { + return candidate.end > position || !isCompletedNode(candidate, sourceFile); + } + function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { + if (parent.kind === 165 /* IfStatement */ && parent.elseStatement === child) { + var elseKeyword = ts.findChildOfKind(parent, 74 /* ElseKeyword */, sourceFile); + ts.Debug.assert(elseKeyword !== undefined); + var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; + return elseKeywordStartLine === childStartLine; + } + return false; + } + SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; + function getContainingList(node, sourceFile) { + if (node.parent) { + switch (node.parent.kind) { + case 132 /* TypeReference */: + if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { + return node.parent.typeArguments; + } + break; + case 142 /* ObjectLiteral */: + return node.parent.properties; + case 141 /* ArrayLiteral */: + return node.parent.elements; + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 125 /* Method */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + var start = node.getStart(sourceFile); + if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { + return node.parent.typeParameters; + } + if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { + return node.parent.parameters; + } + break; + case 148 /* NewExpression */: + case 147 /* CallExpression */: + var start = node.getStart(sourceFile); + if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { + return node.parent.typeArguments; + } + if (ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { + return node.parent.arguments; + } + break; + } + } + return undefined; + } + function getActualIndentationForListItem(node, sourceFile, options) { + var containingList = getContainingList(node, sourceFile); + return containingList ? getActualIndentationFromList(containingList) : -1; + function getActualIndentationFromList(list) { + var index = ts.indexOf(list, node); + return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1; + } + } + function deriveActualIndentationFromList(list, index, sourceFile, options) { + ts.Debug.assert(index >= 0 && index < list.length); + var node = list[index]; + var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); + for (var i = index - 1; i >= 0; --i) { + if (list[i].kind === 22 /* CommaToken */) { + continue; + } + var prevEndLine = sourceFile.getLineAndCharacterFromPosition(list[i].end).line; + if (prevEndLine !== lineAndCharacter.line) { + return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options); + } + lineAndCharacter = getStartLineAndCharacterForNode(list[i], sourceFile); + } + return -1; + } + function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options) { + var lineStart = sourceFile.getPositionFromLineAndCharacter(lineAndCharacter.line, 1); + return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); + } + function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { + var column = 0; + for (var pos = startPos; pos < endPos; ++pos) { + var ch = sourceFile.text.charCodeAt(pos); + if (!ts.isWhiteSpace(ch)) { + return column; + } + if (ch === 9 /* tab */) { + column += options.TabSize + (column % options.TabSize); + } + else { + column++; + } + } + return column; + } + SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; + function nodeContentIsAlwaysIndented(kind) { + switch (kind) { + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 141 /* ArrayLiteral */: + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 192 /* ModuleBlock */: + case 142 /* ObjectLiteral */: + case 136 /* TypeLiteral */: + case 174 /* SwitchStatement */: + case 176 /* DefaultClause */: + case 175 /* CaseClause */: + case 151 /* ParenExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 162 /* VariableStatement */: + case 184 /* VariableDeclaration */: + case 194 /* ExportAssignment */: + case 172 /* ReturnStatement */: + return true; + } + return false; + } + function shouldIndentChildNode(parent, child) { + if (nodeContentIsAlwaysIndented(parent)) { + return true; + } + switch (parent) { + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 169 /* ForInStatement */: + case 168 /* ForStatement */: + case 165 /* IfStatement */: + return child !== 161 /* Block */; + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 125 /* Method */: + case 153 /* ArrowFunction */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + return child !== 186 /* FunctionBlock */; + default: + return false; + } + } + SmartIndenter.shouldIndentChildNode = shouldIndentChildNode; + function nodeEndsWith(n, expectedLastToken, sourceFile) { + var children = n.getChildren(sourceFile); + if (children.length) { + var last = children[children.length - 1]; + if (last.kind === expectedLastToken) { + return true; + } + else if (last.kind === 21 /* SemicolonToken */ && children.length !== 1) { + return children[children.length - 2].kind === expectedLastToken; + } + } + return false; + } + function isCompletedNode(n, sourceFile) { + switch (n.kind) { + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 142 /* ObjectLiteral */: + case 161 /* Block */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 174 /* SwitchStatement */: + return nodeEndsWith(n, 14 /* CloseBraceToken */, sourceFile); + case 151 /* ParenExpression */: + case 129 /* CallSignature */: + case 147 /* CallExpression */: + case 130 /* ConstructSignature */: + return nodeEndsWith(n, 16 /* CloseParenToken */, sourceFile); + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 125 /* Method */: + case 153 /* ArrowFunction */: + return !n.body || isCompletedNode(n.body, sourceFile); + case 191 /* ModuleDeclaration */: + return n.body && isCompletedNode(n.body, sourceFile); + case 165 /* IfStatement */: + if (n.elseStatement) { + return isCompletedNode(n.elseStatement, sourceFile); + } + return isCompletedNode(n.thenStatement, sourceFile); + case 164 /* ExpressionStatement */: + return isCompletedNode(n.expression, sourceFile); + case 141 /* ArrayLiteral */: + return nodeEndsWith(n, 18 /* CloseBracketToken */, sourceFile); + case 120 /* Missing */: + return false; + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + return false; + case 167 /* WhileStatement */: + return isCompletedNode(n.statement, sourceFile); + case 166 /* DoStatement */: + var hasWhileKeyword = ts.findChildOfKind(n, 98 /* WhileKeyword */, sourceFile); + if (hasWhileKeyword) { + return nodeEndsWith(n, 16 /* CloseParenToken */, sourceFile); + } + return isCompletedNode(n.statement, sourceFile); + default: + return true; + } + } + })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {})); + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var internedTabsIndentation; + var internedSpacesIndentation; + function getIndentationString(indentation, options) { + if (!options.ConvertTabsToSpaces) { + var tabs = Math.floor(indentation / options.TabSize); + var spaces = indentation - tabs * options.TabSize; + var tabString; + if (!internedTabsIndentation) { + internedTabsIndentation = []; + } + if (internedTabsIndentation[tabs] === undefined) { + internedTabsIndentation[tabs] = tabString = repeat('\t', tabs); + } + else { + tabString = internedTabsIndentation[tabs]; + } + return spaces ? tabString + repeat(" ", spaces) : tabString; + } + else { + var spacesString; + var quotient = Math.floor(indentation / options.IndentSize); + var remainder = indentation % options.IndentSize; + if (!internedSpacesIndentation) { + internedSpacesIndentation = []; + } + if (internedSpacesIndentation[quotient] === undefined) { + spacesString = repeat(" ", options.IndentSize * quotient); + internedSpacesIndentation[quotient] = spacesString; + } + else { + spacesString = internedSpacesIndentation[quotient]; + } + return remainder ? spacesString + repeat(" ", remainder) : spacesString; + } + function repeat(value, count) { + var s = ""; + for (var i = 0; i < count; ++i) { + s += value; + } + return s; + } + } + formatting.getIndentationString = getIndentationString; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var scanner = ts.createScanner(2 /* Latest */, false); + function getFormattingScanner(sourceFile, startPos, endPos) { + scanner.setText(sourceFile.text); + scanner.setTextPos(startPos); + var wasNewLine = true; + var leadingTrivia; + var trailingTrivia; + var savedPos; + var lastScanAction; + var lastTokenInfo; + return { + advance: advance, + readTokenInfo: readTokenInfo, + isOnToken: isOnToken, + lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, + close: function () { + lastTokenInfo = undefined; + scanner.setText(undefined); + } + }; + function advance() { + lastTokenInfo = undefined; + var isStarted = scanner.getStartPos() !== startPos; + if (isStarted) { + if (trailingTrivia) { + ts.Debug.assert(trailingTrivia.length !== 0); + wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === 4 /* NewLineTrivia */; + } + else { + wasNewLine = false; + } + } + leadingTrivia = undefined; + trailingTrivia = undefined; + if (!isStarted) { + scanner.scan(); + } + var t; + var pos = scanner.getStartPos(); + while (pos < endPos) { + var t = scanner.getToken(); + if (!ts.isTrivia(t)) { + break; + } + scanner.scan(); + var item = { + pos: pos, + end: scanner.getStartPos(), + kind: t + }; + pos = scanner.getStartPos(); + if (!leadingTrivia) { + leadingTrivia = []; + } + leadingTrivia.push(item); + } + savedPos = scanner.getStartPos(); + } + function shouldRescanGreaterThanToken(container) { + if (container.kind !== 156 /* BinaryExpression */) { + return false; + } + switch (container.operator) { + case 26 /* GreaterThanEqualsToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + return true; + } + return false; + } + function shouldRescanSlashToken(container) { + return container.kind === 8 /* RegularExpressionLiteral */; + } + function shouldRescanTemplateToken(container) { + return container.kind === 159 /* TemplateSpan */; + } + function startsWithSlashToken(t) { + return t === 35 /* SlashToken */ || t === 55 /* SlashEqualsToken */; + } + function readTokenInfo(n) { + if (!isOnToken()) { + return { + leadingTrivia: leadingTrivia, + trailingTrivia: undefined, + token: undefined + }; + } + var expectedScanAction = shouldRescanGreaterThanToken(n) ? 1 /* RescanGreaterThanToken */ : shouldRescanSlashToken(n) ? 2 /* RescanSlashToken */ : shouldRescanTemplateToken(n) ? 3 /* RescanTemplateToken */ : 0 /* Scan */; + if (lastTokenInfo && expectedScanAction === lastScanAction) { + return lastTokenInfo; + } + if (scanner.getStartPos() !== savedPos) { + ts.Debug.assert(lastTokenInfo !== undefined); + scanner.setTextPos(savedPos); + scanner.scan(); + } + var currentToken = scanner.getToken(); + if (expectedScanAction === 1 /* RescanGreaterThanToken */ && currentToken === 24 /* GreaterThanToken */) { + currentToken = scanner.reScanGreaterToken(); + ts.Debug.assert(n.operator === currentToken); + lastScanAction = 1 /* RescanGreaterThanToken */; + } + else if (expectedScanAction === 2 /* RescanSlashToken */ && startsWithSlashToken(currentToken)) { + currentToken = scanner.reScanSlashToken(); + ts.Debug.assert(n.kind === currentToken); + lastScanAction = 2 /* RescanSlashToken */; + } + else if (expectedScanAction === 3 /* RescanTemplateToken */ && currentToken === 14 /* CloseBraceToken */) { + currentToken = scanner.reScanTemplateToken(); + lastScanAction = 3 /* RescanTemplateToken */; + } + else { + lastScanAction = 0 /* Scan */; + } + var token = { + pos: scanner.getStartPos(), + end: scanner.getTextPos(), + kind: currentToken + }; + while (scanner.getStartPos() < endPos) { + currentToken = scanner.scan(); + if (!ts.isTrivia(currentToken)) { + break; + } + var trivia = { + pos: scanner.getStartPos(), + end: scanner.getTextPos(), + kind: currentToken + }; + if (!trailingTrivia) { + trailingTrivia = []; + } + trailingTrivia.push(trivia); + if (currentToken === 4 /* NewLineTrivia */) { + scanner.scan(); + break; + } + } + return lastTokenInfo = { + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia, + token: token + }; + } + function isOnToken() { + var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); + var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + return startPos < endPos && current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current); + } + } + formatting.getFormattingScanner = getFormattingScanner; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var FormattingContext = (function () { + function FormattingContext(sourceFile, formattingRequestKind) { + this.sourceFile = sourceFile; + this.formattingRequestKind = formattingRequestKind; + } + FormattingContext.prototype.updateContext = function (currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { + ts.Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); + ts.Debug.assert(currentTokenParent !== undefined, "currentTokenParent is null"); + ts.Debug.assert(nextRange !== undefined, "nextTokenSpan is null"); + ts.Debug.assert(nextTokenParent !== undefined, "nextTokenParent is null"); + ts.Debug.assert(commonParent !== undefined, "commonParent is null"); + this.currentTokenSpan = currentRange; + this.currentTokenParent = currentTokenParent; + this.nextTokenSpan = nextRange; + this.nextTokenParent = nextTokenParent; + this.contextNode = commonParent; + this.contextNodeAllOnSameLine = undefined; + this.nextNodeAllOnSameLine = undefined; + this.tokensAreOnSameLine = undefined; + this.contextNodeBlockIsOnOneLine = undefined; + this.nextNodeBlockIsOnOneLine = undefined; + }; + FormattingContext.prototype.ContextNodeAllOnSameLine = function () { + if (this.contextNodeAllOnSameLine === undefined) { + this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); + } + return this.contextNodeAllOnSameLine; + }; + FormattingContext.prototype.NextNodeAllOnSameLine = function () { + if (this.nextNodeAllOnSameLine === undefined) { + this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); + } + return this.nextNodeAllOnSameLine; + }; + FormattingContext.prototype.TokensAreOnSameLine = function () { + if (this.tokensAreOnSameLine === undefined) { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(this.currentTokenSpan.pos).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(this.nextTokenSpan.pos).line; + this.tokensAreOnSameLine = (startLine == endLine); + } + return this.tokensAreOnSameLine; + }; + FormattingContext.prototype.ContextNodeBlockIsOnOneLine = function () { + if (this.contextNodeBlockIsOnOneLine === undefined) { + this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); + } + return this.contextNodeBlockIsOnOneLine; + }; + FormattingContext.prototype.NextNodeBlockIsOnOneLine = function () { + if (this.nextNodeBlockIsOnOneLine === undefined) { + this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); + } + return this.nextNodeBlockIsOnOneLine; + }; + FormattingContext.prototype.NodeIsOnOneLine = function (node) { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(node.getStart(this.sourceFile)).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(node.getEnd()).line; + return startLine == endLine; + }; + FormattingContext.prototype.BlockIsOnOneLine = function (node) { + var openBrace = ts.findChildOfKind(node, 13 /* OpenBraceToken */, this.sourceFile); + var closeBrace = ts.findChildOfKind(node, 14 /* CloseBraceToken */, this.sourceFile); + if (openBrace && closeBrace) { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(openBrace.getEnd()).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(closeBrace.getStart(this.sourceFile)).line; + return startLine === endLine; + } + return false; + }; + return FormattingContext; + })(); + formatting.FormattingContext = FormattingContext; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var Rule = (function () { + function Rule(Descriptor, Operation, Flag) { + if (Flag === void 0) { Flag = 0 /* None */; } + this.Descriptor = Descriptor; + this.Operation = Operation; + this.Flag = Flag; + } + Rule.prototype.toString = function () { + return "[desc=" + this.Descriptor + "," + "operation=" + this.Operation + "," + "flag=" + this.Flag + "]"; + }; + return Rule; + })(); + formatting.Rule = Rule; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RuleDescriptor = (function () { + function RuleDescriptor(LeftTokenRange, RightTokenRange) { + this.LeftTokenRange = LeftTokenRange; + this.RightTokenRange = RightTokenRange; + } + RuleDescriptor.prototype.toString = function () { + return "[leftRange=" + this.LeftTokenRange + "," + "rightRange=" + this.RightTokenRange + "]"; + }; + RuleDescriptor.create1 = function (left, right) { + return RuleDescriptor.create4(formatting.Shared.TokenRange.FromToken(left), formatting.Shared.TokenRange.FromToken(right)); + }; + RuleDescriptor.create2 = function (left, right) { + return RuleDescriptor.create4(left, formatting.Shared.TokenRange.FromToken(right)); + }; + RuleDescriptor.create3 = function (left, right) { + return RuleDescriptor.create4(formatting.Shared.TokenRange.FromToken(left), right); + }; + RuleDescriptor.create4 = function (left, right) { + return new RuleDescriptor(left, right); + }; + return RuleDescriptor; + })(); + formatting.RuleDescriptor = RuleDescriptor; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RuleOperation = (function () { + function RuleOperation() { + this.Context = null; + this.Action = null; + } + RuleOperation.prototype.toString = function () { + return "[context=" + this.Context + "," + "action=" + this.Action + "]"; + }; + RuleOperation.create1 = function (action) { + return RuleOperation.create2(formatting.RuleOperationContext.Any, action); + }; + RuleOperation.create2 = function (context, action) { + var result = new RuleOperation(); + result.Context = context; + result.Action = action; + return result; + }; + return RuleOperation; + })(); + formatting.RuleOperation = RuleOperation; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RuleOperationContext = (function () { + function RuleOperationContext() { + var funcs = []; + for (var _i = 0; _i < arguments.length; _i++) { + funcs[_i - 0] = arguments[_i]; + } + this.customContextChecks = funcs; + } + RuleOperationContext.prototype.IsAny = function () { + return this == RuleOperationContext.Any; + }; + RuleOperationContext.prototype.InContext = function (context) { + if (this.IsAny()) { + return true; + } + for (var i = 0, len = this.customContextChecks.length; i < len; i++) { + if (!this.customContextChecks[i](context)) { + return false; + } + } + return true; + }; + RuleOperationContext.Any = new RuleOperationContext(); + return RuleOperationContext; + })(); + formatting.RuleOperationContext = RuleOperationContext; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var Rules = (function () { + function Rules() { + this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1 /* Ignore */)); + this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2 /* SingleLineCommentTrivia */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1 /* Ignore */)); + this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50 /* ColonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceBeforeQMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 49 /* QuestionToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* ColonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 2 /* Space */)); + this.SpaceAfterQMark = new formatting.Rule(formatting.RuleDescriptor.create3(49 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(21 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14 /* CloseBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); + this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(14 /* CloseBraceToken */, 74 /* ElseKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(14 /* CloseBraceToken */, 98 /* WhileKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([16 /* CloseParenToken */, 18 /* CloseBracketToken */, 22 /* CommaToken */, 21 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19 /* DotToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* DotToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* OpenBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(18 /* CloseBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments; + this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([63 /* Identifier */, 3 /* MultiLineCommentTrivia */]); + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([16 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 73 /* DoKeyword */, 94 /* TryKeyword */, 79 /* FinallyKeyword */, 74 /* ElseKeyword */]); + this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(13 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); + this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 14 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); + this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(13 /* OpenBraceToken */, 14 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 8 /* Delete */)); + this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(13 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); + this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 14 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); + this.NoSpaceAfterUnaryPrefixOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.UnaryPrefixOperators, formatting.Shared.TokenRange.UnaryPrefixExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(37 /* PlusPlusToken */, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(38 /* MinusMinusToken */, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 37 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 38 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(37 /* PlusPlusToken */, 32 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(32 /* PlusToken */, 32 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(32 /* PlusToken */, 37 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(38 /* MinusMinusToken */, 33 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(33 /* MinusToken */, 33 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(33 /* MinusToken */, 38 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22 /* CommaToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([96 /* VarKeyword */, 92 /* ThrowKeyword */, 86 /* NewKeyword */, 72 /* DeleteKeyword */, 88 /* ReturnKeyword */, 95 /* TypeOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext), 8 /* Delete */)); + this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(81 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */)); + this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(97 /* VoidKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2 /* Space */)); + this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(88 /* ReturnKeyword */, 21 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([16 /* CloseParenToken */, 73 /* DoKeyword */, 74 /* ElseKeyword */, 65 /* CaseKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2 /* Space */)); + this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([94 /* TryKeyword */, 79 /* FinallyKeyword */]), 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([113 /* GetKeyword */, 117 /* SetKeyword */]), 63 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(111 /* ConstructorKeyword */, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([114 /* ModuleKeyword */, 115 /* RequireKeyword */]), 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([67 /* ClassKeyword */, 112 /* DeclareKeyword */, 75 /* EnumKeyword */, 76 /* ExportKeyword */, 77 /* ExtendsKeyword */, 113 /* GetKeyword */, 100 /* ImplementsKeyword */, 83 /* ImportKeyword */, 101 /* InterfaceKeyword */, 114 /* ModuleKeyword */, 104 /* PrivateKeyword */, 106 /* PublicKeyword */, 117 /* SetKeyword */, 107 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([77 /* ExtendsKeyword */, 100 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(7 /* StringLiteral */, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); + this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(31 /* EqualsGreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(20 /* DotDotDotToken */, 63 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(49 /* QuestionToken */, formatting.Shared.TokenRange.FromTokens([16 /* CloseParenToken */, 22 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 23 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(16 /* CloseParenToken */, 23 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(23 /* LessThanToken */, formatting.Shared.TokenRange.TypeNames), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 24 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* GreaterThanToken */, formatting.Shared.TokenRange.FromTokens([15 /* OpenParenToken */, 17 /* OpenBracketToken */, 24 /* GreaterThanToken */, 22 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(13 /* OpenBraceToken */, 14 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8 /* Delete */)); + this.HighPriorityCommonRules = [ + this.IgnoreBeforeComment, + this.IgnoreAfterLineComment, + this.NoSpaceBeforeColon, + this.SpaceAfterColon, + this.NoSpaceBeforeQMark, + this.SpaceAfterQMark, + this.NoSpaceBeforeDot, + this.NoSpaceAfterDot, + this.NoSpaceAfterUnaryPrefixOperator, + this.NoSpaceAfterUnaryPreincrementOperator, + this.NoSpaceAfterUnaryPredecrementOperator, + this.NoSpaceBeforeUnaryPostincrementOperator, + this.NoSpaceBeforeUnaryPostdecrementOperator, + this.SpaceAfterPostincrementWhenFollowedByAdd, + this.SpaceAfterAddWhenFollowedByUnaryPlus, + this.SpaceAfterAddWhenFollowedByPreincrement, + this.SpaceAfterPostdecrementWhenFollowedBySubtract, + this.SpaceAfterSubtractWhenFollowedByUnaryMinus, + this.SpaceAfterSubtractWhenFollowedByPredecrement, + this.NoSpaceAfterCloseBrace, + this.SpaceAfterOpenBrace, + this.SpaceBeforeCloseBrace, + this.NewLineBeforeCloseBraceInBlockContext, + this.SpaceAfterCloseBrace, + this.SpaceBetweenCloseBraceAndElse, + this.SpaceBetweenCloseBraceAndWhile, + this.NoSpaceBetweenEmptyBraceBrackets, + this.SpaceAfterFunctionInFuncDecl, + this.NewLineAfterOpenBraceInBlockContext, + this.SpaceAfterGetSetInMember, + this.NoSpaceBetweenReturnAndSemicolon, + this.SpaceAfterCertainKeywords, + this.NoSpaceBeforeOpenParenInFuncCall, + this.SpaceBeforeBinaryKeywordOperator, + this.SpaceAfterBinaryKeywordOperator, + this.SpaceAfterVoidOperator, + this.NoSpaceAfterConstructor, + this.NoSpaceAfterModuleImport, + this.SpaceAfterCertainTypeScriptKeywords, + this.SpaceBeforeCertainTypeScriptKeywords, + this.SpaceAfterModuleName, + this.SpaceAfterArrow, + this.NoSpaceAfterEllipsis, + this.NoSpaceAfterOptionalParameters, + this.NoSpaceBetweenEmptyInterfaceBraceBrackets, + this.NoSpaceBeforeOpenAngularBracket, + this.NoSpaceBetweenCloseParenAndAngularBracket, + this.NoSpaceAfterOpenAngularBracket, + this.NoSpaceBeforeCloseAngularBracket, + this.NoSpaceAfterCloseAngularBracket + ]; + this.LowPriorityCommonRules = [ + this.NoSpaceBeforeSemicolon, + this.SpaceBeforeOpenBraceInControl, + this.SpaceBeforeOpenBraceInFunction, + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, + this.NoSpaceBeforeComma, + this.NoSpaceBeforeOpenBracket, + this.NoSpaceAfterOpenBracket, + this.NoSpaceBeforeCloseBracket, + this.NoSpaceAfterCloseBracket, + this.SpaceAfterSemicolon, + this.NoSpaceBeforeOpenParenInFuncDecl, + this.SpaceBetweenStatements, + this.SpaceAfterTryFinally + ]; + this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); + this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); + this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2 /* Space */)); + this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8 /* Delete */)); + this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(21 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 2 /* Space */)); + this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(21 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 8 /* Delete */)); + this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(15 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(15 /* OpenParenToken */, 16 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(15 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(81 /* FunctionKeyword */, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(81 /* FunctionKeyword */, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8 /* Delete */)); + } + Rules.prototype.getRuleName = function (rule) { + var o = this; + for (var name in o) { + if (o[name] === rule) { + return name; + } + } + throw new Error("Unknown rule"); + }; + Rules.IsForContext = function (context) { + return context.contextNode.kind === 168 /* ForStatement */; + }; + Rules.IsNotForContext = function (context) { + return !Rules.IsForContext(context); + }; + Rules.IsBinaryOpContext = function (context) { + switch (context.contextNode.kind) { + case 156 /* BinaryExpression */: + case 157 /* ConditionalExpression */: + return true; + case 193 /* ImportDeclaration */: + case 184 /* VariableDeclaration */: + case 123 /* Parameter */: + case 195 /* EnumMember */: + case 124 /* Property */: + return context.currentTokenSpan.kind === 51 /* EqualsToken */ || context.nextTokenSpan.kind === 51 /* EqualsToken */; + case 169 /* ForInStatement */: + return context.currentTokenSpan.kind === 84 /* InKeyword */ || context.nextTokenSpan.kind === 84 /* InKeyword */; + } + return false; + }; + Rules.IsNotBinaryOpContext = function (context) { + return !Rules.IsBinaryOpContext(context); + }; + Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { + return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); + }; + Rules.IsBeforeMultilineBlockContext = function (context) { + return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); + }; + Rules.IsMultilineBlockContext = function (context) { + return Rules.IsBlockContext(context) && !(context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); + }; + Rules.IsSingleLineBlockContext = function (context) { + return Rules.IsBlockContext(context) && (context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); + }; + Rules.IsBlockContext = function (context) { + return Rules.NodeIsBlockContext(context.contextNode); + }; + Rules.IsBeforeBlockContext = function (context) { + return Rules.NodeIsBlockContext(context.nextTokenParent); + }; + Rules.NodeIsBlockContext = function (node) { + if (Rules.NodeIsTypeScriptDeclWithBlockContext(node)) { + return true; + } + switch (node.kind) { + case 161 /* Block */: + case 174 /* SwitchStatement */: + case 142 /* ObjectLiteral */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + return true; + } + return false; + }; + Rules.IsFunctionDeclContext = function (context) { + switch (context.contextNode.kind) { + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 129 /* CallSignature */: + case 152 /* FunctionExpression */: + case 126 /* Constructor */: + case 153 /* ArrowFunction */: + case 188 /* InterfaceDeclaration */: + return true; + } + return false; + }; + Rules.IsTypeScriptDeclWithBlockContext = function (context) { + return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); + }; + Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { + switch (node.kind) { + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 136 /* TypeLiteral */: + case 191 /* ModuleDeclaration */: + return true; + } + return false; + }; + Rules.IsAfterCodeBlockContext = function (context) { + switch (context.currentTokenParent.kind) { + case 187 /* ClassDeclaration */: + case 191 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 174 /* SwitchStatement */: + return true; + } + return false; + }; + Rules.IsControlDeclContext = function (context) { + switch (context.contextNode.kind) { + case 165 /* IfStatement */: + case 174 /* SwitchStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 167 /* WhileStatement */: + case 179 /* TryStatement */: + case 166 /* DoStatement */: + case 173 /* WithStatement */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + return true; + default: + return false; + } + }; + Rules.IsObjectContext = function (context) { + return context.contextNode.kind === 142 /* ObjectLiteral */; + }; + Rules.IsFunctionCallContext = function (context) { + return context.contextNode.kind === 147 /* CallExpression */; + }; + Rules.IsNewContext = function (context) { + return context.contextNode.kind === 148 /* NewExpression */; + }; + Rules.IsFunctionCallOrNewContext = function (context) { + return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); + }; + Rules.IsSameLineTokenContext = function (context) { + return context.TokensAreOnSameLine(); + }; + Rules.IsNotFormatOnEnter = function (context) { + return context.formattingRequestKind != 2 /* FormatOnEnter */; + }; + Rules.IsModuleDeclContext = function (context) { + return context.contextNode.kind === 191 /* ModuleDeclaration */; + }; + Rules.IsObjectTypeContext = function (context) { + return context.contextNode.kind === 136 /* TypeLiteral */; + }; + Rules.IsTypeArgumentOrParameter = function (token, parent) { + if (token.kind !== 23 /* LessThanToken */ && token.kind !== 24 /* GreaterThanToken */) { + return false; + } + switch (parent.kind) { + case 132 /* TypeReference */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 125 /* Method */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return true; + default: + return false; + } + }; + Rules.IsTypeArgumentOrParameterContext = function (context) { + return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); + }; + Rules.IsVoidOpContext = function (context) { + return context.currentTokenSpan.kind === 97 /* VoidKeyword */ && context.currentTokenParent.kind === 154 /* PrefixOperator */; + }; + return Rules; + })(); + formatting.Rules = Rules; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RulesMap = (function () { + function RulesMap() { + this.map = []; + this.mapRowLength = 0; + } + RulesMap.create = function (rules) { + var result = new RulesMap(); + result.Initialize(rules); + return result; + }; + RulesMap.prototype.Initialize = function (rules) { + this.mapRowLength = 119 /* LastToken */ + 1; + this.map = new Array(this.mapRowLength * this.mapRowLength); + var rulesBucketConstructionStateList = new Array(this.map.length); + this.FillRules(rules, rulesBucketConstructionStateList); + return this.map; + }; + RulesMap.prototype.FillRules = function (rules, rulesBucketConstructionStateList) { + var _this = this; + rules.forEach(function (rule) { + _this.FillRule(rule, rulesBucketConstructionStateList); + }); + }; + RulesMap.prototype.GetRuleBucketIndex = function (row, column) { + var rulesBucketIndex = (row * this.mapRowLength) + column; + return rulesBucketIndex; + }; + RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { + var _this = this; + var specificRule = rule.Descriptor.LeftTokenRange != formatting.Shared.TokenRange.Any && rule.Descriptor.RightTokenRange != formatting.Shared.TokenRange.Any; + rule.Descriptor.LeftTokenRange.GetTokens().forEach(function (left) { + rule.Descriptor.RightTokenRange.GetTokens().forEach(function (right) { + var rulesBucketIndex = _this.GetRuleBucketIndex(left, right); + var rulesBucket = _this.map[rulesBucketIndex]; + if (rulesBucket == undefined) { + rulesBucket = _this.map[rulesBucketIndex] = new RulesBucket(); + } + rulesBucket.AddRule(rule, specificRule, rulesBucketConstructionStateList, rulesBucketIndex); + }); + }); + }; + RulesMap.prototype.GetRule = function (context) { + var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); + var bucket = this.map[bucketIndex]; + if (bucket != null) { + for (var i = 0, len = bucket.Rules().length; i < len; i++) { + var rule = bucket.Rules()[i]; + if (rule.Operation.Context.InContext(context)) + return rule; + } + } + return null; + }; + return RulesMap; + })(); + formatting.RulesMap = RulesMap; + var MaskBitSize = 5; + var Mask = 0x1f; + (function (RulesPosition) { + RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; + RulesPosition[RulesPosition["IgnoreRulesAny"] = MaskBitSize * 1] = "IgnoreRulesAny"; + RulesPosition[RulesPosition["ContextRulesSpecific"] = MaskBitSize * 2] = "ContextRulesSpecific"; + RulesPosition[RulesPosition["ContextRulesAny"] = MaskBitSize * 3] = "ContextRulesAny"; + RulesPosition[RulesPosition["NoContextRulesSpecific"] = MaskBitSize * 4] = "NoContextRulesSpecific"; + RulesPosition[RulesPosition["NoContextRulesAny"] = MaskBitSize * 5] = "NoContextRulesAny"; + })(formatting.RulesPosition || (formatting.RulesPosition = {})); + var RulesPosition = formatting.RulesPosition; + var RulesBucketConstructionState = (function () { + function RulesBucketConstructionState() { + this.rulesInsertionIndexBitmap = 0; + } + RulesBucketConstructionState.prototype.GetInsertionIndex = function (maskPosition) { + var index = 0; + var pos = 0; + var indexBitmap = this.rulesInsertionIndexBitmap; + while (pos <= maskPosition) { + index += (indexBitmap & Mask); + indexBitmap >>= MaskBitSize; + pos += MaskBitSize; + } + return index; + }; + RulesBucketConstructionState.prototype.IncreaseInsertionIndex = function (maskPosition) { + var value = (this.rulesInsertionIndexBitmap >> maskPosition) & Mask; + value++; + ts.Debug.assert((value & Mask) == value, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); + var temp = this.rulesInsertionIndexBitmap & ~(Mask << maskPosition); + temp |= value << maskPosition; + this.rulesInsertionIndexBitmap = temp; + }; + return RulesBucketConstructionState; + })(); + formatting.RulesBucketConstructionState = RulesBucketConstructionState; + var RulesBucket = (function () { + function RulesBucket() { + this.rules = []; + } + RulesBucket.prototype.Rules = function () { + return this.rules; + }; + RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { + var position; + if (rule.Operation.Action == 1 /* Ignore */) { + position = specificTokens ? 0 /* IgnoreRulesSpecific */ : RulesPosition.IgnoreRulesAny; + } + else if (!rule.Operation.Context.IsAny()) { + position = specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny; + } + else { + position = specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; + } + var state = constructionState[rulesBucketIndex]; + if (state === undefined) { + state = constructionState[rulesBucketIndex] = new RulesBucketConstructionState(); + } + var index = state.GetInsertionIndex(position); + this.rules.splice(index, 0, rule); + state.IncreaseInsertionIndex(position); + }; + return RulesBucket; + })(); + formatting.RulesBucket = RulesBucket; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var Shared; + (function (Shared) { + var TokenRangeAccess = (function () { + function TokenRangeAccess(from, to, except) { + this.tokens = []; + for (var token = from; token <= to; token++) { + if (except.indexOf(token) < 0) { + this.tokens.push(token); + } + } + } + TokenRangeAccess.prototype.GetTokens = function () { + return this.tokens; + }; + TokenRangeAccess.prototype.Contains = function (token) { + return this.tokens.indexOf(token) >= 0; + }; + return TokenRangeAccess; + })(); + Shared.TokenRangeAccess = TokenRangeAccess; + var TokenValuesAccess = (function () { + function TokenValuesAccess(tks) { + this.tokens = tks && tks.length ? tks : []; + } + TokenValuesAccess.prototype.GetTokens = function () { + return this.tokens; + }; + TokenValuesAccess.prototype.Contains = function (token) { + return this.tokens.indexOf(token) >= 0; + }; + return TokenValuesAccess; + })(); + Shared.TokenValuesAccess = TokenValuesAccess; + var TokenSingleValueAccess = (function () { + function TokenSingleValueAccess(token) { + this.token = token; + } + TokenSingleValueAccess.prototype.GetTokens = function () { + return [this.token]; + }; + TokenSingleValueAccess.prototype.Contains = function (tokenValue) { + return tokenValue == this.token; + }; + return TokenSingleValueAccess; + })(); + Shared.TokenSingleValueAccess = TokenSingleValueAccess; + var TokenAllAccess = (function () { + function TokenAllAccess() { + } + TokenAllAccess.prototype.GetTokens = function () { + var result = []; + for (var token = 1 /* FirstToken */; token <= 119 /* LastToken */; token++) { + result.push(token); + } + return result; + }; + TokenAllAccess.prototype.Contains = function (tokenValue) { + return true; + }; + TokenAllAccess.prototype.toString = function () { + return "[allTokens]"; + }; + return TokenAllAccess; + })(); + Shared.TokenAllAccess = TokenAllAccess; + var TokenRange = (function () { + function TokenRange(tokenAccess) { + this.tokenAccess = tokenAccess; + } + TokenRange.FromToken = function (token) { + return new TokenRange(new TokenSingleValueAccess(token)); + }; + TokenRange.FromTokens = function (tokens) { + return new TokenRange(new TokenValuesAccess(tokens)); + }; + TokenRange.FromRange = function (f, to, except) { + if (except === void 0) { except = []; } + return new TokenRange(new TokenRangeAccess(f, to, except)); + }; + TokenRange.AllTokens = function () { + return new TokenRange(new TokenAllAccess()); + }; + TokenRange.prototype.GetTokens = function () { + return this.tokenAccess.GetTokens(); + }; + TokenRange.prototype.Contains = function (token) { + return this.tokenAccess.Contains(token); + }; + TokenRange.prototype.toString = function () { + return this.tokenAccess.toString(); + }; + TokenRange.Any = TokenRange.AllTokens(); + TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); + TokenRange.Keywords = TokenRange.FromRange(64 /* FirstKeyword */, 119 /* LastKeyword */); + TokenRange.Operators = TokenRange.FromRange(21 /* FirstOperator */, 62 /* LastOperator */); + TokenRange.BinaryOperators = TokenRange.FromRange(23 /* FirstBinaryOperator */, 62 /* LastBinaryOperator */); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([84 /* InKeyword */, 85 /* InstanceOfKeyword */]); + TokenRange.ReservedKeywords = TokenRange.FromRange(100 /* FirstFutureReservedWord */, 108 /* LastFutureReservedWord */); + TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([37 /* PlusPlusToken */, 38 /* MinusMinusToken */, 46 /* TildeToken */, 45 /* ExclamationToken */]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([6 /* NumericLiteral */, 63 /* Identifier */, 15 /* OpenParenToken */, 17 /* OpenBracketToken */, 13 /* OpenBraceToken */, 91 /* ThisKeyword */, 86 /* NewKeyword */]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([63 /* Identifier */, 15 /* OpenParenToken */, 91 /* ThisKeyword */, 86 /* NewKeyword */]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([63 /* Identifier */, 16 /* CloseParenToken */, 18 /* CloseBracketToken */, 86 /* NewKeyword */]); + TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([63 /* Identifier */, 15 /* OpenParenToken */, 91 /* ThisKeyword */, 86 /* NewKeyword */]); + TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([63 /* Identifier */, 16 /* CloseParenToken */, 18 /* CloseBracketToken */, 86 /* NewKeyword */]); + TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); + TokenRange.TypeNames = TokenRange.FromTokens([63 /* Identifier */, 116 /* NumberKeyword */, 118 /* StringKeyword */, 110 /* BooleanKeyword */, 97 /* VoidKeyword */, 109 /* AnyKeyword */]); + return TokenRange; + })(); + Shared.TokenRange = TokenRange; + })(Shared = formatting.Shared || (formatting.Shared = {})); + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var TokenSpan = (function (_super) { + __extends(TokenSpan, _super); + function TokenSpan(kind, start, length) { + _super.call(this, start, length); + this.kind = kind; + } + return TokenSpan; + })(ts.TextSpan); + formatting.TokenSpan = TokenSpan; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RulesProvider = (function () { + function RulesProvider(logger) { + this.logger = logger; + this.globalRules = new formatting.Rules(); + } + RulesProvider.prototype.getRuleName = function (rule) { + return this.globalRules.getRuleName(rule); + }; + RulesProvider.prototype.getRuleByName = function (name) { + return this.globalRules[name]; + }; + RulesProvider.prototype.getRulesMap = function () { + return this.rulesMap; + }; + RulesProvider.prototype.ensureUpToDate = function (options) { + if (this.options == null || !ts.compareDataObjects(this.options, options)) { + var activeRules = this.createActiveRules(options); + var rulesMap = formatting.RulesMap.create(activeRules); + this.activeRules = activeRules; + this.rulesMap = rulesMap; + this.options = ts.clone(options); + } + }; + RulesProvider.prototype.createActiveRules = function (options) { + var rules = this.globalRules.HighPriorityCommonRules.slice(0); + if (options.InsertSpaceAfterCommaDelimiter) { + rules.push(this.globalRules.SpaceAfterComma); + } + else { + rules.push(this.globalRules.NoSpaceAfterComma); + } + if (options.InsertSpaceAfterFunctionKeywordForAnonymousFunctions) { + rules.push(this.globalRules.SpaceAfterAnonymousFunctionKeyword); + } + else { + rules.push(this.globalRules.NoSpaceAfterAnonymousFunctionKeyword); + } + if (options.InsertSpaceAfterKeywordsInControlFlowStatements) { + rules.push(this.globalRules.SpaceAfterKeywordInControl); + } + else { + rules.push(this.globalRules.NoSpaceAfterKeywordInControl); + } + if (options.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis) { + rules.push(this.globalRules.SpaceAfterOpenParen); + rules.push(this.globalRules.SpaceBeforeCloseParen); + rules.push(this.globalRules.NoSpaceBetweenParens); + } + else { + rules.push(this.globalRules.NoSpaceAfterOpenParen); + rules.push(this.globalRules.NoSpaceBeforeCloseParen); + rules.push(this.globalRules.NoSpaceBetweenParens); + } + if (options.InsertSpaceAfterSemicolonInForStatements) { + rules.push(this.globalRules.SpaceAfterSemicolonInFor); + } + else { + rules.push(this.globalRules.NoSpaceAfterSemicolonInFor); + } + if (options.InsertSpaceBeforeAndAfterBinaryOperators) { + rules.push(this.globalRules.SpaceBeforeBinaryOperator); + rules.push(this.globalRules.SpaceAfterBinaryOperator); + } + else { + rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); + rules.push(this.globalRules.NoSpaceAfterBinaryOperator); + } + if (options.PlaceOpenBraceOnNewLineForControlBlocks) { + rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); + } + if (options.PlaceOpenBraceOnNewLineForFunctions) { + rules.push(this.globalRules.NewLineBeforeOpenBraceInFunction); + rules.push(this.globalRules.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock); + } + rules = rules.concat(this.globalRules.LowPriorityCommonRules); + return rules; + }; + return RulesProvider; + })(); + formatting.RulesProvider = RulesProvider; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + function formatOnEnter(position, sourceFile, rulesProvider, options) { + var line = sourceFile.getLineAndCharacterFromPosition(position).line; + ts.Debug.assert(line >= 2); + var span = { + pos: ts.getStartPositionOfLine(line - 1, sourceFile), + end: ts.getEndLinePosition(line, sourceFile) + 1 + }; + return formatSpan(span, sourceFile, options, rulesProvider, 2 /* FormatOnEnter */); + } + formatting.formatOnEnter = formatOnEnter; + function formatOnSemicolon(position, sourceFile, rulesProvider, options) { + return formatOutermostParent(position, 21 /* SemicolonToken */, sourceFile, options, rulesProvider, 3 /* FormatOnSemicolon */); + } + formatting.formatOnSemicolon = formatOnSemicolon; + function formatOnClosingCurly(position, sourceFile, rulesProvider, options) { + return formatOutermostParent(position, 14 /* CloseBraceToken */, sourceFile, options, rulesProvider, 4 /* FormatOnClosingCurlyBrace */); + } + formatting.formatOnClosingCurly = formatOnClosingCurly; + function formatDocument(sourceFile, rulesProvider, options) { + var span = { + pos: 0, + end: sourceFile.text.length + }; + return formatSpan(span, sourceFile, options, rulesProvider, 0 /* FormatDocument */); + } + formatting.formatDocument = formatDocument; + function formatSelection(start, end, sourceFile, rulesProvider, options) { + var span = { + pos: ts.getStartLinePositionForPosition(start, sourceFile), + end: end + }; + return formatSpan(span, sourceFile, options, rulesProvider, 1 /* FormatSelection */); + } + formatting.formatSelection = formatSelection; + function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { + var parent = findOutermostParent(position, expectedLastToken, sourceFile); + if (!parent) { + return []; + } + var span = { + pos: ts.getStartLinePositionForPosition(parent.getStart(sourceFile), sourceFile), + end: parent.end + }; + return formatSpan(span, sourceFile, options, rulesProvider, requestKind); + } + function findOutermostParent(position, expectedTokenKind, sourceFile) { + var precedingToken = ts.findPrecedingToken(position, sourceFile); + if (!precedingToken || precedingToken.kind !== expectedTokenKind) { + return undefined; + } + var current = precedingToken; + while (current && current.parent && current.parent.end === precedingToken.end && !isListElement(current.parent, current)) { + current = current.parent; + } + return current; + } + function isListElement(parent, node) { + switch (parent.kind) { + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + return ts.rangeContainsRange(parent.members, node); + case 191 /* ModuleDeclaration */: + var body = parent.body; + return body && body.kind === 161 /* Block */ && ts.rangeContainsRange(body.statements, node); + case 196 /* SourceFile */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 192 /* ModuleBlock */: + return ts.rangeContainsRange(parent.statements, node); + } + return false; + } + function findEnclosingNode(range, sourceFile) { + return find(sourceFile); + function find(n) { + var candidate = ts.forEachChild(n, function (c) { return ts.startEndContainsRange(c.getStart(sourceFile), c.end, range) && c; }); + if (candidate) { + var result = find(candidate); + if (result) { + return result; + } + } + return n; + } + } + function prepareRangeContainsErrorFunction(errors, originalRange) { + if (!errors.length) { + return rangeHasNoErrors; + } + var sorted = errors.filter(function (d) { return d.isParseError && ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); }).sort(function (e1, e2) { return e1.start - e2.start; }); + if (!sorted.length) { + return rangeHasNoErrors; + } + var index = 0; + return function (r) { + while (true) { + if (index >= sorted.length) { + return false; + } + var error = sorted[index]; + if (r.end <= error.start) { + return false; + } + if (ts.startEndOverlapsWithStartEnd(r.pos, r.end, error.start, error.start + error.length)) { + return true; + } + index++; + } + }; + function rangeHasNoErrors(r) { + return false; + } + } + function getScanStartPosition(enclosingNode, originalRange, sourceFile) { + var start = enclosingNode.getStart(sourceFile); + if (start === originalRange.pos && enclosingNode.end === originalRange.end) { + return start; + } + var precedingToken = ts.findPrecedingToken(originalRange.pos, sourceFile); + return precedingToken ? precedingToken.end : enclosingNode.pos; + } + function formatSpan(originalRange, sourceFile, options, rulesProvider, requestKind) { + var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.getSyntacticDiagnostics(), originalRange); + var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); + var enclosingNode = findEnclosingNode(originalRange, sourceFile); + var formattingScanner = formatting.getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); + var initialIndentation = formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); + var previousRangeHasError; + var previousRange; + var previousParent; + var previousRangeStartLine; + var edits = []; + formattingScanner.advance(); + if (formattingScanner.isOnToken()) { + var startLine = sourceFile.getLineAndCharacterFromPosition(enclosingNode.getStart(sourceFile)).line; + var delta = formatting.SmartIndenter.shouldIndentChildNode(enclosingNode.kind, 0 /* Unknown */) ? options.IndentSize : 0; + processNode(enclosingNode, enclosingNode, startLine, initialIndentation, delta); + } + formattingScanner.close(); + return edits; + function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { + if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos)) { + if (inheritedIndentation !== -1 /* Unknown */) { + return inheritedIndentation; + } + } + else { + var startLine = sourceFile.getLineAndCharacterFromPosition(startPos).line; + var startLinePosition = ts.getStartLinePositionForPosition(startPos, sourceFile); + var column = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); + if (startLine !== parentStartLine || startPos === column) { + return column; + } + } + return -1 /* Unknown */; + } + function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { + var indentation = inheritedIndentation; + if (indentation === -1 /* Unknown */) { + if (isSomeBlock(node.kind)) { + if (isSomeBlock(parent.kind) || parent.kind === 196 /* SourceFile */ || parent.kind === 175 /* CaseClause */ || parent.kind === 176 /* DefaultClause */) { + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); + } + else { + indentation = parentDynamicIndentation.getIndentation(); + } + } + else { + if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + indentation = parentDynamicIndentation.getIndentation(); + } + else { + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); + } + } + } + var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */) ? options.IndentSize : 0; + if (effectiveParentStartLine === startLine) { + indentation = parentDynamicIndentation.getIndentation(); + delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); + } + return { + indentation: indentation, + delta: delta + }; + } + function getDynamicIndentation(node, nodeStartLine, indentation, delta) { + return { + getIndentationForComment: function (kind) { + switch (kind) { + case 14 /* CloseBraceToken */: + case 18 /* CloseBracketToken */: + return indentation + delta; + } + return indentation; + }, + getIndentationForToken: function (line, kind) { + switch (kind) { + case 13 /* OpenBraceToken */: + case 14 /* CloseBraceToken */: + case 17 /* OpenBracketToken */: + case 18 /* CloseBracketToken */: + case 74 /* ElseKeyword */: + case 98 /* WhileKeyword */: + return indentation; + default: + return nodeStartLine !== line ? indentation + delta : indentation; + } + }, + getIndentation: function () { return indentation; }, + getDelta: function () { return delta; }, + recomputeIndentation: function (lineAdded) { + if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { + if (lineAdded) { + indentation += options.IndentSize; + } + else { + indentation -= options.IndentSize; + } + if (formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */)) { + delta = options.IndentSize; + } + else { + delta = 0; + } + } + } + }; + } + function processNode(node, contextNode, nodeStartLine, indentation, delta) { + if (!ts.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { + return; + } + var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta); + var childContextNode = contextNode; + ts.forEachChild(node, function (child) { + processChildNode(child, -1 /* Unknown */, node, nodeDynamicIndentation, nodeStartLine, false); + }, function (nodes) { + processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); + }); + while (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > node.end) { + break; + } + consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); + } + function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, isListItem) { + var childStartPos = child.getStart(sourceFile); + var childStart = sourceFile.getLineAndCharacterFromPosition(childStartPos); + var childIndentationAmount = -1 /* Unknown */; + if (isListItem) { + childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); + if (childIndentationAmount !== -1 /* Unknown */) { + inheritedIndentation = childIndentationAmount; + } + } + if (!ts.rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) { + return inheritedIndentation; + } + if (child.kind === 120 /* Missing */) { + return inheritedIndentation; + } + while (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > childStartPos) { + break; + } + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + } + if (!formattingScanner.isOnToken()) { + return inheritedIndentation; + } + if (ts.isToken(child)) { + var tokenInfo = formattingScanner.readTokenInfo(node); + ts.Debug.assert(tokenInfo.token.end === child.end); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + return inheritedIndentation; + } + var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); + processNode(child, childContextNode, childStart.line, childIndentation.indentation, childIndentation.delta); + childContextNode = node; + return inheritedIndentation; + } + function processChildNodes(nodes, parent, parentStartLine, parentDynamicIndentation) { + var listStartToken = getOpenTokenForList(parent, nodes); + var listEndToken = getCloseTokenForOpenToken(listStartToken); + var listDynamicIndentation = parentDynamicIndentation; + var startLine = parentStartLine; + if (listStartToken !== 0 /* Unknown */) { + while (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.end > nodes.pos) { + break; + } + else if (tokenInfo.token.kind === listStartToken) { + startLine = sourceFile.getLineAndCharacterFromPosition(tokenInfo.token.pos).line; + var indentation = computeIndentation(tokenInfo.token, startLine, -1 /* Unknown */, parent, parentDynamicIndentation, startLine); + listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation.indentation, indentation.delta); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + } + else { + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + } + } + } + var inheritedIndentation = -1 /* Unknown */; + for (var i = 0, len = nodes.length; i < len; ++i) { + inheritedIndentation = processChildNode(nodes[i], inheritedIndentation, node, listDynamicIndentation, startLine, true); + } + if (listEndToken !== 0 /* Unknown */) { + if (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.kind === listEndToken) { + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + } + } + } + } + function consumeTokenAndAdvanceScanner(currentTokenInfo, parent, dynamicIndentation) { + ts.Debug.assert(ts.rangeContainsRange(parent, currentTokenInfo.token)); + var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); + var indentToken = false; + if (currentTokenInfo.leadingTrivia) { + processTrivia(currentTokenInfo.leadingTrivia, parent, childContextNode, dynamicIndentation); + } + var lineAdded; + var isTokenInRange = ts.rangeContainsRange(originalRange, currentTokenInfo.token); + var tokenStart = sourceFile.getLineAndCharacterFromPosition(currentTokenInfo.token.pos); + if (isTokenInRange) { + var prevStartLine = previousRangeStartLine; + lineAdded = processRange(currentTokenInfo.token, tokenStart, parent, childContextNode, dynamicIndentation); + if (lineAdded !== undefined) { + indentToken = lineAdded; + } + else { + indentToken = lastTriviaWasNewLine && tokenStart.line !== prevStartLine; + } + } + if (currentTokenInfo.trailingTrivia) { + processTrivia(currentTokenInfo.trailingTrivia, parent, childContextNode, dynamicIndentation); + } + if (indentToken) { + var indentNextTokenOrTrivia = true; + if (currentTokenInfo.leadingTrivia) { + for (var i = 0, len = currentTokenInfo.leadingTrivia.length; i < len; ++i) { + var triviaItem = currentTokenInfo.leadingTrivia[i]; + if (!ts.rangeContainsRange(originalRange, triviaItem)) { + continue; + } + var triviaStartLine = sourceFile.getLineAndCharacterFromPosition(triviaItem.pos).line; + switch (triviaItem.kind) { + case 3 /* MultiLineCommentTrivia */: + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + indentMultilineComment(triviaItem, commentIndentation, !indentNextTokenOrTrivia); + indentNextTokenOrTrivia = false; + break; + case 2 /* SingleLineCommentTrivia */: + if (indentNextTokenOrTrivia) { + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + insertIndentation(triviaItem.pos, commentIndentation, false); + indentNextTokenOrTrivia = false; + } + break; + case 4 /* NewLineTrivia */: + indentNextTokenOrTrivia = true; + break; + } + } + } + if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { + var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); + insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); + } + } + formattingScanner.advance(); + childContextNode = parent; + } + } + function processTrivia(trivia, parent, contextNode, dynamicIndentation) { + for (var i = 0, len = trivia.length; i < len; ++i) { + var triviaItem = trivia[i]; + if (ts.isComment(triviaItem.kind) && ts.rangeContainsRange(originalRange, triviaItem)) { + var triviaItemStart = sourceFile.getLineAndCharacterFromPosition(triviaItem.pos); + processRange(triviaItem, triviaItemStart, parent, contextNode, dynamicIndentation); + } + } + } + function processRange(range, rangeStart, parent, contextNode, dynamicIndentation) { + var rangeHasError = rangeContainsError(range); + var lineAdded; + if (!rangeHasError && !previousRangeHasError) { + if (!previousRange) { + var originalStart = sourceFile.getLineAndCharacterFromPosition(originalRange.pos); + trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); + } + else { + lineAdded = processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); + } + } + previousRange = range; + previousParent = parent; + previousRangeStartLine = rangeStart.line; + previousRangeHasError = rangeHasError; + return lineAdded; + } + function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { + formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode); + var rule = rulesProvider.getRulesMap().GetRule(formattingContext); + var trimTrailingWhitespaces; + var lineAdded; + if (rule) { + applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); + if (rule.Operation.Action & (2 /* Space */ | 8 /* Delete */) && currentStartLine !== previousStartLine) { + if (currentParent.getStart(sourceFile) === currentItem.pos) { + lineAdded = false; + } + } + else if (rule.Operation.Action & 4 /* NewLine */ && currentStartLine === previousStartLine) { + if (currentParent.getStart(sourceFile) === currentItem.pos) { + lineAdded = true; + } + } + if (lineAdded !== undefined) { + dynamicIndentation.recomputeIndentation(lineAdded); + } + trimTrailingWhitespaces = (rule.Operation.Action & (4 /* NewLine */ | 2 /* Space */)) && rule.Flag !== 1 /* CanDeleteNewLines */; + } + else { + trimTrailingWhitespaces = true; + } + if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { + trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem); + } + return lineAdded; + } + function insertIndentation(pos, indentation, lineAdded) { + var indentationString = formatting.getIndentationString(indentation, options); + if (lineAdded) { + recordReplace(pos, 0, indentationString); + } + else { + var tokenStart = sourceFile.getLineAndCharacterFromPosition(pos); + if (indentation !== tokenStart.character - 1) { + var startLinePosition = ts.getStartPositionOfLine(tokenStart.line, sourceFile); + recordReplace(startLinePosition, tokenStart.character - 1, indentationString); + } + } + } + function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { + var startLine = sourceFile.getLineAndCharacterFromPosition(commentRange.pos).line; + var endLine = sourceFile.getLineAndCharacterFromPosition(commentRange.end).line; + if (startLine === endLine) { + if (!firstLineIsIndented) { + insertIndentation(commentRange.pos, indentation, false); + } + return; + } + else { + var parts = []; + var startPos = commentRange.pos; + for (var line = startLine; line < endLine; ++line) { + var endOfLine = ts.getEndLinePosition(line, sourceFile); + parts.push({ pos: startPos, end: endOfLine }); + startPos = ts.getStartPositionOfLine(line + 1, sourceFile); + } + parts.push({ pos: startPos, end: commentRange.end }); + } + var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); + var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePos, parts[0].pos, sourceFile, options); + if (indentation === nonWhitespaceColumnInFirstPart) { + return; + } + var startIndex = 0; + if (firstLineIsIndented) { + startIndex = 1; + startLine++; + } + var delta = indentation - nonWhitespaceColumnInFirstPart; + for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { + var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); + var nonWhitespaceColumn = i === 0 ? nonWhitespaceColumnInFirstPart : formatting.SmartIndenter.findFirstNonWhitespaceColumn(parts[i].pos, parts[i].end, sourceFile, options); + var newIndentation = nonWhitespaceColumn + delta; + if (newIndentation > 0) { + var indentationString = formatting.getIndentationString(newIndentation, options); + recordReplace(startLinePos, nonWhitespaceColumn, indentationString); + } + else { + recordDelete(startLinePos, nonWhitespaceColumn); + } + } + } + function trimTrailingWhitespacesForLines(line1, line2, range) { + for (var line = line1; line < line2; ++line) { + var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + var lineEndPosition = ts.getEndLinePosition(line, sourceFile); + if (range && ts.isComment(range.kind) && range.pos <= lineEndPosition && range.end > lineEndPosition) { + continue; + } + var pos = lineEndPosition; + while (pos >= lineStartPosition && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { + pos--; + } + if (pos !== lineEndPosition) { + ts.Debug.assert(pos === lineStartPosition || !ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))); + recordDelete(pos + 1, lineEndPosition - pos); + } + } + } + function newTextChange(start, len, newText) { + return { span: new ts.TextSpan(start, len), newText: newText }; + } + function recordDelete(start, len) { + if (len) { + edits.push(newTextChange(start, len, "")); + } + } + function recordReplace(start, len, newText) { + if (len || newText) { + edits.push(newTextChange(start, len, newText)); + } + } + function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { + var between; + switch (rule.Operation.Action) { + case 1 /* Ignore */: + return; + case 8 /* Delete */: + if (previousRange.end !== currentRange.pos) { + recordDelete(previousRange.end, currentRange.pos - previousRange.end); + } + break; + case 4 /* NewLine */: + if (rule.Flag !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { + return; + } + var lineDelta = currentStartLine - previousStartLine; + if (lineDelta !== 1) { + recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.NewLineCharacter); + } + break; + case 2 /* Space */: + if (rule.Flag !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { + return; + } + var posDelta = currentRange.pos - previousRange.end; + if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32 /* space */) { + recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); + } + break; + } + } + } + function isSomeBlock(kind) { + switch (kind) { + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 192 /* ModuleBlock */: + return true; + } + return false; + } + function getOpenTokenForList(node, list) { + switch (node.kind) { + case 126 /* Constructor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 125 /* Method */: + case 153 /* ArrowFunction */: + if (node.typeParameters === list) { + return 23 /* LessThanToken */; + } + else if (node.parameters === list) { + return 15 /* OpenParenToken */; + } + break; + case 147 /* CallExpression */: + case 148 /* NewExpression */: + if (node.typeArguments === list) { + return 23 /* LessThanToken */; + } + else if (node.arguments === list) { + return 15 /* OpenParenToken */; + } + break; + case 132 /* TypeReference */: + if (node.typeArguments === list) { + return 23 /* LessThanToken */; + } + } + return 0 /* Unknown */; + } + function getCloseTokenForOpenToken(kind) { + switch (kind) { + case 15 /* OpenParenToken */: + return 16 /* CloseParenToken */; + case 23 /* LessThanToken */: + return 24 /* GreaterThanToken */; + } + return 0 /* Unknown */; + } + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var ScriptSnapshot; + (function (ScriptSnapshot) { + var StringScriptSnapshot = (function () { + function StringScriptSnapshot(text) { + this.text = text; + this._lineStartPositions = undefined; + } + StringScriptSnapshot.prototype.getText = function (start, end) { + return this.text.substring(start, end); + }; + StringScriptSnapshot.prototype.getLength = function () { + return this.text.length; + }; + StringScriptSnapshot.prototype.getLineStartPositions = function () { + if (!this._lineStartPositions) { + this._lineStartPositions = ts.computeLineStarts(this.text); + } + return this._lineStartPositions; + }; + StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) { + throw new Error("not yet implemented"); + }; + return StringScriptSnapshot; + })(); + function fromString(text) { + return new StringScriptSnapshot(text); + } + ScriptSnapshot.fromString = fromString; + })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); + var scanner = ts.createScanner(2 /* Latest */, true); var emptyArray = []; function createNode(kind, pos, end, flags, parent) { var node = new (ts.getNodeConstructor(kind))(); @@ -30667,13 +19351,10 @@ var ts; function NodeObject() { } NodeObject.prototype.getSourceFile = function () { - var node = this; - while (node.kind !== 177 /* SourceFile */) - node = node.parent; - return node; + return ts.getSourceFileOfNode(this); }; - NodeObject.prototype.getStart = function () { - return ts.getTokenPosOfNode(this); + NodeObject.prototype.getStart = function (sourceFile) { + return ts.getTokenPosOfNode(this, sourceFile); }; NodeObject.prototype.getFullStart = function () { return this.pos; @@ -30681,30 +19362,33 @@ var ts; NodeObject.prototype.getEnd = function () { return this.end; }; - NodeObject.prototype.getWidth = function () { - return this.getEnd() - this.getStart(); + NodeObject.prototype.getWidth = function (sourceFile) { + return this.getEnd() - this.getStart(sourceFile); }; NodeObject.prototype.getFullWidth = function () { return this.end - this.getFullStart(); }; - NodeObject.prototype.getLeadingTriviaWidth = function () { - return this.getStart() - this.pos; + NodeObject.prototype.getLeadingTriviaWidth = function (sourceFile) { + return this.getStart(sourceFile) - this.pos; }; - NodeObject.prototype.getFullText = function () { - return this.getSourceFile().text.substring(this.pos, this.end); + NodeObject.prototype.getFullText = function (sourceFile) { + return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); + }; + NodeObject.prototype.getText = function (sourceFile) { + return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd()); }; NodeObject.prototype.addSyntheticNodes = function (nodes, pos, end) { scanner.setTextPos(pos); while (pos < end) { var token = scanner.scan(); var textPos = scanner.getTextPos(); - var node = nodes.push(createNode(token, pos, textPos, 256 /* Synthetic */, this)); + nodes.push(createNode(token, pos, textPos, 512 /* Synthetic */, this)); pos = textPos; } return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(179 /* SyntaxList */, nodes.pos, nodes.end, 256 /* Synthetic */, this); + var list = createNode(198 /* SyntaxList */, nodes.pos, nodes.end, 512 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var i = 0, len = nodes.length; i < len; i++) { @@ -30720,10 +19404,10 @@ var ts; } return list; }; - NodeObject.prototype.createChildren = function () { + NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; - if (this.kind > 111 /* Missing */) { - scanner.setText(this.getSourceFile().text); + if (this.kind > 120 /* Missing */) { + scanner.setText((sourceFile || this.getSourceFile()).text); var children = []; var pos = this.pos; var processNode = function (node) { @@ -30748,39 +19432,39 @@ var ts; } this._children = children || emptyArray; }; - NodeObject.prototype.getChildCount = function () { + NodeObject.prototype.getChildCount = function (sourceFile) { if (!this._children) - this.createChildren(); + this.createChildren(sourceFile); return this._children.length; }; - NodeObject.prototype.getChildAt = function (index) { + NodeObject.prototype.getChildAt = function (index, sourceFile) { if (!this._children) - this.createChildren(); + this.createChildren(sourceFile); return this._children[index]; }; - NodeObject.prototype.getChildren = function () { + NodeObject.prototype.getChildren = function (sourceFile) { if (!this._children) - this.createChildren(); + this.createChildren(sourceFile); return this._children; }; - NodeObject.prototype.getFirstToken = function () { + NodeObject.prototype.getFirstToken = function (sourceFile) { var children = this.getChildren(); for (var i = 0; i < children.length; i++) { var child = children[i]; - if (child.kind < 111 /* Missing */) + if (child.kind < 120 /* Missing */) return child; - if (child.kind > 111 /* Missing */) - return child.getFirstToken(); + if (child.kind > 120 /* Missing */) + return child.getFirstToken(sourceFile); } }; - NodeObject.prototype.getLastToken = function () { - var children = this.getChildren(); + NodeObject.prototype.getLastToken = function (sourceFile) { + var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 111 /* Missing */) + if (child.kind < 120 /* Missing */) return child; - if (child.kind > 111 /* Missing */) - return child.getLastToken(); + if (child.kind > 120 /* Missing */) + return child.getLastToken(sourceFile); } }; return NodeObject; @@ -30799,8 +19483,242 @@ var ts; SymbolObject.prototype.getDeclarations = function () { return this.declarations; }; + SymbolObject.prototype.getDocumentationComment = function () { + if (this.documentationComment === undefined) { + this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4 /* Property */)); + } + return this.documentationComment; + }; return SymbolObject; })(); + function getJsDocCommentsFromDeclarations(declarations, name, canUseParsedParamTagComments) { + var documentationComment = []; + var docComments = getJsDocCommentsSeparatedByNewLines(); + ts.forEach(docComments, function (docComment) { + if (documentationComment.length) { + documentationComment.push(lineBreakPart()); + } + documentationComment.push(docComment); + }); + return documentationComment; + function getJsDocCommentsSeparatedByNewLines() { + var paramTag = "@param"; + var jsDocCommentParts = []; + ts.forEach(declarations, function (declaration) { + var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); + if (canUseParsedParamTagComments && declaration.kind === 123 /* Parameter */) { + ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); + if (cleanedParamJsDocComment) { + jsDocCommentParts.push.apply(jsDocCommentParts, cleanedParamJsDocComment); + } + }); + } + if (declaration.kind === 191 /* ModuleDeclaration */ && declaration.body.kind === 191 /* ModuleDeclaration */) { + return; + } + while (declaration.kind === 191 /* ModuleDeclaration */ && declaration.parent.kind === 191 /* ModuleDeclaration */) { + declaration = declaration.parent; + } + ts.forEach(getJsDocCommentTextRange(declaration.kind === 184 /* VariableDeclaration */ ? declaration.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); + if (cleanedJsDocComment) { + jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); + } + }); + }); + return jsDocCommentParts; + function getJsDocCommentTextRange(node, sourceFile) { + return ts.map(ts.getJsDocComments(node, sourceFile), function (jsDocComment) { + return { + pos: jsDocComment.pos + "/*".length, + end: jsDocComment.end - "*/".length + }; + }); + } + function consumeWhiteSpacesOnTheLine(pos, end, sourceFile, maxSpacesToRemove) { + if (maxSpacesToRemove !== undefined) { + end = Math.min(end, pos + maxSpacesToRemove); + } + for (; pos < end; pos++) { + var ch = sourceFile.text.charCodeAt(pos); + if (!ts.isWhiteSpace(ch) || ts.isLineBreak(ch)) { + return pos; + } + } + return end; + } + function consumeLineBreaks(pos, end, sourceFile) { + while (pos < end && ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { + pos++; + } + return pos; + } + function isName(pos, end, sourceFile, name) { + return pos + name.length < end && sourceFile.text.substr(pos, name.length) === name && (ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) || ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); + } + function isParamTag(pos, end, sourceFile) { + return isName(pos, end, sourceFile, paramTag); + } + function pushDocCommentLineText(docComments, text, blankLineCount) { + while (blankLineCount--) + docComments.push(textPart("")); + docComments.push(textPart(text)); + } + function getCleanedJsDocComment(pos, end, sourceFile) { + var spacesToRemoveAfterAsterisk; + var docComments = []; + var blankLineCount = 0; + var isInParamTag = false; + while (pos < end) { + var docCommentTextOfLine = ""; + pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile); + if (pos < end && sourceFile.text.charCodeAt(pos) === 42 /* asterisk */) { + var lineStartPos = pos + 1; + pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, spacesToRemoveAfterAsterisk); + if (spacesToRemoveAfterAsterisk === undefined && pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { + spacesToRemoveAfterAsterisk = pos - lineStartPos; + } + } + else if (spacesToRemoveAfterAsterisk === undefined) { + spacesToRemoveAfterAsterisk = 0; + } + while (pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { + var ch = sourceFile.text.charAt(pos); + if (ch === "@") { + if (isParamTag(pos, end, sourceFile)) { + isInParamTag = true; + pos += paramTag.length; + continue; + } + else { + isInParamTag = false; + } + } + if (!isInParamTag) { + docCommentTextOfLine += ch; + } + pos++; + } + pos = consumeLineBreaks(pos, end, sourceFile); + if (docCommentTextOfLine) { + pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); + blankLineCount = 0; + } + else if (!isInParamTag && docComments.length) { + blankLineCount++; + } + } + return docComments; + } + function getCleanedParamJsDocComment(pos, end, sourceFile) { + var paramHelpStringMargin; + var paramDocComments = []; + while (pos < end) { + if (isParamTag(pos, end, sourceFile)) { + var blankLineCount = 0; + var recordedParamTag = false; + pos = consumeWhiteSpaces(pos + paramTag.length); + if (pos >= end) { + break; + } + if (sourceFile.text.charCodeAt(pos) === 123 /* openBrace */) { + pos++; + for (var curlies = 1; pos < end; pos++) { + var charCode = sourceFile.text.charCodeAt(pos); + if (charCode === 123 /* openBrace */) { + curlies++; + continue; + } + if (charCode === 125 /* closeBrace */) { + curlies--; + if (curlies === 0) { + pos++; + break; + } + else { + continue; + } + } + if (charCode === 64 /* at */) { + break; + } + } + pos = consumeWhiteSpaces(pos); + if (pos >= end) { + break; + } + } + if (isName(pos, end, sourceFile, name)) { + pos = consumeWhiteSpaces(pos + name.length); + if (pos >= end) { + break; + } + var paramHelpString = ""; + var firstLineParamHelpStringPos = pos; + while (pos < end) { + var ch = sourceFile.text.charCodeAt(pos); + if (ts.isLineBreak(ch)) { + if (paramHelpString) { + pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); + paramHelpString = ""; + blankLineCount = 0; + recordedParamTag = true; + } + else if (recordedParamTag) { + blankLineCount++; + } + setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos); + continue; + } + if (ch === 64 /* at */) { + break; + } + paramHelpString += sourceFile.text.charAt(pos); + pos++; + } + if (paramHelpString) { + pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); + } + paramHelpStringMargin = undefined; + } + if (sourceFile.text.charCodeAt(pos) === 64 /* at */) { + continue; + } + } + pos++; + } + return paramDocComments; + function consumeWhiteSpaces(pos) { + while (pos < end && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { + pos++; + } + return pos; + } + function setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos) { + pos = consumeLineBreaks(pos, end, sourceFile); + if (pos >= end) { + return; + } + if (paramHelpStringMargin === undefined) { + paramHelpStringMargin = sourceFile.getLineAndCharacterFromPosition(firstLineParamHelpStringPos).character - 1; + } + var startOfLinePos = pos; + pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile, paramHelpStringMargin); + if (pos >= end) { + return; + } + var consumedSpaces = pos - startOfLinePos; + if (consumedSpaces < paramHelpStringMargin) { + var ch = sourceFile.text.charCodeAt(pos); + if (ch === 42 /* asterisk */) { + pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); + } + } + } + } + } + } var TypeObject = (function () { function TypeObject(checker, flags) { this.checker = checker; @@ -30819,7 +19737,7 @@ var ts; return this.checker.getPropertyOfType(this, propertyName); }; TypeObject.prototype.getApparentProperties = function () { - return this.checker.getAugmentedPropertiesOfApparentType(this); + return this.checker.getAugmentedPropertiesOfType(this); }; TypeObject.prototype.getCallSignatures = function () { return this.checker.getSignaturesOfType(this, 0 /* Call */); @@ -30851,9 +19769,14 @@ var ts; SignatureObject.prototype.getReturnType = function () { return this.checker.getReturnTypeOfSignature(this); }; + SignatureObject.prototype.getDocumentationComment = function () { + if (this.documentationComment === undefined) { + this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], undefined, false) : []; + } + return this.documentationComment; + }; return SignatureObject; })(); - var incrementalParse = TypeScript.IncrementalParser.parse; var SourceFileObject = (function (_super) { __extends(SourceFileObject, _super); function SourceFileObject() { @@ -30865,255 +19788,124 @@ var ts; SourceFileObject.prototype.getPositionFromLineAndCharacter = function (line, character) { return -1; }; - SourceFileObject.prototype.getSourceUnit = function () { - return this.getSyntaxTree().sourceUnit(); + SourceFileObject.prototype.getLineStarts = function () { + return undefined; + }; + SourceFileObject.prototype.getSyntacticDiagnostics = function () { + return undefined; }; SourceFileObject.prototype.getScriptSnapshot = function () { return this.scriptSnapshot; }; - SourceFileObject.prototype.getLineMap = function () { - return this.getSyntaxTree().lineMap(); - }; - SourceFileObject.prototype.getSyntaxTree = function () { - if (!this.syntaxTree) { - var start = new Date().getTime(); - this.syntaxTree = TypeScript.Parser.parse(this.filename, TypeScript.SimpleText.fromScriptSnapshot(this.scriptSnapshot), this.languageVersion, this.isDeclareFile()); - var time = new Date().getTime() - start; - } - return this.syntaxTree; - }; - SourceFileObject.prototype.isDeclareFile = function () { - return TypeScript.isDTSFile(this.filename); - }; - SourceFileObject.prototype.getBloomFilter = function () { - if (!this.bloomFilter) { - var identifiers = TypeScript.createIntrinsicsObject(); - var pre = function (cur) { - if (TypeScript.ASTHelpers.isValidAstNode(cur)) { - if (cur.kind() === 11 /* IdentifierName */) { - var nodeText = TypeScript.tokenValueText(cur); - identifiers[nodeText] = true; - } + SourceFileObject.prototype.getNamedDeclarations = function () { + if (!this.namedDeclarations) { + var sourceFile = this; + var namedDeclarations = []; + ts.forEachChild(sourceFile, function visit(node) { + switch (node.kind) { + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + var functionDeclaration = node; + if (functionDeclaration.name && functionDeclaration.name.kind !== 120 /* Missing */) { + var lastDeclaration = namedDeclarations.length > 0 ? namedDeclarations[namedDeclarations.length - 1] : undefined; + if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { + if (functionDeclaration.body && !lastDeclaration.body) { + namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; + } + } + else { + namedDeclarations.push(node); + } + ts.forEachChild(node, visit); + } + break; + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 136 /* TypeLiteral */: + if (node.name) { + namedDeclarations.push(node); + } + case 126 /* Constructor */: + case 162 /* VariableStatement */: + case 192 /* ModuleBlock */: + case 186 /* FunctionBlock */: + ts.forEachChild(node, visit); + break; + case 123 /* Parameter */: + if (!(node.flags & 112 /* AccessibilityModifier */)) { + break; + } + case 184 /* VariableDeclaration */: + case 195 /* EnumMember */: + case 124 /* Property */: + namedDeclarations.push(node); + break; } - }; - TypeScript.getAstWalkerFactory().simpleWalk(this.getSourceUnit(), pre, null, identifiers); - var identifierCount = 0; - for (var name in identifiers) { - if (identifiers[name]) { - identifierCount++; - } - } - this.bloomFilter = new TypeScript.BloomFilter(identifierCount); - this.bloomFilter.addKeys(identifiers); + }); + this.namedDeclarations = namedDeclarations; } - return this.bloomFilter; + return this.namedDeclarations; }; SourceFileObject.prototype.update = function (scriptSnapshot, version, isOpen, textChangeRange) { - var oldSyntaxTree = this.syntaxTree; if (textChangeRange && ts.Debug.shouldAssert(1 /* Normal */)) { var oldText = this.scriptSnapshot; var newText = scriptSnapshot; - TypeScript.Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); + ts.Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); if (ts.Debug.shouldAssert(3 /* VeryAggressive */)) { var oldTextPrefix = oldText.getText(0, textChangeRange.span().start()); var newTextPrefix = newText.getText(0, textChangeRange.span().start()); - TypeScript.Debug.assert(oldTextPrefix === newTextPrefix); + ts.Debug.assert(oldTextPrefix === newTextPrefix); var oldTextSuffix = oldText.getText(textChangeRange.span().end(), oldText.getLength()); var newTextSuffix = newText.getText(textChangeRange.newSpan().end(), newText.getLength()); - TypeScript.Debug.assert(oldTextSuffix === newTextSuffix); + ts.Debug.assert(oldTextSuffix === newTextSuffix); } } - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var newSyntaxTree = !textChangeRange || !oldSyntaxTree ? TypeScript.Parser.parse(this.filename, text, this.languageVersion, TypeScript.isDTSFile(this.filename)) : TypeScript.IncrementalParser.parse(oldSyntaxTree, textChangeRange, text); - return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen, newSyntaxTree); + return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen); }; - SourceFileObject.createSourceFileObject = function (filename, scriptSnapshot, languageVersion, version, isOpen, syntaxTree) { + SourceFileObject.createSourceFileObject = function (filename, scriptSnapshot, languageVersion, version, isOpen) { var newSourceFile = ts.createSourceFile(filename, scriptSnapshot.getText(0, scriptSnapshot.getLength()), languageVersion, version, isOpen); newSourceFile.scriptSnapshot = scriptSnapshot; - newSourceFile.syntaxTree = syntaxTree; return newSourceFile; }; return SourceFileObject; })(NodeObject); - var NavigationBarItem = (function () { - function NavigationBarItem(text, kind, kindModifiers, spans, childItems, indent, bolded, grayed) { - if (childItems === void 0) { childItems = null; } - if (indent === void 0) { indent = 0; } - if (bolded === void 0) { bolded = false; } - if (grayed === void 0) { grayed = false; } - this.text = text; - this.kind = kind; - this.kindModifiers = kindModifiers; - this.spans = spans; - this.childItems = childItems; - this.indent = indent; - this.bolded = bolded; - this.grayed = grayed; - } - return NavigationBarItem; - })(); - ts.NavigationBarItem = NavigationBarItem; - var TodoCommentDescriptor = (function () { - function TodoCommentDescriptor(text, priority) { - this.text = text; - this.priority = priority; - } - return TodoCommentDescriptor; - })(); - ts.TodoCommentDescriptor = TodoCommentDescriptor; - var TodoComment = (function () { - function TodoComment(descriptor, message, position) { - this.descriptor = descriptor; - this.message = message; - this.position = position; - } - return TodoComment; - })(); - ts.TodoComment = TodoComment; var TextChange = (function () { - function TextChange(span, newText) { - this.span = span; - this.newText = newText; + function TextChange() { } - TextChange.createInsert = function (pos, newText) { - return new TextChange(new TypeScript.TextSpan(pos, 0), newText); - }; - TextChange.createDelete = function (start, end) { - return new TextChange(TypeScript.TextSpan.fromBounds(start, end), ""); - }; - TextChange.createReplace = function (start, end, newText) { - return new TextChange(TypeScript.TextSpan.fromBounds(start, end), newText); - }; return TextChange; })(); ts.TextChange = TextChange; - var ReferenceEntry = (function () { - function ReferenceEntry(fileName, textSpan, isWriteAccess) { - this.fileName = ""; - this.isWriteAccess = false; - this.fileName = fileName; - this.textSpan = textSpan; - this.isWriteAccess = isWriteAccess; - } - return ReferenceEntry; - })(); - ts.ReferenceEntry = ReferenceEntry; - var NavigateToItem = (function () { - function NavigateToItem(name, kind, kindModifiers, matchKind, fileName, textSpan, containerName, containerKind) { - this.name = name; - this.kind = kind; - this.kindModifiers = kindModifiers; - this.matchKind = matchKind; - this.fileName = fileName; - this.textSpan = textSpan; - this.containerName = containerName; - this.containerKind = containerKind; - } - return NavigateToItem; - })(); - ts.NavigateToItem = NavigateToItem; - var DefinitionInfo = (function () { - function DefinitionInfo(fileName, textSpan, kind, name, containerKind, containerName) { - this.fileName = fileName; - this.textSpan = textSpan; - this.kind = kind; - this.name = name; - this.containerKind = containerKind; - this.containerName = containerName; - } - return DefinitionInfo; - })(); - ts.DefinitionInfo = DefinitionInfo; - var TypeInfo = (function () { - function TypeInfo(memberName, docComment, fullSymbolName, kind, textSpan) { - this.memberName = memberName; - this.docComment = docComment; - this.fullSymbolName = fullSymbolName; - this.kind = kind; - this.textSpan = textSpan; - } - return TypeInfo; - })(); - ts.TypeInfo = TypeInfo; - var RenameInfo = (function () { - function RenameInfo(canRename, localizedErrorMessage, displayName, fullDisplayName, kind, kindModifiers, triggerSpan) { - this.canRename = canRename; - this.localizedErrorMessage = localizedErrorMessage; - this.displayName = displayName; - this.fullDisplayName = fullDisplayName; - this.kind = kind; - this.kindModifiers = kindModifiers; - this.triggerSpan = triggerSpan; - } - RenameInfo.CreateError = function (localizedErrorMessage) { - return new RenameInfo(false, localizedErrorMessage, null, null, null, null, null); - }; - RenameInfo.Create = function (displayName, fullDisplayName, kind, kindModifiers, triggerSpan) { - return new RenameInfo(true, null, displayName, fullDisplayName, kind, kindModifiers, triggerSpan); - }; - return RenameInfo; - })(); - ts.RenameInfo = RenameInfo; - var SignatureHelpParameter = (function () { - function SignatureHelpParameter(name, documentation, display, isOptional) { - this.name = name; - this.documentation = documentation; - this.display = display; - this.isOptional = isOptional; - } - return SignatureHelpParameter; - })(); - ts.SignatureHelpParameter = SignatureHelpParameter; - var SignatureHelpItem = (function () { - function SignatureHelpItem(isVariadic, prefix, suffix, separator, parameters, documentation) { - this.isVariadic = isVariadic; - this.prefix = prefix; - this.suffix = suffix; - this.separator = separator; - this.parameters = parameters; - this.documentation = documentation; - } - return SignatureHelpItem; - })(); - ts.SignatureHelpItem = SignatureHelpItem; - var SignatureHelpItems = (function () { - function SignatureHelpItems(items, applicableSpan, selectedItemIndex) { - this.items = items; - this.applicableSpan = applicableSpan; - this.selectedItemIndex = selectedItemIndex; - } - return SignatureHelpItems; - })(); - ts.SignatureHelpItems = SignatureHelpItems; - var SignatureHelpState = (function () { - function SignatureHelpState(argumentIndex, argumentCount) { - this.argumentIndex = argumentIndex; - this.argumentCount = argumentCount; - } - return SignatureHelpState; - })(); - ts.SignatureHelpState = SignatureHelpState; - (function (EmitOutputResult) { - EmitOutputResult[EmitOutputResult["Succeeded"] = 0] = "Succeeded"; - EmitOutputResult[EmitOutputResult["FailedBecauseOfSyntaxErrors"] = 1] = "FailedBecauseOfSyntaxErrors"; - EmitOutputResult[EmitOutputResult["FailedBecauseOfCompilerOptionsErrors"] = 2] = "FailedBecauseOfCompilerOptionsErrors"; - EmitOutputResult[EmitOutputResult["FailedToGenerateDeclarationsBecauseOfSemanticErrors"] = 3] = "FailedToGenerateDeclarationsBecauseOfSemanticErrors"; - })(ts.EmitOutputResult || (ts.EmitOutputResult = {})); - var EmitOutputResult = ts.EmitOutputResult; - (function (OutputFileType) { - OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript"; - OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap"; - OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration"; - })(ts.OutputFileType || (ts.OutputFileType = {})); - var OutputFileType = ts.OutputFileType; - (function (EndOfLineState) { - EndOfLineState[EndOfLineState["Start"] = 0] = "Start"; - EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; - EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; - EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; - EndOfLineState[EndOfLineState["EndingWithDotToken"] = 4] = "EndingWithDotToken"; - })(ts.EndOfLineState || (ts.EndOfLineState = {})); - var EndOfLineState = ts.EndOfLineState; + (function (SymbolDisplayPartKind) { + SymbolDisplayPartKind[SymbolDisplayPartKind["aliasName"] = 0] = "aliasName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["className"] = 1] = "className"; + SymbolDisplayPartKind[SymbolDisplayPartKind["enumName"] = 2] = "enumName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["fieldName"] = 3] = "fieldName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["interfaceName"] = 4] = "interfaceName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["keyword"] = 5] = "keyword"; + SymbolDisplayPartKind[SymbolDisplayPartKind["lineBreak"] = 6] = "lineBreak"; + SymbolDisplayPartKind[SymbolDisplayPartKind["numericLiteral"] = 7] = "numericLiteral"; + SymbolDisplayPartKind[SymbolDisplayPartKind["stringLiteral"] = 8] = "stringLiteral"; + SymbolDisplayPartKind[SymbolDisplayPartKind["localName"] = 9] = "localName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["methodName"] = 10] = "methodName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["moduleName"] = 11] = "moduleName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["operator"] = 12] = "operator"; + SymbolDisplayPartKind[SymbolDisplayPartKind["parameterName"] = 13] = "parameterName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["propertyName"] = 14] = "propertyName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["punctuation"] = 15] = "punctuation"; + SymbolDisplayPartKind[SymbolDisplayPartKind["space"] = 16] = "space"; + SymbolDisplayPartKind[SymbolDisplayPartKind["text"] = 17] = "text"; + SymbolDisplayPartKind[SymbolDisplayPartKind["typeParameterName"] = 18] = "typeParameterName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["enumMemberName"] = 19] = "enumMemberName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["functionName"] = 20] = "functionName"; + SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; + })(ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {})); + var SymbolDisplayPartKind = ts.SymbolDisplayPartKind; (function (TokenClass) { TokenClass[TokenClass["Punctuation"] = 0] = "Punctuation"; TokenClass[TokenClass["Keyword"] = 1] = "Keyword"; @@ -31135,6 +19927,7 @@ var ts; ScriptElementKind.moduleElement = "module"; ScriptElementKind.classElement = "class"; ScriptElementKind.interfaceElement = "interface"; + ScriptElementKind.typeElement = "type"; ScriptElementKind.enumElement = "enum"; ScriptElementKind.variableElement = "var"; ScriptElementKind.localVariableElement = "local var"; @@ -31152,6 +19945,8 @@ var ts; ScriptElementKind.typeParameterElement = "type parameter"; ScriptElementKind.primitiveType = "primitive type"; ScriptElementKind.label = "label"; + ScriptElementKind.alias = "alias"; + ScriptElementKind.constantElement = "constant"; return ScriptElementKind; })(); ts.ScriptElementKind = ScriptElementKind; @@ -31161,25 +19956,214 @@ var ts; ScriptElementKindModifier.none = ""; ScriptElementKindModifier.publicMemberModifier = "public"; ScriptElementKindModifier.privateMemberModifier = "private"; + ScriptElementKindModifier.protectedMemberModifier = "protected"; ScriptElementKindModifier.exportedModifier = "export"; ScriptElementKindModifier.ambientModifier = "declare"; ScriptElementKindModifier.staticModifier = "static"; return ScriptElementKindModifier; })(); ts.ScriptElementKindModifier = ScriptElementKindModifier; - var MatchKind = (function () { - function MatchKind() { + var ClassificationTypeNames = (function () { + function ClassificationTypeNames() { } - MatchKind.none = null; - MatchKind.exact = "exact"; - MatchKind.subString = "substring"; - MatchKind.prefix = "prefix"; - return MatchKind; + ClassificationTypeNames.comment = "comment"; + ClassificationTypeNames.identifier = "identifier"; + ClassificationTypeNames.keyword = "keyword"; + ClassificationTypeNames.numericLiteral = "number"; + ClassificationTypeNames.operator = "operator"; + ClassificationTypeNames.stringLiteral = "string"; + ClassificationTypeNames.whiteSpace = "whitespace"; + ClassificationTypeNames.text = "text"; + ClassificationTypeNames.punctuation = "punctuation"; + ClassificationTypeNames.className = "class name"; + ClassificationTypeNames.enumName = "enum name"; + ClassificationTypeNames.interfaceName = "interface name"; + ClassificationTypeNames.moduleName = "module name"; + ClassificationTypeNames.typeParameterName = "type parameter name"; + return ClassificationTypeNames; })(); - ts.MatchKind = MatchKind; + ts.ClassificationTypeNames = ClassificationTypeNames; + var MatchKind; + (function (MatchKind) { + MatchKind[MatchKind["none"] = 0] = "none"; + MatchKind[MatchKind["exact"] = 1] = "exact"; + MatchKind[MatchKind["substring"] = 2] = "substring"; + MatchKind[MatchKind["prefix"] = 3] = "prefix"; + })(MatchKind || (MatchKind = {})); + function displayPartsToString(displayParts) { + if (displayParts) { + return ts.map(displayParts, function (displayPart) { return displayPart.text; }).join(""); + } + return ""; + } + ts.displayPartsToString = displayPartsToString; + var displayPartWriter = getDisplayPartWriter(); + function getDisplayPartWriter() { + var displayParts; + var lineStart; + var indent; + resetWriter(); + return { + displayParts: function () { return displayParts; }, + writeKeyword: function (text) { return writeKind(text, 5 /* keyword */); }, + writeOperator: function (text) { return writeKind(text, 12 /* operator */); }, + writePunctuation: function (text) { return writeKind(text, 15 /* punctuation */); }, + writeSpace: function (text) { return writeKind(text, 16 /* space */); }, + writeStringLiteral: function (text) { return writeKind(text, 8 /* stringLiteral */); }, + writeParameter: function (text) { return writeKind(text, 13 /* parameterName */); }, + writeSymbol: writeSymbol, + writeLine: writeLine, + increaseIndent: function () { + indent++; + }, + decreaseIndent: function () { + indent--; + }, + clear: resetWriter, + trackSymbol: function () { + } + }; + function writeIndent() { + if (lineStart) { + displayParts.push(displayPart(ts.getIndentString(indent), 16 /* space */)); + lineStart = false; + } + } + function writeKind(text, kind) { + writeIndent(); + displayParts.push(displayPart(text, kind)); + } + function writeSymbol(text, symbol) { + writeIndent(); + displayParts.push(symbolPart(text, symbol)); + } + function writeLine() { + displayParts.push(lineBreakPart()); + lineStart = true; + } + function resetWriter() { + displayParts = []; + lineStart = true; + indent = 0; + } + } + function displayPart(text, kind, symbol) { + return { + text: text, + kind: SymbolDisplayPartKind[kind] + }; + } + function spacePart() { + return displayPart(" ", 16 /* space */); + } + ts.spacePart = spacePart; + function keywordPart(kind) { + return displayPart(ts.tokenToString(kind), 5 /* keyword */); + } + ts.keywordPart = keywordPart; + function punctuationPart(kind) { + return displayPart(ts.tokenToString(kind), 15 /* punctuation */); + } + ts.punctuationPart = punctuationPart; + function operatorPart(kind) { + return displayPart(ts.tokenToString(kind), 12 /* operator */); + } + ts.operatorPart = operatorPart; + function textPart(text) { + return displayPart(text, 17 /* text */); + } + ts.textPart = textPart; + function lineBreakPart() { + return displayPart("\n", 6 /* lineBreak */); + } + ts.lineBreakPart = lineBreakPart; + function isFirstDeclarationOfSymbolParameter(symbol) { + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 123 /* Parameter */; + } + function isLocalVariableOrFunction(symbol) { + if (symbol.parent) { + return false; + } + return ts.forEach(symbol.declarations, function (declaration) { + if (declaration.kind === 152 /* FunctionExpression */) { + return true; + } + if (declaration.kind !== 184 /* VariableDeclaration */ && declaration.kind !== 185 /* FunctionDeclaration */) { + return false; + } + for (var parent = declaration.parent; parent.kind !== 186 /* FunctionBlock */; parent = parent.parent) { + if (parent.kind === 196 /* SourceFile */ || parent.kind === 192 /* ModuleBlock */) { + return false; + } + } + return true; + }); + } + function symbolPart(text, symbol) { + return displayPart(text, displayPartKind(symbol), symbol); + function displayPartKind(symbol) { + var flags = symbol.flags; + if (flags & 3 /* Variable */) { + return isFirstDeclarationOfSymbolParameter(symbol) ? 13 /* parameterName */ : 9 /* localName */; + } + else if (flags & 4 /* Property */) { + return 14 /* propertyName */; + } + else if (flags & 8 /* EnumMember */) { + return 19 /* enumMemberName */; + } + else if (flags & 16 /* Function */) { + return 20 /* functionName */; + } + else if (flags & 32 /* Class */) { + return 1 /* className */; + } + else if (flags & 64 /* Interface */) { + return 4 /* interfaceName */; + } + else if (flags & 384 /* Enum */) { + return 2 /* enumName */; + } + else if (flags & 1536 /* Module */) { + return 11 /* moduleName */; + } + else if (flags & 8192 /* Method */) { + return 10 /* methodName */; + } + else if (flags & 1048576 /* TypeParameter */) { + return 18 /* typeParameterName */; + } + return 17 /* text */; + } + } + ts.symbolPart = symbolPart; + function mapToDisplayParts(writeDisplayParts) { + writeDisplayParts(displayPartWriter); + var result = displayPartWriter.displayParts(); + displayPartWriter.clear(); + return result; + } + ts.mapToDisplayParts = mapToDisplayParts; + function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags) { + return mapToDisplayParts(function (writer) { + typechecker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + }); + } + ts.typeToDisplayParts = typeToDisplayParts; + function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags) { + return mapToDisplayParts(function (writer) { + typeChecker.getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags); + }); + } + ts.symbolToDisplayParts = symbolToDisplayParts; + function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { + return mapToDisplayParts(function (writer) { + typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); + }); + } function getDefaultCompilerOptions() { return { - target: 1 /* ES5 */, + target: 2 /* Latest */, module: 0 /* None */ }; } @@ -31219,6 +20203,7 @@ var ts; CancellationTokenObject.None = new CancellationTokenObject(null); return CancellationTokenObject; })(); + ts.CancellationTokenObject = CancellationTokenObject; var HostCache = (function () { function HostCache(host) { this.host = host; @@ -31226,7 +20211,7 @@ var ts; var filenames = host.getScriptFileNames(); for (var i = 0, n = filenames.length; i < n; i++) { var filename = filenames[i]; - this.filenameToEntry[TypeScript.switchToForwardSlashes(filename)] = { + this.filenameToEntry[ts.normalizeSlashes(filename)] = { filename: filename, version: host.getScriptVersion(filename), isOpen: host.getScriptIsOpen(filename) @@ -31238,7 +20223,7 @@ var ts; return this._compilationSettings; }; HostCache.prototype.getEntry = function (filename) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); return ts.lookUp(this.filenameToEntry, filename); }; HostCache.prototype.contains = function (filename) { @@ -31276,7 +20261,7 @@ var ts; HostCache.prototype.getChangeRange = function (filename, lastKnownVersion, oldScriptSnapshot) { var currentVersion = this.getVersion(filename); if (lastKnownVersion === currentVersion) { - return TypeScript.TextChangeRange.unchanged; + return ts.TextChangeRange.unchanged; } var scriptSnapshot = this.getScriptSnapshot(filename); return scriptSnapshot.getChangeRange(oldScriptSnapshot); @@ -31289,33 +20274,36 @@ var ts; this.currentFilename = ""; this.currentFileVersion = null; this.currentSourceFile = null; - this.currentFileSyntaxTree = null; this.hostCache = new HostCache(host); } SyntaxTreeCache.prototype.initialize = function (filename) { - ts.Debug.assert(!!this.currentFileSyntaxTree === !!this.currentSourceFile); + var start = new Date().getTime(); this.hostCache = new HostCache(this.host); + this.host.log("SyntaxTreeCache.Initialize: new HostCache: " + (new Date().getTime() - start)); var version = this.hostCache.getVersion(filename); - var syntaxTree = null; var sourceFile; - if (this.currentFileSyntaxTree === null || this.currentFilename !== filename) { + if (this.currentFilename !== filename) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); - syntaxTree = this.createSyntaxTree(filename, scriptSnapshot); + var start = new Date().getTime(); sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, true); + this.host.log("SyntaxTreeCache.Initialize: createSourceFile: " + (new Date().getTime() - start)); + var start = new Date().getTime(); fixupParentReferences(sourceFile); + this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } else if (this.currentFileVersion !== version) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); - syntaxTree = this.updateSyntaxTree(filename, scriptSnapshot, this.currentSourceFile.getScriptSnapshot(), this.currentFileSyntaxTree, this.currentFileVersion); var editRange = this.hostCache.getChangeRange(filename, this.currentFileVersion, this.currentSourceFile.getScriptSnapshot()); + var start = new Date().getTime(); sourceFile = !editRange ? createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, true) : this.currentSourceFile.update(scriptSnapshot, version, true, editRange); + this.host.log("SyntaxTreeCache.Initialize: updateSourceFile: " + (new Date().getTime() - start)); + var start = new Date().getTime(); fixupParentReferences(sourceFile); + this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } - if (syntaxTree !== null) { - ts.Debug.assert(sourceFile); + if (sourceFile) { this.currentFileVersion = version; this.currentFilename = filename; - this.currentFileSyntaxTree = syntaxTree; this.currentSourceFile = sourceFile; } function fixupParentReferences(sourceFile) { @@ -31330,61 +20318,13 @@ var ts; ts.forEachChild(sourceFile, walk); } }; - SyntaxTreeCache.prototype.getCurrentFileSyntaxTree = function (filename) { - this.initialize(filename); - return this.currentFileSyntaxTree; - }; SyntaxTreeCache.prototype.getCurrentSourceFile = function (filename) { this.initialize(filename); return this.currentSourceFile; }; SyntaxTreeCache.prototype.getCurrentScriptSnapshot = function (filename) { - this.getCurrentFileSyntaxTree(filename); return this.getCurrentSourceFile(filename).getScriptSnapshot(); }; - SyntaxTreeCache.prototype.createSyntaxTree = function (filename, scriptSnapshot) { - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var syntaxTree = TypeScript.Parser.parse(filename, text, getDefaultCompilerOptions().target, TypeScript.isDTSFile(filename)); - return syntaxTree; - }; - SyntaxTreeCache.prototype.updateSyntaxTree = function (filename, scriptSnapshot, previousScriptSnapshot, previousSyntaxTree, previousFileVersion) { - var editRange = this.hostCache.getChangeRange(filename, previousFileVersion, previousScriptSnapshot); - if (editRange === null) { - return this.createSyntaxTree(filename, scriptSnapshot); - } - var nextSyntaxTree = TypeScript.IncrementalParser.parse(previousSyntaxTree, editRange, TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot)); - this.ensureInvariants(filename, editRange, nextSyntaxTree, previousScriptSnapshot, scriptSnapshot); - return nextSyntaxTree; - }; - SyntaxTreeCache.prototype.ensureInvariants = function (filename, editRange, incrementalTree, oldScriptSnapshot, newScriptSnapshot) { - var expectedNewLength = oldScriptSnapshot.getLength() - editRange.span().length() + editRange.newLength(); - var actualNewLength = newScriptSnapshot.getLength(); - function provideMoreDebugInfo() { - var debugInformation = ["expected length:", expectedNewLength, "and actual length:", actualNewLength, "are not equal\r\n"]; - var oldSpan = editRange.span(); - function prettyPrintString(s) { - return '"' + s.replace(/\r/g, '\\r').replace(/\n/g, '\\n') + '"'; - } - debugInformation.push('Edit range (old text) (start: ' + oldSpan.start() + ', end: ' + oldSpan.end() + ') \r\n'); - debugInformation.push('Old text edit range contents: ' + prettyPrintString(oldScriptSnapshot.getText(oldSpan.start(), oldSpan.end()))); - var newSpan = editRange.newSpan(); - debugInformation.push('Edit range (new text) (start: ' + newSpan.start() + ', end: ' + newSpan.end() + ') \r\n'); - debugInformation.push('New text edit range contents: ' + prettyPrintString(newScriptSnapshot.getText(newSpan.start(), newSpan.end()))); - return debugInformation.join(' '); - } - ts.Debug.assert(expectedNewLength === actualNewLength, "Expected length is different from actual!", provideMoreDebugInfo); - if (ts.Debug.shouldAssert(3 /* VeryAggressive */)) { - var oldPrefixText = oldScriptSnapshot.getText(0, editRange.span().start()); - var newPrefixText = newScriptSnapshot.getText(0, editRange.span().start()); - ts.Debug.assert(oldPrefixText === newPrefixText, 'Expected equal prefix texts!'); - var oldSuffixText = oldScriptSnapshot.getText(editRange.span().end(), oldScriptSnapshot.getLength()); - var newSuffixText = newScriptSnapshot.getText(editRange.newSpan().end(), newScriptSnapshot.getLength()); - ts.Debug.assert(oldSuffixText === newSuffixText, 'Expected equal suffix texts!'); - var incrementalTreeText = TypeScript.fullText(incrementalTree.sourceUnit()); - var actualSnapshotText = newScriptSnapshot.getText(0, newScriptSnapshot.getLength()); - ts.Debug.assert(incrementalTreeText === actualSnapshotText, 'Expected full texts to be equal'); - } - }; return SyntaxTreeCache; })(); function createSourceFileFromScriptSnapshot(filename, scriptSnapshot, settings, version, isOpen) { @@ -31393,7 +20333,7 @@ var ts; function createDocumentRegistry() { var buckets = {}; function getKeyFromCompilationSettings(settings) { - return "_" + ts.ScriptTarget[settings.target]; + return "_" + settings.target; } function getBucketForCompilationSettings(settings, createIfMissing) { var key = getKeyFromCompilationSettings(settings); @@ -31439,9 +20379,9 @@ var ts; } function updateDocument(sourceFile, filename, compilationSettings, scriptSnapshot, version, isOpen, textChangeRange) { var bucket = getBucketForCompilationSettings(compilationSettings, false); - ts.Debug.assert(bucket); + ts.Debug.assert(bucket !== undefined); var entry = ts.lookUp(bucket, filename); - ts.Debug.assert(entry); + ts.Debug.assert(entry !== undefined); if (entry.sourceFile.isOpen === isOpen && entry.sourceFile.version === version) { return entry.sourceFile; } @@ -31450,7 +20390,7 @@ var ts; } function releaseDocument(filename, compilationSettings) { var bucket = getBucketForCompilationSettings(compilationSettings, false); - ts.Debug.assert(bucket); + ts.Debug.assert(bucket !== undefined); var entry = ts.lookUp(bucket, filename); entry.refCount--; ts.Debug.assert(entry.refCount >= 0); @@ -31466,8 +20406,178 @@ var ts; }; } ts.createDocumentRegistry = createDocumentRegistry; + function preProcessFile(sourceText, readImportFiles) { + if (readImportFiles === void 0) { readImportFiles = true; } + var referencedFiles = []; + var importedFiles = []; + var isNoDefaultLib = false; + function processTripleSlashDirectives() { + var commentRanges = ts.getLeadingCommentRanges(sourceText, 0); + ts.forEach(commentRanges, function (commentRange) { + var comment = sourceText.substring(commentRange.pos, commentRange.end); + var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, commentRange); + if (referencePathMatchResult) { + isNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + var fileReference = referencePathMatchResult.fileReference; + if (fileReference) { + referencedFiles.push(fileReference); + } + } + }); + } + function processImport() { + scanner.setText(sourceText); + var token = scanner.scan(); + while (token !== 1 /* EndOfFileToken */) { + if (token === 83 /* ImportKeyword */) { + token = scanner.scan(); + if (token === 63 /* Identifier */) { + token = scanner.scan(); + if (token === 51 /* EqualsToken */) { + token = scanner.scan(); + if (token === 115 /* RequireKeyword */) { + token = scanner.scan(); + if (token === 15 /* OpenParenToken */) { + token = scanner.scan(); + if (token === 7 /* StringLiteral */) { + var importPath = scanner.getTokenValue(); + var pos = scanner.getTokenPos(); + importedFiles.push({ + filename: importPath, + pos: pos, + end: pos + importPath.length + }); + } + } + } + } + } + } + token = scanner.scan(); + } + scanner.setText(undefined); + } + if (readImportFiles) { + processImport(); + } + processTripleSlashDirectives(); + return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; + } + ts.preProcessFile = preProcessFile; + function getNodeModifiers(node) { + var flags = node.flags; + var result = []; + if (flags & 32 /* Private */) + result.push(ScriptElementKindModifier.privateMemberModifier); + if (flags & 64 /* Protected */) + result.push(ScriptElementKindModifier.protectedMemberModifier); + if (flags & 16 /* Public */) + result.push(ScriptElementKindModifier.publicMemberModifier); + if (flags & 128 /* Static */) + result.push(ScriptElementKindModifier.staticModifier); + if (flags & 1 /* Export */) + result.push(ScriptElementKindModifier.exportedModifier); + if (ts.isInAmbientContext(node)) + result.push(ScriptElementKindModifier.ambientModifier); + return result.length > 0 ? result.join(',') : ScriptElementKindModifier.none; + } + ts.getNodeModifiers = getNodeModifiers; + function getTargetLabel(referenceNode, labelName) { + while (referenceNode) { + if (referenceNode.kind === 177 /* LabeledStatement */ && referenceNode.label.text === labelName) { + return referenceNode.label; + } + referenceNode = referenceNode.parent; + } + return undefined; + } + function isJumpStatementTarget(node) { + return node.kind === 63 /* Identifier */ && (node.parent.kind === 171 /* BreakStatement */ || node.parent.kind === 170 /* ContinueStatement */) && node.parent.label === node; + } + function isLabelOfLabeledStatement(node) { + return node.kind === 63 /* Identifier */ && node.parent.kind === 177 /* LabeledStatement */ && node.parent.label === node; + } + function isLabeledBy(node, labelName) { + for (var owner = node.parent; owner.kind === 177 /* LabeledStatement */; owner = owner.parent) { + if (owner.label.text === labelName) { + return true; + } + } + return false; + } + function isLabelName(node) { + return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); + } + function isRightSideOfQualifiedName(node) { + return node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node; + } + function isRightSideOfPropertyAccess(node) { + return node && node.parent && node.parent.kind === 145 /* PropertyAccess */ && node.parent.right === node; + } + function isCallExpressionTarget(node) { + if (isRightSideOfPropertyAccess(node)) { + node = node.parent; + } + return node && node.parent && node.parent.kind === 147 /* CallExpression */ && node.parent.func === node; + } + function isNewExpressionTarget(node) { + if (isRightSideOfPropertyAccess(node)) { + node = node.parent; + } + return node && node.parent && node.parent.kind === 148 /* NewExpression */ && node.parent.func === node; + } + function isNameOfModuleDeclaration(node) { + return node.parent.kind === 191 /* ModuleDeclaration */ && node.parent.name === node; + } + function isNameOfFunctionDeclaration(node) { + return node.kind === 63 /* Identifier */ && ts.isAnyFunction(node.parent) && node.parent.name === node; + } + function isNameOfPropertyAssignment(node) { + return (node.kind === 63 /* Identifier */ || node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) && (node.parent.kind === 143 /* PropertyAssignment */ || node.parent.kind === 144 /* ShorthandPropertyAssignment */) && node.parent.name === node; + } + function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { + if (node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) { + switch (node.parent.kind) { + case 124 /* Property */: + case 143 /* PropertyAssignment */: + case 195 /* EnumMember */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 191 /* ModuleDeclaration */: + return node.parent.name === node; + case 146 /* IndexedAccess */: + return node.parent.index === node; + } + } + return false; + } + function isNameOfExternalModuleImportOrDeclaration(node) { + return node.kind === 7 /* StringLiteral */ && (isNameOfModuleDeclaration(node) || (node.parent.kind === 193 /* ImportDeclaration */ && node.parent.externalModuleName === node)); + } + function isInsideComment(sourceFile, token, position) { + return position <= token.getStart(sourceFile) && (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); + function isInsideCommentRange(comments) { + return ts.forEach(comments, function (comment) { + if (comment.pos < position && position < comment.end) { + return true; + } + else if (position === comment.end) { + var text = sourceFile.text; + var width = comment.end - comment.pos; + if (width <= 2 || text.charCodeAt(comment.pos + 1) === 47 /* slash */) { + return true; + } + else { + return !(text.charCodeAt(comment.end - 1) === 47 /* slash */ && text.charCodeAt(comment.end - 2) === 42 /* asterisk */); + } + } + return false; + }); + } + } var keywordCompletions = []; - for (var i = ts.SyntaxKind.FirstKeyword; i <= ts.SyntaxKind.LastKeyword; i++) { + for (var i = 64 /* FirstKeyword */; i <= 119 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -31476,7 +20586,7 @@ var ts; } function createLanguageService(host, documentRegistry) { var syntaxTreeCache = new SyntaxTreeCache(host); - var formattingRulesProvider; + var ruleProvider; var hostCache; var program; var typeInfoResolver; @@ -31486,8 +20596,9 @@ var ts; var documentRegistry = documentRegistry; var cancellationToken = new CancellationTokenObject(host.getCancellationToken()); var activeCompletionSession; - if (!TypeScript.LocalizedDiagnosticMessages) { - TypeScript.LocalizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); + var writer = undefined; + if (!ts.localizedDiagnosticMessages) { + ts.localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); } function getSourceFile(filename) { return ts.lookUp(sourceFilesByName, filename); @@ -31495,25 +20606,31 @@ var ts; function getFullTypeCheckChecker() { return fullTypeCheckChecker_doNotAccessDirectly || (fullTypeCheckChecker_doNotAccessDirectly = program.getTypeChecker(true)); } + function getRuleProvider(options) { + if (!ruleProvider) { + ruleProvider = new ts.formatting.RulesProvider(host); + } + ruleProvider.ensureUpToDate(options); + return ruleProvider; + } function createCompilerHost() { return { getSourceFile: function (filename, languageVersion) { var sourceFile = getSourceFile(filename); - ts.Debug.assert(!!sourceFile, "sourceFile can not be undefined"); - return sourceFile.getSourceFile(); + return sourceFile && sourceFile.getSourceFile(); }, getCancellationToken: function () { return cancellationToken; }, getCanonicalFileName: function (filename) { return useCaseSensitivefilenames ? filename : filename.toLowerCase(); }, useCaseSensitiveFileNames: function () { return useCaseSensitivefilenames; }, getNewLine: function () { return "\r\n"; }, getDefaultLibFilename: function () { - throw Error("TOD:: getDefaultLibfilename"); + return host.getDefaultLibFilename(); }, writeFile: function (filename, data, writeByteOrderMark) { - throw Error("TODO: write file"); + writer(filename, data, writeByteOrderMark); }, getCurrentDirectory: function () { - throw Error("TODO: getCurrentDirectory"); + return host.getCurrentDirectory(); } }; } @@ -31597,70 +20714,220 @@ var ts; } function getSyntacticDiagnostics(filename) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); return program.getDiagnostics(getSourceFile(filename).getSourceFile()); } function getSemanticDiagnostics(filename) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); - return getFullTypeCheckChecker().getDiagnostics(getSourceFile(filename)); + filename = ts.normalizeSlashes(filename); + var compilerOptions = program.getCompilerOptions(); + var checker = getFullTypeCheckChecker(); + var targetSourceFile = getSourceFile(filename); + var allDiagnostics = checker.getDiagnostics(targetSourceFile); + if (compilerOptions.declaration) { + var savedWriter = writer; + writer = function (filename, data, writeByteOrderMark) { + }; + allDiagnostics = allDiagnostics.concat(checker.invokeEmitter(targetSourceFile).diagnostics); + writer = savedWriter; + } + return allDiagnostics; } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getGlobalDiagnostics(); } - function getValidCompletionEntryDisplayName(displayName, target) { + function getValidCompletionEntryDisplayName(symbol, target) { + var displayName = symbol.getName(); if (displayName && displayName.length > 0) { - var firstChar = displayName.charCodeAt(0); - if (firstChar === 39 /* singleQuote */ || firstChar === 34 /* doubleQuote */) { - displayName = TypeScript.stripStartAndEndQuotes(displayName); + var firstCharCode = displayName.charCodeAt(0); + if ((symbol.flags & 1536 /* Namespace */) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { + return undefined; } - if (TypeScript.Scanner.isValidIdentifier(TypeScript.SimpleText.fromString(displayName), target)) { - return displayName; + if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { + displayName = displayName.substring(1, displayName.length - 1); + } + var isValid = ts.isIdentifierStart(displayName.charCodeAt(0), target); + for (var i = 1, n = displayName.length; isValid && i < n; i++) { + isValid = ts.isIdentifierPart(displayName.charCodeAt(i), target); + } + if (isValid) { + return ts.unescapeIdentifier(displayName); } } return undefined; } - function createCompletionEntry(symbol) { - var displayName = getValidCompletionEntryDisplayName(symbol.getName(), program.getCompilerOptions().target); + function createCompletionEntry(symbol, typeChecker, location) { + var displayName = getValidCompletionEntryDisplayName(symbol, program.getCompilerOptions().target); if (!displayName) { return undefined; } - var declarations = symbol.getDeclarations(); - var firstDeclaration = [0]; return { name: displayName, - kind: getSymbolKind(symbol), - kindModifiers: declarations ? getNodeModifiers(declarations[0]) : ScriptElementKindModifier.none + kind: getSymbolKind(symbol, typeChecker, location), + kindModifiers: getSymbolModifiers(symbol) }; } function getCompletionsAtPosition(filename, position, isMemberCompletion) { + synchronizeHostData(); + filename = ts.normalizeSlashes(filename); + var syntacticStart = new Date().getTime(); + var sourceFile = getSourceFile(filename); + var start = new Date().getTime(); + var currentToken = ts.getTokenAtPosition(sourceFile, position); + host.log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); + var start = new Date().getTime(); + var insideComment = isInsideComment(sourceFile, currentToken, position); + host.log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); + if (insideComment) { + host.log("Returning an empty list because completion was inside a comment."); + return undefined; + } + var start = new Date().getTime(); + var previousToken = ts.findPrecedingToken(position, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); + if (previousToken && position <= previousToken.end && previousToken.kind === 63 /* Identifier */) { + var start = new Date().getTime(); + previousToken = ts.findPrecedingToken(previousToken.pos, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start)); + } + if (previousToken && isCompletionListBlocker(previousToken)) { + host.log("Returning an empty list because completion was requested in an invalid position."); + return undefined; + } + var node; + var isRightOfDot; + if (previousToken && previousToken.kind === 19 /* DotToken */ && (previousToken.parent.kind === 145 /* PropertyAccess */ || previousToken.parent.kind === 121 /* QualifiedName */)) { + node = previousToken.parent.left; + isRightOfDot = true; + } + else { + node = currentToken; + isRightOfDot = false; + } + activeCompletionSession = { + filename: filename, + position: position, + entries: [], + symbols: {}, + typeChecker: typeInfoResolver + }; + host.log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); + var location = ts.getTouchingPropertyName(sourceFile, position); + var semanticStart = new Date().getTime(); + if (isRightOfDot) { + var symbols = []; + isMemberCompletion = true; + if (node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */ || node.kind === 145 /* PropertyAccess */) { + var symbol = typeInfoResolver.getSymbolInfo(node); + if (symbol && symbol.flags & 33554432 /* Import */) { + symbol = typeInfoResolver.getAliasedSymbol(symbol); + } + if (symbol && symbol.flags & 1952 /* HasExports */) { + ts.forEachValue(symbol.exports, function (symbol) { + if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } + }); + } + } + var type = typeInfoResolver.getTypeOfNode(node); + if (type) { + ts.forEach(type.getApparentProperties(), function (symbol) { + if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } + }); + } + getCompletionEntriesFromSymbols(symbols, activeCompletionSession); + } + else { + var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(previousToken); + if (containingObjectLiteral) { + isMemberCompletion = true; + var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); + if (!contextualType) { + return undefined; + } + var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); + if (contextualTypeMembers && contextualTypeMembers.length > 0) { + var filteredMembers = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); + getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); + } + } + else { + isMemberCompletion = false; + var symbolMeanings = 3152352 /* Type */ | 107455 /* Value */ | 1536 /* Namespace */ | 33554432 /* Import */; + var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); + getCompletionEntriesFromSymbols(symbols, activeCompletionSession); + } + } + if (!isMemberCompletion) { + Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); + } + host.log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); + return { + isMemberCompletion: isMemberCompletion, + entries: activeCompletionSession.entries + }; function getCompletionEntriesFromSymbols(symbols, session) { + var start = new Date().getTime(); ts.forEach(symbols, function (symbol) { - var entry = createCompletionEntry(symbol); + var entry = createCompletionEntry(symbol, session.typeChecker, location); if (entry) { - session.entries.push(entry); - session.symbols[entry.name] = symbol; + var id = ts.escapeIdentifier(entry.name); + if (!ts.lookUp(session.symbols, id)) { + session.entries.push(entry); + session.symbols[id] = symbol; + } } }); + host.log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); } - function isCompletionListBlocker(sourceUnit, position) { - if (position < 0 || position > TypeScript.fullWidth(sourceUnit)) { - return true; + function isCompletionListBlocker(previousToken) { + var start = new Date().getTime(); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); + host.log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); + return result; + } + function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { + if (previousToken.kind === 7 /* StringLiteral */ || ts.isTemplateLiteralKind(previousToken.kind)) { + var start = previousToken.getStart(); + var end = previousToken.getEnd(); + if (start < position && position < end) { + return true; + } + else if (position === end) { + var width = end - start; + var text = previousToken.getSourceFile().text; + if (width <= 1 || text.charCodeAt(end - 2) === 92 /* backslash */) { + return true; + } + switch (previousToken.kind) { + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + return text.charCodeAt(start) !== text.charCodeAt(end - 1); + case 10 /* TemplateHead */: + case 11 /* TemplateMiddle */: + return text.charCodeAt(end - 1) !== 123 /* openBrace */ || text.charCodeAt(end - 2) !== 36 /* $ */; + case 12 /* TemplateTail */: + return text.charCodeAt(end - 1) !== 96 /* backtick */; + } + return false; + } } - return TypeScript.Syntax.isEntirelyInsideComment(sourceUnit, position) || TypeScript.Syntax.isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) || isIdentifierDefinitionLocation(sourceUnit, position) || isRightOfIllegalDot(sourceUnit, position); + else if (previousToken.kind === 8 /* RegularExpressionLiteral */) { + return previousToken.getStart() < position && position < previousToken.getEnd(); + } + return false; } - function getContainingObjectLiteralApplicableForCompletion(sourceUnit, position) { - var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); + function getContainingObjectLiteralApplicableForCompletion(previousToken) { if (previousToken) { var parent = previousToken.parent; - switch (previousToken.kind()) { - case 70 /* OpenBraceToken */: - case 79 /* CommaToken */: - if (parent && parent.kind() === 2 /* SeparatedList */) { - parent = parent.parent; - } - if (parent && parent.kind() === 215 /* ObjectLiteralExpression */) { + switch (previousToken.kind) { + case 13 /* OpenBraceToken */: + case 22 /* CommaToken */: + if (parent && parent.kind === 142 /* ObjectLiteral */) { return parent; } break; @@ -31668,160 +20935,111 @@ var ts; } return undefined; } - function isIdentifierDefinitionLocation(sourceUnit, position) { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); - if (positionedToken) { - var containingNodeKind = TypeScript.Syntax.containingNode(positionedToken) && TypeScript.Syntax.containingNode(positionedToken).kind(); - switch (positionedToken.kind()) { - case 79 /* CommaToken */: - return containingNodeKind === 227 /* ParameterList */ || containingNodeKind === 224 /* VariableDeclaration */ || containingNodeKind === 132 /* EnumDeclaration */; - case 72 /* OpenParenToken */: - return containingNodeKind === 227 /* ParameterList */ || containingNodeKind === 236 /* CatchClause */; - case 70 /* OpenBraceToken */: - return containingNodeKind === 132 /* EnumDeclaration */; - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 58 /* StaticKeyword */: - case 77 /* DotDotDotToken */: - return containingNodeKind === 242 /* Parameter */; - case 44 /* ClassKeyword */: - case 65 /* ModuleKeyword */: - case 46 /* EnumKeyword */: - case 52 /* InterfaceKeyword */: - case 27 /* FunctionKeyword */: - case 40 /* VarKeyword */: - case 64 /* GetKeyword */: - case 68 /* SetKeyword */: + function isFunction(kind) { + switch (kind) { + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + return true; + } + return false; + } + function isIdentifierDefinitionLocation(previousToken) { + if (previousToken) { + var containingNodeKind = previousToken.parent.kind; + switch (previousToken.kind) { + case 22 /* CommaToken */: + return containingNodeKind === 184 /* VariableDeclaration */ || containingNodeKind === 162 /* VariableStatement */ || containingNodeKind === 190 /* EnumDeclaration */ || isFunction(containingNodeKind); + case 15 /* OpenParenToken */: + return containingNodeKind === 181 /* CatchBlock */ || isFunction(containingNodeKind); + case 13 /* OpenBraceToken */: + return containingNodeKind === 190 /* EnumDeclaration */ || containingNodeKind === 188 /* InterfaceDeclaration */; + case 21 /* SemicolonToken */: + return containingNodeKind === 124 /* Property */ && previousToken.parent.parent.kind === 188 /* InterfaceDeclaration */; + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 107 /* StaticKeyword */: + case 20 /* DotDotDotToken */: + return containingNodeKind === 123 /* Parameter */; + case 67 /* ClassKeyword */: + case 114 /* ModuleKeyword */: + case 75 /* EnumKeyword */: + case 101 /* InterfaceKeyword */: + case 81 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 113 /* GetKeyword */: + case 117 /* SetKeyword */: + case 83 /* ImportKeyword */: return true; } - switch (positionedToken.text()) { + switch (previousToken.getText()) { case "class": case "interface": case "enum": case "module": + case "function": + case "var": return true; } } return false; } - function getNonIdentifierCompleteTokenOnLeft(sourceUnit, position) { - var positionedToken = TypeScript.Syntax.findCompleteTokenOnLeft(sourceUnit, position, true); - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() == 10 /* EndOfFileToken */) { - positionedToken = TypeScript.previousToken(positionedToken, true); - } - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() === 11 /* IdentifierName */) { - positionedToken = TypeScript.previousToken(positionedToken, true); - } - return positionedToken; - } - function isRightOfIllegalDot(sourceUnit, position) { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); - if (positionedToken) { - switch (positionedToken.kind()) { - case 76 /* DotToken */: - var leftOfDotPositionedToken = TypeScript.previousToken(positionedToken, true); - return leftOfDotPositionedToken && leftOfDotPositionedToken.kind() === 13 /* NumericLiteral */; - case 13 /* NumericLiteral */: - var text = positionedToken.text(); - return text.charAt(text.length - 1) === "."; - } + function isRightOfIllegalDot(previousToken) { + if (previousToken && previousToken.kind === 6 /* NumericLiteral */) { + var text = previousToken.getFullText(); + return text.charAt(text.length - 1) === "."; } return false; } - synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getSourceFile(filename); - var sourceUnit = sourceFile.getSourceUnit(); - if (isCompletionListBlocker(sourceFile.getSyntaxTree().sourceUnit(), position)) { - host.log("Returning an empty list because completion was blocked."); - return null; - } - var node = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, true, true); - if (node && node.kind() === 11 /* IdentifierName */ && TypeScript.start(node) === TypeScript.end(node)) { - node = node.parent; - } - var isRightOfDot = false; - if (node && node.kind() === 212 /* MemberAccessExpression */ && TypeScript.end(node.expression) < position) { - isRightOfDot = true; - node = node.expression; - } - else if (node && node.kind() === 121 /* QualifiedName */ && TypeScript.end(node.left) < position) { - isRightOfDot = true; - node = node.left; - } - else if (node && node.parent && node.kind() === 11 /* IdentifierName */ && node.parent.kind() === 212 /* MemberAccessExpression */ && node.parent.name === node) { - isRightOfDot = true; - node = node.parent.expression; - } - else if (node && node.parent && node.kind() === 11 /* IdentifierName */ && node.parent.kind() === 121 /* QualifiedName */ && node.parent.right === node) { - isRightOfDot = true; - node = node.parent.left; - } - var mappedNode = getNodeAtPosition(sourceFile.getSourceFile(), TypeScript.end(node) - 1); - ts.Debug.assert(mappedNode, "Could not map a Fidelity node to an AST node"); - activeCompletionSession = { - filename: filename, - position: position, - entries: [], - symbols: {}, - location: mappedNode, - typeChecker: typeInfoResolver - }; - if (isRightOfDot) { - var type = typeInfoResolver.getApparentType(typeInfoResolver.getTypeOfNode(mappedNode)); - if (!type) { - return undefined; + function filterContextualMembersList(contextualMemberSymbols, existingMembers) { + if (!existingMembers || existingMembers.length === 0) { + return contextualMemberSymbols; } - var symbols = type.getApparentProperties(); - isMemberCompletion = true; - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); - } - else { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(sourceFile.getSyntaxTree().sourceUnit(), position); - if (containingObjectLiteral) { - var searchPosition = Math.min(position, TypeScript.end(containingObjectLiteral)); - var path = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, searchPosition); - while (node && node.kind() !== 215 /* ObjectLiteralExpression */) { - node = node.parent; + var existingMemberNames = {}; + ts.forEach(existingMembers, function (m) { + if (m.kind !== 143 /* PropertyAssignment */ && m.kind !== 144 /* ShorthandPropertyAssignment */) { + return; } - if (!node || node.kind() !== 215 /* ObjectLiteralExpression */) { - return null; + if (m.getStart() <= position && position <= m.getEnd()) { + return; } - isMemberCompletion = true; - } - else { - isMemberCompletion = false; - var symbolMeanings = ts.SymbolFlags.Type | ts.SymbolFlags.Value | ts.SymbolFlags.Namespace; - var symbols = typeInfoResolver.getSymbolsInScope(mappedNode, symbolMeanings); - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); - } + existingMemberNames[m.name.text] = true; + }); + var filteredMembers = []; + ts.forEach(contextualMemberSymbols, function (s) { + if (!existingMemberNames[s.name]) { + filteredMembers.push(s); + } + }); + return filteredMembers; } - if (!isMemberCompletion) { - Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); - } - return { - isMemberCompletion: isMemberCompletion, - entries: activeCompletionSession.entries - }; } function getCompletionEntryDetails(filename, position, entryName) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); + var sourceFile = getSourceFile(filename); var session = activeCompletionSession; if (!session || session.filename !== filename || session.position !== position) { return undefined; } - var symbol = ts.lookUp(activeCompletionSession.symbols, entryName); + var symbol = ts.lookUp(activeCompletionSession.symbols, ts.escapeIdentifier(entryName)); if (symbol) { - var type = session.typeChecker.getTypeOfSymbol(symbol); - ts.Debug.assert(type, "Could not find type for symbol"); - var completionEntry = createCompletionEntry(symbol); + var location = ts.getTouchingPropertyName(sourceFile, position); + var completionEntry = createCompletionEntry(symbol, session.typeChecker, location); + ts.Debug.assert(session.typeChecker.getNarrowedTypeOfSymbol(symbol, location) !== undefined, "Could not find type for symbol"); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), location, session.typeChecker, location, 7 /* All */); return { name: entryName, - kind: completionEntry.kind, + kind: displayPartsDocumentationsAndSymbolKind.symbolKind, kindModifiers: completionEntry.kindModifiers, - type: session.typeChecker.typeToString(type, session.location), - fullSymbolName: typeInfoResolver.symbolToString(symbol, session.location), - docComment: "" + displayParts: displayPartsDocumentationsAndSymbolKind.displayParts, + documentation: displayPartsDocumentationsAndSymbolKind.documentation }; } else { @@ -31829,81 +21047,101 @@ var ts; name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - type: undefined, - fullSymbolName: entryName, - docComment: undefined + displayParts: [displayPart(entryName, 5 /* keyword */)], + documentation: undefined }; } } - function getNodeAtPosition(sourceFile, position) { - var current = sourceFile; - outer: while (true) { - for (var i = 0, n = current.getChildCount(); i < n; i++) { - var child = current.getChildAt(i); - if (child.getStart() <= position && position < child.getEnd()) { - current = child; - continue outer; - } - if (child.end > position) - break; - } - return current; - } - } function getContainerNode(node) { while (true) { node = node.parent; if (!node) { - return node; + return undefined; } switch (node.kind) { - case 116 /* Method */: - case 167 /* FunctionDeclaration */: - case 136 /* FunctionExpression */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 169 /* ClassDeclaration */: - case 170 /* InterfaceDeclaration */: - case 171 /* EnumDeclaration */: - case 172 /* ModuleDeclaration */: + case 196 /* SourceFile */: + case 125 /* Method */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: return node; } } } - function getSymbolKind(symbol) { + function getSymbolKind(symbol, typeResolver, location) { var flags = symbol.getFlags(); - if (flags & ts.SymbolFlags.Module) - return ScriptElementKind.moduleElement; - if (flags & 16 /* Class */) + if (flags & 32 /* Class */) return ScriptElementKind.classElement; - if (flags & 32 /* Interface */) - return ScriptElementKind.interfaceElement; - if (flags & 64 /* Enum */) + if (flags & 384 /* Enum */) return ScriptElementKind.enumElement; - if (flags & 1 /* Variable */) - return ScriptElementKind.variableElement; - if (flags & 8 /* Function */) - return ScriptElementKind.functionElement; - if (flags & 8192 /* GetAccessor */) - return ScriptElementKind.memberGetAccessorElement; - if (flags & 16384 /* SetAccessor */) - return ScriptElementKind.memberSetAccessorElement; - if (flags & 2048 /* Method */) - return ScriptElementKind.memberFunctionElement; - if (flags & 2 /* Property */) - return ScriptElementKind.memberVariableElement; - if (flags & 131072 /* IndexSignature */) - return ScriptElementKind.indexSignatureElement; - if (flags & 65536 /* ConstructSignature */) - return ScriptElementKind.constructSignatureElement; - if (flags & 32768 /* CallSignature */) - return ScriptElementKind.callSignatureElement; - if (flags & 4096 /* Constructor */) - return ScriptElementKind.constructorImplementationElement; - if (flags & 262144 /* TypeParameter */) + if (flags & 2097152 /* TypeAlias */) + return ScriptElementKind.typeElement; + if (flags & 64 /* Interface */) + return ScriptElementKind.interfaceElement; + if (flags & 1048576 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - if (flags & 4 /* EnumMember */) + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location); + if (result === ScriptElementKind.unknown) { + if (flags & 1048576 /* TypeParameter */) + return ScriptElementKind.typeParameterElement; + if (flags & 8 /* EnumMember */) + return ScriptElementKind.variableElement; + if (flags & 33554432 /* Import */) + return ScriptElementKind.alias; + } + return result; + } + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location) { + if (typeResolver.isUndefinedSymbol(symbol)) { return ScriptElementKind.variableElement; + } + if (typeResolver.isArgumentsSymbol(symbol)) { + return ScriptElementKind.localVariableElement; + } + if (flags & 3 /* Variable */) { + if (isFirstDeclarationOfSymbolParameter(symbol)) { + return ScriptElementKind.parameterElement; + } + else if (symbol.valueDeclaration && symbol.valueDeclaration.flags & 4096 /* Const */) { + return ScriptElementKind.constantElement; + } + return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement; + } + if (flags & 16 /* Function */) + return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement; + if (flags & 32768 /* GetAccessor */) + return ScriptElementKind.memberGetAccessorElement; + if (flags & 65536 /* SetAccessor */) + return ScriptElementKind.memberSetAccessorElement; + if (flags & 8192 /* Method */) + return ScriptElementKind.memberFunctionElement; + if (flags & 16384 /* Constructor */) + return ScriptElementKind.constructorImplementationElement; + if (flags & 4 /* Property */) { + if (flags & 1073741824 /* UnionProperty */) { + var unionPropertyKind = ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { + var rootSymbolFlags = rootSymbol.getFlags(); + if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) { + return ScriptElementKind.memberVariableElement; + } + ts.Debug.assert(!!(rootSymbolFlags & 8192 /* Method */)); + }); + if (!unionPropertyKind) { + var typeOfUnionProperty = typeInfoResolver.getNarrowedTypeOfSymbol(symbol, location); + if (typeOfUnionProperty.getCallSignatures().length) { + return ScriptElementKind.memberFunctionElement; + } + return ScriptElementKind.memberVariableElement; + } + return unionPropertyKind; + } + return ScriptElementKind.memberVariableElement; + } return ScriptElementKind.unknown; } function getTypeKind(type) { @@ -31916,87 +21154,368 @@ var ts; return ScriptElementKind.interfaceElement; if (flags & 512 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - if (flags & ts.TypeFlags.Intrinsic) + if (flags & 127 /* Intrinsic */) return ScriptElementKind.primitiveType; if (flags & 256 /* StringLiteral */) return ScriptElementKind.primitiveType; return ScriptElementKind.unknown; } - function getNodeModifiers(node) { - var flags = node.flags; - var result = []; - if (flags & 32 /* Private */) - result.push(ScriptElementKindModifier.privateMemberModifier); - if (flags & 16 /* Public */) - result.push(ScriptElementKindModifier.publicMemberModifier); - if (flags & 64 /* Static */) - result.push(ScriptElementKindModifier.staticModifier); - if (flags & 1 /* Export */) - result.push(ScriptElementKindModifier.exportedModifier); - if (ts.isInAmbientContext(node)) - result.push(ScriptElementKindModifier.ambientModifier); - return result.length > 0 ? result.join(',') : ScriptElementKindModifier.none; - } - function getTypeAtPosition(fileName, position) { - synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); - var sourceFile = getSourceFile(fileName); - var node = getNodeAtPosition(sourceFile.getSourceFile(), position); - if (!node) - return undefined; - var symbol = typeInfoResolver.getSymbolInfo(node); - var type = symbol && typeInfoResolver.getTypeOfSymbol(symbol); - if (type) { - return new TypeInfo(new TypeScript.MemberNameString(typeInfoResolver.typeToString(type)), "", typeInfoResolver.symbolToString(symbol, getContainerNode(node)), getSymbolKind(symbol), TypeScript.TextSpan.fromBounds(node.pos, node.end)); + function getNodeKind(node) { + switch (node.kind) { + case 191 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 187 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 188 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 189 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 190 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 184 /* VariableDeclaration */: return node.flags & 4096 /* Const */ ? ScriptElementKind.constantElement : ScriptElementKind.variableElement; + case 185 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 127 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; + case 128 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; + case 125 /* Method */: return ScriptElementKind.memberFunctionElement; + case 124 /* Property */: return ScriptElementKind.memberVariableElement; + case 131 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; + case 130 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; + case 129 /* CallSignature */: return ScriptElementKind.callSignatureElement; + case 126 /* Constructor */: return ScriptElementKind.constructorImplementationElement; + case 122 /* TypeParameter */: return ScriptElementKind.typeParameterElement; + case 195 /* EnumMember */: return ScriptElementKind.variableElement; + case 123 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; } - return undefined; + return ScriptElementKind.unknown; + } + function getSymbolModifiers(symbol) { + return symbol && symbol.declarations && symbol.declarations.length > 0 ? getNodeModifiers(symbol.declarations[0]) : ScriptElementKindModifier.none; + } + function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location, semanticMeaning) { + if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); } + var displayParts = []; + var documentation; + var symbolFlags = symbol.flags; + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); + var hasAddedSymbolInfo; + if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 /* Class */ || symbolFlags & 33554432 /* Import */) { + if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { + symbolKind = ScriptElementKind.memberVariableElement; + } + var type = typeResolver.getNarrowedTypeOfSymbol(symbol, location); + if (type) { + if (location.parent && location.parent.kind === 145 /* PropertyAccess */) { + var right = location.parent.right; + if (right === location || (right && right.kind === 120 /* Missing */)) { + location = location.parent; + } + } + var callExpression; + if (location.kind === 147 /* CallExpression */ || location.kind === 148 /* NewExpression */) { + callExpression = location; + } + else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { + callExpression = location.parent; + } + if (callExpression) { + var candidateSignatures = []; + signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures); + if (!signature && candidateSignatures.length) { + signature = candidateSignatures[0]; + } + var useConstructSignatures = callExpression.kind === 148 /* NewExpression */ || callExpression.func.kind === 89 /* SuperKeyword */; + var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); + if (!ts.contains(allSignatures, signature.target || signature)) { + signature = allSignatures.length ? allSignatures[0] : undefined; + } + if (signature) { + if (useConstructSignatures && (symbolFlags & 32 /* Class */)) { + symbolKind = ScriptElementKind.constructorImplementationElement; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + } + else if (symbolFlags & 33554432 /* Import */) { + symbolKind = ScriptElementKind.alias; + displayParts.push(punctuationPart(15 /* OpenParenToken */)); + displayParts.push(textPart(symbolKind)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); + displayParts.push(spacePart()); + if (useConstructSignatures) { + displayParts.push(keywordPart(86 /* NewKeyword */)); + displayParts.push(spacePart()); + } + addFullSymbolName(symbol); + } + else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + switch (symbolKind) { + case ScriptElementKind.memberVariableElement: + case ScriptElementKind.variableElement: + case ScriptElementKind.constantElement: + case ScriptElementKind.parameterElement: + case ScriptElementKind.localVariableElement: + displayParts.push(punctuationPart(50 /* ColonToken */)); + displayParts.push(spacePart()); + if (useConstructSignatures) { + displayParts.push(keywordPart(86 /* NewKeyword */)); + displayParts.push(spacePart()); + } + if (!(type.flags & 32768 /* Anonymous */)) { + displayParts.push.apply(displayParts, symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, undefined, 1 /* WriteTypeParametersOrArguments */)); + } + addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */); + break; + default: + addSignatureDisplayParts(signature, allSignatures); + } + hasAddedSymbolInfo = true; + } + } + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || (location.kind === 111 /* ConstructorKeyword */ && location.parent.kind === 126 /* Constructor */)) { + var signature; + var functionDeclaration = location.parent; + var allSignatures = functionDeclaration.kind === 126 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); + if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { + signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); + } + else { + signature = allSignatures[0]; + } + if (functionDeclaration.kind === 126 /* Constructor */) { + addPrefixForAnyFunctionOrVar(type.symbol, ScriptElementKind.constructorImplementationElement); + } + else { + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 129 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); + } + addSignatureDisplayParts(signature, allSignatures); + hasAddedSymbolInfo = true; + } + } + } + if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { + displayParts.push(keywordPart(67 /* ClassKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + } + if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(101 /* InterfaceKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + } + if (symbolFlags & 2097152 /* TypeAlias */) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(119 /* TypeKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + displayParts.push(spacePart()); + displayParts.push(punctuationPart(51 /* EqualsToken */)); + displayParts.push(spacePart()); + displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); + } + if (symbolFlags & 384 /* Enum */) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(75 /* EnumKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } + if (symbolFlags & 1536 /* Module */) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(114 /* ModuleKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } + if ((symbolFlags & 1048576 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { + addNewLineIfDisplayPartsExist(); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); + displayParts.push(textPart("type parameter")); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + displayParts.push(spacePart()); + displayParts.push(keywordPart(84 /* InKeyword */)); + displayParts.push(spacePart()); + if (symbol.parent) { + addFullSymbolName(symbol.parent, enclosingDeclaration); + writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); + } + else { + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 122 /* TypeParameter */).parent; + var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); + if (signatureDeclaration.kind === 130 /* ConstructSignature */) { + displayParts.push(keywordPart(86 /* NewKeyword */)); + displayParts.push(spacePart()); + } + else if (signatureDeclaration.kind !== 129 /* CallSignature */ && signatureDeclaration.name) { + addFullSymbolName(signatureDeclaration.symbol); + } + displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); + } + } + if (symbolFlags & 8 /* EnumMember */) { + addPrefixForAnyFunctionOrVar(symbol, "enum member"); + var declaration = symbol.declarations[0]; + if (declaration.kind === 195 /* EnumMember */) { + var constantValue = typeResolver.getEnumMemberValue(declaration); + if (constantValue !== undefined) { + displayParts.push(spacePart()); + displayParts.push(operatorPart(51 /* EqualsToken */)); + displayParts.push(spacePart()); + displayParts.push(displayPart(constantValue.toString(), 7 /* numericLiteral */)); + } + } + } + if (symbolFlags & 33554432 /* Import */) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(83 /* ImportKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + ts.forEach(symbol.declarations, function (declaration) { + if (declaration.kind === 193 /* ImportDeclaration */) { + var importDeclaration = declaration; + if (importDeclaration.externalModuleName) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart(51 /* EqualsToken */)); + displayParts.push(spacePart()); + displayParts.push(keywordPart(115 /* RequireKeyword */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); + displayParts.push(displayPart(ts.getTextOfNode(importDeclaration.externalModuleName), 8 /* stringLiteral */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); + } + else { + var internalAliasSymbol = typeResolver.getSymbolInfo(importDeclaration.entityName); + if (internalAliasSymbol) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart(51 /* EqualsToken */)); + displayParts.push(spacePart()); + addFullSymbolName(internalAliasSymbol, enclosingDeclaration); + } + } + return true; + } + }); + } + if (!hasAddedSymbolInfo) { + if (symbolKind !== ScriptElementKind.unknown) { + if (type) { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & 3 /* Variable */ || symbolKind === ScriptElementKind.localVariableElement) { + displayParts.push(punctuationPart(50 /* ColonToken */)); + displayParts.push(spacePart()); + if (type.symbol && type.symbol.flags & 1048576 /* TypeParameter */) { + var typeParameterParts = mapToDisplayParts(function (writer) { + typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + }); + displayParts.push.apply(displayParts, typeParameterParts); + } + else { + displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, type, enclosingDeclaration)); + } + } + else if (symbolFlags & 16 /* Function */ || symbolFlags & 8192 /* Method */ || symbolFlags & 16384 /* Constructor */ || symbolFlags & 917504 /* Signature */ || symbolFlags & 98304 /* Accessor */ || symbolKind === ScriptElementKind.memberFunctionElement) { + var allSignatures = type.getCallSignatures(); + addSignatureDisplayParts(allSignatures[0], allSignatures); + } + } + } + else { + symbolKind = getSymbolKind(symbol, typeResolver, location); + } + } + if (!documentation) { + documentation = symbol.getDocumentationComment(); + } + return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + function addNewLineIfDisplayPartsExist() { + if (displayParts.length) { + displayParts.push(lineBreakPart()); + } + } + function addFullSymbolName(symbol, enclosingDeclaration) { + var fullSymbolDisplayParts = symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */); + displayParts.push.apply(displayParts, fullSymbolDisplayParts); + } + function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { + addNewLineIfDisplayPartsExist(); + if (symbolKind) { + displayParts.push(punctuationPart(15 /* OpenParenToken */)); + displayParts.push(textPart(symbolKind)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } + } + function addSignatureDisplayParts(signature, allSignatures, flags) { + displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); + if (allSignatures.length > 1) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); + displayParts.push(operatorPart(32 /* PlusToken */)); + displayParts.push(displayPart((allSignatures.length - 1).toString(), 7 /* numericLiteral */)); + displayParts.push(spacePart()); + displayParts.push(textPart(allSignatures.length === 2 ? "overload" : "overloads")); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); + } + documentation = signature.getDocumentationComment(); + } + function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { + var typeParameterParts = mapToDisplayParts(function (writer) { + typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + }); + displayParts.push.apply(displayParts, typeParameterParts); + } + } + function getQuickInfoAtPosition(fileName, position) { + synchronizeHostData(); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getSourceFile(fileName); + var node = ts.getTouchingPropertyName(sourceFile, position); + if (!node) { + return undefined; + } + var symbol = typeInfoResolver.getSymbolInfo(node); + if (!symbol) { + switch (node.kind) { + case 63 /* Identifier */: + case 145 /* PropertyAccess */: + case 121 /* QualifiedName */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + var type = typeInfoResolver.getTypeOfNode(node); + if (type) { + return { + kind: ScriptElementKind.unknown, + kindModifiers: ScriptElementKindModifier.none, + textSpan: new ts.TextSpan(node.getStart(), node.getWidth()), + displayParts: typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)), + documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined + }; + } + } + return undefined; + } + var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node); + return { + kind: displayPartsDocumentationsAndKind.symbolKind, + kindModifiers: getSymbolModifiers(symbol), + textSpan: new ts.TextSpan(node.getStart(), node.getWidth()), + displayParts: displayPartsDocumentationsAndKind.displayParts, + documentation: displayPartsDocumentationsAndKind.documentation + }; } function getDefinitionAtPosition(filename, position) { - function getTargetLabel(node, labelName) { - while (node) { - if (node.kind === 159 /* LabelledStatement */ && node.label.text === labelName) { - return node.label; - } - node = node.parent; - } - return undefined; - } - function isJumpStatementTarget(node) { - return node.kind === 55 /* Identifier */ && (node.parent.kind === 153 /* BreakStatement */ || node.parent.kind === 152 /* ContinueStatement */) && node.parent.label === node; - } - function isCallExpressionTarget(node) { - if (node.parent.kind === 130 /* PropertyAccess */ && node.parent.right === node) - node = node.parent; - return node.parent.kind === 132 /* CallExpression */ && node.parent.func === node; - } - function isNewExpressionTarget(node) { - if (node.parent.kind === 130 /* PropertyAccess */ && node.parent.right === node) - node = node.parent; - return node.parent.kind === 133 /* NewExpression */ && node.parent.func === node; - } - function isFunctionDeclaration(node) { - switch (node.kind) { - case 167 /* FunctionDeclaration */: - case 116 /* Method */: - case 136 /* FunctionExpression */: - case 118 /* GetAccessor */: - case 119 /* SetAccessor */: - case 137 /* ArrowFunction */: - return true; - } - return false; - } - function isNameOfFunctionDeclaration(node) { - return node.kind === 55 /* Identifier */ && isFunctionDeclaration(node.parent) && node.parent.name === node; - } function getDefinitionInfo(node, symbolKind, symbolName, containerName) { - return new DefinitionInfo(node.getSourceFile().filename, TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()), symbolKind, symbolName, undefined, containerName); + return { + fileName: node.getSourceFile().filename, + textSpan: ts.TextSpan.fromBounds(node.getStart(), node.getEnd()), + kind: symbolKind, + name: symbolName, + containerKind: undefined, + containerName: containerName + }; } function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 117 /* Constructor */) || (!selectConstructors && (d.kind === 167 /* FunctionDeclaration */ || d.kind === 116 /* Method */))) { + if ((selectConstructors && d.kind === 126 /* Constructor */) || (!selectConstructors && (d.kind === 185 /* FunctionDeclaration */ || d.kind === 125 /* Method */))) { declarations.push(d); if (d.body) definition = d; @@ -32013,10 +21532,10 @@ var ts; return false; } function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isNewExpressionTarget(location) || location.kind === 103 /* ConstructorKeyword */) { - if (symbol.flags & 16 /* Class */) { + if (isNewExpressionTarget(location) || location.kind === 111 /* ConstructorKeyword */) { + if (symbol.flags & 32 /* Class */) { var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 169 /* ClassDeclaration */); + ts.Debug.assert(classDeclaration && classDeclaration.kind === 187 /* ClassDeclaration */); return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); } } @@ -32029,9 +21548,9 @@ var ts; return false; } synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var sourceFile = getSourceFile(filename); - var node = getNodeAtPosition(sourceFile.getSourceFile(), position); + var node = ts.getTouchingPropertyName(sourceFile, position); if (!node) { return undefined; } @@ -32040,25 +21559,43 @@ var ts; var label = getTargetLabel(node.parent, node.text); return label ? [getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; } - var comment = ts.forEach(sourceFile.getSourceFile().referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); + var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); if (comment) { - var targetFilename = ts.normalizePath(ts.combinePaths(ts.getDirectoryPath(filename), comment.filename)); + var targetFilename = ts.isRootedDiskPath(comment.filename) ? comment.filename : ts.combinePaths(ts.getDirectoryPath(filename), comment.filename); + targetFilename = ts.normalizePath(targetFilename); if (program.getSourceFile(targetFilename)) { - return [new DefinitionInfo(targetFilename, TypeScript.TextSpan.fromBounds(0, 0), ScriptElementKind.scriptElement, comment.filename, undefined, undefined)]; + return [{ + fileName: targetFilename, + textSpan: ts.TextSpan.fromBounds(0, 0), + kind: ScriptElementKind.scriptElement, + name: comment.filename, + containerName: undefined, + containerKind: undefined + }]; } return undefined; } var symbol = typeInfoResolver.getSymbolInfo(node); - if (!symbol || !(symbol.getDeclarations())) { + if (!symbol) { return undefined; } var result = []; + if (node.parent.kind === 144 /* ShorthandPropertyAssignment */) { + var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + var shorthandDeclarations = shorthandSymbol.getDeclarations(); + var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver); + var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol); + var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node); + ts.forEach(shorthandDeclarations, function (declaration) { + result.push(getDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); + }); + return result; + } var declarations = symbol.getDeclarations(); - var symbolName = typeInfoResolver.symbolToString(symbol, node); - var symbolKind = getSymbolKind(symbol); + var symbolName = typeInfoResolver.symbolToString(symbol); + var symbolKind = getSymbolKind(symbol, typeInfoResolver); var containerSymbol = symbol.parent; var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; - var containerKind = containerSymbol ? getSymbolKind(symbol) : ""; if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { ts.forEach(declarations, function (declaration) { result.push(getDefinitionInfo(declaration, symbolKind, symbolName, containerName)); @@ -32066,152 +21603,1348 @@ var ts; } return result; } - function getSyntaxTree(filename) { - filename = TypeScript.switchToForwardSlashes(filename); - return syntaxTreeCache.getCurrentFileSyntaxTree(filename); + function getOccurrencesAtPosition(filename, position) { + synchronizeHostData(); + filename = ts.normalizeSlashes(filename); + var sourceFile = getSourceFile(filename); + var node = ts.getTouchingWord(sourceFile, position); + if (!node) { + return undefined; + } + if (node.kind === 63 /* Identifier */ || node.kind === 91 /* ThisKeyword */ || node.kind === 89 /* SuperKeyword */ || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + return getReferencesForNode(node, [sourceFile], false, false); + } + switch (node.kind) { + case 82 /* IfKeyword */: + case 74 /* ElseKeyword */: + if (hasKind(node.parent, 165 /* IfStatement */)) { + return getIfElseOccurrences(node.parent); + } + break; + case 88 /* ReturnKeyword */: + if (hasKind(node.parent, 172 /* ReturnStatement */)) { + return getReturnOccurrences(node.parent); + } + break; + case 92 /* ThrowKeyword */: + if (hasKind(node.parent, 178 /* ThrowStatement */)) { + return getThrowOccurrences(node.parent); + } + break; + case 94 /* TryKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: + if (hasKind(parent(parent(node)), 179 /* TryStatement */)) { + return getTryCatchFinallyOccurrences(node.parent.parent); + } + break; + case 90 /* SwitchKeyword */: + if (hasKind(node.parent, 174 /* SwitchStatement */)) { + return getSwitchCaseDefaultOccurrences(node.parent); + } + break; + case 65 /* CaseKeyword */: + case 71 /* DefaultKeyword */: + if (hasKind(parent(parent(node)), 174 /* SwitchStatement */)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent); + } + break; + case 64 /* BreakKeyword */: + case 69 /* ContinueKeyword */: + if (hasKind(node.parent, 171 /* BreakStatement */) || hasKind(node.parent, 170 /* ContinueStatement */)) { + return getBreakOrContinueStatementOccurences(node.parent); + } + break; + case 80 /* ForKeyword */: + if (hasKind(node.parent, 168 /* ForStatement */) || hasKind(node.parent, 169 /* ForInStatement */)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case 98 /* WhileKeyword */: + case 73 /* DoKeyword */: + if (hasKind(node.parent, 167 /* WhileStatement */) || hasKind(node.parent, 166 /* DoStatement */)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case 111 /* ConstructorKeyword */: + if (hasKind(node.parent, 126 /* Constructor */)) { + return getConstructorOccurrences(node.parent); + } + break; + case 113 /* GetKeyword */: + case 117 /* SetKeyword */: + if (hasKind(node.parent, 127 /* GetAccessor */) || hasKind(node.parent, 128 /* SetAccessor */)) { + return getGetAndSetOccurrences(node.parent); + } + } + return undefined; + function getIfElseOccurrences(ifStatement) { + var keywords = []; + while (hasKind(ifStatement.parent, 165 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + while (ifStatement) { + var children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], 82 /* IfKeyword */); + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 74 /* ElseKeyword */)) { + break; + } + } + if (!hasKind(ifStatement.elseStatement, 165 /* IfStatement */)) { + break; + } + ifStatement = ifStatement.elseStatement; + } + var result = []; + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 74 /* ElseKeyword */ && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; + var shouldHighlightNextKeyword = true; + for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { + shouldHighlightNextKeyword = false; + break; + } + } + if (shouldHighlightNextKeyword) { + result.push({ + fileName: filename, + textSpan: ts.TextSpan.fromBounds(elseKeyword.getStart(), ifKeyword.end), + isWriteAccess: false + }); + i++; + continue; + } + } + result.push(getReferenceEntryFromNode(keywords[i])); + } + return result; + } + function getReturnOccurrences(returnStatement) { + var func = ts.getContainingFunction(returnStatement); + if (!(func && hasKind(func.body, 186 /* FunctionBlock */))) { + return undefined; + } + var keywords = []; + ts.forEachReturnStatement(func.body, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 88 /* ReturnKeyword */); + }); + ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 92 /* ThrowKeyword */); + }); + return ts.map(keywords, getReferenceEntryFromNode); + } + function getThrowOccurrences(throwStatement) { + var owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return undefined; + } + var keywords = []; + ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 92 /* ThrowKeyword */); + }); + if (owner.kind === 186 /* FunctionBlock */) { + ts.forEachReturnStatement(owner, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 88 /* ReturnKeyword */); + }); + } + return ts.map(keywords, getReferenceEntryFromNode); + } + function aggregateOwnedThrowStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 178 /* ThrowStatement */) { + statementAccumulator.push(node); + } + else if (node.kind === 179 /* TryStatement */) { + var tryStatement = node; + if (tryStatement.catchBlock) { + aggregate(tryStatement.catchBlock); + } + else { + aggregate(tryStatement.tryBlock); + } + if (tryStatement.finallyBlock) { + aggregate(tryStatement.finallyBlock); + } + } + else if (!ts.isAnyFunction(node)) { + ts.forEachChild(node, aggregate); + } + } + ; + } + function getThrowStatementOwner(throwStatement) { + var child = throwStatement; + while (child.parent) { + var parent = child.parent; + if (parent.kind === 186 /* FunctionBlock */ || parent.kind === 196 /* SourceFile */) { + return parent; + } + if (parent.kind === 179 /* TryStatement */) { + var tryStatement = parent; + if (tryStatement.tryBlock === child && tryStatement.catchBlock) { + return child; + } + } + child = parent; + } + return undefined; + } + function getTryCatchFinallyOccurrences(tryStatement) { + var keywords = []; + pushKeywordIf(keywords, tryStatement.getFirstToken(), 94 /* TryKeyword */); + if (tryStatement.catchBlock) { + pushKeywordIf(keywords, tryStatement.catchBlock.getFirstToken(), 66 /* CatchKeyword */); + } + if (tryStatement.finallyBlock) { + pushKeywordIf(keywords, tryStatement.finallyBlock.getFirstToken(), 79 /* FinallyKeyword */); + } + return ts.map(keywords, getReferenceEntryFromNode); + } + function getLoopBreakContinueOccurrences(loopNode) { + var keywords = []; + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 80 /* ForKeyword */, 98 /* WhileKeyword */, 73 /* DoKeyword */)) { + if (loopNode.kind === 166 /* DoStatement */) { + var loopTokens = loopNode.getChildren(); + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 98 /* WhileKeyword */)) { + break; + } + } + } + } + var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 64 /* BreakKeyword */, 69 /* ContinueKeyword */); + } + }); + return ts.map(keywords, getReferenceEntryFromNode); + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + var keywords = []; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 90 /* SwitchKeyword */); + ts.forEach(switchStatement.clauses, function (clause) { + pushKeywordIf(keywords, clause.getFirstToken(), 65 /* CaseKeyword */, 71 /* DefaultKeyword */); + var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 64 /* BreakKeyword */); + } + }); + }); + return ts.map(keywords, getReferenceEntryFromNode); + } + function getBreakOrContinueStatementOccurences(breakOrContinueStatement) { + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + return getLoopBreakContinueOccurrences(owner); + case 174 /* SwitchStatement */: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return undefined; + } + function aggregateAllBreakAndContinueStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 171 /* BreakStatement */ || node.kind === 170 /* ContinueStatement */) { + statementAccumulator.push(node); + } + else if (!ts.isAnyFunction(node)) { + ts.forEachChild(node, aggregate); + } + } + ; + } + function ownsBreakOrContinueStatement(owner, statement) { + var actualOwner = getBreakOrContinueOwner(statement); + return actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + for (var node = statement.parent; node; node = node.parent) { + switch (node.kind) { + case 174 /* SwitchStatement */: + if (statement.kind === 170 /* ContinueStatement */) { + continue; + } + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 167 /* WhileStatement */: + case 166 /* DoStatement */: + if (!statement.label || isLabeledBy(node, statement.label.text)) { + return node; + } + break; + default: + if (ts.isAnyFunction(node)) { + return undefined; + } + break; + } + } + return undefined; + } + function getConstructorOccurrences(constructorDeclaration) { + var declarations = constructorDeclaration.symbol.getDeclarations(); + var keywords = []; + ts.forEach(declarations, function (declaration) { + ts.forEach(declaration.getChildren(), function (token) { + return pushKeywordIf(keywords, token, 111 /* ConstructorKeyword */); + }); + }); + return ts.map(keywords, getReferenceEntryFromNode); + } + function getGetAndSetOccurrences(accessorDeclaration) { + var keywords = []; + tryPushAccessorKeyword(accessorDeclaration.symbol, 127 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 128 /* SetAccessor */); + return ts.map(keywords, getReferenceEntryFromNode); + function tryPushAccessorKeyword(accessorSymbol, accessorKind) { + var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); + if (accessor) { + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 113 /* GetKeyword */, 117 /* SetKeyword */); }); + } + } + } + function hasKind(node, kind) { + return node !== undefined && node.kind === kind; + } + function parent(node) { + return node && node.parent; + } + function pushKeywordIf(keywordList, token) { + var expected = []; + for (var _i = 2; _i < arguments.length; _i++) { + expected[_i - 2] = arguments[_i]; + } + if (token && ts.contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + } + function findRenameLocations(fileName, position, findInStrings, findInComments) { + return findReferences(fileName, position, findInStrings, findInComments); + } + function getReferencesAtPosition(fileName, position) { + return findReferences(fileName, position, false, false); + } + function findReferences(fileName, position, findInStrings, findInComments) { + synchronizeHostData(); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getSourceFile(fileName); + var node = ts.getTouchingPropertyName(sourceFile, position); + if (!node) { + return undefined; + } + if (node.kind !== 63 /* Identifier */ && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { + return undefined; + } + ts.Debug.assert(node.kind === 63 /* Identifier */ || node.kind === 6 /* NumericLiteral */ || node.kind === 7 /* StringLiteral */); + return getReferencesForNode(node, program.getSourceFiles(), findInStrings, findInComments); + } + function getReferencesForNode(node, sourceFiles, findInStrings, findInComments) { + if (isLabelName(node)) { + if (isJumpStatementTarget(node)) { + var labelDefinition = getTargetLabel(node.parent, node.text); + return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [getReferenceEntryFromNode(node)]; + } + else { + return getLabelReferencesInNode(node.parent, node); + } + } + if (node.kind === 91 /* ThisKeyword */) { + return getReferencesForThisKeyword(node, sourceFiles); + } + if (node.kind === 89 /* SuperKeyword */) { + return getReferencesForSuperKeyword(node); + } + var symbol = typeInfoResolver.getSymbolInfo(node); + if (!symbol) { + return [getReferenceEntryFromNode(node)]; + } + var declarations = symbol.declarations; + if (!declarations || !declarations.length) { + return undefined; + } + var result; + var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); + var symbolName = getNormalizedSymbolName(symbol.name, declarations); + var scope = getSymbolScope(symbol); + if (scope) { + result = []; + getReferencesInNode(scope, symbol, symbolName, node, searchMeaning, findInStrings, findInComments, result); + } + else { + ts.forEach(sourceFiles, function (sourceFile) { + cancellationToken.throwIfCancellationRequested(); + if (ts.lookUp(sourceFile.identifiers, symbolName)) { + result = result || []; + getReferencesInNode(sourceFile, symbol, symbolName, node, searchMeaning, findInStrings, findInComments, result); + } + }); + } + return result; + function getNormalizedSymbolName(symbolName, declarations) { + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 152 /* FunctionExpression */ ? d : undefined; }); + if (functionExpression && functionExpression.name) { + var name = functionExpression.name.text; + } + else { + var name = symbolName; + } + var length = name.length; + if (length >= 2 && name.charCodeAt(0) === 34 /* doubleQuote */ && name.charCodeAt(length - 1) === 34 /* doubleQuote */) { + return name.substring(1, length - 1); + } + ; + return name; + } + function getSymbolScope(symbol) { + if (symbol.getFlags() && (4 /* Property */ | 8192 /* Method */)) { + var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32 /* Private */) ? d : undefined; }); + if (privateDeclaration) { + return ts.getAncestor(privateDeclaration, 187 /* ClassDeclaration */); + } + } + if (symbol.parent) { + return undefined; + } + var scope = undefined; + var declarations = symbol.getDeclarations(); + if (declarations) { + for (var i = 0, n = declarations.length; i < n; i++) { + var container = getContainerNode(declarations[i]); + if (!container) { + return undefined; + } + if (scope && scope !== container) { + return undefined; + } + if (container.kind === 196 /* SourceFile */ && !ts.isExternalModule(container)) { + return undefined; + } + scope = container; + } + } + return scope; + } + function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { + var positions = []; + if (!symbolName || !symbolName.length) { + return positions; + } + var text = sourceFile.text; + var sourceLength = text.length; + var symbolNameLength = symbolName.length; + var position = text.indexOf(symbolName, start); + while (position >= 0) { + cancellationToken.throwIfCancellationRequested(); + if (position > end) + break; + var endPosition = position + symbolNameLength; + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2 /* Latest */)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2 /* Latest */))) { + positions.push(position); + } + position = text.indexOf(symbolName, position + symbolNameLength + 1); + } + return positions; + } + function getLabelReferencesInNode(container, targetLabel) { + var result = []; + var sourceFile = container.getSourceFile(); + var labelName = targetLabel.text; + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); + ts.forEach(possiblePositions, function (position) { + cancellationToken.throwIfCancellationRequested(); + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.getWidth() !== labelName.length) { + return; + } + if (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { + result.push(getReferenceEntryFromNode(node)); + } + }); + return result; + } + function isValidReferencePosition(node, searchSymbolName) { + if (node) { + switch (node.kind) { + case 63 /* Identifier */: + return node.getWidth() === searchSymbolName.length; + case 7 /* StringLiteral */: + if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + return node.getWidth() === searchSymbolName.length + 2; + } + break; + case 6 /* NumericLiteral */: + if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { + return node.getWidth() === searchSymbolName.length; + } + break; + } + } + return false; + } + function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result) { + var sourceFile = container.getSourceFile(); + var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= 0) { + result.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); + } + } + }); + } + function isInString(position) { + var token = ts.getTokenAtPosition(sourceFile, position); + return token && token.kind === 7 /* StringLiteral */ && position > token.getStart(); + } + function isInComment(position) { + var token = ts.getTokenAtPosition(sourceFile, position); + if (token && position < token.getStart()) { + var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); + return ts.forEach(commentRanges, function (c) { + if (c.pos < position && position < c.end) { + var commentText = sourceFile.text.substring(c.pos, c.end); + if (!tripleSlashDirectivePrefixRegex.test(commentText)) { + return true; + } + } + }); + } + return false; + } + } + function getReferencesForSuperKeyword(superKeyword) { + var searchSpaceNode = ts.getSuperContainer(superKeyword); + if (!searchSpaceNode) { + return undefined; + } + var staticFlag = 128 /* Static */; + switch (searchSpaceNode.kind) { + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + staticFlag &= searchSpaceNode.flags; + searchSpaceNode = searchSpaceNode.parent; + break; + default: + return undefined; + } + var result = []; + var sourceFile = searchSpaceNode.getSourceFile(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); + ts.forEach(possiblePositions, function (position) { + cancellationToken.throwIfCancellationRequested(); + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.kind !== 89 /* SuperKeyword */) { + return; + } + var container = ts.getSuperContainer(node); + if (container && (128 /* Static */ & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { + result.push(getReferenceEntryFromNode(node)); + } + }); + return result; + } + function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { + var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); + var staticFlag = 128 /* Static */; + switch (searchSpaceNode.kind) { + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + staticFlag &= searchSpaceNode.flags; + searchSpaceNode = searchSpaceNode.parent; + break; + case 196 /* SourceFile */: + if (ts.isExternalModule(searchSpaceNode)) { + return undefined; + } + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + break; + default: + return undefined; + } + var result = []; + if (searchSpaceNode.kind === 196 /* SourceFile */) { + ts.forEach(sourceFiles, function (sourceFile) { + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); + }); + } + else { + var sourceFile = searchSpaceNode.getSourceFile(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result); + } + return result; + function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { + ts.forEach(possiblePositions, function (position) { + cancellationToken.throwIfCancellationRequested(); + var node = ts.getTouchingWord(sourceFile, position); + if (!node || node.kind !== 91 /* ThisKeyword */) { + return; + } + var container = ts.getThisContainer(node, false); + switch (searchSpaceNode.kind) { + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + if (searchSpaceNode.symbol === container.symbol) { + result.push(getReferenceEntryFromNode(node)); + } + break; + case 187 /* ClassDeclaration */: + if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128 /* Static */) === staticFlag) { + result.push(getReferenceEntryFromNode(node)); + } + break; + case 196 /* SourceFile */: + if (container.kind === 196 /* SourceFile */ && !ts.isExternalModule(container)) { + result.push(getReferenceEntryFromNode(node)); + } + break; + } + }); + } + } + function populateSearchSymbolSet(symbol, location) { + var result = [symbol]; + if (isNameOfPropertyAssignment(location)) { + ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { + result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); + }); + var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); + if (shorthandValueSymbol) { + result.push(shorthandValueSymbol); + } + } + ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { + if (rootSymbol !== symbol) { + result.push(rootSymbol); + } + if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + } + }); + return result; + } + function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { + if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { + ts.forEach(symbol.getDeclarations(), function (declaration) { + if (declaration.kind === 187 /* ClassDeclaration */) { + getPropertySymbolFromTypeReference(declaration.baseType); + ts.forEach(declaration.implementedTypes, getPropertySymbolFromTypeReference); + } + else if (declaration.kind === 188 /* InterfaceDeclaration */) { + ts.forEach(declaration.baseTypes, getPropertySymbolFromTypeReference); + } + }); + } + return; + function getPropertySymbolFromTypeReference(typeReference) { + if (typeReference) { + var type = typeInfoResolver.getTypeOfNode(typeReference); + if (type) { + var propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName); + if (propertySymbol) { + result.push(propertySymbol); + } + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result); + } + } + } + } + function isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation) { + if (searchSymbols.indexOf(referenceSymbol) >= 0) { + return true; + } + if (isNameOfPropertyAssignment(referenceLocation)) { + return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { + return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0; }); + }); + } + return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) { + if (searchSymbols.indexOf(rootSymbol) >= 0) { + return true; + } + if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { + var result = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + return ts.forEach(result, function (s) { return searchSymbols.indexOf(s) >= 0; }); + } + return false; + }); + } + function getPropertySymbolsFromContextualType(node) { + if (isNameOfPropertyAssignment(node)) { + var objectLiteral = node.parent.parent; + var contextualType = typeInfoResolver.getContextualType(objectLiteral); + var name = node.text; + if (contextualType) { + if (contextualType.flags & 16384 /* Union */) { + var unionProperty = contextualType.getProperty(name); + if (unionProperty) { + return [unionProperty]; + } + else { + var result = []; + ts.forEach(contextualType.types, function (t) { + var symbol = t.getProperty(name); + if (symbol) { + result.push(symbol); + } + }); + return result; + } + } + else { + var symbol = contextualType.getProperty(name); + if (symbol) { + return [symbol]; + } + } + } + } + return undefined; + } + function getIntersectingMeaningFromDeclarations(meaning, declarations) { + if (declarations) { + do { + var lastIterationMeaning = meaning; + for (var i = 0, n = declarations.length; i < n; i++) { + var declarationMeaning = getMeaningFromDeclaration(declarations[i]); + if (declarationMeaning & meaning) { + meaning |= declarationMeaning; + } + } + } while (meaning !== lastIterationMeaning); + } + return meaning; + } + } + function getReferenceEntryFromNode(node) { + var start = node.getStart(); + var end = node.getEnd(); + if (node.kind === 7 /* StringLiteral */) { + start += 1; + end -= 1; + } + return { + fileName: node.getSourceFile().filename, + textSpan: ts.TextSpan.fromBounds(start, end), + isWriteAccess: isWriteAccess(node) + }; + } + function isWriteAccess(node) { + if (node.kind === 63 /* Identifier */ && ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + return true; + } + var parent = node.parent; + if (parent) { + if (parent.kind === 155 /* PostfixOperator */ || parent.kind === 154 /* PrefixOperator */) { + return true; + } + else if (parent.kind === 156 /* BinaryExpression */ && parent.left === node) { + var operator = parent.operator; + return 51 /* FirstAssignment */ <= operator && operator <= 62 /* LastAssignment */; + } + } + return false; + } + function getNavigateToItems(searchValue) { + synchronizeHostData(); + var terms = searchValue.split(" "); + var searchTerms = ts.map(terms, function (t) { return ({ caseSensitive: hasAnyUpperCaseCharacter(t), term: t }); }); + var items = []; + ts.forEach(program.getSourceFiles(), function (sourceFile) { + cancellationToken.throwIfCancellationRequested(); + var filename = sourceFile.filename; + var declarations = sourceFile.getNamedDeclarations(); + for (var i = 0, n = declarations.length; i < n; i++) { + var declaration = declarations[i]; + var name = declaration.name.text; + var matchKind = getMatchKind(searchTerms, name); + if (matchKind !== 0 /* none */) { + var container = getContainerNode(declaration); + items.push({ + name: name, + kind: getNodeKind(declaration), + kindModifiers: getNodeModifiers(declaration), + matchKind: MatchKind[matchKind], + fileName: filename, + textSpan: ts.TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), + containerName: container && container.name ? container.name.text : "", + containerKind: container && container.name ? getNodeKind(container) : "" + }); + } + } + }); + return items; + function hasAnyUpperCaseCharacter(s) { + for (var i = 0, n = s.length; i < n; i++) { + var c = s.charCodeAt(i); + if ((65 /* A */ <= c && c <= 90 /* Z */) || (c >= 127 /* maxAsciiCharacter */ && s.charAt(i).toLocaleLowerCase() !== s.charAt(i))) { + return true; + } + } + return false; + } + function getMatchKind(searchTerms, name) { + var matchKind = 0 /* none */; + if (name) { + for (var j = 0, n = searchTerms.length; j < n; j++) { + var searchTerm = searchTerms[j]; + var nameToSearch = searchTerm.caseSensitive ? name : name.toLocaleLowerCase(); + var index = nameToSearch.indexOf(searchTerm.term); + if (index < 0) { + return 0 /* none */; + } + var termKind = 2 /* substring */; + if (index === 0) { + termKind = name.length === searchTerm.term.length ? 1 /* exact */ : 3 /* prefix */; + } + if (matchKind === 0 /* none */ || termKind < matchKind) { + matchKind = termKind; + } + } + } + return matchKind; + } + } + function containErrors(diagnostics) { + return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); + } + function getEmitOutput(filename) { + synchronizeHostData(); + filename = ts.normalizeSlashes(filename); + var compilerOptions = program.getCompilerOptions(); + var targetSourceFile = program.getSourceFile(filename); + var shouldEmitToOwnFile = ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions); + var emitOutput = { + outputFiles: [], + emitOutputStatus: undefined + }; + function getEmitOutputWriter(filename, data, writeByteOrderMark) { + emitOutput.outputFiles.push({ + name: filename, + writeByteOrderMark: writeByteOrderMark, + text: data + }); + } + writer = getEmitOutputWriter; + var containSyntacticErrors = false; + if (shouldEmitToOwnFile) { + containSyntacticErrors = containErrors(program.getDiagnostics(targetSourceFile)); + } + else { + containSyntacticErrors = ts.forEach(program.getSourceFiles(), function (sourceFile) { + if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + return containErrors(program.getDiagnostics(sourceFile)); + } + return false; + }); + } + if (containSyntacticErrors) { + emitOutput.emitOutputStatus = 1 /* AllOutputGenerationSkipped */; + writer = undefined; + return emitOutput; + } + var emitFilesResult = getFullTypeCheckChecker().invokeEmitter(targetSourceFile); + emitOutput.emitOutputStatus = emitFilesResult.emitResultStatus; + writer = undefined; + return emitOutput; + } + function getMeaningFromDeclaration(node) { + switch (node.kind) { + case 123 /* Parameter */: + case 184 /* VariableDeclaration */: + case 124 /* Property */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + case 195 /* EnumMember */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 181 /* CatchBlock */: + return 1 /* Value */; + case 122 /* TypeParameter */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 136 /* TypeLiteral */: + return 2 /* Type */; + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + return 1 /* Value */ | 2 /* Type */; + case 191 /* ModuleDeclaration */: + if (node.name.kind === 7 /* StringLiteral */) { + return 4 /* Namespace */ | 1 /* Value */; + } + else if (ts.getModuleInstanceState(node) === 1 /* Instantiated */) { + return 4 /* Namespace */ | 1 /* Value */; + } + else { + return 4 /* Namespace */; + } + case 193 /* ImportDeclaration */: + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; + case 196 /* SourceFile */: + return 4 /* Namespace */ | 1 /* Value */; + } + ts.Debug.fail("Unknown declaration type"); + } + function isTypeReference(node) { + if (isRightSideOfQualifiedName(node)) { + node = node.parent; + } + return node.parent.kind === 132 /* TypeReference */; + } + function isNamespaceReference(node) { + var root = node; + var isLastClause = true; + if (root.parent.kind === 121 /* QualifiedName */) { + while (root.parent && root.parent.kind === 121 /* QualifiedName */) + root = root.parent; + isLastClause = root.right === node; + } + return root.parent.kind === 132 /* TypeReference */ && !isLastClause; + } + function isInRightSideOfImport(node) { + while (node.parent.kind === 121 /* QualifiedName */) { + node = node.parent; + } + return node.parent.kind === 193 /* ImportDeclaration */ && node.parent.entityName === node; + } + function getMeaningFromRightHandSideOfImport(node) { + ts.Debug.assert(node.kind === 63 /* Identifier */); + if (node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node && node.parent.parent.kind === 193 /* ImportDeclaration */) { + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; + } + return 4 /* Namespace */; + } + function getMeaningFromLocation(node) { + if (node.parent.kind === 194 /* ExportAssignment */) { + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; + } + else if (isInRightSideOfImport(node)) { + return getMeaningFromRightHandSideOfImport(node); + } + else if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + return getMeaningFromDeclaration(node.parent); + } + else if (isTypeReference(node)) { + return 2 /* Type */; + } + else if (isNamespaceReference(node)) { + return 4 /* Namespace */; + } + else { + return 1 /* Value */; + } + } + function getSignatureHelpItems(fileName, position) { + synchronizeHostData(); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getSourceFile(fileName); + return ts.SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); + } + function getSignatureAtPosition(filename, position) { + var signatureHelpItems = getSignatureHelpItems(filename, position); + if (!signatureHelpItems) { + return undefined; + } + var currentArgumentState = { argumentIndex: signatureHelpItems.argumentIndex, argumentCount: signatureHelpItems.argumentCount }; + var formalSignatures = []; + ts.forEach(signatureHelpItems.items, function (signature) { + var signatureInfoString = displayPartsToString(signature.prefixDisplayParts); + var parameters = []; + if (signature.parameters) { + for (var i = 0, n = signature.parameters.length; i < n; i++) { + var parameter = signature.parameters[i]; + if (i) { + signatureInfoString += displayPartsToString(signature.separatorDisplayParts); + } + var start = signatureInfoString.length; + signatureInfoString += displayPartsToString(parameter.displayParts); + var end = signatureInfoString.length; + parameters.push({ + name: parameter.name, + isVariable: i === n - 1 && signature.isVariadic, + docComment: displayPartsToString(parameter.documentation), + minChar: start, + limChar: end + }); + } + } + signatureInfoString += displayPartsToString(signature.suffixDisplayParts); + formalSignatures.push({ + signatureInfo: signatureInfoString, + docComment: displayPartsToString(signature.documentation), + parameters: parameters, + typeParameters: [] + }); + }); + var actualSignature = { + parameterMinChar: signatureHelpItems.applicableSpan.start(), + parameterLimChar: signatureHelpItems.applicableSpan.end(), + currentParameterIsTypeParameter: false, + currentParameter: currentArgumentState.argumentIndex + }; + return { + actual: actualSignature, + formal: formalSignatures, + activeFormal: 0 + }; } function getCurrentSourceFile(filename) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var currentSourceFile = syntaxTreeCache.getCurrentSourceFile(filename); return currentSourceFile; } function getNameOrDottedNameSpan(filename, startPos, endPos) { - function getTypeInfoEligiblePath(filename, position, isConstructorValidPosition) { - var sourceUnit = syntaxTreeCache.getCurrentFileSyntaxTree(filename).sourceUnit(); - var ast = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, false, true); - if (ast === null) { - return null; - } - if (ast.kind() === 227 /* ParameterList */ && ast.parent.kind() === 142 /* CallSignature */ && ast.parent.parent.kind() === 137 /* ConstructorDeclaration */) { - ast = ast.parent.parent; - } - switch (ast.kind()) { - default: - return null; - case 137 /* ConstructorDeclaration */: - var constructorAST = ast; - if (!isConstructorValidPosition || !(position >= TypeScript.start(constructorAST) && position <= TypeScript.start(constructorAST) + "constructor".length)) { - return null; - } - else { - return ast; - } - case 129 /* FunctionDeclaration */: - return null; - case 212 /* MemberAccessExpression */: - case 121 /* QualifiedName */: - case 50 /* SuperKeyword */: - case 14 /* StringLiteral */: - case 35 /* ThisKeyword */: - case 11 /* IdentifierName */: - return ast; - } + filename = ts.normalizeSlashes(filename); + var node = ts.getTouchingPropertyName(getCurrentSourceFile(filename), startPos); + if (!node) { + return; } - filename = TypeScript.switchToForwardSlashes(filename); - var node = getTypeInfoEligiblePath(filename, startPos, false); - if (!node) - return null; - while (node) { - if (TypeScript.ASTHelpers.isNameOfMemberAccessExpression(node) || TypeScript.ASTHelpers.isRightSideOfQualifiedName(node)) { - node = node.parent; + switch (node.kind) { + case 145 /* PropertyAccess */: + case 121 /* QualifiedName */: + case 7 /* StringLiteral */: + case 78 /* FalseKeyword */: + case 93 /* TrueKeyword */: + case 87 /* NullKeyword */: + case 89 /* SuperKeyword */: + case 91 /* ThisKeyword */: + case 63 /* Identifier */: + break; + default: + return; + } + var nodeForStartPos = node; + while (true) { + if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { + nodeForStartPos = nodeForStartPos.parent; + } + else if (isNameOfModuleDeclaration(nodeForStartPos)) { + if (nodeForStartPos.parent.parent.kind === 191 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + nodeForStartPos = nodeForStartPos.parent.parent.name; + } + else { + break; + } } else { break; } } - return TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node)); + return ts.TextSpan.fromBounds(nodeForStartPos.getStart(), node.getEnd()); } function getBreakpointStatementAtPosition(filename, position) { - filename = TypeScript.switchToForwardSlashes(filename); - var syntaxtree = getSyntaxTree(filename); - return TypeScript.Services.Breakpoints.getBreakpointLocation(syntaxtree, position); + filename = ts.normalizeSlashes(filename); + return ts.BreakpointResolver.spanInSourceFileAtLocation(getCurrentSourceFile(filename), position); } function getNavigationBarItems(filename) { - filename = TypeScript.switchToForwardSlashes(filename); - var syntaxTree = getSyntaxTree(filename); - return new TypeScript.Services.NavigationBarItemGetter().getItems(syntaxTree.sourceUnit()); + filename = ts.normalizeSlashes(filename); + return ts.NavigationBar.getNavigationBarItems(getCurrentSourceFile(filename)); + } + function getSemanticClassifications(fileName, span) { + synchronizeHostData(); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getSourceFile(fileName); + var result = []; + processNode(sourceFile); + return result; + function classifySymbol(symbol, meaningAtPosition) { + var flags = symbol.getFlags(); + if (flags & 32 /* Class */) { + return ClassificationTypeNames.className; + } + else if (flags & 384 /* Enum */) { + return ClassificationTypeNames.enumName; + } + else if (meaningAtPosition & 2 /* Type */) { + if (flags & 64 /* Interface */) { + return ClassificationTypeNames.interfaceName; + } + else if (flags & 1048576 /* TypeParameter */) { + return ClassificationTypeNames.typeParameterName; + } + } + else if (flags & 1536 /* Module */) { + if (meaningAtPosition & 4 /* Namespace */ || (meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol))) { + return ClassificationTypeNames.moduleName; + } + } + return undefined; + function hasValueSideModule(symbol) { + return ts.forEach(symbol.declarations, function (declaration) { + return declaration.kind === 191 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; + }); + } + } + function processNode(node) { + if (node && span.intersectsWith(node.getStart(), node.getWidth())) { + if (node.kind === 63 /* Identifier */ && node.getWidth() > 0) { + var symbol = typeInfoResolver.getSymbolInfo(node); + if (symbol) { + var type = classifySymbol(symbol, getMeaningFromLocation(node)); + if (type) { + result.push({ + textSpan: new ts.TextSpan(node.getStart(), node.getWidth()), + classificationType: type + }); + } + } + } + ts.forEachChild(node, processNode); + } + } + } + function getSyntacticClassifications(fileName, span) { + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getCurrentSourceFile(fileName); + var result = []; + processElement(sourceFile); + return result; + function classifyComment(comment) { + var width = comment.end - comment.pos; + if (span.intersectsWith(comment.pos, width)) { + result.push({ + textSpan: new ts.TextSpan(comment.pos, width), + classificationType: ClassificationTypeNames.comment + }); + } + } + function classifyToken(token) { + ts.forEach(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()), classifyComment); + if (token.getWidth() > 0) { + var type = classifyTokenType(token); + if (type) { + result.push({ + textSpan: new ts.TextSpan(token.getStart(), token.getWidth()), + classificationType: type + }); + } + } + ts.forEach(ts.getTrailingCommentRanges(sourceFile.text, token.getEnd()), classifyComment); + } + function classifyTokenType(token) { + var tokenKind = token.kind; + if (ts.isKeyword(tokenKind)) { + return ClassificationTypeNames.keyword; + } + if (tokenKind === 23 /* LessThanToken */ || tokenKind === 24 /* GreaterThanToken */) { + if (ts.getTypeArgumentOrTypeParameterList(token.parent)) { + return ClassificationTypeNames.punctuation; + } + } + if (ts.isPunctuation(token.kind)) { + if (token.parent.kind === 156 /* BinaryExpression */ || token.parent.kind === 184 /* VariableDeclaration */ || token.parent.kind === 154 /* PrefixOperator */ || token.parent.kind === 155 /* PostfixOperator */ || token.parent.kind === 157 /* ConditionalExpression */) { + return ClassificationTypeNames.operator; + } + else { + return ClassificationTypeNames.punctuation; + } + } + else if (tokenKind === 6 /* NumericLiteral */) { + return ClassificationTypeNames.numericLiteral; + } + else if (tokenKind === 7 /* StringLiteral */) { + return ClassificationTypeNames.stringLiteral; + } + else if (tokenKind === 8 /* RegularExpressionLiteral */) { + return ClassificationTypeNames.stringLiteral; + } + else if (ts.isTemplateLiteralKind(tokenKind)) { + return ClassificationTypeNames.stringLiteral; + } + else if (tokenKind === 63 /* Identifier */) { + switch (token.parent.kind) { + case 187 /* ClassDeclaration */: + if (token.parent.name === token) { + return ClassificationTypeNames.className; + } + return; + case 122 /* TypeParameter */: + if (token.parent.name === token) { + return ClassificationTypeNames.typeParameterName; + } + return; + case 188 /* InterfaceDeclaration */: + if (token.parent.name === token) { + return ClassificationTypeNames.interfaceName; + } + return; + case 190 /* EnumDeclaration */: + if (token.parent.name === token) { + return ClassificationTypeNames.enumName; + } + return; + case 191 /* ModuleDeclaration */: + if (token.parent.name === token) { + return ClassificationTypeNames.moduleName; + } + return; + default: + return ClassificationTypeNames.text; + } + } + } + function processElement(element) { + if (span.intersectsWith(element.getFullStart(), element.getFullWidth())) { + var children = element.getChildren(); + for (var i = 0, n = children.length; i < n; i++) { + var child = children[i]; + if (ts.isToken(child)) { + classifyToken(child); + } + else { + processElement(child); + } + } + } + } } function getOutliningSpans(filename) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var sourceFile = getCurrentSourceFile(filename); return ts.OutliningElementsCollector.collectElements(sourceFile); } function getBraceMatchingAtPosition(filename, position) { - filename = TypeScript.switchToForwardSlashes(filename); - var syntaxTree = getSyntaxTree(filename); - return TypeScript.Services.BraceMatcher.getMatchSpans(syntaxTree, position); + var sourceFile = getCurrentSourceFile(filename); + var result = []; + var token = ts.getTouchingToken(sourceFile, position); + if (token.getStart(sourceFile) === position) { + var matchKind = getMatchingTokenKind(token); + if (matchKind) { + var parentElement = token.parent; + var childNodes = parentElement.getChildren(sourceFile); + for (var i = 0, n = childNodes.length; i < n; i++) { + 33; + var current = childNodes[i]; + if (current.kind === matchKind) { + var range1 = new ts.TextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); + var range2 = new ts.TextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); + if (range1.start() < range2.start()) { + result.push(range1, range2); + } + else { + result.push(range2, range1); + } + break; + } + } + } + } + return result; + function getMatchingTokenKind(token) { + switch (token.kind) { + case 13 /* OpenBraceToken */: return 14 /* CloseBraceToken */; + case 15 /* OpenParenToken */: return 16 /* CloseParenToken */; + case 17 /* OpenBracketToken */: return 18 /* CloseBracketToken */; + case 23 /* LessThanToken */: return 24 /* GreaterThanToken */; + case 14 /* CloseBraceToken */: return 13 /* OpenBraceToken */; + case 16 /* CloseParenToken */: return 15 /* OpenParenToken */; + case 18 /* CloseBracketToken */: return 17 /* OpenBracketToken */; + case 24 /* GreaterThanToken */: return 23 /* LessThanToken */; + } + return undefined; + } } function getIndentationAtPosition(filename, position, editorOptions) { - filename = TypeScript.switchToForwardSlashes(filename); - var syntaxTree = getSyntaxTree(filename); - var scriptSnapshot = syntaxTreeCache.getCurrentScriptSnapshot(filename); - var scriptText = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var textSnapshot = new TypeScript.Services.Formatting.TextSnapshot(scriptText); - var options = new TypeScript.FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter); - return TypeScript.Services.Formatting.SingleTokenIndenter.getIndentationAmount(position, syntaxTree.sourceUnit(), textSnapshot, options); - } - function getFormattingManager(filename, options) { - if (formattingRulesProvider == null) { - formattingRulesProvider = new TypeScript.Services.Formatting.RulesProvider(host); - } - formattingRulesProvider.ensureUpToDate(options); - var syntaxTree = getSyntaxTree(filename); - var scriptSnapshot = syntaxTreeCache.getCurrentScriptSnapshot(filename); - var scriptText = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var textSnapshot = new TypeScript.Services.Formatting.TextSnapshot(scriptText); - var manager = new TypeScript.Services.Formatting.FormattingManager(syntaxTree, textSnapshot, formattingRulesProvider, options); - return manager; + filename = ts.normalizeSlashes(filename); + var start = new Date().getTime(); + var sourceFile = getCurrentSourceFile(filename); + host.log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start)); + var start = new Date().getTime(); + var result = ts.formatting.SmartIndenter.getIndentation(position, sourceFile, editorOptions); + host.log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start)); + return result; } function getFormattingEditsForRange(fileName, start, end, options) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var manager = getFormattingManager(fileName, options); - return manager.formatSelection(start, end); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getCurrentSourceFile(fileName); + return ts.formatting.formatSelection(start, end, sourceFile, getRuleProvider(options), options); } function getFormattingEditsForDocument(fileName, options) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var manager = getFormattingManager(fileName, options); - return manager.formatDocument(); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getCurrentSourceFile(fileName); + return ts.formatting.formatDocument(sourceFile, getRuleProvider(options), options); } function getFormattingEditsAfterKeystroke(fileName, position, key, options) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var manager = getFormattingManager(fileName, options); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getCurrentSourceFile(fileName); if (key === "}") { - return manager.formatOnClosingCurlyBrace(position); + return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(options), options); } else if (key === ";") { - return manager.formatOnSemicolon(position); + return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(options), options); } else if (key === "\n") { - return manager.formatOnEnter(position); + return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(options), options); } return []; } - function escapeRegExp(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - } - function getTodoCommentsRegExp(descriptors) { - var singleLineCommentStart = /(?:\/\/+\s*)/.source; - var multiLineCommentStart = /(?:\/\*+\s*)/.source; - var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; - var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; - var literals = "(?:" + descriptors.map(function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; - var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; - var messageRemainder = /(?:.*?)/.source; - var messagePortion = "(" + literals + messageRemainder + ")"; - var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; - return new RegExp(regExpString, "gim"); - } - function getTodoComments(fileName, descriptors) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var sourceFile = getCurrentSourceFile(fileName); - var syntaxTree = sourceFile.getSyntaxTree(); + function getTodoComments(filename, descriptors) { + synchronizeHostData(); + filename = ts.normalizeSlashes(filename); + var sourceFile = getSourceFile(filename); cancellationToken.throwIfCancellationRequested(); - var text = syntaxTree.text; - var fileContents = text.substr(0, text.length()); + var fileContents = sourceFile.text; cancellationToken.throwIfCancellationRequested(); var result = []; if (descriptors.length > 0) { - var regExp = getTodoCommentsRegExp(descriptors); + var regExp = getTodoCommentsRegExp(); var matchArray; while (matchArray = regExp.exec(fileContents)) { cancellationToken.throwIfCancellationRequested(); @@ -32219,13 +22952,8 @@ var ts; ts.Debug.assert(matchArray.length === descriptors.length + firstDescriptorCaptureIndex); var preamble = matchArray[1]; var matchPosition = matchArray.index + preamble.length; - var token = TypeScript.findToken(syntaxTree.sourceUnit(), matchPosition); - if (matchPosition >= TypeScript.start(token) && matchPosition < TypeScript.end(token)) { - continue; - } - var triviaList = matchPosition < TypeScript.start(token) ? token.leadingTrivia(syntaxTree.text) : token.trailingTrivia(syntaxTree.text); - var trivia = findContainingComment(triviaList, matchPosition); - if (trivia === null) { + var token = ts.getTokenAtPosition(sourceFile, matchPosition); + if (!isInsideComment(sourceFile, token, matchPosition)) { continue; } var descriptor = undefined; @@ -32234,28 +22962,86 @@ var ts; descriptor = descriptors[i]; } } - ts.Debug.assert(descriptor); + ts.Debug.assert(descriptor !== undefined); if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) { continue; } var message = matchArray[2]; - result.push(new TodoComment(descriptor, message, matchPosition)); + result.push({ + descriptor: descriptor, + message: message, + position: matchPosition + }); } } return result; + function escapeRegExp(str) { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + } + function getTodoCommentsRegExp() { + var singleLineCommentStart = /(?:\/\/+\s*)/.source; + var multiLineCommentStart = /(?:\/\*+\s*)/.source; + var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; + var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; + var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; + var messageRemainder = /(?:.*?)/.source; + var messagePortion = "(" + literals + messageRemainder + ")"; + var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; + return new RegExp(regExpString, "gim"); + } + function getContainingComment(comments, position) { + if (comments) { + for (var i = 0, n = comments.length; i < n; i++) { + var comment = comments[i]; + if (comment.pos <= position && position < comment.end) { + return comment; + } + } + } + return undefined; + } + function isLetterOrDigit(char) { + return (char >= 97 /* a */ && char <= 122 /* z */) || (char >= 65 /* A */ && char <= 90 /* Z */) || (char >= 48 /* _0 */ && char <= 57 /* _9 */); + } } - function isLetterOrDigit(char) { - return (char >= 97 /* a */ && char <= 122 /* z */) || (char >= 65 /* A */ && char <= 90 /* Z */) || (char >= 48 /* _0 */ && char <= 57 /* _9 */); - } - function findContainingComment(triviaList, position) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - var fullEnd = trivia.fullStart() + trivia.fullWidth(); - if (trivia.isComment() && trivia.fullStart() <= position && position < fullEnd) { - return trivia; + function getRenameInfo(fileName, position) { + synchronizeHostData(); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getSourceFile(fileName); + var node = ts.getTouchingWord(sourceFile, position); + if (node && node.kind === 63 /* Identifier */) { + var symbol = typeInfoResolver.getSymbolInfo(node); + if (symbol && symbol.getDeclarations() && symbol.getDeclarations().length > 0) { + var kind = getSymbolKind(symbol, typeInfoResolver); + if (kind) { + return getRenameInfo(symbol.name, typeInfoResolver.getFullyQualifiedName(symbol), kind, getSymbolModifiers(symbol), new ts.TextSpan(node.getStart(), node.getWidth())); + } } } - return null; + return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element.key)); + function getRenameInfoError(localizedErrorMessage) { + return { + canRename: false, + localizedErrorMessage: ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element.key), + displayName: undefined, + fullDisplayName: undefined, + kind: undefined, + kindModifiers: undefined, + triggerSpan: undefined + }; + } + function getRenameInfo(displayName, fullDisplayName, kind, kindModifiers, triggerSpan) { + return { + canRename: true, + localizedErrorMessage: undefined, + displayName: displayName, + fullDisplayName: fullDisplayName, + kind: kind, + kindModifiers: kindModifiers, + triggerSpan: triggerSpan + }; + } } return { dispose: dispose, @@ -32263,19 +23049,20 @@ var ts; getSyntacticDiagnostics: getSyntacticDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, + getSyntacticClassifications: getSyntacticClassifications, + getSemanticClassifications: getSemanticClassifications, getCompletionsAtPosition: getCompletionsAtPosition, getCompletionEntryDetails: getCompletionEntryDetails, - getTypeAtPosition: getTypeAtPosition, - getSignatureHelpItems: function (filename, position) { return null; }, - getSignatureHelpCurrentArgumentState: function (fileName, position, applicableSpanStart) { return null; }, + getSignatureHelpItems: getSignatureHelpItems, + getQuickInfoAtPosition: getQuickInfoAtPosition, getDefinitionAtPosition: getDefinitionAtPosition, - getReferencesAtPosition: function (filename, position) { return []; }, - getOccurrencesAtPosition: function (filename, position) { return []; }, - getImplementorsAtPosition: function (filename, position) { return []; }, + getReferencesAtPosition: getReferencesAtPosition, + getOccurrencesAtPosition: getOccurrencesAtPosition, getNameOrDottedNameSpan: getNameOrDottedNameSpan, getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, - getNavigateToItems: function (searchValue) { return []; }, - getRenameInfo: function (fileName, position) { return RenameInfo.CreateError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element.key)); }, + getNavigateToItems: getNavigateToItems, + getRenameInfo: getRenameInfo, + findRenameLocations: findRenameLocations, getNavigationBarItems: getNavigationBarItems, getOutliningSpans: getOutliningSpans, getTodoComments: getTodoComments, @@ -32284,33 +23071,48 @@ var ts; getFormattingEditsForRange: getFormattingEditsForRange, getFormattingEditsForDocument: getFormattingEditsForDocument, getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, - getEmitOutput: function (filename) { return null; } + getEmitOutput: getEmitOutput, + getSignatureAtPosition: getSignatureAtPosition }; } ts.createLanguageService = createLanguageService; function createClassifier(host) { - var scanner; - var noRegexTable; - if (!noRegexTable) { - noRegexTable = []; - noRegexTable[55 /* Identifier */] = true; - noRegexTable[3 /* StringLiteral */] = true; - noRegexTable[2 /* NumericLiteral */] = true; - noRegexTable[4 /* RegularExpressionLiteral */] = true; - noRegexTable[83 /* ThisKeyword */] = true; - noRegexTable[29 /* PlusPlusToken */] = true; - noRegexTable[30 /* MinusMinusToken */] = true; - noRegexTable[8 /* CloseParenToken */] = true; - noRegexTable[10 /* CloseBracketToken */] = true; - noRegexTable[6 /* CloseBraceToken */] = true; - noRegexTable[85 /* TrueKeyword */] = true; - noRegexTable[70 /* FalseKeyword */] = true; + var scanner = ts.createScanner(2 /* Latest */, false); + var noRegexTable = []; + noRegexTable[63 /* Identifier */] = true; + noRegexTable[7 /* StringLiteral */] = true; + noRegexTable[6 /* NumericLiteral */] = true; + noRegexTable[8 /* RegularExpressionLiteral */] = true; + noRegexTable[91 /* ThisKeyword */] = true; + noRegexTable[37 /* PlusPlusToken */] = true; + noRegexTable[38 /* MinusMinusToken */] = true; + noRegexTable[16 /* CloseParenToken */] = true; + noRegexTable[18 /* CloseBracketToken */] = true; + noRegexTable[14 /* CloseBraceToken */] = true; + noRegexTable[93 /* TrueKeyword */] = true; + noRegexTable[78 /* FalseKeyword */] = true; + function isAccessibilityModifier(kind) { + switch (kind) { + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + return true; + } + return false; + } + function canFollow(keyword1, keyword2) { + if (isAccessibilityModifier(keyword1)) { + if (keyword2 === 113 /* GetKeyword */ || keyword2 === 117 /* SetKeyword */ || keyword2 === 111 /* ConstructorKeyword */ || keyword2 === 107 /* StaticKeyword */) { + return true; + } + return false; + } + return true; } function getClassificationsForLine(text, lexState) { var offset = 0; - var lastTokenOrCommentEnd = 0; - var lastToken = 0 /* Unknown */; - var inUnterminatedMultiLineComment = false; + var token = 0 /* Unknown */; + var lastNonTriviaToken = 0 /* Unknown */; switch (lexState) { case 3 /* InDoubleQuoteStringLiteral */: text = '"\\\n' + text; @@ -32324,64 +23126,63 @@ var ts; text = "/*\n" + text; offset = 3; break; - case 4 /* EndingWithDotToken */: - lastToken = 11 /* DotToken */; - break; } + scanner.setText(text); var result = { finalLexState: 0 /* Start */, entries: [] }; - scanner = ts.createScanner(1 /* ES5 */, text, onError, processComment); - var token = 0 /* Unknown */; + var angleBracketStack = 0; do { token = scanner.scan(); - if ((token === 27 /* SlashToken */ || token === 47 /* SlashEqualsToken */) && !noRegexTable[lastToken]) { - if (scanner.reScanSlashToken() === 4 /* RegularExpressionLiteral */) { - token = 4 /* RegularExpressionLiteral */; + if (!ts.isTrivia(token)) { + if ((token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { + if (scanner.reScanSlashToken() === 8 /* RegularExpressionLiteral */) { + token = 8 /* RegularExpressionLiteral */; + } } + else if (lastNonTriviaToken === 19 /* DotToken */ && isKeyword(token)) { + token = 63 /* Identifier */; + } + else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { + token = 63 /* Identifier */; + } + else if (lastNonTriviaToken === 63 /* Identifier */ && token === 23 /* LessThanToken */) { + angleBracketStack++; + } + else if (token === 24 /* GreaterThanToken */ && angleBracketStack > 0) { + angleBracketStack--; + } + else if (token === 109 /* AnyKeyword */ || token === 118 /* StringKeyword */ || token === 116 /* NumberKeyword */ || token === 110 /* BooleanKeyword */) { + if (angleBracketStack > 0) { + token = 63 /* Identifier */; + } + } + lastNonTriviaToken = token; } - else if (lastToken === 11 /* DotToken */) { - token = 55 /* Identifier */; - } - lastToken = token; processToken(); } while (token !== 1 /* EndOfFileToken */); return result; - function onError(message) { - inUnterminatedMultiLineComment = message.key === ts.Diagnostics.Asterisk_Slash_expected.key; - } - function processComment(start, end) { - addLeadingWhiteSpace(start, end); - addResult(end - start, 3 /* Comment */); - } function processToken() { var start = scanner.getTokenPos(); var end = scanner.getTextPos(); - addLeadingWhiteSpace(start, end); addResult(end - start, classFromKind(token)); if (end >= text.length) { - if (inUnterminatedMultiLineComment) { - result.finalLexState = 1 /* InMultiLineCommentTrivia */; - } - else if (token === 3 /* StringLiteral */) { + if (token === 7 /* StringLiteral */) { var tokenText = scanner.getTokenText(); if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === 92 /* backslash */) { var quoteChar = tokenText.charCodeAt(0); result.finalLexState = quoteChar === 34 /* doubleQuote */ ? 3 /* InDoubleQuoteStringLiteral */ : 2 /* InSingleQuoteStringLiteral */; } } - else if (token === 11 /* DotToken */) { - result.finalLexState = 4 /* EndingWithDotToken */; + else if (token === 3 /* MultiLineCommentTrivia */) { + var tokenText = scanner.getTokenText(); + if (!(tokenText.length > 3 && tokenText.charCodeAt(tokenText.length - 2) === 42 /* asterisk */ && tokenText.charCodeAt(tokenText.length - 1) === 47 /* slash */)) { + result.finalLexState = 1 /* InMultiLineCommentTrivia */; + } } } } - function addLeadingWhiteSpace(start, end) { - if (start > lastTokenOrCommentEnd) { - addResult(start - lastTokenOrCommentEnd, 4 /* Whitespace */); - } - lastTokenOrCommentEnd = end; - } function addResult(length, classification) { if (length > 0) { if (result.entries.length === 0) { @@ -32393,62 +23194,61 @@ var ts; } function isBinaryExpressionOperatorToken(token) { switch (token) { - case 26 /* AsteriskToken */: - case 27 /* SlashToken */: - case 28 /* PercentToken */: - case 24 /* PlusToken */: - case 25 /* MinusToken */: - case 31 /* LessThanLessThanToken */: - case 32 /* GreaterThanGreaterThanToken */: - case 33 /* GreaterThanGreaterThanGreaterThanToken */: - case 15 /* LessThanToken */: - case 16 /* GreaterThanToken */: - case 17 /* LessThanEqualsToken */: - case 18 /* GreaterThanEqualsToken */: - case 77 /* InstanceOfKeyword */: - case 76 /* InKeyword */: - case 19 /* EqualsEqualsToken */: - case 20 /* ExclamationEqualsToken */: - case 21 /* EqualsEqualsEqualsToken */: - case 22 /* ExclamationEqualsEqualsToken */: - case 34 /* AmpersandToken */: - case 36 /* CaretToken */: - case 35 /* BarToken */: - case 39 /* AmpersandAmpersandToken */: - case 40 /* BarBarToken */: - case 53 /* BarEqualsToken */: - case 52 /* AmpersandEqualsToken */: - case 54 /* CaretEqualsToken */: - case 49 /* LessThanLessThanEqualsToken */: - case 50 /* GreaterThanGreaterThanEqualsToken */: - case 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 44 /* PlusEqualsToken */: - case 45 /* MinusEqualsToken */: - case 46 /* AsteriskEqualsToken */: - case 47 /* SlashEqualsToken */: - case 48 /* PercentEqualsToken */: - case 43 /* EqualsToken */: - case 14 /* CommaToken */: + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 39 /* LessThanLessThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + case 85 /* InstanceOfKeyword */: + case 84 /* InKeyword */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: + case 42 /* AmpersandToken */: + case 44 /* CaretToken */: + case 43 /* BarToken */: + case 47 /* AmpersandAmpersandToken */: + case 48 /* BarBarToken */: + case 61 /* BarEqualsToken */: + case 60 /* AmpersandEqualsToken */: + case 62 /* CaretEqualsToken */: + case 57 /* LessThanLessThanEqualsToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 52 /* PlusEqualsToken */: + case 53 /* MinusEqualsToken */: + case 54 /* AsteriskEqualsToken */: + case 55 /* SlashEqualsToken */: + case 56 /* PercentEqualsToken */: + case 51 /* EqualsToken */: + case 22 /* CommaToken */: return true; - default: - return false; + default: return false; } } function isPrefixUnaryExpressionOperatorToken(token) { switch (token) { - case 24 /* PlusToken */: - case 25 /* MinusToken */: - case 38 /* TildeToken */: - case 37 /* ExclamationToken */: - case 29 /* PlusPlusToken */: - case 30 /* MinusMinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: return true; default: return false; } } function isKeyword(token) { - return token >= ts.SyntaxKind.FirstKeyword && token <= ts.SyntaxKind.LastKeyword; + return token >= 64 /* FirstKeyword */ && token <= 119 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { @@ -32457,24 +23257,27 @@ var ts; else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { return 2 /* Operator */; } - else if (token >= ts.SyntaxKind.FirstPunctuation && token <= ts.SyntaxKind.LastPunctuation) { + else if (token >= 13 /* FirstPunctuation */ && token <= 62 /* LastPunctuation */) { return 0 /* Punctuation */; } switch (token) { - case 2 /* NumericLiteral */: + case 6 /* NumericLiteral */: return 6 /* NumberLiteral */; - case 3 /* StringLiteral */: + case 7 /* StringLiteral */: return 7 /* StringLiteral */; - case 4 /* RegularExpressionLiteral */: + case 8 /* RegularExpressionLiteral */: return 8 /* RegExpLiteral */; - case 55 /* Identifier */: + case 3 /* MultiLineCommentTrivia */: + case 2 /* SingleLineCommentTrivia */: + return 3 /* Comment */; + case 5 /* WhitespaceTrivia */: + return 4 /* Whitespace */; + case 63 /* Identifier */: default: return 5 /* Identifier */; } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine: getClassificationsForLine }; } ts.createClassifier = createClassifier; function initializeServices() { @@ -32482,7 +23285,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 177 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); + var proto = kind === 196 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -32498,192 +23301,387 @@ var ts; } initializeServices(); })(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - function isNoDefaultLibMatch(comment) { - var isNoDefaultLibRegex = /^(\/\/\/\s*/gim; - return isNoDefaultLibRegex.exec(comment); - } - TypeScript.tripleSlashReferenceRegExp = /^(\/\/\/\s*/; - function getFileReferenceFromReferencePath(fileName, text, position, comment, diagnostics) { - var lineMap = text.lineMap(); - var simpleReferenceRegEx = /^\/\/\/\s*= 7 && fullReference[6] === "true"; - return { - line: 0, - character: 0, - position: 0, - length: 0, - path: TypeScript.switchToForwardSlashes(adjustedPath), - isResident: isResident - }; +var ts; +(function (ts) { + var BreakpointResolver; + (function (BreakpointResolver) { + function spanInSourceFileAtLocation(sourceFile, position) { + if (sourceFile.flags & 1024 /* DeclarationFile */) { + return undefined; + } + var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position); + var lineOfPosition = sourceFile.getLineAndCharacterFromPosition(position).line; + if (sourceFile.getLineAndCharacterFromPosition(tokenAtLocation.getStart()).line > lineOfPosition) { + tokenAtLocation = ts.findPrecedingToken(tokenAtLocation.pos, sourceFile); + if (!tokenAtLocation || sourceFile.getLineAndCharacterFromPosition(tokenAtLocation.getEnd()).line !== lineOfPosition) { + return undefined; } } - } - return null; - } - var reportDiagnostic = function () { - }; - function processImports(text, scanner, token, importedFiles) { - var lineChar = { line: -1, character: -1 }; - var lineMap = text.lineMap(); - var start = new Date().getTime(); - while (token.kind() !== 10 /* EndOfFileToken */) { - if (token.kind() === 49 /* ImportKeyword */) { - var importToken = token; - token = scanner.scan(false); - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - token = scanner.scan(false); - if (token.kind() === 107 /* EqualsToken */) { - token = scanner.scan(false); - if (token.kind() === 65 /* ModuleKeyword */ || token.kind() === 66 /* RequireKeyword */) { - token = scanner.scan(false); - if (token.kind() === 72 /* OpenParenToken */) { - token = scanner.scan(false); - lineMap.fillLineAndCharacterFromPosition(TypeScript.start(importToken, text), lineChar); - if (token.kind() === 14 /* StringLiteral */) { - var ref = { - line: lineChar.line, - character: lineChar.character, - position: TypeScript.start(token, text), - length: TypeScript.width(token), - path: TypeScript.stripStartAndEndQuotes(TypeScript.switchToForwardSlashes(token.text())), - isResident: false - }; - importedFiles.push(ref); - } + if (ts.isInAmbientContext(tokenAtLocation)) { + return undefined; + } + return spanInNode(tokenAtLocation); + function textSpan(startNode, endNode) { + return ts.TextSpan.fromBounds(startNode.getStart(), (endNode || startNode).getEnd()); + } + function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { + if (node && lineOfPosition === sourceFile.getLineAndCharacterFromPosition(node.getStart()).line) { + return spanInNode(node); + } + return spanInNode(otherwiseOnNode); + } + function spanInPreviousNode(node) { + return spanInNode(ts.findPrecedingToken(node.pos, sourceFile)); + } + function spanInNextNode(node) { + return spanInNode(ts.findNextToken(node, node.parent)); + } + function spanInNode(node) { + if (node) { + if (ts.isExpression(node)) { + if (node.parent.kind === 166 /* DoStatement */) { + return spanInPreviousNode(node); + } + if (node.parent.kind === 168 /* ForStatement */) { + return textSpan(node); + } + if (node.parent.kind === 156 /* BinaryExpression */ && node.parent.operator === 22 /* CommaToken */) { + return textSpan(node); + } + if (node.parent.kind == 153 /* ArrowFunction */ && node.parent.body == node) { + return textSpan(node); + } + } + switch (node.kind) { + case 162 /* VariableStatement */: + return spanInVariableDeclaration(node.declarations[0]); + case 184 /* VariableDeclaration */: + case 124 /* Property */: + return spanInVariableDeclaration(node); + case 123 /* Parameter */: + return spanInParameterDeclaration(node); + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + return spanInFunctionDeclaration(node); + case 186 /* FunctionBlock */: + return spanInFunctionBlock(node); + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 192 /* ModuleBlock */: + return spanInBlock(node); + case 164 /* ExpressionStatement */: + return textSpan(node.expression); + case 172 /* ReturnStatement */: + return textSpan(node.getChildAt(0), node.expression); + case 167 /* WhileStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 166 /* DoStatement */: + return spanInNode(node.statement); + case 183 /* DebuggerStatement */: + return textSpan(node.getChildAt(0)); + case 165 /* IfStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 177 /* LabeledStatement */: + return spanInNode(node.statement); + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + return textSpan(node.getChildAt(0), node.label); + case 168 /* ForStatement */: + return spanInForStatement(node); + case 169 /* ForInStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 174 /* SwitchStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + return spanInNode(node.statements[0]); + case 179 /* TryStatement */: + return spanInBlock(node.tryBlock); + case 178 /* ThrowStatement */: + return textSpan(node, node.expression); + case 194 /* ExportAssignment */: + return textSpan(node, node.exportName); + case 193 /* ImportDeclaration */: + return textSpan(node, node.entityName || node.externalModuleName); + case 191 /* ModuleDeclaration */: + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + return undefined; } + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + case 195 /* EnumMember */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return textSpan(node); + case 173 /* WithStatement */: + return spanInNode(node.statement); + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + return undefined; + case 21 /* SemicolonToken */: + case 1 /* EndOfFileToken */: + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile)); + case 22 /* CommaToken */: + return spanInPreviousNode(node); + case 13 /* OpenBraceToken */: + return spanInOpenBraceToken(node); + case 14 /* CloseBraceToken */: + return spanInCloseBraceToken(node); + case 15 /* OpenParenToken */: + return spanInOpenParenToken(node); + case 16 /* CloseParenToken */: + return spanInCloseParenToken(node); + case 50 /* ColonToken */: + return spanInColonToken(node); + case 24 /* GreaterThanToken */: + case 23 /* LessThanToken */: + return spanInGreaterThanOrLessThanToken(node); + case 98 /* WhileKeyword */: + return spanInWhileKeyword(node); + case 74 /* ElseKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: + return spanInNextNode(node); + default: + if (node.parent.kind === 143 /* PropertyAssignment */ && node.parent.name === node) { + return spanInNode(node.parent.initializer); + } + if (node.parent.kind === 150 /* TypeAssertion */ && node.parent.type === node) { + return spanInNode(node.parent.operand); + } + if (ts.isAnyFunction(node.parent) && node.parent.type === node) { + return spanInPreviousNode(node); + } + return spanInNode(node.parent); + } + } + function spanInVariableDeclaration(variableDeclaration) { + if (variableDeclaration.parent.kind === 169 /* ForInStatement */) { + return spanInNode(variableDeclaration.parent); + } + var isParentVariableStatement = variableDeclaration.parent.kind === 162 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.kind === 168 /* ForStatement */ && ts.contains(variableDeclaration.parent.declarations, variableDeclaration); + var declarations = isParentVariableStatement ? variableDeclaration.parent.declarations : isDeclarationOfForStatement ? variableDeclaration.parent.declarations : undefined; + if (variableDeclaration.initializer || (variableDeclaration.flags & 1 /* Export */)) { + if (declarations && declarations[0] === variableDeclaration) { + if (isParentVariableStatement) { + return textSpan(variableDeclaration.parent, variableDeclaration); + } + else { + ts.Debug.assert(isDeclarationOfForStatement); + return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); + } + } + else { + return textSpan(variableDeclaration); + } + } + else if (declarations && declarations[0] !== variableDeclaration) { + var indexOfCurrentDeclaration = ts.indexOf(declarations, variableDeclaration); + return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); + } + } + function canHaveSpanInParameterDeclaration(parameter) { + return !!parameter.initializer || !!(parameter.flags & 8 /* Rest */) || !!(parameter.flags & 16 /* Public */) || !!(parameter.flags & 32 /* Private */); + } + function spanInParameterDeclaration(parameter) { + if (canHaveSpanInParameterDeclaration(parameter)) { + return textSpan(parameter); + } + else { + var functionDeclaration = parameter.parent; + var indexOfParameter = ts.indexOf(functionDeclaration.parameters, parameter); + if (indexOfParameter) { + return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); + } + else { + return spanInNode(functionDeclaration.body); } } } - } - token = scanner.scan(false); - } - var totalTime = new Date().getTime() - start; - } - function processTripleSlashDirectives(fileName, text, firstToken) { - var leadingTrivia = firstToken.leadingTrivia(text); - var position = 0; - var lineChar = { line: -1, character: -1 }; - var noDefaultLib = false; - var diagnostics = []; - var referencedFiles = []; - var lineMap = text.lineMap(); - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 7 /* SingleLineCommentTrivia */) { - var triviaText = trivia.fullText(); - var referencedCode = getFileReferenceFromReferencePath(fileName, text, position, triviaText, diagnostics); - if (referencedCode) { - lineMap.fillLineAndCharacterFromPosition(position, lineChar); - referencedCode.position = position; - referencedCode.length = trivia.fullWidth(); - referencedCode.line = lineChar.line; - referencedCode.character = lineChar.character; - referencedFiles.push(referencedCode); + function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { + return !!(functionDeclaration.flags & 1 /* Export */) || (functionDeclaration.parent.kind === 187 /* ClassDeclaration */ && functionDeclaration.kind !== 126 /* Constructor */); } - var isNoDefaultLib = isNoDefaultLibMatch(triviaText); - if (isNoDefaultLib) { - noDefaultLib = isNoDefaultLib[3] === "true"; + function spanInFunctionDeclaration(functionDeclaration) { + if (!functionDeclaration.body) { + return undefined; + } + if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) { + return textSpan(functionDeclaration); + } + return spanInNode(functionDeclaration.body); + } + function spanInFunctionBlock(block) { + var nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); + if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { + return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); + } + return spanInNode(nodeForSpanInBlock); + } + function spanInBlock(block) { + switch (block.parent.kind) { + case 191 /* ModuleDeclaration */: + if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { + return undefined; + } + case 167 /* WhileStatement */: + case 165 /* IfStatement */: + case 169 /* ForInStatement */: + return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); + case 168 /* ForStatement */: + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); + } + return spanInNode(block.statements[0]); + } + function spanInForStatement(forStatement) { + if (forStatement.declarations) { + return spanInNode(forStatement.declarations[0]); + } + if (forStatement.initializer) { + return spanInNode(forStatement.initializer); + } + if (forStatement.condition) { + return textSpan(forStatement.condition); + } + if (forStatement.iterator) { + return textSpan(forStatement.iterator); + } + } + function spanInOpenBraceToken(node) { + switch (node.parent.kind) { + case 190 /* EnumDeclaration */: + var enumDeclaration = node.parent; + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); + case 187 /* ClassDeclaration */: + var classDeclaration = node.parent; + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); + case 174 /* SwitchStatement */: + return spanInNodeIfStartsOnSameLine(node.parent, node.parent.clauses[0]); + } + return spanInNode(node.parent); + } + function spanInCloseBraceToken(node) { + switch (node.parent.kind) { + case 192 /* ModuleBlock */: + if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { + return undefined; + } + case 186 /* FunctionBlock */: + case 190 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: + return textSpan(node); + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + return spanInNode(node.parent.statements[node.parent.statements.length - 1]); + ; + case 174 /* SwitchStatement */: + var switchStatement = node.parent; + var lastClause = switchStatement.clauses[switchStatement.clauses.length - 1]; + if (lastClause) { + return spanInNode(lastClause.statements[lastClause.statements.length - 1]); + } + return undefined; + default: + return spanInNode(node.parent); + } + } + function spanInOpenParenToken(node) { + if (node.parent.kind === 166 /* DoStatement */) { + return spanInPreviousNode(node); + } + return spanInNode(node.parent); + } + function spanInCloseParenToken(node) { + switch (node.parent.kind) { + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + case 167 /* WhileStatement */: + case 166 /* DoStatement */: + case 168 /* ForStatement */: + return spanInPreviousNode(node); + default: + return spanInNode(node.parent); + } + return spanInNode(node.parent); + } + function spanInColonToken(node) { + if (ts.isAnyFunction(node.parent) || node.parent.kind === 143 /* PropertyAssignment */) { + return spanInPreviousNode(node); + } + return spanInNode(node.parent); + } + function spanInGreaterThanOrLessThanToken(node) { + if (node.parent.kind === 150 /* TypeAssertion */) { + return spanInNode(node.parent.operand); + } + return spanInNode(node.parent); + } + function spanInWhileKeyword(node) { + if (node.parent.kind === 166 /* DoStatement */) { + return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); + } + return spanInNode(node.parent); } } - position += trivia.fullWidth(); } - return { noDefaultLib: noDefaultLib, diagnostics: diagnostics, referencedFiles: referencedFiles }; - } - function preProcessFile(fileName, sourceText, readImportFiles) { - if (readImportFiles === void 0) { readImportFiles = true; } - var text = TypeScript.SimpleText.fromScriptSnapshot(sourceText); - var scanner = TypeScript.Scanner.createScanner(1 /* ES5 */, text, reportDiagnostic); - var firstToken = scanner.scan(false); - var importedFiles = []; - if (readImportFiles) { - processImports(text, scanner, firstToken, importedFiles); - } - var properties = processTripleSlashDirectives(fileName, text, firstToken); - return { referencedFiles: properties.referencedFiles, importedFiles: importedFiles, isLibFile: properties.noDefaultLib, diagnostics: properties.diagnostics }; - } - TypeScript.preProcessFile = preProcessFile; - function getReferencedFiles(fileName, sourceText) { - return preProcessFile(fileName, sourceText, false).referencedFiles; - } - TypeScript.getReferencedFiles = getReferencedFiles; -})(TypeScript || (TypeScript = {})); + BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; + })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); +})(ts || (ts = {})); var debugObjectHost = this; var ts; (function (ts) { - var LanguageVersion; - (function (LanguageVersion) { - LanguageVersion[LanguageVersion["EcmaScript3"] = 0] = "EcmaScript3"; - LanguageVersion[LanguageVersion["EcmaScript5"] = 1] = "EcmaScript5"; - })(LanguageVersion || (LanguageVersion = {})); - var ModuleGenTarget; - (function (ModuleGenTarget) { - ModuleGenTarget[ModuleGenTarget["Unspecified"] = 0] = "Unspecified"; - ModuleGenTarget[ModuleGenTarget["Synchronous"] = 1] = "Synchronous"; - ModuleGenTarget[ModuleGenTarget["Asynchronous"] = 2] = "Asynchronous"; - })(ModuleGenTarget || (ModuleGenTarget = {})); function languageVersionToScriptTarget(languageVersion) { if (typeof languageVersion === "undefined") return undefined; switch (languageVersion) { - case 0 /* EcmaScript3 */: - return 0 /* ES3 */; - case 1 /* EcmaScript5 */: - return 1 /* ES5 */; - default: - throw Error("unsuported LanguageVersion value: " + languageVersion); + case 0 /* EcmaScript3 */: return 0 /* ES3 */; + case 1 /* EcmaScript5 */: return 1 /* ES5 */; + case 2 /* EcmaScript6 */: return 2 /* ES6 */; + default: throw Error("unsupported LanguageVersion value: " + languageVersion); } } function moduleGenTargetToModuleKind(moduleGenTarget) { if (typeof moduleGenTarget === "undefined") return undefined; switch (moduleGenTarget) { - case 2 /* Asynchronous */: - return 2 /* AMD */; - case 1 /* Synchronous */: - return 1 /* CommonJS */; - case 0 /* Unspecified */: - return 0 /* None */; - default: - throw Error("unsuported ModuleGenTarget value: " + moduleGenTarget); + case 2 /* Asynchronous */: return 2 /* AMD */; + case 1 /* Synchronous */: return 1 /* CommonJS */; + case 0 /* Unspecified */: return 0 /* None */; + default: throw Error("unsupported ModuleGenTarget value: " + moduleGenTarget); } } function scriptTargetTolanguageVersion(scriptTarget) { if (typeof scriptTarget === "undefined") return undefined; switch (scriptTarget) { - case 0 /* ES3 */: - return 0 /* EcmaScript3 */; - case 1 /* ES5 */: - return 1 /* EcmaScript5 */; - default: - throw Error("unsuported ScriptTarget value: " + scriptTarget); + case 0 /* ES3 */: return 0 /* EcmaScript3 */; + case 1 /* ES5 */: return 1 /* EcmaScript5 */; + case 2 /* ES6 */: return 2 /* EcmaScript6 */; + default: throw Error("unsupported ScriptTarget value: " + scriptTarget); } } function moduleKindToModuleGenTarget(moduleKind) { if (typeof moduleKind === "undefined") return undefined; switch (moduleKind) { - case 2 /* AMD */: - return 2 /* Asynchronous */; - case 1 /* CommonJS */: - return 1 /* Synchronous */; - case 0 /* None */: - return 0 /* Unspecified */; - default: - throw Error("unsuported ModuleKind value: " + moduleKind); + case 2 /* AMD */: return 2 /* Asynchronous */; + case 1 /* CommonJS */: return 1 /* Synchronous */; + case 0 /* None */: return 0 /* Unspecified */; + default: throw Error("unsupported ModuleKind value: " + moduleKind); } } function compilationSettingsToCompilerOptions(settings) { @@ -32749,7 +23747,7 @@ var ts; return null; } var decoded = JSON.parse(encoded); - return new TypeScript.TextChangeRange(new TypeScript.TextSpan(decoded.span.start, decoded.span.length), decoded.newLength); + return new ts.TextChangeRange(new ts.TextSpan(decoded.span.start, decoded.span.length), decoded.newLength); }; return ScriptSnapshotShimAdapter; })(); @@ -32767,7 +23765,6 @@ var ts; return null; } var options = compilationSettingsToCompilerOptions(JSON.parse(settingsJson)); - options.noResolve = true; return options; }; LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () { @@ -32799,6 +23796,12 @@ var ts; LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () { return this.shimHost.getCancellationToken(); }; + LanguageServiceShimHostAdapter.prototype.getDefaultLibFilename = function () { + return this.shimHost.getDefaultLibFilename(); + }; + LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () { + return this.shimHost.getCurrentDirectory(); + }; return LanguageServiceShimHostAdapter; })(); ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; @@ -32880,17 +23883,23 @@ var ts; message: diagnostic.messageText, start: diagnostic.start, length: diagnostic.length, - category: ts.DiagnosticCategory[diagnostic.category].toLowerCase() + category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(), + code: diagnostic.code }; }; - LanguageServiceShimObject.prototype.realizeDiagnosticWithFileName = function (diagnostic) { - return { - fileName: diagnostic.file.filename, - message: diagnostic.messageText, - start: diagnostic.start, - length: diagnostic.length, - category: ts.DiagnosticCategory[diagnostic.category].toLowerCase() - }; + LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { + var _this = this; + return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { + var classifications = _this.languageService.getSyntacticClassifications(fileName, new ts.TextSpan(start, length)); + return classifications; + }); + }; + LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) { + var _this = this; + return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { + var classifications = _this.languageService.getSemanticClassifications(fileName, new ts.TextSpan(start, length)); + return classifications; + }); }; LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) { var _this = this; @@ -32910,14 +23919,14 @@ var ts; var _this = this; return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function () { var errors = _this.languageService.getCompilerOptionsDiagnostics(); - return errors.map(function (d) { return _this.realizeDiagnosticWithFileName(d); }); + return errors.map(LanguageServiceShimObject.realizeDiagnostic); }); }; - LanguageServiceShimObject.prototype.getTypeAtPosition = function (fileName, position) { + LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getTypeAtPosition('" + fileName + "', " + position + ")", function () { - var typeInfo = _this.languageService.getTypeAtPosition(fileName, position); - return typeInfo; + return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { + var quickInfo = _this.languageService.getQuickInfoAtPosition(fileName, position); + return quickInfo; }); }; LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) { @@ -32941,11 +23950,10 @@ var ts; return signatureInfo; }); }; - LanguageServiceShimObject.prototype.getSignatureHelpCurrentArgumentState = function (fileName, position, applicableSpanStart) { + LanguageServiceShimObject.prototype.getSignatureAtPosition = function (fileName, position) { var _this = this; - return this.forwardJSONCall("getSignatureHelpCurrentArgumentState('" + fileName + "', " + position + ", " + applicableSpanStart + ")", function () { - var signatureInfo = _this.languageService.getSignatureHelpItems(fileName, position); - return signatureInfo; + return this.forwardJSONCall("getSignatureAtPosition('" + fileName + "', " + position + ")", function () { + return _this.languageService.getSignatureAtPosition(fileName, position); }); }; LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) { @@ -32960,6 +23968,12 @@ var ts; return _this.languageService.getRenameInfo(fileName, position); }); }; + LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) { + var _this = this; + return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { + return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); + }); + }; LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { @@ -32986,12 +24000,6 @@ var ts; return _this.languageService.getOccurrencesAtPosition(fileName, position); }); }; - LanguageServiceShimObject.prototype.getImplementorsAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getImplementorsAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getImplementorsAtPosition(fileName, position); - }); - }; LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, isMemberCompletion) { var _this = this; return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + isMemberCompletion + ")", function () { @@ -33096,10 +24104,29 @@ var ts; CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) { return forwardJSONCall(this.logger, actionDescription, action); }; - CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceText) { + CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) { return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { - var result = TypeScript.preProcessFile(fileName, sourceText); - return result; + var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength())); + var convertResult = { + referencedFiles: [], + importedFiles: [], + isLibFile: result.isLibFile + }; + ts.forEach(result.referencedFiles, function (refFile) { + convertResult.referencedFiles.push({ + path: ts.normalizePath(refFile.filename), + position: refFile.pos, + length: refFile.end - refFile.pos + }); + }); + ts.forEach(result.importedFiles, function (importedFile) { + convertResult.importedFiles.push({ + path: ts.normalizeSlashes(importedFile.filename), + position: importedFile.pos, + length: importedFile.end - importedFile.pos + }); + }); + return convertResult; }); }; CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () { @@ -33157,7 +24184,7 @@ var ts; return; } } - throw TypeScript.Errors.invalidOperation(); + throw new Error("Invalid operation"); }; return TypeScriptServicesFactory; })(); @@ -33165,8 +24192,8 @@ var ts; })(ts || (ts = {})); var TypeScript; (function (TypeScript) { + var Services; (function (Services) { Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; + })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); diff --git a/doc/TypeScript Language Specification (Change Markup) .pdf b/doc/TypeScript Language Specification (Change Markup) .pdf deleted file mode 100644 index 2b37fc55f3c..00000000000 Binary files a/doc/TypeScript Language Specification (Change Markup) .pdf and /dev/null differ diff --git a/doc/TypeScript Language Specification (Change Markup).docx b/doc/TypeScript Language Specification (Change Markup).docx index b3a0384f926..7846303e15b 100644 Binary files a/doc/TypeScript Language Specification (Change Markup).docx and b/doc/TypeScript Language Specification (Change Markup).docx differ diff --git a/doc/TypeScript Language Specification (Change Markup).pdf b/doc/TypeScript Language Specification (Change Markup).pdf new file mode 100644 index 00000000000..ea7cede20f8 Binary files /dev/null and b/doc/TypeScript Language Specification (Change Markup).pdf differ diff --git a/doc/TypeScript Language Specification.docx b/doc/TypeScript Language Specification.docx index 7fce1932d80..c7b95764525 100644 Binary files a/doc/TypeScript Language Specification.docx and b/doc/TypeScript Language Specification.docx differ diff --git a/doc/TypeScript Language Specification.pdf b/doc/TypeScript Language Specification.pdf index b9223f922d2..9a165b56df6 100644 Binary files a/doc/TypeScript Language Specification.pdf and b/doc/TypeScript Language Specification.pdf differ diff --git a/doc/spec.md b/doc/spec.md new file mode 100644 index 00000000000..62d27e0a808 --- /dev/null +++ b/doc/spec.md @@ -0,0 +1,5731 @@ +# TypeScript Language Specification + +Version 1.4 + +October, 2014 + +
+ +Microsoft is making this Specification available under the Open Web Foundation Final Specification Agreement Version 1.0 ("OWF 1.0") as of October 1, 2012. The OWF 1.0 is available at http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0. + +TypeScript is a trademark of Microsoft Corporation. + +
+ +## Table of Contents + +* [1 Introduction](#1) + * [1.1 Ambient Declarations](#1.1) + * [1.2 Function Types](#1.2) + * [1.3 Object Types](#1.3) + * [1.4 Structural Subtyping](#1.4) + * [1.5 Contextual Typing](#1.5) + * [1.6 Classes](#1.6) + * [1.7 Enum Types](#1.7) + * [1.8 Overloading on String Parameters](#1.8) + * [1.9 Generic Types and Functions](#1.9) + * [1.10 Modules](#1.10) +* [2 Basic Concepts](#2) + * [2.1 Grammar Conventions](#2.1) + * [2.2 Namespaces and Named Types](#2.2) + * [2.3 Declarations](#2.3) + * [2.4 Scopes](#2.4) +* [3 Types](#3) + * [3.1 The Any Type](#3.1) + * [3.2 Primitive Types](#3.2) + * [3.2.1 The Number Type](#3.2.1) + * [3.2.2 The Boolean Type](#3.2.2) + * [3.2.3 The String Type](#3.2.3) + * [3.2.4 The Void Type](#3.2.4) + * [3.2.5 The Null Type](#3.2.5) + * [3.2.6 The Undefined Type](#3.2.6) + * [3.2.7 Enum Types](#3.2.7) + * [3.2.8 String Literal Types](#3.2.8) + * [3.3 Object Types](#3.3) + * [3.3.1 Named Type References](#3.3.1) + * [3.3.2 Array Types](#3.3.2) + * [3.3.3 Tuple Types](#3.3.3) + * [3.3.4 Function Types](#3.3.4) + * [3.3.5 Constructor Types](#3.3.5) + * [3.3.6 Members](#3.3.6) + * [3.4 Union Types](#3.4) + * [3.4.1 Contextual Union Types](#3.4.1) + * [3.5 Type Parameters](#3.5) + * [3.5.1 Type Parameter Lists](#3.5.1) + * [3.5.2 Type Argument Lists](#3.5.2) + * [3.6 Named Types](#3.6) + * [3.6.1 Instance Types](#3.6.1) + * [3.7 Specifying Types](#3.7) + * [3.7.1 Predefined Types](#3.7.1) + * [3.7.2 Type References](#3.7.2) + * [3.7.3 Object Type Literals](#3.7.3) + * [3.7.4 Array Type Literals](#3.7.4) + * [3.7.5 Tuple Type Literals](#3.7.5) + * [3.7.6 Union Type Literals](#3.7.6) + * [3.7.7 Function Type Literals](#3.7.7) + * [3.7.8 Constructor Type Literals](#3.7.8) + * [3.7.9 Type Queries](#3.7.9) + * [3.8 Specifying Members](#3.8) + * [3.8.1 Property Signatures](#3.8.1) + * [3.8.2 Call Signatures](#3.8.2) + * [3.8.3 Construct Signatures](#3.8.3) + * [3.8.4 Index Signatures](#3.8.4) + * [3.8.5 Method Signatures](#3.8.5) + * [3.9 Type Aliases](#3.9) + * [3.10 Type Relationships](#3.10) + * [3.10.1 Apparent Members](#3.10.1) + * [3.10.2 Type and Member Identity](#3.10.2) + * [3.10.3 Subtypes and Supertypes](#3.10.3) + * [3.10.4 Assignment Compatibility](#3.10.4) + * [3.10.5 Contextual Signature Instantiation](#3.10.5) + * [3.10.6 Type Inference](#3.10.6) + * [3.10.7 Recursive Types](#3.10.7) + * [3.11 Widened Types](#3.11) +* [4 Expressions](#4) + * [4.1 Values and References](#4.1) + * [4.2 The this Keyword](#4.2) + * [4.3 Identifiers](#4.3) + * [4.4 Literals](#4.4) + * [4.5 Object Literals](#4.5) + * [4.6 Array Literals](#4.6) + * [4.7 Parentheses](#4.7) + * [4.8 The super Keyword](#4.8) + * [4.8.1 Super Calls](#4.8.1) + * [4.8.2 Super Property Access](#4.8.2) + * [4.9 Function Expressions](#4.9) + * [4.9.1 Standard Function Expressions](#4.9.1) + * [4.9.2 Arrow Function Expressions](#4.9.2) + * [4.9.3 Contextually Typed Function Expressions](#4.9.3) + * [4.10 Property Access](#4.10) + * [4.11 The new Operator](#4.11) + * [4.12 Function Calls](#4.12) + * [4.12.1 Overload Resolution](#4.12.1) + * [4.12.2 Type Argument Inference](#4.12.2) + * [4.12.3 Grammar Ambiguities](#4.12.3) + * [4.13 Type Assertions](#4.13) + * [4.14 Unary Operators](#4.14) + * [4.14.1 The ++ and -- operators](#4.14.1) + * [4.14.2 The +, –, and ~ operators](#4.14.2) + * [4.14.3 The ! operator](#4.14.3) + * [4.14.4 The delete Operator](#4.14.4) + * [4.14.5 The void Operator](#4.14.5) + * [4.14.6 The typeof Operator](#4.14.6) + * [4.15 Binary Operators](#4.15) + * [4.15.1 The *, /, %, –, <<, >>, >>>, &, ^, and | operators](#4.15.1) + * [4.15.2 The + operator](#4.15.2) + * [4.15.3 The <, >, <=, >=, ==, !=, ===, and !== operators](#4.15.3) + * [4.15.4 The instanceof operator](#4.15.4) + * [4.15.5 The in operator](#4.15.5) + * [4.15.6 The && operator](#4.15.6) + * [4.15.7 The || operator](#4.15.7) + * [4.16 The Conditional Operator](#4.16) + * [4.17 Assignment Operators](#4.17) + * [4.18 The Comma Operator](#4.18) + * [4.19 Contextually Typed Expressions](#4.19) + * [4.20 Type Guards](#4.20) +* [5 Statements](#5) + * [5.1 Variable Statements](#5.1) + * [5.2 If, Do, and While Statements](#5.2) + * [5.3 For Statements](#5.3) + * [5.4 For-In Statements](#5.4) + * [5.5 Continue Statements](#5.5) + * [5.6 Break Statements](#5.6) + * [5.7 Return Statements](#5.7) + * [5.8 With Statements](#5.8) + * [5.9 Switch Statements](#5.9) + * [5.10 Throw Statements](#5.10) + * [5.11 Try Statements](#5.11) +* [6 Functions](#6) + * [6.1 Function Declarations](#6.1) + * [6.2 Function Overloads](#6.2) + * [6.3 Function Implementations](#6.3) + * [6.4 Generic Functions](#6.4) + * [6.5 Code Generation](#6.5) +* [7 Interfaces](#7) + * [7.1 Interface Declarations](#7.1) + * [7.2 Declaration Merging](#7.2) + * [7.3 Interfaces Extending Classes](#7.3) + * [7.4 Dynamic Type Checks](#7.4) +* [8 Classes](#8) + * [8.1 Class Declarations](#8.1) + * [8.1.1 Class Heritage Specification](#8.1.1) + * [8.1.2 Class Body](#8.1.2) + * [8.2 Members](#8.2) + * [8.2.1 Instance and Static Members](#8.2.1) + * [8.2.2 Accessibility](#8.2.2) + * [8.2.3 Inheritance and Overriding](#8.2.3) + * [8.2.4 Class Types](#8.2.4) + * [8.2.5 Constructor Function Types](#8.2.5) + * [8.3 Constructor Declarations](#8.3) + * [8.3.1 Constructor Parameters](#8.3.1) + * [8.3.2 Super Calls](#8.3.2) + * [8.3.3 Automatic Constructors](#8.3.3) + * [8.4 Property Member Declarations](#8.4) + * [8.4.1 Member Variable Declarations](#8.4.1) + * [8.4.2 Member Function Declarations](#8.4.2) + * [8.4.3 Member Accessor Declarations](#8.4.3) + * [8.5 Index Member Declarations](#8.5) + * [8.6 Code Generation](#8.6) + * [8.6.1 Classes Without Extends Clauses](#8.6.1) + * [8.6.2 Classes With Extends Clauses](#8.6.2) +* [9 Enums](#9) + * [9.1 Enum Declarations](#9.1) + * [9.2 Enum Members](#9.2) + * [9.3 Declaration Merging](#9.3) + * [9.4 Code Generation](#9.4) +* [10 Internal Modules](#10) + * [10.1 Module Declarations](#10.1) + * [10.2 Module Body](#10.2) + * [10.3 Import Declarations](#10.3) + * [10.4 Export Declarations](#10.4) + * [10.5 Declaration Merging](#10.5) + * [10.6 Code Generation](#10.6) +* [11 Source Files and External Modules](#11) + * [11.1 Source Files](#11.1) + * [11.1.1 Source Files Dependencies](#11.1.1) + * [11.2 External Modules](#11.2) + * [11.2.1 External Module Names](#11.2.1) + * [11.2.2 External Import Declarations](#11.2.2) + * [11.2.3 Export Declarations](#11.2.3) + * [11.2.4 Export Assignments](#11.2.4) + * [11.2.5 CommonJS Modules](#11.2.5) + * [11.2.6 AMD Modules](#11.2.6) +* [12 Ambients](#12) + * [12.1 Ambient Declarations](#12.1) + * [12.1.1 Ambient Variable Declarations](#12.1.1) + * [12.1.2 Ambient Function Declarations](#12.1.2) + * [12.1.3 Ambient Class Declarations](#12.1.3) + * [12.1.4 Ambient Enum Declarations](#12.1.4) + * [12.1.5 Ambient Module Declarations](#12.1.5) + * [12.2 Ambient External Module Declarations](#12.2) +* [A Grammar](#A) + * [A.1 Types](#A.1) + * [A.2 Expressions](#A.2) + * [A.3 Statements](#A.3) + * [A.4 Functions](#A.4) + * [A.5 Interfaces](#A.5) + * [A.6 Classes](#A.6) + * [A.7 Enums](#A.7) + * [A.8 Internal Modules](#A.8) + * [A.9 Source Files and External Modules](#A.9) + * [A.10 Ambients](#A.10) + +
+ +# 1 Introduction + +JavaScript applications such as web e-mail, maps, document editing, and collaboration tools are becoming an increasingly important part of the everyday computing. We designed TypeScript to meet the needs of the JavaScript programming teams that build and maintain large JavaScript programs. TypeScript helps programming teams to define interfaces between software components and to gain insight into the behavior of existing JavaScript libraries. TypeScript also enables teams to reduce naming conflicts by organizing their code into dynamically-loadable modules. TypeScript's optional type system enables JavaScript programmers to use highly-productive development tools and practices: static checking, symbol-based navigation, statement completion, and code re-factoring. + +TypeScript is a syntactic sugar for JavaScript. TypeScript syntax is a superset of Ecmascript 5 (ES5) syntax. Every JavaScript program is also a TypeScript program. The TypeScript compiler performs only file-local transformations on TypeScript programs and does not re-order variables declared in TypeScript. This leads to JavaScript output that closely matches the TypeScript input. TypeScript does not transform variable names, making tractable the direct debugging of emitted JavaScript. TypeScript optionally provides source maps, enabling source-level debugging. TypeScript tools typically emit JavaScript upon file save, preserving the test, edit, refresh cycle commonly used in JavaScript development. + +TypeScript syntax includes several proposed features of Ecmascript 6 (ES6), including classes and modules. Classes enable programmers to express common object-oriented patterns in a standard way, making features like inheritance more readable and interoperable. Modules enable programmers to organize their code into components while avoiding naming conflicts. The TypeScript compiler provides module code generation options that support either static or dynamic loading of module contents. + +TypeScript also provides to JavaScript programmers a system of optional type annotations. These type annotations are like the JSDoc comments found in the Closure system, but in TypeScript they are integrated directly into the language syntax. This integration makes the code more readable and reduces the maintenance cost of synchronizing type annotations with their corresponding variables. + +The TypeScript type system enables programmers to express limits on the capabilities of JavaScript objects, and to use tools that enforce these limits. To minimize the number of annotations needed for tools to become useful, the TypeScript type system makes extensive use of type inference. For example, from the following statement, TypeScript will infer that the variable 'i' has the type number. + +```TypeScript +var i = 0; +``` + +TypeScript will infer from the following function definition that the function f has return type string. + +```TypeScript +function f() { + return "hello"; +} +``` + +To benefit from this inference, a programmer can use the TypeScript language service. For example, a code editor can incorporate the TypeScript language service and use the service to find the members of a string object as in the following screen shot. + +/ + +In this example, the programmer benefits from type inference without providing type annotations. Some beneficial tools, however, do require the programmer to provide type annotations. In TypeScript, we can express a parameter requirement as in the following code fragment. + +```TypeScript +function f(s: string) { + return s; +} + +f({}); // Error +f("hello"); // Ok +``` + +This optional type annotation on the parameter 's' lets the TypeScript type checker know that the programmer expects parameter 's' to be of type 'string'. Within the body of function 'f', tools can assume 's' is of type 'string' and provide operator type checking and member completion consistent with this assumption. Tools can also signal an error on the first call to 'f', because 'f' expects a string, not an object, as its parameter. For the function 'f', the TypeScript compiler will emit the following JavaScript code: + +```TypeScript +function f(s) { + return s; +} +``` + +In the JavaScript output, all type annotations have been erased. In general, TypeScript erases all type information before emiting JavaScript. + +## 1.1 Ambient Declarations + +An ambient declaration introduces a variable into a TypeScript scope, but has zero impact on the emitted JavaScript program. Programmers can use ambient declarations to tell the TypeScript compiler that some other component will supply a variable. For example, by default the TypeScript compiler will print an error for uses of undefined variables. To add some of the common variables defined by browsers, a TypeScript programmer can use ambient declarations. The following example declares the 'document' object supplied by browsers. Because the declaration does not specify a type, the type 'any' is inferred. The type 'any' means that a tool can assume nothing about the shape or behavior of the document object. Some of the examples below will illustrate how programmers can use types to further characterize the expected behavior of an object. + +```TypeScript +declare var document; +document.title = "Hello"; // Ok because document has been declared +``` + +In the case of 'document', the TypeScript compiler automatically supplies a declaration, because TypeScript by default includes a file 'lib.d.ts' that provides interface declarations for the built-in JavaScript library as well as the Document Object Model. + +The TypeScript compiler does not include by default an interface for jQuery, so to use jQuery, a programmer could supply a declaration such as: + +```TypeScript +declare var $; +``` + +Section [1.3](#1.3) provides a more extensive example of how a programmer can add type information for jQuery and other libraries. + +## 1.2 Function Types + +Function expressions are a powerful feature of JavaScript. They enable function definitions to create closures: functions that capture information from the lexical scope surrounding the function's definition. Closures are currently JavaScript's only way of enforcing data encapsulation. By capturing and using environment variables, a closure can retain information that cannot be accessed from outside the closure. JavaScript programmers often use closures to express event handlers and other asynchronous callbacks, in which another software component, such as the DOM, will call back into JavaScript through a handler function. + +TypeScript function types make it possible for programmers to express the expected *signature* of a function. A function signature is a sequence of parameter types plus a return type. The following example uses function types to express the callback signature requirements of an asynchronous voting mechanism. + +```TypeScript +function vote(candidate: string, callback: (result: string) => any) { + // ... +} + +vote("BigPig", + function(result: string) { + if (result === "BigPig") { + // ... + } + } +); +``` + +In this example, the second parameter to 'vote' has the function type + +```TypeScript +(result: string) => any +``` + +which means the second parameter is a function returning type 'any' that has a single parameter of type 'string' named 'result'. + +Section [3.8.2](#3.8.2) provides additional information about function types. + +## 1.3 Object Types + +TypeScript programmers use *object types* to declare their expectations of object behavior. The following code uses an *object type literal* to specify the return type of the 'MakePoint' function. + +```TypeScript +var MakePoint: () => { + x: number; y: number; +}; +``` + +Programmers can give names to object types; we call named object types *interfaces*. For example, in the following code, an interface declares one required field (name) and one optional field (favoriteColor). + +```TypeScript +interface Friend { + name: string; + favoriteColor?: string; +} + +function add(friend: Friend) { + var name = friend.name; +} + +add({ name: "Fred" }); // Ok +add({ favoriteColor: "blue" }); // Error, name required +add({ name: "Jill", favoriteColor: "green" }); // Ok +``` + +TypeScript object types model the diversity of behaviors that a JavaScript object can exhibit. For example, the jQuery library defines an object, '$', that has methods, such as 'get' (which sends an Ajax message), and fields, such as 'browser' (which gives browser vendor information). However, jQuery clients can also call '$' as a function. The behavior of this function depends on the type of parameters passed to the function. + +The following code fragment captures a small subset of jQuery behavior, just enough to use jQuery in a simple way. + +```TypeScript +interface JQuery { + text(content: string); +} + +interface JQueryStatic { + get(url: string, callback: (data: string) => any); + (query: string): JQuery; +} + +declare var $: JQueryStatic; + +$.get("http://mysite.org/divContent", + function (data: string) { + $("div").text(data); + } +); +``` + +The 'JQueryStatic' interface references another interface: 'JQuery'. This interface represents a collection of one or more DOM elements. The jQuery library can perform many operations on such a collection, but in this example the jQuery client only needs to know that it can set the text content of each jQuery element in a collection by passing a string to the 'text' method. The 'JQueryStatic' interface also contains a method, 'get', that performs an Ajax get operation on the provided URL and arranges to invoke the provided callback upon receipt of a response. + +Finally, the 'JQueryStatic' interface contains a bare function signature + +```TypeScript +(query: string): JQuery; +``` + +The bare signature indicates that instances of the interface are callable. This example illustrates that TypeScript function types are just special cases of TypeScript object types. Specifically, function types are object types that contain one or more call signatures. For this reason we can write any function type as an object type literal. The following example uses both forms to describe the same type. + +```TypeScript +var f: { (): string; }; +var sameType: () => string = f; // Ok +var nope: () => number = sameType; // Error: type mismatch +``` + +We mentioned above that the '$' function behaves differently depending on the type of its parameter. So far, our jQuery typing only captures one of these behaviors: return an object of type 'JQuery' when passed a string. To specify multiple behaviors, TypeScript supports *overloading* of function signatures in object types. For example, we can add an additional call signature to the 'JQueryStatic' interface. + +```TypeScript +(ready: () => any): any; +``` + +This signature denotes that a function may be passed as the parameter of the '$' function. When a function is passed to '$', the jQuery library will invoke that function when a DOM document is ready. Because TypeScript supports overloading, tools can use TypeScript to show all available function signatures with their documentation tips and to give the correct documentation once a function has been called with a particular signature. + +A typical client would not need to add any additional typing but could just use a community-supplied typing to discover (through statement completion with documentation tips) and verify (through static checking) correct use of the library, as in the following screen shot. + +/ + +Section [3.3](#3.3) provides additional information about object types. + +## 1.4 Structural Subtyping + +Object types are compared *structurally*. For example, in the code fragment below, class 'CPoint' matches interface 'Point' because 'CPoint' has all of the required members of 'Point'. A class may optionally declare that it implements an interface, so that the compiler will check the declaration for structural compatibility. The example also illustrates that an object type can match the type inferred from an object literal, as long as the object literal supplies all of the required members. + +```TypeScript +interface Point { + x: number; + y: number; +} + +function getX(p: Point) { + return p.x; +} + +class CPoint { + x: number; + y: number; + constructor(x: number, y: number) { + this.x = x; + this.y = y; + } +} + +getX(new CPoint(0, 0)); // Ok, fields match + +getX({ x: 0, y: 0, color: "red" }); // Extra fields Ok + +getX({ x: 0 }); // Error: supplied parameter does not match +``` + +See section [0](#0) for more information about type comparisons. + +## 1.5 Contextual Typing + +Ordinarily, TypeScript type inference proceeds "bottom-up": from the leaves of an expression tree to its root. In the following example, TypeScript infers 'number' as the return type of the function 'mul' by flowing type information bottom up in the return expression. + +```TypeScript +function mul(a: number, b: number) { + return a * b; +} +``` + +For variables and parameters without a type annotation or a default value, TypeScript infers type 'any', ensuring that compilers do not need non-local information about a function's call sites to infer the function's return type. Generally, this bottom-up approach provides programmers with a clear intuition about the flow of type information. + +However, in some limited contexts, inference proceeds "top-down" from the context of an expression. Where this happens, it is called contextual typing. Contextual typing helps tools provide excellent information when a programmer is using a type but may not know all of the details of the type. For example, in the jQuery example, above, the programmer supplies a function expression as the second parameter to the 'get' method. During typing of that expression, tools can assume that the type of the function expression is as given in the 'get' signature and can provide a template that includes parameter names and types. + +```TypeScript +$.get("http://mysite.org/divContent", + function (data) { + $("div").text(data); // TypeScript infers data is a string + } +); +``` + +Contextual typing is also useful for writing out object literals. As the programmer types the object literal, the contextual type provides information that enables tools to provide completion for object member names. + +Section [4.19](#4.19) provides additional information about contextually typed expressions. + +## 1.6 Classes + +JavaScript practice has at least two common design patterns: the module pattern and the class pattern. Roughly speaking, the module pattern uses closures to hide names and to encapsulate private data, while the class pattern uses prototype chains to implement many variations on object-oriented inheritance mechanisms. Libraries such as 'prototype.js' are typical of this practice. + +This section and the module section below will show how TypeScript emits consistent, idiomatic JavaScript code to implement classes and modules that are closely aligned with the current ES6 proposal. The goal of TypeScript's translation is to emit exactly what a programmer would type when implementing a class or module unaided by a tool. This section will also describe how TypeScript infers a type for each class declaration. We'll start with a simple BankAccount class. + +```TypeScript +class BankAccount { + balance = 0; + deposit(credit: number) { + this.balance += credit; + return this.balance; + } +} +``` + +This class generates the following JavaScript code. + +```TypeScript +var BankAccount = (function () { + function BankAccount() { + this.balance = 0; + } + BankAccount.prototype.deposit = function(credit) { + this.balance += credit; + return this.balance; + }; + return BankAccount; +})(); +``` + +This TypeScript class declaration creates a variable named 'BankAccount' whose value is the constructor function for 'BankAccount' instances. This declaration also creates an instance type of the same name. If we were to write this type as an interface it would look like the following. + +```TypeScript +interface BankAccount { + balance: number; + deposit(credit: number): number; +} +``` + +If we were to write out the function type declaration for the 'BankAccount' constructor variable, it would have the following form. + +```TypeScript +var BankAccount: new() => BankAccount; +``` + +The function signature is prefixed with the keyword 'new' indicating that the 'BankAccount' function must be called as a constructor. It is possible for a function's type to have both call and constructor signatures. For example, the type of the built-in JavaScript Date object includes both kinds of signatures. + +If we want to start our bank account with an initial balance, we can add to the 'BankAccount' class a constructor declaration. + +```TypeScript +class BankAccount { + balance: number; + constructor(initially: number) { + this.balance = initially; + } + deposit(credit: number) { + this.balance += credit; + return this.balance; + } +} +``` + +This version of the 'BankAccount' class requires us to introduce a constructor parameter and then assign it to the 'balance' field. To simplify this common case, TypeScript accepts the following shorthand syntax. + +```TypeScript +class BankAccount { + constructor(public balance: number) { + } + deposit(credit: number) { + this.balance += credit; + return this.balance; + } +} +``` + +The 'public' keyword denotes that the constructor parameter is to be retained as a field. Public is the default accessibility for class members, but a programmer can also specify private or protected accessibility for a class member. Accessibility is a design-time construct; it is enforced during static type checking but does not imply any runtime enforcement. + +TypeScript classes also support inheritance, as in the following example.* * + +```TypeScript +class CheckingAccount extends BankAccount { + constructor(balance: number) { + super(balance); + } + writeCheck(debit: number) { + this.balance -= debit; + } +} +``` + +In this example, the class 'CheckingAccount' *derives* from class 'BankAccount'. The constructor for 'CheckingAccount' calls the constructor for class 'BankAccount' using the 'super' keyword. In the emitted JavaScript code, the prototype of 'CheckingAccount' will chain to the prototype of 'BankingAccount'. + +TypeScript classes may also specify static members. Static class members become properties of the class constructor. + +Section [8](#8) provides additional information about classes. + +## 1.7 Enum Types + +TypeScript enables programmers to summarize a set of numeric constants as an *enum type*. The example below creates an enum type to represent operators in a calculator application. + +```TypeScript +enum Operator { + ADD, + DIV, + MUL, + SUB +} + +function compute(op: Operator, a: number, b: number) { + console.log("the operator is" + Operator[op]); + // ... +} +``` + +In this example, the compute function logs the operator 'op' using a feature of enum types: reverse mapping from the enum value ('op') to the string corresponding to that value. For example, the declaration of 'Operator' automatically assigns integers, starting from zero, to the listed enum members. Section [9](#9) describes how programmers can also explicitly assign integers to enum members, and can use any string to name an enum member. + +If all enum members have explicitly assigned literal integers, or if an enum has all members automatically assigned, the TypeScript compiler will emit for an enum member a JavaScript constant corresponding to that member's assigned value (annotated with a comment). This improves performance on many JavaScript engines. + +For example, the 'compute' function could contain a switch statement like the following. + +```TypeScript +switch (op) { + case Operator.ADD: + // execute add + break; + case Operator.DIV: + // execute div + break; + // ... +} +``` + +For this switch statement, the compiler will generate the following code. + +```TypeScript +switch (op) { + case 0 /* Operator.ADD */: + // execute add + break; + case 1 /* Operator.DIV */: + // execute div + break; + // ... +} +``` + +JavaScript implementations can use these explicit constants to generate efficient code for this switch statement, for example by building a jump table indexed by case value. + +## 1.8 Overloading on String Parameters + +An important goal of TypeScript is to provide accurate and straightforward types for existing JavaScript programming patterns. To that end, TypeScript includes generic types, discussed in the next section, and *overloading on string parameters*, the topic of this section. + +JavaScript programming interfaces often include functions whose behavior is discriminated by a string constant passed to the function. The Document Object Model makes heavy use of this pattern. For example, the following screen shot shows that the 'createElement' method of the 'document' object has multiple signatures, some of which identify the types returned when specific strings are passed into the method. + +/ + +The following code fragment uses this feature. Because the 'span' variable is inferred to have the type 'HTMLSpanElement', the code can reference without static error the 'isMultiline' property of 'span'. + +```TypeScript +var span = document.createElement("span"); +span.isMultiLine = false; // OK: HTMLSpanElement has isMultiline property +``` + +In the following screen shot, a programming tool combines information from overloading on string parameters with contextual typing to infer that the type of the variable 'e' is 'MouseEvent' and that therefore 'e' has a 'clientX' property. + +/ + +Section [3.8.2.4](#3.8.2.4) provides details on how to use string literals in function signatures. + +## 1.9 Generic Types and Functions + +Like overloading on string parameters, *generic types* make it easier for TypeScript to accurately capture the behavior of JavaScript libraries. Because they enable type information to flow from client code, through library code, and back into client code, generic types may do more than any other TypeScript feature to support detailed API descriptions. + +To illustrate this, let's take a look at part of the TypeScript interface for the built-in JavaScript array type. You can find this interface in the 'lib.d.ts' file that accompanies a TypeScript distribution. + +```TypeScript +interface Array { + reverse(): T[]; + sort(compareFn?: (a: T, b: T) => number): T[]; + // ... +} +``` + +Interface definitions, like the one above, can have one or more *type parameters*. In this case the 'Array' interface has a single parameter, 'T', that defines the element type for the array. The 'reverse' method returns an array with the same element type. The sort method takes an optional parameter, 'compareFn', whose type is a function that takes two parameters of type 'T' and returns a number. Finally, sort returns an array with element type 'T'. + +Functions can also have generic parameters. For example, the array interface contains a 'map' method, defined as follows: + +```TypeScript +map(func: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; +``` + +The map method, invoked on an array 'a' with element type 'T', will apply function 'func' to each element of 'a', returning a value of type 'U'. + +The TypeScript compiler can often infer generic method parameters, making it unnecessary for the programmer to explicitly provide them. In the following example, the compiler infers that parameter 'U' of the map method has type 'string', because the function passed to map returns a string. + +```TypeScript +function numberToString(a: number[]) { + var stringArray = a.map(v => v.toString()); + return stringArray; +} +``` + +The compiler infers in this example that the 'numberToString' function returns an array of strings. + +In TypeScript, classes can also have type parameters. The following code declares a class that implements a linked list of items of type 'T'. This code illustrates how programmers can *constrain* type parameters to extend a specific type. In this case, the items on the list must extend the type 'NamedItem'. This enables the programmer to implement the 'log' function, which logs the name of the item. + +```TypeScript +interface NamedItem { + name: string; +} + +class List { + next: List = null; + + constructor(public item: T) { + } + + insertAfter(item: T) { + var temp = this.next; + this.next = new List(item); + this.next.next = temp; + } + + log() { + console.log(this.item.name); + } + + // ... +} +``` + +Section [3.6](#3.6) provides further information about generic types. + +## 1.10 Modules + +Classes and interfaces support large-scale JavaScript development by providing a mechanism for describing how to use a software component that can be separated from that component's implementation. TypeScript enforces *encapsulation* of implementation in classes at design time (by restricting use of private and protected members), but cannot enforce encapsulation at runtime because all object properties are accessible at runtime. Future versions of JavaScript may provide *private names* which would enable runtime enforcement of private and protected members. + +In the current version of JavaScript, the only way to enforce encapsulation at runtime is to use the module pattern: encapsulate private fields and methods using closure variables. The module pattern is a natural way to provide organizational structure and dynamic loading options by drawing a boundary around a software component. A module can also provide the ability to introduce namespaces, avoiding use of the global namespace for most software components. + +The following example illustrates the JavaScript module pattern. + +```TypeScript +(function(exports) { + var key = generateSecretKey(); + function sendMessage(message) { + sendSecureMessage(message, key); + } + exports.sendMessage = sendMessage; +})(MessageModule); +``` + +This example illustrates the two essential elements of the module pattern: a *module closure* and a *module* *object*. The module closure is a function that encapsulates the module's implementation, in this case the variable 'key' and the function 'sendMessage'. The module object contains the exported variables and functions of the module. Simple modules may create and return the module object. The module above takes the module object as a parameter, 'exports', and adds the 'sendMessage' property to the module object. This *augmentation* approach simplifies dynamic loading of modules and also supports separation of module code into multiple files. + +The example assumes that an outer lexical scope defines the functions 'generateSecretKey' and 'sendSecureMessage'; it also assumes that the outer scope has assigned the module object to the variable 'MessageModule'. + +TypeScript modules provide a mechanism for succinctly expressing the module pattern. In TypeScript, programmers can combine the module pattern with the class pattern by nesting modules and classes within an outer module. + +The following example shows the definition and use of a simple module. + +```TypeScript +module M { + var s = "hello"; + export function f() { + return s; + } +} + +M.f(); +M.s; // Error, s is not exported +``` + +In this example, variable 's' is a private feature of the module, but function 'f' is exported from the module and accessible to code outside of the module. If we were to describe the effect of module 'M' in terms of interfaces and variables, we would write + +```TypeScript +interface M { + f(): string; +} + +var M: M; +``` + +The interface 'M' summarizes the externally visible behavior of module 'M'. In this example, we can use the same name for the interface as for the initialized variable because in TypeScript type names and variable names do not conflict: each lexical scope contains a variable declaration space and type declaration space (see section [2.3](#2.3) for more details). + +Module 'M' is an example of an *internal* module, because it is nested within the *global* module (see section [10](#10) for more details). The TypeScript compiler emits the following JavaScript code for this module. + +```TypeScript +var M; +(function(M) { + var s = "hello"; + function f() { + return s; + } + M.f = f; +})(M || (M = {})); +``` + +In this case, the compiler assumes that the module object resides in global variable 'M', which may or may not have been initialized to the desired module object. + +TypeScript also supports *external* modules, which are files that contain top-level *export* and *import *directives. For this type of module the TypeScript compiler will emit code whose module closure and module object implementation vary according to the specified dynamic loading system, for example, the Asynchronous Module Definition system. + +
+ +#
2 Basic Concepts + +The remainder of this document is the formal specification of the TypeScript programming language and is intended to be read as an adjunct to the ECMAScript Language Specification (specifically, the ECMA-262 Standard, 5th Edition). This document describes the syntactic grammar added by TypeScript along with the compile-time processing and type checking performed by the TypeScript compiler, but it only minimally discusses the run-time behavior of programs since that is covered by the ECMAScript specification. + +## 2.1 Grammar Conventions + +The syntactic grammar added by TypeScript language is specified throughout this document using the existing conventions and production names of the ECMAScript grammar. In places where TypeScript augments an existing grammar production it is so noted. For example: + +  *CallExpression:* *( Modified )* +   … +   `super` `(` *ArgumentListopt* `)` +   `super` `.` *IdentifierName* + +The '*( Modified )*' annotation indicates that an existing grammar production is being replaced, and the '…' references the contents of the original grammar production. + +Similar to the ECMAScript grammar, if the phrase "*[no LineTerminator here]*" appears in the right-hand side of a production of the syntactic grammar, it indicates that the production is not a match if a *LineTerminator* occurs in the input stream at the indicated position. + +## 2.2 Namespaces and Named Types + +TypeScript supports ***named types*** that can be organized in hierarchical ***namespaces***. Namespaces are introduced by module declarations and named types are introduced by class, interface, and enum declarations. Named types are denoted by qualified names that extend from some root module (possibly the global module) to the point of their declaration. The example + +```TypeScript +module X { + export module Y { + export interface Z { } + } + export interface Y { } +} +``` + +declares two interface types with the qualified names 'X.Y.Z' and 'X.Y' relative to the root module in which 'X' is declared. + +In a qualified type name all identifiers but the last one refer to namespaces and the last identifier refers to a named type. Named type and namespace names are in separate declaration spaces and it is therefore possible for a named type and a namespace to have the same name, as in the example above. + +The hierarchy formed by namespace and named type names partially mirrors that formed by module instances and members. The example + +```TypeScript +module A { + export module B { + export class C { } + } +} +``` + +introduces a named type with the qualified name 'A.B.C' and also introduces a constructor function that can be accessed using the expression 'A.B.C'. Thus, in the example + +```TypeScript +var c: A.B.C = new A.B.C(); +``` + +the two occurrences of 'A.B.C' in fact refer to different entities. It is the context of the occurrences that determines whether 'A.B.C' is processed as a type name or an expression. + +## 2.3 Declarations + +Declarations introduce names in the ***declaration spaces*** to which they belong. It is an error to have two names with same spelling in the same declaration space. Declaration spaces exist as follows: + +* The global module and each external or internal module has a declaration space for variables (including functions, modules, class constructor functions, and enum objects), a declaration space for named types (classes, interfaces, and enums), and a declaration space for namespaces (containers of named types). Every declaration (whether local or exported) in a module contributes to one or more of these declaration spaces. +* Each external or internal module has a declaration space for exported members, a declaration space for exported named types, and a declaration space for exported namespaces. All export declarations in the module contribute to these declaration spaces. Each internal module's export declaration spaces are shared with other internal modules that have the same root module and the same qualified name starting from that root module. +* Each class declaration has a declaration space for instance members, a declaration space for static members, and a declaration space for type parameters. +* Each interface declaration has a declaration space for members and a declaration space for type parameters. An interface's declaration space is shared with other interfaces that have the same root module and the same qualified name starting from that root module. +* Each enum declaration has a declaration space for its enum members. An enum's declaration space is shared with other enums that have the same root module and the same qualified name starting from that root module. +* Each function declaration (including constructor, member function, and member accessor declarations) and each function expression has a declaration space for variables (parameters, local variables, and local functions) and a declaration space for type parameters. +* Each object literal has a declaration space for its properties. +* Each object type literal has a declaration space for its members. + +Top-level declarations in a source file with no top-level import or export declarations belong to the ***global module***. Top-level declarations in a source file with one or more top-level import or export declarations belong to the ***external module*** represented by that source file. + +An internal module declaration contributes a namespace name (representing a container of types) and possibly a member name (representing the module instance) to the containing module. A class declaration contributes both a member name (representing the constructor function) and a type name (representing the class type) to the containing module. An interface declaration contributes a type name to the containing module. An enum declaration contributes both a member name (representing the enum object) and a type name (representing the enum type) to the containing module. Any other declaration contributes a member name to the declaration space to which it belongs. + +The ***parent module*** of an entity is defined as follows: + +* The parent module of an entity declared in an internal module is that internal module. +* The parent module of an entity declared in an external module is that external module. +* The parent module of an entity declared in the global module is the global module. +* The parent module of an external module is the global module. + +The ***root module*** of an entity is defined as follows: + +* The root module of a non-exported entity is the entity's parent module. +* The root module of an exported entity is the root module of the entity's parent module. + +Intuitively, the root module of an entity is the outermost module body from within which the entity is reachable. + +Interfaces, enums, and internal modules are "open ended," meaning that interface, enum, and internal module declarations with the same qualified name relative to a common root are automatically merged. For further details, see sections [7.2](#7.2), [9.3](#9.3), and [10.5](#10.5). + +Namespace, type, and member names exist in separate declaration spaces. Furthermore, declarations of non-instantiated modules (modules that contain only interfaces or modules at all levels of nesting) do not introduce a member name in their containing declaration space. This means that the following is permitted, provided module 'X' contains only interface or module declarations at all levels of nesting: + +```TypeScript +module M { + module X { ... } // Namespace + interface X { ... } // Type + var X; // Member +} +``` + +If module 'X' above was an instantiated module (section [10.1](#10.1)) it would cause a member 'X' to be introduced in 'M'. This member would conflict with the variable 'X' and thus cause an error. + +Instance and static members in a class are likewise in separate declaration spaces. Thus the following is permitted: + +```TypeScript +class C { + x: number; // Instance member + static x: string; // Static member +} +``` + +## 2.4 Scopes + +The ***scope*** of a name is the region of program text within which it is possible to refer to the entity declared by that name without qualification of the name. The scope of a name depends on the context in which the name is declared. The contexts are listed below in order from outermost to innermost: + +* The scope of an entity declared in the global module is the entire program text. +* The scope of an entity declared in an external module is the source file of that external module. +* The scope of an exported entity declared in an internal module is the body of that module and every internal module with the same root and the same qualified name relative to that root. +* The scope of a non-exported entity declared within an internal module declaration is the body of that internal module declaration. +* The scope of a type parameter declared in a class or interface declaration is that entire declaration, including constraints, extends clause, implements clause, and declaration body, but not including static member declarations. +* The scope of a member declared in an enum declaration is the body of that declaration and every enum declaration with the same root and the same qualified name relative to that root. +* The scope of a type parameter declared in a call or construct signature is that entire signature declaration, including constraints, parameter list, and return type. If the signature is part of a function implementation, the scope includes the function body. +* The scope of a parameter, local variable, or local function declared within a function declaration (including a constructor, member function, or member accessor declaration) or function expression is the body of that function declaration or function expression. + +Scopes may overlap, for example through nesting of modules and functions. When the scopes of two entities with the same name overlap, the entity with the innermost declaration takes precedence and access to the outer entity is either not possible or only possible by qualifying its name. + +When an identifier is resolved as a *TypeName* (section [3.7.2](#3.7.2)), only classes, interfaces, enums, and type parameters are considered and other entities in scope are ignored. + +When an identifier is resolved as a *ModuleName* (section [3.7.2](#3.7.2)), only modules are considered and other entities in scope are ignored. + +When an identifier is resolved as a *PrimaryExpression* (section [4.3](#4.3)), only instantiated modules (section [10.1](#10.1)), classes, enums, functions, variables, and parameters are considered and other entities in scope are ignored. + +Note that class and enum members are never directly in scope—they can only be accessed by applying the dot ('.') operator to a class instance or enum object. This even includes members of the current instance in a constructor or member function, which are accessed by applying the dot operator to `this`. + +As the rules above imply, locally declared entities in an internal module are closer in scope than exported entities declared in other module declarations for the same internal module. For example: + +```TypeScript +var x = 1; +module M { + export var x = 2; + console.log(x); // 2 +} +module M { + console.log(x); // 2 +} +module M { + var x = 3; + console.log(x); // 3 +} +``` + +
+ +#
3 Types + +TypeScript adds optional static types to JavaScript. Types are used to place static constraints on program entities such as functions, variables, and properties so that compilers and development tools can offer better verification and assistance during software development. TypeScript's *static* compile-time type system closely models the *dynamic* run-time type system of JavaScript, allowing programmers to accurately express the type relationships that are expected to exist when their programs run and have those assumptions pre-validated by the TypeScript compiler. TypeScript's type analysis occurs entirely at compile-time and adds no run-time overhead to program execution. + +All types in TypeScript are subtypes of a single top type called the Any type. The `any` keyword references this type. The Any type is the one type that can represent *any* JavaScript value with no constraints. All other types are categorized as ***primitive types***, ***object types***, ***union types***, or ***type parameters***. These types introduce various static constraints on their values. + +The primitive types are the Number, Boolean, String, Void, Null, and Undefined types along with user defined enum types. The `number`, `boolean`, `string`, and `void` keywords reference the Number, Boolean, String, and Void primitive types respectively. The Void type exists purely to indicate the absence of a value, such as in a function with no return value. It is not possible to explicitly reference the Null and Undefined types—only *values* of those types can be referenced, using the `null` and `undefined` literals. + +The object types are all class, interface, array, tuple, function, and constructor types. Class and interface types are introduced through class and interface declarations and are referenced by the name given to them in their declarations. Class and interface types may be ***generic types*** which have one or more type parameters. + +Union types represent values that can have one of multiple types. + +Declarations of modules, classes, properties, functions, variables and other language entities associate types with those entities. The mechanism by which a type is formed and associated with a language entity depends on the particular kind of entity. For example, a module declaration associates the module with an anonymous type containing a set of properties corresponding to the exported variables and functions in the module, and a function declaration associates the function with an anonymous type containing a call signature corresponding to the parameters and return type of the function. Types can be associated with variables through explicit ***type annotations***, such as + +```TypeScript +var x: number; +``` + +or through implicit ***type inference***, as in + +```TypeScript +var x = 1; +``` + +which infers the type of 'x' to be the Number primitive type because that is the type of the value used to initialize 'x'. + +## 3.1 The Any Type + +The Any type is used to represent any JavaScript value. A value of the Any type supports the same operations as a value in JavaScript and minimal static type checking is performed for operations on Any values. Specifically, properties of any name can be accessed through an Any value and Any values can be called as functions or constructors with any argument list. + +The `any` keyword references the Any type. In general, in places where a type is not explicitly provided and TypeScript cannot infer one, the Any type is assumed. + +The Any type is a supertype of all types, and is assignable to and from all types. + +Some examples: + +```TypeScript +var x: any; // Explicitly typed +var y; // Same as y: any +var z: { a; b; }; // Same as z: { a: any; b: any; } + +function f(x) { // Same as f(x: any): void + console.log(x); +} +``` + +## 3.2 Primitive Types + +The primitive types are the Number, Boolean, String, Void, Null, and Undefined types and all user defined enum types. + +### 3.2.1 The Number Type + +The Number primitive type corresponds to the similarly named JavaScript primitive type and represents double-precision 64-bit format IEEE 754 floating point values. + +The `number` keyword references the Number primitive type and numeric literals may be used to write values of the Number primitive type. + +For purposes of determining type relationships (section [0](#0)) and accessing properties (section [4.10](#4.10)), the Number primitive type behaves as an object type with the same properties as the global interface type 'Number'. + +Some examples: + +```TypeScript +var x: number; // Explicitly typed +var y = 0; // Same as y: number = 0 +var z = 123.456; // Same as z: number = 123.456 +var s = z.toFixed(2); // Property of Number interface +``` + +### 3.2.2 The Boolean Type + +The Boolean primitive type corresponds to the similarly named JavaScript primitive type and represents logical values that are either true or false. + +The `boolean` keyword references the Boolean primitive type and the `true` and `false` literals reference the two Boolean truth values. + +For purposes of determining type relationships (section [0](#0)) and accessing properties (section [4.10](#4.10)), the Boolean primitive type behaves as an object type with the same properties as the global interface type 'Boolean'. + +Some examples: + +```TypeScript +var b: boolean; // Explicitly typed +var yes = true; // Same as yes: boolean = true +var no = false; // Same as no: boolean = false +``` + +### 3.2.3 The String Type + +The String primitive type corresponds to the similarly named JavaScript primitive type and represents sequences of characters stored as Unicode UTF-16 code units. + +The `string` keyword references the String primitive type and string literals may be used to write values of the String primitive type. + +For purposes of determining type relationships (section [0](#0)) and accessing properties (section [4.10](#4.10)), the String primitive type behaves as an object type with the same properties as the global interface type 'String'. + +Some examples: + +```TypeScript +var s: string; // Explicitly typed +var empty = ""; // Same as empty: string = "" +var abc = 'abc'; // Same as abc: string = "abc" +var c = abc.charAt(2); // Property of String interface +``` + +### 3.2.4 The Void Type + +The Void type, referenced by the `void` keyword, represents the absence of a value and is used as the return type of functions with no return value. + +The only possible values for the Void type are `null` and `undefined`. The Void type is a subtype of the Any type and a supertype of the Null and Undefined types, but otherwise Void is unrelated to all other types. + +*NOTE: We might consider disallowing declaring variables of type Void as they serve no useful purpose. However, because Void is permitted as a type argument to a generic type or function it is not feasible to disallow Void properties or parameters*. + +### 3.2.5 The Null Type + +The Null type corresponds to the similarly named JavaScript primitive type and is the type of the `null` literal. + +The `null` literal references the one and only value of the Null type. It is not possible to directly reference the Null type itself. + +The Null type is a subtype of all types, except the Undefined type. This means that `null` is considered a valid value for all primitive types, object types, union types, and type parameters, including even the Number and Boolean primitive types. + +Some examples: + +```TypeScript +var n: number = null; // Primitives can be null +var x = null; // Same as x: any = null +var e: Null; // Error, can't reference Null type +``` + +### 3.2.6 The Undefined Type + +The Undefined type corresponds to the similarly named JavaScript primitive type and is the type of the `undefined` literal. + +The `undefined` literal denotes the value given to all uninitialized variables and is the one and only value of the Undefined type. It is not possible to directly reference the Undefined type itself. + +The undefined type is a subtype of all types. This means that `undefined` is considered a valid value for all primitive types, object types, union types, and type parameters. + +Some examples: + +```TypeScript +var n: number; // Same as n: number = undefined +var x = undefined; // Same as x: any = undefined +var e: Undefined; // Error, can't reference Undefined type +``` + +### 3.2.7 Enum Types + +Enum types are distinct user defined subtypes of the Number primitive type. Enum types are declared using enum declarations (section [9.1](#9.1)) and referenced using type references (section [3.7.2](#3.7.2)). + +Enum types are assignable to the Number primitive type, and vice versa, but different enum types are not assignable to each other. + +### 3.2.8 String Literal Types + +Specialized signatures (section [3.8.2.4](#3.8.2.4)) permit string literals to be used as types in parameter type annotations. String literal types are permitted only in that context and nowhere else. + +All string literal types are subtypes of the String primitive type. + +## 3.3 Object Types + +Object types are composed from properties, call signatures, construct signatures, and index signatures, collectively called members. + +Class and interface type references, array types, tuple types, union types, function types, and constructor types are all classified as object types. Multiple constructs in the TypeScript language create object types, including: + +* Object type literals (section [3.7.3](#3.7.3)). +* Array type literals (section [3.7.4](#3.7.4)). +* Tuple type literals (section [3.7.5](#3.7.5)). +* Function type literals (section [3.7.7](#3.7.7)). +* Constructor type literals (section [3.7.8](#3.7.8)). +* Object literals (section [4.5](#4.5)). +* Array literals (section [4.6](#4.6)). +* Function expressions (section [4.9](#4.9)) and function declarations ([6.1](#6.1)). +* Constructor function types created by class declarations (section [8.2.5](#8.2.5)). +* Module instance types created by module declarations (section [10.3](#10.3)). + +### 3.3.1 Named Type References + +Type references (section [3.7.2](#3.7.2)) to class and interface types are classified as object types. Type references to generic class and interface types include type arguments that are substituted for the type parameters of the class or interface to produce an actual object type. + +### 3.3.2 Array Types + +***Array types*** represent JavaScript arrays with a common element type. Array types are named type references created from the generic interface type 'Array' in the global module with the array element type as a type argument. Array type literals (section [3.7.4](#3.7.4)) provide a shorthand notation for creating such references. + +The declaration of the 'Array' interface includes a property 'length' and a numeric index signature for the element type, along with other members: + +```TypeScript +interface Array { + length: number; + [x: number]: T; + // Other members +} +``` + +Array literals (section [4.6](#4.6)) may be used to create values of array types. For example + +```TypeScript +var a: string[] = ["hello", "world"]; +``` + +### 3.3.3 Tuple Types + +***Tuple types*** represent JavaScript arrays with individually tracked element types. Tuple types are written using tuple type literals (section [3.7.5](#3.7.5)). A tuple type combines a set of numerically named properties with the members of an array type. Specifically, a tuple type + +```TypeScript +[ T0, T1, ..., Tn ] +``` + +combines the set of properties + +```TypeScript +{ + 0: T0; + 1: T1; + ... + n: Tn; +} +``` + +with the members of an array type whose element type is the union type (section [3.4](#3.4)) of the tuple element types. + +Array literals (section [4.6](#4.6)) may be used to create values of tuple types. For example: + +```TypeScript +var t: [number, string] = [3, "three"]; +var n = t[0]; // Type of n is number +var s = t[1]; // Type of s is string +var i: number; +var x = t[i]; // Type of x is number | string +``` + +Named tuple types can be created by declaring interfaces that derive from Array<T> and introduce numerically named properties. For example: + +```TypeScript +interface KeyValuePair extends Array { 0: K; 1: V; } + +var x: KeyValuePair = [10, "ten"]; +``` + +### 3.3.4 Function Types + +An object type containing one or more call signatures is said to be a ***function type***. Function types may be written using function type literals (section [3.7.7](#3.7.7)) or by including call signatures in object type literals. + +### 3.3.5 Constructor Types + +An object type containing one or more construct signatures is said to be a ***constructor type***. Constructor types may be written using constructor type literals (section [3.7.8](#3.7.8)) or by including construct signatures in object type literals. + +### 3.3.6 Members + +Every object type is composed from zero or more of the following kinds of members: + +* ***Properties***, which define the names and types of the properties of objects of the given type. Property names are unique within their type. +* ***Call signatures***, which define the possible parameter lists and return types associated with applying call operations to objects of the given type. +* ***Construct signatures***, which define the possible parameter lists and return types associated with applying the `new` operator to objects of the given type. +* ***Index signatures***, which define type constraints for properties in the given type. An object type can have at most one string index signature and one numeric index signature. + +Properties are either ***public***, ***private***, or ***protected*** and are either ***required*** or ***optional***: + +* Properties in a class declaration may be designated public, private, or protected, while properties declared in other contexts are always considered public. Private members are only accessible within their declaring class, as described in section [8.2.2](#8.2.2), and private properties match only themselves in subtype and assignment compatibility checks, as described in section [0](#0). Protected members are only accessible within their declaring class and classes derived from it, as described in section [8.2.2](#8.2.2), and protected properties match only themselves and overrides in subtype and assignment compatibility checks, as described in section [0](#0). +* Properties in an object type literal or interface declaration may be designated required or optional, while properties declared in other contexts are always considered required. Properties that are optional in the target type of an assignment may be omitted from source objects, as described in section [3.10.4](#3.10.4). + +Call and construct signatures may be ***specialized*** (section [3.8.2.4](#3.8.2.4)) by including parameters with string literal types. Specialized signatures are used to express patterns where specific string values for some parameters cause the types of other parameters or the function result to become further specialized. + +## 3.4 Union Types + +***Union types*** represent values that may have one of several disjoint representations. A value of a union type *A* | *B* is a value that is *either* of type *A* or type *B*. Union types are written using union type literals (section [3.7.6](#3.7.6)). + +A union type encompasses an unordered set of unrelated types (that is, types that aren't subtypes of each other). The following rules govern union types: + +* *A* | *B* is equivalent to *A* if *B* is a subtype of *A*. +* *A* | *B* is equivalent to *B* | *A*. +* *AB* | *C* is equivalent to *A* | *BC*, where *AB* is *A* | *B* and *BC* is *B* | *C*. + +Union types are reduced to the smallest possible set of constituent types using these rules. + +Union types have the following subtype relationships: + +* A union type *U* is a subtype of a type *T* if each type in *U* is a subtype of *T*. +* A type *T* is a subtype of a union type *U* if *T* is a subtype of any type in *U*. + +Similarly, union types have the following assignability relationships: + +* A union type *U* is assignable to a type *T* if each type in *U* is assignable to *T*. +* A type *T* is assignable to a union type *U* if *T* is assignable to any type in *U*. + +The || and conditional operators (section [4.15.7](#4.15.7) and [4.16](#4.16)) may produce values of union types, and array literals (section [4.6](#4.6)) may produce array values that have union types as their element types. + +Type guards (section [4.20](#4.20)) may be used to narrow a union type to a more specific type. In particular, type guards are useful for narrowing union type values to a non-union type values. + +In the example + +```TypeScript +var x: string | number; +var test: boolean; +x = "hello"; // Ok +x = 42; // Ok +x = test; // Error, boolean not assignable +x = test ? 5 : "five"; // Ok +x = test ? 0 : false; // Error, number | boolean not asssignable +``` + +it is possible to assign 'x' a value of type string, number, or the union type string | number, but not any other type. To access a value in 'x', a type guard can be used to first narrow the type of 'x' to either string or number: + +```TypeScript +var n = typeof x === "string" ? x.length : x; // Type of n is number +``` + +For purposes of property access and function calls, the apparent members (section [3.10.1](#3.10.1)) of a union type *U* are those that are present in every one of its constituent types, with types that are unions of the respective apparent members in the constituent types. The following example illustrates the merging of member types that occurs when union types are created from object types. + +```TypeScript +interface A { + a: string; + b: number; +} + +interface B { + a: number; + b: number; + c: number; +} + +var x: A | B; +var a = x.a; // a has type string | number +var b = x.b; // b has type number +var c = x.c; // Error, no property c in union type +``` + +Note that 'x.a' has a union type because the type of 'a' is different in 'A' and 'B', whereas 'x.b' simply has type number because that is the type of 'b' in both 'A' and 'B'. Also note that there is no property 'x.c' because only 'A' has a property 'c'. + +### 3.4.1 Contextual Union Types + +When used as a contextual type (section [4.19](#4.19)), a union type *U* has those members that are present in any of its constituent types, with types that are unions of the respective members in the constituent types. Specifically: + +* Let *S* be the set of types in *U* that has a property *P*. If *S* is not empty, *U* has a property *P* of a union type of the types of *P* from each type in *S*. +* Let *S* be the set of types in *U* that have call signatures. If *S* is not empty and the sets of call signatures of the types in *S* are identical ignoring return types, *U* has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in *S*. +* Let *S* be the set of types in *U* that have construct signatures. If *S* is not empty and the sets of construct signatures of the types in *S* are identical ignoring return types, *U* has the same set of construct signatures, but with return types that are unions of the return types of the respective construct signatures from each type in *S*. +* Let *S* be the set of types in *U* that has a string index signature. If *S* is not empty, *U* has a string index signature of a union type of the types of the string index signatures from each type in *S*. +* Let *S* be the set of types in *U* that has a numeric index signature. If *S* is not empty, *U* has a numeric index signature of a union type of the types of the numeric index signatures from each type in *S*. + +## 3.5 Type Parameters + +A type parameter represents an actual type that the parameter is bound to in a generic type reference or a generic function call. Type parameters have constraints that establish upper bounds for their actual type arguments. + +Since a type parameter represents a multitude of different type arguments, type parameters have certain restrictions compared to other types. In particular, a type parameter cannot be used as a base class or interface. + +### 3.5.1 Type Parameter Lists + +Class, interface, and function declarations may optionally include lists of type parameters enclosed in < and > brackets. Type parameters are also permitted in call signatures of object, function, and constructor type literals. + +  *TypeParameters:* +   `<` *TypeParameterList* `>` + +  *TypeParameterList:* +   *TypeParameter* +   *TypeParameterList* `,` *TypeParameter* + +  *TypeParameter:* +   *Identifier* *Constraintopt* + +  *Constraint:* +   `extends` *Type* + +Type parameter names must be unique. A compile-time error occurs if two or more type parameters in the same *TypeParameterList* have the same name. + +The scope of a type parameter extends over the entire declaration with which the type parameter list is associated, with the exception of static member declarations in classes. + +Each type parameter has an associated type parameter ***constraint*** that establishes an upper bound for type arguments. Omitting a constraint corresponds to specifying the empty object type `{}`. Type parameters declared in a particular type parameter list may not be referenced in constraints in that type parameter list. + +The ***base constraint*** of a type parameter *T* is defined as follows: + +* If *T* has no declared constraint, *T*'s base constraint is the empty object type `{}`. +* If *T*'s declared constraint is a type parameter, *T*'s base constraint is that of the type parameter. +* Otherwise, *T*'s base constraint is *T*'s declared constraint. + +In the example + +```TypeScript +interface G { + f(x: V): V; +} +``` + +the base constraint of 'T' is the empty object type, and the base constraint of 'U' and 'V' is 'Function'. + +For purposes of determining type relationships (section [0](#0)), type parameters appear to be subtypes of their base constraint. Likewise, in property accesses (section [4.10](#4.10)), `new` operations (section [4.11](#4.11)), and function calls (section [4.12](#4.12)), type parameters appear to have the members of their base constraint, but no other members. + +### 3.5.2 Type Argument Lists + +A type reference (section [3.7.2](#3.7.2)) to a generic type must include a list of type arguments enclosed in angle brackets and separated by commas. Similarly, a call (section [4.12](#4.12)) to a generic function may explicitly include a type argument list instead of relying on type inference. + +  *TypeArguments:* +   `<` *TypeArgumentList* `>` + +  *TypeArgumentList:* +   *TypeArgument* +   *TypeArgumentList* `,` *TypeArgument* + +  *TypeArgument:* +   *Type* + +Type arguments correspond one-to-one with type parameters of the generic type or function being referenced. A type argument list is required to specify exactly one type argument for each corresponding type parameter, and each type argument is required to ***satisfy*** the constraint of its corresponding type parameter. A type argument satisfies a type parameter constraint if the type argument is assignable to (section [3.10.4](#3.10.4)) the constraint type once type arguments are substituted for type parameters. + +Given the declaration + +```TypeScript +interface G { } +``` + +a type reference of the form 'G<A, B>' places no requirements on 'A' but requires 'B' to be assignable to 'Function'. + +The process of substituting type arguments for type parameters in a generic type or generic signature is known as ***instantiating*** the generic type or signature. Instantiation of a generic type or signature can fail if the supplied type arguments do not satisfy the constraints of their corresponding type parameters. + +## 3.6 Named Types + +Classes, interfaces, enums, and type aliases are ***named types*** that are introduced through class declarations (section [8.1](#8.1)), interface declarations (section [7.1](#7.1)), enum declarations ([9.1](#9.1)), and type alias declarations (section [3.9](#3.9)). Class and interface types may have type parameters and are then called ***generic types***. Conversely, named types without type parameters are called ***non-generic types***. + +Interface declarations only introduce named types, whereas class declarations introduce named types *and* constructor functions that create instances of implementations of those named types. The named types introduced by class and interface declarations have only minor differences (classes can't declare optional members and interfaces can't declare private or protected members) and are in most contexts interchangeable. In particular, class declarations with only public members introduce named types that function exactly like those created by interface declarations. + +Named types are referenced through ***type references*** (section [3.7.2](#3.7.2)) that specify a type name and, if applicable, the type arguments to be substituted for the type parameters of the named type. + +Named types are technically not types—only *references* to named types are. This distinction is particularly evident with generic types: Generic types are "templates" from which multiple *actual* types can be created by writing type references that supply type arguments to substitute in place of the generic type's type parameters. This substitution process is known as ***instantiating*** a generic type. Only once a generic type is instantiated does it denote an actual type. + +TypeScript has a structural type system, and therefore an instantiation of a generic type is indistinguishable from an equivalent manually written expansion. For example, given the declaration + +```TypeScript +interface Pair { first: T1; second: T2; } +``` + +the type reference + +```TypeScript +Pair +``` + +is indistinguishable from the type + +```TypeScript +{ first: string; second: Entity; } +``` + +### 3.6.1 Instance Types + +Each class and interface has an associated actual type known as the ***instance type***. For a non-generic class or interface, the instance type is simply a type reference to the class or interface. For a generic class or interface, the instance type is an instantiation of the generic type where each of the type arguments is the corresponding type parameter. Since the instance type uses the type parameters it can be used only where the type parameters are in scope—that is, inside the declaration of the class or interface. Within the constructor and instance member functions of a class, the type of `this` is the instance type of the class. + +The following example illustrates the concept of an instance type: + +```TypeScript +class G { // Introduce type parameter T + self: G; // Use T as type argument to form instance type + f() { + this.self = this; // self and this are both of type G + } +} +``` + +## 3.7 Specifying Types + +Types are specified either by referencing their keyword or name, or by writing object type literals, array type literals, tuple type literals, function type literals, constructor type literals, or type queries. + +  *Type:* +   *PrimaryOrUnionType* +   *FunctionType* +   *ConstructorType* + +  *PrimaryOrUnionType:* +   *PrimaryType* +   *UnionType* + +  *PrimaryType:* +   *ParenthesizedType* +   *PredefinedType* +   *TypeReference* +   *ObjectType* +   *ArrayType* +   *TupleType* +   *TypeQuery* + +  *ParenthesizedType:* +   `(` *Type* `)` + +Parentheses are required around union, function, or constructor types when they are used as array element types, and parentheses are required around function or constructor types in union types. For example: + +```TypeScript +(string | number)[] +((x: string) => string) | (x: number) => number) +``` + +The different forms of type notations are described in the following sections. + +### 3.7.1 Predefined Types + +The `any`, `number`, `boolean`, `string`, and `void` keywords reference the Any type and the Number, Boolean, String, and Void primitive types respectively. + +  *PredefinedType:* +   `any` +   `number` +   `boolean` +   `string` +   `void` + +The predefined type keywords are reserved and cannot be used as names of user defined types. + +### 3.7.2 Type References + +A type reference references a named type or type parameter through its name and, in the case of a generic type, supplies a type argument list. + +  *TypeReference:* +   *TypeName* *[no LineTerminator here]* *TypeArgumentsopt* + +  *TypeName:* +   *Identifier* +   *ModuleName* `.` *Identifier* + +  *ModuleName:* +   *Identifier* +   *ModuleName* `.` *Identifier* + +A *TypeReference* consists of a *TypeName* that a references a named type or type parameter. A reference to a generic type must be followed by a list of *TypeArguments* (section [3.5.2](#3.5.2)). + +Resolution of a *TypeName* consisting of a single identifier is described in section [2.4](#2.4). + +Resolution of a *TypeName* of the form *M.N*, where *M* is a *ModuleName* and *N* is an *Identifier*, proceeds by first resolving the module name *M*. If the resolution of *M* is successful and the resulting module contains an exported named type *N*, then *M.N* refers to that member. Otherwise, *M.N* is undefined. + +Resolution of a *ModuleName* consisting of a single identifier is described in section [2.4](#2.4). + +Resolution of a *ModuleName* of the form *M.N*, where *M* is a *ModuleName* and *N* is an *Identifier*, proceeds by first resolving the module name *M*. If the resolution of *M* is successful and the resulting module contains an exported module member *N*, then *M.N* refers to that member. Otherwise, *M.N* is undefined. + +A type reference to a generic type is required to specify exactly one type argument for each type parameter of the referenced generic type, and each type argument must be assignable to (section [3.10.4](#3.10.4)) the constraint of the corresponding type parameter or otherwise an error occurs. An example: + +```TypeScript +interface A { a: string; } + +interface B extends A { b: string; } + +interface C extends B { c: string; } + +interface G { + x: T; + y: U; +} + +var v1: G; // Ok +var v2: G<{ a: string }, C>; // Ok, equivalent to G +var v3: G; // Error, A not valid argument for U +var v4: G, C>; // Ok +var v5: G; // Ok +var v6: G; // Error, wrong number of arguments +var v7: G; // Error, no arguments +``` + +A type argument is simply a *Type* and may itself be a type reference to a generic type, as demonstrated by 'v4' in the example above. + +As described in section [3.6](#3.6), a type reference to a generic type *G* designates a type wherein all occurrences of *G*'s type parameters have been replaced with the actual type arguments supplied in the type reference. For example, the declaration of 'v1' above is equivalent to: + +```TypeScript +var v1: { + x: { a: string; } + y: { a: string; b: string; c: string }; +}; +``` + +### 3.7.3 Object Type Literals + +An object type literal defines an object type by specifying the set of members that are statically considered to be present in instances of the type. Object type literals can be given names using interface declarations but are otherwise anonymous. + +  *ObjectType:* +   `{` *TypeBodyopt* `}` + +  *TypeBody:* +   *TypeMemberList* `;`*opt* + +  *TypeMemberList:* +   *TypeMember* +   *TypeMemberList* `;` *TypeMember* + +  *TypeMember:* +   *PropertySignature* +   *CallSignature* +   *ConstructSignature* +   *IndexSignature* +   *MethodSignature* + +The members of an object type literal are specified as a combination of property, call, construct, index, and method signatures. Object type members are described in section [3.8](#3.8). + +### 3.7.4 Array Type Literals + +An array type literal is written as an element type followed by an open and close square bracket. + +  *ArrayType:* +   *PrimaryType* *[no LineTerminator here]* `[` `]` + +An array type literal references an array type (section [3.3.2](#3.3.2)) with the given element type. An array type literal is simply shorthand notation for a reference to the generic interface type 'Array' in the global module with the element type as a type argument. + +When union, function, or constructor types are used as array element types they must be enclosed in parentheses. For example: + +```TypeScript +(string | number)[] +(() => string))[] +``` + +Alternatively, array types can be written using the 'Array<T>' notation. For example, the types above are equivalent to + +```TypeScript +Array +Array<() => string> +``` + +### 3.7.5 Tuple Type Literals + +A tuple type literal is written as a sequence of element types, separated by commas and enclosed in square brackets. + +  *TupleType:* +   `[` *TupleElementTypes* `]` + +  *TupleElementTypes:* +   *TupleElementType* +   *TupleElementTypes* `,` *TupleElementType* + +  *TupleElementType:* +   *Type* + +A tuple type literal references a tuple type (section [3.3.3](#3.3.3)). + +### 3.7.6 Union Type Literals + +A union type literal is written as a sequence of types separated by vertical bars. + +  *UnionType:* +   *PrimaryOrUnionType* `|` *PrimaryType* + +A union typle literal references a union type (section [3.4](#3.4)). + +When function or constructor types are included in union types they must be enclosed in parentheses. For example: + +```TypeScript +((x: string) => string) | ((x: number) => number) +``` + +Alternatively, function or constructor types in union types can be written using object literals: + +```TypeScript +{ (x: string): string } | { (x: number): number } +``` + +### 3.7.7 Function Type Literals + +A function type literal specifies the type parameters, regular parameters, and return type of a call signature. + +  *FunctionType:* +   *TypeParametersopt* `(` *ParameterListopt* `)` `=>` *Type* + +A function type literal is shorthand for an object type containing a single call signature. Specifically, a function type literal of the form + +```TypeScript +< T1, T2, ... > ( p1, p2, ... ) => R +``` + +is exactly equivalent to the object type literal + +```TypeScript +{ < T1, T2, ... > ( p1, p2, ... ) : R } +``` + +Note that function types with multiple call or construct signatures cannot be written as function type literals but must instead be written as object type literals. + +### 3.7.8 Constructor Type Literals + +A constructor type literal specifies the type parameters, regular parameters, and return type of a construct signature. + +  *ConstructorType:* +   `new` *TypeParametersopt* `(` *ParameterListopt* `)` `=>` *Type* + +A constructor type literal is shorthand for an object type containing a single construct signature. Specifically, a constructor type literal of the form + +```TypeScript +new < T1, T2, ... > ( p1, p2, ... ) => R +``` + +is exactly equivalent to the object type literal + +```TypeScript +{ new < T1, T2, ... > ( p1, p2, ... ) : R } +``` + +Note that constructor types with multiple construct signatures cannot be written as constructor type literals but must instead be written as object type literals. + +### 3.7.9 Type Queries + +A type query obtains the type of an expression. + +  *TypeQuery:* +   `typeof` *TypeQueryExpression* + +  *TypeQueryExpression:* +   *Identifier* +   *TypeQueryExpression* `.` *IdentifierName* + +A type query consists of the keyword `typeof` followed by an expression. The expression is restricted to a single identifier or a sequence of identifiers separated by periods. The expression is processed as an identifier expression (section [4.3](#4.3)) or property access expression (section [4.10](#4.10)), the widened type (section [3.11](#3.11)) of which becomes the result. Similar to other static typing constructs, type queries are erased from the generated JavaScript code and add no run-time overhead. + +Type queries are useful for capturing anonymous types that are generated by various constructs such as object literals, function declarations, and module declarations. For example: + +```TypeScript +var a = { x: 10, y: 20 }; +var b: typeof a; +``` + +Above, 'b' is given the same type as 'a', namely '{ x: number; y: number; }'. + +If a declaration includes a type annotation that references the entity being declared through a circular path of type queries or type references containing type queries, the resulting type is the Any type. For example, all of the following variables are given the type Any: + +```TypeScript +var c: typeof c; +var d: typeof e; +var e: typeof d; +var f: Array; +``` + +However, if a circular path of type queries includes at least one *ObjectType*, *FunctionType* or *ConstructorType*, the construct denotes a recursive type: + +```TypeScript +var g: { x: typeof g; }; +var h: () => typeof h; +``` + +Here, 'g' and 'g.x' have the same recursive type, and likewise 'h' and 'h()' have the same recursive type. + +## 3.8 Specifying Members + +The members of an object type literal (section [3.7.3](#3.7.3)) are specified as a combination of property, call, construct, index, and method signatures. + +### 3.8.1 Property Signatures + +A property signature declares the name and type of a property member. + +  *PropertySignature:* +   *PropertyName* `?`*opt* *TypeAnnotationopt* + +  *PropertyName:* +   *IdentifierName* +   *StringLiteral* +   *NumericLiteral* + +The *PropertyName* production, reproduced above from the ECMAScript grammar, permits a property name to be any identifier (including a reserved word), a string literal, or a numeric literal. String literals can be used to give properties names that are not valid identifiers, such as names containing blanks. Numeric literal property names are equivalent to string literal property names with the string representation of the numeric literal, as defined in the ECMAScript specification. + +The *PropertyName* of a property signature must be unique within its containing type. If the property name is followed by a question mark, the property is optional. Otherwise, the property is required. + +If a property signature omits a *TypeAnnotation*, the Any type is assumed. + +### 3.8.2 Call Signatures + +A call signature defines the type parameters, parameter list, and return type associated with applying a call operation (section [4.12](#4.12)) to an instance of the containing type. A type may ***overload*** call operations by defining multiple different call signatures. + +  *CallSignature:* +   *TypeParametersopt* `(` *ParameterListopt* `)` *TypeAnnotationopt* + +A call signature that includes *TypeParameters* (section [3.5.1](#3.5.1)) is called a ***generic call signature***. Conversely, a call signature with no *TypeParameters* is called a non-generic call signature. + +As well as being members of object type literals, call signatures occur in method signatures (section [3.8.5](#3.8.5)), function expressions (section [4.9](#4.9)), and function declarations (section [6.1](#6.1)). + +An object type containing call signatures is said to be a ***function type***. + +#### 3.8.2.1 Type Parameters + +Type parameters (section [3.5.1](#3.5.1)) in call signatures provide a mechanism for expressing the relationships of parameter and return types in call operations. For example, a signature might introduce a type parameter and use it as both a parameter type and a return type, in effect describing a function that returns a value of the same type as its argument. + +Type parameters may be referenced in parameter types and return type annotations, but not in type parameter constraints, of the call signature in which they are introduced. + +Type arguments (section [3.5.2](#3.5.2)) for call signature type parameters may be explicitly specified in a call operation or may, when possible, be inferred (section [4.12.2](#4.12.2)) from the types of the regular arguments in the call. An ***instantiation*** of a generic call signature for a particular set of type arguments is the call signature formed by replacing each type parameter with its corresponding type argument. + +Some examples of call signatures with type parameters follow below. + +A function taking an argument of any type, returning a value of that same type: + +```TypeScript +(x: T): T +``` + +A function taking two values of the same type, returning an array of that type: + +```TypeScript +(x: T, y: T): T[] +``` + +A function taking two arguments of different types, returning an object with properties 'x' and 'y' of those types: + +```TypeScript +(x: T, y: U): { x: T; y: U; } +``` + +A function taking an array of one type and a function argument, returning an array of another type, where the function argument takes a value of the first array element type and returns a value of the second array element type: + +```TypeScript +(a: T[], f: (x: T) => U): U[] +``` + +#### 3.8.2.2 Parameter List + +A signature's parameter list consists of zero or more required parameters, followed by zero or more optional parameters, finally followed by an optional rest parameter. + +  *ParameterList:* +   *RequiredParameterList* +   *OptionalParameterList* +   *RestParameter* +   *RequiredParameterList* `,` *OptionalParameterList* +   *RequiredParameterList* `,` *RestParameter* +   *OptionalParameterList* `,` *RestParameter* +   *RequiredParameterList* `,` *OptionalParameterList* `,` *RestParameter* + +  *RequiredParameterList:* +   *RequiredParameter* +   *RequiredParameterList* `,` *RequiredParameter* + +  *RequiredParameter:* +   *AccessibilityModifieropt* *Identifier* *TypeAnnotationopt* +   *Identifier* `:` *StringLiteral* + +  *AccessibilityModifier:* +   `public` +   `private` +   `protected` + +  *OptionalParameterList:* +   *OptionalParameter* +   *OptionalParameterList* `,` *OptionalParameter* + +  *OptionalParameter:* +   *AccessibilityModifieropt* *Identifier* `?` *TypeAnnotationopt* +   *AccessibilityModifieropt* *Identifier* *TypeAnnotationopt* *Initialiser* +   *Identifier* `?` `:` *StringLiteral* + +  *RestParameter:* +   `...` *Identifier* *TypeAnnotationopt* + +Parameter names must be unique. A compile-time error occurs if two or more parameters have the same name. + +A parameter is permitted to include a `public`, `private`, or `protected` modifier only if it occurs in the parameter list of a *ConstructorImplementation* (section [8.3.1](#8.3.1)). + +A parameter with a type annotation is considered to be of that type. A type annotation for a rest parameter must denote an array type. + +A parameter with no type annotation or initializer is considered to be of type `any`, unless it is a rest parameter, in which case it is considered to be of type `any[]`. + +When a parameter type annotation specifies a string literal type, the containing signature is a specialized signature (section [3.8.2.4](#3.8.2.4)). Specialized signatures are not permitted in conjunction with a function body, i.e. the *FunctionExpression*, *FunctionImplementation*, *MemberFunctionImplementation*, and *ConstructorImplementation* grammar productions do not permit parameters with string literal types. + +A parameter can be marked optional by following its name with a question mark (`?`) or by including an initializer. The form that includes an initializer is permitted only in conjunction with a function body, i.e. only in a *FunctionExpression*, *FunctionImplementation*, *MemberFunctionImplementation*, or *ConstructorImplementation* grammar production. + +#### 3.8.2.3 Return Type + +If present, a call signature's return type annotation specifies the type of the value computed and returned by a call operation. A `void` return type annotation is used to indicate that a function has no return value. + +When a call signature with no return type annotation occurs in a context without a function body, the return type is assumed to be the Any type. + +When a call signature with no return type annotation occurs in a context that has a function body (specifically, a function implementation, a member function implementation, or a member accessor declaration), the return type is inferred from the function body as described in section [6.3](#6.3). + +#### 3.8.2.4 Specialized Signatures + +When a parameter type annotation specifies a string literal type (section [3.2.8](#3.2.8)), the containing signature is considered a specialized signature. Specialized signatures are used to express patterns where specific string values for some parameters cause the types of other parameters or the function result to become further specialized. For example, the declaration + +```TypeScript +interface Document { + createElement(tagName: "div"): HTMLDivElement; + createElement(tagName: "span"): HTMLSpanElement; + createElement(tagName: "canvas"): HTMLCanvasElement; + createElement(tagName: string): HTMLElement; +} +``` + +states that calls to 'createElement' with the string literals "div", "span", and "canvas" return values of type 'HTMLDivElement', 'HTMLSpanElement', and 'HTMLCanvasElement' respectively, and that calls with all other string expressions return values of type 'HTMLElement'. + +When writing overloaded declarations such as the one above it is important to list the non-specialized signature last. This is because overload resolution (section [4.12.1](#4.12.1)) processes the candidates in declaration order and picks the first one that matches. + +Every specialized call or construct signature in an object type must be assignable to at least one non-specialized call or construct signature in the same object type (where a call signature *A* is considered assignable to another call signature *B* if an object type containing only *A* would be assignable to an object type containing only *B*). For example, the 'createElement' property in the example above is of a type that contains three specialized signatures, all of which are assignable to the non-specialized signature in the type. + +### 3.8.3 Construct Signatures + +A construct signature defines the parameter list and return type associated with applying the `new` operator (section [4.11](#4.11)) to an instance of the containing type. A type may overload `new` operations by defining multiple construct signatures with different parameter lists. + +  *ConstructSignature:* +   `new` *TypeParametersopt* `(` *ParameterListopt* `)` *TypeAnnotationopt* + +The type parameters, parameter list, and return type of a construct signature are subject to the same rules as a call signature. + +A type containing construct signatures is said to be a ***constructor type***. + +### 3.8.4 Index Signatures + +An index signature defines a type constraint for properties in the containing type. + +  *IndexSignature:* +   `[` *Identifier* `:` `string` `]` *TypeAnnotation* +   `[` *Identifier* `:` `number` `]` *TypeAnnotation* + +There are two kinds of index signatures: + +* ***String index signatures***, specified using index type `string`, define type constraints for all properties and numeric index signatures in the containing type. Specifically, in a type with a string index signature of type *T*, all properties and numeric index signatures must have types that are assignable to *T*. +* ***Numeric index signatures***, specified using index type `number`, define type constraints for all numerically named properties in the containing type. Specifically, in a type with a numeric index signature of type *T*, all numerically named properties must have types that are assignable to *T*. + +A ***numerically named property*** is a property whose name is a valid numeric literal. Specifically, a property with a name *N* for which ToNumber(*N*) is not NaN, where ToNumber is the abstract operation defined in ECMAScript specification. + +An object type can contain at most one string index signature and one numeric index signature. + +Index signatures affect the determination of the type that results from applying a bracket notation property access to an instance of the containing type, as described in section [4.10](#4.10). + +### 3.8.5 Method Signatures + +A method signature is shorthand for declaring a property of a function type. + +  *MethodSignature:* +   *PropertyName* `?`*opt* *CallSignature* + +If the identifier is followed by a question mark, the property is optional. Otherwise, the property is required. Only object type literals and interfaces can declare optional properties. + +A method signature of the form + +```TypeScript +f < T1, T2, ... > ( p1, p2, ... ) : R +``` + +is equivalent to the property declaration + +```TypeScript +f : { < T1, T2, ... > ( p1, p2, ... ) : R } +``` + +A literal type may ***overload*** a method by declaring multiple method signatures with the same name but differing parameter lists. Overloads must either all be required (question mark omitted) or all be optional (question mark included). A set of overloaded method signatures correspond to a declaration of a single property with a type composed from an equivalent set of call signatures. Specifically + +```TypeScript +f < T1, T2, ... > ( p1, p2, ... ) : R ; +f < U1, U2, ... > ( q1, q2, ... ) : S ; +... +``` + +is equivalent to + +```TypeScript +f : { + < T1, T2, ... > ( p1, p2, ... ) : R ; + < U1, U2, ... > ( q1, q2, ... ) : S ; + ... +} ; +``` + +In the following example of an object type + +```TypeScript +{ + func1(x: number): number; // Method signature + func2: (x: number) => number; // Function type literal + func3: { (x: number): number }; // Object type literal +} +``` + +the properties 'func1', 'func2', and 'func3' are all of the same type, namely an object type with a single call signature taking a number and returning a number. Likewise, in the object type + +```TypeScript +{ + func4(x: number): number; + func4(s: string): string; + func5: { + (x: number): number; + (s: string): string; + }; +} +``` + +the properties 'func4' and 'func5' are of the same type, namely an object type with two call signatures taking and returning number and string respectively. + +## 3.9 Type Aliases + +A type alias declaration introduces a ***type alias*** in the containing module. + +  *TypeAliasDeclaration:* +   `type` *Identifier* `=` *Type* `;` + +A type alias serves as an alias for the type specified in the type alias declaration. Unlike an interface declaration, which always introduces a named object type, a type alias declaration can introduce a name for any kind of type, including primitive types and union types. + +Type aliases are referenced using type references ([3.7.2](#3.7.2)). Writing a reference to a type alias has ***exactly*** the same effect as writing the aliased type itself. + +The *Identifier* of a type alias declaration may not be one of the predefined type names (section [3.7.1](#3.7.1)). + +It is an error for the type specified in a type alias to depend on that type alias. Types have the following dependencies: + +* A type alias *directly depends on* the type it aliases. +* A type reference *directly depends on* the referenced type and each of the type arguments, if any. +* A union type *directly depends on* each of the constituent types. +* An array type *directly depends on* its element type. +* A tuple type *directly depends on* each of its element types. +* A type query *directly depends on* the type of the referenced entity. + +Given this definition, the complete set of types upon which a type depends is the transitive closure of the *directly depends on* relationship. Note that object type literals, function type literals, and constructor type literals do not depend on types referenced within them and are therefore permitted to circularly reference themselves through type aliases. + +Some examples of type alias declarations: + +```TypeScript +type StringOrNumber = string | number; +type Text = string | { text: string }; +type Coordinates = [number, number]; +type NameLookup = Dictionary; +type Callback = (data: string) => void; +type RecFunc = () => RecFunc; +type ObjectStatics = typeof Object; +``` + +Interface types have many similarities to type aliases for object type literals, but since interface types offer more capabilities they are generally preferred to type aliases. For example, the interface type + +```TypeScript +interface Point { + x: number; + y: number; +} +``` + +could be written as the type alias + +```TypeScript +type Point = { + x: number; + y: number; +}; +``` + +However, doing so means the following capabilities are lost: + +* An interface can be named in an extends or implements clause, but a type alias for an object type literal cannot. +* An interface can have multiple merged declarations, but a type alias for an object type literal cannot. +* An interface can have type parameters, but a type alias for an object type literal cannot. +* An interface is referenced by its name in error messages and tooling, but a type alias is always expanded to its structural representation. + +## 3.10 Type Relationships + +Types in TypeScript have identity, subtype, supertype, and assignment compatibility relationships as defined in the following sections. + +### 3.10.1 Apparent Members + +The ***apparent members*** of a type are the members observed in subtype, supertype, and assignment compatibility relationships, as well as in the type checking of property accesses (section [4.10](#4.10)), `new` operations (section [4.11](#4.11)), and function calls (section [4.12](#4.12)). The apparent members of a type are determined as follows: + +* The apparent members of the primitive types Number, Boolean, and String are the apparent members of the global interface types 'Number', 'Boolean', and 'String' respectively. +* The apparent members of an enum type are the apparent members of the global interface type 'Number'. +* The apparent members of a type parameter are the apparent members of the base constraint (section [3.5.1](#3.5.1)) of that type parameter. +* The apparent members of an object type *T* are the combination of the following: + * The declared and/or inherited members of *T*. + * The properties of the global interface type 'Object' that aren't hidden by properties with the same name in *T*. + * If *T* has one or more call or construct signatures, the properties of the global interface type 'Function' that aren't hidden by properties with the same name in *T*. +* The apparent members of a union type *U* are determined as follows: + * If each type in *U* has an apparent property *P*, *U* has an apparent property *P* of a union type of the types of *P* from each type in *U*. + * If each type in *U* has apparent call signatures and the sets of apparent call signatures are identical ignoring return types, *U* has the same set of call signatures, but with return types that are unions of the return types of the respective apparent call signatures from each type in *U*. + * If each type in *U* has apparent construct signatures and the sets of apparent construct signatures are identical ignoring return types, *U* has the same set of construct signatures, but with return types that are unions of the return types of the respective apparent construct signatures from each type in *U*. + * If each type in *U* has an apparent string index signature, *U* has a string index signature of a union type of the types of the apparent string index signatures from each type in *U*. + * If each type in *U* has an apparent numeric index signature, *U* has a numeric index signature of a union type of the types of the apparent numeric index signatures from each type in *U*. + +If a type is not one of the above, it is considered to have no apparent members. + +In effect, a type's apparent members make it a subtype of the 'Object' or 'Function' interface unless the type defines members that are incompatible with those of the 'Object' or 'Function' interface—which, for example, occurs if the type defines a property with the same name as a property in the 'Object' or 'Function' interface but with a type that isn't a subtype of that in the 'Object' or 'Function' interface. + +Some examples: + +```TypeScript +var o: Object = { x: 10, y: 20 }; // Ok +var f: Function = (x: number) => x * x; // Ok +var err: Object = { toString: 0 }; // Error +``` + +The last assignment is an error because the object literal has a 'toString' method that isn't compatible with that of 'Object'. + +### 3.10.2 Type and Member Identity + +Two types are considered ***identical*** when + +* they are both the Any type, +* they are the same primitive type, +* they are the same type parameter, +* they are union types with identical sets of constituent types, or +* they are object types with identical sets of members. + +Two members are considered identical when + +* they are public properties with identical names, optionality, and types, +* they are private or protected properties originating in the same declaration and having identical types, +* they are identical call signatures, +* they are identical construct signatures, or +* they are index signatures of identical kind with identical types. + +Two call or construct signatures are considered identical when they have the same number of type parameters with identical type parameter constraints and, after substituting type Any for the type parameters introduced by the signatures, identical number of parameters with identical kind (required, optional or rest) and types, and identical return types. + +Note that, except for primitive types and classes with private or protected members, it is structure, not naming, of types that determines identity. Also, note that parameter names are not significant when determining identity of signatures. + +Private and protected properties match only if they originate in the same declaration and have identical types. Two distinct types might contain properties that originate in the same declaration if the types are separate parameterized references to the same generic class. In the example + +```TypeScript +class C { private x: T; } + +interface X { f(): string; } + +interface Y { f(): string; } + +var a: C; +var b: C; +``` + +the variables 'a' and 'b' are of identical types because the two type references to 'C' create types with a private member 'x' that originates in the same declaration, and because the two private 'x' members have types with identical sets of members once the type arguments 'X' and 'Y' are substituted. + +### 3.10.3 Subtypes and Supertypes + +*S* is a ***subtype*** of a type *T*, and *T* is a ***supertype*** of *S*, if one of the following is true: + +* *S* and *T* are identical types. +* *T* is the Any type. +* *S* is the Undefined type. +* *S* is the Null type and *T* is not the Undefined type. +* *S* is an enum type and *T* is the primitive type Number. +* *S* is a string literal type and *T* is the primitive type String. +* *S* and *T* are type parameters, and *S* is directly or indirectly constrained to *T*. +* *S* is a union type and each constituent type of *S* is a subtype of *T*. +* *T* is a union type and *S* is a subtype of at least one constituent type of *T*. +* *S* is an object type, a type parameter, or the Number, Boolean, or String primitive type, *T* is an object type, and for each member *M* in *T*, one of the following is true: + * *M* is a property and *S* has an apparent property *N* where + * *M* and *N* have the same name, + * the type of *N* is a subtype of that of *M*, + * if *M* is a required property, *N* is also a required property, and + * *M* and *N* are both public, *M* and *N* are both private and originate in the same declaration, *M* and *N* are both protected and originate in the same declaration, or *M* is protected and *N* is declared in a class derived from the class in which *M* is declared. + * *M* is a non-specialized call or construct signature and *S* has an apparent call or construct signature *N* where, when *M* and *N* are instantiated using type Any as the type argument for all type parameters declared by *M* and *N* (if any), + * the signatures are of the same kind (call or construct), + * *M* has a rest parameter or the number of non-optional parameters in *N* is less than or equal to the total number of parameters in *M*, + * for parameter positions that are present in both signatures, each parameter type in *N* is a subtype or supertype of the corresponding parameter type in *M*, and + * the result type of *M* is Void, or the result type of *N* is a subtype of that of *M*. + * *M* is a string index signature of type *U* and *S* has an apparent string index signature of a type that is a subtype of *U*. + * *M* is a numeric index signature of type *U* and *S* has an apparent string or numeric index signature of a type that is a subtype of *U*. + +When comparing call or construct signatures, parameter names are ignored and rest parameters correspond to an unbounded expansion of optional parameters of the rest parameter element type. + +Note that specialized call and construct signatures (section [3.8.2.4](#3.8.2.4)) are not significant when determining subtype and supertype relationships. + +Also note that type parameters are not considered object types. Thus, the only subtypes of a type parameter *T* are *T* itself and other type parameters that are directly or indirectly constrained to *T*. + +### 3.10.4 Assignment Compatibility + +Types are required to be assignment compatible in certain circumstances, such as expression and variable types in assignment statements and argument and parameter types in function calls. + +*S* is ***assignable to*** a type *T*, and *T* is ***assignable from*** *S*, if one of the following is true: + +* *S* and *T* are identical types. +* *S* or *T* is the Any type. +* *S* is the Undefined type. +* *S* is the Null type and *T* is not the Undefined type. +* *S* or *T* is an enum type and* *the other is the primitive type Number. +* *S* is a string literal type and *T* is the primitive type String. +* *S* and *T* are type parameters, and *S* is directly or indirectly constrained to *T*. +* *S* is a union type and each constituent type of *S* is assignable to *T*. +* *T* is a union type and *S* is assignable to at least one constituent type of *T*. +* *S* is an object type, a type parameter, or the Number, Boolean, or String primitive type, *T* is an object type, and for each member *M* in *T*, one of the following is true: + * *M* is a property and *S* has an apparent property *N* where + * *M* and *N* have the same name, + * the type of *N* is assignable to that of *M*, + * if *M* is a required property, *N* is also a required property, and + * *M* and *N* are both public, *M* and *N* are both private and originate in the same declaration, *M* and *N* are both protected and originate in the same declaration, or *M* is protected and *N* is declared in a class derived from the class in which *M* is declared. + * *M* is an optional property and *S* has no apparent property of the same name as *M*. + * *M* is a non-specialized call or construct signature and *S* has an apparent call or construct signature *N* where, when *M* and *N* are instantiated using type Any as the type argument for all type parameters declared by *M* and *N* (if any), + * the signatures are of the same kind (call or construct), + * *M* has a rest parameter or the number of non-optional parameters in *N* is less than or equal to the total number of parameters in *M*, + * for parameter positions that are present in both signatures, each parameter type in *N* is assignable to or from the corresponding parameter type in *M*, and + * the result type of *M* is Void, or the result type of *N* is assignable to that of *M*. + * *M* is a string index signature of type *U* and *S* has an apparent string index signature of a type that is assignable to *U*. + * *M* is a numeric index signature of type *U* and *S* has an apparent string or numeric index signature of a type that is assignable to *U*. + +When comparing call or construct signatures, parameter names are ignored and rest parameters correspond to an unbounded expansion of optional parameters of the rest parameter element type. + +Note that specialized call and construct signatures (section [3.8.2.4](#3.8.2.4)) are not significant when determining assignment compatibility. + +The assignment compatibility and subtyping rules differ only in that + +* the Any type is assignable to, but not a subtype of, all types, +* the primitive type Number is assignable to, but not a subtype of, all enum types, and +* an object type without a particular property is assignable to an object type in which that property is optional. + +The assignment compatibility rules imply that, when assigning values or passing parameters, optional properties must either be present and of a compatible type, or not be present at all. For example: + +```TypeScript +function foo(x: { id: number; name?: string; }) { } + +foo({ id: 1234 }); // Ok +foo({ id: 1234, name: "hello" }); // Ok +foo({ id: 1234, name: false }); // Error, name of wrong type +foo({ name: "hello" }); // Error, id required but missing +``` + +### 3.10.5 Contextual Signature Instantiation + +During type argument inference in a function call (section [4.12.2](#4.12.2)) it is in certain circumstances necessary to instantiate a generic call signature of an argument expression in the context of a non-generic call signature of a parameter such that further inferences can be made. A generic call signature *A* is ***instantiated in the context of*** non-generic call signature *B* as follows: + +* Using the process described in [3.10.6](#3.10.6), inferences for *A*'s type parameters are made from each parameter type in *B* to the corresponding parameter type in *A* for those parameter positions that are present in both signatures, where rest parameters correspond to an unbounded expansion of optional parameters of the rest parameter element type. +* The inferred type argument for each type parameter is the union type of the set of inferences made for that type parameter. However, if the union type does not satisfy the constraint of the type parameter, the inferred type argument is instead the constraint. + +### 3.10.6 Type Inference + +In certain contexts, inferences for a given set of type parameters are made *from* a type *S*, in which those type parameters do not occur, *to* another type *T*, in which those type parameters do occur. Inferences consist of a set of candidate type arguments collected for each of the type parameters. The inference process recursively relates *S* and *T* to gather as many inferences as possible: + +* If *T* is one of the type parameters for which inferences are being made, *S* is added to the set of inferences for that type parameter. +* Otherwise, if *S* and *T* are references to the same generic type, inferences are made from each type argument in *S* to each corresponding type argument in *T*. +* Otherwise, if *T* is a union type: + * First, inferences are made from *S* to each constituent type in *T* that isn't simply one of the type parameters for which inferences are being made. + * If the first step produced no inferences and exactly one constituent type in *T* is simply a type parameter for which inferences are being made, inferences are made from *S* to that type parameter. +* Otherwise, if *S* is a union type, inferences are made from each constituent type in *S* to *T*. +* Otherwise, if *S* and *T* are object types, then for each member *M* in *T*: + * If *M* is a property and *S* contains a property *N* with the same name as *M*, inferences are made from the type of *N* to the type of *M*. + * If *M* is a call signature and a corresponding call signature *N* exists in *S*, *N* is instantiated with the Any type as an argument for each type parameter (if any) and inferences are made from parameter types in *N* to the corresponding parameter types in *M* for positions that are present in both signatures, and from the return type of *N* to the return type of *M*. + * If *M* is a construct signature and a corresponding construct signature *N* exists in *S*, *N* is instantiated with the Any type as an argument for each type parameter (if any) and inferences are made from parameter types in *N* to the corresponding parameter types in *M* for positions that are present in both signatures, and from the return type of *N* to the return type of *M*. + * If *M* is a string index signature and *S* contains a string index signature *N*, inferences are made from the type of *N* to the type of *M*. + * If *M* is a numeric index signature and *S* contains a numeric index signature *N*, inferences are made from the type of *N* to the type of *M*. + * If *M* is a numeric index signature and *S* contains a string index signature *N*, inferences are made from the type of *N* to the type of *M*. + +When comparing call or construct signatures, signatures in *S* correspond to signatures of the same kind in *T* pairwise in declaration order. If *S* and *T* have different numbers of a given kind of signature, the excess *first* signatures in declaration order of the longer list are ignored. + +### 3.10.7 Recursive Types + +Classes and interfaces can reference themselves in their internal structure, in effect creating recursive types with infinite nesting. For example, the type + +```TypeScript +interface A { next: A; } +``` + +contains an infinitely nested sequence of 'next' properties. Types such as this are perfectly valid but require special treatment when determining type relationships. Specifically, when comparing types *S* and *T* for a given relationship (identity, subtype, or assignability), the relationship in question is assumed to be true for every directly or indirectly nested occurrence of the same *S* and the same *T* (where same means originating in the same declaration and, if applicable, having identical type arguments). For example, consider the identity relationship between 'A' above and 'B' below: + +```TypeScript +interface B { next: C; } + +interface C { next: D; } + +interface D { next: B; } +``` + +To determine whether 'A' and 'B' are identical, first the 'next' properties of type 'A' and 'C' are compared. That leads to comparing the 'next' properties of type 'A' and 'D', which leads to comparing the 'next' properties of type 'A' and 'B'. Since 'A' and 'B' are already being compared this relationship is by definition true. That in turn causes the other comparisons to be true, and therefore the final result is true. + +When this same technique is used to compare generic type references, two type references are considered the same when they originate in the same declaration and have identical type arguments. + +In certain circumstances, generic types that directly or indirectly reference themselves in a recursive fashion can lead to infinite series of distinct instantiations. For example, in the type + +```TypeScript +interface List { + data: T; + next: List; + owner: List>; +} +``` + +'List<T>' has a member 'owner' of type 'List<List<T>>', which has a member 'owner' of type 'List<List<List<T>>>', which has a member 'owner' of type 'List<List<List<List<T>>>>' and so on, ad infinitum. Since type relationships are determined structurally, possibly exploring the constituent types to their full depth, in order to determine type relationships involving infinitely expanding generic types it may be necessary for the compiler to terminate the recursion at some point with the assumption that no further exploration will change the outcome. + +## 3.11 Widened Types + +In several situations TypeScript infers types from context, alleviating the need for the programmer to explicitly specify types that appear obvious. For example + +```TypeScript +var name = "Steve"; +``` + +infers the type of 'name' to be the String primitive type since that is the type of the value used to initialize it. When inferring the type of a variable, property or function result from an expression, the ***widened*** form of the source type is used as the inferred type of the target. The widened form of a type is the type in which all occurrences of the Null and Undefined types have been replaced with the type `any`. + +The following example shows the results of widening types to produce inferred variable types. + +```TypeScript +var a = null; // var a: any +var b = undefined; // var b: any +var c = { x: 0, y: null }; // var c: { x: number, y: any } +var d = [ null, undefined ]; // var d: any[] +``` + +
+ +#
4 Expressions + +This chapter describes the manner in which TypeScript provides type inference and type checking for JavaScript expressions. TypeScript's type analysis occurs entirely at compile-time and adds no run-time overhead to expression evaluation. + +TypeScript's typing rules define a type for every expression construct. For example, the type of the literal 123 is the Number primitive type, and the type of the object literal { a: 10, b: "hello" } is { a: number; b: string; }. The sections in this chapter describe these rules in detail. + +In addition to type inference and type checking, TypeScript augments JavaScript expressions with the following constructs: + +* Optional parameter and return type annotations in function expressions. +* Default parameter values and rest parameters in function expressions. +* Arrow function expressions. +* Super calls and member access. +* Type assertions. + +Unless otherwise noted in the sections that follow, TypeScript expressions and the JavaScript expressions generated from them are identical. + +## 4.1 Values and References + +Expressions are classified as ***values*** or ***references***. References are the subset of expressions that are permitted as the target of an assignment. Specifically, references are combinations of identifiers (section [4.3](#4.3)), parentheses (section [4.7](#4.7)), and property accesses (section [4.10](#4.10)). All other expression constructs described in this chapter are classified as values. + +## 4.2 The this Keyword + +The type of `this` in an expression depends on the location in which the reference takes place: + +* In a constructor, instance member function, instance member accessor, or instance member variable initializer, `this` is of the class instance type of the containing class. +* In a static member function or static member accessor, the type of `this` is the constructor function type of the containing class. +* In a function declaration or a standard function expression, `this` is of type Any. +* In the global module, `this` is of type Any. + +In all other contexts it is a compile-time error to reference `this`. + +In the body of an arrow function expression, references to `this` are rewritten in the generated JavaScript code, as described in section [4.9.2](#4.9.2). + +## 4.3 Identifiers + +When an expression is an *Identifier*, the expression refers to the most nested module, class, enum, function, variable, or parameter with that name whose scope (section [2.4](#2.4)) includes the location of the reference. The type of such an expression is the type associated with the referenced entity: + +* For a module, the object type associated with the module instance. +* For a class, the constructor type associated with the constructor function object. +* For an enum, the object type associated with the enum object. +* For a function, the function type associated with the function object. +* For a variable, the type of the variable. +* For a parameter, the type of the parameter. + +An identifier expression that references a variable or parameter is classified as a reference. An identifier expression that references any other kind of entity is classified as a value (and therefore cannot be the target of an assignment). + +## 4.4 Literals + +Literals are typed as follows: + +* The type of the `null` literal is the Null primitive type. +* The type of the literals `true` and `false` is the Boolean primitive type. +* The type of numeric literals is the Number primitive type. +* The type of string literals is the String primitive type. +* The type of regular expression literals is the global interface type 'RegExp'. + +## 4.5 Object Literals + +Object literals are extended to support type annotations in get and set accessors. + +  *PropertyAssignment:* *( Modified )* +   *PropertyName* `:` *AssignmentExpression* +   *PropertyName* *CallSignature* `{` *FunctionBody* `}` +   *GetAccessor* +   *SetAccessor* + +  *GetAccessor:* +   `get` *PropertyName* `(` `)` *TypeAnnotationopt* `{` *FunctionBody* `}` + +  *SetAccessor:* +   `set` *PropertyName* `(` *Identifier* *TypeAnnotationopt* `)` `{` *FunctionBody* `}` + +The type of an object literal is an object type with the set of properties specified by the property assignments in the object literal. A get and set accessor may specify the same property name, but otherwise it is an error to specify multiple property assignments for the same property. + +A property assignment of the form + +```TypeScript +f ( ... ) { ... } +``` + +is simply shorthand for + +```TypeScript +f : function ( ... ) { ... } +``` + +Each property assignment in an object literal is processed as follows: + +* If the object literal is contextually typed and the contextual type contains a property with a matching name, the property assignment is contextually typed by the type of that property. +* Otherwise, if the object literal is contextually typed, if the contextual type contains a numeric index signature, and if the property assignment specifies a numeric property name, the property assignment is contextually typed by the type of the numeric index signature. +* Otherwise, if the object literal is contextually typed and the contextual type contains a string index signature, the property assignment is contextually typed by the type of the string index signature. +* Otherwise, the property assignment is processed without a contextual type. + +The type of a property introduced by a property assignment of the form *Name* `:` *Expr* is the type of *Expr*. + +A get accessor declaration is processed in the same manner as an ordinary function declaration (section [6.1](#6.1)) with no parameters. A set accessor declaration is processed in the same manner as an ordinary function declaration with a single parameter and a Void return type. When both a get and set accessor is declared for a property: + +* If both accessors include type annotations, the specified types must be identical. +* If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. +* If neither accessor includes a type annotation, the inferred return type of the get accessor becomes the parameter type of the set accessor. + +If a get accessor is declared for a property, the return type of the get accessor becomes the type of the property. If only a set accessor is declared for a property, the parameter type (which may be type Any if no type annotation is present) of the set accessor becomes the type of the property. + +When an object literal is contextually typed by a type that includes a string index signature, the resulting type of the object literal includes a string index signature with the union type of the types of the properties declared in the object literal, or the Undefined type if the object literal is empty. Likewise, when an object literal is contextually typed by a type that includes a numeric index signature, the resulting type of the object literal includes a numeric index signature with the union type of the types of the numerically named properties (section [3.8.4](#3.8.4)) declared in the object literal, or the Undefined type if the object literal declares no numerically named properties. + +## 4.6 Array Literals + +An array literal + +```TypeScript +[ expr1, expr2, ..., exprN ] +``` + +denotes a value of an array type (section [3.3.2](#3.3.2)) or a tuple type (section [3.3.3](#3.3.3)) depending on context. + +Each element expression in a non-empty array literal is processed as follows: + +* If the array literal is contextually typed (section [4.19](#4.19)) by a type *T* and *T* has a property with the numeric name *N*, where *N* is the index of the element expression in the array literal, the element expression is contextually typed by the type of that property. +* Otherwise, if the array literal is contextually typed by a type *T* with a numeric index signature, the element expression is contextually typed by the type of the numeric index signature. +* Otherwise, the element expression is not contextually typed. + +The resulting type an array literal expression is determined as follows: + +* If the array literal is empty, the resulting type is an array type with the element type Undefined. +* Otherwise, if the array literal is contextually typed by a type that has a property with the numeric name '0', the resulting type is a tuple type constructed from the types of the element expressions. +* Otherwise, the resulting type is an array type with an element type that is the union of the types of the element expressions. + +The rules above mean that an array literal is always of an array type, unless it is contextually typed by a type with numerically named properties (such as a tuple type). For example + +```TypeScript +var a = [1, 2]; // number[] +var b = ["hello", true]; // (string | boolean)[] +var c: [number, string] = [3, "three"]; // [number, string] +``` + +## 4.7 Parentheses + +A parenthesized expression + +```TypeScript +( expr ) +``` + +has the same type and classification as the contained expression itself. Specifically, if the contained expression is classified as a reference, so is the parenthesized expression. + +## 4.8 The super Keyword + +The `super` keyword can be used in expressions to reference base class properties and the base class constructor. + +  *CallExpression:* *( Modified )* +   … +   `super` `(` *ArgumentListopt* `)` +   `super` `.` *IdentifierName* + +### 4.8.1 Super Calls + +Super calls consist of the keyword `super` followed by an argument list enclosed in parentheses. Super calls are only permitted in constructors of derived classes, as described in section [8.3.2](#8.3.2). + +A super call invokes the constructor of the base class on the instance referenced by `this`. A super call is processed as a function call (section [4.12](#4.12)) using the construct signatures of the base class constructor function type as the initial set of candidate signatures for overload resolution. Type arguments cannot be explicitly specified in a super call. If the base class is a generic class, the type arguments used to process a super call are always those specified in the `extends` clause that references the base class. + +The type of a super call expression is Void. + +The JavaScript code generated for a super call is specified in section [8.6.2](#8.6.2). + +### 4.8.2 Super Property Access + +A super property access consists of the keyword `super` followed by a dot and an identifier. Super property accesses are used to access base class member functions from derived classes and are permitted in contexts where `this` (section [4.2](#4.2)) references a derived class instance or a derived class constructor function. Specifically: + +* In a constructor, instance member function, instance member accessor, or instance member variable initializer where `this` references a derived class instance, a super property access is permitted and must specify a public instance member function of the base class. +* In a static member function or static member accessor where `this` references the constructor function object of a derived class, a super property access is permitted and must specify a public static member function of the base class. + +Super property accesses are not permitted in other contexts, and it is not possible to access other kinds of base class members in a super property access. Note that super property accesses are not permitted inside standard function expressions nested in the above constructs because `this` is of type Any in such function expressions. + +Super property accesses are typically used to access overridden base class member functions from derived class member functions. For an example of this, see section [8.4.2](#8.4.2). + +The JavaScript code generated for a super property access is specified in section [8.6.2](#8.6.2). + +## 4.9 Function Expressions + +Function expressions are extended from JavaScript to optionally include parameter and return type annotations, and a new compact form, called arrow function expressions, is introduced. + +  *FunctionExpression:* *( Modified )* +   `function` *Identifieropt* *CallSignature* `{` *FunctionBody* `}` + +  *AssignmentExpression:* *( Modified )* +   … +   *ArrowFunctionExpression* + +  *ArrowFunctionExpression:* +   *ArrowFormalParameters* `=>` *Block* +   *ArrowFormalParameters* `=>` *AssignmentExpression* + +  *ArrowFormalParameters:* +   *CallSignature* +   *Identifier* + +The terms ***standard function expression*** and ***arrow function expression*** are used to refer to the *FunctionExpression* and *ArrowFunctionExpression* forms respectively. When referring to either, the generic term ***function expression*** is used. + +The type of a function expression is an object type containing a single call signature with parameter and return types inferred from the function expression's signature and body. + +The descriptions of function declarations provided in section [6.1](#6.1) apply to function expressions as well, except that function expressions do not support overloading. + +### 4.9.1 Standard Function Expressions + +Standard function expressions are function expressions written with the `function` keyword. The type of `this` in a standard function expression is the Any type. + +Standard function expressions are transformed to JavaScript in the same manner as function declarations (see section [6.5](#6.5)). + +### 4.9.2 Arrow Function Expressions + +TypeScript supports ***arrow function expressions***, a new feature planned for ECMAScript 6. Arrow function expressions are a compact form of function expressions that omit the `function` keyword and have lexical scoping of `this`. + +An arrow function expression of the form + +```TypeScript +( ... ) => expr +``` + +is exactly equivalent to + +```TypeScript +( ... ) => { return expr ; } +``` + +Furthermore, arrow function expressions of the forms + +```TypeScript +id => { ... } +id => expr +``` + +are exactly equivalent to + +```TypeScript +( id ) => { ... } +( id ) => expr +``` + +Thus, the following examples are all equivalent: + +```TypeScript +(x) => { return Math.sin(x); } +(x) => Math.sin(x) +x => { return Math.sin(x); } +x => Math.sin(x) +``` + +A function expression using the `function` keyword introduces a new dynamically bound `this`, whereas an arrow function expression preserves the `this` of its enclosing context. Arrow function expressions are particularly useful for writing callbacks, which otherwise often have an undefined or unexpected `this`. + +In the example + +```TypeScript +class Messenger { + message = "Hello World"; + start() { + setTimeout(() => alert(this.message), 3000); + } +}; + +var messenger = new Messenger(); +messenger.start(); +``` + +the use of an arrow function expression causes the callback to have the same `this` as the surrounding 'start' method. Writing the callback as a standard function expression it becomes necessary to manually arrange access to the surrounding `this`, for example by copying it into a local variable: + +```TypeScript +class Messenger { + message = "Hello World"; + start() { + var _this = this; + setTimeout(function() { alert(_this.message); }, 3000); + } +}; + +var messenger = new Messenger(); +messenger.start(); +``` + +The TypeScript compiler applies this type of transformation to rewrite arrow function expressions into standard function expressions. + +A construct of the form + +```TypeScript +< T > ( ... ) => { ... } +``` + +could be parsed as an arrow function expression with a type parameter or a type assertion applied to an arrow function with no type parameter. It is resolved as the former, but parentheses can be used to select the latter meaning: + +```TypeScript +< T > ( ( ... ) => { ... } ) +``` + +### 4.9.3 Contextually Typed Function Expressions + +Function expressions with no type parameters and no parameter type annotations (but possibly with optional parameters and default parameter values) are contextually typed in certain circumstances, as described in section [4.19](#4.19). + +When a function expression is contextually typed by a function type *T*, the function expression is processed as if it had explicitly specified parameter type annotations as they exist in *T*. Parameters are matched by position and need not have matching names. If the function expression has fewer parameters than *T*, the additional parameters in *T* are ignored. If the function expression has more parameters than *T*, the additional parameters are all considered to have type Any. + +Furthermore, when a function expression has no return type annotation and is contextually typed by a function type *T*, expressions in contained return statements (section [5.7](#5.7)) are contextually typed by *T*'s return type. + +## 4.10 Property Access + +A property access uses either dot notation or bracket notation. A property access expression is always classified as a reference. + +A dot notation property access of the form + +```TypeScript +object . name +``` + +where *object* is an expression and *name* is an identifier (including, possibly, a reserved word), is used to access the property with the given name on the given object. A dot notation property access is processed as follows at compile-time: + +* If *object* is of type Any, any *name* is permitted and the property access is of type Any. +* Otherwise, if *name* denotes an accessible apparent property (section [3.10.1](#3.10.1)) in the type of *object*, the property access is of the type of that property. Public members are always accessible, but private and protected members of a class have restricted accessibility, as described in [8.2.2](#8.2.2). +* Otherwise, the property access is invalid and a compile-time error occurs. + +A bracket notation property access of the form + +```TypeScript +object [ index ] +``` + +where *object* and *index* are expressions, is used to access the property with the name computed by the index expression on the given object. A bracket notation property access is processed as follows at compile-time: + +* If *index* is a string literal or a numeric literal and *object* has an apparent property (section [3.10.1](#3.10.1)) with the name given by that literal (converted to its string representation in the case of a numeric literal), the property access is of the type of that property. +* Otherwise, if *object* has an apparent numeric index signature and *index* is of type Any, the Number primitive type, or an enum type, the property access is of the type of that index signature. +* Otherwise, if *object* has an apparent string index signature and *index* is of type Any, the String or Number primitive type, or an enum type, the property access is of the type of that index signature. +* Otherwise, if *index* is of type Any, the String or Number primitive type, or an enum type, the property access is of type Any. +* Otherwise, the property access is invalid and a compile-time error occurs. + +The rules above mean that properties are strongly typed when accessed using bracket notation with the literal representation of their name. For example: + +```TypeScript +var type = { + name: "boolean", + primitive: true +}; + +var s = type["name"]; // string +var b = type["primitive"]; // boolean +``` + +Tuple types assign numeric names to each of their elements and elements are therefore strongly typed when accessed using bracket notation with a numeric literal: + +```TypeScript +var data: [string, number] = ["five", 5]; +var s = data[0]; // string +var n = data[1]; // number +``` + +## 4.11 The new Operator + +A `new` operation has one of the following forms: + +```TypeScript +new C +new C ( ... ) +new C < ... > ( ... ) +``` + +where *C* is an expression. The first form is equivalent to supplying an empty argument list. *C* must be of type Any or of an object type with one or more construct or call signatures. The operation is processed as follows at compile-time: + +* If *C* is of type Any, any argument list is permitted and the result of the operation is of type Any. +* If *C* has one or more apparent construct signatures (section [3.10.1](#3.10.1)), the expression is processed in the same manner as a function call, but using the construct signatures as the initial set of candidate signatures for overload resolution. The result type of the function call becomes the result type of the operation. +* If *C* has no apparent construct signatures but one or more apparent call signatures, the expression is processed as a function call. A compile-time error occurs if the result of the function call is not Void. The type of the result of the operation is Any. + +## 4.12 Function Calls + +Function calls are extended from JavaScript to optionally include type arguments. + +  *Arguments:* *( Modified )* +   *TypeArgumentsopt* `(` *ArgumentListopt* `)` + +A function call takes one of the forms + +```TypeScript +func ( ... ) +func < ... > ( ... ) +``` + +where *func* is an expression of a function type or of type Any. The function expression is followed by an optional type argument list (section [3.5.2](#3.5.2)) and an argument list. + +If *func* is of type Any, or of an object type that has no call or construct signatures but is a subtype of the Function interface, the call is an ***untyped function call***. In an untyped function call no type arguments are permitted, argument expressions can be of any type and number, no contextual types are provided for the argument expressions, and the result is always of type Any. + +If *func* has apparent call signatures (section [3.10.1](#3.10.1)) the call is a ***typed function call***. TypeScript employs ***overload resolution*** in typed function calls in order to support functions with multiple call signatures. Furthermore, TypeScript may perform ***type argument inference*** to automatically determine type arguments in generic function calls. + +### 4.12.1 Overload Resolution + +The purpose of overload resolution in a function call is to ensure that at least one signature is applicable, to provide contextual types for the arguments, and to determine the result type of the function call, which could differ between the multiple applicable signatures. Overload resolution has no impact on the run-time behavior of a function call. Since JavaScript doesn't support function overloading, all that matters at run-time is the name of the function. + +The compile-time processing of a typed function call consists of the following steps: + +* First, a list of candidate signatures is constructed from the call signatures in the function type in declaration order. For classes and interfaces, inherited signatures are considered to follow explicitly declared signatures in `extends` clause order. + * A non-generic signature is a candidate when + * the function call has no type arguments, and + * the signature is applicable with respect to the argument list of the function call. + * A generic signature is a candidate in a function call without type arguments when + * type inference (section [4.12.2](#4.12.2)) succeeds for each type parameter, + * once the inferred type arguments are substituted for their associated type parameters, the signature is applicable with respect to the argument list of the function call. + * A generic signature is a candidate in a function call with type arguments when + * The signature has the same number of type parameters as were supplied in the type argument list, + * the type arguments satisfy their constraints, and + * once the type arguments are substituted for their associated type parameters, the signature is applicable with respect to the argument list of the function call. +* If the list of candidate signatures is empty, the function call is an error. +* Otherwise, if the candidate list contains one or more signatures for which the type of each argument expression is a subtype of each corresponding parameter type, the return type of the first of those signatures becomes the return type of the function call. +* Otherwise, the return type of the first signature in the candidate list becomes the return type of the function call. + +A signature is said to be an ***applicable signature*** with respect to an argument list when + +* the number of arguments is not less than the number of required parameters, +* the number of arguments is not greater than the number of parameters, and +* for each argument expression *e* and its corresponding parameter *P,* when *e* is contextually typed (section [4.19](#4.19)) by the type of *P*, no errors ensue and the type of *e* is assignable to (section [3.10.4](#3.10.4)) the type of *P*. + +### 4.12.2 Type Argument Inference + +Given a signature < *T1* , *T2* , … , *Tn* > ( *p1* : *P1* , *p2* : *P2* , … , *pm* : *Pm* ), where each parameter type *P* references zero or more of the type parameters *T*, and an argument list ( *e1* , *e2* , … , *em* ), the task of type argument inference is to find a set of type arguments *A1*…*An* to substitute for *T1*…*Tn* such that the argument list becomes an applicable signature. + +Type argument inference produces a set of candidate types for each type parameter. Given a type parameter *T* and set of candidate types, the actual inferred type argument is determined as follows: + +* If the set of candidate argument types is empty, the inferred type argument for *T* is *T*'s constraint. +* Otherwise, if at least one of the candidate types is a supertype of all of the other candidate types, let *C* denote the first such candidate type. If *C* satisfies *T*'s constraint, the inferred type argument for *T* is *C*. Otherwise, the inferred type argument for *T* is *T*'s constraint. +* Otherwise, if no candidate type is a supertype of all of the other candidate types, type inference has fails and no type argument is inferred for *T*. + +In order to compute candidate types, the argument list is processed as follows: + +* Initially all inferred type arguments are considered ***unfixed*** with an empty set of candidate types. +* Proceeding from left to right, each argument expression *e* is ***inferentially typed*** by its corresponding parameter type *P*, possibly causing some inferred type arguments to become ***fixed***, and candidate type inferences (section [3.10.6](#3.10.6)) are made for unfixed inferred type arguments from the type computed for *e* to *P*. + +The process of inferentially typing an expression *e* by a type *T* is the same as that of contextually typing *e* by *T*, with the following exceptions: + +* Where expressions contained within *e* would be contextually typed, they are instead inferentially typed. +* When a function expression is inferentially typed (section [4.9.3](#4.9.3)) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, the corresponding inferred type arguments to become ***fixed*** and no further candidate inferences are made for them. +* If *e* is an expression of a function type that contains exactly one generic call signature and no other members, and *T* is a function type with exactly one non-generic call signature and no other members, then any inferences made for type parameters referenced by the parameters of *T*'s call signature are ***fixed***, and *e*'s type is changed to a function type with *e*'s call signature instantiated in the context of *T*'s call signature (section [3.10.5](#3.10.5)). + +An example: + +```TypeScript +function choose(x: T, y: T): T { + return Math.random() < 0.5 ? x : y; +} + +var x = choose(10, 20); // Ok, x of type number +var y = choose("Five", 5); // Error +``` + +In the first call to 'choose', two inferences are made from 'number' to 'T', one for each parameter. Thus, 'number' is inferred for 'T' and the call is equivalent to + +```TypeScript +var x = choose(10, 20); +``` + +In the second call to 'choose', an inference is made from type 'string' to 'T' for the first parameter and an inference is made from type 'number' to 'T' for the second parameter. Since neither 'string' nor 'number' is a supertype of the other, type inference fails. That in turn means there are no applicable signatures and the function call is an error. + +In the example + +```TypeScript +function map(a: T[], f: (x: T) => U): U[] { + var result: U[] = []; + for (var i = 0; i < a.length; i++) result.push(f(a[i])); + return result; +} + +var names = ["Peter", "Paul", "Mary"]; +var lengths = map(names, s => s.length); +``` + +inferences for 'T' and 'U' in the call to 'map' are made as follows: For the first parameter, inferences are made from the type 'string[]' (the type of 'names') to the type 'T[]', inferring 'string' for 'T'. For the second parameter, inferential typing of the arrow expression 's => s.length' causes 'T' to become fixed such that the inferred type 'string' can be used for the parameter 's'. The return type of the arrow expression can then be determined, and inferences are made from the type '(s: string) => number' to the type '(x: T) => U', inferring 'number' for 'U'. Thus the call to 'map' is equivalent to + +```TypeScript +var lengths = map(names, s => s.length); +``` + +and the resulting type of 'lengths' is therefore 'number[]'. + +In the example + +```TypeScript +function zip(x: S[], y: T[], combine: (x: S) => (y: T) => U): U[] { + var len = Math.max(x.length, y.length); + var result: U[] = []; + for (var i = 0; i < len; i++) result.push(combine(x[i])(y[i])); + return result; +} + +var names = ["Peter", "Paul", "Mary"]; +var ages = [7, 9, 12]; +var pairs = zip(names, ages, s => n => ({ name: s, age: n })); +``` + +inferences for 'S', 'T' and 'U' in the call to 'zip' are made as follows: Using the first two parameters, inferences of 'string' for 'S' and 'number' for 'T' are made. For the third parameter, inferential typing of the outer arrow expression causes 'S' to become fixed such that the inferred type 'string' can be used for the parameter 's'. When a function expression is inferentially typed, its return expression(s) are also inferentially typed. Thus, the inner arrow function is inferentially typed, causing 'T' to become fixed such that the inferred type 'number' can be used for the parameter 'n'. The return type of the inner arrow function can then be determined, which in turn determines the return type of the function returned from the outer arrow function, and inferences are made from the type '(s: string) => (n: number) => { name: string; age: number }' to the type '(x: S) => (y: T) => R', inferring '{ name: string; age: number }' for 'R'. Thus the call to 'zip' is equivalent to + +```TypeScript +var pairs = zip( + names, ages, s => n => ({ name: s, age: n })); +``` + +and the resulting type of 'pairs' is therefore '{ name: string; age: number }[]'. + +### 4.12.3 Grammar Ambiguities + +The inclusion of type arguments in the *Arguments* production (section [4.12](#4.12)) gives rise to certain ambiguities in the grammar for expressions. For example, the statement + +```TypeScript +f(g(7)); +``` + +could be interpreted as a call to 'f' with two arguments, 'g < A' and 'B > (7)'. Alternatively, it could be interpreted as a call to 'f' with one argument, which is a call to a generic function 'g' with two type arguments and one regular argument. + +The grammar ambiguity is resolved as follows: In a context where one possible interpretation of a sequence of tokens is an *Arguments* production, if the initial sequence of tokens forms a syntactically correct *TypeArguments* production and is followed by a '`(`' token, then the sequence of tokens is processed an *Arguments* production, and any other possible interpretation is discarded. Otherwise, the sequence of tokens is not considered an *Arguments* production. + +This rule means that the call to 'f' above is interpreted as a call with one argument, which is a call to a generic function 'g' with two type arguments and one regular argument. However, the statements + +```TypeScript +f(g < A, B > 7); +f(g < A, B > +(7)); +``` + +are both interpreted as calls to 'f' with two arguments. + +## 4.13 Type Assertions + +TypeScript extends the JavaScript expression grammar with the ability to assert a type for an expression: + +  *UnaryExpression:* *( Modified )* +   … +   `<` *Type* `>` *UnaryExpression* + +A type assertion expression consists of a type enclosed in `<` and `>` followed by a unary expression. Type assertion expressions are purely a compile-time construct. Type assertions are *not* checked at run-time and have no impact on the emitted JavaScript (and therefore no run-time cost). The type and the enclosing `<` and `>` are simply removed from the generated code. + +In a type assertion expression of the form `<` *T* `>` *e*, *e* is contextually typed (section [4.19](#4.19)) by *T* and the resulting type of* e* is required to be assignable to *T*, or *T* is required to be assignable to the widened form of the resulting type of *e*, or otherwise a compile-time error occurs. The type of the result is *T*. + +Type assertions check for assignment compatibility in both directions. Thus, type assertions allow type conversions that *might* be correct, but aren't *known* to be correct. In the example + +```TypeScript +class Shape { ... } + +class Circle extends Shape { ... } + +function createShape(kind: string): Shape { + if (kind === "circle") return new Circle(); + ... +} + +var circle = createShape("circle"); +``` + +the type annotations indicate that the 'createShape' function *might* return a 'Circle' (because 'Circle' is a subtype of 'Shape'), but isn't *known* to do so (because its return type is 'Shape'). Therefore, a type assertion is needed to treat the result as a 'Circle'. + +As mentioned above, type assertions are not checked at run-time and it is up to the programmer to guard against errors, for example using the `instanceof` operator: + +```TypeScript +var shape = createShape(shapeKind); +if (shape instanceof Circle) { + var circle = shape; + ... +} +``` + +## 4.14 Unary Operators + +The subsections that follow specify the compile-time processing rules of the unary operators. In general, if the operand of a unary operator does not meet the stated requirements, a compile-time error occurs and the result of the operation defaults to type Any in further processing. + +### 4.14.1 The ++ and -- operators + +These operators, in prefix or postfix form, require their operand to be of type Any, the Number primitive type, or an enum type, and classified as a reference (section [4.1](#4.1)). They produce a result of the Number primitive type. + +### 4.14.2 The +, –, and ~ operators + +These operators permit their operand to be of any type and produce a result of the Number primitive type. + +The unary + operator can conveniently be used to convert a value of any type to the Number primitive type: + +```TypeScript +function getValue() { ... } + +var n = +getValue(); +``` + +The example above converts the result of 'getValue()' to a number if it isn't a number already. The type inferred for 'n' is the Number primitive type regardless of the return type of 'getValue'. + +### 4.14.3 The ! operator + +The ! operator permits its operand to be of any type and produces a result of the Boolean primitive type. + +Two unary ! operators in sequence can conveniently be used to convert a value of any type to the Boolean primitive type: + +```TypeScript +function getValue() { ... } + +var b = !!getValue(); +``` + +The example above converts the result of 'getValue()' to a Boolean if it isn't a Boolean already. The type inferred for 'b' is the Boolean primitive type regardless of the return type of 'getValue'. + +### 4.14.4 The delete Operator + +The 'delete' operator takes an operand of any type and produces a result of the Boolean primitive type. + +### 4.14.5 The void Operator + +The 'void' operator takes an operand of any type and produces the value 'undefined'. The type of the result is the Undefined type ([3.2.6](#3.2.6)). + +### 4.14.6 The typeof Operator + +The 'typeof' operator takes an operand of any type and produces a value of the String primitive type. In positions where a type is expected, 'typeof' can also be used in a type query (section [3.7.9](#3.7.9)) to produce the type of an expression. + +```TypeScript +var x = 5; +var y = typeof x; // Use in an expression +var z: typeof x; // Use in a type query +``` + +In the example above, 'x' is of type 'number', 'y' is of type 'string' because when used in an expression, 'typeof' produces a value of type string (in this case the string "number"), and 'z' is of type 'number' because when used in a type query, 'typeof' obtains the type of an expression. + +## 4.15 Binary Operators + +The subsections that follow specify the compile-time processing rules of the binary operators. In general, if the operands of a binary operator do not meet the stated requirements, a compile-time error occurs and the result of the operation defaults to type any in further processing. Tables that summarize the compile-time processing rules for operands of the Any type, the Boolean, Number, and String primitive types, and all other types (the Other column in the tables) are provided. + +### 4.15.1 The *, /, %, –, <<, >>, >>>, &, ^, and | operators + +These operators require their operands to be of type Any, the Number primitive type, or an enum type. Operands of an enum type are treated as having the primitive type Number. If one operand is the `null` or `undefined` value, it is treated as having the type of the other operand. The result is always of the Number primitive type. + +||Any|Boolean|Number|String|Other| +|:---:|:---:|:---:|:---:|:---:|:---:| +|Any|Number||Number||| +|Boolean|||||| +|Number|Number||Number||| +|String|||||| +|Other|||||| + +### 4.15.2 The + operator + +The binary + operator requires both operands to be of the Number primitive type or an enum type, or at least one of the operands to be of type Any or the String primitive type. Operands of an enum type are treated as having the primitive type Number. If one operand is the `null` or `undefined` value, it is treated as having the type of the other operand. If both operands are of the Number primitive type, the result is of the Number primitive type. If one or both operands are of the String primitive type, the result is of the String primitive type. Otherwise, the result is of type Any. + +||Any|Boolean|Number|String|Other| +|:---:|:---:|:---:|:---:|:---:|:---:| +|Any|Any|Any|Any|String|Any| +|Boolean|Any|||String|| +|Number|Any||Number|String|| +|String|String|String|String|String|String| +|Other|Any|||String|| + +A value of any type can converted to the String primitive type by adding an empty string: + +```TypeScript +function getValue() { ... } + +var s = getValue() + ""; +``` + +The example above converts the result of 'getValue()' to a string if it isn't a string already. The type inferred for 's' is the String primitive type regardless of the return type of 'getValue'. + +### 4.15.3 The <, >, <=, >=, ==, !=, ===, and !== operators + +These operators require one or both of the operand types to be assignable to the other. The result is always of the Boolean primitive type. + +||Any|Boolean|Number|String|Other| +|:---:|:---:|:---:|:---:|:---:|:---:| +|Any|Boolean|Boolean|Boolean|Boolean|Boolean| +|Boolean|Boolean|Boolean|||| +|Number|Boolean||Boolean||| +|String|Boolean|||Boolean|| +|Other|Boolean||||Boolean| + +### 4.15.4 The instanceof operator + +The `instanceof` operator requires the left operand to be of type Any, an object type, or a type parameter type, and the right operand to be of type Any or a subtype of the 'Function' interface type. The result is always of the Boolean primitive type. + +Note that object types containing one or more call or construct signatures are automatically subtypes of the 'Function' interface type, as described in section [3.3](#3.3). + +### 4.15.5 The in operator + +The `in` operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, and the right operand to be of type Any, an object type, or a type parameter type. The result is always of the Boolean primitive type. + +### 4.15.6 The && operator + +The && operator permits the operands to be of any type and produces a result of the same type as the second operand. + +||Any|Boolean|Number|String|Other| +|:---:|:---:|:---:|:---:|:---:|:---:| +|Any|Any|Boolean|Number|String|Other| +|Boolean|Any|Boolean|Number|String|Other| +|Number|Any|Boolean|Number|String|Other| +|String|Any|Boolean|Number|String|Other| +|Other|Any|Boolean|Number|String|Other| + +### 4.15.7 The || operator + +The || operator permits the operands to be of any type. + +If the || expression is contextually typed (section [4.19](#4.19)), the operands are contextually typed by the same type. Otherwise, the left operand is not contextually typed and the right operand is contextually typed by the type of the left operand. + +The type of the result is the union type of the two operand types. + +||Any|Boolean|Number|String|Other| +|:---:|:---:|:---:|:---:|:---:|:---:| +|Any|Any|Any|Any|Any|Any| +|Boolean|Any|Boolean|N | B|S | B|B | O| +|Number|Any|N | B|Number|S | N|N | O| +|String|Any|S | B|S | N|String|S | O| +|Other|Any|B | O|N | O|S | O|Other| + +## 4.16 The Conditional Operator + +In a conditional expression of the form + +```TypeScript +test ? expr1 : expr2 +``` + +the *test* expression may be of any type. + +If the conditional expression is contextually typed (section [4.19](#4.19)), *expr1* and *expr2* are contextually typed by the same type. Otherwise, *expr1* and *expr2* are not contextually typed. + +The type of the result is the union type of the types of *expr1* and *expr2*. + +## 4.17 Assignment Operators + +An assignment of the form + +```TypeScript +v = expr +``` + +requires *v* to be classified as a reference (section [4.1](#4.1)). The *expr* expression is contextually typed (section [4.19](#4.19)) by the type of *v*, and the type of *expr* must be assignable to (section [3.10.4](#3.10.4)) the type of *v*, or otherwise a compile-time error occurs. The result is a value with the type of *expr*. + +A compound assignment of the form + +```TypeScript +v ??= expr +``` + +where ??= is one of the compound assignment operators + +```TypeScript +*= /= %= += -= <<= >>= >>>= &= ^= |= +``` + +is subject to the same requirements, and produces a value of the same type, as the corresponding non-compound operation. A compound assignment furthermore requires *v* to be classified as a reference (section [4.1](#4.1)) and the type of the non-compound operation to be assignable to the type of *v*. + +## 4.18 The Comma Operator + +The comma operator permits the operands to be of any type and produces a result that is of the same type as the second operand. + +## 4.19 Contextually Typed Expressions + +In certain situations, parameter and return types of function expressions are automatically inferred from the contexts in which the function expressions occur. For example, given the declaration + +```TypeScript +var f: (s: string) => string; +``` + +the assignment + +```TypeScript +f = function(s) { return s.toLowerCase(); } +``` + +infers the type of the 's' parameter to be the String primitive type even though there is no type annotation to that effect. The function expression is said to be ***contextually typed*** by the variable to which it is being assigned. Contextual typing occurs in the following situations: + +* In variable, parameter, and member declarations with a type annotation and an initializer, the initializer expression is contextually typed by the type of the variable, parameter, or property. +* In return statements, if the containing function includes a return type annotation, return expressions are contextually typed by that return type. Otherwise, if the containing function is contextually typed by a type *T*, return expressions are contextually typed by *T*'s return type. +* In typed function calls, argument expressions are contextually typed by their parameter types. +* In type assertions, the expression is contextually typed by the indicated type. +* In || operator expressions without a contextual type, the right hand expression is contextually typed by the type of the left hand expression. +* In assignment expressions, the right hand expression is contextually typed by the type of the left hand expression. +* In contextually typed object literals, property assignments are contextually typed by their property types. +* In contextually typed array literals, element expressions are contextually typed by the array element type. +* In contextually typed || operator expressions, the operands are contextually typed as well. +* In contextually typed conditional operator expressions, the operands are contextually typed as well. + +Contextual typing of an expression *e* by a type *T* proceeds as follows: + +* If *e* is an *ObjectLiteral* and *T* is an object type, *e* is processed with the contextual type *T*, as described in section [4.5](#4.5). +* If *e* is an *ArrayLiteral* and *T* is an object type with a numeric index signature, *e* is processed with the contextual type *T*, as described in section [4.6](#4.6). +* If *e* is a *FunctionExpression* or *ArrowFunctionExpression* with no type parameters and no parameter type annotations, *T* is a function type with exactly one call signature and *T*'s call signature is non-generic, then any inferences made for type parameters referenced by the parameters of *T*'s call signature are fixed (section [4.12.2](#4.12.2)) and *e* is processed with the contextual type *T*, as described in section [4.9.3](#4.9.3). +* If *e* is a || operator expression and *T* is an object type, *e* is processed with the contextual type *T*, as described in section [4.15.7](#4.15.7). +* If *e* is a conditional operator expression and *T* is an object type, *e* is processed with the contextual type *T*, as described in section [4.16](#4.16). +* Otherwise, *e* is processed without a contextual type. + +The rules above require expressions be of the exact syntactic forms specified in order to be processed as contextually typed constructs. For example, given the declaration of the variable 'f' above, the assignment + +```TypeScript +f = s => s.toLowerCase(); +``` + +causes the function expression to be contextually typed, inferring the String primitive type for 's'. However, simply enclosing the construct in parentheses + +```TypeScript +f = (s => s.toLowerCase()); +``` + +causes the function expression to be processed without a contextual type, now inferring 's' and the result of the function to be of type Any as no type annotations are present. + +In the following example + +```TypeScript +interface EventObject { + x: number; + y: number; +} + +interface EventHandlers { + mousedown?: (event: EventObject) => void; + mouseup?: (event: EventObject) => void; + mousemove?: (event: EventObject) => void; +} + +function setEventHandlers(handlers: EventHandlers) { ... } + +setEventHandlers({ + mousedown: e => { startTracking(e.x, e.y); }, + mouseup: e => { endTracking(); } +}); +``` + +the object literal passed to 'setEventHandlers' is contextually typed to the 'EventHandlers' type. This causes the two property assignments to be contextually typed to the unnamed function type '(event: EventObject) => void', which in turn causes the 'e' parameters in the arrow function expressions to automatically be typed as 'EventObject'. + +## 4.20 Type Guards + +Type guards are particular expression patterns involving the 'typeof' and 'instanceof' operators that cause the types of variables or parameters to be ***narrowed*** to more specific types. For example, in the code below, knowledge of the static type of 'x' in combination with a 'typeof' check makes it safe to narrow the type of 'x' to string in the first branch of the 'if' statement and number in the second branch of the 'if' statement. + +```TypeScript +function foo(x: number | string) { + if (typeof x === "string") { + return x.length; // x has type string here + } + else { + return x + 1; // x has type number here + } +} +``` + +The type of a variable or parameter is narrowed in the following situations: + +* 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*, provided the true branch statement contains no assignments to the variable or parameter. +* In the false branch statement of an 'if' statement, the type of a variable or parameter is *narrowed* by any type guard in the 'if' condition *when false*, provided the false branch statement contains no assignments to the variable or parameter. +* In the true expression of a conditional expression, the type of a variable or parameter is *narrowed* by any type guard in the condition *when true*, provided the true expression contains no assignments to the variable or parameter. +* In the false expression of a conditional expression, the type of a variable or parameter is *narrowed* by any type guard in the condition *when false*, provided the false expression contains no assignments to the variable or parameter. +* In the right operand of a && operation, the type of a variable or parameter is *narrowed* by any type guard in the left operand *when true*, provided the right operand contains no assignments to the variable or parameter. +* In the right operand of a || operation, the type of a variable or parameter is *narrowed* by any type guard in the left operand *when false*, provided the right operand contains no assignments to the variable or parameter. + +A type guard is simply an expression that follows a particular pattern. The process of narrowing the type of a variable *x* by a type guard *when true* or *when false* depends on the type guard as follows: + +* A type guard of the form `x instanceof C`, where *C* is of a subtype of the global type 'Function' and *C* has a property named 'prototype' + * *when true*, narrows the type of *x* to the type of the 'prototype' property in *C* provided it is a subtype of the type of *x*, or + * *when false*, has no effect on the type of *x*. +* A type guard of the form `typeof x === s`, where *s* is a string literal with the value 'string', 'number', or 'boolean', + * *when true*, narrows the type of *x* to the given primitive type, or + * *when false*, removes the primitive type from the type of *x*. +* A type guard of the form `typeof x === s`, where *s* is a string literal with any value but 'string', 'number', or 'boolean', + * *when true*, removes the primitive types string, number, and boolean from the type of *x*, or + * *when false*, has no effect on the type of *x*. +* A type guard of the form `typeof x !== s`, where *s* is a string literal, + * *when true*, narrows the type of x by `typeof x === s` *when false*, or + * *when false*, narrows the type of x by `typeof x === s` *when true*. +* A type guard of the form `!expr` + * *when true*, narrows the type of *x* by *expr* *when false*, or + * *when false*, narrows the type of *x* by *expr* *when true*. +* A type guard of the form `expr1 && expr2` + * *when true*, narrows the type of *x* by *expr1* *when true* and then by *expr2* *when true*, or + * *when false*, narrows the type of *x* to *T1* | *T2*, where *T1* is the type of *x* narrowed by *expr1* *when false*, and *T2* is the type of *x* narrowed by *expr1* *when true* and then by *expr2* *when false*. +* A type guard of the form `expr1 || expr2` + * *when true*, narrows the type of *x* to *T1* | *T2*, where *T1* is the type of *x* narrowed by *expr1* *when true*, and *T2* is the type of *x* narrowed by *expr1* *when false* and then by *expr2* *when true*, or + * *when false*, narrows the type of *x* by *expr1* *when false* and then by *expr2* *when false*. +* A type guard of any other form has no effect on the type of *x*. + +A primitive type *P* is removed from a type *T* as follows: + +* If *T* is a union type *P* | *T1* | *T2* | … | *Tn*, the result is the type *T1* | *T2* | … | *Tn*. +* Otherwise, the result is *T*. + +Note that type guards affect types of variables and parameters only and have no effect on members of objects such as properties. Also note that it is possible to defeat a type guard by calling a function that changes the type of the guarded variable. + +In the example + +```TypeScript +function isLongString(obj: any) { + return typeof obj === "string" && obj.length > 100; +} +``` + +the 'obj' parameter has type string in the right operand of the && operator. + +In the example + +```TypeScript +function f(x: string | number | boolean) { + if (typeof x === "string" || typeof x === "number") { + var y = x; // Type of y is string | number + } + else { + var z = x; // Type of z is boolean + } +} +``` + +the type of 'x' is string | number | boolean in left operand of the || operator, number | boolean in the right operand of the || operator, string | number in the first branch of the 'if' statement, and boolean in the second branch of the 'if' statement. + +In the example + +```TypeScript +function processData(data: string | { (): string }) { + var d = typeof data !== "string" ? data() : data; + // Process string in d +} +``` + +the inferred type of 'd' is string. + +In the example + +```TypeScript +class NamedItem { + name: string; +} + +function getName(obj: any) { + return obj instanceof NamedItem ? obj.name : "unknown"; +} +``` + +the inferred type of the 'getName' function is string. + +
+ +#
5 Statements + +This chapter describes the static type checking TypeScript provides for JavaScript statements. TypeScript itself does not introduce any new statement constructs. + +## 5.1 Variable Statements + +Variable statements are extended to include optional type annotations. + +  *VariableDeclaration:* *( Modified )* +   *Identifier* *TypeAnnotationopt* *Initialiseropt* + +  *VariableDeclarationNoIn:* *( Modified )* +   *Identifier* *TypeAnnotationopt* *InitialiserNoInopt* + +  *TypeAnnotation:* +   `:` *Type* + +A variable declaration introduces a variable with the given name in the containing declaration space. The type associated with a variable is determined as follows: + +* If the declaration includes a type annotation, the stated type becomes the type of the variable. If an initializer is present, the initializer expression is contextually typed (section [4.19](#4.19)) by the stated type and must be assignable to the stated type, or otherwise a compile-time error occurs. +* If the declaration includes an initializer but no type annotation, and if the initializer doesn't directly or indirectly reference the variable, the widened type (section [3.11](#3.11)) of the initializer expression becomes the type of the variable. If the initializer directly or indirectly references the variable, the type of the variable becomes the Any type. +* If the declaration includes neither a type annotation nor an initializer, the type of the variable becomes the Any type. + +Multiple declarations for the same variable name in the same declaration space are permitted, provided that each declaration associates the same type with the variable. + +Below are some examples of variable declarations and their associated types. + +```TypeScript +var a; // any +var b: number; // number +var c = 1; // number +var d = { x: 1, y: "hello" }; // { x: number; y: string; } +var e: any = "test"; // any +``` + +The following is permitted because all declarations of the single variable 'x' associate the same type (Number) with 'x'. + +```TypeScript +var x = 1; +var x: number; +if (x == 1) { + var x = 2; +} +``` + +In the following example, all five variables are of the same type, '{ x: number; y: number; }'. + +```TypeScript +interface Point { x: number; y: number; } + +var a = { x: 0, y: undefined }; +var b: Point = { x: 0, y: undefined }; +var c = { x: 0, y: undefined }; +var d: { x: number; y: number; } = { x: 0, y: undefined }; +var e = <{ x: number; y: number; }> { x: 0, y: undefined }; +``` + +## 5.2 If, Do, and While Statements + +Expressions controlling 'if', 'do', and 'while' statements can be of any type (and not just type Boolean). + +## 5.3 For Statements + +Variable declarations in 'for' statements are extended in the same manner as variable declarations in variable statements (section [5.1](#5.1)). + +## 5.4 For-In Statements + +In a 'for-in' statement of the form + +```TypeScript +for (v in expr) statement +``` + +*v* must be an expression classified as a reference of type Any or the String primitive type, and *expr* must be an expression of type Any, an object type, or a type parameter type. + +In a 'for-in' statement of the form + +```TypeScript +for (var v in expr) statement +``` + +*v* must be a variable declaration without a type annotation that declares a variable of type Any, and *expr* must be an expression of type Any, an object type, or a type parameter type. + +## 5.5 Continue Statements + +A 'continue' statement is required to be nested, directly or indirectly (but not crossing function boundaries), within an iteration ('do', 'while', 'for', or 'for-in') statement. When a 'continue' statement includes a target label, that target label must appear in the label set of an enclosing (but not crossing function boundaries) iteration statement. + +## 5.6 Break Statements + +A 'break' statement is required to be nested, directly or indirectly (but not crossing function boundaries), within an iteration ('do', 'while', 'for', or 'for-in') or 'switch' statement. When a 'break' statement includes a target label, that target label must appear in the label set of an enclosing (but not crossing function boundaries) statement. + +## 5.7 Return Statements + +It is an error for a 'return' statement to occur outside a function body. Specifically, 'return' statements are not permitted at the global level or in module bodies. + +A 'return' statement without an expression returns the value 'undefined' and is permitted in the body of any function, regardless of the return type of the function. + +When a 'return' statement includes an expression, if the containing function includes a return type annotation, the return expression is contextually typed (section [4.19](#4.19)) by that return type and must be of a type that is assignable to the return type. Otherwise, if the containing function is contextually typed by a type *T*, *Expr* is contextually typed by *T*'s return type. + +In a function implementation without a return type annotation, the return type is inferred from the 'return' statements in the function body, as described in section [6.3](#6.3). + +In the example + +```TypeScript +function f(): (x: string) => number { + return s => s.length; +} +``` + +the arrow expression in the 'return' statement is contextually typed by the return type of 'f', thus giving type 'string' to 's'. + +## 5.8 With Statements + +Use of the 'with' statement in TypeScript is an error, as is the case in ECMAScript 5's strict mode. Furthermore, within the body of a 'with' statement, TypeScript considers every identifier occurring in an expression (section [4.3](#4.3)) to be of the Any type regardless of its declared type. Because the 'with' statement puts a statically unknown set of identifiers in scope in front of those that are statically known, it is not possible to meaningfully assign a static type to any identifier. + +## 5.9 Switch Statements + +In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from (section [3.10.4](#3.10.4)) the type of the 'switch' expression. + +## 5.10 Throw Statements + +The expression specified in a 'throw' statement can be of any type. + +## 5.11 Try Statements + +The variable introduced by a 'catch' clause of a 'try' statement is always of type Any. It is not possible to include a type annotation in a 'catch' clause. + +
+ +#
6 Functions + +TypeScript extends JavaScript functions to include type parameters, parameter and return type annotations, overloads, default parameter values, and rest parameters. + +## 6.1 Function Declarations + +Function declarations consist of an optional set of function overloads followed by an actual function implementation. + +  *FunctionDeclaration:* *( Modified )* +   *FunctionOverloadsopt* *FunctionImplementation* + +  *FunctionOverloads:* +   *FunctionOverload* +   *FunctionOverloads* *FunctionOverload* + +  *FunctionOverload:* +   `function` *Identifier* *CallSignature* `;` + +  *FunctionImplementation:* +   `function` *Identifier* *CallSignature* `{` *FunctionBody* `}` + +A function declaration introduces a function with the given name in the containing declaration space. Function overloads, if present, must specify the same name as the function implementation. If a function declaration includes overloads, the overloads determine the call signatures of the type given to the function object and the function implementation signature must be assignable to that type. Otherwise, the function implementation itself determines the call signature. Function overloads have no other effect on a function declaration. + +## 6.2 Function Overloads + +Function overloads allow a more accurate specification of the patterns of invocation supported by a function than is possible with a single signature. The compile-time processing of a call to an overloaded function chooses the best candidate overload for the particular arguments and the return type of that overload becomes the result type the function call expression. Thus, using overloads it is possible to statically describe the manner in which a function's return type varies based on its arguments. Overload resolution in function calls is described further in section [4.12](#4.12). + +Function overloads are purely a compile-time construct. They have no impact on the emitted JavaScript and thus no run-time cost. + +The parameter list of a function overload cannot specify default values for parameters. In other words, an overload may use only the `?` form when specifying optional parameters. + +The following is an example of a function with overloads. + +```TypeScript +function attr(name: string): string; +function attr(name: string, value: string): Accessor; +function attr(map: any): Accessor; +function attr(nameOrMap: any, value?: string): any { + if (nameOrMap && typeof nameOrMap === "string") { + // handle string case + } + else { + // handle map case + } +} +``` + +Note that each overload and the final implementation specify the same identifier. The type of the local variable 'attr' introduced by this declaration is + +```TypeScript +var attr: { + (name: string): string; + (name: string, value: string): Accessor; + (map: any): Accessor; +}; +``` + +Note that the signature of the actual function implementation is not included in the type. + +## 6.3 Function Implementations + +A function implementation without a return type annotation is said to be an ***implicitly typed function***. The return type of an implicitly typed function *f* is inferred from its function body as follows: + +* If there are no return statements with expressions in *f*'s function body, the inferred return type is Void. +* Otherwise, if *f*'s function body directly references *f* or references any implicitly typed functions that through this same analysis reference *f*, the inferred return type is Any. +* Otherwise, if *f* is a contextually typed function expression (section [4.9.3](#4.9.3)), the inferred return type is the union type (section [3.4](#3.4)) of the types of the return statement expressions in the function body, ignoring return statements with no expressions. +* Otherwise, the inferred return type is the first of the types of the return statement expressions in the function body that is a supertype (section [3.10.3](#3.10.3)) of each of the others, ignoring return statements with no expressions. A compile-time error occurs if no return statement expression has a type that is a supertype of each of the others. + +In the example + +```TypeScript +function f(x: number) { + if (x <= 0) return x; + return g(x); +} + +function g(x: number) { + return f(x - 1); +} +``` + +the inferred return type for 'f' and 'g' is Any because the functions reference themselves through a cycle with no return type annotations. Adding an explicit return type 'number' to either breaks the cycle and causes the return type 'number' to be inferred for the other. + +An explicitly typed function whose return type isn't the Void or the Any type must have at least one return statement somewhere in its body. An exception to this rule is if the function implementation consists of a single 'throw' statement. + +The type of 'this' in a function implementation is the Any type. + +In the signature of a function implementation, a parameter can be marked optional by following it with an initializer. When a parameter declaration includes both a type annotation and an initializer, the initializer expression is contextually typed (section [4.19](#4.19)) by the stated type and must be assignable to the stated type, or otherwise a compile-time error occurs. When a parameter declaration has no type annotation but includes an initializer, the type of the parameter is the widened form (section [3.11](#3.11)) of the type of the initializer expression. + +Initializer expressions are evaluated in the scope of the function body but are not permitted to reference local variables and are only permitted to access parameters that are declared to the left of the parameter they initialize, unless the parameter reference occurs in a nested function expression. + +For each parameter with an initializer, a statement that substitutes the default value for an omitted argument is included in the generated JavaScript, as described in section [6.5](#6.5). The example + +```TypeScript +function strange(x: number, y = x * 2, z = x + y) { + return z; +} +``` + +generates JavaScript that is equivalent to + +```TypeScript +function strange(x, y, z) { + if (y === void 0) { y = x * 2; } + if (z === void 0) { z = x + y; } + return z; +} +``` + +In the example + +```TypeScript +var x = 1; +function f(a = x) { + var x = "hello"; +} +``` + +the local variable 'x' is in scope in the parameter initializer (thus hiding the outer 'x'), but it is an error to reference it because it will always be uninitialized at the time the parameter initializer is evaluated. + +## 6.4 Generic Functions + +A function implementation may include type parameters in its signature (section [3.8.2.1](#3.8.2.1)) and is then called a ***generic function***. Type parameters provide a mechanism for expressing relationships between parameter and return types in call operations. Type parameters have no run-time representation—they are purely a compile-time construct. + +Type parameters declared in the signature of a function implementation are in scope in the signature and body of that function implementation. + +The following is an example of a generic function: + +```TypeScript +interface Comparable { + localeCompare(other: any): number; +} + +function compare(x: T, y: T): number { + if (x == null) return y == null ? 0 : -1; + if (y == null) return 1; + return x.localeCompare(y); +} +``` + +Note that the 'x' and 'y' parameters are known to be subtypes of the constraint 'Comparable' and therefore have a 'compareTo' member. This is described further in section [3.5.1](#3.5.1). + +The type arguments of a call to a generic function may be explicitly specified in a call operation or may, when possible, be inferred (section [4.12.2](#4.12.2)) from the types of the regular arguments in the call. In the example + +```TypeScript +class Person { + name: string; + localeCompare(other: Person) { + return compare(this.name, other.name); + } +} +``` + +the type argument to 'compare' is automatically inferred to be the String type because the two arguments are strings. + +## 6.5 Code Generation + +A function declaration generates JavaScript code that is equivalent to: + +```TypeScript +function () { + + +} +``` + +*FunctionName* is the name of the function (or nothing in the case of a function expression). + +*FunctionParameters* is a comma separated list of the function's parameter names. + +*DefaultValueAssignments* is a sequence of default property value assignments, one for each parameter with a default value, in the order they are declared, of the form + +```TypeScript +if ( === void 0) { = ; } +``` + +where *Parameter* is the parameter name and *Default* is the default value expression. + +*FunctionStatements* is the code generated for the statements specified in the function body. + +
+ +#
7 Interfaces + +Interfaces provide the ability to name and parameterize object types and to compose existing named object types into new ones. + +Interfaces have no run-time representation—they are purely a compile-time construct. Interfaces are particularly useful for documenting and validating the required shape of properties, objects passed as parameters, and objects returned from functions. + +Because TypeScript has a structural type system, an interface type with a particular set of members is considered identical to, and can be substituted for, another interface type or object type literal with an identical set of members (see section [3.10.2](#3.10.2)). + +Class declarations may reference interfaces in their implements clause to validate that they provide an implementation of the interfaces. + +## 7.1 Interface Declarations + +An interface declaration declares a new named type (section [3.6](#3.6)) by introducing a type name in the containing module. + +  *InterfaceDeclaration:* +   `interface` *Identifier* *TypeParametersopt* *InterfaceExtendsClauseopt* *ObjectType* + +  *InterfaceExtendsClause:* +   `extends` *ClassOrInterfaceTypeList* + +  *ClassOrInterfaceTypeList:* +   *ClassOrInterfaceType* +   *ClassOrInterfaceTypeList* `,` *ClassOrInterfaceType* + +  *ClassOrInterfaceType:* +   *TypeReference* + +The *Identifier* of an interface declaration may not be one of the predefined type names (section [3.7.1](#3.7.1)). + +An interface may optionally have type parameters (section [3.5.1](#3.5.1)) that serve as placeholders for actual types to be provided when the interface is referenced in type references. An interface with type parameters is called a ***generic interface***. The type parameters of a generic interface declaration are in scope in the entire declaration and may be referenced in the *InterfaceExtendsClause* and *ObjectType* body. + +An interface can inherit from zero or more ***base types*** which are specified in the *InterfaceExtendsClause*. The base types must be type references to class or interface types. + +An interface has the members specified in the *ObjectType* of its declaration and furthermore inherits all base type members that aren't hidden by declarations in the interface: + +* A property declaration hides a public base type property with the same name. +* A string index signature declaration hides a base type string index signature. +* A numeric index signature declaration hides a base type numeric index signature. + +The following constraints must be satisfied by an interface declaration or otherwise a compile-time error occurs: + +* An interface declaration may not, directly or indirectly, specify a base type that originates in the same declaration. In other words an interface cannot, directly or indirectly, be a base type of itself, regardless of type arguments. +* An interface cannot declare a property with the same name as an inherited private or protected property. +* Inherited properties with the same name must be identical (section [3.10.2](#3.10.2)). +* All properties of the interface must satisfy the constraints implied by the index signatures of the interface as specified in section [3.8.4](#3.8.4). +* The instance type (section [3.6.1](#3.6.1)) of the declared interface must be assignable (section [3.10.4](#3.10.4)) to each of the base type references. + +An interface is permitted to inherit identical members from multiple base types and will in that case only contain one occurrence of each particular member. + +Below is an example of two interfaces that contain properties with the same name but different types: + +```TypeScript +interface Mover { + move(): void; + getStatus(): { speed: number; }; +} + +interface Shaker { + shake(): void; + getStatus(): { frequency: number; }; +} +``` + +An interface that extends 'Mover' and 'Shaker' must declare a new 'getStatus' property as it would otherwise inherit two 'getStatus' properties with different types. The new 'getStatus' property must be declared such that the resulting 'MoverShaker' is a subtype of both 'Mover' and 'Shaker': + +```TypeScript +interface MoverShaker extends Mover, Shaker { + getStatus(): { speed: number; frequency: number; }; +} +``` + +Since function and constructor types are just object types containing call and construct signatures, interfaces can be used to declare named function and constructor types. For example: + +```TypeScript +interface StringComparer { (a: string, b: string): number; } +``` + +This declares type 'StringComparer' to be a function type taking two strings and returning a number. + +## 7.2 Declaration Merging + +Interfaces are "open-ended" and interface declarations with the same qualified name relative to a common root (as defined in section [2.3](#2.3)) contribute to a single interface. + +When a generic interface has multiple declarations, all declarations must have identical type parameter lists, i.e. identical type parameter names with identical constraints in identical order. + +In an interface with multiple declarations, the `extends` clauses are merged into a single set of base types and the bodies of the interface declarations are merged into a single object type. Declaration merging produces a declaration order that corresponds to *prepending* the members of each interface declaration, in the order the members are written, to the combined list of members in the order of the interface declarations. Thus, members declared in the last interface declaration will appear first in the declaration order of the merged type. + +For example, a sequence of declarations in this order: + +```TypeScript +interface Document { + createElement(tagName: any): Element; +} + +interface Document { + createElement(tagName: string): HTMLElement; +} + +interface Document { + createElement(tagName: "div"): HTMLDivElement; + createElement(tagName: "span"): HTMLSpanElement; + createElement(tagName: "canvas"): HTMLCanvasElement; +} +``` + +is equivalent to the following single declaration: + +```TypeScript +interface Document { + createElement(tagName: "div"): HTMLDivElement; + createElement(tagName: "span"): HTMLSpanElement; + createElement(tagName: "canvas"): HTMLCanvasElement; + createElement(tagName: string): HTMLElement; + createElement(tagName: any): Element; +} +``` + +Note that the members of the last interface declaration appear first in the merged declaration. Also note that the relative order of members declared in the same interface body is preserved. + +## 7.3 Interfaces Extending Classes + +When an interface type extends a class type it inherits the members of the class but not their implementations. It is as if the interface had declared all of the members of the class without providing an implementation. Interfaces inherit even the private and protected members of a base class. When a class containing private or protected members is the base type of an interface type, that interface type can only be implemented by that class or a descendant class. For example: + +```TypeScript +class Control { + private state: any; +} + +interface SelectableControl extends Control { + select(): void; +} + +class Button extends Control { + select() { } +} + +class TextBox extends Control { + select() { } +} + +class Image extends Control { +} + +class Location { + select() { } +} +``` + +In the above example, 'SelectableControl' contains all of the members of 'Control', including the private 'state' property. Since 'state' is a private member it is only possible for descendants of 'Control' to implement 'SelectableControl'. This is because only descendants of 'Control' will have a 'state' private member that originates in the same declaration, which is a requirement for private members to be compatible (section [0](#0)). + +Within the 'Control' class it is possible to access the 'state' private member through an instance of 'SelectableControl'. Effectively, a 'SelectableControl' acts like a 'Control' that is known to have a 'select' method. The 'Button' and 'TextBox' classes are subtypes of 'SelectableControl' (because they both inherit from 'Control' and have a 'select' method), but the 'Image' and 'Location' classes are not. + +## 7.4 Dynamic Type Checks + +TypeScript does not provide a direct mechanism for dynamically testing whether an object implements a particular interface. Instead, TypeScript code can use the JavaScript technique of checking whether an appropriate set of members are present on the object. For example, given the declarations in section [7.1](#7.1), the following is a dynamic check for the 'MoverShaker' interface: + +```TypeScript +var obj: any = getSomeObject(); +if (obj && obj.move && obj.shake && obj.getStatus) { + var moverShaker = obj; + ... +} +``` + +If such a check is used often it can be abstracted into a function: + +```TypeScript +function asMoverShaker(obj: any): MoverShaker { + return obj && obj.move && obj.shake && obj.getStatus ? obj : null; +} +``` + +
+ +#
8 Classes + +TypeScript supports classes that are closely aligned with those proposed for ECMAScript 6, and includes extensions for instance and static member declarations and properties declared and initialized from constructor parameters. + +*NOTE: TypeScript currently doesn't support class expressions or nested class declarations from the ECMAScript 6 proposal*. + +## 8.1 Class Declarations + +Class declarations introduce named types and provide implementations of those types. Classes support inheritance, allowing derived classes to extend and specialize base classes. + +  *ClassDeclaration:* +   `class` *Identifier* *TypeParametersopt* *ClassHeritage* `{` *ClassBody* `}` + +A *ClassDeclaration* declares a ***class type*** and a ***constructor function***, both with the name given by *Identifier*, in the containing module. The class type is created from the instance members declared in the class body and the instance members inherited from the base class. The constructor function is created from the constructor declaration, the static member declarations in the class body, and the static members inherited from the base class. The constructor function initializes and returns an instance of the class type. + +The *Identifier* of a class declaration may not be one of the predefined type names (section [3.7.1](#3.7.1)). + +A class may optionally have type parameters (section [3.5.1](#3.5.1)) that serve as placeholders for actual types to be provided when the class is referenced in type references. A class with type parameters is called a ***generic class***. The type parameters of a generic class declaration are in scope in the entire declaration and may be referenced in the *ClassHeritage* and *ClassBody*. + +The following example introduces both a named type called 'Point' (the class type) and a member called 'Point' (the constructor function) in the containing module. + +```TypeScript +class Point { + constructor(public x: number, public y: number) { } + public length() { return Math.sqrt(this.x * this.x + this.y * this.y); } + static origin = new Point(0, 0); +} +``` + +The 'Point' type is exactly equivalent to + +```TypeScript +interface Point { + x: number; + y: number; + length(): number; +} +``` + +The 'Point' member is a constructor function whose type corresponds to the declaration + +```TypeScript +var Point: { + new(x: number, y: number): Point; + origin: Point; +}; +``` + +The context in which a class is referenced distinguishes between the class instance type and the constructor function. For example, in the assignment statement + +```TypeScript +var p: Point = new Point(10, 20); +``` + +the identifier 'Point' in the type annotation refers to the class instance type, whereas the identifier 'Point' in the `new` expression refers to the constructor function object. + +### 8.1.1 Class Heritage Specification + +The heritage specification of a class consists of optional `extends` and `implements` clauses. The `extends` clause specifies the base class of the class and the `implements` clause specifies a set of interfaces for which to validate the class provides an implementation. + +  *ClassHeritage:* +   *ClassExtendsClauseopt* *ImplementsClauseopt* + +  *ClassExtendsClause:* +   `extends`  *ClassType* + +  *ClassType:* +   *TypeReference* + +  *ImplementsClause:* +   `implements` *ClassOrInterfaceTypeList* + +A class that includes an `extends` clause is called a ***derived class***, and the class specified in the `extends` clause is called the ***base class*** of the derived class. When a class heritage specification omits the `extends` clause, the class does not have a base class. However, as is the case with every object type, type references (section [3.3.1](#3.3.1)) to the class will appear to have the members of the global interface type named 'Object' unless those members are hidden by members with the same name in the class. + +The following constraints must be satisfied by the class heritage specification or otherwise a compile-time error occurs: + +* If present, the type reference specified in the `extends` clause must denote a class type. Furthermore, the *TypeName* part of the type reference is required to be a reference to the class constructor function when evaluated as an expression. +* A class declaration may not, directly or indirectly, specify a base class that originates in the same declaration. In other words a class cannot, directly or indirectly, be a base class of itself, regardless of type arguments. +* The instance type (section [3.6.1](#3.6.1)) of the declared class must be assignable (section [3.10.4](#3.10.4)) to the base type reference and each of the type references listed in the `implements` clause. +* The constructor function type created by the class declaration must be assignable to the base class constructor function type, ignoring construct signatures. + +The following example illustrates a situation in which the first rule above would be violated: + +```TypeScript +class A { a: number; } + +module Foo { + var A = 1; + class B extends A { b: string; } +} +``` + +When evaluated as an expression, the type reference 'A' in the `extends` clause doesn't reference the class constructor function of 'A' (instead it references the local variable 'A'). + +The only situation in which the last two constraints above are violated is when a class overrides one or more base class members with incompatible new members. + +Note that because TypeScript has a structural type system, a class doesn't need to explicitly state that it implements an interface—it suffices for the class to simply contain the appropriate set of instance members. The `implements` clause of a class provides a mechanism to assert and validate that the class contains the appropriate sets of instance members, but otherwise it has no effect on the class type. + +### 8.1.2 Class Body + +The class body consists of zero or more constructor or member declarations. Statements are not allowed in the body of a class—they must be placed in the constructor or in members. + +  *ClassBody:* +   *ClassElementsopt* + +  *ClassElements:* +   *ClassElement* +   *ClassElements* *ClassElement* + +  *ClassElement:* +   *ConstructorDeclaration* +   *PropertyMemberDeclaration* +   *IndexMemberDeclaration* + +The body of class may optionally contain a single constructor declaration. Constructor declarations are described in section [8.3](#8.3). + +Member declarations are used to declare instance and static members of the class. Property member declarations are described in section [8.4](#8.4) and index member declarations are described in section [8.5](#8.5). + +## 8.2 Members + +The members of a class consist of the members introduced through member declarations in the class body and the members inherited from the base class. + +### 8.2.1 Instance and Static Members + +Members are either ***instance members*** or ***static members***. + +Instance members are members of the class type (section [8.2.4](#8.2.4)) and its associated instance type. Within constructors, instance member functions, and instance member accessors, the type of `this` is the instance type (section [3.6.1](#3.6.1)) of the class. + +Static members are declared using the `static` modifier and are members of the constructor function type (section [8.2.5](#8.2.5)). Within static member functions and static member accessors, the type of `this` is the constructor function type. + +Class type parameters cannot be referenced in static member declarations. + +### 8.2.2 Accessibility + +Property members have either ***public***, ***private***, or ***protected*** accessibility. The default is public accessibility, but property member declarations may include a `public`, `private`, or `protected` modifier to explicitly specify the desired accessibility. + +Public property members can be accessed everywhere without restrictions. + +Private property members can be accessed only within their declaring class. Specifically, a private member *M* declared in a class *C* can be accessed only within the class body of *C*. + +Protected property members can be accessed only within their declaring class and classes derived from their declaring class, and a protected instance property member must be accessed *through* an instance of the enclosing class. Specifically, a protected member *M* declared in a class *C* can be accessed only within the class body of *C* or the class body of a class derived from *C*. Furthermore, when a protected instance member *M* is accessed in a property access *E*`.`*M* within the body of a class *D*, the type of *E* is required to be *D* or a type that directly or indirectly has *D* as a base type, regardless of type arguments. + +Private and protected accessibility is enforced only at compile-time and serves as no more than an *indication of intent*. Since JavaScript provides no mechanism to create private and protected properties on an object, it is not possible to enforce the private and protected modifiers in dynamic code at run-time. For example, private and protected accessibility can be defeated by changing an object's static type to Any and accessing the member dynamically. + +The following example demonstrates private and protected accessibility: + +```TypeScript +class A { + private x: number; + protected y: number; + static f(a: A, b: B) { + a.x = 1; // Ok + b.x = 1; // Ok + a.y = 1; // Ok + b.y = 1; // Ok + } +} + +class B extends A { + static f(a: A, b: B) { + a.x = 1; // Error, x only accessible within A + b.x = 1; // Error, x only accessible within A + a.y = 1; // Error, y must be accessed through instance of B + b.y = 1; // Ok + } +} +``` + +In class 'A', the accesses to 'x' are permitted because 'x' is declared in 'A', and the accesses to 'y' are permitted because both take place through an instance of 'A' or a type derived from 'A'. In class 'B', access to 'x' is not permitted, and the first access to 'y' is an error because it takes place through an instance of 'A', which is not derived from the enclosing class 'B'. + +### 8.2.3 Inheritance and Overriding + +A derived class ***inherits*** all members from its base class it doesn't ***override***. Inheritance means that a derived class implicitly contains all non-overridden members of the base class. Only public and protected property members can be overridden. + +A property member in a derived class is said to override a property member in a base class when the derived class property member has the same name and kind (instance or static) as the base class property member. The type of an overriding property member must be assignable (section [3.10.4](#3.10.4)) to the type of the overridden property member, or otherwise a compile-time error occurs. + +Base class instance member functions can be overridden by derived class instance member functions, but not by other kinds of members. + +Base class instance member variables and accessors can be overridden by derived class instance member variables and accessors, but not by other kinds of members. + +Base class static property members can be overridden by derived class static property members of any kind as long as the types are compatible, as described above. + +An index member in a derived class is said to override an index member in a base class when the derived class index member is of the same index kind (string or numeric) as the base class index member. The type of an overriding index member must be assignable (section [3.10.4](#3.10.4)) to the type of the overridden index member, or otherwise a compile-time error occurs. + +### 8.2.4 Class Types + +A class declaration declares a new named type (section [3.6](#3.6)) called a class type. Within the constructor and member functions of a class, the type of `this` is the instance type (section [3.6.1](#3.6.1)) of this class type. The class type has the following members: + +* A property for each instance member variable declaration in the class body. +* A property of a function type for each instance member function declaration in the class body. +* A property for each uniquely named instance member accessor declaration in the class body. +* A property for each constructor parameter declared with a `public`, `private`, or `protected` modifier. +* An index signature for each instance index member declaration in the class body. +* All base class instance type property or index members that are not overridden in the class. + +All instance property members (including those that are private or protected) of a class must satisfy the constraints implied by the index members of the class as specified in section [3.8.4](#3.8.4). + +In the example + +```TypeScript +class A { + public x: number; + public f() { } + public g(a: any) { return undefined; } + static s: string; +} + +class B extends A { + public y: number; + public g(b: boolean) { return false; } +} +``` + +the instance type of 'A' is + +```TypeScript +interface A { + x: number; + f: () => void; + g: (a: any) => any; +} +``` + +and the instance type of 'B' is + +```TypeScript +interface B { + x: number; + y: number; + f: () => void; + g: (b: boolean) => boolean; +} +``` + +Note that static declarations in a class do not contribute to the class type and its instance type—rather, static declarations introduce properties on the constructor function object. Also note that the declaration of 'g' in 'B' overrides the member inherited from 'A'. + +### 8.2.5 Constructor Function Types + +The type of the constructor function introduced by a class declaration is called the constructor function type. The constructor function type has the following members: + +* If the class contains no constructor declaration and has no base class, a single construct signature with no parameters, having the same type parameters as the class and returning the instance type of the class. +* If the class contains no constructor declaration and has a base class, a set of construct signatures with the same parameters as those of the base class constructor function type following substitution of type parameters with the type arguments specified in the base class type reference, all having the same type parameters as the class and returning the instance type of the class. +* If the class contains a constructor declaration with no overloads, a construct signature with the parameter list of the constructor implementation, having the same type parameters as the class and returning the instance type of the class. +* If the class contains a constructor declaration with overloads, a set of construct signatures with the parameter lists of the overloads, all having the same type parameters as the class and returning the instance type of the class. +* A property for each static member variable declaration in the class body. +* A property of a function type for each static member function declaration in the class body. +* A property for each uniquely named static member accessor declaration in the class body. +* A property named 'prototype', the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. +* All base class constructor function type properties that are not overridden in the class. + +Every class automatically contains a static property member named 'prototype', the type of which is the containing class with type Any substituted for each type parameter. + +The example + +```TypeScript +class Pair { + constructor(public item1: T1, public item2: T2) { } +} + +class TwoArrays extends Pair { } +``` + +introduces two named types corresponding to + +```TypeScript +interface Pair { + item1: T1; + item2: T2; +} + +interface TwoArrays { + item1: T[]; + item2: T[]; +} +``` + +and two constructor functions corresponding to + +```TypeScript +var Pair: { + new (item1: T1, item2: T2): Pair; +} + +var TwoArrays: { + new (item1: T[], item2: T[]): TwoArrays; +} +``` + +Note that the construct signatures in the constructor function types have the same type parameters as their class and return the instance type of their class. Also note that when a derived class doesn't declare a constructor, type arguments from the base class reference are substituted before construct signatures are propagated from the base constructor function type to the derived constructor function type. + +## 8.3 Constructor Declarations + +A constructor declaration declares the constructor function of a class. + +  *ConstructorDeclaration:* +   *ConstructorOverloadsopt* *ConstructorImplementation* + +  *ConstructorOverloads:* +   *ConstructorOverload* +   *ConstructorOverloads* *ConstructorOverload* + +  *ConstructorOverload:* +   *AccessibilityModifieropt* `constructor` `(` *ParameterListopt* `)` `;` + +  *ConstructorImplementation:* +   *AccessibilityModifieropt* `constructor` `(` *ParameterListopt* `)` `{` *FunctionBody* `}` + +A class may contain at most one constructor declaration. If a class contains no constructor declaration, an automatic constructor is provided, as described in section [8.3.3](#8.3.3). + +Overloads and the implementation of a constructor may include an accessibility modifier, but only public constructors are supported and private or protected constructors result in an error. + +If a constructor declaration includes overloads, the overloads determine the construct signatures of the type given to the constructor function object, and the constructor implementation signature must be assignable to that type. Otherwise, the constructor implementation itself determines the construct signature. This exactly parallels the way overloads are processed in a function declaration (section [6.2](#6.2)). + +The function body of a constructor is permitted to contain return statements. If return statements specify expressions, those expressions must be of types that are assignable to the instance type of the class. + +The type parameters of a generic class are in scope and accessible in a constructor declaration. + +### 8.3.1 Constructor Parameters + +Similar to functions, only the constructor implementation (and not constructor overloads) can specify default value expressions for optional parameters. It is a compile-time error for such default value expressions to reference `this`. For each parameter with a default value, a statement that substitutes the default value for an omitted argument is included in the JavaScript generated for the constructor function. + +A parameter of a *ConstructorImplementation* may be prefixed with a `public`, `private`, or `protected` modifier. This is called a ***parameter property declaration*** and is shorthand for declaring a property with the same name as the parameter and initializing it with the value of the parameter. For example, the declaration + +```TypeScript +class Point { + constructor(public x: number, public y: number) { + // Constructor body + } +} +``` + +is equivalent to writing + +```TypeScript +class Point { + public x: number; + public y: number; + constructor(x: number, y: number) { + this.x = x; + this.y = y; + // Constructor body + } +} +``` + +### 8.3.2 Super Calls + +Super calls (section [4.8.1](#4.8.1)) are used to call the constructor of the base class. A super call consists of the keyword `super` followed by an argument list enclosed in parentheses. For example: + +```TypeScript +class ColoredPoint extends Point { + constructor(x: number, y: number, public color: string) { + super(x, y); + } +} +``` + +Constructors of classes with no `extends` clause may not contain super calls, whereas constructors of derived classes must contain at least one super call somewhere in their function body. Super calls are not permitted outside constructors or in local functions inside constructors. + +The first statement in the body of a constructor *must* be a super call if both of the following are true: + +* The containing class is a derived class. +* The constructor declares parameter properties or the containing class declares instance member variables with initializers. + +In such a required super call, it is a compile-time error for argument expressions to reference `this`. + +Initialization of parameter properties and instance member variables with initializers takes place immediately at the beginning of the constructor body if the class has no base class, or immediately following the super call if the class is a derived class. + +### 8.3.3 Automatic Constructors + +If a class omits a constructor declaration, an ***automatic constructor*** is provided. + +In a class with no `extends` clause, the automatic constructor has no parameters and performs no action other than executing the instance member variable initializers (section [8.4.1](#8.4.1)), if any. + +In a derived class, the automatic constructor has the same parameter list (and possibly overloads) as the base class constructor. The automatically provided constructor first forwards the call to the base class constructor using a call equivalent to + +```TypeScript +BaseClass.apply(this, arguments); +``` + +and then executes the instance member variable initializers, if any. + +## 8.4 Property Member Declarations + +Property member declarations can be member variable declarations, member function declarations, or member accessor declarations. + +  *PropertyMemberDeclaration:* +   *MemberVariableDeclaration* +   *MemberFunctionDeclaration* +   *MemberAccessorDeclaration* + +Member declarations without a `static` modifier are called instance member declarations. Instance property member declarations declare properties in the class instance type (section [8.2.4](#8.2.4)), and must specify names that are unique among all instance property member and parameter property declarations in the containing class, with the exception that instance get and set accessor declarations may pairwise specify the same name. + +Member declarations with a `static` modifier are called static member declarations. Static property member declarations declare properties in the constructor function type (section [8.2.5](#8.2.5)), and must specify names that are unique among all static property member declarations in the containing class, with the exception that static get and set accessor declarations may pairwise specify the same name. + +Note that the declaration spaces of instance and static property members are separate. Thus, it is possible to have instance and static property members with the same name. + +Except for overrides, as described in section [8.2.3](#8.2.3), it is an error for a derived class to declare a property member with the same name and kind (instance or static) as a base class member. + +Every class automatically contains a static property member named 'prototype', the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. It is an error to explicitly declare a static property member with the name 'prototype'. + +Below is an example of a class containing both instance and static property member declarations: + +```TypeScript +class Point { + constructor(public x: number, public y: number) { } + public distance(p: Point) { + var dx = this.x - p.x; + var dy = this.y - p.y; + return Math.sqrt(dx * dx + dy * dy); + } + static origin = new Point(0, 0); + static distance(p1: Point, p2: Point) { return p1.distance(p2); } +} +``` + +The class instance type 'Point' has the members: + +```TypeScript +interface Point { + x: number; + y: number; + distance(p: Point); +} +``` + +and the constructor function 'Point' has a type corresponding to the declaration: + +```TypeScript +var Point: { + new(x: number, y: number): Point; + origin: Point; + distance(p1: Point, p2: Point): number; +} +``` + +### 8.4.1 Member Variable Declarations + +A member variable declaration declares an instance member variable or a static member variable. + +  *MemberVariableDeclaration:* +   *AccessibilityModifieropt* `static`*opt* *PropertyName* *TypeAnnotationopt* *Initialiseropt* `;` + +The type associated with a member variable declaration is determined in the same manner as an ordinary variable declaration (see section [5.1](#5.1)). + +An instance member variable declaration introduces a member in the class instance type and optionally initializes a property on instances of the class. Initializers in instance member variable declarations are executed once for every new instance of the class and are equivalent to assignments to properties of `this` in the constructor. In an initializer expression for an instance member variable, `this` is of the class instance type. + +A static member variable declaration introduces a property in the constructor function type and optionally initializes a property on the constructor function object. Initializers in static member variable declarations are executed once when the containing program or module is loaded. + +Initializer expressions for instance member variables are evaluated in the scope of the class constructor body but are not permitted to reference parameters or local variables of the constructor. This effectively means that entities from outer scopes by the same name as a constructor parameter or local variable are inaccessible in initializer expressions for instance member variables. + +Since instance member variable initializers are equivalent to assignments to properties of `this` in the constructor, the example + +```TypeScript +class Employee { + public name: string; + public address: string; + public retired = false; + public manager: Employee = null; + public reports: Employee[] = []; +} +``` + +is equivalent to + +```TypeScript +class Employee { + public name: string; + public address: string; + public retired: boolean; + public manager: Employee; + public reports: Employee[]; + constructor() { + this.retired = false; + this.manager = null; + this.reports = []; + } +} +``` + +### 8.4.2 Member Function Declarations + +A member function declaration declares an instance member function or a static member function. + +  *MemberFunctionDeclaration:* +   *MemberFunctionOverloadsopt* *MemberFunctionImplementation* + +  *MemberFunctionOverloads*: +   *MemberFunctionOverload* +   *MemberFunctionOverloads* *MemberFunctionOverload* + +  *MemberFunctionOverload*: +   *AccessibilityModifieropt* `static`*opt* *PropertyName* *CallSignature* `;` + +  *MemberFunctionImplementation:* +   *AccessibilityModifieropt* `static`*opt* *PropertyName* *CallSignature* `{` *FunctionBody* `}` + +A member function declaration is processed in the same manner as an ordinary function declaration (section [6](#6)), except that in a member function `this` has a known type. + +All overloads of a member function must have the same accessibility (public, private, or protected) and kind (instance or static). + +An instance member function declaration declares a property in the class instance type and assigns a function object to a property on the prototype object of the class. In the body of an instance member function declaration, `this` is of the class instance type. + +A static member function declaration declares a property in the constructor function type and assigns a function object to a property on the constructor function object. In the body of a static member function declaration, the type of `this` is the constructor function type. + +A member function can access overridden base class members using a super property access (section [4.8.2](#4.8.2)). For example + +```TypeScript +class Point { + constructor(public x: number, public y: number) { } + public toString() { + return "x=" + this.x + " y=" + this.y; + } +} + +class ColoredPoint extends Point { + constructor(x: number, y: number, public color: string) { + super(x, y); + } + public toString() { + return super.toString() + " color=" + this.color; + } +} +``` + +In a static member function, `this` represents the constructor function object on which the static member function was invoked. Thus, a call to 'new this()' may actually invoke a derived class constructor: + +```TypeScript +class A { + a = 1; + static create() { + return new this(); + } +} + +class B extends A { + b = 2; +} + +var x = A.create(); // new A() +var y = B.create(); // new B() +``` + +Note that TypeScript doesn't require or verify that derived constructor functions are subtypes of base constructor functions. In other words, changing the declaration of 'B' to + +```TypeScript +class B extends A { + constructor(public b: number) { + super(); + } +} +``` + +does not cause errors in the example, even though the call to the constructor from the 'create' function doesn't specify an argument (thus giving the value 'undefined' to 'b'). + +### 8.4.3 Member Accessor Declarations + +A member accessor declaration declares an instance member accessor or a static member accessor. + +  *MemberAccessorDeclaration:* +   *AccessibilityModifieropt* `static`*opt* *GetAccessor* +   *AccessibilityModifieropt* `static`*opt* *SetAccessor* + +Get and set accessors are processed in the same manner as in an object literal (section [4.5](#4.5)), except that a contextual type is never available in a member accessor declaration. + +Accessors for the same member name must specify the same accessibility. + +An instance member accessor declaration declares a property in the class instance type and defines a property on the prototype object of the class with a get or set accessor. In the body of an instance member accessor declaration, `this` is of the class instance type. + +A static member accessor declaration declares a property in the constructor function type and defines a property on the constructor function object of the class with a get or set accessor. In the body of a static member accessor declaration, the type of `this` is the constructor function type. + +Get and set accessors are emitted as calls to 'Object.defineProperty' in the generated JavaScript, as described in section [8.6.1](#8.6.1). + +## 8.5 Index Member Declarations + +An index member declaration introduces an index signature (section [3.8.4](#3.8.4)) in the class instance type. + +  *IndexMemberDeclaration:* +   *IndexSignature* `;` + +Index member declarations have no body and cannot specify an accessibility modifier. + +A class declaration can have at most one string index member declaration and one numeric index member declaration. All instance property members of a class must satisfy the constraints implied by the index members of the class as specified in section [3.8.4](#3.8.4). + +It is not possible to declare index members for the static side of a class. + +Note that it is seldom meaningful to include a string index signature in a class because it constrains all instance properties of the class. However, numeric index signatures can be useful to control the element type when a class is used in an array-like manner. + +## 8.6 Code Generation + +This section describes the structure of the JavaScript code generated from TypeScript classes. + +### 8.6.1 Classes Without Extends Clauses + +A class with no `extends` clause generates JavaScript equivalent to the following: + +```TypeScript +var = (function () { + function () { + + + + + } + + + return ; +})(); +``` + +*ClassName* is the name of the class. + +*ConstructorParameters* is a comma separated list of the constructor's parameter names. + +*DefaultValueAssignments* is a sequence of default property value assignments corresponding to those generated for a regular function declaration, as described in section [6.5](#6.5). + +*ParameterPropertyAssignments* is a sequence of assignments, one for each parameter property declaration in the constructor, in order they are declared, of the form + +```TypeScript +this. = ; +``` + +where *ParameterName* is the name of a parameter property. + +*MemberVariableAssignments* is a sequence of assignments, one for each instance member variable declaration with an initializer, in the order they are declared, of the form + +```TypeScript +this. = ; +``` + +where *MemberName* is the name of the member variable and *InitializerExpression* is the code generated for the initializer expression. + +*ConstructorStatements* is the code generated for the statements specified in the constructor body. + +*MemberFunctionStatements* is a sequence of statements, one for each member function declaration or member accessor declaration, in the order they are declared. + +An instance member function declaration generates a statement of the form + +```TypeScript +.prototype. = function () { + + +} +``` + +and static member function declaration generates a statement of the form + +```TypeScript +. = function () { + + +} +``` + +where *MemberName* is the name of the member function, and *FunctionParameters*, *DefaultValueAssignments*, and *FunctionStatements* correspond to those generated for a regular function declaration, as described in section [6.5](#6.5). + +A get or set instance member accessor declaration, or a pair of get and set instance member accessor declarations with the same name, generates a statement of the form + +```TypeScript +Object.defineProperty(.prototype, "", { + get: function () { + + }, + set: function () { + + }, + enumerable: true, + configurable: true +}; +``` + +and a get or set static member accessor declaration, or a pair of get and set static member accessor declarations with the same name, generates a statement of the form + +```TypeScript +Object.defineProperty(, "", { + get: function () { + + }, + set: function () { + + }, + enumerable: true, + configurable: true +}; +``` + +where *MemberName* is the name of the member accessor, *GetAccessorStatements* is the code generated for the statements in the get acessor's function body, *ParameterName* is the name of the set accessor parameter, and *SetAccessorStatements* is the code generated for the statements in the set accessor's function body. The 'get' property is included only if a get accessor is declared and the 'set' property is included only if a set accessor is declared. + +*StaticVariableAssignments* is a sequence of statements, one for each static member variable declaration with an initializer, in the order they are declared, of the form + +```TypeScript +. = ; +``` + +where *MemberName* is the name of the static variable, and *InitializerExpression* is the code generated for the initializer expression. + +### 8.6.2 Classes With Extends Clauses + +A class with an `extends` clause generates JavaScript equivalent to the following: + +```TypeScript +var = (function (_super) { + __extends(, _super); + function () { + + + + + + } + + + return ; +})(); +``` + +In addition, the '__extends' function below is emitted at the beginning of the JavaScript source file. It copies all properties from the base constructor function object to the derived constructor function object (in order to inherit static members), and appropriately establishes the 'prototype' property of the derived constructor function object. + +```TypeScript +var __extends = this.__extends || function(d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function f() { this.constructor = d; } + f.prototype = b.prototype; + d.prototype = new f(); +} +``` + +*BaseClassName* is the class name specified in the `extends` clause. + +If the class has no explicitly declared constructor, the *SuperCallStatement* takes the form + +```TypeScript +_super.apply(this, arguments); +``` + +Otherwise the *SuperCallStatement* is present if the constructor function is required to start with a super call, as discussed in section [8.3.2](#8.3.2), and takes the form + +```TypeScript +_super.call(this, ) +``` + +where *SuperCallArguments* is the argument list specified in the super call. Note that this call precedes the code generated for parameter properties and member variables with initializers. Super calls elsewhere in the constructor generate similar code, but the code generated for such calls will be part of the *ConstructorStatements* section. + +A super property access in the constructor, an instance member function, or an instance member accessor generates JavaScript equivalent to + +```TypeScript +_super.prototype. +``` + +where *PropertyName* is the name of the referenced base class property. When the super property access appears in a function call, the generated JavaScript is equivalent to + +```TypeScript +_super.prototype..call(this, ) +``` + +where Arguments is the code generated for the argument list specified in the function call. + +A super property access in a static member function or a static member accessor generates JavaScript equivalent to + +```TypeScript +_super. +``` + +where *PropertyName* is the name of the referenced base class property. When the super property access appears in a function call, the generated JavaScript is equivalent to + +```TypeScript +_super..call(this, ) +``` + +where Arguments is the code generated for the argument list specified in the function call. + +
+ +#
9 Enums + +An enum type is a distinct subtype of the Number primitive type with an associated set of named constants that define the possible values of the enum type. + +## 9.1 Enum Declarations + +An enum declaration declares an ***enum type*** and an ***enum object*** in the containing module. + +  *EnumDeclaration:* +   `enum` *Identifier* `{` *EnumBodyopt* `}` + +The enum type and enum object declared by an *EnumDeclaration* both have the name given by the *Identifier* of the declaration. The enum type is a distinct subtype of the Number primitive type. The enum object is a variable of an anonymous object type containing a set of properties, all of the enum type, corresponding to the values declared for the enum type in the body of the declaration. The enum object's type furthermore includes a numeric index signature with the signature '[x: number]: string'. + +The *Identifier* of an enum declaration may not be one of the predefined type names (section [3.7.1](#3.7.1)). + +The example + +```TypeScript +enum Color { Red, Green, Blue } +``` + +declares a subtype of the Number primitive type called 'Color' and introduces a variable 'Color' with a type that corresponds to the declaration + +```TypeScript +var Color: { + [x: number]: string; + Red: Color; + Green: Color; + Blue: Color; +}; +``` + +The numeric index signature reflects a "reverse mapping" that is automatically generated in every enum object, as described in section [9.4](#9.4). The reverse mapping provides a convenient way to obtain the string representation of an enum value. For example + +```TypeScript +var c = Color.Red; +console.log(Color[c]); // Outputs "Red" +``` + +## 9.2 Enum Members + +The body of an enum declaration defines zero or more enum members which are the named values of the enum type. Each enum member has an associated numeric value of the primitive type introduced by the enum declaration. + +  *EnumBody*: +   *ConstantEnumMembers* `,`*opt* +   *ConstantEnumMembers* `,` *EnumMemberSections* `,`*opt* +   *EnumMemberSections* `,`*opt* + +  *ConstantEnumMembers:* +   *PropertyName* +   *ConstantEnumMembers* `,` *PropertyName* + +  *EnumMemberSections:* +   *EnumMemberSection* +   *EnumMemberSections* `,` *EnumMemberSection* + +  *EnumMemberSection:* +   *ConstantEnumMemberSection* +   *ComputedEnumMember* + +  *ConstantEnumMemberSection:* +   *PropertyName* `=` *ConstantEnumValue* +   *PropertyName* `=` *ConstantEnumValue* `,` *ConstantEnumMembers* + +  *ConstantEnumValue:* +   *SignedInteger* +   *HexIntegerLiteral* + +  *ComputedEnumMember:* +   *PropertyName* `=` *AssignmentExpression* + +Enum members are either ***constant members*** or ***computed members***. Constant members have known constant values that are substituted in place of references to the members in the generated JavaScript code. Computed members have values that are computed at run-time and not known at compile-time. No substitution is performed for references to computed members. + +The body of an enum declaration consists of an optional *ConstantEnumMembers* production followed by any number of *ConstantEnumMemberSection* or *ComputedEnumMember* productions. + +* If present, the initial *ConstantEnumMembers* production introduces a series of constant members with consecutive integral values starting at the value zero. +* A *ConstantEnumMemberSection* introduces one or more constant members with consecutive integral values starting at the specified constant value. +* A *ComputedEnumMember* introduces a computed member with a value computed by an expression. + +Expressions specified for computed members must produce values of type Any, the Number primitive type, or the enum type itself. + +In the example + +```TypeScript +enum Test { + A, + B, + C = Math.floor(Math.random() * 1000), + D = 10, + E +} +``` + +'A', 'B', 'D', and 'E' are constant members with values 0, 1, 10, and 11 respectively, and 'C' is a computed member. + +In the example + +```TypeScript +enum Style { + None = 0, + Bold = 1, + Italic = 2, + Underline = 4, + Emphasis = Bold | Italic, + Hyperlink = Bold | Underline +} +``` + +the first four members are constant members and the last two are computed members. Note that computed member declarations can reference other enum members without qualification. Also, because enums are subtypes of the Number primitive type, numeric operators, such as the bitwise OR operator, can be used to compute enum values. + +## 9.3 Declaration Merging + +Enums are "open-ended" and enum declarations with the same qualified name relative to a common root (as defined in section [2.3](#2.3)) define a single enum type and contribute to a single enum object. + +It isn't possible for one enum declaration to continue the automatic numbering sequence of another, and when an enum type has multiple declarations, only one declaration is permitted to omit a value for the first member. + +## 9.4 Code Generation + +An enum declaration generates JavaScript equivalent to the following: + +```TypeScript +var ; +(function () { + +})(||(={})); +``` + +*EnumName* is the name of the enum. + +*EnumMemberAssignments* is a sequence of assignments, one for each enum member, in order they are declared, of the form + +```TypeScript +[[""] = ] = ""; +``` + +where *MemberName* is the name of the enum member and *Value* is the assigned constant value or the code generated for the computed value expression. + +For example, the 'Color' enum example from section [9.1](#9.1) generates the following JavaScript: + +```TypeScript +var Color; +(function (Color) { + Color[Color["Red"] = 0] = "Red"; + Color[Color["Green"] = 1] = "Green"; + Color[Color["Blue"] = 2] = "Blue"; +})(Color||(Color={})); +``` + +
+ +#
10 Internal Modules + +An internal module is a named container of statements and declarations. An internal module represents both a namespace and a singleton module instance. The namespace contains named types and other namespaces, and the singleton module instance contains properties for the module's exported members. The body of an internal module corresponds to a function that is executed once, thereby providing a mechanism for maintaining local state with assured isolation. + +## 10.1 Module Declarations + +An internal module declaration declares a namespace name and, in the case of an instantiated module, a member name in the containing module. + +  *ModuleDeclaration:* +   `module` *IdentifierPath* `{` *ModuleBody* `}` + +  *IdentifierPath:* +   *Identifier* +   *IdentifierPath* `.` *Identifier* + +Internal modules are either ***instantiated*** or ***non-instantiated***. A non-instantiated module is an internal module containing only interface types and other non-instantiated modules. An instantiated module is an internal module that doesn't meet this definition. In intuitive terms, an instantiated module is one for which a module object instance is created, whereas a non-instantiated module is one for which no code is generated. + +When a module identifier is referenced as a *ModuleName* (section [3.7.2](#3.7.2)) it denotes a container of module and type names, and when a module identifier is referenced as a *PrimaryExpression* (section [4.3](#4.3)) it denotes the singleton module instance. For example: + +```TypeScript +module M { + export interface P { x: number; y: number; } + export var a = 1; +} + +var p: M.P; // M used as ModuleName +var m = M; // M used as PrimaryExpression +var x1 = M.a; // M used as PrimaryExpression +var x2 = m.a; // Same as M.a +var q: m.P; // Error +``` + +Above, when 'M' is used as a *PrimaryExpression* it denotes an object instance with a single member 'a' and when 'M' is used as a *ModuleName* it denotes a container with a single type member 'P'. The final line in the example is an error because 'm' is a variable which cannot be referenced in a type name. + +If the declaration of 'M' above had excluded the exported variable 'a', 'M' would be a non-instantiated module and it would be an error to reference 'M' as a *PrimaryExpression*. + +An internal module declaration that specifies an *IdentifierPath* with more than one identifier is equivalent to a series of nested single-identifier internal module declarations where all but the outermost are automatically exported. For example: + +```TypeScript +module A.B.C { + export var x = 1; +} +``` + +corresponds to + +```TypeScript +module A { + export module B { + export module C { + export var x = 1; + } + } +} +``` + +## 10.2 Module Body + +The body of an internal module corresponds to a function that is executed once to initialize the module instance. + +  *ModuleBody:* +   *ModuleElementsopt* + +  *ModuleElements:* +   *ModuleElement* +   *ModuleElements* *ModuleElement* + +  *ModuleElement:* +   *Statement* +   `export`*opt* *VariableDeclaration* +   `export`*opt* *FunctionDeclaration* +   `export`*opt* *ClassDeclaration* +   `export`*opt* *InterfaceDeclaration* +   `export`*opt* *TypeAliasDeclaration* +   `export`*opt* *EnumDeclaration* +   `export`*opt* *ModuleDeclaration* +   `export`*opt* *ImportDeclaration* +   `export`*opt* *AmbientDeclaration* + +Each module body has a declaration space for local variables (including functions, modules, class constructor functions, and enum objects), a declaration space for local named types (classes, interfaces, and enums), and a declaration space for local namespaces (containers of named types). Every declaration (whether local or exported) in a module contributes to one or more of these declaration spaces. + +## 10.3 Import Declarations + +Import declarations are used to create local aliases for entities in other modules. + +  *ImportDeclaration:* +   `import` *Identifier* `=` *EntityName* `;` + +  *EntityName:* +   *ModuleName* +   *ModuleName* `.` *Identifier* + +An *EntityName* consisting of a single identifier is resolved as a *ModuleName* and is thus required to reference an internal module. The resulting local alias references the given internal module and is itself classified as an internal module. + +An *EntityName* consisting of more than one identifier is resolved as a *ModuleName* followed by an identifier that names one or more exported entities in the given module. The resulting local alias has all the meanings and classifications of the referenced entity or entities. (As many as three distinct meanings are possible for an entity name—namespace, type, and member.) In effect, it is as if the imported entity or entities were declared locally with the local alias name. + +In the example + +```TypeScript +module A { + export interface X { s: string } + export var X: X; +} + +module B { + interface A { n: number } + import Y = A; // Alias only for module A + import Z = A.X; // Alias for both type and member A.X + var v: Z = Z; +} +``` + +within 'B', 'Y' is an alias only for module 'A' and not the local interface 'A', whereas 'Z' is an alias for all exported meanings of 'A.X', thus denoting both an interface type and a variable. + +If the *ModuleName* portion of an *EntityName* references an instantiated module, the *ModuleName* is required to reference the module instance when evaluated as an expression. In the example + +```TypeScript +module A { + export interface X { s: string } +} + +module B { + var A = 1; + import Y = A; +} +``` + +'Y' is a local alias for the non-instantiated module 'A'. If the declaration of 'A' is changed such that 'A' becomes an instantiated module, for example by including a variable declaration in 'A', the import statement in 'B' above would be an error because the expression 'A' doesn't reference the module instance of module 'A'. + +When an import statement includes an export modifier, all meanings of the local alias are exported. + +## 10.4 Export Declarations + +An export declaration declares an externally accessible module member. An export declaration is simply a regular declaration prefixed with the keyword `export`. + +Exported class, interface, and enum types can be accessed as a *TypeName* (section [3.7.2](#3.7.2)) of the form *M.T*, where *M* is a reference to the containing module and *T* is the exported type name. Likewise, as part of a *TypeName*, exported modules can be accessed as a *ModuleName* of the form *M.N*, where *M* is a reference to the containing module and *N* is the exported module. + +Exported variable, function, class, enum, module, and import alias declarations become properties on the module instance and together establish the module's ***instance type***. This unnamed type has the following members: + +* A property for each exported variable declaration. +* A property of a function type for each exported function declaration. +* A property of a constructor type for each exported class declaration. +* A property of an object type for each exported enum declaration. +* A property of an object type for each exported instantiated module declaration. +* A property for each exported import alias that references a variable, function, class, enum, or instantiated module. + +An exported member depends on a (possibly empty) set of named types (section [3.6](#3.6)). Those named types must be at least as accessible as the exported member, or otherwise an error occurs. + +The named types upon which a member depends are the named types occurring in the transitive closure of the ***directly depends on*** relationship defined as follows: + +* A variable directly depends on the *Type* specified in its type annotation. +* A function directly depends on each *Type* specified in a parameter or return type annotation. +* A class directly depends on each *Type* specified as a type parameter constraint, each *TypeReference* specified as a base class or implemented interface, and each *Type* specified in a constructor parameter type annotation, public member variable type annotation, public member function parameter or return type annotation, public member accessor parameter or return type annotation, or index signature type annotation. +* An interface directly depends on each *Type* specified as a type parameter constraint, each *TypeReference* specified as a base interface, and the *ObjectType* specified as its body. +* A module directly depends on its exported members. +* A *Type* or *ObjectType* directly depends on every *TypeReference* that occurs within the type at any level of nesting. +* A *TypeReference* directly depends on the type it references and on each *Type* specified as a type argument. + +A named type *T* having a root module *R* (section [2.3](#2.3)) is said to be ***at least as accessible as*** a member *M* if + +* *R* is the global module or an external module, or +* *R* is an internal module in the parent module chain of *M*. + +In the example + +```TypeScript +interface A { x: string; } + +module M { + export interface B { x: A; } + export interface C { x: B; } + export function foo(c: C) { … } +} +``` + +the 'foo' function depends upon the named types 'A', 'B', and 'C'. In order to export 'foo' it is necessary to also export 'B' and 'C' as they otherwise would not be at least as accessible as 'foo'. The 'A' interface is already at least as accessible as 'foo' because it is declared in a parent module of foo's module. + +## 10.5 Declaration Merging + +Internal modules are "open-ended" and internal module declarations with the same qualified name relative to a common root (as defined in section [2.3](#2.3)) contribute to a single module. For example, the following two declarations of a module outer might be located in separate source files. + +File a.ts: + +```TypeScript +module outer { + var local = 1; // Non-exported local variable + export var a = local; // outer.a + export module inner { + export var x = 10; // outer.inner.x + } +} +``` + +File b.ts: + +```TypeScript +module outer { + var local = 2; // Non-exported local variable + export var b = local; // outer.b + export module inner { + export var y = 20; // outer.inner.y + } +} +``` + +Assuming the two source files are part of the same program, the two declarations will have the global module as their common root and will therefore contribute to the same module instance, the instance type of which will be: + +```TypeScript +{ + a: number; + b: number; + inner: { + x: number; + y: number; + }; +} +``` + +Declaration merging does not apply to local aliases created by import declarations. In other words, it is not possible have an import declaration and a module declaration for the same name within the same module body. + +Declaration merging also extends to internal module declarations with the same qualified name relative to a common root as a function, class, or enum declaration: + +* When merging a function and an internal module, the type of the function object is merged with the instance type of the module. In effect, the overloads or implementation of the function provide the call signatures and the exported members of the module provide the properties of the combined type. +* When merging a class and an internal module, the type of the constructor function object is merged with the instance type of the module. In effect, the overloads or implementation of the class constructor provide the construct signatures, and the static members of the class and exported members of the module provide the properties of the combined type. It is an error to have static class members and exported module members with the same name. +* When merging an enum and an internal module, the type of the enum object is merged with the instance type of the module. In effect, the members of the enum and the exported members of the module provide the properties of the combined type. It is an error to have enum members and exported module members with the same name. + +When merging a non-ambient function or class declaration and a non-ambient internal module declaration, the function or class declaration must be located prior to the internal module declaration in the same source file. This ensures that the shared object instance is created as a function object. (While it is possible to add properties to an object after its creation, it is not possible to make an object "callable" after the fact.) + +The example + +```TypeScript +interface Point { + x: number; + y: number; +} + +function point(x: number, y: number): Point { + return { x: x, y: y }; +} + +module point { + export var origin = point(0, 0); + export function equals(p1: Point, p2: Point) { + return p1.x == p2.x && p1.y == p2.y; + } +} + +var p1 = point(0, 0); +var p2 = point.origin; +var b = point.equals(p1, p2); +``` + +declares 'point' as a function object with two properties, 'origin' and 'equals'. Note that the module declaration for 'point' is located after the function declaration. + +## 10.6 Code Generation + +An internal module generates JavaScript code that is equivalent to the following: + +```TypeScript +var ; +(function() { + +})(||(={})); +``` + +where *ModuleName* is the name of the module and *ModuleStatements* is the code generated for the statements in the module body. The *ModuleName* function parameter may be prefixed with one or more underscore characters to ensure the name is unique within the function body. Note that the entire module is emitted as an anonymous function that is immediately executed. This ensures that local variables are in their own lexical environment isolated from the surrounding context. Also note that the generated function doesn't create and return a module instance, but rather it extends the existing instance (which may have just been created in the function call). This ensures that internal modules can extend each other. + +An import statement generates code of the form + +```TypeScript +var = ; +``` + +This code is emitted only if the imported entity is referenced as a *PrimaryExpression* somewhere in the body of the importing module. If an imported entity is referenced only as a *TypeName* or *ModuleName*, nothing is emitted. This ensures that types declared in one internal module can be referenced through an import alias in another internal module with no run-time overhead. + +When a variable is exported, all references to the variable in the body of the module are replaced with + +```TypeScript +. +``` + +This effectively promotes the variable to be a property on the module instance and ensures that all references to the variable become references to the property. + +When a function, class, enum, or module is exported, the code generated for the entity is followed by an assignment statement of the form + +```TypeScript +. = ; +``` + +This copies a reference to the entity into a property on the module instance. + +
+ +#
11 Source Files and External Modules + +TypeScript implements external modules that are closely aligned with those proposed for ECMAScript 6 and supports code generation targeting CommonJS and AMD module systems. + +*NOTE: TypeScript currently doesn't support the full proposed capabilities of the ECMAScript 6 import and export syntax. We expect to align more closely on the syntax as the ECMAScript 6 specification evolves*. + +## 11.1 Source Files + +A TypeScript ***program*** consists of one or more source files that are either ***implementation source files*** or ***declaration source files***. Source files with extension '.ts' are *ImplementationSourceFiles* containing statements and declarations. Source files with extension '.d.ts' are *DeclarationSourceFiles* containing declarations only. Declaration source files are a strict subset of implementation source files. + +  *SourceFile:* +   *ImplementationSourceFile* +   *DeclarationSourceFile* + +  *ImplementationSourceFile:* +   *ImplementationElementsopt* + +  *ImplementationElements:* +   *ImplementationElement* +   *ImplementationElements* *ImplementationElement* + +  *ImplementationElement:* +   *ModuleElement* +   *ExportAssignment* +   *AmbientExternalModuleDeclaration* +   `export`*opt* *ExternalImportDeclaration* + +  *DeclarationSourceFile:* +   *DeclarationElementsopt* + +  *DeclarationElements:* +   *DeclarationElement* +   *DeclarationElements* *DeclarationElement* + +  *DeclarationElement:* +   *ExportAssignment* +   *AmbientExternalModuleDeclaration* +   `export`*opt* *InterfaceDeclaration* +   `export`*opt* *TypeAliasDeclaration* +   `export`*opt* *ImportDeclaration* +   `export`*opt* *AmbientDeclaration* +   `export`*opt* *ExternalImportDeclaration* + +When a TypeScript program is compiled, all of the program's source files are processed together. Statements and declarations in different source files can depend on each other, possibly in a circular fashion. By default, a JavaScript output file is generated for each implementation source file in a compilation, but no output is generated from declaration source files. + +The source elements permitted in a TypeScript implementation source file are a superset of those supported by JavaScript. Specifically, TypeScript extends the JavaScript grammar's existing *VariableDeclaration* (section [5.1](#5.1)) and *FunctionDeclaration* (section [6.1](#6.1)) productions, and adds *TypeAliasDeclaration* (section [3.9](#3.9)), *InterfaceDeclaration* (section [7.1](#7.1)), *ClassDeclaration* (section [8.1](#8.1)), *EnumDeclaration* (section [9.1](#9.1)), *ModuleDeclaration* (section [10.1](#10.1)), *ImportDeclaration* (section [10.3](#10.3)), *ExternalImportDeclaration* (section [11.2.2](#11.2.2)), *ExportAssignment* (section [11.2.4](#11.2.4)), *AmbientDeclaration* (section [12.1](#12.1)), and *AmbientExternalModuleDeclaration* (section [12.2](#12.2)) productions. + +Declaration source files are restricted to contain declarations only. Declaration source files can be used to declare the static type information associated with existing JavaScript code in an adjunct manner. They are entirely optional but enable the TypeScript compiler and tools to provide better verification and assistance when integrating existing JavaScript code and libraries in a TypeScript application. + +Implementation and declaration source files that contain no import or export declarations form the single ***global module***. Entities declared in the global module are in scope everywhere in a program. Initialization order of the source files that make up the global module ultimately depends on the order in which the generated JavaScript files are loaded at run-time (which, for example, may be controlled by <script/> tags that reference the generated JavaScript files). + +Implementation and declaration source files that contain at least one external import declaration, export assignment, or top-level exported declaration are considered separate ***external modules***. Entities declared in an external module are in scope only in that module, but exported entities can be imported into other modules using import declarations. Initialization order of external modules is determined by the module loader being and is not specified by the TypeScript language. However, it is generally the case that non-circularly dependent modules are automatically loaded and initialized in the correct order. + +External modules can additionally be declared using *AmbientExternalModuleDeclarations* in the global module that directly specify the external module names as string literals. This is described further in section [12.2](#12.2). + +### 11.1.1 Source Files Dependencies + +The TypeScript compiler automatically determines a source file's dependencies and includes those dependencies in the program being compiled. The determination is made from "reference comments" and external import declarations as follows: + +* A comment of the form /// <reference path="…"/> adds a dependency on the source file specified in the path argument. The path is resolved relative to the directory of the containing source file. +* An external import declaration that specifies a relative external module name (section [11.2.1](#11.2.1)) resolves the name relative to the directory of the containing source file. If a source file with the resulting path and file extension '.ts' exists, that file is added as a dependency. Otherwise, if a source file with the resulting path and file extension '.d.ts' exists, that file is added as a dependency. +* An external import declaration that specifies a top-level external module name (section [11.2.1](#11.2.1)) resolves the name in a host dependent manner (typically by resolving the name relative to a module name space root or searching for the name in a series of directories). If a source file with extension '.ts' or '.d.ts' corresponding to the reference is located, that file is added as a dependency. + +Any files included as dependencies in turn have their references analyzed in a transitive manner until all dependencies have been determined. + +## 11.2 External Modules + +External modules are separately loaded bodies of code referenced using external module names. External modules can be likened to functions that are loaded and executed once to initialize their associated module instance. Entities declared in an external module are private and inaccessible elsewhere unless they are exported. + +External modules are written as separate source files that contain at least one external import declaration, export assignment, or top-level exported declaration. Specifically, if a source file contains at least one + +* *ExternalImportDeclaration*, +* *ExportAssignment*, +* top-level exported *VariableDeclaration*, +* top-level exported *FunctionDeclaration*, +* top-level exported *ClassDeclaration*, +* top-level exported *InterfaceDeclaration*, +* top-level exported *TypeAliasDeclaration*, +* top-level exported *EnumDeclaration*, +* top-level exported *ModuleDeclaration*, +* top-level exported *ImportDeclaration*, or +* top-level exported *AmbientDeclaration*, + +that source file is considered an external module; otherwise, the source file is considered part of the global module. + +Below is an example of two external modules written in separate source files. + +File main.ts: + +```TypeScript +import log = require("./log"); +log.message("hello"); +``` + +File log.ts: + +```TypeScript +export function message(s: string) { + console.log(s); +} +``` + +The import declaration in the 'main' module references the 'log' module and compiling the 'main.ts' file causes the 'log.ts' file to also be compiled as part of the program. At run-time, the import declaration loads the 'log' module and produces a reference to its module instance through which it is possible to reference the exported function. + +TypeScript supports two patterns of JavaScript code generation for external modules: The CommonJS Modules pattern (section [11.2.5](#11.2.5)), typically used by server frameworks such as node.js, and the Asynchronous Module Definition (AMD) pattern (section [11.2.6](#11.2.6)), an extension to CommonJS Modules that permits asynchronous module loading, as is typical in browsers. The desired module code generation pattern is selected through a compiler option and does not affect the TypeScript source code. Indeed, it is possible to author external modules that can be compiled for use both on the server side (e.g. using node.js) and on the client side (using an AMD compliant loader) with no changes to the TypeScript source code. + +### 11.2.1 External Module Names + +External modules are identified and referenced using external module names. The following definition is aligned with that provided in the CommonJS Modules 1.0 specification. + +* An external module name is a string of terms delimited by forward slashes. +* External module names may not have file-name extensions like ".js". +* External module names may be relative or top-level. An external module name is relative if the first term is "." or "..". +* Top-level names are resolved off the conceptual module name space root. +* Relative names are resolved relative to the name of the module in which they occur. + +For purposes of resolving external module references, TypeScript associates a file path with every external module. The file path is simply the path of the module's source file without the file extension. For example, an external module contained in the source file 'C:\src\lib\io.ts' has the file path 'C:/src/lib/io' and an external module contained in the source file 'C:\src\ui\editor.d.ts' has the file path 'C:/src/ui/editor'. + +An external module name in an import declaration is resolved as follows: + +* If the import declaration specifies a relative external module name, the name is resolved relative to the directory of the referencing module's file path. The program must contain a module with the resulting file path or otherwise an error occurs. For example, in a module with the file path 'C:/src/ui/main', the external module names './editor' and '../lib/io' reference modules with the file paths 'C:/src/ui/editor' and 'C:/src/lib/io'. +* If the import declaration specifies a top-level external module name and the program contains an *AmbientExternalModuleDeclaration* (section [12.2](#12.2)) with a string literal that specifies that exact name, then the import declaration references that ambient external module. +* If the import declaration specifies a top-level external module name and the program contains no *AmbientExternalModuleDeclaration* (section [12.2](#12.2)) with a string literal that specifies that exact name, the name is resolved in a host dependent manner (for example by considering the name relative to a module name space root). If a matching module cannot be found an error occurs. + +### 11.2.2 External Import Declarations + +External import declarations are used to import external modules and create local aliases by which they may be referenced. + +  *ExternalImportDeclaration:* +   `import` *Identifier* `=` *ExternalModuleReference* `;` + +  *ExternalModuleReference:* +   `require` `(` *StringLiteral* `)` + +The string literal specified in an *ExternalModuleReference* is interpreted as an external module name (section [11.2.1](#11.2.1)). + +An external import declaration introduces a local identifier that references a given external module. The local identifier becomes an alias for, and is classified exactly like, the entity or entities exported from the referenced external module. Specifically, if the referenced external module contains no export assignment the identifier is classified as a module, and if the referenced external module contains an export assignment the identifier is classified exactly like the entity or entities named in the export assignment. + +### 11.2.3 Export Declarations + +An external module that contains no export assignment (section [11.2.4](#11.2.4)) exports an entity classified as a module. Similarly to an internal module, export declarations (section [10.4](#10.4)) in the external module are used to declare the members of this entity. + +Unlike a non-instantiated internal module (section [10.1](#10.1)), an external module containing only interface types and non-instantiated internal modules still has a module instance associated with it, albeit one with no members. + +If an external module contains an export assignment it is an error for the external module to also contain export declarations. The two types of exports are mutually exclusive. + +### 11.2.4 Export Assignments + +An export assignment designates a module member as the entity to be exported in place of the external module itself. + +  *ExportAssignment:* +   `export` `=` *Identifier* `;` + +When an external module containing an export assignment is imported, the local alias introduced by the external import declaration takes on all meanings of the identifier named in the export assignment. + +It is an error for an external module to contain more than one export assignment. + +Assume the following example resides in the file 'point.ts': + +```TypeScript +export = Point; + +class Point { + constructor(public x: number, public y: number) { } + static origin = new Point(0, 0); +} +``` + +When 'point.ts' is imported in another external module, the import alias references the exported class and can be used both as a type and as a constructor function: + +```TypeScript +import Pt = require("./point"); + +var p1 = new Pt(10, 20); +var p2 = Pt.origin; +``` + +Note that there is no requirement that the import alias use the same name as the exported entity. + +### 11.2.5 CommonJS Modules + +The CommonJS Modules definition specifies a methodology for writing JavaScript modules with implied privacy, the ability to import other modules, and the ability to explicitly export members. A CommonJS compliant system provides a 'require' function that can be used to synchronously load other external modules to obtain their singleton module instance, as well as an 'exports' variable to which a module can add properties to define its external API. + +The 'main' and 'log' example from section [11.2](#11.2) above generates the following JavaScript code when compiled for the CommonJS Modules pattern: + +File main.js: + +```TypeScript +var log = require("./log"); +log.message("hello"); +``` + +File log.js: + +```TypeScript +exports.message = function(s) { + console.log(s); +} +``` + +An external import declaration is represented in the generated JavaScript as a variable initialized by a call to the 'require' function provided by the module system host. A variable declaration and 'require' call is emitted for a particular imported module only if the imported module, or a local alias (section [10.3](#10.3)) that references the imported module, is referenced as a *PrimaryExpression* somewhere in the body of the importing module. If an imported module is referenced only as a *ModuleName* or *TypeQueryExpression*, nothing is emitted. + +An example: + +File geometry.ts: + +```TypeScript +export interface Point { x: number; y: number }; + +export function point(x: number, y: number): Point { + return { x: x, y: y }; +} +``` + +File game.ts: + +```TypeScript +import g = require("./geometry"); +var p = g.point(10, 20); +``` + +The 'game' module references the imported 'geometry' module in an expression (through its alias 'g') and a 'require' call is therefore included in the emitted JavaScript: + +```TypeScript +var g = require("./geometry"); +var p = g.point(10, 20); +``` + +Had the 'game' module instead been written to only reference 'geometry' in a type position + +```TypeScript +import g = require("./geometry"); +var p: g.Point = { x: 10, y: 20 }; +``` + +the emitted JavaScript would have no dependency on the 'geometry' module and would simply be + +```TypeScript +var p = { x: 10, y: 20 }; +``` + +### 11.2.6 AMD Modules + +The Asynchronous Module Definition (AMD) specification extends the CommonJS Modules specification with a pattern for authoring asynchronously loadable modules with associated dependencies. Using the AMD pattern, modules are emitted as calls to a global 'define' function taking an array of dependencies, specified as external module names, and a callback function containing the module body. The global 'define' function is provided by including an AMD compliant loader in the application. The loader arranges to asynchronously load the module's dependencies and, upon completion, calls the callback function passing resolved module instances as arguments in the order they were listed in the dependency array. + +The "main" and "log" example from above generates the following JavaScript code when compiled for the AMD pattern. + +File main.js: + +```TypeScript +define(["require", "exports", "./log"], function(require, exports, log) { + log.message("hello"); +} +``` + +File log.js: + +```TypeScript +define(["require", "exports"], function(require, exports) { + exports.message = function(s) { + console.log(s); + } +} +``` + +The special 'require' and 'exports' dependencies are always present. Additional entries are added to the dependencies array and the parameter list as required to represent imported external modules. Similar to the code generation for CommonJS Modules, a dependency entry is generated for a particular imported module only if the imported module is referenced as a *PrimaryExpression* somewhere in the body of the importing module. If an imported module is referenced only as a *ModuleName*, no dependency is generated for that module. + +
+ +#
12 Ambients + +Ambient declarations are used to provide static typing over existing JavaScript code. Ambient declarations differ from regular declarations in that no JavaScript code is emitted for them. Instead of introducing new variables, functions, classes, enums, or modules, ambient declarations provide type information for entities that exist "ambiently" and are included in a program by external means, for example by referencing a JavaScript library in a <script/> tag. + +## 12.1 Ambient Declarations + +Ambient declarations are written using the `declare` keyword and can declare variables, functions, classes, enums, internal modules, or external modules. + +  *AmbientDeclaration:* +   `declare` *AmbientVariableDeclaration* +   `declare` *AmbientFunctionDeclaration* +   `declare` *AmbientClassDeclaration* +   `declare` *AmbientEnumDeclaration* +   `declare` *AmbientModuleDeclaration* + +### 12.1.1 Ambient Variable Declarations + +An ambient variable declaration introduces a variable in the containing declaration space. + +  *AmbientVariableDeclaration:* +   `var` *Identifier*  *TypeAnnotationopt* `;` + +An ambient variable declaration may optionally include a type annotation. If no type annotation is present, the variable is assumed to have type Any. + +An ambient variable declaration does not permit an initializer expression to be present. + +### 12.1.2 Ambient Function Declarations + +An ambient function declaration introduces a function in the containing declaration space. + +  *AmbientFunctionDeclaration:* +   `function` *Identifier* *CallSignature* `;` + +Ambient functions may be overloaded by specifying multiple ambient function declarations with the same name, but it is an error to declare multiple overloads that are considered identical (section [3.10.2](#3.10.2)) or differ only in their return types. + +Ambient function declarations cannot specify a function bodies and do not permit default parameter values. + +### 12.1.3 Ambient Class Declarations + +An ambient class declaration declares a class instance type and a constructor function in the containing module. + +  *AmbientClassDeclaration:* +   `class` *Identifier* *TypeParametersopt* *ClassHeritage* `{` *AmbientClassBody* `}` + +  *AmbientClassBody:* +   *AmbientClassBodyElementsopt* + +  *AmbientClassBodyElements:* +   *AmbientClassBodyElement* +   *AmbientClassBodyElements* *AmbientClassBodyElement* + +  *AmbientClassBodyElement:* +   *AmbientConstructorDeclaration* +   *AmbientPropertyMemberDeclaration* +   *IndexSignature* + +  *AmbientConstructorDeclaration:* +   `constructor` `(` *ParameterListopt* `)` `;` + +  *AmbientPropertyMemberDeclaration:* +   *AccessibilityModifieropt* `static`*opt* *PropertyName* *TypeAnnotationopt* `;` +   *AccessibilityModifieropt* `static`*opt* *PropertyName* *CallSignature* `;` + +### 12.1.4 Ambient Enum Declarations + +An ambient enum declaration declares an enum type and an enum object in the containing module. + +  *AmbientEnumDeclaration:* +   `enum` *Identifier* `{` *AmbientEnumBodyopt* `}` + +  *AmbientEnumBody:* +   *AmbientEnumMemberList* `,`*opt* + +  *AmbientEnumMemberList:* +   *AmbientEnumMember* +   *AmbientEnumMemberList* `,` *AmbientEnumMember* + +  *AmbientEnumMember:* +   *PropertyName* +   *PropertyName* = *ConstantEnumValue* + +An *AmbientEnumMember* that includes a *ConstantEnumValue* value is considered a constant member. An *AmbientEnumMember* with no *ConstantEnumValue* value is considered a computed member. + +### 12.1.5 Ambient Module Declarations + +An ambient module declaration declares an internal module. + +  *AmbientModuleDeclaration:* +   `module` *IdentifierPath* `{` *AmbientModuleBody* `}` + +  *AmbientModuleBody:* +   *AmbientModuleElementsopt* + +  *AmbientModuleElements:* +   *AmbientModuleElement* +   *AmbientModuleElements* *AmbientModuleElement* + +  *AmbientModuleElement:* +   `export`*opt* *AmbientVariableDeclaration* +   `export`*opt* *AmbientFunctionDeclaration* +   `export`*opt* *AmbientClassDeclaration* +   `export`*opt* *InterfaceDeclaration* +   `export`*opt* *AmbientEnumDeclaration* +   `export`*opt* *AmbientModuleDeclaration* +   `export`*opt* *ImportDeclaration* + +Except for *ImportDeclarations*, *AmbientModuleElements* always declare exported entities regardless of whether they include the optional `export` modifier. + +## 12.2 Ambient External Module Declarations + +An *AmbientExternalModuleDeclaration* declares an external module. This type of declaration is permitted only at the top level in a source file that contributes to the global module (section [11.1](#11.1)). The *StringLiteral* must specify a top-level external module name. Relative external module names are not permitted. + +  *AmbientExternalModuleDeclaration:* +   `module` *StringLiteral* `{`  *AmbientExternalModuleBody* `}` + +  *AmbientExternalModuleBody:* +   *AmbientExternalModuleElementsopt* + +  *AmbientExternalModuleElements:* +   *AmbientExternalModuleElement* +   *AmbientExternalModuleElements* *AmbientExternalModuleElement* + +  *AmbientExternalModuleElement:* +   *AmbientModuleElement* +   *ExportAssignment* +   `export`*opt* *ExternalImportDeclaration* + +An *ExternalImportDeclaration* in an *AmbientExternalModuleDeclaration* may reference other external modules only through top-level external module names. Relative external module names are not permitted. + +If an ambient external module declaration includes an export assignment, it is an error for any of the declarations within the module to specify an `export` modifier. If an ambient external module declaration contains no export assignment, entities declared in the module are exported regardless of whether their declarations include the optional `export` modifier. + +Ambient external modules are "open-ended" and ambient external module declarations with the same string literal name contribute to a single external module. For example, the following two declarations of an external module 'io' might be located in separate source files. + +```TypeScript +declare module "io" { + export function readFile(filename: string): string; +} + +declare module "io" { + export function writeFile(filename: string, data: string): void; +} +``` + +This has the same effect as a single combined declaration: + +```TypeScript +declare module "io" { + export function readFile(filename: string): string; + export function writeFile(filename: string, data: string): void; +} +``` + +
+ +#
A Grammar + +This appendix contains a summary of the grammar found in the main document. As described in section [2.1](#2.1), the TypeScript grammar is a superset of the grammar defined in the ECMAScript Language Specification (specifically, the ECMA-262 Standard, 5th Edition) and this appendix lists only productions that are new or modified from the ECMAScript grammar. + +## A.1 Types + +  *TypeParameters:* +   `<` *TypeParameterList* `>` + +  *TypeParameterList:* +   *TypeParameter* +   *TypeParameterList* `,` *TypeParameter* + +  *TypeParameter:* +   *Identifier* *Constraintopt* + +  *Constraint:* +   `extends` *Type* + +  *TypeArguments:* +   `<` *TypeArgumentList* `>` + +  *TypeArgumentList:* +   *TypeArgument* +   *TypeArgumentList* `,` *TypeArgument* + +  *TypeArgument:* +   *Type* + +  *Type:* +   *PrimaryOrUnionType* +   *FunctionType* +   *ConstructorType* + +  *PrimaryOrUnionType:* +   *PrimaryType* +   *UnionType* + +  *PrimaryType:* +   *ParenthesizedType* +   *PredefinedType* +   *TypeReference* +   *ObjectType* +   *ArrayType* +   *TupleType* +   *TypeQuery* + +  *ParenthesizedType:* +   `(` *Type* `)` + +  *PredefinedType:* +   `any` +   `number` +   `boolean` +   `string` +   `void` + +  *TypeReference:* +   *TypeName* *[no LineTerminator here]* *TypeArgumentsopt* + +  *TypeName:* +   *Identifier* +   *ModuleName* `.` *Identifier* + +  *ModuleName:* +   *Identifier* +   *ModuleName* `.` *Identifier* + +  *ObjectType:* +   `{` *TypeBodyopt* `}` + +  *TypeBody:* +   *TypeMemberList* `;`*opt* + +  *TypeMemberList:* +   *TypeMember* +   *TypeMemberList* `;` *TypeMember* + +  *TypeMember:* +   *PropertySignature* +   *CallSignature* +   *ConstructSignature* +   *IndexSignature* +   *MethodSignature* + +  *ArrayType:* +   *PrimaryType* *[no LineTerminator here]* `[` `]` + +  *TupleType:* +   `[` *TupleElementTypes* `]` + +  *TupleElementTypes:* +   *TupleElementType* +   *TupleElementTypes* `,` *TupleElementType* + +  *TupleElementType:* +   *Type* + +  *UnionType:* +   *PrimaryOrUnionType* `|` *PrimaryType* + +  *FunctionType:* +   *TypeParametersopt* `(` *ParameterListopt* `)` `=>` *Type* + +  *ConstructorType:* +   `new` *TypeParametersopt* `(` *ParameterListopt* `)` `=>` *Type* + +  *TypeQuery:* +   `typeof` *TypeQueryExpression* + +  *TypeQueryExpression:* +   *Identifier* +   *TypeQueryExpression* `.` *IdentifierName* + +  *PropertySignature:* +   *PropertyName* `?`*opt* *TypeAnnotationopt* + +  *PropertyName:* +   *IdentifierName* +   *StringLiteral* +   *NumericLiteral* + +  *CallSignature:* +   *TypeParametersopt* `(` *ParameterListopt* `)` *TypeAnnotationopt* + +  *ParameterList:* +   *RequiredParameterList* +   *OptionalParameterList* +   *RestParameter* +   *RequiredParameterList* `,` *OptionalParameterList* +   *RequiredParameterList* `,` *RestParameter* +   *OptionalParameterList* `,` *RestParameter* +   *RequiredParameterList* `,` *OptionalParameterList* `,` *RestParameter* + +  *RequiredParameterList:* +   *RequiredParameter* +   *RequiredParameterList* `,` *RequiredParameter* + +  *RequiredParameter:* +   *AccessibilityModifieropt* *Identifier* *TypeAnnotationopt* +   *Identifier* `:` *StringLiteral* + +  *AccessibilityModifier:* +   `public` +   `private` +   `protected` + +  *OptionalParameterList:* +   *OptionalParameter* +   *OptionalParameterList* `,` *OptionalParameter* + +  *OptionalParameter:* +   *AccessibilityModifieropt* *Identifier* `?` *TypeAnnotationopt* +   *AccessibilityModifieropt* *Identifier* *TypeAnnotationopt* *Initialiser* +   *Identifier* `?` `:` *StringLiteral* + +  *RestParameter:* +   `...` *Identifier* *TypeAnnotationopt* + +  *ConstructSignature:* +   `new` *TypeParametersopt* `(` *ParameterListopt* `)` *TypeAnnotationopt* + +  *IndexSignature:* +   `[` *Identifier* `:` `string` `]` *TypeAnnotation* +   `[` *Identifier* `:` `number` `]` *TypeAnnotation* + +  *MethodSignature:* +   *PropertyName* `?`*opt* *CallSignature* + +  *TypeAliasDeclaration:* +   `type` *Identifier* `=` *Type* `;` + +## A.2 Expressions + +  *PropertyAssignment:* *( Modified )* +   *PropertyName* `:` *AssignmentExpression* +   *PropertyName* *CallSignature* `{` *FunctionBody* `}` +   *GetAccessor* +   *SetAccessor* + +  *GetAccessor:* +   `get` *PropertyName* `(` `)` *TypeAnnotationopt* `{` *FunctionBody* `}` + +  *SetAccessor:* +   `set` *PropertyName* `(` *Identifier* *TypeAnnotationopt* `)` `{` *FunctionBody* `}` + +  *CallExpression:* *( Modified )* +   … +   `super` `(` *ArgumentListopt* `)` +   `super` `.` *IdentifierName* + +  *FunctionExpression:* *( Modified )* +   `function` *Identifieropt* *CallSignature* `{` *FunctionBody* `}` + +  *AssignmentExpression:* *( Modified )* +   … +   *ArrowFunctionExpression* + +  *ArrowFunctionExpression:* +   *ArrowFormalParameters* `=>` *Block* +   *ArrowFormalParameters* `=>` *AssignmentExpression* + +  *ArrowFormalParameters:* +   *CallSignature* +   *Identifier* + +  *Arguments:* *( Modified )* +   *TypeArgumentsopt* `(` *ArgumentListopt* `)` + +  *UnaryExpression:* *( Modified )* +   … +   `<` *Type* `>` *UnaryExpression* + +## A.3 Statements + +  *VariableDeclaration:* *( Modified )* +   *Identifier* *TypeAnnotationopt* *Initialiseropt* + +  *VariableDeclarationNoIn:* *( Modified )* +   *Identifier* *TypeAnnotationopt* *InitialiserNoInopt* + +  *TypeAnnotation:* +   `:` *Type* + +## A.4 Functions + +  *FunctionDeclaration:* *( Modified )* +   *FunctionOverloadsopt* *FunctionImplementation* + +  *FunctionOverloads:* +   *FunctionOverload* +   *FunctionOverloads* *FunctionOverload* + +  *FunctionOverload:* +   `function` *Identifier* *CallSignature* `;` + +  *FunctionImplementation:* +   `function` *Identifier* *CallSignature* `{` *FunctionBody* `}` + +## A.5 Interfaces + +  *InterfaceDeclaration:* +   `interface` *Identifier* *TypeParametersopt* *InterfaceExtendsClauseopt* *ObjectType* + +  *InterfaceExtendsClause:* +   `extends` *ClassOrInterfaceTypeList* + +  *ClassOrInterfaceTypeList:* +   *ClassOrInterfaceType* +   *ClassOrInterfaceTypeList* `,` *ClassOrInterfaceType* + +  *ClassOrInterfaceType:* +   *TypeReference* + +## A.6 Classes + +  *ClassDeclaration:* +   `class` *Identifier* *TypeParametersopt* *ClassHeritage* `{` *ClassBody* `}` + +  *ClassHeritage:* +   *ClassExtendsClauseopt* *ImplementsClauseopt* + +  *ClassExtendsClause:* +   `extends`  *ClassType* + +  *ClassType:* +   *TypeReference* + +  *ImplementsClause:* +   `implements` *ClassOrInterfaceTypeList* + +  *ClassBody:* +   *ClassElementsopt* + +  *ClassElements:* +   *ClassElement* +   *ClassElements* *ClassElement* + +  *ClassElement:* +   *ConstructorDeclaration* +   *PropertyMemberDeclaration* +   *IndexMemberDeclaration* + +  *ConstructorDeclaration:* +   *ConstructorOverloadsopt* *ConstructorImplementation* + +  *ConstructorOverloads:* +   *ConstructorOverload* +   *ConstructorOverloads* *ConstructorOverload* + +  *ConstructorOverload:* +   *AccessibilityModifieropt* `constructor` `(` *ParameterListopt* `)` `;` + +  *ConstructorImplementation:* +   *AccessibilityModifieropt* `constructor` `(` *ParameterListopt* `)` `{` *FunctionBody* `}` + +  *PropertyMemberDeclaration:* +   *MemberVariableDeclaration* +   *MemberFunctionDeclaration* +   *MemberAccessorDeclaration* + +  *MemberVariableDeclaration:* +   *AccessibilityModifieropt* `static`*opt* *PropertyName* *TypeAnnotationopt* *Initialiseropt* `;` + +  *MemberFunctionDeclaration:* +   *MemberFunctionOverloadsopt* *MemberFunctionImplementation* + +  *MemberFunctionOverloads*: +   *MemberFunctionOverload* +   *MemberFunctionOverloads* *MemberFunctionOverload* + +  *MemberFunctionOverload*: +   *AccessibilityModifieropt* `static`*opt* *PropertyName* *CallSignature* `;` + +  *MemberFunctionImplementation:* +   *AccessibilityModifieropt* `static`*opt* *PropertyName* *CallSignature* `{` *FunctionBody* `}` + +  *MemberAccessorDeclaration:* +   *AccessibilityModifieropt* `static`*opt* *GetAccessor* +   *AccessibilityModifieropt* `static`*opt* *SetAccessor* + +  *IndexMemberDeclaration:* +   *IndexSignature* `;` + +## A.7 Enums + +  *EnumDeclaration:* +   `enum` *Identifier* `{` *EnumBodyopt* `}` + +  *EnumBody*: +   *ConstantEnumMembers* `,`*opt* +   *ConstantEnumMembers* `,` *EnumMemberSections* `,`*opt* +   *EnumMemberSections* `,`*opt* + +  *ConstantEnumMembers:* +   *PropertyName* +   *ConstantEnumMembers* `,` *PropertyName* + +  *EnumMemberSections:* +   *EnumMemberSection* +   *EnumMemberSections* `,` *EnumMemberSection* + +  *EnumMemberSection:* +   *ConstantEnumMemberSection* +   *ComputedEnumMember* + +  *ConstantEnumMemberSection:* +   *PropertyName* `=` *ConstantEnumValue* +   *PropertyName* `=` *ConstantEnumValue* `,` *ConstantEnumMembers* + +  *ConstantEnumValue:* +   *SignedInteger* +   *HexIntegerLiteral* + +  *ComputedEnumMember:* +   *PropertyName* `=` *AssignmentExpression* + +## A.8 Internal Modules + +  *ModuleDeclaration:* +   `module` *IdentifierPath* `{` *ModuleBody* `}` + +  *IdentifierPath:* +   *Identifier* +   *IdentifierPath* `.` *Identifier* + +  *ModuleBody:* +   *ModuleElementsopt* + +  *ModuleElements:* +   *ModuleElement* +   *ModuleElements* *ModuleElement* + +  *ModuleElement:* +   *Statement* +   `export`*opt* *VariableDeclaration* +   `export`*opt* *FunctionDeclaration* +   `export`*opt* *ClassDeclaration* +   `export`*opt* *InterfaceDeclaration* +   `export`*opt* *TypeAliasDeclaration* +   `export`*opt* *EnumDeclaration* +   `export`*opt* *ModuleDeclaration* +   `export`*opt* *ImportDeclaration* +   `export`*opt* *AmbientDeclaration* + +  *ImportDeclaration:* +   `import` *Identifier* `=` *EntityName* `;` + +  *EntityName:* +   *ModuleName* +   *ModuleName* `.` *Identifier* + +## A.9 Source Files and External Modules + +  *SourceFile:* +   *ImplementationSourceFile* +   *DeclarationSourceFile* + +  *ImplementationSourceFile:* +   *ImplementationElementsopt* + +  *ImplementationElements:* +   *ImplementationElement* +   *ImplementationElements* *ImplementationElement* + +  *ImplementationElement:* +   *ModuleElement* +   *ExportAssignment* +   *AmbientExternalModuleDeclaration* +   `export`*opt* *ExternalImportDeclaration* + +  *DeclarationSourceFile:* +   *DeclarationElementsopt* + +  *DeclarationElements:* +   *DeclarationElement* +   *DeclarationElements* *DeclarationElement* + +  *DeclarationElement:* +   *ExportAssignment* +   *AmbientExternalModuleDeclaration* +   `export`*opt* *InterfaceDeclaration* +   `export`*opt* *TypeAliasDeclaration* +   `export`*opt* *ImportDeclaration* +   `export`*opt* *AmbientDeclaration* +   `export`*opt* *ExternalImportDeclaration* + +  *ExternalImportDeclaration:* +   `import` *Identifier* `=` *ExternalModuleReference* `;` + +  *ExternalModuleReference:* +   `require` `(` *StringLiteral* `)` + +  *ExportAssignment:* +   `export` `=` *Identifier* `;` + +## A.10 Ambients + +  *AmbientDeclaration:* +   `declare` *AmbientVariableDeclaration* +   `declare` *AmbientFunctionDeclaration* +   `declare` *AmbientClassDeclaration* +   `declare` *AmbientEnumDeclaration* +   `declare` *AmbientModuleDeclaration* + +  *AmbientVariableDeclaration:* +   `var` *Identifier*  *TypeAnnotationopt* `;` + +  *AmbientFunctionDeclaration:* +   `function` *Identifier* *CallSignature* `;` + +  *AmbientClassDeclaration:* +   `class` *Identifier* *TypeParametersopt* *ClassHeritage* `{` *AmbientClassBody* `}` + +  *AmbientClassBody:* +   *AmbientClassBodyElementsopt* + +  *AmbientClassBodyElements:* +   *AmbientClassBodyElement* +   *AmbientClassBodyElements* *AmbientClassBodyElement* + +  *AmbientClassBodyElement:* +   *AmbientConstructorDeclaration* +   *AmbientPropertyMemberDeclaration* +   *IndexSignature* + +  *AmbientConstructorDeclaration:* +   `constructor` `(` *ParameterListopt* `)` `;` + +  *AmbientPropertyMemberDeclaration:* +   *AccessibilityModifieropt* `static`*opt* *PropertyName* *TypeAnnotationopt* `;` +   *AccessibilityModifieropt* `static`*opt* *PropertyName* *CallSignature* `;` + +  *AmbientEnumDeclaration:* +   `enum` *Identifier* `{` *AmbientEnumBodyopt* `}` + +  *AmbientEnumBody:* +   *AmbientEnumMemberList* `,`*opt* + +  *AmbientEnumMemberList:* +   *AmbientEnumMember* +   *AmbientEnumMemberList* `,` *AmbientEnumMember* + +  *AmbientEnumMember:* +   *PropertyName* +   *PropertyName* = *ConstantEnumValue* + +  *AmbientModuleDeclaration:* +   `module` *IdentifierPath* `{` *AmbientModuleBody* `}` + +  *AmbientModuleBody:* +   *AmbientModuleElementsopt* + +  *AmbientModuleElements:* +   *AmbientModuleElement* +   *AmbientModuleElements* *AmbientModuleElement* + +  *AmbientModuleElement:* +   `export`*opt* *AmbientVariableDeclaration* +   `export`*opt* *AmbientFunctionDeclaration* +   `export`*opt* *AmbientClassDeclaration* +   `export`*opt* *InterfaceDeclaration* +   `export`*opt* *AmbientEnumDeclaration* +   `export`*opt* *AmbientModuleDeclaration* +   `export`*opt* *ImportDeclaration* + +  *AmbientExternalModuleDeclaration:* +   `module` *StringLiteral* `{`  *AmbientExternalModuleBody* `}` + +  *AmbientExternalModuleBody:* +   *AmbientExternalModuleElementsopt* + +  *AmbientExternalModuleElements:* +   *AmbientExternalModuleElement* +   *AmbientExternalModuleElements* *AmbientExternalModuleElement* + +  *AmbientExternalModuleElement:* +   *AmbientModuleElement* +   *ExportAssignment* +   `export`*opt* *ExternalImportDeclaration* + diff --git a/package.json b/package.json index dd1c6276a2b..00752302254 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "http://typescriptlang.org/", - "version": "1.0.1", + "version": "1.3.0", "licenses": [ { "type": "Apache License 2.0", diff --git a/scripts/importDefinitelyTypedTests.ts b/scripts/importDefinitelyTypedTests.ts index caa6be0063a..f33ba1dd525 100644 --- a/scripts/importDefinitelyTypedTests.ts +++ b/scripts/importDefinitelyTypedTests.ts @@ -33,44 +33,44 @@ function importDefinitelyTypedTest(testCaseName: string, testFiles: string[], re fs.mkdirSync(testDirectoryPath); child_process.exec(cmd, { - maxBuffer: 1 * 1024 * 1024, - cwd: testDirectoryPath - }, (error, stdout, stderr) => { - //console.log("importing " + testCaseName + " ..."); - //console.log(cmd); - - if (error) { - console.log("importing " + testCaseName + " ..."); - console.log(cmd); - console.log("==> error " + JSON.stringify(error)); - console.log("==> stdout " + String(stdout)); - console.log("==> stderr " + String(stderr)); - console.log("\r\n"); - return; - } - - // copy generated file to output location - var outputFilePath = path.join(testDirectoryPath, "iocapture0.json"); - var testCasePath = path.join(rwcTestPath, "DefinitelyTyped_" + testCaseName + ".json"); - copyFileSync(outputFilePath, testCasePath); - - //console.log("output generated at: " + outputFilePath); - - if (!fs.existsSync(testCasePath)) { - throw new Error("could not find test case at: " + testCasePath); - } - else { - fs.unlinkSync(outputFilePath); - fs.rmdirSync(testDirectoryPath); - //console.log("testcase generated at: " + testCasePath); - //console.log("Done."); - } - //console.log("\r\n"); - - }) - .on('error', function (error) { - console.log("==> error " + JSON.stringify(error)); - console.log("\r\n"); + maxBuffer: 1 * 1024 * 1024, + cwd: testDirectoryPath + }, (error, stdout, stderr) => { + console.log("importing " + testCaseName + " ..."); + console.log(cmd); + + if (error) { + console.log("importing " + testCaseName + " ..."); + console.log(cmd); + console.log("==> error " + JSON.stringify(error)); + console.log("==> stdout " + String(stdout)); + console.log("==> stderr " + String(stderr)); + console.log("\r\n"); + return; + } + + // copy generated file to output location + var outputFilePath = path.join(testDirectoryPath, "iocapture0.json"); + var testCasePath = path.join(rwcTestPath, "DefinitelyTyped_" + testCaseName + ".json"); + copyFileSync(outputFilePath, testCasePath); + + //console.log("output generated at: " + outputFilePath); + + if (!fs.existsSync(testCasePath)) { + throw new Error("could not find test case at: " + testCasePath); + } + else { + fs.unlinkSync(outputFilePath); + fs.rmdirSync(testDirectoryPath); + //console.log("testcase generated at: " + testCasePath); + //console.log("Done."); + } + //console.log("\r\n"); + + }) + .on('error', function (error) { + console.log("==> error " + JSON.stringify(error)); + console.log("\r\n"); }); } @@ -79,7 +79,8 @@ function importDefinitelyTypedTests(definitelyTypedRoot: string): void { if (err) throw err; subDirectorys - .filter(d => ["_infrastructure", "node_modules", ".git"].indexOf(d) >= 0) + .filter(d => ["_infrastructure", "node_modules", ".git"].indexOf(d) < 0) + .filter(i => i.indexOf("sipml") >=0 ) .filter(i => fs.statSync(path.join(definitelyTypedRoot, i)).isDirectory()) .forEach(d => { var directoryPath = path.join(definitelyTypedRoot, d); diff --git a/scripts/importDefinitllyTypedTests.ts b/scripts/importDefinitllyTypedTests.ts deleted file mode 100644 index caa6be0063a..00000000000 --- a/scripts/importDefinitllyTypedTests.ts +++ /dev/null @@ -1,124 +0,0 @@ -declare var require: any, process: any; -declare var __dirname: any; - -var fs = require("fs"); -var path = require("path"); -var child_process = require('child_process'); - -var tscRoot = path.join(__dirname, "..\\"); -var tscPath = path.join(tscRoot, "built", "instrumented", "tsc.js"); -var rwcTestPath = path.join(tscRoot, "tests", "cases", "rwc", "dt"); -var definitelyTypedRoot = process.argv[2]; - -function fileExtensionIs(path: string, extension: string): boolean { - var pathLen = path.length; - var extLen = extension.length; - return pathLen > extLen && path.substr(pathLen - extLen, extLen).toLocaleLowerCase() === extension.toLocaleLowerCase(); -} - -function copyFileSync(source, destination) { - var text = fs.readFileSync(source); - fs.writeFileSync(destination, text); -} - -function importDefinitelyTypedTest(testCaseName: string, testFiles: string[], responseFile: string ) { - var cmd = "node " + tscPath + " --module commonjs " + testFiles.join(" "); - if (responseFile) cmd += " @" + responseFile; - - var testDirectoryName = testCaseName + "_" + Math.floor((Math.random() * 10000) + 1); - var testDirectoryPath = path.join(process.env["temp"], testDirectoryName); - if (fs.existsSync(testDirectoryPath)) { - throw new Error("Could not create test directory"); - } - fs.mkdirSync(testDirectoryPath); - - child_process.exec(cmd, { - maxBuffer: 1 * 1024 * 1024, - cwd: testDirectoryPath - }, (error, stdout, stderr) => { - //console.log("importing " + testCaseName + " ..."); - //console.log(cmd); - - if (error) { - console.log("importing " + testCaseName + " ..."); - console.log(cmd); - console.log("==> error " + JSON.stringify(error)); - console.log("==> stdout " + String(stdout)); - console.log("==> stderr " + String(stderr)); - console.log("\r\n"); - return; - } - - // copy generated file to output location - var outputFilePath = path.join(testDirectoryPath, "iocapture0.json"); - var testCasePath = path.join(rwcTestPath, "DefinitelyTyped_" + testCaseName + ".json"); - copyFileSync(outputFilePath, testCasePath); - - //console.log("output generated at: " + outputFilePath); - - if (!fs.existsSync(testCasePath)) { - throw new Error("could not find test case at: " + testCasePath); - } - else { - fs.unlinkSync(outputFilePath); - fs.rmdirSync(testDirectoryPath); - //console.log("testcase generated at: " + testCasePath); - //console.log("Done."); - } - //console.log("\r\n"); - - }) - .on('error', function (error) { - console.log("==> error " + JSON.stringify(error)); - console.log("\r\n"); - }); -} - -function importDefinitelyTypedTests(definitelyTypedRoot: string): void { - fs.readdir(definitelyTypedRoot, (err, subDirectorys) => { - if (err) throw err; - - subDirectorys - .filter(d => ["_infrastructure", "node_modules", ".git"].indexOf(d) >= 0) - .filter(i => fs.statSync(path.join(definitelyTypedRoot, i)).isDirectory()) - .forEach(d => { - var directoryPath = path.join(definitelyTypedRoot, d); - fs.readdir(directoryPath, function (err, files) { - if (err) throw err; - - var tsFiles = []; - var testFiles = []; - var paramFile; - - files - .map(f => path.join(directoryPath, f)) - .forEach(f => { - if (fileExtensionIs(f, ".ts")) tsFiles.push(f); - else if (fileExtensionIs(f, ".tscparams")) paramFile = f; - - if (fileExtensionIs(f, "-tests.ts")) testFiles.push(f); - }); - - if (testFiles.length === 0) { - // no test files but multiple d.ts's, e.g. winjs - var regexp = new RegExp(d + "(([-][0-9])|([\.]d[\.]ts))"); - if (tsFiles.length > 1 && tsFiles.every(t => fileExtensionIs(t, ".d.ts") && regexp.test(t))) { - tsFiles.forEach(filename => { - importDefinitelyTypedTest(path.basename(filename, ".d.ts"), [filename], paramFile); - }); - } - else { - importDefinitelyTypedTest(d, tsFiles, paramFile); - } - } - else { - testFiles.forEach(filename => { - importDefinitelyTypedTest(path.basename(filename, "-tests.ts"), [filename], paramFile); - }); - } - }); - }) - }); -} - -importDefinitelyTypedTests(definitelyTypedRoot); \ No newline at end of file diff --git a/scripts/ior.ts b/scripts/ior.ts new file mode 100644 index 00000000000..f0c142a266c --- /dev/null +++ b/scripts/ior.ts @@ -0,0 +1,123 @@ +/// + +import fs = require('fs'); +import path = require('path'); + +interface IOLog { + filesRead: { + path: string; + result: { contents: string; }; + }[]; + arguments: string[]; +} + +module Commands { + export function dir(obj: IOLog) { + obj.filesRead.filter(f => f.result !== undefined).forEach(f => { + console.log(f.path); + }); + } + dir['description'] = ': displays a list of files'; + + export function find(obj: IOLog, str: string) { + obj.filesRead.filter(f => f.result !== undefined).forEach(f => { + var lines = f.result.contents.split('\n'); + var printedHeader = false; + lines.forEach(line => { + if (line.indexOf(str) >= 0) { + if (!printedHeader) { + console.log(' === ' + f.path + ' ==='); + printedHeader = true; + } + console.log(line); + } + }); + }); + } + find['description'] = ' string: finds text in files'; + + export function grab(obj: IOLog, filename: string) { + obj.filesRead.filter(f => f.result !== undefined).forEach(f => { + if (path.basename(f.path) === filename) { + fs.writeFile(filename, f.result.contents); + } + }); + } + grab['description'] = ' filename.ts: writes out the specified file to disk'; + + export function extract(obj: IOLog, outputFolder: string) { + var directorySeparator = "/"; + function directoryExists(path: string): boolean { + return fs.existsSync(path) && fs.statSync(path).isDirectory(); + } + function getDirectoryPath(path: string) { + return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(directorySeparator))); + } + function getRootLength(path: string): number { + if (path.charAt(0) === directorySeparator) { + if (path.charAt(1) !== directorySeparator) return 1; + var p1 = path.indexOf(directorySeparator, 2); + if (p1 < 0) return 2; + var p2 = path.indexOf(directorySeparator, p1 + 1); + if (p2 < 0) return p1 + 1; + return p2 + 1; + } + if (path.charAt(1) === ":") { + if (path.charAt(2) === directorySeparator) return 3; + return 2; + } + return 0; + } + function ensureDirectoriesExist(directoryPath: string) { + if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) { + var parentDirectory = getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory); + console.log("creating directory: " + directoryPath); + fs.mkdirSync(directoryPath); + } + } + function transalatePath(outputFolder:string, path: string): string { + return outputFolder + directorySeparator + path.replace(":", ""); + } + function fileExists(path: string): boolean { + return fs.existsSync(path); + } + obj.filesRead.forEach(f => { + var filename = transalatePath(outputFolder, f.path); + ensureDirectoriesExist(getDirectoryPath(filename)); + console.log("writing filename: " + filename); + fs.writeFile(filename, f.result.contents, (err) => { }); + }); + + console.log("Command: tsc "); + obj.arguments.forEach(a => { + if (getRootLength(a) > 0) { + console.log(transalatePath(outputFolder, a)); + } + else { + console.log(a); + } + console.log(" "); + }); + } + extract['description'] = ' outputFolder: extract all input files to '; +} + +var args = process.argv.slice(2); +if (args.length < 2) { + console.log('Usage: node ior.js path_to_file.json [command]'); + console.log('List of commands: '); + Object.keys(Commands).forEach(k => console.log(' ' + k + Commands[k]['description'])); +} else { + var cmd: Function = Commands[args[1]]; + if (cmd === undefined) { + console.log('Unknown command ' + args[1]); + } else { + fs.readFile(args[0], 'utf-8', (err, data) => { + if (err) throw err; + var json = JSON.parse(data); + cmd.apply(undefined, [json].concat(args.slice(2))); + }); + } +} + diff --git a/scripts/processDiagnosticMessages.ts b/scripts/processDiagnosticMessages.ts index 6a4aaad9f93..eccfb821bb2 100644 --- a/scripts/processDiagnosticMessages.ts +++ b/scripts/processDiagnosticMessages.ts @@ -3,6 +3,7 @@ interface DiagnosticDetails { category: string; code: number; + isEarly?: boolean; } interface InputDiagnosticMessageTable { @@ -63,8 +64,9 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap: ' ' + convertPropertyName(nameMap[name]) + ': { code: ' + diagnosticDetails.code + ', category: DiagnosticCategory.' + diagnosticDetails.category + - ', key: "' + name.replace('"', '\\"') + - '" },\r\n'; + ', key: "' + name.replace('"', '\\"') + '"' + + (diagnosticDetails.isEarly ? ', isEarly: true' : '') + + ' },\r\n'; } result += ' };\r\n}'; diff --git a/scripts/word2md.js b/scripts/word2md.js new file mode 100644 index 00000000000..0645acbb143 --- /dev/null +++ b/scripts/word2md.js @@ -0,0 +1,212 @@ +var sys = (function () { + var fileStream = new ActiveXObject("ADODB.Stream"); + fileStream.Type = 2; + var binaryStream = new ActiveXObject("ADODB.Stream"); + binaryStream.Type = 1; + var args = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + return { + args: args, + createObject: function (typeName) { return new ActiveXObject(typeName); }, + write: function (s) { + WScript.StdOut.Write(s); + }, + writeFile: function (fileName, data) { + fileStream.Open(); + binaryStream.Open(); + try { + fileStream.Charset = "utf-8"; + fileStream.WriteText(data); + fileStream.Position = 3; + fileStream.CopyTo(binaryStream); + binaryStream.SaveToFile(fileName, 2); + } + finally { + binaryStream.Close(); + fileStream.Close(); + } + } + }; +})(); +function convertDocumentToMarkdown(doc) { + var result = ""; + var lastStyle; + var lastInTable; + var tableColumnCount; + var tableCellIndex; + var columnAlignment = []; + function setProperties(target, properties) { + for (var name in properties) { + if (properties.hasOwnProperty(name)) { + var value = properties[name]; + if (typeof value === "object") { + setProperties(target[name], value); + } + else { + target[name] = value; + } + } + } + } + function findReplace(findText, findOptions, replaceText, replaceOptions) { + var find = doc.range().find; + find.clearFormatting(); + setProperties(find, findOptions); + var replace = find.replacement; + replace.clearFormatting(); + setProperties(replace, replaceOptions); + find.execute(findText, false, false, false, false, false, true, 0, true, replaceText, 2); + } + function write(s) { + result += s; + } + function writeTableHeader() { + for (var i = 0; i < tableColumnCount - 1; i++) { + switch (columnAlignment[i]) { + case 1: + write("|:---:"); + break; + case 2: + write("|---:"); + break; + default: + write("|---"); + } + } + write("|\n"); + } + function trimEndFormattingMarks(text) { + var i = text.length; + while (i > 0 && text.charCodeAt(i - 1) < 0x20) + i--; + return text.substr(0, i); + } + function writeBlockEnd() { + switch (lastStyle) { + case "Code": + write("```\n\n"); + break; + case "List Paragraph": + case "Table": + case "TOC": + write("\n"); + break; + } + } + function writeParagraph(p) { + var text = p.range.text; + var style = p.style.nameLocal; + var inTable = p.range.tables.count > 0; + var level = 1; + var sectionBreak = text.indexOf("\x0C") >= 0; + text = trimEndFormattingMarks(text); + if (inTable) { + style = "Table"; + } + else if (style.match(/\s\d$/)) { + level = +style.substr(style.length - 1); + style = style.substr(0, style.length - 2); + } + if (lastStyle && style !== lastStyle) { + writeBlockEnd(); + } + switch (style) { + case "Heading": + case "Appendix": + var section = p.range.listFormat.listString; + write("####".substr(0, level) + ' ' + section + " " + text + "\n\n"); + break; + case "Normal": + if (text.length) { + write(text + "\n\n"); + } + break; + case "List Paragraph": + write(" ".substr(0, p.range.listFormat.listLevelNumber * 2 - 2) + "* " + text + "\n"); + break; + case "Grammar": + write("  " + text.replace(/\s\s\s/g, " ").replace(/\x0B/g, " \n   ") + "\n\n"); + break; + case "Code": + if (lastStyle !== "Code") { + write("```TypeScript\n"); + } + else { + write("\n"); + } + write(text.replace(/\x0B/g, " \n") + "\n"); + break; + case "Table": + if (!lastInTable) { + tableColumnCount = p.range.tables.item(1).columns.count + 1; + tableCellIndex = 0; + } + if (tableCellIndex < tableColumnCount) { + columnAlignment[tableCellIndex] = p.alignment; + } + write("|" + text); + tableCellIndex++; + if (tableCellIndex % tableColumnCount === 0) { + write("\n"); + if (tableCellIndex === tableColumnCount) { + writeTableHeader(); + } + } + break; + case "TOC Heading": + write("## " + text + "\n\n"); + break; + case "TOC": + var strings = text.split("\t"); + write(" ".substr(0, level * 2 - 2) + "* [" + strings[0] + " " + strings[1] + "](#" + strings[0] + ")\n"); + break; + } + if (sectionBreak) { + write("
\n\n"); + } + lastStyle = style; + lastInTable = inTable; + } + function writeDocument() { + var title = doc.builtInDocumentProperties.item(1) + ""; + if (title.length) { + write("# " + title + "\n\n"); + } + for (var p = doc.paragraphs.first; p; p = p.next()) { + writeParagraph(p); + } + writeBlockEnd(); + } + findReplace("<", {}, "<", {}); + findReplace("<", { style: "Code" }, "<", {}); + findReplace("<", { style: "Code Fragment" }, "<", {}); + findReplace("<", { style: "Terminal" }, "<", {}); + findReplace("", { font: { subscript: true } }, "^&", { font: { subscript: false } }); + findReplace("", { style: "Code Fragment" }, "`^&`", { style: -66 }); + findReplace("", { style: "Production" }, "*^&*", { style: -66 }); + findReplace("", { style: "Terminal" }, "`^&`", { style: -66 }); + findReplace("", { font: { bold: true, italic: true } }, "***^&***", { font: { bold: false, italic: false } }); + findReplace("", { font: { italic: true } }, "*^&*", { font: { italic: false } }); + doc.fields.toggleShowCodes(); + findReplace("^19 REF", {}, "[^&](#^&)", {}); + doc.fields.toggleShowCodes(); + writeDocument(); + result = result.replace(/\x85/g, "\u2026"); + result = result.replace(/\x96/g, "\u2013"); + result = result.replace(/\x97/g, "\u2014"); + return result; +} +function main(args) { + if (args.length !== 2) { + sys.write("Syntax: word2md \n"); + return; + } + var app = sys.createObject("Word.Application"); + var doc = app.documents.open(args[0]); + sys.writeFile(args[1], convertDocumentToMarkdown(doc)); + doc.close(false); + app.quit(); +} +main(sys.args); diff --git a/scripts/word2md.ts b/scripts/word2md.ts new file mode 100644 index 00000000000..65b39d6e4f6 --- /dev/null +++ b/scripts/word2md.ts @@ -0,0 +1,371 @@ +// word2md - Word to Markdown conversion tool +// +// word2md converts a Microsoft Word document to Markdown formatted text. The tool uses the +// Word Automation APIs to start an instance of Word and access the contents of the document +// being converted. The tool must be run using the cscript.exe script host and requires Word +// to be installed on the target machine. The name of the document to convert must be specified +// as a command line argument and the resulting Markdown is written to standard output. The +// tool recognizes the specific Word styles used in the TypeScript Language Specification. + +module Word { + + export interface Collection { + count: number; + item(index: number): T; + } + + export interface Font { + bold: boolean; + italic: boolean; + subscript: boolean; + superscript: boolean; + } + + export interface Find { + font: Font; + format: boolean; + replacement: Replacement; + style: any; + text: string; + clearFormatting(): void; + execute( + findText: string, + matchCase: boolean, + matchWholeWord: boolean, + matchWildcards: boolean, + matchSoundsLike: boolean, + matchAllWordForms: boolean, + forward: boolean, + wrap: number, + format: boolean, + replaceWith: string, + replace: number): boolean; + } + + export interface Replacement { + font: Font; + style: any; + text: string; + clearFormatting(): void; + } + + export interface ListFormat { + listLevelNumber: number; + listString: string; + } + + export interface Column { + } + + export interface Columns extends Collection { + } + + export interface Table { + columns: Columns; + } + + export interface Tables extends Collection { + } + + export interface Range { + find: Find; + listFormat: ListFormat; + tables: Tables; + text: string; + words: Ranges; + } + + export interface Ranges extends Collection { + } + + export interface Style { + nameLocal: string; + } + + export interface Paragraph { + alignment: number; + range: Range; + style: Style; + next(): Paragraph; + } + + export interface Paragraphs extends Collection { + first: Paragraph; + } + + export interface Field { + } + + export interface Fields extends Collection { + toggleShowCodes(): void; + } + + export interface Document { + fields: Fields; + paragraphs: Paragraphs; + builtInDocumentProperties: Collection; + close(saveChanges: boolean): void; + range(): Range; + } + + export interface Documents extends Collection { + open(filename: string): Document; + } + + export interface Application { + documents: Documents; + quit(): void; + } +} + +var sys = (function () { + var fileStream = new ActiveXObject("ADODB.Stream"); + fileStream.Type = 2 /*text*/; + var binaryStream = new ActiveXObject("ADODB.Stream"); + binaryStream.Type = 1 /*binary*/; + var args: string[] = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + return { + args: args, + createObject: (typeName: string) => new ActiveXObject(typeName), + write(s: string): void { + WScript.StdOut.Write(s); + }, + writeFile: (fileName: string, data: string): void => { + fileStream.Open(); + binaryStream.Open(); + try { + // Write characters in UTF-8 encoding + fileStream.Charset = "utf-8"; + fileStream.WriteText(data); + // We don't want the BOM, skip it by setting the starting location to 3 (size of BOM). + fileStream.Position = 3; + fileStream.CopyTo(binaryStream); + binaryStream.SaveToFile(fileName, 2 /*overwrite*/); + } + finally { + binaryStream.Close(); + fileStream.Close(); + } + } + }; +})(); + +interface FindReplaceOptions { + style?: any; + font?: { + bold?: boolean; + italic?: boolean; + subscript?: boolean; + }; +} + +function convertDocumentToMarkdown(doc: Word.Document): string { + + var result: string = ""; + var lastStyle: string; + var lastInTable: boolean; + var tableColumnCount: number; + var tableCellIndex: number; + var columnAlignment: number[] = []; + + function setProperties(target: any, properties: any) { + for (var name in properties) { + if (properties.hasOwnProperty(name)) { + var value = properties[name]; + if (typeof value === "object") { + setProperties(target[name], value); + } + else { + target[name] = value; + } + } + } + } + + function findReplace(findText: string, findOptions: FindReplaceOptions, replaceText: string, replaceOptions: FindReplaceOptions) { + var find = doc.range().find; + find.clearFormatting(); + setProperties(find, findOptions); + var replace = find.replacement; + replace.clearFormatting(); + setProperties(replace, replaceOptions); + find.execute(findText, false, false, false, false, false, true, 0, true, replaceText, 2); + } + + function write(s: string) { + result += s; + } + + function writeTableHeader() { + for (var i = 0; i < tableColumnCount - 1; i++) { + switch (columnAlignment[i]) { + case 1: + write("|:---:"); + break; + case 2: + write("|---:"); + break; + default: + write("|---"); + } + } + write("|\n"); + } + + function trimEndFormattingMarks(text: string) { + var i = text.length; + while (i > 0 && text.charCodeAt(i - 1) < 0x20) i--; + return text.substr(0, i); + } + + function writeBlockEnd() { + switch (lastStyle) { + case "Code": + write("```\n\n"); + break; + case "List Paragraph": + case "Table": + case "TOC": + write("\n"); + break; + } + } + + function writeParagraph(p: Word.Paragraph) { + + var text = p.range.text; + var style = p.style.nameLocal; + var inTable = p.range.tables.count > 0; + var level = 1; + var sectionBreak = text.indexOf("\x0C") >= 0; + + text = trimEndFormattingMarks(text); + if (inTable) { + style = "Table"; + } + else if (style.match(/\s\d$/)) { + level = +style.substr(style.length - 1); + style = style.substr(0, style.length - 2); + } + if (lastStyle && style !== lastStyle) { + writeBlockEnd(); + } + + switch (style) { + + case "Heading": + case "Appendix": + var section = p.range.listFormat.listString; + write("####".substr(0, level) + ' ' + section + " " + text + "\n\n"); + break; + + case "Normal": + if (text.length) { + write(text + "\n\n"); + } + break; + + case "List Paragraph": + write(" ".substr(0, p.range.listFormat.listLevelNumber * 2 - 2) + "* " + text + "\n"); + break; + + case "Grammar": + write("  " + text.replace(/\s\s\s/g, " ").replace(/\x0B/g, " \n   ") + "\n\n"); + break; + + case "Code": + if (lastStyle !== "Code") { + write("```TypeScript\n"); + } + else { + write("\n"); + } + write(text.replace(/\x0B/g, " \n") + "\n"); + break; + + case "Table": + if (!lastInTable) { + tableColumnCount = p.range.tables.item(1).columns.count + 1; + tableCellIndex = 0; + } + if (tableCellIndex < tableColumnCount) { + columnAlignment[tableCellIndex] = p.alignment; + } + write("|" + text); + tableCellIndex++; + if (tableCellIndex % tableColumnCount === 0) { + write("\n"); + if (tableCellIndex === tableColumnCount) { + writeTableHeader(); + } + } + break; + + case "TOC Heading": + write("## " + text + "\n\n"); + break; + + case "TOC": + var strings = text.split("\t"); + write(" ".substr(0, level * 2 - 2) + "* [" + strings[0] + " " + strings[1] + "](#" + strings[0] + ")\n"); + break; + } + + if (sectionBreak) { + write("
\n\n"); + } + lastStyle = style; + lastInTable = inTable; + } + + function writeDocument() { + var title = doc.builtInDocumentProperties.item(1) + ""; + if (title.length) { + write("# " + title + "\n\n"); + } + for (var p = doc.paragraphs.first; p; p = p.next()) { + writeParagraph(p); + } + writeBlockEnd(); + } + + findReplace("<", {}, "<", {}); + findReplace("<", { style: "Code" }, "<", {}); + findReplace("<", { style: "Code Fragment" }, "<", {}); + findReplace("<", { style: "Terminal" }, "<", {}); + findReplace("", { font: { subscript: true } }, "^&", { font: { subscript: false } }); + findReplace("", { style: "Code Fragment" }, "`^&`", { style: -66 /* default font */ }); + findReplace("", { style: "Production" }, "*^&*", { style: -66 /* default font */}); + findReplace("", { style: "Terminal" }, "`^&`", { style: -66 /* default font */}); + findReplace("", { font: { bold: true, italic: true } }, "***^&***", { font: { bold: false, italic: false } }); + findReplace("", { font: { italic: true } }, "*^&*", { font: { italic: false } }); + + doc.fields.toggleShowCodes(); + findReplace("^19 REF", {}, "[^&](#^&)", {}); + doc.fields.toggleShowCodes(); + + writeDocument(); + + result = result.replace(/\x85/g, "\u2026"); + result = result.replace(/\x96/g, "\u2013"); + result = result.replace(/\x97/g, "\u2014"); + + return result; +} + +function main(args: string[]) { + if (args.length !== 2) { + sys.write("Syntax: word2md \n"); + return; + } + var app: Word.Application = sys.createObject("Word.Application"); + var doc = app.documents.open(args[0]); + sys.writeFile(args[1], convertDocumentToMarkdown(doc)); + doc.close(false); + app.quit(); +} + +main(sys.args); diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index bae4b6abb3c..1a1075d9d9e 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -5,25 +5,51 @@ module ts { - export function isInstantiated(node: Node): boolean { + export const enum ModuleInstanceState { + NonInstantiated = 0, + Instantiated = 1, + ConstEnumOnly = 2 + } + + export function getModuleInstanceState(node: Node): ModuleInstanceState { // A module is uninstantiated if it contains only // 1. interface declarations if (node.kind === SyntaxKind.InterfaceDeclaration) { - return false; + return ModuleInstanceState.NonInstantiated; } - // 2. non - exported import declarations + // 2. const enum declarations don't make module instantiated + else if (isConstEnumDeclaration(node)) { + return ModuleInstanceState.ConstEnumOnly; + } + // 3. non - exported import declarations else if (node.kind === SyntaxKind.ImportDeclaration && !(node.flags & NodeFlags.Export)) { - return false; + return ModuleInstanceState.NonInstantiated; } - // 3. other uninstantiated module declarations. - else if (node.kind === SyntaxKind.ModuleBlock && !forEachChild(node, isInstantiated)) { - return false; + // 4. other uninstantiated module declarations. + else if (node.kind === SyntaxKind.ModuleBlock) { + var state = ModuleInstanceState.NonInstantiated; + forEachChild(node, n => { + switch (getModuleInstanceState(n)) { + case ModuleInstanceState.NonInstantiated: + // child is non-instantiated - continue searching + return false; + case ModuleInstanceState.ConstEnumOnly: + // child is const enum only - record state and continue searching + state = ModuleInstanceState.ConstEnumOnly; + return false; + case ModuleInstanceState.Instantiated: + // child is instantiated - record state and stop + state = ModuleInstanceState.Instantiated; + return true; + } + }); + return state; } - else if (node.kind === SyntaxKind.ModuleDeclaration && !isInstantiated((node).body)) { - return false; + else if (node.kind === SyntaxKind.ModuleDeclaration) { + return getModuleInstanceState((node).body); } else { - return true; + return ModuleInstanceState.Instantiated; } } @@ -31,13 +57,14 @@ module ts { var parent: Node; var container: Declaration; + var blockScopeContainer: Node; var lastContainer: Declaration; var symbolCount = 0; var Symbol = objectAllocator.getSymbolConstructor(); if (!file.locals) { file.locals = {}; - container = file; + container = blockScopeContainer = file; bind(file); file.symbolCount = symbolCount; } @@ -57,23 +84,30 @@ module ts { if (symbolKind & SymbolFlags.Value && !symbol.valueDeclaration) symbol.valueDeclaration = node; } + // TODO(jfreeman): Implement getDeclarationName for property name function getDeclarationName(node: Declaration): string { if (node.name) { if (node.kind === SyntaxKind.ModuleDeclaration && node.name.kind === SyntaxKind.StringLiteral) { - return '"' + node.name.text + '"'; + return '"' + (node.name).text + '"'; } - return node.name.text; + return (node.name).text; } switch (node.kind) { - case SyntaxKind.Constructor: return "__constructor"; - case SyntaxKind.CallSignature: return "__call"; - case SyntaxKind.ConstructSignature: return "__new"; - case SyntaxKind.IndexSignature: return "__index"; + case SyntaxKind.ConstructorType: + case SyntaxKind.Constructor: + return "__constructor"; + case SyntaxKind.FunctionType: + case SyntaxKind.CallSignature: + return "__call"; + case SyntaxKind.ConstructSignature: + return "__new"; + case SyntaxKind.IndexSignature: + return "__index"; } } function getDisplayName(node: Declaration): string { - return node.name ? identifierToString(node.name) : getDeclarationName(node); + return node.name ? declarationNameToString(node.name) : getDeclarationName(node); } function declareSymbol(symbols: SymbolTable, parent: Symbol, node: Declaration, includes: SymbolFlags, excludes: SymbolFlags): Symbol { @@ -84,8 +118,17 @@ module ts { if (node.name) { node.name.parent = node; } - file.semanticErrors.push(createDiagnosticForNode(node.name ? node.name : node, - Diagnostics.Duplicate_identifier_0, getDisplayName(node))); + // Report errors every position with duplicate declaration + // Report errors on previous encountered declarations + var message = symbol.flags & SymbolFlags.BlockScopedVariable + ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : Diagnostics.Duplicate_identifier_0; + + forEach(symbol.declarations, declaration => { + file.semanticDiagnostics.push(createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); + }); + file.semanticDiagnostics.push(createDiagnosticForNode(node.name, message, getDisplayName(node))); + symbol = createSymbol(0, name); } } @@ -105,7 +148,7 @@ module ts { if (node.name) { node.name.parent = node; } - file.semanticErrors.push(createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], + file.semanticDiagnostics.push(createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } symbol.exports[prototypeSymbol.name] = prototypeSymbol; @@ -162,12 +205,13 @@ module ts { // All container nodes are kept on a linked list in declaration order. This list is used by the getLocalNameOfContainer function // in the type checker to validate that the local name used for a container is unique. - function bindChildren(node: Declaration, symbolKind: SymbolFlags) { + function bindChildren(node: Declaration, symbolKind: SymbolFlags, isBlockScopeContainer: boolean) { if (symbolKind & SymbolFlags.HasLocals) { node.locals = {}; } var saveParent = parent; var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; parent = node; if (symbolKind & SymbolFlags.IsContainer) { container = node; @@ -179,12 +223,16 @@ module ts { lastContainer = container; } } + if (isBlockScopeContainer) { + blockScopeContainer = node; + } forEachChild(node, bind); container = saveContainer; parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; } - function bindDeclaration(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags) { + function bindDeclaration(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags, isBlockScopeContainer: boolean) { switch (container.kind) { case SyntaxKind.ModuleDeclaration: declareModuleMember(node, symbolKind, symbolExcludes); @@ -194,6 +242,8 @@ module ts { declareModuleMember(node, symbolKind, symbolExcludes); break; } + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: case SyntaxKind.IndexSignature: @@ -220,121 +270,204 @@ module ts { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindConstructorDeclaration(node: ConstructorDeclaration) { - bindDeclaration(node, SymbolFlags.Constructor, 0); + bindDeclaration(node, SymbolFlags.Constructor, 0, /*isBlockScopeContainer*/ true); forEach(node.parameters, p => { - if (p.flags & (NodeFlags.Public | NodeFlags.Private)) { - bindDeclaration(p, SymbolFlags.Property, SymbolFlags.PropertyExcludes); + if (p.flags & (NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected)) { + bindDeclaration(p, SymbolFlags.Property, SymbolFlags.PropertyExcludes, /*isBlockScopeContainer*/ false); } }); } function bindModuleDeclaration(node: ModuleDeclaration) { if (node.name.kind === SyntaxKind.StringLiteral) { - bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes); - } - else if (isInstantiated(node)) { - bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes); + bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes, /*isBlockScopeContainer*/ true); } else { - bindDeclaration(node, SymbolFlags.NamespaceModule, SymbolFlags.NamespaceModuleExcludes); + var state = getModuleInstanceState(node); + if (state === ModuleInstanceState.NonInstantiated) { + bindDeclaration(node, SymbolFlags.NamespaceModule, SymbolFlags.NamespaceModuleExcludes, /*isBlockScopeContainer*/ true); + } + else { + bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes, /*isBlockScopeContainer*/ true); + if (state === ModuleInstanceState.ConstEnumOnly) { + // mark value module as module that contains only enums + node.symbol.constEnumOnlyModule = true; + } + else if (node.symbol.constEnumOnlyModule) { + // const only value module was merged with instantiated module - reset flag + node.symbol.constEnumOnlyModule = false; + } + } } } - function bindAnonymousDeclaration(node: Node, symbolKind: SymbolFlags, name: string) { + function bindFunctionOrConstructorType(node: SignatureDeclaration) { + // For a given function symbol "<...>(...) => T" we want to generate a symbol identical + // to the one we would get for: { <...>(...): T } + // + // We do that by making an anonymous type literal symbol, and then setting the function + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // from an actual type literal symbol you would have gotten had you used the long form. + + var symbolKind = node.kind === SyntaxKind.FunctionType ? SymbolFlags.CallSignature : SymbolFlags.ConstructSignature; + var symbol = createSymbol(symbolKind, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, symbolKind); + bindChildren(node, symbolKind, /*isBlockScopeContainer:*/ false); + + var typeLiteralSymbol = createSymbol(SymbolFlags.TypeLiteral, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, SymbolFlags.TypeLiteral); + typeLiteralSymbol.members = {}; + typeLiteralSymbol.members[node.kind === SyntaxKind.FunctionType ? "__call" : "__new"] = symbol + } + + function bindAnonymousDeclaration(node: Node, symbolKind: SymbolFlags, name: string, isBlockScopeContainer: boolean) { var symbol = createSymbol(symbolKind, name); addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindCatchVariableDeclaration(node: CatchBlock) { - var symbol = createSymbol(SymbolFlags.Variable, node.variable.text || "__missing"); - addDeclarationToSymbol(symbol, node, SymbolFlags.Variable); + var symbol = createSymbol(SymbolFlags.FunctionScopedVariable, node.variable.text || "__missing"); + addDeclarationToSymbol(symbol, node, SymbolFlags.FunctionScopedVariable); var saveParent = parent; - parent = node; + var savedBlockScopeContainer = blockScopeContainer; + parent = blockScopeContainer = node; forEachChild(node, bind); parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + + function bindBlockScopedVariableDeclaration(node: Declaration) { + switch (blockScopeContainer.kind) { + case SyntaxKind.ModuleDeclaration: + declareModuleMember(node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes); + break; + case SyntaxKind.SourceFile: + if (isExternalModule(container)) { + declareModuleMember(node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + } + declareSymbol(blockScopeContainer.locals, undefined, node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes); + } + + bindChildren(node, SymbolFlags.BlockScopedVariable, /*isBlockScopeContainer*/ false); } function bind(node: Node) { node.parent = parent; switch (node.kind) { case SyntaxKind.TypeParameter: - bindDeclaration(node, SymbolFlags.TypeParameter, SymbolFlags.TypeParameterExcludes); + bindDeclaration(node, SymbolFlags.TypeParameter, SymbolFlags.TypeParameterExcludes, /*isBlockScopeContainer*/ false); break; case SyntaxKind.Parameter: - bindDeclaration(node, SymbolFlags.Variable, SymbolFlags.ParameterExcludes); + bindDeclaration(node, SymbolFlags.FunctionScopedVariable, SymbolFlags.ParameterExcludes, /*isBlockScopeContainer*/ false); break; case SyntaxKind.VariableDeclaration: - bindDeclaration(node, SymbolFlags.Variable, SymbolFlags.VariableExcludes); + if (node.flags & NodeFlags.BlockScoped) { + bindBlockScopedVariableDeclaration(node); + } + else { + bindDeclaration(node, SymbolFlags.FunctionScopedVariable, SymbolFlags.FunctionScopedVariableExcludes, /*isBlockScopeContainer*/ false); + } break; case SyntaxKind.Property: case SyntaxKind.PropertyAssignment: - bindDeclaration(node, SymbolFlags.Property, SymbolFlags.PropertyExcludes); + case SyntaxKind.ShorthandPropertyAssignment: + bindDeclaration(node, SymbolFlags.Property, SymbolFlags.PropertyExcludes, /*isBlockScopeContainer*/ false); break; case SyntaxKind.EnumMember: - bindDeclaration(node, SymbolFlags.EnumMember, SymbolFlags.EnumMemberExcludes); + bindDeclaration(node, SymbolFlags.EnumMember, SymbolFlags.EnumMemberExcludes, /*isBlockScopeContainer*/ false); break; case SyntaxKind.CallSignature: - bindDeclaration(node, SymbolFlags.CallSignature, 0); - break; - case SyntaxKind.Method: - bindDeclaration(node, SymbolFlags.Method, SymbolFlags.MethodExcludes); + bindDeclaration(node, SymbolFlags.CallSignature, 0, /*isBlockScopeContainer*/ false); break; case SyntaxKind.ConstructSignature: - bindDeclaration(node, SymbolFlags.ConstructSignature, 0); + bindDeclaration(node, SymbolFlags.ConstructSignature, 0, /*isBlockScopeContainer*/ true); + break; + case SyntaxKind.Method: + bindDeclaration(node, SymbolFlags.Method, SymbolFlags.MethodExcludes, /*isBlockScopeContainer*/ true); break; case SyntaxKind.IndexSignature: - bindDeclaration(node, SymbolFlags.IndexSignature, 0); + bindDeclaration(node, SymbolFlags.IndexSignature, 0, /*isBlockScopeContainer*/ false); break; case SyntaxKind.FunctionDeclaration: - bindDeclaration(node, SymbolFlags.Function, SymbolFlags.FunctionExcludes); + bindDeclaration(node, SymbolFlags.Function, SymbolFlags.FunctionExcludes, /*isBlockScopeContainer*/ true); break; case SyntaxKind.Constructor: bindConstructorDeclaration(node); break; case SyntaxKind.GetAccessor: - bindDeclaration(node, SymbolFlags.GetAccessor, SymbolFlags.GetAccessorExcludes); + bindDeclaration(node, SymbolFlags.GetAccessor, SymbolFlags.GetAccessorExcludes, /*isBlockScopeContainer*/ true); break; case SyntaxKind.SetAccessor: - bindDeclaration(node, SymbolFlags.SetAccessor, SymbolFlags.SetAccessorExcludes); + bindDeclaration(node, SymbolFlags.SetAccessor, SymbolFlags.SetAccessorExcludes, /*isBlockScopeContainer*/ true); break; + + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: + bindFunctionOrConstructorType(node); + break; + case SyntaxKind.TypeLiteral: - bindAnonymousDeclaration(node, SymbolFlags.TypeLiteral, "__type"); + bindAnonymousDeclaration(node, SymbolFlags.TypeLiteral, "__type", /*isBlockScopeContainer*/ false); break; case SyntaxKind.ObjectLiteral: - bindAnonymousDeclaration(node, SymbolFlags.ObjectLiteral, "__object"); + bindAnonymousDeclaration(node, SymbolFlags.ObjectLiteral, "__object", /*isBlockScopeContainer*/ false); break; case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - bindAnonymousDeclaration(node, SymbolFlags.Function, "__function"); + bindAnonymousDeclaration(node, SymbolFlags.Function, "__function", /*isBlockScopeContainer*/ true); break; case SyntaxKind.CatchBlock: bindCatchVariableDeclaration(node); break; case SyntaxKind.ClassDeclaration: - bindDeclaration(node, SymbolFlags.Class, SymbolFlags.ClassExcludes); + bindDeclaration(node, SymbolFlags.Class, SymbolFlags.ClassExcludes, /*isBlockScopeContainer*/ false); break; case SyntaxKind.InterfaceDeclaration: - bindDeclaration(node, SymbolFlags.Interface, SymbolFlags.InterfaceExcludes); + bindDeclaration(node, SymbolFlags.Interface, SymbolFlags.InterfaceExcludes, /*isBlockScopeContainer*/ false); + break; + case SyntaxKind.TypeAliasDeclaration: + bindDeclaration(node, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes, /*isBlockScopeContainer*/ false); break; case SyntaxKind.EnumDeclaration: - bindDeclaration(node, SymbolFlags.Enum, SymbolFlags.EnumExcludes); + if (isConst(node)) { + bindDeclaration(node, SymbolFlags.ConstEnum, SymbolFlags.ConstEnumExcludes, /*isBlockScopeContainer*/ false); + } + else { + bindDeclaration(node, SymbolFlags.RegularEnum, SymbolFlags.RegularEnumExcludes, /*isBlockScopeContainer*/ false); + } break; case SyntaxKind.ModuleDeclaration: bindModuleDeclaration(node); break; case SyntaxKind.ImportDeclaration: - bindDeclaration(node, SymbolFlags.Import, SymbolFlags.ImportExcludes); + bindDeclaration(node, SymbolFlags.Import, SymbolFlags.ImportExcludes, /*isBlockScopeContainer*/ false); break; case SyntaxKind.SourceFile: if (isExternalModule(node)) { - bindAnonymousDeclaration(node, SymbolFlags.ValueModule, '"' + getModuleNameFromFilename((node).filename) + '"'); + bindAnonymousDeclaration(node, SymbolFlags.ValueModule, '"' + removeFileExtension((node).filename) + '"', /*isBlockScopeContainer*/ true); break; } + + case SyntaxKind.Block: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.SwitchStatement: + bindChildren(node, 0 , true); + break; + default: var saveParent = parent; parent = node; diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ab8e3655541..5ee9fa4ab3e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6,7 +6,6 @@ /// module ts { - var nextSymbolId = 1; var nextNodeId = 1; var nextMergeId = 1; @@ -23,6 +22,40 @@ module ts { return undefined; } + export interface StringSymbolWriter extends SymbolWriter { + string(): string; + } + + // Pool writers to avoid needing to allocate them for every symbol we write. + var stringWriters: StringSymbolWriter[] = []; + export function getSingleLineStringWriter(): StringSymbolWriter { + if (stringWriters.length == 0) { + var str = ""; + + var writeText: (text: string) => void = text => str += text; + return { + string: () => str, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeParameter: writeText, + writeSymbol: writeText, + + // Completely ignore indentation for string writers. And map newlines to + // a single space. + writeLine: () => str += " ", + increaseIndent: () => { }, + decreaseIndent: () => { }, + clear: () => str = "", + trackSymbol: () => { } + }; + } + + return stringWriters.pop(); + } + /// fullTypeCheck denotes if this instance of the typechecker will be used to get semantic diagnostics. /// If fullTypeCheck === true, then the typechecker should do every possible check to produce all errors /// If fullTypeCheck === false, the typechecker can take shortcuts and skip checks that only produce errors. @@ -37,33 +70,49 @@ module ts { var emptyArray: any[] = []; var emptySymbols: SymbolTable = {}; - + + var compilerOptions = program.getCompilerOptions(); + var checker: TypeChecker = { getProgram: () => program, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: () => sum(program.getSourceFiles(), "nodeCount"), getIdentifierCount: () => sum(program.getSourceFiles(), "identifierCount"), getSymbolCount: () => sum(program.getSourceFiles(), "symbolCount"), getTypeCount: () => typeCount, - checkProgram: checkProgram, + isUndefinedSymbol: symbol => symbol === undefinedSymbol, + isArgumentsSymbol: symbol => symbol === argumentsSymbol, emitFiles: invokeEmitter, - getParentOfSymbol: getParentOfSymbol, - getTypeOfSymbol: getTypeOfSymbol, - getPropertiesOfType: getPropertiesOfType, - getPropertyOfType: getPropertyOfType, - getSignaturesOfType: getSignaturesOfType, - getIndexTypeOfType: getIndexTypeOfType, - getReturnTypeOfSignature: getReturnTypeOfSignature, - getSymbolsInScope: getSymbolsInScope, - getSymbolInfo: getSymbolInfo, - getTypeOfNode: getTypeOfNode, - getApparentType: getApparentType, - typeToString: typeToString, - symbolToString: symbolToString, - getAugmentedPropertiesOfApparentType: getAugmentedPropertiesOfApparentType, - getRootSymbol: getRootSymbol, - getContextualType: getContextualType + getDiagnostics, + getDeclarationDiagnostics, + getGlobalDiagnostics, + checkProgram, + getParentOfSymbol, + getNarrowedTypeOfSymbol, + getDeclaredTypeOfSymbol, + getPropertiesOfType, + getPropertyOfType, + getSignaturesOfType, + getIndexTypeOfType, + getReturnTypeOfSignature, + getSymbolsInScope, + getSymbolInfo, + getShorthandAssignmentValueSymbol, + getTypeOfNode, + typeToString, + getSymbolDisplayBuilder, + symbolToString, + getAugmentedPropertiesOfType, + getRootSymbols, + getContextualType, + getFullyQualifiedName, + getResolvedSignature, + getEnumMemberValue, + isValidPropertyAccess, + getSignatureFromDeclaration, + isImplementationOfOverload, + getAliasedSymbol: resolveImport, + hasEarlyErrors, + isEmitBlocked, }; var undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined"); @@ -84,6 +133,7 @@ module ts { var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); @@ -99,7 +149,10 @@ module ts { var globalNumberType: ObjectType; var globalBooleanType: ObjectType; var globalRegExpType: ObjectType; + var globalTemplateStringsArrayType: ObjectType; + var tupleTypes: Map = {}; + var unionTypes: Map = {}; var stringLiteralTypes: Map = {}; var emitExtends = false; @@ -129,18 +182,21 @@ module ts { function getExcludedSymbolFlags(flags: SymbolFlags): SymbolFlags { var result: SymbolFlags = 0; - if (flags & SymbolFlags.Variable) result |= SymbolFlags.VariableExcludes; + if (flags & SymbolFlags.BlockScopedVariable) result |= SymbolFlags.BlockScopedVariableExcludes; + if (flags & SymbolFlags.FunctionScopedVariable) result |= SymbolFlags.FunctionScopedVariableExcludes; if (flags & SymbolFlags.Property) result |= SymbolFlags.PropertyExcludes; if (flags & SymbolFlags.EnumMember) result |= SymbolFlags.EnumMemberExcludes; if (flags & SymbolFlags.Function) result |= SymbolFlags.FunctionExcludes; if (flags & SymbolFlags.Class) result |= SymbolFlags.ClassExcludes; if (flags & SymbolFlags.Interface) result |= SymbolFlags.InterfaceExcludes; - if (flags & SymbolFlags.Enum) result |= SymbolFlags.EnumExcludes; + if (flags & SymbolFlags.RegularEnum) result |= SymbolFlags.RegularEnumExcludes; + if (flags & SymbolFlags.ConstEnum) result |= SymbolFlags.ConstEnumExcludes; if (flags & SymbolFlags.ValueModule) result |= SymbolFlags.ValueModuleExcludes; if (flags & SymbolFlags.Method) result |= SymbolFlags.MethodExcludes; if (flags & SymbolFlags.GetAccessor) result |= SymbolFlags.GetAccessorExcludes; if (flags & SymbolFlags.SetAccessor) result |= SymbolFlags.SetAccessorExcludes; if (flags & SymbolFlags.TypeParameter) result |= SymbolFlags.TypeParameterExcludes; + if (flags & SymbolFlags.TypeAlias) result |= SymbolFlags.TypeAliasExcludes; if (flags & SymbolFlags.Import) result |= SymbolFlags.ImportExcludes; return result; } @@ -155,6 +211,7 @@ module ts { result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) result.constEnumOnlyModule = true; if (symbol.members) result.members = cloneSymbolTable(symbol.members); if (symbol.exports) result.exports = cloneSymbolTable(symbol.exports); recordMergedSymbol(result, symbol); @@ -163,6 +220,10 @@ module ts { function extendSymbol(target: Symbol, source: Symbol) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + if (source.flags & SymbolFlags.ValueModule && target.flags & SymbolFlags.ValueModule && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + // reset flag when merging instantiated module into value module that has only const enums + target.constEnumOnlyModule = false; + } target.flags |= source.flags; if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; forEach(source.declarations, node => { @@ -179,8 +240,13 @@ module ts { recordMergedSymbol(target, source); } else { + var message = target.flags & SymbolFlags.BlockScopedVariable || source.flags & SymbolFlags.BlockScopedVariable + ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; forEach(source.declarations, node => { - error(node.name ? node.name : node, Diagnostics.Duplicate_identifier_0, symbolToString(source)); + error(node.name ? node.name : node, message, symbolToString(source)); + }); + forEach(target.declarations, node => { + error(node.name ? node.name : node, message, symbolToString(source)); }); } } @@ -252,33 +318,37 @@ module ts { // return undefined if we can't find a symbol. } - function resolveName(location: Node, name: string, meaning: SymbolFlags, nameNotFoundMessage: DiagnosticMessage, nameArg: string): Symbol { - var errorLocation = location; - var result: Symbol; - var lastLocation: Node; - - var memberWithInitializerThatReferencesIdentifierFromConstructor: Node; - - function returnResolvedSymbol(s: Symbol) { - // we've seen member with initializer that references identifier defined in constructor during the search. - // if this was the only result with given name then just report default 'nameNotFound' message. - // however if we met something else that was 'shadowed' by the identifier in constructor - report more specific error - if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { - var propertyName = (memberWithInitializerThatReferencesIdentifierFromConstructor).name; - error(errorLocation, Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, identifierToString(propertyName), nameArg); - return undefined; - } - if (!s && nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, nameArg); - } - return s; + /** Returns true if node1 is defined before node 2**/ + function isDefinedBefore(node1: Node, node2: Node): boolean { + var file1 = getSourceFileOfNode(node1); + var file2 = getSourceFileOfNode(node2); + if (file1 === file2) { + return node1.pos <= node2.pos; } - while (location) { + if (!compilerOptions.out) { + return true; + } + + var sourceFiles = program.getSourceFiles(); + return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); + } + + // Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and + // the nameNotFoundMessage argument is not undefined. Returns the resolved symbol, or undefined if no symbol with + // the given name can be found. + function resolveName(location: Node, name: string, meaning: SymbolFlags, nameNotFoundMessage: DiagnosticMessage, nameArg: string | Identifier): Symbol { + + var result: Symbol; + var lastLocation: Node; + var propertyWithInvalidInitializer: Node; + var errorLocation = location; + + loop: while (location) { // Locals of a source file are not in scope (because they get merged into the global symbol table) if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - return returnResolvedSymbol(result); + break loop; } } switch (location.kind) { @@ -286,27 +356,27 @@ module ts { if (!isExternalModule(location)) break; case SyntaxKind.ModuleDeclaration: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.ModuleMember)) { - return returnResolvedSymbol(result); + break loop; } break; case SyntaxKind.EnumDeclaration: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.EnumMember)) { - return returnResolvedSymbol(result); + break loop; } break; case SyntaxKind.Property: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or - // local variables of the constructor.This effectively means that entities from outer scopes + // local variables of the constructor. This effectively means that entities from outer scopes // by the same name as a constructor parameter or local variable are inaccessible // in initializer expressions for instance member variables. if (location.parent.kind === SyntaxKind.ClassDeclaration && !(location.flags & NodeFlags.Static)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & SymbolFlags.Value)) { - // save the property node - later it will be used by 'returnResolvedSymbol' to report appropriate error - memberWithInitializerThatReferencesIdentifierFromConstructor = location; + // Remember the property node, it will be used later to report appropriate error + propertyWithInvalidInitializer = location; } } } @@ -316,14 +386,12 @@ module ts { if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & SymbolFlags.Type)) { if (lastLocation && lastLocation.flags & NodeFlags.Static) { // TypeScript 1.0 spec (April 2014): 3.4.1 - // The scope of a type parameter extends over the entire declaration - // with which the type parameter list is associated, with the exception of static member declarations in classes. + // The scope of a type parameter extends over the entire declaration with which the type + // parameter list is associated, with the exception of static member declarations in classes. error(errorLocation, Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } - else { - return returnResolvedSymbol(result); - } + break loop; } break; case SyntaxKind.Method: @@ -333,33 +401,64 @@ module ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.ArrowFunction: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } break; case SyntaxKind.FunctionExpression: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } var id = (location).name; if (id && name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; case SyntaxKind.CatchBlock: var id = (location).variable; if (name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; } lastLocation = location; location = location.parent; } - if (result = getSymbol(globals, name, meaning)) { - return returnResolvedSymbol(result); + + if (!result) { + result = getSymbol(globals, name, meaning); } - return returnResolvedSymbol(undefined); + if (!result) { + if (nameNotFoundMessage) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg)); + } + return undefined; + } + + // Perform extra checks only if error reporting was requested + if (nameNotFoundMessage) { + if (propertyWithInvalidInitializer) { + // We have a match, but the reference occurred within a property initializer and the identifier also binds + // to a local variable in the constructor where the code will be emitted. + var propertyName = (propertyWithInvalidInitializer).name; + error(errorLocation, Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, + declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg)); + return undefined; + } + if (result.flags & SymbolFlags.BlockScopedVariable) { + // Block-scoped variables cannot be used before their definition + var declaration = forEach(result.declarations, d => d.flags & NodeFlags.BlockScoped ? d : undefined); + Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + if (!isDefinedBefore(declaration, errorLocation)) { + error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationNameToString(declaration.name)); + } + } + } + return result; } function resolveImport(symbol: Symbol): Symbol { @@ -387,8 +486,8 @@ module ts { // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImport(entityName: EntityName, importDeclaration?: ImportDeclaration): Symbol { if (!importDeclaration) { - importDeclaration = getAncestor(entityName, SyntaxKind.ImportDeclaration); - Debug.assert(importDeclaration); + importDeclaration = getAncestor(entityName, SyntaxKind.ImportDeclaration); + Debug.assert(importDeclaration !== undefined); } // There are three things we might try to look for. In the following examples, // the search term is enclosed in |...|: @@ -397,7 +496,7 @@ module ts { // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace if (entityName.kind === SyntaxKind.Identifier && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; + entityName = entityName.parent; } // Check for case 1 and 3 in the above example if (entityName.kind === SyntaxKind.Identifier || entityName.parent.kind === SyntaxKind.QualifiedName) { @@ -411,15 +510,14 @@ module ts { } } - function getFullyQualifiedName(symbol: Symbol) { + function getFullyQualifiedName(symbol: Symbol): string { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } // Resolves a qualified name and any involved import aliases function resolveEntityName(location: Node, name: EntityName, meaning: SymbolFlags): Symbol { if (name.kind === SyntaxKind.Identifier) { - // TODO: Investigate error recovery for symbols not found - var symbol = resolveName(location, (name).text, meaning, Diagnostics.Cannot_find_name_0, identifierToString(name)); + var symbol = resolveName(location, (name).text, meaning, Diagnostics.Cannot_find_name_0, name); if (!symbol) { return; } @@ -430,7 +528,7 @@ module ts { var symbol = getSymbol(namespace.exports, (name).right.text, meaning); if (!symbol) { error(location, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), - identifierToString((name).right)); + declarationNameToString((name).right)); return; } } @@ -516,7 +614,7 @@ module ts { } if (node.exportName.text) { var meaning = SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace; - var exportSymbol = resolveName(node, node.exportName.text, meaning, Diagnostics.Cannot_find_name_0, identifierToString(node.exportName)); + var exportSymbol = resolveName(node, node.exportName.text, meaning, Diagnostics.Cannot_find_name_0, node.exportName); } } symbolLinks.exportAssignSymbol = exportSymbol || unknownSymbol; @@ -563,6 +661,12 @@ module ts { } function symbolIsValue(symbol: Symbol): boolean { + // If it is an instantiated symbol, then it is a value if the symbol it is an + // instantiation of is a value. + if (symbol.flags & SymbolFlags.Instantiated) { + return symbolIsValue(getSymbolLinks(symbol).target); + } + // If the symbol has the value flag, it is trivially a value. if (symbol.flags & SymbolFlags.Value) { return true; @@ -573,12 +677,6 @@ module ts { return (resolveImport(symbol).flags & SymbolFlags.Value) !== 0; } - // If it is an instantiated symbol, then it is a value if the symbol it is an - // instantiation of is a value. - if (symbol.flags & SymbolFlags.Instantiated) { - return (getSymbolLinks(symbol).target.flags & SymbolFlags.Value) !== 0; - } - return false; } @@ -631,31 +729,30 @@ module ts { return result || emptyArray; } - function setObjectTypeMembers(type: ObjectType, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexType: Type, numberIndexType: Type): ResolvedObjectType { - (type).members = members; - (type).properties = getNamedMembers(members); - (type).callSignatures = callSignatures; - (type).constructSignatures = constructSignatures; - if (stringIndexType) (type).stringIndexType = stringIndexType; - if (numberIndexType) (type).numberIndexType = numberIndexType; - return type; + function setObjectTypeMembers(type: ObjectType, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexType: Type, numberIndexType: Type): ResolvedType { + (type).members = members; + (type).properties = getNamedMembers(members); + (type).callSignatures = callSignatures; + (type).constructSignatures = constructSignatures; + if (stringIndexType) (type).stringIndexType = stringIndexType; + if (numberIndexType) (type).numberIndexType = numberIndexType; + return type; } - function createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexType: Type, numberIndexType: Type): ResolvedObjectType { + function createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexType: Type, numberIndexType: Type): ResolvedType { return setObjectTypeMembers(createObjectType(TypeFlags.Anonymous, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function isOptionalProperty(propertySymbol: Symbol): boolean { - if (propertySymbol.flags & SymbolFlags.Prototype) { - return false; - } // class C { // constructor(public x?) { } // } // // x is an optional parameter, but it is a required property. - return (propertySymbol.valueDeclaration.flags & NodeFlags.QuestionMark) && propertySymbol.valueDeclaration.kind !== SyntaxKind.Parameter; + return propertySymbol.valueDeclaration && + propertySymbol.valueDeclaration.flags & NodeFlags.QuestionMark && + propertySymbol.valueDeclaration.kind !== SyntaxKind.Parameter; } function forEachSymbolTableInScope(enclosingDeclaration: Node, callback: (symbolTable: SymbolTable) => T): T { @@ -694,7 +791,7 @@ module ts { return rightMeaning === SymbolFlags.Value ? SymbolFlags.Value : SymbolFlags.Namespace; } - function getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): Symbol[] { + function getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, useOnlyExternalAliasing: boolean): Symbol[] { function getAccessibleSymbolChainFromSymbolTable(symbols: SymbolTable): Symbol[] { function canQualifySymbol(symbolFromSymbolTable: Symbol, meaning: SymbolFlags) { // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible @@ -703,7 +800,7 @@ module ts { } // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too - var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning)); + var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); return !!accessibleParent; } @@ -725,16 +822,21 @@ module ts { // Check if symbol is any of the alias return forEachValue(symbols, symbolFromSymbolTable => { if (symbolFromSymbolTable.flags & SymbolFlags.Import) { - var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } + if (!useOnlyExternalAliasing || // We can use any type of alias to get the name + // Is this external alias, then use it to name + ts.forEach(symbolFromSymbolTable.declarations, declaration => + declaration.kind === SyntaxKind.ImportDeclaration && (declaration).externalModuleName)) { + var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); + if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { + return [symbolFromSymbolTable]; + } - // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain - // but only if the symbolFromSymbolTable can be qualified - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain + // but only if the symbolFromSymbolTable can be qualified + var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + } } } }); @@ -780,17 +882,17 @@ module ts { var meaningToLook = meaning; while (symbol) { // Symbol is accessible if it by itself is accessible - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook); + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook, /*useOnlyExternalAliasing*/ false); if (accessibleSymbolChain) { var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); if (!hasAccessibleDeclarations) { - return { + return { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, SymbolFlags.Namespace) : undefined, }; } - return { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; + return hasAccessibleDeclarations; } // If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible. @@ -847,12 +949,12 @@ module ts { (declaration.kind === SyntaxKind.SourceFile && isExternalModule(declaration)); } - function hasVisibleDeclarations(symbol: Symbol): { aliasesToMakeVisible?: ImportDeclaration[]; } { + function hasVisibleDeclarations(symbol: Symbol): SymbolVisibilityResult { var aliasesToMakeVisible: ImportDeclaration[]; if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) { return undefined; } - return { aliasesToMakeVisible: aliasesToMakeVisible }; + return { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible }; function getIsDeclarationVisible(declaration: Declaration) { if (!isDeclarationVisible(declaration)) { @@ -864,11 +966,11 @@ module ts { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!contains(aliasesToMakeVisible, declaration)) { - aliasesToMakeVisible.push(declaration); + aliasesToMakeVisible.push(declaration); } } else { - aliasesToMakeVisible = [declaration]; + aliasesToMakeVisible = [declaration]; } return true; } @@ -881,291 +983,548 @@ module ts { } } - function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName: EntityName): SymbolAccessiblityResult { + function isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult { + // get symbol of the first identifier of the entityName + var meaning: SymbolFlags; + if (entityName.parent.kind === SyntaxKind.TypeQuery) { + // Typeof value + meaning = SymbolFlags.Value | SymbolFlags.ExportValue; + } + else if (entityName.kind === SyntaxKind.QualifiedName || + entityName.parent.kind === SyntaxKind.ImportDeclaration) { + // Left identifier from type reference or TypeAlias + // Entity name of the import declaration + meaning = SymbolFlags.Namespace; + } + else { + // Type Reference or TypeAlias entity = Identifier + meaning = SymbolFlags.Type; + } + var firstIdentifier = getFirstIdentifier(entityName); - var firstIdentifierName = identifierToString(firstIdentifier); - var symbolOfNameSpace = resolveName(entityName.parent, (firstIdentifier).text, SymbolFlags.Namespace, Diagnostics.Cannot_find_name_0, firstIdentifierName); + var symbol = resolveName(enclosingDeclaration, (firstIdentifier).text, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined); + // Verify if the symbol is accessible - var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? - { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : - { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: firstIdentifierName }; - } - - // Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope - // Meaning needs to be specified if the enclosing declaration is given - function symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) { - function getSymbolName(symbol: Symbol) { - if (symbol.declarations && symbol.declarations.length > 0) { - var declaration = symbol.declarations[0]; - if (declaration.name) { - return identifierToString(declaration.name); - } - } - return symbol.name; - } - - // Get qualified name - if (enclosingDeclaration && - // Properties/methods/Signatures/Constructors/TypeParameters do not need qualification - !(symbol.flags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Signature | SymbolFlags.Constructor | SymbolFlags.Method | SymbolFlags.TypeParameter))) { - var symbolName: string; - while (symbol) { - var isFirstName = !symbolName; - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning); - - var currentSymbolName: string; - if (accessibleSymbolChain) { - currentSymbolName = ts.map(accessibleSymbolChain, accessibleSymbol => getSymbolName(accessibleSymbol)).join("."); - } - else { - // If we didn't find accessible symbol chain for this symbol, break if this is external module - if (!isFirstName && ts.forEach(symbol.declarations, declaration => hasExternalModuleSymbol(declaration))) { - break; - } - currentSymbolName = getSymbolName(symbol); - } - symbolName = currentSymbolName + (isFirstName ? "" : ("." + symbolName)); - if (accessibleSymbolChain && !needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - break; - } - symbol = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - meaning = getQualifiedLeftMeaning(meaning); - } - - return symbolName; - } - - return getSymbolName(symbol); - } - - function writeSymbolToTextWriter(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, writer: TextWriter) { - writer.write(symbolToString(symbol, enclosingDeclaration, meaning)); - } - - function createSingleLineTextWriter() { - var result = ""; - return { - write(s: string) { result += s; }, - writeSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) { writeSymbolToTextWriter(symbol, enclosingDeclaration, meaning, this); }, - writeLine() { result += " "; }, - increaseIndent() { }, - decreaseIndent() { }, - getText() { return result; } + return hasVisibleDeclarations(symbol) || { + accessibility: SymbolAccessibility.NotAccessible, + errorSymbolName: getTextOfNode(firstIdentifier), + errorNode: firstIdentifier }; } - function typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string { - var stringWriter = createSingleLineTextWriter(); - // TODO(shkamat): typeToString should take enclosingDeclaration as input, once we have implemented enclosingDeclaration - writeTypeToTextWriter(type, enclosingDeclaration, flags, stringWriter); - return stringWriter.getText(); + function releaseStringWriter(writer: StringSymbolWriter) { + writer.clear() + stringWriters.push(writer); } - function writeTypeToTextWriter(type: Type, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: TextWriter) { - var typeStack: Type[]; - return writeType(type, /*allowFunctionOrConstructorTypeLiteral*/ true); + function writeKeyword(writer: SymbolWriter, kind: SyntaxKind) { + writer.writeKeyword(tokenToString(kind)); + } - function writeType(type: Type, allowFunctionOrConstructorTypeLiteral: boolean) { - if (type.flags & TypeFlags.Intrinsic) { - writer.write((type).intrinsicName); - } - else if (type.flags & TypeFlags.Reference) { - writeTypeReference(type); - } - else if (type.flags & (TypeFlags.Class | TypeFlags.Interface | TypeFlags.Enum | TypeFlags.TypeParameter)) { - writer.writeSymbol(type.symbol, enclosingDeclaration, SymbolFlags.Type); - } - else if (type.flags & TypeFlags.Anonymous) { - writeAnonymousType(type, allowFunctionOrConstructorTypeLiteral); - } - else if (type.flags & TypeFlags.StringLiteral) { - writer.write((type).text); - } - else { - // Should never get here - writer.write("{ ... }"); - } + function writePunctuation(writer: SymbolWriter, kind: SyntaxKind) { + writer.writePunctuation(tokenToString(kind)); + } + + function writeOperator(writer: SymbolWriter, kind: SyntaxKind) { + writer.writeOperator(tokenToString(kind)); + } + + function writeSpace(writer: SymbolWriter) { + writer.writeSpace(" "); + } + + function symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string { + var writer = getSingleLineStringWriter(); + getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning); + + var result = writer.string(); + releaseStringWriter(writer); + + return result; + } + + function typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string { + var writer = getSingleLineStringWriter(); + getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + + var result = writer.string(); + releaseStringWriter(writer); + + var maxLength = compilerOptions.noErrorTruncation || flags & TypeFormatFlags.NoTruncation ? undefined : 100; + if (maxLength && result.length >= maxLength) { + result = result.substr(0, maxLength - "...".length) + "..."; } - function writeTypeReference(type: TypeReference) { - if (type.target === globalArrayType && !(flags & TypeFormatFlags.WriteArrayAsGenericType)) { - // If we are writing array element type the arrow style signatures are not allowed as - // we need to surround it by curlies, e.g. { (): T; }[]; as () => T[] would mean something different - writeType(type.typeArguments[0], /*allowFunctionOrConstructorTypeLiteral*/ false); - writer.write("[]"); + return result; + } + + function getTypeAliasForTypeLiteral(type: Type): Symbol { + if (type.symbol && type.symbol.flags & SymbolFlags.TypeLiteral) { + var node = type.symbol.declarations[0].parent; + while (node.kind === SyntaxKind.ParenType) { + node = node.parent; } - else { - writer.writeSymbol(type.target.symbol, enclosingDeclaration, SymbolFlags.Type); - writer.write("<"); - for (var i = 0; i < type.typeArguments.length; i++) { - if (i > 0) { - writer.write(", "); - } - writeType(type.typeArguments[i], /*allowFunctionOrConstructorTypeLiteral*/ true); - } - writer.write(">"); + if (node.kind === SyntaxKind.TypeAliasDeclaration) { + return getSymbolOfNode(node); } } + return undefined; + } - function writeAnonymousType(type: ObjectType, allowFunctionOrConstructorTypeLiteral: boolean) { - // Always use 'typeof T' for type of class, enum, and module objects - if (type.symbol && type.symbol.flags & (SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)) { - writeTypeofSymbol(type); - } - // Use 'typeof T' for types of functions and methods that circularly reference themselves - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeofSymbol(type); - } - else if (typeStack && contains(typeStack, type)) { - // Recursive usage, use any - writer.write("any"); - } - else { - if (!typeStack) { - typeStack = []; - } - typeStack.push(type); - writeLiteralType(type, allowFunctionOrConstructorTypeLiteral); - typeStack.pop(); - } - - function shouldWriteTypeOfFunctionSymbol() { - if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & SymbolFlags.Method && // typeof static method - ts.forEach(type.symbol.declarations, declaration => declaration.flags & NodeFlags.Static)); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & SymbolFlags.Function) && - (type.symbol.parent || // is exported function symbol - ts.forEach(type.symbol.declarations, declaration => - declaration.parent.kind === SyntaxKind.SourceFile || declaration.parent.kind === SyntaxKind.ModuleBlock)); - - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - // typeof is allowed only for static/non local functions - return !!(flags & TypeFormatFlags.UseTypeOfFunction) || // use typeof if format flags specify it - (typeStack && contains(typeStack, type)); // it is type of the symbol uses itself recursively - } - } - } - } - - function writeTypeofSymbol(type: ObjectType) { - writer.write("typeof "); - writer.writeSymbol(type.symbol, enclosingDeclaration, SymbolFlags.Value); - } - - function writeLiteralType(type: ObjectType, allowFunctionOrConstructorTypeLiteral: boolean) { - var resolved = resolveObjectTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writer.write("{}"); + // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. + var _displayBuilder: SymbolDisplayBuilder; + function getSymbolDisplayBuilder(): SymbolDisplayBuilder { + /** + * Writes only the name of the symbol out to the writer. Uses the original source text + * for the name of the symbol if it is available to match how the user inputted the name. + */ + function appendSymbolNameOnly(symbol: Symbol, writer: SymbolWriter): void { + if (symbol.declarations && symbol.declarations.length > 0) { + var declaration = symbol.declarations[0]; + if (declaration.name) { + writer.writeSymbol(declarationNameToString(declaration.name), symbol); return; } + } - if (allowFunctionOrConstructorTypeLiteral) { - if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - writeSignature(resolved.callSignatures[0], /*arrowStyle*/ true); - return; + writer.writeSymbol(symbol.name, symbol); + } + + /** + * Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope + * Meaning needs to be specified if the enclosing declaration is given + */ + function buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void { + var parentSymbol: Symbol; + function appendParentTypeArgumentsAndSymbolName(symbol: Symbol): void { + if (parentSymbol) { + // Write type arguments of instantiated class/interface here + if (flags & SymbolFormatFlags.WriteTypeParametersOrArguments) { + if (symbol.flags & SymbolFlags.Instantiated) { + buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), + (symbol).mapper, writer, enclosingDeclaration); + } + else { + buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); + } } - if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - writer.write("new "); - writeSignature(resolved.constructSignatures[0], /*arrowStyle*/ true); - return; + writePunctuation(writer, SyntaxKind.DotToken); + } + parentSymbol = symbol; + appendSymbolNameOnly(symbol, writer); + } + + // 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. + // + // NOTE(cyrusn): This approach feels somewhat unfortunate. A simple pass over the tree + // 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) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & SymbolFormatFlags.UseOnlyExternalAliasing)); + + 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)); + } + + if (accessibleSymbolChain) { + for (var i = 0, n = accessibleSymbolChain.length; i < n; i++) { + appendParentTypeArgumentsAndSymbolName(accessibleSymbolChain[i]); + } + } + else { + // If we didn't find accessible symbol chain for this symbol, break if this is external module + if (!parentSymbol && ts.forEach(symbol.declarations, declaration => hasExternalModuleSymbol(declaration))) { + return; + } + + // if this is anonymous type break + if (symbol.flags & SymbolFlags.TypeLiteral || symbol.flags & SymbolFlags.ObjectLiteral) { + return; + } + + appendParentTypeArgumentsAndSymbolName(symbol); } } } - writer.write("{"); - writer.writeLine(); - writer.increaseIndent(); - for (var i = 0; i < resolved.callSignatures.length; i++) { - writeSignature(resolved.callSignatures[i]); - writer.write(";"); - writer.writeLine(); + // Get qualified name + if (enclosingDeclaration && + // TypeParameters do not need qualification + !(symbol.flags & SymbolFlags.TypeParameter)) { + + walkSymbol(symbol, meaning); + return; } - for (var i = 0; i < resolved.constructSignatures.length; i++) { - writer.write("new "); - writeSignature(resolved.constructSignatures[i]); - writer.write(";"); - writer.writeLine(); + + return appendParentTypeArgumentsAndSymbolName(symbol); + } + + function buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, typeStack?: Type[]) { + var globalFlagsToPass = globalFlags & TypeFormatFlags.WriteOwnNameForAnyLike; + return writeType(type, globalFlags); + + function writeType(type: Type, flags: TypeFormatFlags) { + // Write undefined/null type as any + if (type.flags & TypeFlags.Intrinsic) { + // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving + writer.writeKeyword(!(globalFlags & TypeFormatFlags.WriteOwnNameForAnyLike) && + (type.flags & TypeFlags.Any) ? "any" : (type).intrinsicName); + } + else if (type.flags & TypeFlags.Reference) { + writeTypeReference(type, flags); + } + else if (type.flags & (TypeFlags.Class | TypeFlags.Interface | TypeFlags.Enum | TypeFlags.TypeParameter)) { + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, SymbolFlags.Type); + } + else if (type.flags & TypeFlags.Tuple) { + writeTupleType(type); + } + else if (type.flags & TypeFlags.Union) { + writeUnionType(type, flags); + } + else if (type.flags & TypeFlags.Anonymous) { + writeAnonymousType(type, flags); + } + else if (type.flags & TypeFlags.StringLiteral) { + writer.writeStringLiteral((type).text); + } + else { + // Should never get here + // { ... } + writePunctuation(writer, SyntaxKind.OpenBraceToken); + writeSpace(writer); + writePunctuation(writer, SyntaxKind.DotDotDotToken); + writeSpace(writer); + writePunctuation(writer, SyntaxKind.CloseBraceToken); + } } - if (resolved.stringIndexType) { - writer.write("[x: string]: "); - writeType(resolved.stringIndexType, /*allowFunctionOrConstructorTypeLiteral*/ true); - writer.write(";"); - writer.writeLine(); - } - if (resolved.numberIndexType) { - writer.write("[x: number]: "); - writeType(resolved.numberIndexType, /*allowFunctionOrConstructorTypeLiteral*/ true); - writer.write(";"); - writer.writeLine(); - } - for (var i = 0; i < resolved.properties.length; i++) { - var p = resolved.properties[i]; - var t = getTypeOfSymbol(p); - if (p.flags & (SymbolFlags.Function | SymbolFlags.Method) && !getPropertiesOfType(t).length) { - var signatures = getSignaturesOfType(t, SignatureKind.Call); - for (var j = 0; j < signatures.length; j++) { - writer.writeSymbol(p); - if (isOptionalProperty(p)) { - writer.write("?"); + + function writeTypeList(types: Type[], union: boolean) { + for (var i = 0; i < types.length; i++) { + if (i > 0) { + if (union) { + writeSpace(writer); } - writeSignature(signatures[j]); - writer.write(";"); - writer.writeLine(); + writePunctuation(writer, union ? SyntaxKind.BarToken : SyntaxKind.CommaToken); + writeSpace(writer); + } + writeType(types[i], union ? TypeFormatFlags.InElementType : TypeFormatFlags.None); + } + } + + function writeTypeReference(type: TypeReference, flags: TypeFormatFlags) { + if (type.target === globalArrayType && !(flags & TypeFormatFlags.WriteArrayAsGenericType)) { + writeType(type.typeArguments[0], TypeFormatFlags.InElementType); + writePunctuation(writer, SyntaxKind.OpenBracketToken); + writePunctuation(writer, SyntaxKind.CloseBracketToken); + } + else { + buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, SymbolFlags.Type); + writePunctuation(writer, SyntaxKind.LessThanToken); + writeTypeList(type.typeArguments, /*union*/ false); + writePunctuation(writer, SyntaxKind.GreaterThanToken); + } + } + + function writeTupleType(type: TupleType) { + writePunctuation(writer, SyntaxKind.OpenBracketToken); + writeTypeList(type.elementTypes, /*union*/ false); + writePunctuation(writer, SyntaxKind.CloseBracketToken); + } + + function writeUnionType(type: UnionType, flags: TypeFormatFlags) { + if (flags & TypeFormatFlags.InElementType) { + writePunctuation(writer, SyntaxKind.OpenParenToken); + } + writeTypeList(type.types, /*union*/ true); + if (flags & TypeFormatFlags.InElementType) { + writePunctuation(writer, SyntaxKind.CloseParenToken); + } + } + + function writeAnonymousType(type: ObjectType, flags: TypeFormatFlags) { + // Always use 'typeof T' for type of class, enum, and module objects + if (type.symbol && type.symbol.flags & (SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)) { + writeTypeofSymbol(type); + } + // Use 'typeof T' for types of functions and methods that circularly reference themselves + else if (shouldWriteTypeOfFunctionSymbol()) { + writeTypeofSymbol(type); + } + else if (typeStack && contains(typeStack, type)) { + // If type is an anonymous type literal in a type alias declaration, use type alias name + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, SymbolFlags.Type); + } + else { + // Recursive usage, use any + writeKeyword(writer, SyntaxKind.AnyKeyword); } } else { - writer.writeSymbol(p); - if (isOptionalProperty(p)) { - writer.write("?"); + if (!typeStack) { + typeStack = []; } - writer.write(": "); - writeType(t, /*allowFunctionOrConstructorTypeLiteral*/ true); - writer.write(";"); + typeStack.push(type); + writeLiteralType(type, flags); + typeStack.pop(); + } + + function shouldWriteTypeOfFunctionSymbol() { + if (type.symbol) { + var isStaticMethodSymbol = !!(type.symbol.flags & SymbolFlags.Method && // typeof static method + ts.forEach(type.symbol.declarations, declaration => declaration.flags & NodeFlags.Static)); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & SymbolFlags.Function) && + (type.symbol.parent || // is exported function symbol + ts.forEach(type.symbol.declarations, declaration => + declaration.parent.kind === SyntaxKind.SourceFile || declaration.parent.kind === SyntaxKind.ModuleBlock)); + + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + // typeof is allowed only for static/non local functions + return !!(flags & TypeFormatFlags.UseTypeOfFunction) || // use typeof if format flags specify it + (typeStack && contains(typeStack, type)); // it is type of the symbol uses itself recursively + } + } + } + } + + function writeTypeofSymbol(type: ObjectType) { + writeKeyword(writer, SyntaxKind.TypeOfKeyword); + writeSpace(writer); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, SymbolFlags.Value); + } + + function writeLiteralType(type: ObjectType, flags: TypeFormatFlags) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + writePunctuation(writer, SyntaxKind.OpenBraceToken); + writePunctuation(writer, SyntaxKind.CloseBraceToken); + return; + } + + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + if (flags & TypeFormatFlags.InElementType) { + writePunctuation(writer, SyntaxKind.OpenParenToken); + } + buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | TypeFormatFlags.WriteArrowStyleSignature , typeStack); + if (flags & TypeFormatFlags.InElementType) { + writePunctuation(writer, SyntaxKind.CloseParenToken); + } + return; + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + if (flags & TypeFormatFlags.InElementType) { + writePunctuation(writer, SyntaxKind.OpenParenToken); + } + writeKeyword(writer, SyntaxKind.NewKeyword); + writeSpace(writer); + buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | TypeFormatFlags.WriteArrowStyleSignature, typeStack); + if (flags & TypeFormatFlags.InElementType) { + writePunctuation(writer, SyntaxKind.CloseParenToken); + } + return; + } + } + + writePunctuation(writer, SyntaxKind.OpenBraceToken); + writer.writeLine(); + writer.increaseIndent(); + for (var i = 0; i < resolved.callSignatures.length; i++) { + buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + writePunctuation(writer, SyntaxKind.SemicolonToken); writer.writeLine(); } + for (var i = 0; i < resolved.constructSignatures.length; i++) { + writeKeyword(writer, SyntaxKind.NewKeyword); + writeSpace(writer); + + buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + writePunctuation(writer, SyntaxKind.SemicolonToken); + writer.writeLine(); + } + if (resolved.stringIndexType) { + // [x: string]: + writePunctuation(writer, SyntaxKind.OpenBracketToken); + writer.writeParameter("x"); + writePunctuation(writer, SyntaxKind.ColonToken); + writeSpace(writer); + writeKeyword(writer, SyntaxKind.StringKeyword); + writePunctuation(writer, SyntaxKind.CloseBracketToken); + writePunctuation(writer, SyntaxKind.ColonToken); + writeSpace(writer); + writeType(resolved.stringIndexType, TypeFormatFlags.None); + writePunctuation(writer, SyntaxKind.SemicolonToken); + writer.writeLine(); + } + if (resolved.numberIndexType) { + // [x: number]: + writePunctuation(writer, SyntaxKind.OpenBracketToken); + writer.writeParameter("x"); + writePunctuation(writer, SyntaxKind.ColonToken); + writeSpace(writer); + writeKeyword(writer, SyntaxKind.NumberKeyword); + writePunctuation(writer, SyntaxKind.CloseBracketToken); + writePunctuation(writer, SyntaxKind.ColonToken); + writeSpace(writer); + writeType(resolved.numberIndexType, TypeFormatFlags.None); + writePunctuation(writer, SyntaxKind.SemicolonToken); + writer.writeLine(); + } + for (var i = 0; i < resolved.properties.length; i++) { + var p = resolved.properties[i]; + var t = getTypeOfSymbol(p); + if (p.flags & (SymbolFlags.Function | SymbolFlags.Method) && !getPropertiesOfObjectType(t).length) { + var signatures = getSignaturesOfType(t, SignatureKind.Call); + for (var j = 0; j < signatures.length; j++) { + buildSymbolDisplay(p, writer); + if (isOptionalProperty(p)) { + writePunctuation(writer, SyntaxKind.QuestionToken); + } + buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + writePunctuation(writer, SyntaxKind.SemicolonToken); + writer.writeLine(); + } + } + else { + buildSymbolDisplay(p, writer); + if (isOptionalProperty(p)) { + writePunctuation(writer, SyntaxKind.QuestionToken); + } + writePunctuation(writer, SyntaxKind.ColonToken); + writeSpace(writer); + writeType(t, TypeFormatFlags.None); + writePunctuation(writer, SyntaxKind.SemicolonToken); + writer.writeLine(); + } + } + writer.decreaseIndent(); + writePunctuation(writer, SyntaxKind.CloseBraceToken); } - writer.decreaseIndent(); - writer.write("}"); } - function writeSignature(signature: Signature, arrowStyle?: boolean) { - if (signature.typeParameters) { - writer.write("<"); - for (var i = 0; i < signature.typeParameters.length; i++) { - if (i > 0) { - writer.write(", "); - } - var tp = signature.typeParameters[i]; - writer.writeSymbol(tp.symbol); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writer.write(" extends "); - writeType(constraint, /*allowFunctionOrConstructorTypeLiteral*/ true); - } - } - writer.write(">"); + function buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags) { + var targetSymbol = getTargetSymbol(symbol); + if (targetSymbol.flags & SymbolFlags.Class || targetSymbol.flags & SymbolFlags.Interface) { + buildDisplayForTypeParametersAndDelimiters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); } - writer.write("("); - for (var i = 0; i < signature.parameters.length; i++) { - if (i > 0) { - writer.write(", "); - } - var p = signature.parameters[i]; - if (getDeclarationFlagsFromSymbol(p) & NodeFlags.Rest) { - writer.write("..."); - } - writer.writeSymbol(p); - if (p.valueDeclaration.flags & NodeFlags.QuestionMark || (p.valueDeclaration).initializer) { - writer.write("?"); - } - writer.write(": "); - writeType(getTypeOfSymbol(p), /*allowFunctionOrConstructorTypeLiteral*/ true); - } - writer.write(arrowStyle ? ") => " : "): "); - writeType(getReturnTypeOfSignature(signature), /*allowFunctionOrConstructorTypeLiteral*/ true); } + + function buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, typeStack?: Type[]) { + appendSymbolNameOnly(tp.symbol, writer); + var constraint = getConstraintOfTypeParameter(tp); + if (constraint) { + writeSpace(writer); + writeKeyword(writer, SyntaxKind.ExtendsKeyword); + writeSpace(writer); + buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); + } + } + + function buildParameterDisplay(p: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, typeStack?: Type[]) { + if (getDeclarationFlagsFromSymbol(p) & NodeFlags.Rest) { + writePunctuation(writer, SyntaxKind.DotDotDotToken); + } + appendSymbolNameOnly(p, writer); + if (p.valueDeclaration.flags & NodeFlags.QuestionMark || (p.valueDeclaration).initializer) { + writePunctuation(writer, SyntaxKind.QuestionToken); + } + writePunctuation(writer, SyntaxKind.ColonToken); + writeSpace(writer); + + buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); + } + + function buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, typeStack?: Type[]) { + if (typeParameters && typeParameters.length) { + writePunctuation(writer, SyntaxKind.LessThanToken); + for (var i = 0; i < typeParameters.length; i++) { + if (i > 0) { + writePunctuation(writer, SyntaxKind.CommaToken); + writeSpace(writer); + } + buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); + } + writePunctuation(writer, SyntaxKind.GreaterThanToken); + } + } + + function buildDisplayForTypeArgumentsAndDelimiters(typeParameters: TypeParameter[], mapper: TypeMapper, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, typeStack?: Type[]) { + if (typeParameters && typeParameters.length) { + writePunctuation(writer, SyntaxKind.LessThanToken); + for (var i = 0; i < typeParameters.length; i++) { + if (i > 0) { + writePunctuation(writer, SyntaxKind.CommaToken); + writeSpace(writer); + } + buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, TypeFormatFlags.None); + } + writePunctuation(writer, SyntaxKind.GreaterThanToken); + } + } + + function buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, typeStack?: Type[]) { + writePunctuation(writer, SyntaxKind.OpenParenToken); + for (var i = 0; i < parameters.length; i++) { + if (i > 0) { + writePunctuation(writer, SyntaxKind.CommaToken); + writeSpace(writer); + } + buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, typeStack); + } + writePunctuation(writer, SyntaxKind.CloseParenToken); + } + + function buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, typeStack?: Type[]) { + if (flags & TypeFormatFlags.WriteArrowStyleSignature) { + writeSpace(writer); + writePunctuation(writer, SyntaxKind.EqualsGreaterThanToken); + } + else { + writePunctuation(writer, SyntaxKind.ColonToken); + } + writeSpace(writer); + buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); + } + + function buildSignatureDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, typeStack?: Type[]) { + if (signature.target && (flags & TypeFormatFlags.WriteTypeArgumentsOfSignature)) { + // Instantiated signature, write type arguments instead + // This is achieved by passing in the mapper separately + buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); + } + else { + buildDisplayForTypeParametersAndDelimiters(signature.typeParameters, writer, enclosingDeclaration, flags, typeStack); + } + + buildDisplayForParametersAndDelimiters(signature.parameters, writer, enclosingDeclaration, flags, typeStack); + buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack); + } + + return _displayBuilder || (_displayBuilder = { + symbolToString: symbolToString, + typeToString: typeToString, + buildSymbolDisplay: buildSymbolDisplay, + buildTypeDisplay: buildTypeDisplay, + buildTypeParameterDisplay: buildTypeParameterDisplay, + buildParameterDisplay: buildParameterDisplay, + buildDisplayForParametersAndDelimiters: buildDisplayForParametersAndDelimiters, + buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, + buildDisplayForTypeArgumentsAndDelimiters: buildDisplayForTypeArgumentsAndDelimiters, + buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, + buildSignatureDisplay: buildSignatureDisplay, + buildReturnTypeDisplay: buildReturnTypeDisplay + }); } function isDeclarationVisible(node: Declaration): boolean { @@ -1234,6 +1593,7 @@ module ts { case SyntaxKind.ModuleDeclaration: case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.FunctionDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.ImportDeclaration: @@ -1249,8 +1609,8 @@ module ts { case SyntaxKind.Property: case SyntaxKind.Method: - if (node.flags & NodeFlags.Private) { - // Private properties/methods are not visible + if (node.flags & (NodeFlags.Private | NodeFlags.Protected)) { + // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so let it fall into next case statement @@ -1261,6 +1621,7 @@ module ts { case SyntaxKind.IndexSignature: case SyntaxKind.Parameter: case SyntaxKind.ModuleBlock: + case SyntaxKind.TypeParameter: return isDeclarationVisible(node.parent); // Source file is always visible @@ -1268,7 +1629,7 @@ module ts { return true; default: - Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + SyntaxKind[node.kind]); + Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } @@ -1281,25 +1642,6 @@ module ts { } } - function getApparentType(type: Type): ApparentType { - if (type.flags & TypeFlags.TypeParameter) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & TypeFlags.TypeParameter); - if (!type) type = emptyObjectType; - } - if (type.flags & TypeFlags.StringLike) { - type = globalStringType; - } - else if (type.flags & TypeFlags.NumberLike) { - type = globalNumberType; - } - else if (type.flags & TypeFlags.Boolean) { - type = globalBooleanType; - } - return type; - } - function getTypeOfPrototypeProperty(prototype: Symbol): Type { // TypeScript 1.0 spec (April 2014): 8.4 // Every class automatically contains a static property member named 'prototype', @@ -1309,7 +1651,7 @@ module ts { return classType.typeParameters ? createTypeReference(classType, map(classType.typeParameters, _ => anyType)) : classType; } - function getTypeOfVariableDeclaration(declaration: VariableDeclaration): Type { + function getTypeOfVariableOrPropertyDeclaration(declaration: VariableDeclaration | PropertyDeclaration): Type { // A variable declared in a for..in statement is always of type any if (declaration.parent.kind === SyntaxKind.ForInStatement) { return anyType; @@ -1319,7 +1661,7 @@ module ts { return getTypeFromTypeNode(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { - var func = declaration.parent; + var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present if (func.kind === SyntaxKind.SetAccessor) { var getter = getDeclarationOfKind(declaration.parent.symbol, SyntaxKind.GetAccessor); @@ -1328,27 +1670,38 @@ module ts { } } // Use contextual parameter type if one is available - var type = getContextuallyTypedParameterType(declaration); + var type = getContextuallyTypedParameterType(declaration); if (type) { return type; } } // Use the type of the initializer expression if one is present if (declaration.initializer) { - var unwidenedType = checkAndMarkExpression(declaration.initializer); - var type = getWidenedType(unwidenedType); - if (type !== unwidenedType) { - checkImplicitAny(type); + var type = checkAndMarkExpression(declaration.initializer); + // Widening of property assignments is handled by checkObjectLiteral, exclude them here + if (declaration.kind !== SyntaxKind.PropertyAssignment) { + var unwidenedType = type; + type = getWidenedType(type); + if (type !== unwidenedType) { + checkImplicitAny(type); + } } return type; } + + // If it is a short-hand property assignment; Use the type of the identifier + if (declaration.kind === SyntaxKind.ShorthandPropertyAssignment) { + var type = checkIdentifier(declaration.name); + return type + } + // Rest parameters default to type any[], other parameters default to type any var type = declaration.flags & NodeFlags.Rest ? createArrayType(anyType) : anyType; checkImplicitAny(type); return type; function checkImplicitAny(type: Type) { - if (!fullTypeCheck || !program.getCompilerOptions().noImplicitAny) { + if (!fullTypeCheck || !compilerOptions.noImplicitAny) { return; } // We need to have ended up with 'any', 'any[]', 'any[][]', etc. @@ -1372,7 +1725,7 @@ module ts { default: var diagnostic = Diagnostics.Variable_0_implicitly_has_an_1_type; } - error(declaration, diagnostic, identifierToString(declaration.name), typeToString(type)); + error(declaration, diagnostic, declarationNameToString(declaration.name), typeToString(type)); } } @@ -1390,13 +1743,19 @@ module ts { } // Handle variable, parameter or property links.type = resolvingType; - var type = getTypeOfVariableDeclaration(declaration); + var type = getTypeOfVariableOrPropertyDeclaration(declaration); if (links.type === resolvingType) { links.type = type; } } else if (links.type === resolvingType) { links.type = anyType; + if (compilerOptions.noImplicitAny) { + var diagnostic = (symbol.valueDeclaration).type ? + Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : + Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; + error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); + } } return links.type; } @@ -1446,13 +1805,13 @@ module ts { } else { // If there are no specified types, try to infer it from the body of the get accessor if it exists. - if (getter) { + if (getter && getter.body) { type = getReturnTypeFromBody(getter); } // Otherwise, fall back to 'any'. else { - if (program.getCompilerOptions().noImplicitAny) { - error(setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbol.name); + if (compilerOptions.noImplicitAny) { + error(setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbolToString(symbol)); } type = anyType; @@ -1466,6 +1825,10 @@ module ts { } else if (links.type === resolvingType) { links.type = anyType; + if (compilerOptions.noImplicitAny) { + var getter = getDeclarationOfKind(symbol, SyntaxKind.GetAccessor); + error(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); + } } } @@ -1502,6 +1865,9 @@ module ts { } function getTypeOfSymbol(symbol: Symbol): Type { + if (symbol.flags & SymbolFlags.Instantiated) { + return getTypeOfInstantiatedSymbol(symbol); + } if (symbol.flags & (SymbolFlags.Variable | SymbolFlags.Property)) { return getTypeOfVariableOrParameterOrProperty(symbol); } @@ -1517,9 +1883,6 @@ module ts { if (symbol.flags & SymbolFlags.Import) { return getTypeOfImport(symbol); } - if (symbol.flags & SymbolFlags.Instantiated) { - return getTypeOfInstantiatedSymbol(symbol); - } return unknownType; } @@ -1529,7 +1892,7 @@ module ts { function hasBaseType(type: InterfaceType, checkBase: InterfaceType) { return check(type); - function check(type: InterfaceType) { + function check(type: InterfaceType): boolean { var target = getTargetType(type); return target === checkBase || forEach(target.baseTypes, check); } @@ -1642,6 +2005,24 @@ module ts { return links.declaredType; } + function getDeclaredTypeOfTypeAlias(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = resolvingType; + var declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); + var type = getTypeFromTypeNode(declaration.type); + if (links.declaredType === resolvingType) { + links.declaredType = type; + } + } + else if (links.declaredType === resolvingType) { + links.declaredType = unknownType; + var declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); + error(declaration.name, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + return links.declaredType; + } + function getDeclaredTypeOfEnum(symbol: Symbol): Type { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -1674,12 +2055,16 @@ module ts { } function getDeclaredTypeOfSymbol(symbol: Symbol): Type { + Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0); if (symbol.flags & SymbolFlags.Class) { return getDeclaredTypeOfClass(symbol); } if (symbol.flags & SymbolFlags.Interface) { return getDeclaredTypeOfInterface(symbol); } + if (symbol.flags & SymbolFlags.TypeAlias) { + return getDeclaredTypeOfTypeAlias(symbol); + } if (symbol.flags & SymbolFlags.Enum) { return getDeclaredTypeOfEnum(symbol); } @@ -1689,7 +2074,6 @@ module ts { if (symbol.flags & SymbolFlags.Import) { return getDeclaredTypeOfImport(symbol); } - Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0); return unknownType; } @@ -1737,7 +2121,7 @@ module ts { if (type.baseTypes.length) { members = createSymbolTable(type.declaredProperties); forEach(type.baseTypes, baseType => { - addInheritedMembers(members, getPropertiesOfType(baseType)); + addInheritedMembers(members, getPropertiesOfObjectType(baseType)); callSignatures = concatenate(callSignatures, getSignaturesOfType(baseType, SignatureKind.Call)); constructSignatures = concatenate(constructSignatures, getSignaturesOfType(baseType, SignatureKind.Construct)); stringIndexType = stringIndexType || getIndexTypeOfType(baseType, IndexKind.String); @@ -1757,7 +2141,7 @@ module ts { var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; forEach(target.baseTypes, baseType => { var instantiatedBaseType = instantiateType(baseType, mapper); - addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); + addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Call)); constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Construct)); stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, IndexKind.String); @@ -1799,6 +2183,83 @@ module ts { return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; } + function createTupleTypeMemberSymbols(memberTypes: Type[]): SymbolTable { + var members: SymbolTable = {}; + for (var i = 0; i < memberTypes.length; i++) { + var symbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "" + i); + symbol.type = memberTypes[i]; + members[i] = symbol; + } + return members; + } + + function resolveTupleTypeMembers(type: TupleType) { + var arrayType = resolveObjectOrUnionTypeMembers(createArrayType(getUnionType(type.elementTypes))); + var members = createTupleTypeMemberSymbols(type.elementTypes); + addInheritedMembers(members, arrayType.properties); + setObjectTypeMembers(type, members, arrayType.callSignatures, arrayType.constructSignatures, arrayType.stringIndexType, arrayType.numberIndexType); + } + + function signatureListsIdentical(s: Signature[], t: Signature[]): boolean { + if (s.length !== t.length) { + return false; + } + for (var i = 0; i < s.length; i++) { + if (!compareSignatures(s[i], t[i], /*compareReturnTypes*/ false, compareTypes)) { + return false; + } + } + return true; + } + + // If the lists of call or construct signatures in the given types are all identical except for return types, + // and if none of the signatures are generic, return a list of signatures that has substitutes a union of the + // return types of the corresponding signatures in each resulting signature. + function getUnionSignatures(types: Type[], kind: SignatureKind): Signature[] { + var signatureLists = map(types, t => getSignaturesOfType(t, kind)); + var signatures = signatureLists[0]; + for (var i = 0; i < signatures.length; i++) { + if (signatures[i].typeParameters) { + return emptyArray; + } + } + for (var i = 1; i < signatureLists.length; i++) { + if (!signatureListsIdentical(signatures, signatureLists[i])) { + return emptyArray; + } + } + var result = map(signatures, cloneSignature); + for (var i = 0; i < result.length; i++) { + var s = result[i]; + // Clear resolved return type we possibly got from cloneSignature + s.resolvedReturnType = undefined; + s.unionSignatures = map(signatureLists, signatures => signatures[i]); + } + return result; + } + + function getUnionIndexType(types: Type[], kind: IndexKind): Type { + var indexTypes: Type[] = []; + for (var i = 0; i < types.length; i++) { + var indexType = getIndexTypeOfType(types[i], kind); + if (!indexType) { + return undefined; + } + indexTypes.push(indexType); + } + return getUnionType(indexTypes); + } + + function resolveUnionTypeMembers(type: UnionType) { + // The members and properties collections are empty for union types. To get all properties of a union + // type use getPropertiesOfType (only the language service uses this). + var callSignatures = getUnionSignatures(type.types, SignatureKind.Call); + var constructSignatures = getUnionSignatures(type.types, SignatureKind.Construct); + var stringIndexType = getUnionIndexType(type.types, IndexKind.String); + var numberIndexType = getUnionIndexType(type.types, IndexKind.Number); + setObjectTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function resolveAnonymousTypeMembers(type: ObjectType) { var symbol = type.symbol; if (symbol.flags & SymbolFlags.TypeLiteral) { @@ -1827,7 +2288,7 @@ module ts { } if (classType.baseTypes.length) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); } } var stringIndexType: Type = undefined; @@ -1836,72 +2297,191 @@ module ts { setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } - function resolveObjectTypeMembers(type: ObjectType): ResolvedObjectType { - if (!(type).members) { + function resolveObjectOrUnionTypeMembers(type: ObjectType): ResolvedType { + if (!(type).members) { if (type.flags & (TypeFlags.Class | TypeFlags.Interface)) { resolveClassOrInterfaceMembers(type); } else if (type.flags & TypeFlags.Anonymous) { resolveAnonymousTypeMembers(type); } + else if (type.flags & TypeFlags.Tuple) { + resolveTupleTypeMembers(type); + } + else if (type.flags & TypeFlags.Union) { + resolveUnionTypeMembers(type); + } else { resolveTypeReferenceMembers(type); } } - return type; + return type; } - function getPropertiesOfType(type: Type): Symbol[] { + // Return properties of an object type or an empty array for other types + function getPropertiesOfObjectType(type: Type): Symbol[] { if (type.flags & TypeFlags.ObjectType) { - return resolveObjectTypeMembers(type).properties; + return resolveObjectOrUnionTypeMembers(type).properties; } return emptyArray; } + // If the given type is an object type and that type has a property by the given name, return + // the symbol for that property. Otherwise return undefined. + function getPropertyOfObjectType(type: Type, name: string): Symbol { + if (type.flags & TypeFlags.ObjectType) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + } + } + + function getPropertiesOfUnionType(type: UnionType): Symbol[] { + var result: Symbol[] = []; + forEach(getPropertiesOfType(type.types[0]), prop => { + var unionProp = getPropertyOfUnionType(type, prop.name); + if (unionProp) { + result.push(unionProp); + } + }); + return result; + } + + function getPropertiesOfType(type: Type): Symbol[] { + if (type.flags & TypeFlags.Union) { + return getPropertiesOfUnionType(type); + } + return getPropertiesOfObjectType(getApparentType(type)); + } + + // For a type parameter, return the base constraint of the type parameter. For the string, number, and + // boolean primitive types, return the corresponding object types.Otherwise return the type itself. + // Note that the apparent type of a union type is the union type itself. + function getApparentType(type: Type): Type { + if (type.flags & TypeFlags.TypeParameter) { + do { + type = getConstraintOfTypeParameter(type); + } while (type && type.flags & TypeFlags.TypeParameter); + if (!type) { + type = emptyObjectType; + } + } + if (type.flags & TypeFlags.StringLike) { + type = globalStringType; + } + else if (type.flags & TypeFlags.NumberLike) { + type = globalNumberType; + } + else if (type.flags & TypeFlags.Boolean) { + type = globalBooleanType; + } + return type; + } + + function createUnionProperty(unionType: UnionType, name: string): Symbol { + var types = unionType.types; + var props: Symbol[]; + for (var i = 0; i < types.length; i++) { + var type = getApparentType(types[i]); + if (type !== unknownType) { + var prop = getPropertyOfType(type, name); + if (!prop) { + return undefined; + } + if (!props) { + props = [prop]; + } + else { + props.push(prop); + } + } + } + var propTypes: Type[] = []; + var declarations: Declaration[] = []; + for (var i = 0; i < props.length; i++) { + var prop = props[i]; + if (prop.declarations) { + declarations.push.apply(declarations, prop.declarations); + } + propTypes.push(getTypeOfSymbol(prop)); + } + var result = createSymbol(SymbolFlags.Property | SymbolFlags.Transient | SymbolFlags.UnionProperty, name); + result.unionType = unionType; + result.declarations = declarations; + result.type = getUnionType(propTypes); + return result; + } + + function getPropertyOfUnionType(type: UnionType, name: string): Symbol { + var properties = type.resolvedProperties || (type.resolvedProperties = {}); + if (hasProperty(properties, name)) { + return properties[name]; + } + var property = createUnionProperty(type, name); + if (property) { + properties[name] = property; + } + return property; + } + + // Return the symbol for the property with the given name in the given type. Creates synthetic union properties when + // necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from + // Object and Function as appropriate. function getPropertyOfType(type: Type, name: string): Symbol { - if (type.flags & TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } + if (type.flags & TypeFlags.Union) { + return getPropertyOfUnionType(type, name); + } + if (!(type.flags & TypeFlags.ObjectType)) { + type = getApparentType(type); + if (!(type.flags & TypeFlags.ObjectType)) { + return undefined; } } - } - - function getPropertyOfApparentType(type: ApparentType, name: string): Symbol { - if (type.flags & TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } + var resolved = resolveObjectOrUnionTypeMembers(type); + if (hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfType(globalFunctionType, name); - if (symbol) return symbol; - } - return getPropertyOfType(globalObjectType, name); } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) return symbol; + } + return getPropertyOfObjectType(globalObjectType, name); } - function getSignaturesOfType(type: Type, kind: SignatureKind): Signature[] { - if (type.flags & TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); + function getSignaturesOfObjectOrUnionType(type: Type, kind: SignatureKind): Signature[] { + if (type.flags & (TypeFlags.ObjectType | TypeFlags.Union)) { + var resolved = resolveObjectOrUnionTypeMembers(type); return kind === SignatureKind.Call ? resolved.callSignatures : resolved.constructSignatures; } return emptyArray; } - function getIndexTypeOfType(type: Type, kind: IndexKind): Type { - if (type.flags & TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); + // Return the signatures of the given kind in the given type. Creates synthetic union signatures when necessary and + // maps primitive types and type parameters are to their apparent types. + function getSignaturesOfType(type: Type, kind: SignatureKind): Signature[] { + return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); + } + + function getIndexTypeOfObjectOrUnionType(type: Type, kind: IndexKind): Type { + if (type.flags & (TypeFlags.ObjectType | TypeFlags.Union)) { + var resolved = resolveObjectOrUnionTypeMembers(type); return kind === IndexKind.String ? resolved.stringIndexType : resolved.numberIndexType; } } + // Return the index type of the given kind in the given type. Creates synthetic union index types when necessary and + // maps primitive types and type parameters are to their apparent types. + function getIndexTypeOfType(type: Type, kind: IndexKind): Type { + return getIndexTypeOfObjectOrUnionType(getApparentType(type), kind); + } + // Return list of type parameters with duplicates removed (duplicate identifier errors are generated in the actual // type checking functions). function getTypeParametersFromDeclaration(typeParameterDeclarations: TypeParameterDeclaration[]): TypeParameter[] { @@ -1956,7 +2536,7 @@ module ts { returnType = getAnnotatedAccessorType(setter); } - if (!returnType && !(declaration).body) { + if (!returnType && !(declaration).body) { returnType = anyType; } } @@ -1973,6 +2553,8 @@ module ts { for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: case SyntaxKind.FunctionDeclaration: case SyntaxKind.Method: case SyntaxKind.Constructor: @@ -1986,7 +2568,7 @@ module ts { // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). - if (i > 0 && (node).body) { + if (i > 0 && (node).body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { break; @@ -2004,8 +2586,11 @@ module ts { if (signature.target) { var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } + else if (signature.unionSignatures) { + var type = getUnionType(map(signature.unionSignatures, getReturnTypeOfSignature)); + } else { - var type = getReturnTypeFromBody(signature.declaration); + var type = getReturnTypeFromBody(signature.declaration); } if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = type; @@ -2013,6 +2598,15 @@ module ts { } else if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = anyType; + if (compilerOptions.noImplicitAny) { + var declaration = signature.declaration; + if (declaration.name) { + error(declaration.name, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, declarationNameToString(declaration.name)); + } + else { + error(declaration, Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); + } + } } return signature.resolvedReturnType; } @@ -2051,7 +2645,7 @@ module ts { // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var isConstructor = signature.declaration.kind === SyntaxKind.Constructor || signature.declaration.kind === SyntaxKind.ConstructSignature; - var type = createObjectType(TypeFlags.Anonymous | TypeFlags.FromSignature); + var type = createObjectType(TypeFlags.Anonymous | TypeFlags.FromSignature); type.members = emptySymbols; type.properties = emptyArray; type.callSignatures = !isConstructor ? [signature] : emptyArray; @@ -2199,7 +2793,7 @@ module ts { if (type.flags & (TypeFlags.Class | TypeFlags.Interface) && type.flags & TypeFlags.Reference) { var typeParameters = (type).typeParameters; if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, map(node.typeArguments, t => getTypeFromTypeNode(t))); + type = createTypeReference(type, map(node.typeArguments, getTypeFromTypeNode)); } else { error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length); @@ -2285,7 +2879,121 @@ module ts { return links.resolvedType; } - function getTypeFromTypeLiteralNode(node: TypeLiteralNode): Type { + function createTupleType(elementTypes: Type[]) { + var id = getTypeListId(elementTypes); + var type = tupleTypes[id]; + if (!type) { + type = tupleTypes[id] = createObjectType(TypeFlags.Tuple); + type.elementTypes = elementTypes; + } + return type; + } + + function getTypeFromTupleTypeNode(node: TupleTypeNode): Type { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNode)); + } + return links.resolvedType; + } + + function addTypeToSortedSet(sortedSet: Type[], type: Type) { + if (type.flags & TypeFlags.Union) { + addTypesToSortedSet(sortedSet, (type).types); + } + else { + var i = 0; + var id = type.id; + while (i < sortedSet.length && sortedSet[i].id < id) { + i++; + } + if (i === sortedSet.length || sortedSet[i].id !== id) { + sortedSet.splice(i, 0, type); + } + } + } + + function addTypesToSortedSet(sortedTypes: Type[], types: Type[]) { + for (var i = 0, len = types.length; i < len; i++) { + addTypeToSortedSet(sortedTypes, types[i]); + } + } + + function isSubtypeOfAny(candidate: Type, types: Type[]): boolean { + for (var i = 0, len = types.length; i < len; i++) { + if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + return true; + } + } + return false; + } + + function removeSubtypes(types: Type[]) { + var i = types.length; + while (i > 0) { + i--; + if (isSubtypeOfAny(types[i], types)) { + types.splice(i, 1); + } + } + } + + function containsAnyType(types: Type[]) { + for (var i = 0; i < types.length; i++) { + if (types[i].flags & TypeFlags.Any) { + return true; + } + } + return false; + } + + function removeAllButLast(types: Type[], typeToRemove: Type) { + var i = types.length; + while (i > 0 && types.length > 1) { + i--; + if (types[i] === typeToRemove) { + types.splice(i, 1); + } + } + } + + function getUnionType(types: Type[], noSubtypeReduction?: boolean): Type { + if (types.length === 0) { + return emptyObjectType; + } + var sortedTypes: Type[] = []; + addTypesToSortedSet(sortedTypes, types); + if (noSubtypeReduction) { + if (containsAnyType(sortedTypes)) { + return anyType; + } + removeAllButLast(sortedTypes, undefinedType); + removeAllButLast(sortedTypes, nullType); + } + else { + removeSubtypes(sortedTypes); + } + if (sortedTypes.length === 1) { + return sortedTypes[0]; + } + var id = getTypeListId(sortedTypes); + var type = unionTypes[id]; + if (!type) { + type = unionTypes[id] = createObjectType(TypeFlags.Union); + type.types = sortedTypes; + } + return type; + } + + function getTypeFromUnionTypeNode(node: UnionTypeNode): Type { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNode), /*noSubtypeReduction*/ true); + } + return links.resolvedType; + } + + function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node: Node): Type { var links = getNodeLinks(node); if (!links.resolvedType) { // Deferred resolution of members is handled by resolveObjectTypeMembers @@ -2297,7 +3005,7 @@ module ts { function getStringLiteralType(node: StringLiteralTypeNode): StringLiteralType { if (hasProperty(stringLiteralTypes, node.text)) return stringLiteralTypes[node.text]; var type = stringLiteralTypes[node.text] = createType(TypeFlags.StringLiteral); - type.text = getSourceTextOfNode(node); + type.text = getTextOfNode(node); return type; } @@ -2329,14 +3037,22 @@ module ts { return getTypeFromTypeQueryNode(node); case SyntaxKind.ArrayType: return getTypeFromArrayTypeNode(node); + case SyntaxKind.TupleType: + return getTypeFromTupleTypeNode(node); + case SyntaxKind.UnionType: + return getTypeFromUnionTypeNode(node); + case SyntaxKind.ParenType: + return getTypeFromTypeNode((node).type); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: case SyntaxKind.TypeLiteral: - return getTypeFromTypeLiteralNode(node); + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case SyntaxKind.Identifier: case SyntaxKind.QualifiedName: var symbol = getSymbolInfo(node); - return getDeclaredTypeOfSymbol(symbol); + return symbol && getDeclaredTypeOfSymbol(symbol); default: return unknownType; } @@ -2453,7 +3169,7 @@ module ts { // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and // also transient so that we can just store data on it directly. - var result = createSymbol(SymbolFlags.Instantiated | SymbolFlags.Transient, symbol.name); + var result = createSymbol(SymbolFlags.Instantiated | SymbolFlags.Transient | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -2466,8 +3182,8 @@ module ts { } function instantiateAnonymousType(type: ObjectType, mapper: TypeMapper): ObjectType { - var result = createObjectType(TypeFlags.Anonymous, type.symbol); - result.properties = instantiateList(getPropertiesOfType(type), mapper, instantiateSymbol); + var result = createObjectType(TypeFlags.Anonymous, type.symbol); + result.properties = instantiateList(getPropertiesOfObjectType(type), mapper, instantiateSymbol); result.members = createSymbolTable(result.properties); result.callSignatures = instantiateList(getSignaturesOfType(type, SignatureKind.Call), mapper, instantiateSignature); result.constructSignatures = instantiateList(getSignaturesOfType(type, SignatureKind.Construct), mapper, instantiateSignature); @@ -2490,6 +3206,12 @@ module ts { if (type.flags & TypeFlags.Reference) { return createTypeReference((type).target, instantiateList((type).typeArguments, mapper, instantiateType)); } + if (type.flags & TypeFlags.Tuple) { + return createTupleType(instantiateList((type).elementTypes, mapper, instantiateType)); + } + if (type.flags & TypeFlags.Union) { + return getUnionType(instantiateList((type).types, mapper, instantiateType), /*noSubtypeReduction*/ true); + } } return type; } @@ -2518,9 +3240,9 @@ module ts { function getTypeWithoutConstructors(type: Type): Type { if (type.flags & TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); + var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.constructSignatures.length) { - var result = createObjectType(TypeFlags.Anonymous, type.symbol); + var result = createObjectType(TypeFlags.Anonymous, type.symbol); result.members = resolved.members; result.properties = resolved.properties; result.callSignatures = resolved.callSignatures; @@ -2538,214 +3260,190 @@ module ts { var identityRelation: Map = {}; function isTypeIdenticalTo(source: Type, target: Type): boolean { - return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined); + } + + function compareTypes(source: Type, target: Type): Ternary { + return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined) ? Ternary.True : Ternary.False; } function isTypeSubtypeOf(source: Type, target: Type): boolean { - return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); - } - - function checkTypeSubtypeOf(source: Type, target: Type, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); + return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined); } function isTypeAssignableTo(source: Type, target: Type): boolean { - return checkTypeAssignableTo(source, target, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + return checkTypeAssignableTo(source, target, /*errorNode*/ undefined); } - function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); + function checkTypeSubtypeOf(source: Type, target: Type, errorNode: Node, headMessage?: DiagnosticMessage, containingMessageChain?: DiagnosticMessageChain): boolean { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); } - function isTypeRelatedTo(source: Type, target: Type, relation: Map): boolean { - return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, headMessage?: DiagnosticMessage): boolean { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage); } function isSignatureAssignableTo(source: Signature, target: Signature): boolean { var sourceType = getOrCreateTypeFromSignature(source); var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + return checkTypeRelatedTo(sourceType, targetType, assignableRelation, /*errorNode*/ undefined); } - function isPropertyIdenticalTo(sourceProp: Symbol, targetProp: Symbol): boolean { - return isPropertyIdenticalToRecursive(sourceProp, targetProp, /*reportErrors*/ false, (s, t, _reportErrors) => isTypeIdenticalTo(s, t)); - } + function checkTypeRelatedTo( + source: Type, + target: Type, + relation: Map, + errorNode: Node, + headMessage?: DiagnosticMessage, + containingMessageChain?: DiagnosticMessageChain): boolean { - function checkInheritedPropertiesAreIdentical(type: InterfaceType, typeNode: Node): boolean { - if (!type.baseTypes.length || type.baseTypes.length === 1) { - return true; - } - - var seen: Map<{ prop: Symbol; containingType: Type }> = {}; - forEach(type.declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; }); - var ok = true; - - for (var i = 0, len = type.baseTypes.length; i < len; ++i) { - var base = type.baseTypes[i]; - var properties = getPropertiesOfType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; - if (!hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - - var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type), typeName1, typeName2); - addDiagnostic(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); - } - } - } - } - - return ok; - } - - function isPropertyIdenticalToRecursive(sourceProp: Symbol, targetProp: Symbol, reportErrors: boolean, relate: (source: Type, target: Type, reportErrors: boolean) => boolean): boolean { - Debug.assert(sourceProp); - if (!targetProp) { - return false; - } - - // Two members are considered identical when - // - they are public properties with identical names, optionality, and types, - // - they are private properties originating in the same declaration and having identical types - var sourcePropIsPrivate = getDeclarationFlagsFromSymbol(sourceProp) & NodeFlags.Private; - var targetPropIsPrivate = getDeclarationFlagsFromSymbol(targetProp) & NodeFlags.Private; - if (sourcePropIsPrivate !== targetPropIsPrivate) { - return false; - } - - if (sourcePropIsPrivate) { - return (getTargetSymbol(sourceProp).parent === getTargetSymbol(targetProp).parent) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - else { - return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - } - - function checkTypeRelatedTo(source: Type, target: Type, relation: Map, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { var errorInfo: DiagnosticMessageChain; var sourceStack: ObjectType[]; var targetStack: ObjectType[]; + var maybeStack: Map[]; var expandingFlags: number; var depth = 0; var overflow = false; Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); + var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { + if (containingMessageChain) { + errorInfo = concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + } addDiagnostic(createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine())); } - return result; + return result !== Ternary.False; - function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string): void { - errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1); + function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string, arg2?: string): void { + errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source: Type, target: Type, reportErrors: boolean): boolean { - return isRelatedToWithCustomErrors(source, target, reportErrors, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); - } - - function isRelatedToWithCustomErrors(source: Type, target: Type, reportErrors: boolean, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { + // Compare two types and return + // Ternary.True if they are related with no assumptions, + // Ternary.Maybe if they are related with assumptions of other relationships, or + // Ternary.False if they are not related. + function isRelatedTo(source: Type, target: Type, reportErrors?: boolean, headMessage?: DiagnosticMessage): Ternary { + var result: Ternary; if (relation === identityRelation) { // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases - if (source === target) return true; + if (source === target) return Ternary.True; } else { - if (source === target) return true; - if (target.flags & TypeFlags.Any) return true; - if (source === undefinedType) return true; - if (source === nullType && target !== undefinedType) return true; - if (source.flags & TypeFlags.Enum && target === numberType) return true; - if (source.flags & TypeFlags.StringLiteral && target === stringType) return true; + if (source === target) return Ternary.True; + if (target.flags & TypeFlags.Any) return Ternary.True; + if (source === undefinedType) return Ternary.True; + if (source === nullType && target !== undefinedType) return Ternary.True; + if (source.flags & TypeFlags.Enum && target === numberType) return Ternary.True; + if (source.flags & TypeFlags.StringLiteral && target === stringType) return Ternary.True; if (relation === assignableRelation) { - if (source.flags & TypeFlags.Any) return true; - if (source === numberType && target.flags & TypeFlags.Enum) return true; + if (source.flags & TypeFlags.Any) return Ternary.True; + if (source === numberType && target.flags & TypeFlags.Enum) return Ternary.True; } } - - if (source.flags & TypeFlags.TypeParameter && target.flags & TypeFlags.TypeParameter) { - if (typeParameterRelatedTo(source, target, reportErrors)) { - return true; + if (source.flags & TypeFlags.Union) { + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; + } + } + else if (target.flags & TypeFlags.Union) { + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; + } + } + else if (source.flags & TypeFlags.TypeParameter && target.flags & TypeFlags.TypeParameter) { + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & TypeFlags.Reference && target.flags & TypeFlags.Reference && (source).target === (target).target) { // We have type references to same target type, see if relationship holds for all type arguments - if (typesRelatedTo((source).typeArguments, (target).typeArguments, reportErrors)) { - return true; + if (result = typesRelatedTo((source).typeArguments, (target).typeArguments, reportErrors)) { + return result; } } // Even if relationship doesn't hold for type arguments, it may hold in a structural comparison // Report structural errors only if we haven't reported any errors yet var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; // identity relation does not use apparent type - var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); + var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType && - objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return true; + return result; } } if (reportErrors) { - // The error should end in a period when this is the deepest error in the chain - // (when errorInfo is undefined). Otherwise, it has a colon before the nested - // error. - - chainedMessage = chainedMessage || Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; - terminalMessage = terminalMessage || Diagnostics.Type_0_is_not_assignable_to_type_1; - var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; - Debug.assert(diagnosticKey); - reportError(diagnosticKey, typeToString(source), typeToString(target)); + headMessage = headMessage || Diagnostics.Type_0_is_not_assignable_to_type_1; + reportError(headMessage, typeToString(source), typeToString(target)); } - return false; + return Ternary.False; } - function typesRelatedTo(sources: Type[], targets: Type[], reportErrors: boolean): boolean { + function typeRelatedToUnionType(source: Type, target: UnionType, reportErrors: boolean): Ternary { + var targetTypes = target.types; + for (var i = 0, len = targetTypes.length; i < len; i++) { + var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + if (related) { + return related; + } + } + return Ternary.False; + } + + function unionTypeRelatedToType(source: UnionType, target: Type, reportErrors: boolean): Ternary { + var result = Ternary.True; + var sourceTypes = source.types; + for (var i = 0, len = sourceTypes.length; i < len; i++) { + var related = isRelatedTo(sourceTypes[i], target, reportErrors); + if (!related) { + return Ternary.False; + } + result &= related; + } + return result; + } + + function typesRelatedTo(sources: Type[], targets: Type[], reportErrors: boolean): Ternary { + var result = Ternary.True; for (var i = 0, len = sources.length; i < len; i++) { - if (!isRelatedTo(sources[i], targets[i], reportErrors)) return false; + var related = isRelatedTo(sources[i], targets[i], reportErrors); + if (!related) { + return Ternary.False; + } + result &= related; } - return true; + return result; } - function typeParameterRelatedTo(source: TypeParameter, target: TypeParameter, reportErrors: boolean): boolean { + function typeParameterRelatedTo(source: TypeParameter, target: TypeParameter, reportErrors: boolean): Ternary { if (relation === identityRelation) { if (source.symbol.name !== target.symbol.name) { - return false; + return Ternary.False; } - // covers case when both type parameters does not have constraint (both equal to noConstraintType) if (source.constraint === target.constraint) { - return true; + return Ternary.True; } - if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return false; + return Ternary.False; } - return isRelatedTo(source.constraint, target.constraint, reportErrors); } else { while (true) { var constraint = getConstraintOfTypeParameter(source); - if (constraint === target) return true; + if (constraint === target) return Ternary.True; if (!(constraint && constraint.flags & TypeFlags.TypeParameter)) break; source = constraint; } - return false; + return Ternary.False; } } @@ -2754,41 +3452,73 @@ module ts { // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { - if (overflow) return false; - var result: boolean; + function objectTypeRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): Ternary { + if (overflow) { + return Ternary.False; + } var id = source.id + "," + target.id; - if ((result = relation[id]) !== undefined) return result; + var related = relation[id]; + if (related !== undefined) { + return related ? Ternary.True : Ternary.False; + } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) return true; + // If source and target are already being compared, consider them related with assumptions + if (maybeStack[i][id]) { + return Ternary.Maybe; + } } if (depth === 100) { overflow = true; - return false; + return Ternary.False; } } else { sourceStack = []; targetStack = []; + maybeStack = []; expandingFlags = 0; } sourceStack[depth] = source; targetStack[depth] = target; + maybeStack[depth] = {}; + maybeStack[depth][id] = true; depth++; var saveExpandingFlags = expandingFlags; if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - result = expandingFlags === 3 || - propertiesRelatedTo(source, target, reportErrors) && - signaturesRelatedTo(source, target, SignatureKind.Call, reportErrors) && - signaturesRelatedTo(source, target, SignatureKind.Construct, reportErrors) && - stringIndexTypesRelatedTo(source, target, reportErrors) && - numberIndexTypesRelatedTo(source, target, reportErrors); + if (expandingFlags === 3) { + var result = Ternary.Maybe; + } + else { + var result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, SignatureKind.Call, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, SignatureKind.Construct, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); + } + } + } + } + } expandingFlags = saveExpandingFlags; depth--; - if (depth === 0) { - relation[id] = result; + if (result) { + var maybeCache = maybeStack[depth]; + // If result is definitely true, copy assumptions to global cache, else copy to next level up + var destinationCache = result === Ternary.True || depth === 0 ? relation : maybeStack[depth - 1]; + for (var p in maybeCache) { + destinationCache[p] = maybeCache[p]; + } + } + else { + // A false result goes straight into global cache (when something is false under assumptions it + // will also be false without assumptions) + relation[id] = false; } return result; } @@ -2813,168 +3543,121 @@ module ts { return false; } - function propertiesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + function propertiesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): Ternary { if (relation === identityRelation) { - return propertiesAreIdenticalTo(source, target, reportErrors); + return propertiesIdenticalTo(source, target); } - else { - return propertiesAreSubtypeOrAssignableTo(source, target, reportErrors); - } - } - - function propertiesAreIdenticalTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { - if (source === target) { - return true; - } - - var sourceProperties = getPropertiesOfType(source); - var targetProperties = getPropertiesOfType(target); - if (sourceProperties.length !== targetProperties.length) { - return false; - } - - for (var i = 0, len = sourceProperties.length; i < len; ++i) { - var sourceProp = sourceProperties[i]; - var targetProp = getPropertyOfType(target, sourceProp.name); - - if (!isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { - return false; - } - } - - return true; - } - - function propertiesAreSubtypeOrAssignableTo(source: ApparentType, target: ObjectType, reportErrors: boolean): boolean { - var properties = getPropertiesOfType(target); + var result = Ternary.True; + var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; - var sourceProp = getPropertyOfApparentType(source, targetProp.name); - if (sourceProp === targetProp) { - continue; - } - - var targetPropIsOptional = isOptionalProperty(targetProp); - if (!sourceProp) { - if (!targetPropIsOptional) { - if (reportErrors) { - reportError(Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); + var sourceProp = getPropertyOfType(source, targetProp.name); + if (sourceProp !== targetProp) { + if (!sourceProp) { + if (relation === subtypeRelation || !isOptionalProperty(targetProp)) { + if (reportErrors) { + reportError(Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); + } + return Ternary.False; } - return false; } - } - else if (sourceProp !== targetProp) { - if (targetProp.flags & SymbolFlags.Prototype) { - continue; - } - - if (getDeclarationFlagsFromSymbol(sourceProp) & NodeFlags.Private || getDeclarationFlagsFromSymbol(targetProp) & NodeFlags.Private) { - if (reportErrors) { - reportError(Diagnostics.Private_property_0_cannot_be_reimplemented, symbolToString(targetProp)); + else if (!(targetProp.flags & SymbolFlags.Prototype)) { + var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); + var targetFlags = getDeclarationFlagsFromSymbol(targetProp); + if (sourceFlags & NodeFlags.Private || targetFlags & NodeFlags.Private) { + if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { + if (reportErrors) { + if (sourceFlags & NodeFlags.Private && targetFlags & NodeFlags.Private) { + reportError(Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); + } + else { + reportError(Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), + typeToString(sourceFlags & NodeFlags.Private ? source : target), + typeToString(sourceFlags & NodeFlags.Private ? target : source)); + } + } + return Ternary.False; + } } - return false; - } - if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { - if (reportErrors) { - reportError(Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); + else if (targetFlags & NodeFlags.Protected) { + var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & SymbolFlags.Class; + var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; + var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); + if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { + if (reportErrors) { + reportError(Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, + symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); + } + return Ternary.False; + } } - return false; - } - else if (isOptionalProperty(sourceProp) && !targetPropIsOptional) { - // TypeScript 1.0 spec (April 2014): 3.8.3 - // S is a subtype of a type T, and T is a supertype of S if ... - // S' and T are object types and, for each member M in T.. - // M is a property and S' contains a property N where - // if M is a required property, N is also a required property - // (M - property in T) - // (N - property in S) - if (reportErrors) { - reportError(Diagnostics.Required_property_0_cannot_be_reimplemented_with_optional_property_in_1, targetProp.name, typeToString(source)); + else if (sourceFlags & NodeFlags.Protected) { + if (reportErrors) { + reportError(Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, + symbolToString(targetProp), typeToString(source), typeToString(target)); + } + return Ternary.False; + } + var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + if (!related) { + if (reportErrors) { + reportError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); + } + return Ternary.False; + } + result &= related; + if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) { + // TypeScript 1.0 spec (April 2014): 3.8.3 + // S is a subtype of a type T, and T is a supertype of S if ... + // S' and T are object types and, for each member M in T.. + // M is a property and S' contains a property N where + // if M is a required property, N is also a required property + // (M - property in T) + // (N - property in S) + if (reportErrors) { + reportError(Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, + symbolToString(targetProp), typeToString(source), typeToString(target)); + } + return Ternary.False; } - return false; } } } - return true; + return result; } - function signaturesRelatedTo(source: ObjectType, target: ObjectType, kind: SignatureKind, reportErrors: boolean): boolean { + function propertiesIdenticalTo(source: ObjectType, target: ObjectType): Ternary { + var sourceProperties = getPropertiesOfObjectType(source); + var targetProperties = getPropertiesOfObjectType(target); + if (sourceProperties.length !== targetProperties.length) { + return Ternary.False; + } + var result = Ternary.True; + for (var i = 0, len = sourceProperties.length; i < len; ++i) { + var sourceProp = sourceProperties[i]; + var targetProp = getPropertyOfObjectType(target, sourceProp.name); + if (!targetProp) { + return Ternary.False; + } + var related = compareProperties(sourceProp, targetProp, isRelatedTo); + if (!related) { + return Ternary.False; + } + result &= related; + } + return result; + } + + function signaturesRelatedTo(source: ObjectType, target: ObjectType, kind: SignatureKind, reportErrors: boolean): Ternary { if (relation === identityRelation) { - return areSignaturesIdenticalTo(source, target, kind, reportErrors); + return signaturesIdenticalTo(source, target, kind); } - else { - return areSignaturesSubtypeOrAssignableTo(source, target, kind, reportErrors); + if (target === anyFunctionType || source === anyFunctionType) { + return Ternary.True; } - } - - function areSignaturesIdenticalTo(source: ObjectType, target: ObjectType, kind: SignatureKind, reportErrors: boolean): boolean { - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - if (sourceSignatures.length !== targetSignatures.length) { - return false; - } - - for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - if (!isSignatureIdenticalTo(sourceSignatures[i], targetSignatures[i], reportErrors)) { - return false; - } - } - - return true; - } - - function isSignatureIdenticalTo(source: Signature, target: Signature, reportErrors: boolean): boolean { - if (source === target) { - return true; - } - - if (source.hasRestParameter !== target.hasRestParameter) { - return false; - } - - if (source.parameters.length !== target.parameters.length) { - return false; - } - - if (source.minArgumentCount !== target.minArgumentCount) { - return false; - } - - if (source.typeParameters && target.typeParameters) { - if (source.typeParameters.length !== target.typeParameters.length) { - return false; - } - - for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - if (!isRelatedTo(source.typeParameters[i], target.typeParameters[i], reportErrors)) { - return false; - } - } - } - else if (source.typeParameters || source.typeParameters) { - return false; - } - - // Spec 1.0 Section 3.8.3 & 3.8.4: - // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N - source = getErasedSignature(source); - target = getErasedSignature(target); - for (var i = 0, len = source.parameters.length; i < len; i++) { - var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); - var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - if (!isRelatedTo(s, t, reportErrors)) { - return false; - } - } - var t = getReturnTypeOfSignature(target); - var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); - } - - function areSignaturesSubtypeOrAssignableTo(source: ObjectType, target: ObjectType, kind: SignatureKind, reportErrors: boolean): boolean { - if (target === anyFunctionType || source === anyFunctionType) return true; var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + var result = Ternary.True; var saveErrorInfo = errorInfo; outer: for (var i = 0; i < targetSignatures.length; i++) { var t = targetSignatures[i]; @@ -2983,7 +3666,9 @@ module ts { for (var j = 0; j < sourceSignatures.length; j++) { var s = sourceSignatures[j]; if (!s.hasStringLiterals || source.flags & TypeFlags.FromSignature) { - if (isSignatureSubtypeOrAssignableTo(s, t, localErrors)) { + var related = signatureRelatedTo(s, t, localErrors); + if (related) { + result &= related; errorInfo = saveErrorInfo; continue outer; } @@ -2991,21 +3676,19 @@ module ts { localErrors = false; } } - return false; + return Ternary.False; } } - return true; + return result; } - function isSignatureSubtypeOrAssignableTo(source: Signature, target: Signature, reportErrors: boolean): boolean { + function signatureRelatedTo(source: Signature, target: Signature, reportErrors: boolean): Ternary { if (source === target) { - return true; + return Ternary.True; } - if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return Ternary.False; } - var sourceMax = source.parameters.length; var targetMax = target.parameters.length; var checkCount: number; @@ -3029,93 +3712,192 @@ module ts { // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N source = getErasedSignature(source); target = getErasedSignature(target); + var result = Ternary.True; for (var i = 0; i < checkCount; i++) { var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - if (!isRelatedTo(s, t, reportErrors)) { - if (!isRelatedTo(t, s, false)) { + var related = isRelatedTo(s, t, reportErrors); + if (!related) { + related = isRelatedTo(t, s, false); + if (!related) { if (reportErrors) { - reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, + reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } - return false; + return Ternary.False; } errorInfo = saveErrorInfo; } + result &= related; } var t = getReturnTypeOfSignature(target); - if (t === voidType) return true; + if (t === voidType) return result; var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); } - function stringIndexTypesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { - if (relation === identityRelation) { - return areIndexTypesIdenticalTo(IndexKind.String, source, target, reportErrors); + function signaturesIdenticalTo(source: ObjectType, target: ObjectType, kind: SignatureKind): Ternary { + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + if (sourceSignatures.length !== targetSignatures.length) { + return Ternary.False; } - else { - var targetType = getIndexTypeOfType(target, IndexKind.String); - if (targetType) { - var sourceType = getIndexTypeOfType(source, IndexKind.String); - if (!sourceType) { - if (reportErrors) { - reportError(Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return false; - } - if (!isRelatedTo(sourceType, targetType, reportErrors)) { - if (reportErrors) { - reportError(Diagnostics.Index_signatures_are_incompatible_Colon); - } - return false; - } + var result = Ternary.True; + for (var i = 0, len = sourceSignatures.length; i < len; ++i) { + var related = compareSignatures(sourceSignatures[i], targetSignatures[i], /*compareReturnTypes*/ true, isRelatedTo); + if (!related) { + return Ternary.False; } - return true; + result &= related; } + return result; + } + + function stringIndexTypesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): Ternary { + if (relation === identityRelation) { + return indexTypesIdenticalTo(IndexKind.String, source, target); + } + var targetType = getIndexTypeOfType(target, IndexKind.String); + if (targetType) { + var sourceType = getIndexTypeOfType(source, IndexKind.String); + if (!sourceType) { + if (reportErrors) { + reportError(Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); + } + return Ternary.False; + } + var related = isRelatedTo(sourceType, targetType, reportErrors); + if (!related) { + if (reportErrors) { + reportError(Diagnostics.Index_signatures_are_incompatible); + } + return Ternary.False; + } + return related; + } + return Ternary.True; } - function numberIndexTypesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + function numberIndexTypesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): Ternary { if (relation === identityRelation) { - return areIndexTypesIdenticalTo(IndexKind.Number, source, target, reportErrors); + return indexTypesIdenticalTo(IndexKind.Number, source, target); } - else { - var targetType = getIndexTypeOfType(target, IndexKind.Number); - if (targetType) { - var sourceStringType = getIndexTypeOfType(source, IndexKind.String); - var sourceNumberType = getIndexTypeOfType(source, IndexKind.Number); - if (!(sourceStringType || sourceNumberType)) { - if (reportErrors) { - reportError(Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return false; - } - if (sourceStringType && sourceNumberType) { - // If we know for sure we're testing both string and numeric index types then only report errors from the second one - var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); - } - else { - var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); - } - if (!compatible) { - if (reportErrors) { - reportError(Diagnostics.Index_signatures_are_incompatible_Colon); - } - return false; + var targetType = getIndexTypeOfType(target, IndexKind.Number); + if (targetType) { + var sourceStringType = getIndexTypeOfType(source, IndexKind.String); + var sourceNumberType = getIndexTypeOfType(source, IndexKind.Number); + if (!(sourceStringType || sourceNumberType)) { + if (reportErrors) { + reportError(Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } + return Ternary.False; } - return true; + if (sourceStringType && sourceNumberType) { + // If we know for sure we're testing both string and numeric index types then only report errors from the second one + var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + } + else { + var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + } + if (!related) { + if (reportErrors) { + reportError(Diagnostics.Index_signatures_are_incompatible); + } + return Ternary.False; + } + return related; } + return Ternary.True; } - function areIndexTypesIdenticalTo(indexKind: IndexKind, source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + function indexTypesIdenticalTo(indexKind: IndexKind, source: ObjectType, target: ObjectType): Ternary { var targetType = getIndexTypeOfType(target, indexKind); var sourceType = getIndexTypeOfType(source, indexKind); - return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); + if (!sourceType && !targetType) { + return Ternary.True; + } + if (sourceType && targetType) { + return isRelatedTo(sourceType, targetType); + } + return Ternary.False; } } + function isPropertyIdenticalTo(sourceProp: Symbol, targetProp: Symbol): boolean { + return compareProperties(sourceProp, targetProp, compareTypes) !== Ternary.False; + } + + function compareProperties(sourceProp: Symbol, targetProp: Symbol, compareTypes: (source: Type, target: Type) => Ternary): Ternary { + // Two members are considered identical when + // - they are public properties with identical names, optionality, and types, + // - they are private or protected properties originating in the same declaration and having identical types + if (sourceProp === targetProp) { + return Ternary.True; + } + var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (NodeFlags.Private | NodeFlags.Protected); + var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (NodeFlags.Private | NodeFlags.Protected); + if (sourcePropAccessibility !== targetPropAccessibility) { + return Ternary.False; + } + if (sourcePropAccessibility) { + if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { + return Ternary.False; + } + } + else { + if (isOptionalProperty(sourceProp) !== isOptionalProperty(targetProp)) { + return Ternary.False; + } + } + return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + + function compareSignatures(source: Signature, target: Signature, compareReturnTypes: boolean, compareTypes: (s: Type, t: Type) => Ternary): Ternary { + if (source === target) { + return Ternary.True; + } + if (source.parameters.length !== target.parameters.length || + source.minArgumentCount !== target.minArgumentCount || + source.hasRestParameter !== target.hasRestParameter) { + return Ternary.False; + } + var result = Ternary.True; + if (source.typeParameters && target.typeParameters) { + if (source.typeParameters.length !== target.typeParameters.length) { + return Ternary.False; + } + for (var i = 0, len = source.typeParameters.length; i < len; ++i) { + var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); + if (!related) { + return Ternary.False; + } + result &= related; + } + } + else if (source.typeParameters || source.typeParameters) { + return Ternary.False; + } + // Spec 1.0 Section 3.8.3 & 3.8.4: + // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N + source = getErasedSignature(source); + target = getErasedSignature(target); + for (var i = 0, len = source.parameters.length; i < len; i++) { + var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); + var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); + var related = compareTypes(s, t); + if (!related) { + return Ternary.False; + } + result &= related; + } + if (compareReturnTypes) { + result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + return result; + } + function isSupertypeOfEach(candidate: Type, types: Type[]): boolean { for (var i = 0, len = types.length; i < len; i++) { if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) return false; @@ -3123,54 +3905,50 @@ module ts { return true; } - function getBestCommonType(types: Type[], contextualType?: Type, candidatesOnly?: boolean): Type { - if (contextualType && isSupertypeOfEach(contextualType, types)) return contextualType; - return forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined) || (candidatesOnly ? undefined : emptyObjectType); + function getCommonSupertype(types: Type[]): Type { + return forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined); + } + + function reportNoCommonSupertypeError(types: Type[], errorLocation: Node, errorMessageChainHead: DiagnosticMessageChain): void { + var bestSupertype: Type; + var bestSupertypeDownfallType: Type; // The type that caused bestSupertype not to be the common supertype + var bestSupertypeScore = 0; + + for (var i = 0; i < types.length; i++) { + var score = 0; + var downfallType: Type = undefined; + for (var j = 0; j < types.length; j++) { + if (isTypeSubtypeOf(types[j], types[i])) { + score++; + } + else if (!downfallType) { + downfallType = types[j]; + } + } + + if (score > bestSupertypeScore) { + bestSupertype = types[i]; + bestSupertypeDownfallType = downfallType; + bestSupertypeScore = score; + } + + // types.length - 1 is the maximum score, given that getCommonSupertype returned false + if (bestSupertypeScore === types.length - 1) { + break; + } + } + + // In the following errors, the {1} slot is before the {0} slot because checkTypeSubtypeOf supplies the + // subtype as the first argument to the error + checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, + Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, + errorMessageChainHead); } function isTypeOfObjectLiteral(type: Type): boolean { return (type.flags & TypeFlags.Anonymous) && type.symbol && (type.symbol.flags & SymbolFlags.ObjectLiteral) ? true : false; } - function getWidenedTypeOfObjectLiteral(type: Type): Type { - var properties = getPropertiesOfType(type); - if (properties.length) { - var widenedTypes: Type[] = []; - var propTypeWasWidened: boolean = false; - forEach(properties, p => { - var propType = getTypeOfSymbol(p); - var widenedType = getWidenedType(propType); - if (propType !== widenedType) { - propTypeWasWidened = true; - - if (program.getCompilerOptions().noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { - error(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType)); - } - } - widenedTypes.push(widenedType); - }); - if (propTypeWasWidened) { - var members: SymbolTable = {}; - var index = 0; - forEach(properties, p => { - var symbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, p.name); - symbol.declarations = p.declarations; - symbol.parent = p.parent; - symbol.type = widenedTypes[index++]; - symbol.target = p; - if (p.valueDeclaration) symbol.valueDeclaration = p.valueDeclaration; - members[symbol.name] = symbol; - }); - var stringIndexType = getIndexTypeOfType(type, IndexKind.String); - var numberIndexType = getIndexTypeOfType(type, IndexKind.Number); - if (stringIndexType) stringIndexType = getWidenedType(stringIndexType); - if (numberIndexType) numberIndexType = getWidenedType(numberIndexType); - type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); - } - } - return type; - } - function isArrayType(type: Type): boolean { return type.flags & TypeFlags.Reference && (type).target === globalArrayType; } @@ -3179,24 +3957,17 @@ module ts { while (isArrayType(type)) { type = (type).typeArguments[0]; } - - return type; - } - - function getWidenedTypeOfArrayLiteral(type: Type): Type { - var elementType = (type).typeArguments[0]; - var widenedType = getWidenedType(elementType); - - type = elementType !== widenedType ? createArrayType(widenedType) : type; - return type; } /* If we are widening on a literal, then we may need to the 'node' parameter for reporting purposes */ - function getWidenedType(type: Type): Type { + function getWidenedType(type: Type, suppressNoImplicitAnyErrors?: boolean): Type { if (type.flags & (TypeFlags.Undefined | TypeFlags.Null)) { return anyType; } + if (type.flags & TypeFlags.Union) { + return getWidenedTypeOfUnion(type); + } if (isTypeOfObjectLiteral(type)) { return getWidenedTypeOfObjectLiteral(type); } @@ -3204,6 +3975,55 @@ module ts { return getWidenedTypeOfArrayLiteral(type); } return type; + + function getWidenedTypeOfUnion(type: Type): Type { + return getUnionType(map((type).types, t => getWidenedType(t, suppressNoImplicitAnyErrors))); + } + + function getWidenedTypeOfObjectLiteral(type: Type): Type { + var properties = getPropertiesOfObjectType(type); + if (properties.length) { + var widenedTypes: Type[] = []; + var propTypeWasWidened: boolean = false; + forEach(properties, p => { + var propType = getTypeOfSymbol(p); + var widenedType = getWidenedType(propType); + if (propType !== widenedType) { + propTypeWasWidened = true; + if (!suppressNoImplicitAnyErrors && compilerOptions.noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + error(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType)); + } + } + widenedTypes.push(widenedType); + }); + if (propTypeWasWidened) { + var members: SymbolTable = {}; + var index = 0; + forEach(properties, p => { + var symbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient | p.flags, p.name); + symbol.declarations = p.declarations; + symbol.parent = p.parent; + symbol.type = widenedTypes[index++]; + symbol.target = p; + if (p.valueDeclaration) symbol.valueDeclaration = p.valueDeclaration; + members[symbol.name] = symbol; + }); + var stringIndexType = getIndexTypeOfType(type, IndexKind.String); + var numberIndexType = getIndexTypeOfType(type, IndexKind.Number); + if (stringIndexType) stringIndexType = getWidenedType(stringIndexType); + if (numberIndexType) numberIndexType = getWidenedType(numberIndexType); + type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); + } + } + return type; + } + + function getWidenedTypeOfArrayLiteral(type: Type): Type { + var elementType = (type).typeArguments[0]; + var widenedType = getWidenedType(elementType, suppressNoImplicitAnyErrors); + type = elementType !== widenedType ? createArrayType(widenedType) : type; + return type; + } } function forEachMatchingParameterType(source: Signature, target: Signature, callback: (s: Type, t: Type) => void) { @@ -3233,11 +4053,15 @@ module ts { } } - function createInferenceContext(typeParameters: TypeParameter[]): InferenceContext { - var inferences: Type[][] = []; - for (var i = 0; i < typeParameters.length; i++) inferences.push([]); + function createInferenceContext(typeParameters: TypeParameter[], inferUnionTypes: boolean): InferenceContext { + var inferences: TypeInferences[] = []; + for (var i = 0; i < typeParameters.length; i++) { + inferences.push({ primary: undefined, secondary: undefined }); + } return { typeParameters: typeParameters, + inferUnionTypes: inferUnionTypes, + inferenceCount: 0, inferences: inferences, inferredTypes: new Array(typeParameters.length), }; @@ -3247,6 +4071,7 @@ module ts { var sourceStack: Type[]; var targetStack: Type[]; var depth = 0; + var inferiority = 0; inferFromTypes(source, target); function isInProcess(source: Type, target: Type) { @@ -3276,7 +4101,10 @@ module ts { for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; - if (!contains(inferences, source)) inferences.push(source); + var candidates = inferiority ? + inferences.secondary || (inferences.secondary = []) : + inferences.primary || (inferences.primary = []); + if (!contains(candidates, source)) candidates.push(source); break; } } @@ -3289,9 +4117,38 @@ module ts { inferFromTypes(sourceTypes[i], targetTypes[i]); } } - else if (source.flags & TypeFlags.ObjectType && (target.flags & TypeFlags.Reference || (target.flags & TypeFlags.Anonymous) && - target.symbol && target.symbol.flags & (SymbolFlags.Method | SymbolFlags.TypeLiteral))) { - // If source is an object type, and target is a type reference, the type of a method, or a type literal, infer from members + else if (target.flags & TypeFlags.Union) { + var targetTypes = (target).types; + var typeParameterCount = 0; + var typeParameter: TypeParameter; + // First infer to each type in union that isn't a type parameter + for (var i = 0; i < targetTypes.length; i++) { + var t = targetTypes[i]; + if (t.flags & TypeFlags.TypeParameter && contains(context.typeParameters, t)) { + typeParameter = t; + typeParameterCount++; + } + else { + inferFromTypes(source, t); + } + } + // If union contains a single naked type parameter, make a secondary inference to that type parameter + if (typeParameterCount === 1) { + inferiority++; + inferFromTypes(source, typeParameter); + inferiority--; + } + } + else if (source.flags & TypeFlags.Union) { + // Source is a union type, infer from each consituent type + var sourceTypes = (source).types; + for (var i = 0; i < sourceTypes.length; i++) { + inferFromTypes(sourceTypes[i], target); + } + } + else if (source.flags & TypeFlags.ObjectType && (target.flags & (TypeFlags.Reference | TypeFlags.Tuple) || + (target.flags & TypeFlags.Anonymous) && target.symbol && target.symbol.flags & (SymbolFlags.Method | SymbolFlags.TypeLiteral))) { + // If source is an object type, and target is a type reference, a tuple type, the type of a method, or a type literal, infer from members if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -3312,10 +4169,10 @@ module ts { } function inferFromProperties(source: Type, target: Type) { - var properties = getPropertiesOfType(target); + var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; - var sourceProp = getPropertyOfType(source, targetProp.name); + var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); } @@ -3349,22 +4206,38 @@ module ts { } } + function getInferenceCandidates(context: InferenceContext, index: number): Type[]{ + var inferences = context.inferences[index]; + return inferences.primary || inferences.secondary || emptyArray; + } + function getInferredType(context: InferenceContext, index: number): Type { - var result = context.inferredTypes[index]; - if (!result) { - var commonType = getWidenedType(getBestCommonType(context.inferences[index])); - var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - var result = constraint && !isTypeAssignableTo(commonType, constraint) ? constraint : commonType; - context.inferredTypes[index] = result; + var inferredType = context.inferredTypes[index]; + if (!inferredType) { + var inferences = getInferenceCandidates(context, index); + if (inferences.length) { + // Infer widened union or supertype, or the undefined type for no common supertype + var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); + inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; + } + else { + // Infer the empty object type when no inferences were made + inferredType = emptyObjectType; + } + if (inferredType !== inferenceFailureType) { + var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + } + context.inferredTypes[index] = inferredType; } - return result; + return inferredType; } function getInferredTypes(context: InferenceContext): Type[] { for (var i = 0; i < context.inferredTypes.length; i++) { getInferredType(context, i); } - context.inferences = undefined; + return context.inferredTypes; } @@ -3372,104 +4245,295 @@ module ts { return getAncestor(node, kind) !== undefined; } - function getAncestor(node: Node, kind: SyntaxKind): Node { - switch (kind) { - // special-cases that can be come first - case SyntaxKind.ClassDeclaration: - while (node) { - switch (node.kind) { - case SyntaxKind.ClassDeclaration: - return node; - case SyntaxKind.EnumDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.ImportDeclaration: - // early exit cases - declarations cannot be nested in classes - return undefined; - default: - node = node.parent; - continue; - } - } - break; - default: - while (node) { - if (node.kind === kind) { - return node; - } - else { - node = node.parent; - } - } - break; - } - - return undefined; - } - // EXPRESSION TYPE CHECKING - function checkIdentifier(node: Identifier): Type { - function isInTypeQuery(node: Node): boolean { - // TypeScript 1.0 spec (April 2014): 3.6.3 - // A type query consists of the keyword typeof followed by an expression. - // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - while (node) { - switch (node.kind) { - case SyntaxKind.TypeQuery: - return true; - case SyntaxKind.Identifier: - case SyntaxKind.QualifiedName: - node = node.parent; - continue; - default: - return false; + function getResolvedSymbol(node: Identifier): Symbol { + var links = getNodeLinks(node); + if (!links.resolvedSymbol) { + links.resolvedSymbol = resolveName(node, node.text, SymbolFlags.Value | SymbolFlags.ExportValue, Diagnostics.Cannot_find_name_0, node) || unknownSymbol; + } + return links.resolvedSymbol; + } + + function isInTypeQuery(node: Node): boolean { + // TypeScript 1.0 spec (April 2014): 3.6.3 + // A type query consists of the keyword typeof followed by an expression. + // The expression is restricted to a single identifier or a sequence of identifiers separated by periods + while (node) { + switch (node.kind) { + case SyntaxKind.TypeQuery: + return true; + case SyntaxKind.Identifier: + case SyntaxKind.QualifiedName: + node = node.parent; + continue; + default: + return false; + } + } + Debug.fail("should not get here"); + } + + // Remove one or more primitive types from a union type + function subtractPrimitiveTypes(type: Type, subtractMask: TypeFlags): Type { + if (type.flags & TypeFlags.Union) { + var types = (type).types; + if (forEach(types, t => t.flags & subtractMask)) { + return getUnionType(filter(types, t => !(t.flags & subtractMask))); + } + } + return type; + } + + // Check if a given variable is assigned within a given syntax node + function isVariableAssignedWithin(symbol: Symbol, node: Node): boolean { + var links = getNodeLinks(node); + if (links.assignmentChecks) { + var cachedResult = links.assignmentChecks[symbol.id]; + if (cachedResult !== undefined) { + return cachedResult; + } + } + else { + links.assignmentChecks = {}; + } + return links.assignmentChecks[symbol.id] = isAssignedIn(node); + + function isAssignedInBinaryExpression(node: BinaryExpression) { + if (node.operator >= SyntaxKind.FirstAssignment && node.operator <= SyntaxKind.LastAssignment) { + var n = node.left; + while (n.kind === SyntaxKind.ParenExpression) { + n = (n).expression; + } + if (n.kind === SyntaxKind.Identifier && getResolvedSymbol(n) === symbol) { + return true; } } - Debug.fail("should not get here"); + return forEachChild(node, isAssignedIn); } - var symbol = resolveName(node, node.text, SymbolFlags.Value | SymbolFlags.ExportValue, Diagnostics.Cannot_find_name_0, identifierToString(node)); - if (!symbol) { - symbol = unknownSymbol; + function isAssignedInVariableDeclaration(node: VariableDeclaration) { + if (getSymbolOfNode(node) === symbol && node.initializer) { + return true; + } + return forEachChild(node, isAssignedIn); } + function isAssignedIn(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.BinaryExpression: + return isAssignedInBinaryExpression(node); + case SyntaxKind.VariableDeclaration: + return isAssignedInVariableDeclaration(node); + case SyntaxKind.ArrayLiteral: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.PropertyAccess: + case SyntaxKind.IndexedAccess: + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + case SyntaxKind.TypeAssertion: + case SyntaxKind.ParenExpression: + case SyntaxKind.PrefixOperator: + case SyntaxKind.PostfixOperator: + case SyntaxKind.ConditionalExpression: + case SyntaxKind.Block: + case SyntaxKind.VariableStatement: + case SyntaxKind.ExpressionStatement: + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ReturnStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.SwitchStatement: + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + case SyntaxKind.LabeledStatement: + case SyntaxKind.ThrowStatement: + case SyntaxKind.TryStatement: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + return forEachChild(node, isAssignedIn); + } + return false; + } + } + + // Get the narrowed type of a given symbol at a given location + function getNarrowedTypeOfSymbol(symbol: Symbol, node: Node) { + var type = getTypeOfSymbol(symbol); + // Only narrow when symbol is variable of a structured type + if (node && (symbol.flags & SymbolFlags.Variable && type.flags & TypeFlags.Structured)) { + loop: while (true) { + var child = node; + node = node.parent; + var narrowedType = type; + switch (node.kind) { + case SyntaxKind.IfStatement: + // In a branch of an if statement, narrow based on controlling expression + if (child !== (node).expression) { + narrowedType = narrowType(type, (node).expression, /*assumeTrue*/ child === (node).thenStatement); + } + break; + case SyntaxKind.ConditionalExpression: + // In a branch of a conditional expression, narrow based on controlling condition + if (child !== (node).condition) { + narrowedType = narrowType(type, (node).condition, /*assumeTrue*/ child === (node).whenTrue); + } + break; + case SyntaxKind.BinaryExpression: + // In the right operand of an && or ||, narrow based on left operand + if (child === (node).right) { + if ((node).operator === SyntaxKind.AmpersandAmpersandToken) { + narrowedType = narrowType(type, (node).left, /*assumeTrue*/ true); + } + else if ((node).operator === SyntaxKind.BarBarToken) { + narrowedType = narrowType(type, (node).left, /*assumeTrue*/ false); + } + } + break; + case SyntaxKind.SourceFile: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.Constructor: + // Stop at the first containing function or module declaration + break loop; + } + // Use narrowed type if it is a subtype and construct contains no assignments to variable + if (narrowedType !== type && isTypeSubtypeOf(narrowedType, type)) { + if (isVariableAssignedWithin(symbol, node)) { + break; + } + type = narrowedType; + } + } + } + return type; + + function narrowTypeByEquality(type: Type, expr: BinaryExpression, assumeTrue: boolean): Type { + var left = expr.left; + var right = expr.right; + // Check that we have 'typeof ' on the left and string literal on the right + if (left.kind !== SyntaxKind.PrefixOperator || left.operator !== SyntaxKind.TypeOfKeyword || + left.operand.kind !== SyntaxKind.Identifier || right.kind !== SyntaxKind.StringLiteral || + getResolvedSymbol(left.operand) !== symbol) { + return type; + } + var t = right.text; + var checkType: Type = t === "string" ? stringType : t === "number" ? numberType : t === "boolean" ? booleanType : emptyObjectType; + if (expr.operator === SyntaxKind.ExclamationEqualsEqualsToken) { + assumeTrue = !assumeTrue; + } + if (assumeTrue) { + // The assumed result is true. If check was for a primitive type, that type is the narrowed type. Otherwise we can + // remove the primitive types from the narrowed type. + return checkType === emptyObjectType ? subtractPrimitiveTypes(type, TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean) : checkType; + } + else { + // The assumed result is false. If check was for a primitive type we can remove that type from the narrowed type. + // Otherwise we don't have enough information to do anything. + return checkType === emptyObjectType ? type : subtractPrimitiveTypes(type, checkType.flags); + } + } + + function narrowTypeByAnd(type: Type, expr: BinaryExpression, assumeTrue: boolean): Type { + if (assumeTrue) { + // The assumed result is true, therefore we narrow assuming each operand to be true. + return narrowType(narrowType(type, expr.left, /*assumeTrue*/ true), expr.right, /*assumeTrue*/ true); + } + else { + // The assumed result is false. This means either the first operand was false, or the first operand was true + // and the second operand was false. We narrow with those assumptions and union the two resulting types. + return getUnionType([ + narrowType(type, expr.left, /*assumeTrue*/ false), + narrowType(narrowType(type, expr.left, /*assumeTrue*/ true), expr.right, /*assumeTrue*/ false) + ]); + } + } + + function narrowTypeByOr(type: Type, expr: BinaryExpression, assumeTrue: boolean): Type { + if (assumeTrue) { + // The assumed result is true. This means either the first operand was true, or the first operand was false + // and the second operand was true. We narrow with those assumptions and union the two resulting types. + return getUnionType([ + narrowType(type, expr.left, /*assumeTrue*/ true), + narrowType(narrowType(type, expr.left, /*assumeTrue*/ false), expr.right, /*assumeTrue*/ true) + ]); + } + else { + // The assumed result is false, therefore we narrow assuming each operand to be false. + return narrowType(narrowType(type, expr.left, /*assumeTrue*/ false), expr.right, /*assumeTrue*/ false); + } + } + + function narrowTypeByInstanceof(type: Type, expr: BinaryExpression, assumeTrue: boolean): Type { + // Check that assumed result is true and we have variable symbol on the left + if (!assumeTrue || expr.left.kind !== SyntaxKind.Identifier || getResolvedSymbol(expr.left) !== symbol) { + return type; + } + // Check that right operand is a function type with a prototype property + var rightType = checkExpression(expr.right); + if (!isTypeSubtypeOf(rightType, globalFunctionType)) { + return type; + } + var prototypeProperty = getPropertyOfType(rightType, "prototype"); + if (!prototypeProperty) { + return type; + } + var prototypeType = getTypeOfSymbol(prototypeProperty); + // Narrow to type of prototype property if it is a subtype of current type + return isTypeSubtypeOf(prototypeType, type) ? prototypeType : type; + } + + // Narrow the given type based on the given expression having the assumed boolean value + function narrowType(type: Type, expr: Expression, assumeTrue: boolean): Type { + switch (expr.kind) { + case SyntaxKind.ParenExpression: + return narrowType(type, (expr).expression, assumeTrue); + case SyntaxKind.BinaryExpression: + var operator = (expr).operator; + if (operator === SyntaxKind.EqualsEqualsEqualsToken || operator === SyntaxKind.ExclamationEqualsEqualsToken) { + return narrowTypeByEquality(type, expr, assumeTrue); + } + else if (operator === SyntaxKind.AmpersandAmpersandToken) { + return narrowTypeByAnd(type, expr, assumeTrue); + } + else if (operator === SyntaxKind.BarBarToken) { + return narrowTypeByOr(type, expr, assumeTrue); + } + else if (operator === SyntaxKind.InstanceOfKeyword) { + return narrowTypeByInstanceof(type, expr, assumeTrue); + } + break; + case SyntaxKind.PrefixOperator: + if ((expr).operator === SyntaxKind.ExclamationToken) { + return narrowType(type, (expr).operand, !assumeTrue); + } + break; + } + return type; + } + } + + function checkIdentifier(node: Identifier): Type { + var symbol = getResolvedSymbol(node); + if (symbol.flags & SymbolFlags.Import) { // Mark the import as referenced so that we emit it in the final .js file. - // exception: identifiers that appear in type queries - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + // exception: identifiers that appear in type queries, const enums, modules that contain only const enums + getSymbolLinks(symbol).referenced = getSymbolLinks(symbol).referenced || (!isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol))); } - getNodeLinks(node).resolvedSymbol = symbol; - checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); checkCollisionWithIndexVariableInGeneratedCode(node, node); - return getTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol)); - } - - function getThisContainer(node: Node): Node { - while (true) { - node = node.parent; - if (!node) { - return node; - } - switch (node.kind) { - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.FunctionExpression: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.Property: - case SyntaxKind.Method: - case SyntaxKind.Constructor: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.SourceFile: - case SyntaxKind.ArrowFunction: - return node; - } - } + return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node: Node, container: Node): void { @@ -3484,11 +4548,14 @@ module ts { } function checkThisExpression(node: Node): Type { - var container = getThisContainer(node); + // Stop at the first arrow function so that we can + // tell whether 'this' needs to be captured. + var container = getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; - // skip arrow functions - while (container.kind === SyntaxKind.ArrowFunction) { - container = getThisContainer(container); + + // Now skip arrow functions to get the "real" owner of 'this'. + if (container.kind === SyntaxKind.ArrowFunction) { + container = getThisContainer(container, /* includeArrowFunctions */ false); needToCaptureLexicalThis = true; } @@ -3650,18 +4717,34 @@ module ts { // Return contextual type of parameter or undefined if no contextual type is available function getContextuallyTypedParameterType(parameter: ParameterDeclaration): Type { - var func = parameter.parent; + var func = parameter.parent; if (func.kind === SyntaxKind.FunctionExpression || func.kind === SyntaxKind.ArrowFunction) { if (isContextSensitiveExpression(func)) { - var signature = getContextualSignature(func); - if (signature) { - return getTypeAtPosition(signature, indexOf(func.parameters, parameter)); + var contextualSignature = getContextualSignature(func); + if (contextualSignature) { + + var funcHasRestParameters = hasRestParameters(func); + var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); + var indexOfParameter = indexOf(func.parameters, parameter); + if (indexOfParameter < len) { + return getTypeAtPosition(contextualSignature, indexOfParameter); + } + + // If last parameter is contextually rest parameter get its type + if (indexOfParameter === (func.parameters.length - 1) && + funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { + return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); + } } } } return undefined; } + // In a variable, parameter or property declaration with a type annotation, the contextual type of an initializer + // expression is the type of the variable, parameter or property. In a parameter declaration of a contextually + // typed function expression, the contextual type of an initializer expression is the contextual type of the + // parameter. function getContextualTypeForInitializerExpression(node: Expression): Type { var declaration = node.parent; if (node === declaration.initializer) { @@ -3693,6 +4776,7 @@ module ts { return undefined; } + // In a typed function call, an argument expression is contextually typed by the type of the corresponding parameter. function getContextualTypeForArgument(node: Expression): Type { var callExpression = node.parent; var argIndex = indexOf(callExpression.arguments, node); @@ -3707,11 +4791,14 @@ module ts { var binaryExpression = node.parent; var operator = binaryExpression.operator; if (operator >= SyntaxKind.FirstAssignment && operator <= SyntaxKind.LastAssignment) { + // In an assignment expression, the right operand is contextually typed by the type of the left operand. if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } } else if (operator === SyntaxKind.BarBarToken) { + // When an || expression has a contextual type, the operands are contextually typed by that type. When an || + // expression has no contextual type, the right operand is contextually typed by the type of the left operand. var type = getContextualType(binaryExpression); if (!type && node === binaryExpression.right) { type = checkExpression(binaryExpression.left); @@ -3721,33 +4808,97 @@ module ts { return undefined; } + // Apply a mapping function to a contextual type and return the resulting type. If the contextual type + // is a union type, the mapping function is applied to each constituent type and a union of the resulting + // types is returned. + function applyToContextualType(type: Type, mapper: (t: Type) => Type): Type { + if (!(type.flags & TypeFlags.Union)) { + return mapper(type); + } + var types = (type).types; + var mappedType: Type; + var mappedTypes: Type[]; + for (var i = 0; i < types.length; i++) { + var t = mapper(types[i]); + if (t) { + if (!mappedType) { + mappedType = t; + } + else if (!mappedTypes) { + mappedTypes = [mappedType, t]; + } + else { + mappedTypes.push(t); + } + } + } + return mappedTypes ? getUnionType(mappedTypes) : mappedType; + } + + function getTypeOfPropertyOfContextualType(type: Type, name: string) { + return applyToContextualType(type, t => { + var prop = getPropertyOfObjectType(t, name); + return prop ? getTypeOfSymbol(prop) : undefined; + }); + } + + function getIndexTypeOfContextualType(type: Type, kind: IndexKind) { + return applyToContextualType(type, t => getIndexTypeOfObjectOrUnionType(t, kind)); + } + + // Return true if the given contextual type is a tuple-like type + function contextualTypeIsTupleType(type: Type): boolean { + return !!(type.flags & TypeFlags.Union ? forEach((type).types, t => getPropertyOfObjectType(t, "0")) : getPropertyOfObjectType(type, "0")); + } + + // Return true if the given contextual type provides an index signature of the given kind + function contextualTypeHasIndexSignature(type: Type, kind: IndexKind): boolean { + return !!(type.flags & TypeFlags.Union ? forEach((type).types, t => getIndexTypeOfObjectOrUnionType(t, kind)) : getIndexTypeOfObjectOrUnionType(type, kind)); + } + + // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of + // the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one + // exists. Otherwise, it is the type of the string index signature in T, if one exists. function getContextualTypeForPropertyExpression(node: Expression): Type { var declaration = node.parent; var objectLiteral = declaration.parent; var type = getContextualType(objectLiteral); - var name = declaration.name.text; + // TODO(jfreeman): Handle this case for computed names and symbols + var name = (declaration.name).text; if (type && name) { - var prop = getPropertyOfType(type, name); - if (prop) { - return getTypeOfSymbol(prop); - } - return isNumericName(name) && getIndexTypeOfType(type, IndexKind.Number) || getIndexTypeOfType(type, IndexKind.String); + return getTypeOfPropertyOfContextualType(type, name) || + isNumericName(name) && getIndexTypeOfContextualType(type, IndexKind.Number) || + getIndexTypeOfContextualType(type, IndexKind.String); } return undefined; } + // In an array literal contextually typed by a type T, the contextual type of an element expression at index N is + // the type of the property with the numeric name N in T, if one exists. Otherwise, it is the type of the numeric + // index signature in T, if one exists. function getContextualTypeForElementExpression(node: Expression): Type { var arrayLiteral = node.parent; var type = getContextualType(arrayLiteral); - return type ? getIndexTypeOfType(type, IndexKind.Number) : undefined; + if (type) { + var index = indexOf(arrayLiteral.elements, node); + return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, IndexKind.Number); + } + return undefined; } + // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. function getContextualTypeForConditionalOperand(node: Expression): Type { var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } + // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily + // be "pushed" onto a node using the contextualType property. function getContextualType(node: Expression): Type { + if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further + return undefined; + } if (node.contextualType) { return node.contextualType; } @@ -3777,18 +4928,67 @@ module ts { return undefined; } + // 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 { + var signatures = getSignaturesOfObjectOrUnionType(type, SignatureKind.Call); + if (signatures.length === 1) { + var signature = signatures[0]; + if (!signature.typeParameters) { + return signature; + } + } + } + + // Return the contextual signature for a given expression node. A contextual type provides a + // contextual signature if it has a single call signature and if that call signature is non-generic. + // If the contextual type is a union type, get the signature from each type possible and if they are + // all identical ignoring their return type, the result is same signature but with return type as + // union type of return types from these signatures function getContextualSignature(node: Expression): Signature { var type = getContextualType(node); - if (type) { - var signatures = getSignaturesOfType(type, SignatureKind.Call); - if (signatures.length === 1) { - var signature = signatures[0]; - if (!signature.typeParameters) { - return signature; + if (!type) { + return undefined; + } + if (!(type.flags & TypeFlags.Union)) { + return getNonGenericSignature(type); + } + var signatureList: Signature[]; + var types = (type).types; + for (var i = 0; i < types.length; i++) { + // The signature set of all constituent type with call signatures should match + // So number of signatures allowed is either 0 or 1 + if (signatureList && + getSignaturesOfObjectOrUnionType(types[i], SignatureKind.Call).length > 1) { + return undefined; + } + + var signature = getNonGenericSignature(types[i]); + if (signature) { + if (!signatureList) { + // This signature will contribute to contextual union signature + signatureList = [signature]; + } + else if (!compareSignatures(signatureList[0], signature, /*compareReturnTypes*/ false, compareTypes)) { + // Signatures arent identical, do not use + return undefined; + } + else { + // Use this signature for contextual union signature + signatureList.push(signature); } } } - return undefined; + + // Result is union of signatures collected (return type is union of return types of this signature set) + var result: Signature; + if (signatureList) { + result = cloneSignature(signatureList[0]); + // Clear resolved return type we possibly got from cloneSignature + result.resolvedReturnType = undefined; + result.unionSignatures = signatureList; + } + return result; } // Presence of a contextual type mapper indicates inferential typing, except the identityMapper object is @@ -3798,35 +4998,61 @@ module ts { } function checkArrayLiteral(node: ArrayLiteral, contextualMapper?: TypeMapper): Type { - var elementTypes: Type[] = []; - forEach(node.elements, element => { - if (element.kind !== SyntaxKind.OmittedExpression) { - var type = checkExpression(element, contextualMapper); - if (!contains(elementTypes, type)) elementTypes.push(type); - } - }); - var contextualType = isInferentialContext(contextualMapper) ? undefined : getContextualType(node); - var contextualElementType = contextualType && getIndexTypeOfType(contextualType, IndexKind.Number); - var elementType = getBestCommonType(elementTypes, contextualElementType, true); - if (!elementType) elementType = elementTypes.length ? emptyObjectType : undefinedType; - return createArrayType(elementType); + var elements = node.elements; + if (!elements.length) { + return createArrayType(undefinedType); + } + var elementTypes = map(elements, e => checkExpression(e, contextualMapper)); + var contextualType = getContextualType(node); + if (contextualType && contextualTypeIsTupleType(contextualType)) { + return createTupleType(elementTypes); + } + return createArrayType(getUnionType(elementTypes)); } - + function isNumericName(name: string) { - return !isNaN(name); + // The intent of numeric names is that + // - they are names with text in a numeric form, and that + // - setting properties/indexing with them is always equivalent to doing so with the numeric literal 'numLit', + // acquired by applying the abstract 'ToNumber' operation on the name's text. + // + // The subtlety is in the latter portion, as we cannot reliably say that anything that looks like a numeric literal is a numeric name. + // In fact, it is the case that the text of the name must be equal to 'ToString(numLit)' for this to hold. + // + // Consider the property name '"0xF00D"'. When one indexes with '0xF00D', they are actually indexing with the value of 'ToString(0xF00D)' + // according to the ECMAScript specification, so it is actually as if the user indexed with the string '"61453"'. + // Thus, the text of all numeric literals equivalent to '61543' such as '0xF00D', '0xf00D', '0170015', etc. are not valid numeric names + // because their 'ToString' representation is not equal to their original text. + // This is motivated by ECMA-262 sections 9.3.1, 9.8.1, 11.1.5, and 11.2.1. + // + // Here, we test whether 'ToString(ToNumber(name))' is exactly equal to 'name'. + // The '+' prefix operator is equivalent here to applying the abstract ToNumber operation. + // Applying the 'toString()' method on a number gives us the abstract ToString operation on a number. + // + // Note that this accepts the values 'Infinity', '-Infinity', and 'NaN', and that this is intentional. + // This is desired behavior, because when indexing with them as numeric entities, you are indexing + // with the strings '"Infinity"', '"-Infinity"', and '"NaN"' respectively. + return (+name).toString() === name; } - + function checkObjectLiteral(node: ObjectLiteral, contextualMapper?: TypeMapper): Type { var members = node.symbol.members; var properties: SymbolTable = {}; var contextualType = getContextualType(node); - for (var id in members) { if (hasProperty(members, id)) { var member = members[id]; if (member.flags & SymbolFlags.Property) { - var type = checkExpression((member.declarations[0]).initializer, contextualMapper); - var prop = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, member.name); + var memberDecl = member.declarations[0]; + var type: Type; + if (memberDecl.kind === SyntaxKind.PropertyAssignment) { + type = checkExpression(memberDecl.initializer, contextualMapper); + } + else { + Debug.assert(memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment); + type = checkExpression(memberDecl.name, contextualMapper); + } + var prop = createSymbol(SymbolFlags.Property | SymbolFlags.Transient | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) prop.valueDeclaration = member.valueDeclaration; @@ -3858,30 +5084,70 @@ module ts { return createAnonymousType(node.symbol, properties, emptyArray, emptyArray, stringIndexType, numberIndexType); function getIndexType(kind: IndexKind) { - if (contextualType) { - var indexType = getIndexTypeOfType(contextualType, kind); - if (indexType) { - var propTypes: Type[] = []; - for (var id in properties) { - if (hasProperty(properties, id)) { - if (kind === IndexKind.String || isNumericName(id)) { - var type = getTypeOfSymbol(properties[id]); - if (!contains(propTypes, type)) propTypes.push(type); + if (contextualType && contextualTypeHasIndexSignature(contextualType, kind)) { + var propTypes: Type[] = []; + for (var id in properties) { + if (hasProperty(properties, id)) { + if (kind === IndexKind.String || isNumericName(id)) { + var type = getTypeOfSymbol(properties[id]); + if (!contains(propTypes, type)) { + propTypes.push(type); } } } - return getBestCommonType(propTypes, isInferentialContext(contextualMapper) ? undefined : indexType); } + return propTypes.length ? getUnionType(propTypes) : undefinedType; } + return undefined; } } + // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized + // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s: Symbol) { - return s.flags & SymbolFlags.Prototype ? SyntaxKind.Property : s.valueDeclaration.kind; + return s.valueDeclaration ? s.valueDeclaration.kind : SyntaxKind.Property; } function getDeclarationFlagsFromSymbol(s: Symbol) { - return s.flags & SymbolFlags.Prototype ? NodeFlags.Public | NodeFlags.Static : s.valueDeclaration.flags; + return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & SymbolFlags.Prototype ? NodeFlags.Public | NodeFlags.Static : 0; + } + + function checkClassPropertyAccess(node: PropertyAccess, type: Type, prop: Symbol) { + var flags = getDeclarationFlagsFromSymbol(prop); + // Public properties are always accessible + if (!(flags & (NodeFlags.Private | NodeFlags.Protected))) { + return; + } + // Property is known to be private or protected at this point + // Get the declaring and enclosing class instance types + var enclosingClassDeclaration = getAncestor(node, SyntaxKind.ClassDeclaration); + var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; + var declaringClass = getDeclaredTypeOfSymbol(prop.parent); + // Private property is accessible if declaring and enclosing class are the same + if (flags & NodeFlags.Private) { + if (declaringClass !== enclosingClass) { + error(node, Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); + } + return; + } + // Property is known to be protected at this point + // All protected properties of a supertype are accessible in a super access + if (node.left.kind === SyntaxKind.SuperKeyword) { + return; + } + // A protected property is accessible in the declaring class and classes derived from it + if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { + error(node, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); + return; + } + // No further restrictions for static properties + if (flags & NodeFlags.Static) { + return; + } + // An instance property must be accessed through an instance of the enclosing class + if (!(getTargetType(type).flags & (TypeFlags.Class | TypeFlags.Interface) && hasBaseType(type, enclosingClass))) { + error(node, Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); + } } function checkPropertyAccess(node: PropertyAccess) { @@ -3889,20 +5155,19 @@ module ts { if (type === unknownType) return type; if (type !== anyType) { var apparentType = getApparentType(getWidenedType(type)); - if (apparentType === unknownType) { + if (apparentType === unknownType) { // handle cases when type is Type parameter with invalid constraint return unknownType; } - var prop = getPropertyOfApparentType(apparentType, node.right.text); + var prop = getPropertyOfType(apparentType, node.right.text); if (!prop) { if (node.right.text) { - error(node.right, Diagnostics.Property_0_does_not_exist_on_type_1, identifierToString(node.right), typeToString(type)); + error(node.right, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(node.right), typeToString(type)); } return unknownType; } getNodeLinks(node).resolvedSymbol = prop; if (prop.parent && prop.parent.flags & SymbolFlags.Class) { - // TS 1.0 spec (April 2014): 4.8.2 // - In a constructor, instance member function, instance member accessor, or // instance member variable initializer where this references a derived class instance, @@ -3911,13 +5176,10 @@ module ts { // where this references the constructor function object of a derived class, // a super property access is permitted and must specify a public static member function of the base class. if (node.left.kind === SyntaxKind.SuperKeyword && getDeclarationKindFromSymbol(prop) !== SyntaxKind.Method) { - error(node.right, Diagnostics.Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword); + error(node.right, Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } - else if (getDeclarationFlagsFromSymbol(prop) & NodeFlags.Private) { - var classDeclaration = getAncestor(node, SyntaxKind.ClassDeclaration); - if (!classDeclaration || !contains(prop.parent.declarations, classDeclaration)) { - error(node, Diagnostics.Property_0_is_inaccessible, getFullyQualifiedName(prop)); - } + else { + checkClassPropertyAccess(node, type, prop); } } return getTypeOfSymbol(prop); @@ -3925,11 +5187,35 @@ module ts { return anyType; } + function isValidPropertyAccess(node: PropertyAccess, propertyName: string): boolean { + var type = checkExpression(node.left); + if (type !== unknownType && type !== anyType) { + var prop = getPropertyOfType(getWidenedType(type), propertyName); + if (prop && prop.parent && prop.parent.flags & SymbolFlags.Class) { + if (node.left.kind === SyntaxKind.SuperKeyword && getDeclarationKindFromSymbol(prop) !== SyntaxKind.Method) { + return false; + } + else { + var diagnosticsCount = diagnostics.length; + checkClassPropertyAccess(node, type, prop); + return diagnostics.length === diagnosticsCount + } + } + } + return true; + } + function checkIndexedAccess(node: IndexedAccess): Type { - var objectType = checkExpression(node.object); + // Obtain base constraint such that we can bail out if the constraint is an unknown type + var objectType = getApparentType(checkExpression(node.object)); var indexType = checkExpression(node.index); + if (objectType === unknownType) return unknownType; + if (isConstEnumObjectType(objectType) && node.index.kind !== SyntaxKind.StringLiteral) { + error(node.index, Diagnostics.Index_expression_arguments_in_const_enums_must_be_of_type_string); + } + // TypeScript 1.0 spec (April 2014): 4.10 Property Access // - If IndexExpr is a string literal or a numeric literal and ObjExpr's apparent type has a property with the name // given by that literal(converted to its string representation in the case of a numeric literal), the property access is of the type of that property. @@ -3940,15 +5226,11 @@ module ts { // - Otherwise, if IndexExpr is of type Any, the String or Number primitive type, or an enum type, the property access is of type Any. // See if we can index as a property. - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) { - // handle cases when objectType is type parameter with invalid type - return unknownType; - } if (node.index.kind === SyntaxKind.StringLiteral || node.index.kind === SyntaxKind.NumericLiteral) { var name = (node.index).text; - var prop = getPropertyOfApparentType(apparentType, name); + var prop = getPropertyOfType(objectType, name); if (prop) { + getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } } @@ -3958,20 +5240,20 @@ module ts { // Try to use a number indexer. if (indexType.flags & (TypeFlags.Any | TypeFlags.NumberLike)) { - var numberIndexType = getIndexTypeOfType(apparentType, IndexKind.Number); + var numberIndexType = getIndexTypeOfType(objectType, IndexKind.Number); if (numberIndexType) { return numberIndexType; } } // Try to use string indexing. - var stringIndexType = getIndexTypeOfType(apparentType, IndexKind.String); + var stringIndexType = getIndexTypeOfType(objectType, IndexKind.String); if (stringIndexType) { return stringIndexType; } // Fall back to any. - if (program.getCompilerOptions().noImplicitAny && objectType !== anyType) { + if (compilerOptions.noImplicitAny && objectType !== anyType) { error(node, Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); } @@ -3984,44 +5266,471 @@ module ts { return unknownType; } - function resolveUntypedCall(node: CallExpression): Signature { - forEach(node.arguments, argument => { - checkExpression(argument); - }); + function resolveUntypedCall(node: CallLikeExpression): Signature { + if (node.kind === SyntaxKind.TaggedTemplateExpression) { + checkExpression((node).template); + } + else { + forEach((node).arguments, argument => { + checkExpression(argument); + }); + } return anySignature; } - function resolveErrorCall(node: CallExpression): Signature { + function resolveErrorCall(node: CallLikeExpression): Signature { resolveUntypedCall(node); return unknownSignature; } - function isCandidateSignature(node: CallExpression, signature: Signature) { - var args = node.arguments || emptyArray; - return args.length >= signature.minArgumentCount && - (signature.hasRestParameter || args.length <= signature.parameters.length) && - (!node.typeArguments || signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); + function hasCorrectArity(node: CallLikeExpression, args: Expression[], signature: Signature) { + var adjustedArgCount: number; + var typeArguments: NodeArray; + var callIsIncomplete: boolean; + + if (node.kind === SyntaxKind.TaggedTemplateExpression) { + var tagExpression = node; + + // Even if the call is incomplete, we'll have a missing expression as our last argument, + // so we can say the count is just the arg list length + adjustedArgCount = args.length; + typeArguments = undefined; + + if (tagExpression.template.kind === SyntaxKind.TemplateExpression) { + // If a tagged template expression lacks a tail literal, the call is incomplete. + // Specifically, a template only can end in a TemplateTail or a Missing literal. + var templateExpression = tagExpression.template; + var lastSpan = lastOrUndefined(templateExpression.templateSpans); + Debug.assert(lastSpan !== undefined); // we should always have at least one span. + callIsIncomplete = lastSpan.literal.kind === SyntaxKind.Missing || isUnterminatedTemplateEnd(lastSpan.literal); + } + else { + // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, + // then this might actually turn out to be a TemplateHead in the future; + // so we consider the call to be incomplete. + var templateLiteral = tagExpression.template; + Debug.assert(templateLiteral.kind === SyntaxKind.NoSubstitutionTemplateLiteral); + callIsIncomplete = isUnterminatedTemplateEnd(templateLiteral); + } + } + else { + var callExpression = node; + if (!callExpression.arguments) { + // This only happens when we have something of the form: 'new C' + Debug.assert(callExpression.kind === SyntaxKind.NewExpression); + + return signature.minArgumentCount === 0; + } + + // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. + adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; + + // If we are missing the close paren, the call is incomplete. + callIsIncomplete = (callExpression).arguments.end === callExpression.end; + + typeArguments = callExpression.typeArguments; + } + + Debug.assert(adjustedArgCount !== undefined, "'adjustedArgCount' undefined"); + Debug.assert(callIsIncomplete !== undefined, "'callIsIncomplete' undefined"); + + return checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature); + + /** + * @param adjustedArgCount The "apparent" number of arguments that we will have in this call. + * @param typeArguments Type arguments node of the call if it exists; undefined otherwise. + * @param callIsIncomplete Whether or not a call is unfinished, and we should be "lenient" when we have too few arguments. + * @param signature The signature whose arity we are comparing. + */ + function checkArity(adjustedArgCount: number, + typeArguments: NodeArray, + callIsIncomplete: boolean, + signature: Signature): boolean { + // Too many arguments implies incorrect arity. + if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) { + return false; + } + + // If the user supplied type arguments, but the number of type arguments does not match + // the declared number of type parameters, the call has an incorrect arity. + var hasRightNumberOfTypeArgs = !typeArguments || + (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + if (!hasRightNumberOfTypeArgs) { + return false; + } + + // If the call is incomplete, we should skip the lower bound check. + var hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount; + return callIsIncomplete || hasEnoughArguments; + } } - // The candidate list orders groups in reverse, but within a group signatures are kept in declaration order - // A nit here is that we reorder only signatures that belong to the same symbol, - // so order how inherited signatures are processed is still preserved. - // interface A { (x: string): void } - // interface B extends A { (x: 'foo'): string } - // var b: B; - // b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void] - function collectCandidates(node: CallExpression, signatures: Signature[]): Signature[]{ - var result: Signature[] = []; - var lastParent: Node; - var lastSymbol: Symbol; - var cutoffPos: number = 0; - var pos: number; - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; - if (isCandidateSignature(node, signature)) { + // If type has a single call signature and no other members, return that signature. Otherwise, return undefined. + function getSingleCallSignature(type: Type): Signature { + if (type.flags & TypeFlags.ObjectType) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && + resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { + return resolved.callSignatures[0]; + } + } + return undefined; + } + + // 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 { + var context = createInferenceContext(signature.typeParameters, /*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); + }); + return getSignatureInstantiation(signature, getInferredTypes(context)); + } + + function inferTypeArguments(signature: Signature, args: Expression[], excludeArgument?: boolean[]): InferenceContext { + var typeParameters = signature.typeParameters; + var context = createInferenceContext(typeParameters, /*inferUnionTypes*/ false); + var mapper = createInferenceMapper(context); + // First infer from arguments that are not context sensitive + for (var i = 0; i < args.length; i++) { + if (args[i].kind === SyntaxKind.OmittedExpression) { + continue; + } + if (!excludeArgument || excludeArgument[i] === undefined) { + var parameterType = getTypeAtPosition(signature, i); + + if (i === 0 && args[i].parent.kind === SyntaxKind.TaggedTemplateExpression) { + inferTypes(context, globalTemplateStringsArrayType, parameterType); + continue; + } + + inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); + } + } + + // Next, infer from those context sensitive arguments that are no longer excluded + if (excludeArgument) { + for (var i = 0; i < args.length; i++) { + if (args[i].kind === SyntaxKind.OmittedExpression) { + continue; + } + // No need to special-case tagged templates; their excludeArgument value will be 'undefined'. + if (excludeArgument[i] === false) { + var parameterType = getTypeAtPosition(signature, i); + inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); + } + } + } + var inferredTypes = getInferredTypes(context); + // Inference has failed if the inferenceFailureType type is in list of inferences + context.failedTypeParameterIndex = indexOf(inferredTypes, inferenceFailureType); + + // Wipe out the inferenceFailureType from the array so that error recovery can work properly + for (var i = 0; i < inferredTypes.length; i++) { + if (inferredTypes[i] === inferenceFailureType) { + inferredTypes[i] = unknownType; + } + } + + return context; + } + + function checkTypeArguments(signature: Signature, typeArguments: TypeNode[], typeArgumentResultTypes: Type[], reportErrors: boolean): boolean { + var typeParameters = signature.typeParameters; + var typeArgumentsAreAssignable = true; + for (var i = 0; i < typeParameters.length; i++) { + var typeArgNode = typeArguments[i]; + var typeArgument = getTypeFromTypeNode(typeArgNode); + // Do not push on this array! It has a preallocated length + typeArgumentResultTypes[i] = typeArgument; + if (typeArgumentsAreAssignable /* so far */) { + var constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, + Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + } + } + return typeArgumentsAreAssignable; + } + + function checkApplicableSignature(node: CallLikeExpression, args: Node[], signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: boolean) { + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + var argType: Type; + + if (arg.kind === SyntaxKind.OmittedExpression) { + continue; + } + + var paramType = getTypeAtPosition(signature, i); + + if (i === 0 && node.kind === SyntaxKind.TaggedTemplateExpression) { + // A tagged template expression has something of a + // "virtual" parameter with the "cooked" strings array type. + argType = globalTemplateStringsArrayType; + } + else { + // String literals get string literal types unless we're reporting errors + argType = arg.kind === SyntaxKind.StringLiteral && !reportErrors + ? getStringLiteralType(arg) + : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + } + + // Use argument expression as error location when reporting errors + var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); + if (!isValidArgument) { + return false; + } + } + + return true; + } + + /** + * Returns the effective arguments for an expression that works like a function invokation. + * + * If 'node' is a CallExpression or a NewExpression, then its argument list is returned. + * If 'node' is a TaggedTemplateExpression, a new argument list is constructed from the substitution + * expressions, where the first element of the list is the template for error reporting purposes. + */ + function getEffectiveCallArguments(node: CallLikeExpression): Expression[] { + var args: Expression[]; + if (node.kind === SyntaxKind.TaggedTemplateExpression) { + var template = (node).template; + args = [template]; + + if (template.kind === SyntaxKind.TemplateExpression) { + forEach((template).templateSpans, span => { + args.push(span.expression); + }); + } + } + else { + args = (node).arguments || emptyArray; + } + + return args; + } + + function resolveCall(node: CallLikeExpression, signatures: Signature[], candidatesOutArray: Signature[]): Signature { + var isTaggedTemplate = node.kind === SyntaxKind.TaggedTemplateExpression; + + var typeArguments = isTaggedTemplate ? undefined : (node).typeArguments; + forEach(typeArguments, checkSourceElement); + + var candidates = candidatesOutArray || []; + // collectCandidates fills up the candidates array directly + collectCandidates(); + if (!candidates.length) { + error(node, Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + return resolveErrorCall(node); + } + + var args = getEffectiveCallArguments(node); + + // The following applies to any value of 'excludeArgument[i]': + // - true: the argument at 'i' is susceptible to a one-time permanent contextual typing. + // - undefined: the argument at 'i' is *not* susceptible to permanent contextual typing. + // - false: the argument at 'i' *was* and *has been* permanently contextually typed. + // + // The idea is that we will perform type argument inference & assignability checking once + // without using the susceptible parameters that are functions, and once more for each of those + // parameters, contextually typing each as we go along. + // + // For a tagged template, then the first argument be 'undefined' if necessary + // because it represents a TemplateStringsArray. + var excludeArgument: boolean[]; + for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { + if (isContextSensitiveExpression(args[i])) { + if (!excludeArgument) { + excludeArgument = new Array(args.length); + } + excludeArgument[i] = true; + } + } + + // The following variables are captured and modified by calls to chooseOverload. + // If overload resolution or type argument inference fails, we want to report the + // best error possible. The best error is one which says that an argument was not + // assignable to a parameter. This implies that everything else about the overload + // was fine. So if there is any overload that is only incorrect because of an + // argument, we will report an error on that one. + // + // function foo(s: string) {} + // function foo(n: number) {} // Report argument error on this overload + // function foo() {} + // foo(true); + // + // If none of the overloads even made it that far, there are two possibilities. + // There was a problem with type arguments for some overload, in which case + // report an error on that. Or none of the overloads even had correct arity, + // in which case give an arity error. + // + // function foo(x: T, y: T) {} // Report type argument inference error + // function foo() {} + // foo(0, true); + // + var candidateForArgumentError: Signature; + var candidateForTypeArgumentError: Signature; + var resultOfFailedInference: InferenceContext; + var result: Signature; + + // Section 4.12.1: + // if the candidate list contains one or more signatures for which the type of each argument + // expression is a subtype of each corresponding parameter type, the return type of the first + // of those signatures becomes the return type of the function call. + // Otherwise, the return type of the first signature in the candidate list becomes the return + // type of the function call. + // + // Whether the call is an error is determined by assignability of the arguments. The subtype pass + // is just important for choosing the best signature. So in the case where there is only one + // signature, the subtype pass is useless. So skipping it is an optimization. + if (candidates.length > 1) { + result = chooseOverload(candidates, subtypeRelation); + } + if (!result) { + // Reinitialize these pointers for round two + candidateForArgumentError = undefined; + candidateForTypeArgumentError = undefined; + resultOfFailedInference = undefined; + result = chooseOverload(candidates, assignableRelation); + } + if (result) { + return result; + } + + // No signatures were applicable. Now report errors based on the last applicable signature with + // no arguments excluded from assignability checks. + // If candidate is undefined, it means that no candidates had a suitable arity. In that case, + // skip the checkApplicableSignature check. + if (candidateForArgumentError) { + // excludeArgument is undefined, in this case also equivalent to [undefined, undefined, ...] + // The importance of excludeArgument is to prevent us from typing function expression parameters + // in arguments too early. If possible, we'd like to only type them once we know the correct + // overload. However, this matters for the case where the call is correct. When the call is + // an error, we don't need to exclude any arguments, although it would cause no harm to do so. + checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true); + } + else if (candidateForTypeArgumentError) { + if (!isTaggedTemplate && (node).typeArguments) { + checkTypeArguments(candidateForTypeArgumentError, (node).typeArguments, [], /*reportErrors*/ true) + } + else { + Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); + var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex]; + var inferenceCandidates = getInferenceCandidates(resultOfFailedInference, resultOfFailedInference.failedTypeParameterIndex); + + var diagnosticChainHead = chainDiagnosticMessages(/*details*/ undefined, // details will be provided by call to reportNoCommonSupertypeError + Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, + typeToString(failedTypeParameter)); + + reportNoCommonSupertypeError(inferenceCandidates, (node).func || (node).tag, diagnosticChainHead); + } + } + else { + error(node, Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + } + + // No signature was applicable. We have already reported the errors for the invalid signature. + // If this is a type resolution session, e.g. Language Service, try to get better information that anySignature. + // Pick the first candidate that matches the arity. This way we can get a contextual type for cases like: + // declare function f(a: { xa: number; xb: number; }); + // f({ | + if (!fullTypeCheck) { + for (var i = 0, n = candidates.length; i < n; i++) { + if (hasCorrectArity(node, args, candidates[i])) { + return candidates[i]; + } + } + } + + return resolveErrorCall(node); + + function chooseOverload(candidates: Signature[], relation: Map) { + for (var i = 0; i < candidates.length; i++) { + if (!hasCorrectArity(node, args, candidates[i])) { + continue; + } + + var originalCandidate = candidates[i]; + var inferenceResult: InferenceContext; + + while (true) { + var candidate = originalCandidate; + if (candidate.typeParameters) { + var typeArgumentTypes: Type[]; + var typeArgumentsAreValid: boolean; + if (typeArguments) { + typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false) + } + else { + inferenceResult = inferTypeArguments(candidate, args, excludeArgument); + typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; + typeArgumentTypes = inferenceResult.inferredTypes; + } + if (!typeArgumentsAreValid) { + break; + } + candidate = getSignatureInstantiation(candidate, typeArgumentTypes); + } + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { + break; + } + var index = excludeArgument ? indexOf(excludeArgument, true) : -1; + if (index < 0) { + return candidate; + } + excludeArgument[index] = false; + } + + // A post-mortem of this iteration of the loop. The signature was not applicable, + // so we want to track it as a candidate for reporting an error. If the candidate + // had no type parameters, or had no issues related to type arguments, we can + // report an error based on the arguments. If there was an issue with type + // arguments, then we can only report an error based on the type arguments. + if (originalCandidate.typeParameters) { + var instantiatedCandidate = candidate; + if (typeArgumentsAreValid) { + candidateForArgumentError = instantiatedCandidate; + } + else { + candidateForTypeArgumentError = originalCandidate; + if (!typeArguments) { + resultOfFailedInference = inferenceResult; + } + } + } + else { + Debug.assert(originalCandidate === candidate); + candidateForArgumentError = originalCandidate; + } + } + + return undefined; + } + + // The candidate list orders groups in reverse, but within a group signatures are kept in declaration order + // A nit here is that we reorder only signatures that belong to the same symbol, + // so order how inherited signatures are processed is still preserved. + // interface A { (x: string): void } + // interface B extends A { (x: 'foo'): string } + // var b: B; + // b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void] + function collectCandidates(): void { + var result = candidates; + var lastParent: Node; + var lastSymbol: Symbol; + var cutoffPos: number = 0; + var pos: number; + Debug.assert(!result.length); + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); var parent = signature.declaration && signature.declaration.parent; - if (!lastSymbol || symbol === lastSymbol) { + if (!lastSymbol || symbol === lastSymbol) { if (lastParent && parent === lastParent) { pos++; } @@ -4044,172 +5753,25 @@ module ts { result[pos] = signature; } } - return result; } - // If type has a single call signature and no other members, return that signature. Otherwise, return undefined. - function getSingleCallSignature(type: Type): Signature { - if (type.flags & TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && - resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { - return resolved.callSignatures[0]; - } - } - return undefined; - } - - // 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 { - var context = createInferenceContext(signature.typeParameters); - 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); - }); - return getSignatureInstantiation(signature, getInferredTypes(context)); - } - - // Inferentially type an expression by a contextual parameter type (section 4.12.2 in TypeScript spec) - function inferentiallyTypeExpession(expr: Expression, contextualType: Type, contextualMapper: TypeMapper): Type { - var type = checkExpressionWithContextualType(expr, contextualType, contextualMapper); - var signature = getSingleCallSignature(type); - if (signature && signature.typeParameters) { - var contextualSignature = getSingleCallSignature(contextualType); - if (contextualSignature && !contextualSignature.typeParameters) { - type = getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); - } - } - return type; - } - - function inferTypeArguments(signature: Signature, args: Expression[], excludeArgument?: boolean[]): Type[] { - var typeParameters = signature.typeParameters; - var context = createInferenceContext(typeParameters); - var mapper = createInferenceMapper(context); - // First infer from arguments that are not context sensitive - for (var i = 0; i < args.length; i++) { - if (!excludeArgument || excludeArgument[i] === undefined) { - var parameterType = getTypeAtPosition(signature, i); - inferTypes(context, inferentiallyTypeExpession(args[i], parameterType, mapper), parameterType); - } - } - // Next, infer from those context sensitive arguments that are no longer excluded - if (excludeArgument) { - for (var i = 0; i < args.length; i++) { - if (excludeArgument[i] === false) { - var parameterType = getTypeAtPosition(signature, i); - inferTypes(context, inferentiallyTypeExpession(args[i], parameterType, mapper), parameterType); - } - } - } - return getInferredTypes(context); - } - - function checkTypeArguments(signature: Signature, typeArguments: TypeNode[]): Type[] { - var typeParameters = signature.typeParameters; - var result: Type[] = []; - for (var i = 0; i < typeParameters.length; i++) { - var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); - var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint && fullTypeCheck) { - checkTypeAssignableTo(typeArgument, constraint, typeArgNode, Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } - result.push(typeArgument); - } - return result; - } - - function checkApplicableSignature(node: CallExpression, signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: boolean) { - if (node.arguments) { - for (var i = 0; i < node.arguments.length; i++) { - var arg = node.arguments[i]; - var paramType = getTypeAtPosition(signature, i); - // String literals get string literal types unless we're reporting errors - var argType = arg.kind === SyntaxKind.StringLiteral && !reportErrors ? - getStringLiteralType(arg) : - checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - // Use argument expression as error location when reporting errors - var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); - if (!isValidArgument) { - return false; - } - } - } - return true; - } - - function resolveCall(node: CallExpression, signatures: Signature[]): Signature { - forEach(node.typeArguments, checkSourceElement); - var candidates = collectCandidates(node, signatures); - if (!candidates.length) { - error(node, Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); - return resolveErrorCall(node); - } - var args = node.arguments || emptyArray; - var excludeArgument: boolean[]; - for (var i = 0; i < args.length; i++) { - if (isContextSensitiveExpression(args[i])) { - if (!excludeArgument) excludeArgument = new Array(args.length); - excludeArgument[i] = true; - } - } - var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; - while (true) { - for (var i = 0; i < candidates.length; i++) { - while (true) { - var candidate = candidates[i]; - if (candidate.typeParameters) { - var typeArguments = node.typeArguments ? - checkTypeArguments(candidate, node.typeArguments) : - inferTypeArguments(candidate, args, excludeArgument); - candidate = getSignatureInstantiation(candidate, typeArguments); - } - if (!checkApplicableSignature(node, candidate, relation, excludeArgument, /*reportErrors*/ false)) { - break; - } - var index = excludeArgument ? indexOf(excludeArgument, true) : -1; - if (index < 0) { - return candidate; - } - excludeArgument[index] = false; - } - } - if (relation === assignableRelation) { - break; - } - relation = assignableRelation; - } - // No signatures were applicable. Now report errors based on the last applicable signature with - // no arguments excluded from assignability checks. - checkApplicableSignature(node, candidate, relation, undefined, /*reportErrors*/ true); - return resolveErrorCall(node); - } - - function resolveCallExpression(node: CallExpression): Signature { + function resolveCallExpression(node: CallExpression, candidatesOutArray: Signature[]): Signature { if (node.func.kind === SyntaxKind.SuperKeyword) { var superType = checkSuperExpression(node.func); if (superType !== unknownType) { - return resolveCall(node, getSignaturesOfType(superType, SignatureKind.Construct)); + return resolveCall(node, getSignaturesOfType(superType, SignatureKind.Construct), candidatesOutArray); } return resolveUntypedCall(node); } var funcType = checkExpression(node.func); - if (funcType === unknownType) { + var apparentType = getApparentType(funcType); + + if (apparentType === unknownType) { // Another error has already been reported return resolveErrorCall(node); } - var apparentType = getApparentType(funcType); - if (apparentType === unknownType) { - // handler cases when funcType is type parameter with invalid constraint - // Another error was already reported - return resolveErrorCall(node); - } - // Technically, this signatures list may be incomplete. We are taking the apparent type, // but we are not including call signatures that may have been added to the Object or // Function interface, since they have none by default. This is a bit of a leap of faith @@ -4222,7 +5784,9 @@ module ts { // but is a subtype of the Function interface, the call is an untyped function call. In an // untyped function call no TypeArgs are permitted, Args can be any argument list, no contextual // types are provided for the argument expressions, and the result is always of type Any. - if ((funcType === anyType) || (!callSignatures.length && !constructSignatures.length && isTypeAssignableTo(funcType, globalFunctionType))) { + // We exclude union types because we may have a union of function types that happen to have + // no common signatures. + if (funcType === anyType || (!callSignatures.length && !constructSignatures.length && !(funcType.flags & TypeFlags.Union) && isTypeAssignableTo(funcType, globalFunctionType))) { if (node.typeArguments) { error(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); } @@ -4240,15 +5804,11 @@ module ts { } return resolveErrorCall(node); } - return resolveCall(node, callSignatures); + return resolveCall(node, callSignatures, candidatesOutArray); } - function resolveNewExpression(node: NewExpression): Signature { + function resolveNewExpression(node: NewExpression, candidatesOutArray: Signature[]): Signature { var expressionType = checkExpression(node.func); - if (expressionType === unknownType) { - // Another error has already been reported - return resolveErrorCall(node); - } // TS 1.0 spec: 4.11 // If ConstructExpr is of type Any, Args can be any argument // list and the result of the operation is of type Any. @@ -4256,7 +5816,6 @@ module ts { if (node.typeArguments) { error(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); } - return resolveUntypedCall(node); } @@ -4266,9 +5825,8 @@ module ts { // signatures for overload resolution.The result type of the function call becomes // the result type of the operation. expressionType = getApparentType(expressionType); - if (expressionType === unknownType) { - // handler cases when original expressionType is a type parameter with invalid constraint - // another error has already been reported + if (expressionType === unknownType) { + // Another error has already been reported return resolveErrorCall(node); } @@ -4278,7 +5836,7 @@ module ts { // that the user will not add any. var constructSignatures = getSignaturesOfType(expressionType, SignatureKind.Construct); if (constructSignatures.length) { - return resolveCall(node, constructSignatures); + return resolveCall(node, constructSignatures, candidatesOutArray); } // If ConstructExpr's apparent type is an object type with no construct signatures but @@ -4287,7 +5845,7 @@ module ts { // operation is Any. var callSignatures = getSignaturesOfType(expressionType, SignatureKind.Call); if (callSignatures.length) { - var signature = resolveCall(node, callSignatures); + var signature = resolveCall(node, callSignatures, candidatesOutArray); if (getReturnTypeOfSignature(signature) !== voidType) { error(node, Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); } @@ -4298,11 +5856,52 @@ module ts { return resolveErrorCall(node); } - function getResolvedSignature(node: CallExpression): Signature { + function resolveTaggedTemplateExpression(node: TaggedTemplateExpression, candidatesOutArray: Signature[]): Signature { + var tagType = checkExpression(node.tag); + var apparentType = getApparentType(tagType); + + if (apparentType === unknownType) { + // Another error has already been reported + return resolveErrorCall(node); + } + + var callSignatures = getSignaturesOfType(apparentType, SignatureKind.Call); + + if (tagType === anyType || (!callSignatures.length && !(tagType.flags & TypeFlags.Union) && isTypeAssignableTo(tagType, globalFunctionType))) { + return resolveUntypedCall(node); + } + + if (!callSignatures.length) { + error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + return resolveErrorCall(node); + } + + return resolveCall(node, callSignatures, candidatesOutArray); + } + + // candidatesOutArray is passed by signature help in the language service, and collectCandidates + // must fill it up with the appropriate candidate signatures + function getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature { var links = getNodeLinks(node); - if (!links.resolvedSignature) { + // If getResolvedSignature has already been called, we will have cached the resolvedSignature. + // However, it is possible that either candidatesOutArray was not passed in the first time, + // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work + // to correctly fill the candidatesOutArray. + if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === SyntaxKind.CallExpression ? resolveCallExpression(node) : resolveNewExpression(node); + + if (node.kind === SyntaxKind.CallExpression) { + links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); + } + else if (node.kind === SyntaxKind.NewExpression) { + links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); + } + else if (node.kind === SyntaxKind.TaggedTemplateExpression) { + links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); + } + else { + Debug.fail("Branch in 'getResolvedSignature' should be unreachable."); + } } return links.resolvedSignature; } @@ -4314,9 +5913,13 @@ module ts { } if (node.kind === SyntaxKind.NewExpression) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== SyntaxKind.Constructor && declaration.kind !== SyntaxKind.ConstructSignature)) { + if (declaration && + declaration.kind !== SyntaxKind.Constructor && + declaration.kind !== SyntaxKind.ConstructSignature && + declaration.kind !== SyntaxKind.ConstructorType) { + // When resolved signature is a call signature (and not a construct signature) the result type is any - if (program.getCompilerOptions().noImplicitAny) { + if (compilerOptions.noImplicitAny) { error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; @@ -4325,13 +5928,17 @@ module ts { return getReturnTypeOfSignature(signature); } + function checkTaggedTemplateExpression(node: TaggedTemplateExpression): Type { + return getReturnTypeOfSignature(getResolvedSignature(node)); + } + function checkTypeAssertion(node: TypeAssertion): Type { var exprType = checkExpression(node.operand); var targetType = getTypeFromTypeNode(node.type); if (fullTypeCheck && targetType !== unknownType) { - var widenedType = getWidenedType(exprType); + var widenedType = getWidenedType(exprType, /*supressNoImplicitAnyErrors*/ true); if (!(isTypeAssignableTo(targetType, widenedType))) { - checkTypeAssignableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); + checkTypeAssignableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } return targetType; @@ -4357,12 +5964,13 @@ module ts { } } - function getReturnTypeFromBody(func: FunctionDeclaration, contextualMapper?: TypeMapper): Type { + function getReturnTypeFromBody(func: FunctionLikeDeclaration, contextualMapper?: TypeMapper): Type { + var contextualSignature = getContextualSignature(func); if (func.body.kind !== SyntaxKind.FunctionBlock) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); - if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { error(func, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType)); } @@ -4374,7 +5982,9 @@ module ts { // Try to return the best common type if we have any return expressions. if (types.length > 0) { - var commonType = getBestCommonType(types, /*contextualType:*/ undefined, /*candidatesOnly:*/ true); + // When return statements are contextually typed we allow the return type to be a union type. Otherwise we require the + // return expressions to have a best common supertype. + var commonType = contextualSignature ? getUnionType(types) : getCommonSupertype(types); if (!commonType) { error(func, Diagnostics.No_best_common_type_exists_among_return_expressions); @@ -4384,11 +5994,11 @@ module ts { var widenedType = getWidenedType(commonType); // Check and report for noImplicitAny if the best common type implicitly gets widened to an 'any'/arrays-of-'any' type. - if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { var typeName = typeToString(widenedType); if (func.name) { - error(func, Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, identifierToString(func.name), typeName); + error(func, Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, declarationNameToString(func.name), typeName); } else { error(func, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -4401,37 +6011,6 @@ module ts { return voidType; } - // WARNING: This has the same semantics as the forEach family of functions, - // in that traversal terminates in the event that 'visitor' supplies a truthy value. - function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T { - - return traverse(body); - - function traverse(node: Node): T { - switch (node.kind) { - case SyntaxKind.ReturnStatement: - return visitor(node); - case SyntaxKind.Block: - case SyntaxKind.FunctionBlock: - case SyntaxKind.IfStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.WithStatement: - case SyntaxKind.SwitchStatement: - case SyntaxKind.CaseClause: - case SyntaxKind.DefaultClause: - case SyntaxKind.LabelledStatement: - case SyntaxKind.TryStatement: - case SyntaxKind.TryBlock: - case SyntaxKind.CatchBlock: - case SyntaxKind.FinallyBlock: - return forEachChild(node, traverse); - } - } - } - /// Returns a set of types relating to every return expression relating to a function block. function checkAndAggregateReturnExpressionTypes(body: Block, contextualMapper?: TypeMapper): Type[] { var aggregatedTypes: Type[] = []; @@ -4463,7 +6042,7 @@ module ts { // An explicitly typed function whose return type isn't the Void or the Any type // must have at least one return statement somewhere in its body. // An exception to this rule is if the function implementation consists of a single 'throw' statement. - function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func: FunctionDeclaration, returnType: Type): void { + function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func: FunctionLikeDeclaration, returnType: Type): void { if (!fullTypeCheck) { return; } @@ -4540,7 +6119,7 @@ module ts { else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, /*headMessage*/ undefined); } checkFunctionExpressionBodies(node.body); } @@ -4554,7 +6133,7 @@ module ts { return true; } - function checkReferenceExpression(n: Node, message: DiagnosticMessage): boolean { + function checkReferenceExpression(n: Node, invalidReferenceMessage: DiagnosticMessage, constantVarianleMessage: DiagnosticMessage): boolean { function findSymbol(n: Node): Symbol { var symbol = getNodeLinks(n).resolvedSymbol; // Because we got the symbol from the resolvedSymbol property, it might be of kind @@ -4593,8 +6172,34 @@ module ts { } } + function isConstVariableReference(n: Node): boolean { + switch (n.kind) { + case SyntaxKind.Identifier: + case SyntaxKind.PropertyAccess: + var symbol = findSymbol(n); + return symbol && (symbol.flags & SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & NodeFlags.Const) !== 0; + case SyntaxKind.IndexedAccess: + var index = (n).index; + var symbol = findSymbol((n).object); + if (symbol && index.kind === SyntaxKind.StringLiteral) { + var name = (index).text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + return prop && (prop.flags & SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(prop) & NodeFlags.Const) !== 0; + } + return false; + case SyntaxKind.ParenExpression: + return isConstVariableReference((n).expression); + default: + return false; + } + } + if (!isReferenceOrErrorExpression(n)) { - error(n, message); + error(n, invalidReferenceMessage); + return false; + } + if (isConstVariableReference(n)) { + error(n, constantVarianleMessage); return false; } return true; @@ -4619,7 +6224,9 @@ module ts { var ok = checkArithmeticOperandType(node.operand, operandType, Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors - checkReferenceExpression(node.operand, Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, + Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, + Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -4631,13 +6238,27 @@ module ts { var ok = checkArithmeticOperandType(node.operand, operandType, Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { // run check only if former checks succeeded to avoid reporting cascading errors - checkReferenceExpression(node.operand, Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, + Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, + Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } - function isTypeAnyTypeObjectTypeOrTypeParameter(type: Type): boolean { - return type === anyType || ((type.flags & (TypeFlags.ObjectType | TypeFlags.TypeParameter)) !== 0); + // Return true if type is any, an object type, a type parameter, or a union type composed of only those kinds of types + function isStructuredType(type: Type): boolean { + if (type.flags & TypeFlags.Union) { + return !forEach((type).types, t => !isStructuredType(t)); + } + return (type.flags & TypeFlags.Structured) !== 0; + } + + function isConstEnumObjectType(type: Type) : boolean { + return type.flags & (TypeFlags.ObjectType | TypeFlags.Anonymous) && type.symbol && isConstEnumSymbol(type.symbol); + } + + function isConstEnumSymbol(symbol: Symbol): boolean { + return (symbol.flags & SymbolFlags.ConstEnum) !== 0; } function checkInstanceOfExpression(node: BinaryExpression, leftType: Type, rightType: Type): Type { @@ -4645,10 +6266,12 @@ module ts { // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, // and the right operand to be of type Any or a subtype of the 'Function' interface type. // The result is always of the Boolean primitive type. - if (!isTypeAnyTypeObjectTypeOrTypeParameter(leftType)) { + // NOTE: do not raise error if leftType is unknown as related error was already reported + if (leftType !== unknownType && !isStructuredType(leftType)) { error(node.left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { + // NOTE: do not raise error if right is unknown as related error was already reported + if (rightType !== unknownType && rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { error(node.right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; @@ -4662,7 +6285,7 @@ module ts { if (leftType !== anyType && leftType !== stringType && leftType !== numberType) { error(node.left, Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number); } - if (!isTypeAnyTypeObjectTypeOrTypeParameter(rightType)) { + if (!isStructuredType(rightType)) { error(node.right, Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -4702,10 +6325,21 @@ module ts { if (leftType.flags & (TypeFlags.Undefined | TypeFlags.Null)) leftType = rightType; if (rightType.flags & (TypeFlags.Undefined | TypeFlags.Null)) rightType = leftType; - var leftOk = checkArithmeticOperandType(node.left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - var rightOk = checkArithmeticOperandType(node.right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - if (leftOk && rightOk) { - checkAssignmentOperator(numberType); + var suggestedOperator: SyntaxKind; + // if a user tries to apply a bitwise operator to 2 boolean operands + // try and return them a helpful suggestion + if ((leftType.flags & TypeFlags.Boolean) && + (rightType.flags & TypeFlags.Boolean) && + (suggestedOperator = getSuggestedBooleanOperator(node.operator)) !== undefined) { + error(node, Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, tokenToString(node.operator), tokenToString(suggestedOperator)); + } + else { + // otherwise just check each operand separately and report errors as normal + var leftOk = checkArithmeticOperandType(node.left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + var rightOk = checkArithmeticOperandType(node.right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + if (leftOk && rightOk) { + checkAssignmentOperator(numberType); + } } return numberType; @@ -4752,7 +6386,7 @@ module ts { case SyntaxKind.GreaterThanToken: case SyntaxKind.LessThanEqualsToken: case SyntaxKind.GreaterThanEqualsToken: - if (!isTypeSubtypeOf(leftType, rightType) && !isTypeSubtypeOf(rightType, leftType)) { + if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } return booleanType; @@ -4763,13 +6397,29 @@ module ts { case SyntaxKind.AmpersandAmpersandToken: return rightType; case SyntaxKind.BarBarToken: - return getBestCommonType([leftType, rightType], isInferentialContext(contextualMapper) ? undefined : getContextualType(node)); + return getUnionType([leftType, rightType]); case SyntaxKind.EqualsToken: checkAssignmentOperator(rightType); return rightType; case SyntaxKind.CommaToken: return rightType; } + + function getSuggestedBooleanOperator(operator: SyntaxKind): SyntaxKind { + switch (operator) { + case SyntaxKind.BarToken: + case SyntaxKind.BarEqualsToken: + return SyntaxKind.BarBarToken; + case SyntaxKind.CaretToken: + case SyntaxKind.CaretEqualsToken: + return SyntaxKind.ExclamationEqualsEqualsToken; + case SyntaxKind.AmpersandToken: + case SyntaxKind.AmpersandEqualsToken: + return SyntaxKind.AmpersandAmpersandToken; + default: + return undefined; + } + } function checkAssignmentOperator(valueType: Type): void { if (fullTypeCheck && operator >= SyntaxKind.FirstAssignment && operator <= SyntaxKind.LastAssignment) { @@ -4779,11 +6429,11 @@ module ts { // requires VarExpr to be classified as a reference // A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1) // and the type of the non - compound operation to be assignable to the type of VarExpr. - var ok = checkReferenceExpression(node.left, Diagnostics.Invalid_left_hand_side_of_assignment_expression); + var ok = checkReferenceExpression(node.left, Diagnostics.Invalid_left_hand_side_of_assignment_expression, Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); // Use default messages if (ok) { // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported - checkTypeAssignableTo(valueType, leftType, node.left, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(valueType, leftType, node.left, /*headMessage*/ undefined); } } } @@ -4797,18 +6447,20 @@ module ts { checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, contextualMapper); var type2 = checkExpression(node.whenFalse, contextualMapper); - var contextualType = isInferentialContext(contextualMapper) ? undefined : getContextualType(node); - var resultType = getBestCommonType([type1, type2], contextualType, true); - if (!resultType) { - if (contextualType) { - error(node, Diagnostics.No_best_common_type_exists_between_0_1_and_2, typeToString(contextualType), typeToString(type1), typeToString(type2)); - } - else { - error(node, Diagnostics.No_best_common_type_exists_between_0_and_1, typeToString(type1), typeToString(type2)); - } - resultType = emptyObjectType; - } - return resultType; + return getUnionType([type1, type2]); + } + + function checkTemplateExpression(node: TemplateExpression): Type { + // We just want to check each expressions, but we are unconcerned with + // the type of each expression, as any value may be coerced into a string. + // It is worth asking whether this is what we really want though. + // A place where we actually *are* concerned with the expressions' types are + // in tagged templates. + forEach((node).templateSpans, templateSpan => { + checkExpression(templateSpan.expression); + }); + + return stringType; } function checkExpressionWithContextualType(node: Expression, contextualType: Type, contextualMapper?: TypeMapper): Type { @@ -4833,6 +6485,38 @@ module ts { // have the wildcard function type; this form of type check is used during overload resolution to exclude // contextually typed function and arrow expressions in the initial phase. function checkExpression(node: Expression, contextualMapper?: TypeMapper): Type { + var type = checkExpressionNode(node, contextualMapper); + if (contextualMapper && contextualMapper !== identityMapper) { + var signature = getSingleCallSignature(type); + if (signature && signature.typeParameters) { + var contextualType = getContextualType(node); + if (contextualType) { + var contextualSignature = getSingleCallSignature(contextualType); + if (contextualSignature && !contextualSignature.typeParameters) { + type = getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); + } + } + } + } + + if (isConstEnumObjectType(type)) { + // enum object type for const enums are only permitted in: + // - 'left' in property access + // - 'object' in indexed access + // - target in rhs of import statement + var ok = + (node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).left === node) || + (node.parent.kind === SyntaxKind.IndexedAccess && (node.parent).object === node) || + ((node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName) && isInRightSideOfImportOrExportAssignment(node)); + + if (!ok) { + error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + } + } + return type; + } + + function checkExpressionNode(node: Expression, contextualMapper: TypeMapper): Type { switch (node.kind) { case SyntaxKind.Identifier: return checkIdentifier(node); @@ -4847,7 +6531,10 @@ module ts { return booleanType; case SyntaxKind.NumericLiteral: return numberType; + case SyntaxKind.TemplateExpression: + return checkTemplateExpression(node); case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: return stringType; case SyntaxKind.RegularExpressionLiteral: return globalRegExpType; @@ -4864,6 +6551,8 @@ module ts { case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: return checkCallExpression(node); + case SyntaxKind.TaggedTemplateExpression: + return checkTaggedTemplateExpression(node); case SyntaxKind.TypeAssertion: return checkTypeAssertion(node); case SyntaxKind.ParenExpression: @@ -4879,6 +6568,8 @@ module ts { return checkBinaryExpression(node, contextualMapper); case SyntaxKind.ConditionalExpression: return checkConditionalExpression(node, contextualMapper); + case SyntaxKind.OmittedExpression: + return undefinedType; } return unknownType; } @@ -4900,7 +6591,8 @@ module ts { if (fullTypeCheck) { checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (NodeFlags.Public | NodeFlags.Private) && !(parameterDeclaration.parent.kind === SyntaxKind.Constructor && (parameterDeclaration.parent).body)) { + if (parameterDeclaration.flags & (NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected) && + !(parameterDeclaration.parent.kind === SyntaxKind.Constructor && (parameterDeclaration.parent).body)) { error(parameterDeclaration, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } if (parameterDeclaration.flags & NodeFlags.Rest) { @@ -4909,7 +6601,7 @@ module ts { } } else { - if (parameterDeclaration.initializer && !(parameterDeclaration.parent).body) { + if (parameterDeclaration.initializer && !(parameterDeclaration.parent).body) { error(parameterDeclaration, Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); } } @@ -4918,16 +6610,16 @@ module ts { function checkReferencesInInitializer(n: Node): void { if (n.kind === SyntaxKind.Identifier) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - // check FunctionDeclaration.locals (stores parameters\function local variable) + // check FunctionLikeDeclaration.locals (stores parameters\function local variable) // if it contains entry with a specified name and if this entry matches the resolved symbol if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, SymbolFlags.Value) === referencedSymbol) { if (referencedSymbol.valueDeclaration.kind === SyntaxKind.Parameter) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { - error(n, Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, identifierToString(parameterDeclaration.name)); + error(n, Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, declarationNameToString(parameterDeclaration.name)); return; } var enclosingOrReferencedParameter = - forEach((parameterDeclaration.parent).parameters, p => p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined); + forEach((parameterDeclaration.parent).parameters, p => p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined); if (enclosingOrReferencedParameter === referencedSymbol.valueDeclaration) { // legal case - parameter initializer references some parameter strictly on left of current parameter declaration @@ -4936,7 +6628,7 @@ module ts { // fall through to error reporting } - error(n, Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, identifierToString(parameterDeclaration.name), identifierToString(n)); + error(n, Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, declarationNameToString(parameterDeclaration.name), declarationNameToString(n)); } } else { @@ -4958,9 +6650,9 @@ module ts { if (fullTypeCheck) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); - checkCollistionWithRequireExportsInGeneratedCode(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithArgumentsInGeneratedCode(node); - if (program.getCompilerOptions().noImplicitAny && !node.type) { + if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { case SyntaxKind.ConstructSignature: error(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); @@ -5093,7 +6785,7 @@ module ts { // or the containing class declares instance member variables with initializers. var superCallShouldBeFirst = forEach((node.parent).members, isInstancePropertyWithInitializer) || - forEach(node.parameters, p => p.flags & (NodeFlags.Public | NodeFlags.Private)); + forEach(node.parameters, p => p.flags & (NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected)); if (superCallShouldBeFirst) { var statements = (node.body).statements; @@ -5125,8 +6817,7 @@ module ts { var otherKind = node.kind === SyntaxKind.GetAccessor ? SyntaxKind.SetAccessor : SyntaxKind.GetAccessor; var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - var visibilityFlags = NodeFlags.Private | NodeFlags.Public; - if (((node.flags & visibilityFlags) !== (otherAccessor.flags & visibilityFlags))) { + if (((node.flags & NodeFlags.AccessibilityModifier) !== (otherAccessor.flags & NodeFlags.AccessibilityModifier))) { error(node.name, Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } @@ -5156,7 +6847,7 @@ module ts { var constraint = getConstraintOfTypeParameter((type).target.typeParameters[i]); if (fullTypeCheck && constraint) { var typeArgument = (type).typeArguments[i]; - checkTypeAssignableTo(typeArgument, constraint, node, Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + checkTypeAssignableTo(typeArgument, constraint, node, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } } @@ -5169,14 +6860,22 @@ module ts { function checkTypeLiteral(node: TypeLiteralNode) { forEach(node.members, checkSourceElement); if (fullTypeCheck) { - var type = getTypeFromTypeLiteralNode(node); + var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); checkIndexConstraints(type); checkTypeForDuplicateIndexSignatures(node); } } function checkArrayType(node: ArrayTypeNode) { - getTypeFromArrayTypeNode(node); + checkSourceElement(node.elementType); + } + + function checkTupleType(node: TupleTypeNode) { + forEach(node.elementTypes, checkSourceElement); + } + + function checkUnionType(node: UnionTypeNode) { + forEach(node.types, checkSourceElement); } function isPrivateWithinAmbient(node: Node): boolean { @@ -5194,12 +6893,11 @@ module ts { // TypeScript 1.0 spec (April 2014): 3.7.2.2 // Specialized signatures are not permitted in conjunction with a function body - if ((signatureDeclarationNode).body) { + if ((signatureDeclarationNode).body) { error(signatureDeclarationNode, Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); return; } - var symbol = getSymbolOfNode(signatureDeclarationNode); // TypeScript 1.0 spec (April 2014): 3.7.2.4 // Every specialized call or construct signature in an object type must be assignable // to at least one non-specialized call or construct signature in the same object type @@ -5245,7 +6943,7 @@ module ts { return; } - function checkFlagAgreementBetweenOverloads(overloads: Declaration[], implementation: FunctionDeclaration, flagsToCheck: NodeFlags, someOverloadFlags: NodeFlags, allOverloadFlags: NodeFlags): void { + function checkFlagAgreementBetweenOverloads(overloads: Declaration[], implementation: FunctionLikeDeclaration, flagsToCheck: NodeFlags, someOverloadFlags: NodeFlags, allOverloadFlags: NodeFlags): void { // Error if some overloads have a flag that is not shared by all overloads. To find the // deviations, we XOR someOverloadFlags with allOverloadFlags var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; @@ -5267,8 +6965,8 @@ module ts { else if (deviation & NodeFlags.Ambient) { error(o.name, Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); } - else if (deviation & NodeFlags.Private) { - error(o.name, Diagnostics.Overload_signatures_must_all_be_public_or_private); + else if (deviation & (NodeFlags.Private | NodeFlags.Protected)) { + error(o.name, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); } else if (deviation & NodeFlags.QuestionMark) { error(o.name, Diagnostics.Overload_signatures_must_all_be_optional_or_required); @@ -5277,18 +6975,22 @@ module ts { } } - var flagsToCheck: NodeFlags = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Private | NodeFlags.QuestionMark; + var flagsToCheck: NodeFlags = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Private | NodeFlags.Protected | NodeFlags.QuestionMark; var someNodeFlags: NodeFlags = 0; var allNodeFlags = flagsToCheck; var hasOverloads = false; - var bodyDeclaration: FunctionDeclaration; - var lastSeenNonAmbientDeclaration: FunctionDeclaration; - var previousDeclaration: FunctionDeclaration; + var bodyDeclaration: FunctionLikeDeclaration; + var lastSeenNonAmbientDeclaration: FunctionLikeDeclaration; + var previousDeclaration: FunctionLikeDeclaration; var declarations = symbol.declarations; var isConstructor = (symbol.flags & SymbolFlags.Constructor) !== 0; - function reportImplementationExpectedError(node: FunctionDeclaration): void { + function reportImplementationExpectedError(node: FunctionLikeDeclaration): void { + if (node.name && node.name.kind === SyntaxKind.Missing) { + return; + } + var seen = false; var subsequentNode = forEachChild(node.parent, c => { if (seen) { @@ -5300,8 +7002,9 @@ module ts { }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var errorNode: Node = (subsequentNode).name || subsequentNode; - if (node.name && (subsequentNode).name && node.name.text === (subsequentNode).name.text) { + var errorNode: Node = (subsequentNode).name || subsequentNode; + // TODO(jfreeman): These are methods, so handle computed name case + if (node.name && (subsequentNode).name && (node.name).text === ((subsequentNode).name).text) { // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members Debug.assert(node.kind === SyntaxKind.Method); Debug.assert((node.flags & NodeFlags.Static) !== (subsequentNode.flags & NodeFlags.Static)); @@ -5309,8 +7012,8 @@ module ts { error(errorNode, diagnostic); return; } - else if ((subsequentNode).body) { - error(errorNode, Diagnostics.Function_implementation_name_must_be_0, identifierToString(node.name)); + else if ((subsequentNode).body) { + error(errorNode, Diagnostics.Function_implementation_name_must_be_0, declarationNameToString(node.name)); return; } } @@ -5327,8 +7030,10 @@ module ts { // when checking exported function declarations across modules check only duplicate implementations // names and consistency of modifiers are verified when we check local symbol var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & SymbolFlags.Module; + var duplicateFunctionDeclaration = false; + var multipleConstructorImplementation = false; for (var i = 0; i < declarations.length; i++) { - var node = declarations[i]; + var node = declarations[i]; var inAmbientContext = isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === SyntaxKind.InterfaceDeclaration || node.parent.kind === SyntaxKind.TypeLiteral || inAmbientContext; if (inAmbientContextOrInterface) { @@ -5349,10 +7054,10 @@ module ts { if (node.body && bodyDeclaration) { if (isConstructor) { - error(node, Diagnostics.Multiple_constructor_implementations_are_not_allowed); + multipleConstructorImplementation = true; } else { - error(node, Diagnostics.Duplicate_function_implementation); + duplicateFunctionDeclaration = true; } } else if (!isExportSymbolInsideModule && previousDeclaration && previousDeclaration.parent === node.parent && previousDeclaration.end !== node.pos) { @@ -5376,6 +7081,18 @@ module ts { } } + if (multipleConstructorImplementation) { + forEach(declarations, declaration => { + error(declaration, Diagnostics.Multiple_constructor_implementations_are_not_allowed); + }); + } + + if (duplicateFunctionDeclaration) { + forEach( declarations, declaration => { + error(declaration.name, Diagnostics.Duplicate_function_implementation); + }); + } + if (!isExportSymbolInsideModule && lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } @@ -5460,7 +7177,7 @@ module ts { // declaration spaces for exported and non-exported declarations intersect forEach(symbol.declarations, d => { if (getDeclarationSpaces(d) & commonDeclarationSpace) { - error(d.name, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, identifierToString(d.name)); + error(d.name, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, declarationNameToString(d.name)); } }); } @@ -5470,7 +7187,7 @@ module ts { case SyntaxKind.InterfaceDeclaration: return SymbolFlags.ExportType; case SyntaxKind.ModuleDeclaration: - return (d).name.kind === SyntaxKind.StringLiteral || isInstantiated(d) + return (d).name.kind === SyntaxKind.StringLiteral || getModuleInstanceState(d) !== ModuleInstanceState.NonInstantiated ? SymbolFlags.ExportNamespace | SymbolFlags.ExportValue : SymbolFlags.ExportNamespace; case SyntaxKind.ClassDeclaration: @@ -5487,7 +7204,7 @@ module ts { } } - function checkFunctionDeclaration(node: FunctionDeclaration): void { + function checkFunctionDeclaration(node: FunctionLikeDeclaration): void { checkSignatureDeclaration(node); var symbol = getSymbolOfNode(node); @@ -5516,14 +7233,14 @@ module ts { } // If there is no body and no explicit return type, then report an error. - if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && !node.body && !node.type) { + if (fullTypeCheck && compilerOptions.noImplicitAny && !node.body && !node.type) { // Ignore privates within ambient contexts; they exist purely for documentative purposes to avoid name clashing. // (e.g. privates within .d.ts files do not expose type information) if (!isPrivateWithinAmbient(node)) { var typeName = typeToString(anyType); if (node.name) { - error(node, Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, identifierToString(node.name), typeName); + error(node, Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, declarationNameToString(node.name), typeName); } else { error(node, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -5538,7 +7255,7 @@ module ts { function checkCollisionWithArgumentsInGeneratedCode(node: SignatureDeclaration) { // no rest parameters \ declaration context \ overload - no codegen impact - if (!hasRestParameters(node) || isInAmbientContext(node) || !(node).body) { + if (!hasRestParameters(node) || isInAmbientContext(node) || !(node).body) { return; } @@ -5559,7 +7276,7 @@ module ts { // - function has implementation (not a signature) // - function has rest parameters // - context is not ambient (otherwise no codegen impact) - if ((node.parent).body && hasRestParameters(node.parent) && !isInAmbientContext(node)) { + if ((node.parent).body && hasRestParameters(node.parent) && !isInAmbientContext(node)) { error(node, Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } return; @@ -5617,7 +7334,7 @@ module ts { case SyntaxKind.Method: case SyntaxKind.ArrowFunction: case SyntaxKind.Constructor: - if (hasRestParameters(current)) { + if (hasRestParameters(current)) { error(node, Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); return; } @@ -5627,8 +7344,9 @@ module ts { } } - function needCollisionCheckForIdentifier(node: Node, identifier: Identifier, name: string): boolean { - if (!(identifier && identifier.text === name)) { + // TODO(jfreeman): Decide what to do for computed properties + function needCollisionCheckForIdentifier(node: Node, identifier: DeclarationName, name: string): boolean { + if (!(identifier && (identifier).text === name)) { return false; } @@ -5645,15 +7363,16 @@ module ts { return false; } - if (node.kind === SyntaxKind.Parameter && !(node.parent).body) { + if (node.kind === SyntaxKind.Parameter && !(node.parent).body) { // just an overload - no codegen impact return false; } return true; } - - function checkCollisionWithCapturedThisVariable(node: Node, name: Identifier): void { + + // TODO(jfreeman): Decide what to do for computed properties + function checkCollisionWithCapturedThisVariable(node: Node, name: DeclarationName): void { if (!needCollisionCheckForIdentifier(node, name, "_this")) { return; } @@ -5678,7 +7397,7 @@ module ts { } } - function checkCollisionWithCapturedSuperVariable(node: Node, name: Identifier) { + function checkCollisionWithCapturedSuperVariable(node: Node, name: DeclarationName) { if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } @@ -5701,13 +7420,14 @@ module ts { } } - function checkCollistionWithRequireExportsInGeneratedCode(node: Node, name: Identifier) { + // TODO(jfreeman): Decide what to do for computed properties + function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: DeclarationName) { if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } // Uninstantiated modules shouldnt do this check - if (node.kind === SyntaxKind.ModuleDeclaration && !isInstantiated(node)) { + if (node.kind === SyntaxKind.ModuleDeclaration && getModuleInstanceState(node) !== ModuleInstanceState.Instantiated) { return; } @@ -5715,11 +7435,44 @@ module ts { var parent = node.kind === SyntaxKind.VariableDeclaration ? node.parent.parent : node.parent; if (parent.kind === SyntaxKind.SourceFile && isExternalModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords - error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); + error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, + declarationNameToString(name), declarationNameToString(name)); } } - function checkVariableDeclaration(node: VariableDeclaration) { + function checkCollisionWithConstDeclarations(node: VariableDeclaration) { + // Variable declarations are hoisted to the top of their function scope. They can shadow + // block scoped declarations, which bind tighter. this will not be flagged as duplicate definition + // by the binder as the declaration scope is different. + // A non-initialized declaration is a no-op as the block declaration will resolve before the var + // declaration. the problem is if the declaration has an initializer. this will act as a write to the + // block declared value. this is fine for let, but not const. + // + // Only consider declarations with initializers, uninitialized var declarations will not + // step on a const variable. + // Do not consider let and const declarations, as duplicate block-scoped declarations + // are handled by the binder. + // We are only looking for var declarations that step on const declarations from a + // different scope. e.g.: + // var x = 0; + // { + // const x = 0; + // var x = 0; + // } + if (node.initializer && (node.flags & NodeFlags.BlockScoped) === 0) { + var symbol = getSymbolOfNode(node); + if (symbol.flags & SymbolFlags.FunctionScopedVariable) { + var localDeclarationSymbol = resolveName(node, node.name.text, SymbolFlags.Variable, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined); + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & SymbolFlags.BlockScopedVariable) { + if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & NodeFlags.Const) { + error(node, Diagnostics.Cannot_redeclare_block_scoped_variable_0, symbolToString(localDeclarationSymbol)); + } + } + } + } + } + + function checkVariableDeclaration(node: VariableDeclaration | PropertyDeclaration) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); @@ -5733,26 +7486,28 @@ module ts { type = typeOfValueDeclaration; } else { - type = getTypeOfVariableDeclaration(node); + type = getTypeOfVariableOrPropertyDeclaration(node); } if (node.initializer) { if (!(getNodeLinks(node.initializer).flags & NodeCheckFlags.TypeChecked)) { // Use default messages - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*headMessage*/ undefined); } + //TODO(jfreeman): Check that it is not a computed property + checkCollisionWithConstDeclarations(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); - checkCollistionWithRequireExportsInGeneratedCode(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); if (!useTypeFromValueDeclaration) { // TypeScript 1.0 spec (April 2014): 5.1 // Multiple declarations for the same variable name in the same declaration space are permitted, // provided that each declaration associates the same type with the variable. if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + error(node.name, Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, declarationNameToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); } } } @@ -5797,10 +7552,13 @@ module ts { // for (var VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.declaration) { - checkVariableDeclaration(node.declaration); - if (node.declaration.type) { - error(node.declaration, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + checkVariableDeclaration(decl); + if (decl.type) { + error(decl, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + } } } @@ -5815,14 +7573,14 @@ module ts { } else { // run check only former check succeeded to avoid cascading errors - checkReferenceExpression(node.variable, Diagnostics.Invalid_left_hand_side_in_for_in_statement); + checkReferenceExpression(node.variable, Diagnostics.Invalid_left_hand_side_in_for_in_statement, Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); } } var exprType = checkExpression(node.expression); // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAnyTypeObjectTypeOrTypeParameter(exprType) && exprType !== unknownType) { + if (!isStructuredType(exprType) && exprType !== unknownType) { error(node.expression, Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } @@ -5833,17 +7591,6 @@ module ts { // TODO: Check that target label is valid } - function getContainingFunction(node: Node): SignatureDeclaration { - while (true) { - node = node.parent; - if (!node || node.kind === SyntaxKind.FunctionDeclaration || node.kind === SyntaxKind.FunctionExpression || - node.kind === SyntaxKind.ArrowFunction || node.kind === SyntaxKind.Method || node.kind === SyntaxKind.Constructor || - node.kind === SyntaxKind.GetAccessor || node.kind === SyntaxKind.SetAccessor) { - return node; - } - } - } - function checkReturnStatement(node: ReturnStatement) { if (node.expression && !(getNodeLinks(node.expression).flags & NodeCheckFlags.TypeChecked)) { var func = getContainingFunction(node); @@ -5863,7 +7610,7 @@ module ts { func.type || (func.kind === SyntaxKind.GetAccessor && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, SyntaxKind.SetAccessor))); if (checkAssignability) { - checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*headMessage*/ undefined); } else if (func.kind == SyntaxKind.Constructor) { // constructor doesn't have explicit return type annotation and yet its return type is known - declaring type @@ -5891,14 +7638,14 @@ module ts { var caseType = checkExpression(clause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails - checkTypeAssignableTo(caseType, expressionType, clause.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(caseType, expressionType, clause.expression, /*headMessage*/ undefined); } } checkBlock(clause); }); } - function checkLabelledStatement(node: LabelledStatement) { + function checkLabeledStatement(node: LabeledStatement) { checkSourceElement(node.statement); } @@ -5938,7 +7685,7 @@ module ts { // for interfaces property and indexer might be inherited from different bases // check if any base class already has both property and indexer. // check should be performed only if 'type' is the first type that brings property\indexer together - var someBaseClassHasBothPropertyAndIndexer = forEach((type).baseTypes, base => getPropertyOfType(base, prop.name) && getIndexTypeOfType(base, indexKind)); + var someBaseClassHasBothPropertyAndIndexer = forEach((type).baseTypes, base => getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind)); errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : type.symbol.declarations[0]; } @@ -5958,7 +7705,7 @@ module ts { var numberIndexType = getIndexTypeOfType(type, IndexKind.Number); if (stringIndexType || numberIndexType) { - forEach(getPropertiesOfType(type), prop => { + forEach(getPropertiesOfObjectType(type), prop => { var propType = getTypeOfSymbol(prop); checkIndexConstraintForProperty(prop, propType, declaredStringIndexer, stringIndexType, IndexKind.String); checkIndexConstraintForProperty(prop, propType, declaredNumberIndexer, numberIndexType, IndexKind.Number); @@ -5981,16 +7728,17 @@ module ts { } } - function checkTypeNameIsReserved(name: Identifier, message: DiagnosticMessage): void { + // TODO(jfreeman): Decide what to do for computed properties + function checkTypeNameIsReserved(name: DeclarationName, message: DiagnosticMessage): void { // TS 1.0 spec (April 2014): 3.6.1 // The predefined type keywords are reserved and cannot be used as names of user defined types. - switch (name.text) { + switch ((name).text) { case "any": case "number": case "boolean": case "string": case "void": - error(name, message, name.text); + error(name, message, (name).text); } } @@ -6004,7 +7752,7 @@ module ts { if (fullTypeCheck) { for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, Diagnostics.Duplicate_identifier_0, identifierToString(node.name)); + error(node.name, Diagnostics.Duplicate_identifier_0, declarationNameToString(node.name)); } } } @@ -6016,7 +7764,7 @@ module ts { checkTypeNameIsReserved(node.name, Diagnostics.Class_name_cannot_be_0); checkTypeParameters(node.typeParameters); checkCollisionWithCapturedThisVariable(node, node.name); - checkCollistionWithRequireExportsInGeneratedCode(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); var type = getDeclaredTypeOfSymbol(symbol); @@ -6028,10 +7776,10 @@ module ts { if (type.baseTypes.length) { if (fullTypeCheck) { var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, Diagnostics.Class_0_incorrectly_extends_base_class_1); + checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, - Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, SymbolFlags.Value)) { error(node.baseType, Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } @@ -6050,7 +7798,7 @@ module ts { if (t !== unknownType) { var declaredType = (t.flags & TypeFlags.Reference) ? (t).target : t; if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) { - checkTypeAssignableTo(type, t, node.name, Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, Diagnostics.Class_0_incorrectly_implements_interface_1); + checkTypeAssignableTo(type, t, node.name, Diagnostics.Class_0_incorrectly_implements_interface_1); } else { error(typeRefNode, Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -6068,7 +7816,7 @@ module ts { } function getTargetSymbol(s: Symbol) { - // if symbol is instantiated it's flags are not copied from the 'target' + // if symbol is instantiated its flags are not copied from the 'target' // so we'll need to get back original 'target' symbol to work with correct set of flags return s.flags & SymbolFlags.Instantiated ? getSymbolLinks(s).target : s; } @@ -6090,7 +7838,7 @@ module ts { // derived class instance member variables and accessors, but not by other kinds of members. // NOTE: assignability is checked in checkClassDeclaration - var baseProperties = getPropertiesOfType(baseType); + var baseProperties = getPropertiesOfObjectType(baseType); for (var i = 0, len = baseProperties.length; i < len; ++i) { var base = getTargetSymbol(baseProperties[i]); @@ -6098,7 +7846,7 @@ module ts { continue; } - var derived = getTargetSymbol(getPropertyOfType(type, base.name)); + var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); if (derived) { var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); @@ -6123,17 +7871,17 @@ module ts { errorMessage = Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - Debug.assert(derived.flags & SymbolFlags.Property); + Debug.assert((derived.flags & SymbolFlags.Property) !== 0); errorMessage = Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } else if (base.flags & SymbolFlags.Property) { - Debug.assert(derived.flags & SymbolFlags.Method); + Debug.assert((derived.flags & SymbolFlags.Method) !== 0); errorMessage = Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - Debug.assert(base.flags & SymbolFlags.Accessor); - Debug.assert(derived.flags & SymbolFlags.Method); + Debug.assert((base.flags & SymbolFlags.Accessor) !== 0); + Debug.assert((derived.flags & SymbolFlags.Method) !== 0); errorMessage = Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } @@ -6175,6 +7923,43 @@ module ts { return true; } + function checkInheritedPropertiesAreIdentical(type: InterfaceType, typeNode: Node): boolean { + if (!type.baseTypes.length || type.baseTypes.length === 1) { + return true; + } + + var seen: Map<{ prop: Symbol; containingType: Type }> = {}; + forEach(type.declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; }); + var ok = true; + + for (var i = 0, len = type.baseTypes.length; i < len; ++i) { + var base = type.baseTypes[i]; + var properties = getPropertiesOfObjectType(base); + for (var j = 0, proplen = properties.length; j < proplen; ++j) { + var prop = properties[j]; + if (!hasProperty(seen, prop.name)) { + seen[prop.name] = { prop: prop, containingType: base }; + } + else { + var existing = seen[prop.name]; + var isInheritedProperty = existing.containingType !== type; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok = false; + + var typeName1 = typeToString(existing.containingType); + var typeName2 = typeToString(base); + + var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); + addDiagnostic(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); + } + } + } + } + + return ok; + } + function checkInterfaceDeclaration(node: InterfaceDeclaration) { checkTypeParameters(node.typeParameters); if (fullTypeCheck) { @@ -6195,7 +7980,7 @@ module ts { // run subsequent checks only if first set succeeded if (checkInheritedPropertiesAreIdentical(type, node.name)) { forEach(type.baseTypes, baseType => { - checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, Diagnostics.Interface_0_incorrectly_extends_interface_1); + checkTypeAssignableTo(type, baseType, node.name , Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); } @@ -6209,55 +7994,179 @@ module ts { } } - function getConstantValue(node: Expression): number { - var isNegative = false; - if (node.kind === SyntaxKind.PrefixOperator) { - var unaryExpression = node; - if (unaryExpression.operator === SyntaxKind.MinusToken || unaryExpression.operator === SyntaxKind.PlusToken) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === SyntaxKind.MinusToken; - } - } - if (node.kind === SyntaxKind.NumericLiteral) { - var literalText = (node).text; - return isNegative ? -literalText : +literalText; + function checkTypeAliasDeclaration(node: TypeAliasDeclaration) { + checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); + checkSourceElement(node.type); + } + + function computeEnumMemberValues(node: EnumDeclaration) { + var nodeLinks = getNodeLinks(node); + + if (!(nodeLinks.flags & NodeCheckFlags.EnumValuesComputed)) { + var enumSymbol = getSymbolOfNode(node); + var enumType = getDeclaredTypeOfSymbol(enumSymbol); + var autoValue = 0; + var ambient = isInAmbientContext(node); + var enumIsConst = isConst(node); + + forEach(node.members, member => { + // TODO(jfreeman): Check that it is not a computed name + if(isNumericName((member.name).text)) { + error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); + } + var initializer = member.initializer; + if (initializer) { + autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + if (autoValue === undefined) { + if (enumIsConst) { + error(initializer, Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + } + else if (!ambient) { + // Only here do we need to check that the initializer is assignable to the enum type. + // If it is a constant value (not undefined), it is syntactically constrained to be a number. + // Also, we do not need to check this for ambients because there is already + // a syntax error if it is not a constant. + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*headMessage*/ undefined); + } + } + else if (enumIsConst) { + if (isNaN(autoValue)) { + error(initializer, Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN); + } + else if (!isFinite(autoValue)) { + error(initializer, Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + } + } + + } + else if (ambient && !enumIsConst) { + autoValue = undefined; + } + + if (autoValue !== undefined) { + getNodeLinks(member).enumMemberValue = autoValue++; + } + }); + + nodeLinks.flags |= NodeCheckFlags.EnumValuesComputed; } - return undefined; + function getConstantValueForEnumMemberInitializer(initializer: Expression, enumIsConst: boolean): number { + return evalConstant(initializer); + + function evalConstant(e: Node): number { + switch (e.kind) { + case SyntaxKind.PrefixOperator: + var value = evalConstant((e).operand); + if (value === undefined) { + return undefined; + } + switch ((e).operator) { + case SyntaxKind.PlusToken: return value; + case SyntaxKind.MinusToken: return -value; + case SyntaxKind.TildeToken: return enumIsConst ? ~value : undefined; + } + return undefined; + case SyntaxKind.BinaryExpression: + if (!enumIsConst) { + return undefined; + } + + var left = evalConstant((e).left); + if (left === undefined) { + return undefined; + } + var right = evalConstant((e).right); + if (right === undefined) { + return undefined; + } + switch ((e).operator) { + case SyntaxKind.BarToken: return left | right; + case SyntaxKind.AmpersandToken: return left & right; + case SyntaxKind.GreaterThanGreaterThanToken: return left >> right; + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: return left >>> right; + case SyntaxKind.LessThanLessThanToken: return left << right; + case SyntaxKind.CaretToken: return left ^ right; + case SyntaxKind.AsteriskToken: return left * right; + case SyntaxKind.SlashToken: return left / right; + case SyntaxKind.PlusToken: return left + right; + case SyntaxKind.MinusToken: return left - right; + case SyntaxKind.PercentToken: return left % right; + } + return undefined; + case SyntaxKind.NumericLiteral: + return +(e).text; + case SyntaxKind.ParenExpression: + return enumIsConst ? evalConstant((e).expression) : undefined; + case SyntaxKind.Identifier: + case SyntaxKind.IndexedAccess: + case SyntaxKind.PropertyAccess: + if (!enumIsConst) { + return undefined; + } + + var member = initializer.parent; + var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); + var enumType: Type; + var propertyName: string; + + if (e.kind === SyntaxKind.Identifier) { + // unqualified names can refer to member that reside in different declaration of the enum so just doing name resolution won't work. + // instead pick current enum type and later try to fetch member from the type + enumType = currentType; + propertyName = (e).text; + } + else { + if (e.kind === SyntaxKind.IndexedAccess) { + if ((e).index.kind !== SyntaxKind.StringLiteral) { + return undefined; + } + var enumType = getTypeOfNode((e).object); + propertyName = ((e).index).text; + } + else { + var enumType = getTypeOfNode((e).left); + propertyName = (e).right.text; + } + if (enumType !== currentType) { + return undefined; + } + } + + if (propertyName === undefined) { + return undefined; + } + var property = getPropertyOfObjectType(enumType, propertyName); + if (!property || !(property.flags & SymbolFlags.EnumMember)) { + return undefined; + } + var propertyDecl = property.valueDeclaration; + // self references are illegal + if (member === propertyDecl) { + return undefined; + } + + // illegal case: forward reference + if (!isDefinedBefore(propertyDecl, member)) { + return undefined; + } + return getNodeLinks(propertyDecl).enumMemberValue; + } + } + } } function checkEnumDeclaration(node: EnumDeclaration) { if (!fullTypeCheck) { return; } + checkTypeNameIsReserved(node.name, Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); - checkCollistionWithRequireExportsInGeneratedCode(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); - var enumSymbol = getSymbolOfNode(node); - var enumType = getDeclaredTypeOfSymbol(enumSymbol); - var autoValue = 0; - var ambient = isInAmbientContext(node); - forEach(node.members, member => { - var initializer = member.initializer; - if (initializer) { - autoValue = getConstantValue(initializer); - if (autoValue === undefined && !ambient) { - // Only here do we need to check that the initializer is assignable to the enum type. - // If it is a constant value (not undefined), it is syntactically constrained to be a number. - // Also, we do not need to check this for ambients because there is already - // a syntax error if it is not a constant. - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); - } - } - else if (ambient) { - autoValue = undefined; - } - if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; - } - }); + computeEnumMemberValues(node); // Spec 2014 - Section 9.3: // It isn't possible for one enum declaration to continue the automatic numbering sequence of another, @@ -6265,8 +8174,19 @@ module ts { // for the first member. // // Only perform this check once per symbol + var enumSymbol = getSymbolOfNode(node); var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { + if (enumSymbol.declarations.length > 1) { + var enumIsConst = isConst(node); + // check that const is placed\omitted on all enum declarations + forEach(enumSymbol.declarations, decl => { + if (isConstEnumDeclaration(decl) !== enumIsConst) { + error(decl.name, Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } + var seenEnumMissingInitialInitializer = false; forEach(enumSymbol.declarations, declaration => { // return true if we hit a violation of the rule, false otherwise @@ -6296,7 +8216,7 @@ module ts { var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === SyntaxKind.ClassDeclaration || (declaration.kind === SyntaxKind.FunctionDeclaration && (declaration).body)) && !isInAmbientContext(declaration)) { + if ((declaration.kind === SyntaxKind.ClassDeclaration || (declaration.kind === SyntaxKind.FunctionDeclaration && (declaration).body)) && !isInAmbientContext(declaration)) { return declaration; } } @@ -6306,7 +8226,7 @@ module ts { function checkModuleDeclaration(node: ModuleDeclaration) { if (fullTypeCheck) { checkCollisionWithCapturedThisVariable(node, node.name); - checkCollistionWithRequireExportsInGeneratedCode(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); if (symbol.flags & SymbolFlags.ValueModule && symbol.declarations.length > 1 && !isInAmbientContext(node)) { @@ -6341,7 +8261,7 @@ module ts { function checkImportDeclaration(node: ImportDeclaration) { checkCollisionWithCapturedThisVariable(node, node.name); - checkCollistionWithRequireExportsInGeneratedCode(node, node.name); + checkCollisionWithRequireExportsInGeneratedCode(node, node.name); var symbol = getSymbolOfNode(node); var target: Symbol; @@ -6357,7 +8277,7 @@ module ts { checkExpression(node.entityName); } else { - error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, identifierToString(moduleName)); + error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName)); } } if (target.flags & SymbolFlags.Type) { @@ -6417,6 +8337,8 @@ module ts { return checkParameter(node); case SyntaxKind.Property: return checkPropertyDeclaration(node); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: case SyntaxKind.IndexSignature: @@ -6436,8 +8358,14 @@ module ts { return checkTypeLiteral(node); case SyntaxKind.ArrayType: return checkArrayType(node); + case SyntaxKind.TupleType: + return checkTupleType(node); + case SyntaxKind.UnionType: + return checkUnionType(node); + case SyntaxKind.ParenType: + return checkSourceElement((node).type); case SyntaxKind.FunctionDeclaration: - return checkFunctionDeclaration(node); + return checkFunctionDeclaration(node); case SyntaxKind.Block: return checkBlock(node); case SyntaxKind.FunctionBlock: @@ -6466,8 +8394,8 @@ module ts { return checkWithStatement(node); case SyntaxKind.SwitchStatement: return checkSwitchStatement(node); - case SyntaxKind.LabelledStatement: - return checkLabelledStatement(node); + case SyntaxKind.LabeledStatement: + return checkLabeledStatement(node); case SyntaxKind.ThrowStatement: return checkThrowStatement(node); case SyntaxKind.TryStatement: @@ -6478,6 +8406,8 @@ module ts { return checkClassDeclaration(node); case SyntaxKind.InterfaceDeclaration: return checkInterfaceDeclaration(node); + case SyntaxKind.TypeAliasDeclaration: + return checkTypeAliasDeclaration(node); case SyntaxKind.EnumDeclaration: return checkEnumDeclaration(node); case SyntaxKind.ModuleDeclaration: @@ -6502,7 +8432,7 @@ module ts { switch (node.kind) { case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - forEach((node).parameters, checkFunctionExpressionBodies); + forEach((node).parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; case SyntaxKind.Method: @@ -6510,7 +8440,7 @@ module ts { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.FunctionDeclaration: - forEach((node).parameters, checkFunctionExpressionBodies); + forEach((node).parameters, checkFunctionExpressionBodies); break; case SyntaxKind.WithStatement: checkFunctionExpressionBodies((node).expression); @@ -6524,6 +8454,7 @@ module ts { case SyntaxKind.IndexedAccess: case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: + case SyntaxKind.TaggedTemplateExpression: case SyntaxKind.TypeAssertion: case SyntaxKind.ParenExpression: case SyntaxKind.PrefixOperator: @@ -6546,7 +8477,7 @@ module ts { case SyntaxKind.SwitchStatement: case SyntaxKind.CaseClause: case SyntaxKind.DefaultClause: - case SyntaxKind.LabelledStatement: + case SyntaxKind.LabeledStatement: case SyntaxKind.ThrowStatement: case SyntaxKind.TryStatement: case SyntaxKind.TryBlock: @@ -6615,6 +8546,12 @@ module ts { return getSortedDiagnostics(); } + function getDeclarationDiagnostics(targetSourceFile: SourceFile): Diagnostic[] { + var resolver = createResolver(); + checkSourceFile(targetSourceFile); + return ts.getDeclarationDiagnostics(program, resolver, targetSourceFile); + } + function getGlobalDiagnostics(): Diagnostic[] { return filter(getSortedDiagnostics(), d => !d.file); } @@ -6622,7 +8559,7 @@ module ts { // Language service support function getNodeAtPosition(sourceFile: SourceFile, position: number): Node { - function findChildAtPosition(parent: Node) { + function findChildAtPosition(parent: Node): Node { var child = forEachChild(parent, node => { if (position >= node.pos && position <= node.end && position >= getTokenPosOfNode(node)) { return findChildAtPosition(node); @@ -6635,7 +8572,20 @@ module ts { return findChildAtPosition(sourceFile); } - function getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[] { + function isInsideWithStatementBody(node: Node): boolean { + if (node) { + while (node.parent) { + if (node.parent.kind === SyntaxKind.WithStatement && (node.parent).statement === node) { + return true; + } + node = node.parent; + } + } + + return false; + } + + function getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]{ var symbols: SymbolTable = {}; var memberFlags: NodeFlags = 0; function copySymbol(symbol: Symbol, meaning: SymbolFlags) { @@ -6655,6 +8605,12 @@ module ts { } } } + + if (isInsideWithStatementBody(location)) { + // We cannot answer semantic questions within a with block, do not proceed any further + return []; + } + while (location) { if (location.locals && !isGlobalSourceFile(location)) { copySymbols(location.locals, meaning); @@ -6692,7 +8648,6 @@ module ts { return mapToArray(symbols); } - // True if the given identifier is the name of a type declaration node (class, interface, enum, type parameter, etc) function isTypeDeclarationName(name: Node): boolean { return name.kind == SyntaxKind.Identifier && isTypeDeclaration(name.parent) && @@ -6704,6 +8659,7 @@ module ts { case SyntaxKind.TypeParameter: case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.EnumDeclaration: return true; } @@ -6716,79 +8672,8 @@ module ts { return node.parent && node.parent.kind === SyntaxKind.TypeReference; } - function isExpression(node: Node): boolean { - switch (node.kind) { - case SyntaxKind.ThisKeyword: - case SyntaxKind.SuperKeyword: - case SyntaxKind.NullKeyword: - case SyntaxKind.TrueKeyword: - case SyntaxKind.FalseKeyword: - case SyntaxKind.RegularExpressionLiteral: - case SyntaxKind.ArrayLiteral: - case SyntaxKind.ObjectLiteral: - case SyntaxKind.PropertyAccess: - case SyntaxKind.IndexedAccess: - case SyntaxKind.CallExpression: - case SyntaxKind.NewExpression: - case SyntaxKind.TypeAssertion: - case SyntaxKind.ParenExpression: - case SyntaxKind.FunctionExpression: - case SyntaxKind.ArrowFunction: - case SyntaxKind.PrefixOperator: - case SyntaxKind.PostfixOperator: - case SyntaxKind.BinaryExpression: - case SyntaxKind.ConditionalExpression: - case SyntaxKind.OmittedExpression: - return true; - case SyntaxKind.QualifiedName: - while (node.parent.kind === SyntaxKind.QualifiedName) node = node.parent; - return node.parent.kind === SyntaxKind.TypeQuery; - case SyntaxKind.Identifier: - if (node.parent.kind === SyntaxKind.TypeQuery) { - return true; - } - // Fall through - case SyntaxKind.NumericLiteral: - case SyntaxKind.StringLiteral: - var parent = node.parent; - switch (parent.kind) { - case SyntaxKind.VariableDeclaration: - case SyntaxKind.Parameter: - case SyntaxKind.Property: - case SyntaxKind.EnumMember: - case SyntaxKind.PropertyAssignment: - return (parent).initializer === node; - case SyntaxKind.ExpressionStatement: - case SyntaxKind.IfStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.ReturnStatement: - case SyntaxKind.WithStatement: - case SyntaxKind.SwitchStatement: - case SyntaxKind.CaseClause: - case SyntaxKind.ThrowStatement: - case SyntaxKind.SwitchStatement: - return (parent).expression === node; - case SyntaxKind.ForStatement: - return (parent).initializer === node || - (parent).condition === node || - (parent).iterator === node; - case SyntaxKind.ForInStatement: - return (parent).variable === node || - (parent).expression === node; - case SyntaxKind.TypeAssertion: - return node === (parent).operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; - } - function isTypeNode(node: Node): boolean { - if (node.kind >= SyntaxKind.FirstTypeNode && node.kind <= SyntaxKind.LastTypeNode) { + if (SyntaxKind.FirstTypeNode <= node.kind && node.kind <= SyntaxKind.LastTypeNode) { return true; } @@ -6803,16 +8688,19 @@ module ts { case SyntaxKind.StringLiteral: // Specialized signatures can have string literals as their parameters' type names return node.parent.kind === SyntaxKind.Parameter; + // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case SyntaxKind.Identifier: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === SyntaxKind.QualifiedName) { + if (node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node) { node = node.parent; } - // Fall through + // fall through case SyntaxKind.QualifiedName: // At this point, node is either a qualified name or an identifier + Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); + var parent = node.parent; if (parent.kind === SyntaxKind.TypeQuery) { return false; @@ -6823,7 +8711,7 @@ module ts { // // Calling isTypeNode would consider the qualified name A.B a type node. Only C or // A.B.C is a type node. - if (parent.kind >= SyntaxKind.FirstTypeNode && parent.kind <= SyntaxKind.LastTypeNode) { + if (SyntaxKind.FirstTypeNode <= parent.kind && parent.kind <= SyntaxKind.LastTypeNode) { return true; } switch (parent.kind) { @@ -6840,7 +8728,7 @@ module ts { case SyntaxKind.Method: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: - return node === (parent).type; + return node === (parent).type; case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: case SyntaxKind.IndexSignature: @@ -6849,7 +8737,10 @@ module ts { return node === (parent).type; case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: - return (parent).typeArguments.indexOf(node) >= 0; + return (parent).typeArguments && (parent).typeArguments.indexOf(node) >= 0; + case SyntaxKind.TaggedTemplateExpression: + // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. + return false; } } @@ -6858,7 +8749,7 @@ module ts { function isInRightSideOfImportOrExportAssignment(node: EntityName) { while (node.parent.kind === SyntaxKind.QualifiedName) { - node = node.parent; + node = node.parent; } if (node.parent.kind === SyntaxKind.ImportDeclaration) { @@ -6892,7 +8783,7 @@ module ts { } if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; + entityName = entityName.parent; } if (isExpression(entityName)) { @@ -6905,7 +8796,7 @@ module ts { else if (entityName.kind === SyntaxKind.QualifiedName || entityName.kind === SyntaxKind.PropertyAccess) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { - checkPropertyAccess(entityName); + checkPropertyAccess(entityName); } return getNodeLinks(entityName).resolvedSymbol; } @@ -6927,15 +8818,20 @@ module ts { } function getSymbolInfo(node: Node) { + if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further + return undefined; + } + if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { // This is a declaration, call getSymbolOfNode return getSymbolOfNode(node.parent); } - if (node.kind === SyntaxKind.Identifier && isInRightSideOfImportOrExportAssignment(node)) { + if (node.kind === SyntaxKind.Identifier && isInRightSideOfImportOrExportAssignment(node)) { return node.parent.kind === SyntaxKind.ExportAssignment ? getSymbolOfEntityName(node) - : getSymbolOfPartOfRightHandSideOfImport(node); + : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { @@ -6972,18 +8868,34 @@ module ts { var objectType = checkExpression((node.parent).object); if (objectType === unknownType) return undefined; var apparentType = getApparentType(objectType); - if (apparentType === unknownType) return undefined; - return getPropertyOfApparentType(apparentType, (node).text); + if (apparentType === unknownType) return undefined; + return getPropertyOfType(apparentType, (node).text); } break; } return undefined; } + function getShorthandAssignmentValueSymbol(location: Node): Symbol { + // The function returns a value symbol of an identifier in the short-hand property assignment. + // This is necessary as an identifier in short-hand property assignment can contains two meaning: + // property name and property value. + if (location && location.kind === SyntaxKind.ShorthandPropertyAssignment) { + return resolveEntityName(location, (location).name, SymbolFlags.Value); + } + return undefined; + } + function getTypeOfNode(node: Node): Type { + if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further + return unknownType; + } + if (isExpression(node)) { return getTypeOfExpression(node); } + if (isTypeNode(node)) { return getTypeFromTypeNode(node); } @@ -6996,7 +8908,7 @@ module ts { if (isTypeDeclarationName(node)) { var symbol = getSymbolInfo(node); - return getDeclaredTypeOfSymbol(symbol); + return symbol && getDeclaredTypeOfSymbol(symbol); } if (isDeclaration(node)) { @@ -7007,12 +8919,12 @@ module ts { if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { var symbol = getSymbolInfo(node); - return getTypeOfSymbol(symbol); + return symbol && getTypeOfSymbol(symbol); } - if (isInRightSideOfImportOrExportAssignment(node)) { + if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolInfo(node); - var declaredType = getDeclaredTypeOfSymbol(symbol); + var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); } @@ -7026,45 +8938,37 @@ module ts { return checkExpression(expr); } - function getAugmentedPropertiesOfApparentType(type: Type): Symbol[]{ - var apparentType = getApparentType(type); - - if (apparentType.flags & TypeFlags.ObjectType) { - // Augment the apparent type with Function and Object members as applicable - var propertiesByName: Map = {}; - var results: Symbol[] = []; - - forEach(getPropertiesOfType(apparentType), s => { - propertiesByName[s.name] = s; - results.push(s); - }); - - var resolved = resolveObjectTypeMembers(type); - forEachValue(resolved.members, s => { - if (symbolIsValue(s) && !propertiesByName[s.name]) { - propertiesByName[s.name] = s; - results.push(s); + // Return the list of properties of the given type, augmented with properties from Function + // if the type has call or construct signatures + function getAugmentedPropertiesOfType(type: Type): Symbol[] { + var type = getApparentType(type); + var propsByName = createSymbolTable(getPropertiesOfType(type)); + if (getSignaturesOfType(type, SignatureKind.Call).length || getSignaturesOfType(type, SignatureKind.Construct).length) { + forEach(getPropertiesOfType(globalFunctionType), p => { + if (!hasProperty(propsByName, p.name)) { + propsByName[p.name] = p; } }); - - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - forEach(getPropertiesOfType(globalFunctionType), s => { - if (!propertiesByName[s.name]) { - propertiesByName[s.name] = s; - results.push(s); - } - }); - } - - return results; - } - else { - return getPropertiesOfType(apparentType); } + return getNamedMembers(propsByName); } - function getRootSymbol(symbol: Symbol) { - return (symbol.flags & SymbolFlags.Transient) ? getSymbolLinks(symbol).target : symbol; + function getRootSymbols(symbol: Symbol): Symbol[]{ + if (symbol.flags & SymbolFlags.UnionProperty) { + var symbols: Symbol[] = []; + var name = symbol.name; + forEach(getSymbolLinks(symbol).unionType.types, t => { + symbols.push(getPropertyOfType(t, name)); + }); + return symbols; + } + else if (symbol.flags & SymbolFlags.Transient) { + var target = getSymbolLinks(symbol).target; + if (target) { + return [target]; + } + } + return [symbol]; } // Emitter support @@ -7090,7 +8994,7 @@ module ts { return true; } - function getLocalNameOfContainer(container: Declaration): string { + function getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string { var links = getNodeLinks(container); if (!links.localModuleName) { var prefix = ""; @@ -7098,7 +9002,7 @@ module ts { while (!isUniqueLocalName(escapeIdentifier(prefix + name), container)) { prefix += "_"; } - links.localModuleName = prefix + getSourceTextOfNode(container.name); + links.localModuleName = prefix + getTextOfNode(container.name); } return links.localModuleName; } @@ -7107,7 +9011,7 @@ module ts { var node = location; while (node) { if ((node.kind === SyntaxKind.ModuleDeclaration || node.kind === SyntaxKind.EnumDeclaration) && getSymbolOfNode(node) === symbol) { - return getLocalNameOfContainer(node); + return getLocalNameOfContainer(node); } node = node.parent; } @@ -7132,38 +9036,42 @@ module ts { } } - function getPropertyAccessSubstitution(node: PropertyAccess): string { - var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & SymbolFlags.EnumMember)) { - var declaration = symbol.valueDeclaration; - var constantValue: number; - if (declaration.kind === SyntaxKind.EnumMember && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { - return constantValue.toString() + " /* " + identifierToString(declaration.name) + " */"; - } - } - } - function getExportAssignmentName(node: SourceFile): string { var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol): undefined; + return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol): undefined; } - function isTopLevelValueImportedViaEntityName(node: ImportDeclaration): boolean { + function isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean { if (node.parent.kind !== SyntaxKind.SourceFile || !node.entityName) { // parent is not source file or it is not reference to internal module return false; } - var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & SymbolFlags.Value) !== 0); + return isImportResolvedToValue(getSymbolOfNode(node)); } - function shouldEmitDeclarations() { - // If the declaration emit and there are no errors being reported in program or by checker - // declarations can be emitted - return program.getCompilerOptions().declaration && - !program.getDiagnostics().length && - !getDiagnostics().length; + function hasSemanticErrors() { + // Return true if there is any semantic error in a file or globally + return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; + } + + function isEmitBlocked(sourceFile?: SourceFile): boolean { + return program.getDiagnostics(sourceFile).length !== 0 || + hasEarlyErrors(sourceFile) || + (compilerOptions.noEmitOnError && getDiagnostics(sourceFile).length !== 0); + } + + function hasEarlyErrors(sourceFile?: SourceFile): boolean { + return forEach(getDiagnostics(sourceFile), d => d.isEarly); + } + + function isImportResolvedToValue(symbol: Symbol): boolean { + var target = resolveImport(symbol); + // const enums and modules that contain only const enums are not considered values from the emit perespective + return target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target); + } + + function isConstEnumOrConstEnumOnlyModule(s: Symbol): boolean { + return isConstEnumSymbol(s) || s.constEnumOnlyModule; } function isReferencedImportDeclaration(node: ImportDeclaration): boolean { @@ -7174,15 +9082,12 @@ module ts { // logic below will answer 'true' for exported import declaration in a nested module that itself is not exported. // As a consequence this might cause emitting extra. if (node.flags & NodeFlags.Export) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & SymbolFlags.Value) { - return true; - } + return isImportResolvedToValue(symbol); } return false; } - function isImplementationOfOverload(node: FunctionDeclaration) { + function isImplementationOfOverload(node: FunctionLikeDeclaration) { if (node.body) { var symbol = getSymbolOfNode(node); var signaturesOfSymbol = getSignaturesOfSymbol(symbol); @@ -7208,51 +9113,71 @@ module ts { } function getEnumMemberValue(node: EnumMember): number { + computeEnumMemberValues(node.parent); return getNodeLinks(node).enumMemberValue; } - function writeTypeAtLocation(location: Node, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: TextWriter) { + function getConstantValue(node: PropertyAccess | IndexedAccess): number { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol && (symbol.flags & SymbolFlags.EnumMember)) { + var declaration = symbol.valueDeclaration; + var constantValue: number; + if (declaration.kind === SyntaxKind.EnumMember && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + return constantValue; + } + } + + return undefined; + } + + function writeTypeAtLocation(location: Node, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) { // Get type of the symbol if this is the valid symbol otherwise get type at location var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & SymbolFlags.TypeLiteral) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + var type = symbol && !(symbol.flags & (SymbolFlags.TypeLiteral | SymbolFlags.CallSignature | SymbolFlags.ConstructSignature)) + ? getTypeOfSymbol(symbol) + : getTypeFromTypeNode(location); - writeTypeToTextWriter(type, enclosingDeclaration, flags, writer); + getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } - function writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: TextWriter) { + function writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) { var signature = getSignatureFromDeclaration(signatureDeclaration); - writeTypeToTextWriter(getReturnTypeOfSignature(signature), enclosingDeclaration, flags , writer); + getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } - function invokeEmitter() { - var resolver: EmitResolver = { + function createResolver(): EmitResolver { + return { getProgram: () => program, - getLocalNameOfContainer: getLocalNameOfContainer, - getExpressionNamePrefix: getExpressionNamePrefix, - getPropertyAccessSubstitution: getPropertyAccessSubstitution, - getExportAssignmentName: getExportAssignmentName, - isReferencedImportDeclaration: isReferencedImportDeclaration, - getNodeCheckFlags: getNodeCheckFlags, - getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, - shouldEmitDeclarations: shouldEmitDeclarations, - isDeclarationVisible: isDeclarationVisible, - isImplementationOfOverload: isImplementationOfOverload, - writeTypeAtLocation: writeTypeAtLocation, - writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, - writeSymbol: writeSymbolToTextWriter, - isSymbolAccessible: isSymbolAccessible, - isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile + getLocalNameOfContainer, + getExpressionNamePrefix, + getExportAssignmentName, + isReferencedImportDeclaration, + getNodeCheckFlags, + getEnumMemberValue, + isTopLevelValueImportWithEntityName, + hasSemanticErrors, + isEmitBlocked, + isDeclarationVisible, + isImplementationOfOverload, + writeTypeAtLocation, + writeReturnTypeOfSignatureDeclaration, + isSymbolAccessible, + isEntityNameVisible, + getConstantValue, }; + } + + function invokeEmitter(targetSourceFile?: SourceFile) { + var resolver = createResolver(); checkProgram(); - return emitFiles(resolver); + return emitFiles(resolver, targetSourceFile); } function initializeTypeChecker() { // Bind all source files and propagate errors forEach(program.getSourceFiles(), file => { bindSourceFile(file); - forEach(file.semanticErrors, addDiagnostic); + forEach(file.semanticDiagnostics, addDiagnostic); }); // Initialize global symbol table forEach(program.getSourceFiles(), file => { @@ -7274,6 +9199,12 @@ module ts { globalNumberType = getGlobalType("Number"); globalBooleanType = getGlobalType("Boolean"); globalRegExpType = getGlobalType("RegExp"); + + // If we're in ES6 mode, load the TemplateStringsArray. + // Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios. + globalTemplateStringsArrayType = compilerOptions.target >= ScriptTarget.ES6 + ? getGlobalType("TemplateStringsArray") + : unknownType; } initializeTypeChecker(); diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 0e48953eaa7..3fabf6c8588 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -24,7 +24,7 @@ module ts { type: "boolean", }, { - name: "emitBOM", + name: "emitBOM", type: "boolean" }, { @@ -54,6 +54,11 @@ module ts { paramType: Diagnostics.KIND, error: Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd }, + { + name: "noEmitOnError", + type: "boolean", + description: Diagnostics.Do_not_emit_outputs_if_any_type_checking_errors_were_reported, + }, { name: "noImplicitAny", type: "boolean", @@ -102,10 +107,10 @@ module ts { { name: "target", shortName: "t", - type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5 }, - description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5, + type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5, "es6": ScriptTarget.ES6 }, + description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: Diagnostics.VERSION, - error: Diagnostics.Argument_for_target_option_must_be_es3_or_es5 + error: Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 }, { name: "version", @@ -118,6 +123,11 @@ module ts { shortName: "w", type: "boolean", description: Diagnostics.Watch_input_files, + }, + { + name: "preserveConstEnums", + type: "boolean", + description: Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code } ]; @@ -143,9 +153,9 @@ module ts { parseStrings(commandLine); return { - options: options, - filenames: filenames, - errors: errors + options, + filenames, + errors }; function parseStrings(args: string[]) { @@ -183,9 +193,10 @@ module ts { break; // If not a primitive, the possible types are specified in what is effectively a map of options. default: - var value = (args[i++] || "").toLowerCase(); - if (hasProperty(opt.type, value)) { - options[opt.name] = opt.type[value]; + var map = >opt.type; + var key = (args[i++] || "").toLowerCase(); + if (hasProperty(map, key)) { + options[opt.name] = map[key]; } else { errors.push(createCompilerDiagnostic(opt.error)); diff --git a/src/compiler/core.ts b/src/compiler/core.ts index fbf767b91a9..6bbf9a13d03 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1,17 +1,39 @@ /// module ts { + + // Ternary values are defined such that + // x & y is False if either x or y is False. + // x & y is Maybe if either x or y is Maybe, but neither x or y is False. + // x & y is True if both x and y are True. + // x | y is False if both x and y are False. + // x | y is Maybe if either x or y is Maybe, but neither x or y is True. + // x | y is True if either x or y is True. + export const enum Ternary { + False = 0, + Maybe = 1, + True = -1 + } + export interface Map { [index: string]: T; } + export const enum Comparison { + LessThan = -1, + EqualTo = 0, + GreaterThan = 1 + } + export interface StringSet extends Map { } export function forEach(array: T[], callback: (element: T) => U): U { var result: U; if (array) { for (var i = 0, len = array.length; i < len; i++) { - if (result = callback(array[i])) break; + if (result = callback(array[i])) { + break; + } } } return result; @@ -19,8 +41,7 @@ module ts { export function contains(array: T[], value: T): boolean { if (array) { - var len = array.length; - for (var i = 0; i < len; i++) { + for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return true; } @@ -31,8 +52,7 @@ module ts { export function indexOf(array: T[], value: T): number { if (array) { - var len = array.length; - for (var i = 0; i < len; i++) { + for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return i; } @@ -41,10 +61,21 @@ module ts { return -1; } - export function filter(array: T[], f: (x: T) => boolean): T[] { - var result: T[]; + export function countWhere(array: T[], predicate: (x: T) => boolean): number { + var count = 0; if (array) { - result = []; + for (var i = 0, len = array.length; i < len; i++) { + if (predicate(array[i])) { + count++; + } + } + } + return count; + } + + export function filter(array: T[], f: (x: T) => boolean): T[] { + if (array) { + var result: T[] = []; for (var i = 0, len = array.length; i < len; i++) { var item = array[i]; if (f(item)) { @@ -56,11 +87,9 @@ module ts { } export function map(array: T[], f: (x: T) => U): U[] { - var result: U[]; if (array) { - result = []; - var len = array.length; - for (var i = 0; i < len; i++) { + var result: U[] = []; + for (var i = 0, len = array.length; i < len; i++) { result.push(f(array[i])); } } @@ -70,9 +99,21 @@ module ts { export function concatenate(array1: T[], array2: T[]): T[] { if (!array2 || !array2.length) return array1; if (!array1 || !array1.length) return array2; + return array1.concat(array2); } + export function deduplicate(array: T[]): T[] { + if (array) { + var result: T[] = []; + for (var i = 0, len = array.length; i < len; i++) { + var item = array[i]; + if (!contains(result, item)) result.push(item); + } + } + return result; + } + export function sum(array: any[], prop: string): number { var result = 0; for (var i = 0; i < array.length; i++) { @@ -81,6 +122,17 @@ module ts { return result; } + /** + * Returns the last element of an array if non-empty, undefined otherwise. + */ + export function lastOrUndefined(array: T[]): T { + if (array.length === 0) { + return undefined; + } + + return array[array.length - 1]; + } + export function binarySearch(array: number[], value: number): number { var low = 0; var high = array.length - 1; @@ -189,15 +241,16 @@ module ts { export var localizedDiagnosticMessages: Map = undefined; export function getLocaleSpecificMessage(message: string) { - if (ts.localizedDiagnosticMessages) { - message = localizedDiagnosticMessages[message]; - } - - return message; + return localizedDiagnosticMessages && localizedDiagnosticMessages[message] + ? localizedDiagnosticMessages[message] + : message; } export function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: any[]): Diagnostic; export function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage): Diagnostic { + Debug.assert(start >= 0, "start must be non-negative, is " + start); + Debug.assert(length >= 0, "length must be non-negative, is " + length); + var text = getLocaleSpecificMessage(message.key); if (arguments.length > 4) { @@ -205,13 +258,14 @@ module ts { } return { - file: file, - start: start, - length: length, + file, + start, + length, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } @@ -230,7 +284,8 @@ module ts { messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } @@ -251,7 +306,16 @@ module ts { }; } + export function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain { + Debug.assert(!headChain.next); + headChain.next = tailChain; + return headChain; + } + export function flattenDiagnosticChain(file: SourceFile, start: number, length: number, diagnosticChain: DiagnosticMessageChain, newLine: string): Diagnostic { + Debug.assert(start >= 0, "start must be non-negative, is " + start); + Debug.assert(length >= 0, "length must be non-negative, is " + length); + var code = diagnosticChain.code; var category = diagnosticChain.category; var messageText = ""; @@ -271,20 +335,20 @@ module ts { } return { - file: file, - start: start, - length: length, - code: code, - category: category, - messageText: messageText + file, + start, + length, + code, + category, + messageText }; } - export function compareValues(a: T, b: T): number { - if (a === b) return 0; - if (a === undefined) return -1; - if (b === undefined) return 1; - return a < b ? -1 : 1; + export function compareValues(a: T, b: T): Comparison { + if (a === b) return Comparison.EqualTo; + if (a === undefined) return Comparison.LessThan; + if (b === undefined) return Comparison.GreaterThan; + return a < b ? Comparison.LessThan : Comparison.GreaterThan; } function getDiagnosticFilename(diagnostic: Diagnostic): string { @@ -309,7 +373,7 @@ module ts { var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === Comparison.EqualTo; if (!isDupe) { newDiagnostics.push(currentDiagnostic); previousDiagnostic = currentDiagnostic; @@ -395,7 +459,11 @@ module ts { return normalizedPathComponents(path, rootLength); } - export function getNormalizedPathFromPathCompoments(pathComponents: string[]) { + export function getNormalizedAbsolutePath(filename: string, currentDirectory: string) { + return getNormalizedPathFromPathComponents(getNormalizedPathComponents(filename, currentDirectory)); + } + + export function getNormalizedPathFromPathComponents(pathComponents: string[]) { if (pathComponents && pathComponents.length) { return pathComponents[0] + pathComponents.slice(1).join(directorySeparator); } @@ -452,18 +520,18 @@ module ts { } } - export function getRelativePathToDirectoryOrUrl(directoryPathOrUrl: string, relativeOrAbsolutePath: string, currentDirectory: string, isAbsolutePathAnUrl: boolean) { + export function getRelativePathToDirectoryOrUrl(directoryPathOrUrl: string, relativeOrAbsolutePath: string, currentDirectory: string, getCanonicalFileName: (fileName: string) => string, isAbsolutePathAnUrl: boolean) { var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { - // If the directory path given was of type test/cases/ then we really need components of directry to be only till its name + // If the directory path given was of type test/cases/ then we really need components of directory to be only till its name // that is ["test", "cases", ""] needs to be actually ["test", "cases"] directoryComponents.length--; } // Find the component that differs for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { - if (directoryComponents[joinStartIndex] !== pathComponents[joinStartIndex]) { + if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } } @@ -482,7 +550,7 @@ module ts { } // Cant find the relative path, get the absolute path - var absolutePath = getNormalizedPathFromPathCompoments(pathComponents); + var absolutePath = getNormalizedPathFromPathComponents(pathComponents); if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { absolutePath = "file:///" + absolutePath; } @@ -509,6 +577,43 @@ module ts { return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; } + var supportedExtensions = [".d.ts", ".ts", ".js"]; + + export function removeFileExtension(path: string): string { + for (var i = 0; i < supportedExtensions.length; i++) { + var ext = supportedExtensions[i]; + + if (fileExtensionIs(path, ext)) { + return path.substr(0, path.length - ext.length); + } + } + + return path; + } + + var escapedCharsRegExp = /[\t\v\f\b\0\r\n\"\\\u2028\u2029\u0085]/g; + var escapedCharsMap: Map = { + "\t": "\\t", + "\v": "\\v", + "\f": "\\f", + "\b": "\\b", + "\0": "\\0", + "\r": "\\r", + "\n": "\\n", + "\"": "\\\"", + "\u2028": "\\u2028", // lineSeparator + "\u2029": "\\u2029", // paragraphSeparator + "\u0085": "\\u0085" // nextLine + }; + + /** NOTE: This *does not* support the full escape characters, it only supports the subset that can be used in file names + * or string literals. If the information encoded in the map changes, this needs to be revisited. */ + export function escapeString(s: string): string { + return escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, c => { + return escapedCharsMap[c] || c; + }) : s; + } + export interface ObjectAllocator { getNodeConstructor(kind: SyntaxKind): new () => Node; getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol; @@ -547,7 +652,7 @@ module ts { getSignatureConstructor: () => Signature } - export enum AssertionLevel { + export const enum AssertionLevel { None = 0, Normal = 1, Aggressive = 2, @@ -561,7 +666,7 @@ module ts { return currentAssertionLevel >= level; } - export function assert(expression: any, message?: string, verboseDebugInfo?: () => string): void { + export function assert(expression: boolean, message?: string, verboseDebugInfo?: () => string): void { if (!expression) { var verboseDebugString = ""; if (verboseDebugInfo) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index aa1b793f6ac..c877c6f9773 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -5,6 +5,7 @@ module ts { Unterminated_string_literal: { code: 1002, category: DiagnosticCategory.Error, key: "Unterminated string literal." }, Identifier_expected: { code: 1003, category: DiagnosticCategory.Error, key: "Identifier expected." }, _0_expected: { code: 1005, category: DiagnosticCategory.Error, key: "'{0}' expected." }, + A_file_cannot_have_a_reference_to_itself: { code: 1006, category: DiagnosticCategory.Error, key: "A file cannot have a reference to itself." }, Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed." }, Asterisk_Slash_expected: { code: 1010, category: DiagnosticCategory.Error, key: "'*/' expected." }, Unexpected_token: { code: 1012, category: DiagnosticCategory.Error, key: "Unexpected token." }, @@ -84,6 +85,7 @@ module ts { An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: DiagnosticCategory.Error, key: "An object literal cannot have property and accessor with the same name." }, An_export_assignment_cannot_have_modifiers: { code: 1120, category: DiagnosticCategory.Error, key: "An export assignment cannot have modifiers." }, Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: DiagnosticCategory.Error, key: "Octal literals are not allowed in strict mode." }, + A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: DiagnosticCategory.Error, key: "A tuple type element list cannot be empty." }, Variable_declaration_list_cannot_be_empty: { code: 1123, category: DiagnosticCategory.Error, key: "Variable declaration list cannot be empty." }, Digit_expected: { code: 1124, category: DiagnosticCategory.Error, key: "Digit expected." }, Hexadecimal_digit_expected: { code: 1125, category: DiagnosticCategory.Error, key: "Hexadecimal digit expected." }, @@ -112,6 +114,18 @@ module ts { Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." }, Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: DiagnosticCategory.Error, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, + var_let_or_const_expected: { code: 1152, category: DiagnosticCategory.Error, key: "'var', 'let' or 'const' expected." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: DiagnosticCategory.Error, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: DiagnosticCategory.Error, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: DiagnosticCategory.Error, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: DiagnosticCategory.Error, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, + Invalid_template_literal_expected: { code: 1158, category: DiagnosticCategory.Error, key: "Invalid template literal; expected '}'" }, + Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: DiagnosticCategory.Error, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, + Unterminated_template_literal: { code: 1160, category: DiagnosticCategory.Error, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1161, category: DiagnosticCategory.Error, key: "Unterminated regular expression literal." }, + An_object_member_cannot_be_declared_optional: { code: 1162, category: DiagnosticCategory.Error, key: "An object member cannot be declared optional." }, + yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: DiagnosticCategory.Error, key: "'yield' expression must be contained_within a generator declaration." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, @@ -132,17 +146,16 @@ module ts { Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." }, Cannot_find_global_type_0: { code: 2318, category: DiagnosticCategory.Error, key: "Cannot find global type '{0}'." }, Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: DiagnosticCategory.Error, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}':" }, - Type_0_is_not_assignable_to_type_1: { code: 2323, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, + Type_0_is_not_assignable_to_type_1: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, - Private_property_0_cannot_be_reimplemented: { code: 2325, category: DiagnosticCategory.Error, key: "Private property '{0}' cannot be reimplemented." }, - Types_of_property_0_are_incompatible_Colon: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible:" }, - Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2327, category: DiagnosticCategory.Error, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, + Types_of_property_0_are_incompatible: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible." }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: DiagnosticCategory.Error, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, + Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" }, + Index_signatures_are_incompatible: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible." }, this_cannot_be_referenced_in_a_module_body: { code: 2331, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, @@ -152,10 +165,9 @@ module ts { Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: DiagnosticCategory.Error, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: DiagnosticCategory.Error, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, Property_0_does_not_exist_on_type_1: { code: 2339, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: DiagnosticCategory.Error, key: "Only public methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_inaccessible: { code: 2341, category: DiagnosticCategory.Error, key: "Property '{0}' is inaccessible." }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}':" }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, @@ -165,7 +177,6 @@ module ts { Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." }, Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, No_best_common_type_exists_among_return_expressions: { code: 2354, category: DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, @@ -178,8 +189,6 @@ module ts { The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: DiagnosticCategory.Error, key: "Invalid left-hand side of assignment expression." }, Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: DiagnosticCategory.Error, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - No_best_common_type_exists_between_0_1_and_2: { code: 2366, category: DiagnosticCategory.Error, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, - No_best_common_type_exists_between_0_and_1: { code: 2367, category: DiagnosticCategory.Error, key: "No best common type exists between '{0}' and '{1}'." }, Type_parameter_name_cannot_be_0: { code: 2368, category: DiagnosticCategory.Error, key: "Type parameter name cannot be '{0}'" }, A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: DiagnosticCategory.Error, key: "A parameter property is only allowed in a constructor implementation." }, A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: DiagnosticCategory.Error, key: "A rest parameter must be of an array type." }, @@ -197,7 +206,7 @@ module ts { Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." }, Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: DiagnosticCategory.Error, key: "Overload signatures must all be exported or not exported." }, Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: DiagnosticCategory.Error, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_or_private: { code: 2385, category: DiagnosticCategory.Error, key: "Overload signatures must all be public or private." }, + Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: DiagnosticCategory.Error, key: "Overload signatures must all be public, private or protected." }, Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: DiagnosticCategory.Error, key: "Overload signatures must all be optional or required." }, Function_overload_must_be_static: { code: 2387, category: DiagnosticCategory.Error, key: "Function overload must be static." }, Function_overload_must_not_be_static: { code: 2388, category: DiagnosticCategory.Error, key: "Function overload must not be static." }, @@ -228,12 +237,9 @@ module ts { Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, Class_name_cannot_be_0: { code: 2414, category: DiagnosticCategory.Error, key: "Class name cannot be '{0}'" }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}':" }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}':" }, A_class_may_only_implement_another_class_or_interface: { code: 2422, category: DiagnosticCategory.Error, key: "A class may only implement another class or interface." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, @@ -241,7 +247,6 @@ module ts { Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, Interface_name_cannot_be_0: { code: 2427, category: DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" }, All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}':" }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, @@ -254,28 +259,33 @@ module ts { Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: DiagnosticCategory.Error, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" }, Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, + Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: DiagnosticCategory.Error, key: "Types have separate declarations of a private property '{0}'." }, + Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: DiagnosticCategory.Error, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, + Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: DiagnosticCategory.Error, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: DiagnosticCategory.Error, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: DiagnosticCategory.Error, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: DiagnosticCategory.Error, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: DiagnosticCategory.Error, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: DiagnosticCategory.Error, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: DiagnosticCategory.Error, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: DiagnosticCategory.Error, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" }, + An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: DiagnosticCategory.Error, key: "An AMD module cannot have multiple name assignments." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, @@ -333,6 +343,13 @@ module ts { Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: DiagnosticCategory.Error, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: DiagnosticCategory.Error, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 4084, category: DiagnosticCategory.Error, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + Index_expression_arguments_in_const_enums_must_be_of_type_string: { code: 4085, category: DiagnosticCategory.Error, key: "Index expression arguments in 'const' enums must be of type 'string'." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 4086, category: DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 4087, category: DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, @@ -347,8 +364,10 @@ module ts { Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, Watch_input_files: { code: 6005, category: DiagnosticCategory.Message, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: DiagnosticCategory.Message, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: DiagnosticCategory.Message, key: "Do not erase const enum declarations in generated code." }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: DiagnosticCategory.Message, key: "Do not emit outputs if any type checking errors were reported." }, Do_not_emit_comments_to_output: { code: 6009, category: DiagnosticCategory.Message, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" }, Print_this_message: { code: 6017, category: DiagnosticCategory.Message, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: DiagnosticCategory.Message, key: "Print the compiler's version." }, @@ -370,7 +389,7 @@ module ts { Compiler_option_0_expects_an_argument: { code: 6044, category: DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." }, Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: DiagnosticCategory.Error, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: DiagnosticCategory.Error, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: DiagnosticCategory.Error, key: "Unable to open file '{0}'." }, @@ -390,6 +409,10 @@ module ts { Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: DiagnosticCategory.Error, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, + _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, + _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: DiagnosticCategory.Error, key: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, + Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: DiagnosticCategory.Error, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index eef8da8c857..5ee797482a9 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -11,6 +11,10 @@ "category": "Error", "code": 1005 }, + "A file cannot have a reference to itself.": { + "category": "Error", + "code": 1006 + }, "Trailing comma not allowed.": { "category": "Error", "code": 1009 @@ -183,7 +187,7 @@ "category": "Error", "code": 1066 }, - "Unexpected token. A constructor, method, accessor, or property was expected." : { + "Unexpected token. A constructor, method, accessor, or property was expected.": { "category": "Error", "code": 1068 }, @@ -327,6 +331,10 @@ "category": "Error", "code": 1121 }, + "A tuple type element list cannot be empty.": { + "category": "Error", + "code": 1122 + }, "Variable declaration list cannot be empty.": { "category": "Error", "code": 1123 @@ -436,9 +444,57 @@ "code": 1149 }, "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { - "category": "Error", - "code": 1150 - }, + "category": "Error", + "code": 1150 + }, + "'var', 'let' or 'const' expected.": { + "category": "Error", + "code": 1152 + }, + "'let' declarations are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1153 + }, + "'const' declarations are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1154 + }, + "'const' declarations must be initialized": { + "category": "Error", + "code": 1155 + }, + "'const' declarations can only be declared inside a block.": { + "category": "Error", + "code": 1156 + }, + "'let' declarations can only be declared inside a block.": { + "category": "Error", + "code": 1157 + }, + "Invalid template literal; expected '}'": { + "category": "Error", + "code": 1158 + }, + "Tagged templates are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1159 + }, + "Unterminated template literal.": { + "category": "Error", + "code": 1160 + }, + "Unterminated regular expression literal.": { + "category": "Error", + "code": 1161 + }, + "An object member cannot be declared optional.": { + "category": "Error", + "code": 1162 + }, + "'yield' expression must be contained_within a generator declaration.": { + "category": "Error", + "code": 1163 + }, "Duplicate identifier '{0}'.": { "category": "Error", @@ -520,7 +576,7 @@ "category": "Error", "code": 2319 }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':": { + "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'.": { "category": "Error", "code": 2320 }, @@ -528,31 +584,27 @@ "category": "Error", "code": 2321 }, - "Type '{0}' is not assignable to type '{1}':": { - "category": "Error", - "code": 2322 - }, "Type '{0}' is not assignable to type '{1}'.": { "category": "Error", - "code": 2323 + "code": 2322 }, "Property '{0}' is missing in type '{1}'.": { "category": "Error", "code": 2324 }, - "Private property '{0}' cannot be reimplemented.": { + "Property '{0}' is private in type '{1}' but not in type '{2}'.": { "category": "Error", "code": 2325 }, - "Types of property '{0}' are incompatible:": { + "Types of property '{0}' are incompatible.": { "category": "Error", "code": 2326 }, - "Required property '{0}' cannot be reimplemented with optional property in '{1}'.": { + "Property '{0}' is optional in type '{1}' but required in type '{2}'.": { "category": "Error", "code": 2327 }, - "Types of parameters '{0}' and '{1}' are incompatible:": { + "Types of parameters '{0}' and '{1}' are incompatible.": { "category": "Error", "code": 2328 }, @@ -560,7 +612,7 @@ "category": "Error", "code": 2329 }, - "Index signatures are incompatible:": { + "Index signatures are incompatible.": { "category": "Error", "code": 2330 }, @@ -600,11 +652,11 @@ "category": "Error", "code": 2339 }, - "Only public methods of the base class are accessible via the 'super' keyword": { + "Only public and protected methods of the base class are accessible via the 'super' keyword": { "category": "Error", "code": 2340 }, - "Property '{0}' is inaccessible.": { + "Property '{0}' is private and only accessible within class '{1}'.": { "category": "Error", "code": 2341 }, @@ -612,10 +664,6 @@ "category": "Error", "code": 2342 }, - "Type '{0}' does not satisfy the constraint '{1}':": { - "category": "Error", - "code": 2343 - }, "Type '{0}' does not satisfy the constraint '{1}'.": { "category": "Error", "code": 2344 @@ -652,10 +700,6 @@ "category": "Error", "code": 2352 }, - "Neither type '{0}' nor type '{1}' is assignable to the other:": { - "category": "Error", - "code": 2353 - }, "No best common type exists among return expressions.": { "category": "Error", "code": 2354 @@ -704,14 +748,6 @@ "category": "Error", "code": 2365 }, - "No best common type exists between '{0}', '{1}', and '{2}'.": { - "category": "Error", - "code": 2366 - }, - "No best common type exists between '{0}' and '{1}'.": { - "category": "Error", - "code": 2367 - }, "Type parameter name cannot be '{0}'": { "category": "Error", "code": 2368 @@ -780,7 +816,7 @@ "category": "Error", "code": 2384 }, - "Overload signatures must all be public or private.": { + "Overload signatures must all be public, private or protected.": { "category": "Error", "code": 2385 }, @@ -904,18 +940,10 @@ "category": "Error", "code": 2415 }, - "Class '{0}' incorrectly extends base class '{1}':": { - "category": "Error", - "code": 2416 - }, "Class static side '{0}' incorrectly extends base class static side '{1}'.": { "category": "Error", "code": 2417 }, - "Class static side '{0}' incorrectly extends base class static side '{1}':": { - "category": "Error", - "code": 2418 - }, "Type name '{0}' in extends clause does not reference constructor function for '{0}'.": { "category": "Error", "code": 2419 @@ -924,10 +952,6 @@ "category": "Error", "code": 2420 }, - "Class '{0}' incorrectly implements interface '{1}':": { - "category": "Error", - "code": 2421 - }, "A class may only implement another class or interface.": { "category": "Error", "code": 2422 @@ -956,10 +980,6 @@ "category": "Error", "code": 2428 }, - "Interface '{0}' incorrectly extends interface '{1}':": { - "category": "Error", - "code": 2429 - }, "Interface '{0}' incorrectly extends interface '{1}'.": { "category": "Error", "code": 2430 @@ -1008,84 +1028,111 @@ "category": "Error", "code": 2441 }, - + "Types have separate declarations of a private property '{0}'.": { + "category": "Error", + "code": 2442 + }, + "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'.": { + "category": "Error", + "code": 2443 + }, + "Property '{0}' is protected in type '{1}' but public in type '{2}'.": { + "category": "Error", + "code": 2444 + }, + "Property '{0}' is protected and only accessible within class '{1}' and its subclasses.": { + "category": "Error", + "code": 2445 + }, + "Property '{0}' is protected and only accessible through an instance of class '{1}'.": { + "category": "Error", + "code": 2446 + }, + "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead.": { + "category": "Error", + "code": 2447 + }, + "Block-scoped variable '{0}' used before its declaration.": { + "category": "Error", + "code": 2448, + "isEarly": true + }, + "The operand of an increment or decrement operator cannot be a constant.": { + "category": "Error", + "code": 2449, + "isEarly": true + }, + "Left-hand side of assignment expression cannot be a constant.": { + "category": "Error", + "code": 2450, + "isEarly": true + }, + "Cannot redeclare block-scoped variable '{0}'.": { + "category": "Error", + "code": 2451, + "isEarly": true + }, + "An enum member cannot have a numeric name.": { + "category": "Error", + "code": 2452 + }, + "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.": { + "category": "Error", + "code": 2453 + }, + "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'.": { + "category": "Error", + "code": 2455 + }, + "Type alias '{0}' circularly references itself.": { + "category": "Error", + "code": 2456 + }, + "Type alias name cannot be '{0}'": { + "category": "Error", + "code": 2457 + }, + "An AMD module cannot have multiple name assignments.": { + "category": "Error", + "code": 2458 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", "code": 4000 }, - "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4001 - }, "Type parameter '{0}' of exported class has or is using private name '{1}'.": { "category": "Error", "code": 4002 }, - "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4003 - }, "Type parameter '{0}' of exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4004 }, - "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4005 - }, "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4006 }, - "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4007 - }, "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4008 }, - "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4009 - }, "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { "category": "Error", "code": 4010 }, - "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4011 - }, "Type parameter '{0}' of public method from exported class has or is using private name '{1}'.": { "category": "Error", "code": 4012 }, - "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4013 - }, "Type parameter '{0}' of method from exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4014 }, - "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4015 - }, "Type parameter '{0}' of exported function has or is using private name '{1}'.": { "category": "Error", "code": 4016 }, - "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4017 - }, - "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4018 - }, "Implements clause of exported class '{0}' has or is using private name '{1}'.": { "category": "Error", "code": 4019 @@ -1094,10 +1141,6 @@ "category": "Error", "code": 4020 }, - "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4021 - }, "Extends clause of exported interface '{0}' has or is using private name '{1}'.": { "category": "Error", "code": 4022 @@ -1326,8 +1369,35 @@ "category": "Error", "code": 4078 }, - - + "Exported type alias '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4081 + }, + "Enum declarations must all be const or non-const.": { + "category": "Error", + "code": 4082 + }, + "In 'const' enum declarations member initializer must be constant expression.": { + "category": "Error", + "code": 4083, + "isEarly": true + }, + "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.": { + "category": "Error", + "code": 4084 + }, + "Index expression arguments in 'const' enums must be of type 'string'.": { + "category": "Error", + "code": 4085 + }, + "'const' enum member initializer was evaluated to a non-finite value.": { + "category": "Error", + "code": 4086 + }, + "'const' enum member initializer was evaluated to disallowed value 'NaN'.": { + "category": "Error", + "code": 4087 + }, "The current host does not support the '{0}' option.": { "category": "Error", "code": 5001 @@ -1384,11 +1454,19 @@ "category": "Message", "code": 6006 }, + "Do not erase const enum declarations in generated code.": { + "category": "Message", + "code": 6007 + }, + "Do not emit outputs if any type checking errors were reported.": { + "category": "Message", + "code": 6008 + }, "Do not emit comments to output.": { "category": "Message", "code": 6009 }, - "Specify ECMAScript target version: 'ES3' (default), or 'ES5'": { + "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)": { "category": "Message", "code": 6015 }, @@ -1476,7 +1554,7 @@ "category": "Error", "code": 6046 }, - "Argument for '--target' option must be 'es3' or 'es5'.": { + "Argument for '--target' option must be 'es3', 'es5', or 'es6'.": { "category": "Error", "code": 6047 }, @@ -1557,6 +1635,22 @@ "category": "Error", "code": 7020 }, + "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.": { + "category": "Error", + "code": 7021 + }, + "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer.": { + "category": "Error", + "code": 7022 + }, + "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.": { + "category": "Error", + "code": 7023 + }, + "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.": { + "category": "Error", + "code": 7024 + }, "You cannot rename this element.": { "category": "Error", "code": 8000 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 6b18ad4c133..5cdf98aa63e 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -4,7 +4,13 @@ /// module ts { - interface EmitTextWriter extends TextWriter { + interface EmitTextWriter { + write(s: string): void; + writeTextOfNode(sourceFile: SourceFile, node: Node): void; + writeLine(): void; + increaseIndent(): void; + decreaseIndent(): void; + getText(): string; rawWrite(s: string): void; writeLiteral(s: string): void; getTextPos(): number; @@ -13,8 +19,33 @@ module ts { getIndent(): number; } + interface SymbolAccessibilityDiagnostic { + errorNode: Node; + diagnosticMessage: DiagnosticMessage; + typeName?: DeclarationName; + } + type GetSymbolAccessibilityDiagnostic = (symbolAccesibilityResult: SymbolAccessiblityResult) => SymbolAccessibilityDiagnostic; + + interface EmitTextWriterWithSymbolWriter extends EmitTextWriter, SymbolWriter { + getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic; + } + + interface AliasDeclarationEmitInfo { + declaration: ImportDeclaration; + outputPos: number; + indent: number; + asynchronousOutput?: string; // If the output for alias was written asynchronously, the corresponding output + } + + interface DeclarationEmit { + reportedDeclarationError: boolean; + aliasDeclarationEmitInfo: AliasDeclarationEmitInfo[]; + synchronousDeclarationOutput: string; + referencePathsOutput: string; + } + var indentStrings: string[] = ["", " "]; - function getIndentString(level: number) { + export function getIndentString(level: number) { if (indentStrings[level] === undefined) { indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; } @@ -25,7 +56,1397 @@ module ts { return indentStrings[1].length; } - export function emitFiles(resolver: EmitResolver): EmitResult { + export function shouldEmitToOwnFile(sourceFile: SourceFile, compilerOptions: CompilerOptions): boolean { + if (!isDeclarationFile(sourceFile)) { + if ((isExternalModule(sourceFile) || !compilerOptions.out) && !fileExtensionIs(sourceFile.filename, ".js")) { + return true; + } + return false; + } + return false; + } + + export function isExternalModuleOrDeclarationFile(sourceFile: SourceFile) { + return isExternalModule(sourceFile) || isDeclarationFile(sourceFile); + } + + function createTextWriter(newLine: String): EmitTextWriter { + var output = ""; + var indent = 0; + var lineStart = true; + var lineCount = 0; + var linePos = 0; + + function write(s: string) { + if (s && s.length) { + if (lineStart) { + output += getIndentString(indent); + lineStart = false; + } + output += s; + } + } + + function rawWrite(s: string) { + if (s !== undefined) { + if (lineStart) { + lineStart = false; + } + output += s; + } + } + + function writeLiteral(s: string) { + if (s && s.length) { + write(s); + var lineStartsOfS = computeLineStarts(s); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + } + } + } + + function writeLine() { + if (!lineStart) { + output += newLine; + lineCount++; + linePos = output.length; + lineStart = true; + } + } + + function writeTextOfNode(sourceFile: SourceFile, node: Node) { + write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + } + + return { + write, + rawWrite, + writeTextOfNode, + writeLiteral, + writeLine, + increaseIndent: () => indent++, + decreaseIndent: () => indent--, + getIndent: () => indent, + getTextPos: () => output.length, + getLine: () => lineCount + 1, + getColumn: () => lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1, + getText: () => output, + }; + } + + function getLineOfLocalPosition(currentSourceFile: SourceFile, pos: number) { + return currentSourceFile.getLineAndCharacterFromPosition(pos).line; + } + + function emitNewLineBeforeLeadingComments(currentSourceFile: SourceFile, writer: EmitTextWriter, node: TextRange, leadingComments: CommentRange[]) { + // If the leading comments start on different line than the start of node, write new line + if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && + getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + writer.writeLine(); + } + } + + function emitComments(currentSourceFile: SourceFile, writer: EmitTextWriter, comments: CommentRange[], trailingSeparator: boolean, newLine: string, + writeComment: (currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string) => void) { + var emitLeadingSpace = !trailingSeparator; + forEach(comments, comment => { + if (emitLeadingSpace) { + writer.write(" "); + emitLeadingSpace = false; + } + writeComment(currentSourceFile, writer, comment, newLine); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + else if (trailingSeparator) { + writer.write(" "); + } + else { + // Emit leading space to separate comment during next comment emit + emitLeadingSpace = true; + } + }); + } + + function writeCommentRange(currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string){ + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk) { + var firstCommentLineAndCharacter = currentSourceFile.getLineAndCharacterFromPosition(comment.pos); + var firstCommentLineIndent: number; + for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { + var nextLineStart = currentSourceFile.getPositionFromLineAndCharacter(currentLine + 1, /*character*/1); + + if (pos !== comment.pos) { + // If we are not emitting first line, we need to write the spaces to adjust the alignment + if (firstCommentLineIndent === undefined) { + firstCommentLineIndent = calculateIndent(currentSourceFile.getPositionFromLineAndCharacter(firstCommentLineAndCharacter.line, /*character*/1), + comment.pos); + } + + // These are number of spaces writer is going to write at current indent + var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + + // Number of spaces we want to be writing + // eg: Assume writer indent + // module m { + // /* starts at character 9 this is line 1 + // * starts at character pos 4 line --1 = 8 - 8 + 3 + // More left indented comment */ --2 = 8 - 8 + 2 + // class c { } + // } + // module m { + // /* this is line 1 -- Assume current writer indent 8 + // * line --3 = 8 - 4 + 5 + // More right indented comment */ --4 = 8 - 4 + 11 + // class c { } + // } + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + if (spacesToEmit > 0) { + var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); + var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + + // Write indent size string ( in eg 1: = "", 2: "" , 3: string with 8 spaces 4: string with 12 spaces + writer.rawWrite(indentSizeSpaceString); + + // Emit the single spaces (in eg: 1: 3 spaces, 2: 2 spaces, 3: 1 space, 4: 3 spaces) + while (numberOfSingleSpacesToEmit) { + writer.rawWrite(" "); + numberOfSingleSpacesToEmit--; + } + } + else { + // No spaces to emit write empty string + writer.rawWrite(""); + } + } + + // Write the comment line text + writeTrimmedCurrentLine(pos, nextLineStart); + + pos = nextLineStart; + } + } + else { + // Single line comment of style //.... + writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); + } + + function writeTrimmedCurrentLine(pos: number, nextLineStart: number) { + var end = Math.min(comment.end, nextLineStart - 1); + var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); + if (currentLineText) { + // trimmed forward and ending spaces text + writer.write(currentLineText); + if (end !== comment.end) { + writer.writeLine(); + } + } + else { + // Empty string - make sure we write empty line + writer.writeLiteral(newLine); + } + } + + function calculateIndent(pos: number, end: number) { + var currentLineIndent = 0; + for (; pos < end && isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { + if (currentSourceFile.text.charCodeAt(pos) === CharacterCodes.tab) { + // Tabs = TabSize = indent size and go to next tabStop + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + // Single space + currentLineIndent++; + } + } + + return currentLineIndent; + } + } + + function getFirstConstructorWithBody(node: ClassDeclaration): ConstructorDeclaration { + return forEach(node.members, member => { + if (member.kind === SyntaxKind.Constructor && (member).body) { + return member; + } + }); + } + + function getAllAccessorDeclarations(node: ClassDeclaration, accessor: AccessorDeclaration) { + var firstAccessor: AccessorDeclaration; + var getAccessor: AccessorDeclaration; + var setAccessor: AccessorDeclaration; + forEach(node.members, (member: Declaration) => { + // TODO(jfreeman): Handle computed names for accessor matching + if ((member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) && + (member.name).text === (accessor.name).text && + (member.flags & NodeFlags.Static) === (accessor.flags & NodeFlags.Static)) { + if (!firstAccessor) { + firstAccessor = member; + } + + if (member.kind === SyntaxKind.GetAccessor && !getAccessor) { + getAccessor = member; + } + + if (member.kind === SyntaxKind.SetAccessor && !setAccessor) { + setAccessor = member; + } + } + }); + return { + firstAccessor, + getAccessor, + setAccessor + }; + } + + function getSourceFilePathInNewDir(sourceFile: SourceFile, program: Program, newDirPath: string) { + var compilerHost = program.getCompilerHost(); + var sourceFilePath = getNormalizedAbsolutePath(sourceFile.filename, compilerHost.getCurrentDirectory()); + sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); + return combinePaths(newDirPath, sourceFilePath); + } + + function getOwnEmitOutputFilePath(sourceFile: SourceFile, program: Program, extension: string){ + var compilerOptions = program.getCompilerOptions(); + if (compilerOptions.outDir) { + var emitOutputFilePathWithoutExtension = removeFileExtension(getSourceFilePathInNewDir(sourceFile, program, compilerOptions.outDir)); + } + else { + var emitOutputFilePathWithoutExtension = removeFileExtension(sourceFile.filename); + } + + return emitOutputFilePathWithoutExtension + extension; + } + + function writeFile(compilerHost: CompilerHost, diagnostics: Diagnostic[], filename: string, data: string, writeByteOrderMark: boolean) { + compilerHost.writeFile(filename, data, writeByteOrderMark, hostErrorMessage => { + diagnostics.push(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, filename, hostErrorMessage)); + }); + } + + function emitDeclarations(program: Program, resolver: EmitResolver, diagnostics: Diagnostic[], jsFilePath: string, root?: SourceFile): DeclarationEmit { + var newLine = program.getCompilerHost().getNewLine(); + var compilerOptions = program.getCompilerOptions(); + var compilerHost = program.getCompilerHost(); + + var write: (s: string) => void; + var writeLine: () => void; + var increaseIndent: () => void; + var decreaseIndent: () => void; + var writeTextOfNode: (sourceFile: SourceFile, node: Node) => void; + + var writer = createAndSetNewTextWriterWithSymbolWriter(); + + var enclosingDeclaration: Node; + var currentSourceFile: SourceFile; + var reportedDeclarationError = false; + + var emitJsDocComments = compilerOptions.removeComments ? function (declaration: Declaration) { } : writeJsDocComments; + + var aliasDeclarationEmitInfo: AliasDeclarationEmitInfo[] = []; + + function createAndSetNewTextWriterWithSymbolWriter(): EmitTextWriterWithSymbolWriter { + var writer = createTextWriter(newLine); + writer.trackSymbol = trackSymbol; + writer.writeKeyword = writer.write; + writer.writeOperator = writer.write; + writer.writePunctuation = writer.write; + writer.writeSpace = writer.write; + writer.writeStringLiteral = writer.writeLiteral; + writer.writeParameter = writer.write; + writer.writeSymbol = writer.write; + setWriter(writer); + return writer; + } + + function setWriter(newWriter: EmitTextWriterWithSymbolWriter) { + writer = newWriter; + write = newWriter.write; + writeTextOfNode = newWriter.writeTextOfNode; + writeLine = newWriter.writeLine; + increaseIndent = newWriter.increaseIndent; + decreaseIndent = newWriter.decreaseIndent; + } + + function writeAsychronousImportDeclarations(importDeclarations: ImportDeclaration[]) { + var oldWriter = writer; + forEach(importDeclarations, aliasToWrite => { + var aliasEmitInfo = forEach(aliasDeclarationEmitInfo, declEmitInfo => declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined); + // If the alias was marked as not visible when we saw its declaration, we would have saved the aliasEmitInfo, but if we haven't yet visited the alias declaration + // then we don't need to write it at this point. We will write it when we actually see its declaration + // Eg. + // export function bar(a: foo.Foo) { } + // import foo = require("foo"); + // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, + // we would write alias foo declaration when we visit it since it would now be marked as visible + if (aliasEmitInfo) { + createAndSetNewTextWriterWithSymbolWriter(); + for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { + increaseIndent(); + } + writeImportDeclaration(aliasToWrite); + aliasEmitInfo.asynchronousOutput = writer.getText(); + } + }); + setWriter(oldWriter); + } + + function handleSymbolAccessibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { + if (symbolAccesibilityResult.accessibility === SymbolAccessibility.Accessible) { + // write the aliases + if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { + writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); + } + } + else { + // Report error + reportedDeclarationError = true; + var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); + if (errorInfo) { + if (errorInfo.typeName) { + diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, + errorInfo.diagnosticMessage, + getSourceTextOfNodeFromSourceFile(currentSourceFile, errorInfo.typeName), + symbolAccesibilityResult.errorSymbolName, + symbolAccesibilityResult.errorModuleName)); + } + else { + diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, + errorInfo.diagnosticMessage, + symbolAccesibilityResult.errorSymbolName, + symbolAccesibilityResult.errorModuleName)); + } + } + } + } + + function trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) { + handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning)); + } + + function writeTypeAtLocation(location: Node, type: TypeNode, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; + write(": "); + if (type) { + // Write the type + emitType(type); + } + else { + resolver.writeTypeAtLocation(location, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + } + } + + function writeReturnTypeAtSignature(signature: SignatureDeclaration, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; + write(": "); + if (signature.type) { + // Write the type + emitType(signature.type); + } + else { + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + } + } + + function emitLines(nodes: Node[]) { + for (var i = 0, n = nodes.length; i < n; i++) { + emitNode(nodes[i]); + } + } + + function emitSeparatedList(nodes: Node[], separator: string, eachNodeEmitFn: (node: Node) => void) { + var currentWriterPos = writer.getTextPos(); + for (var i = 0, n = nodes.length; i < n; i++) { + if (currentWriterPos !== writer.getTextPos()) { + write(separator); + } + currentWriterPos = writer.getTextPos(); + eachNodeEmitFn(nodes[i]); + } + } + + function emitCommaList(nodes: Node[], eachNodeEmitFn: (node: Node) => void) { + emitSeparatedList(nodes, ", ", eachNodeEmitFn); + } + + function writeJsDocComments(declaration: Declaration) { + if (declaration) { + var jsDocComments = getJsDocComments(declaration, currentSourceFile); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + // jsDoc comments are emitted at /*leading comment1 */space/*leading comment*/space + emitComments(currentSourceFile, writer, jsDocComments, /*trailingSeparator*/ true, newLine, writeCommentRange); + } + } + + function emitTypeWithNewGetSymbolAccessibilityDiangostic(type: TypeNode, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; + emitType(type); + } + + function emitType(type: TypeNode) { + switch (type.kind) { + case SyntaxKind.AnyKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.StringLiteral: + return writeTextOfNode(currentSourceFile, type); + case SyntaxKind.TypeReference: + return emitTypeReference(type); + case SyntaxKind.TypeQuery: + return emitTypeQuery(type); + case SyntaxKind.ArrayType: + return emitArrayType(type); + case SyntaxKind.TupleType: + return emitTupleType(type); + case SyntaxKind.UnionType: + return emitUnionType(type); + case SyntaxKind.ParenType: + return emitParenType(type); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: + return emitSignatureDeclarationWithJsDocComments(type); + case SyntaxKind.TypeLiteral: + return emitTypeLiteral(type); + case SyntaxKind.Identifier: + return emitEntityName(type); + case SyntaxKind.QualifiedName: + return emitEntityName(type); + default: + Debug.fail("Unknown type annotation: " + type.kind); + } + + function emitEntityName(entityName: EntityName) { + var visibilityResult = resolver.isEntityNameVisible(entityName, + // Aliases can be written asynchronously so use correct enclosing declaration + entityName.parent.kind === SyntaxKind.ImportDeclaration ? entityName.parent : enclosingDeclaration); + + handleSymbolAccessibilityError(visibilityResult); + writeEntityName(entityName); + + function writeEntityName(entityName: EntityName) { + if (entityName.kind === SyntaxKind.Identifier) { + writeTextOfNode(currentSourceFile, entityName); + } + else { + var qualifiedName = entityName; + writeEntityName(qualifiedName.left); + write("."); + writeTextOfNode(currentSourceFile, qualifiedName.right); + } + } + } + + function emitTypeReference(type: TypeReferenceNode) { + emitEntityName(type.typeName); + if (type.typeArguments) { + write("<"); + emitCommaList(type.typeArguments, emitType); + write(">"); + } + } + + function emitTypeQuery(type: TypeQueryNode) { + write("typeof "); + emitEntityName(type.exprName); + } + + function emitArrayType(type: ArrayTypeNode) { + emitType(type.elementType); + write("[]"); + } + + function emitTupleType(type: TupleTypeNode) { + write("["); + emitCommaList(type.elementTypes, emitType); + write("]"); + } + + function emitUnionType(type: UnionTypeNode) { + emitSeparatedList(type.types, " | ", emitType); + } + + function emitParenType(type: ParenTypeNode) { + write("("); + emitType(type.type); + write(")"); + } + + function emitTypeLiteral(type: TypeLiteralNode) { + write("{"); + if (type.members.length) { + writeLine(); + increaseIndent(); + // write members + emitLines(type.members); + decreaseIndent(); + } + write("}"); + } + } + + function emitSourceFile(node: SourceFile) { + currentSourceFile = node; + enclosingDeclaration = node; + emitLines(node.statements); + } + + function emitExportAssignment(node: ExportAssignment) { + write("export = "); + writeTextOfNode(currentSourceFile, node.exportName); + write(";"); + writeLine(); + } + + function emitModuleElementDeclarationFlags(node: Declaration) { + // If the node is parented in the current source file we need to emit export declare or just export + if (node.parent === currentSourceFile) { + // If the node is exported + if (node.flags & NodeFlags.Export) { + write("export "); + } + + if (node.kind !== SyntaxKind.InterfaceDeclaration) { + write("declare "); + } + } + } + + function emitClassMemberDeclarationFlags(node: Declaration) { + if (node.flags & NodeFlags.Private) { + write("private "); + } + else if (node.flags & NodeFlags.Protected) { + write("protected "); + } + + if (node.flags & NodeFlags.Static) { + write("static "); + } + } + + function emitImportDeclaration(node: ImportDeclaration) { + var nodeEmitInfo = { + declaration: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + hasWritten: resolver.isDeclarationVisible(node) + }; + aliasDeclarationEmitInfo.push(nodeEmitInfo); + if (nodeEmitInfo.hasWritten) { + writeImportDeclaration(node); + } + } + + function writeImportDeclaration(node: ImportDeclaration) { + // note usage of writer. methods instead of aliases created, just to make sure we are using + // correct writer especially to handle asynchronous alias writing + emitJsDocComments(node); + if (node.flags & NodeFlags.Export) { + write("export "); + } + write("import "); + writeTextOfNode(currentSourceFile, node.name); + write(" = "); + if (node.entityName) { + emitTypeWithNewGetSymbolAccessibilityDiangostic(node.entityName, getImportEntityNameVisibilityError); + write(";"); + } + else { + write("require("); + writeTextOfNode(currentSourceFile, node.externalModuleName); + write(");"); + } + writer.writeLine(); + + function getImportEntityNameVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + return { + diagnosticMessage: Diagnostics.Import_declaration_0_is_using_private_name_1, + errorNode: node, + typeName: node.name + }; + } + } + + function emitModuleDeclaration(node: ModuleDeclaration) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("module "); + writeTextOfNode(currentSourceFile, node.name); + while (node.body.kind !== SyntaxKind.ModuleBlock) { + node = node.body; + write("."); + writeTextOfNode(currentSourceFile, node.name); + } + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + write(" {"); + writeLine(); + increaseIndent(); + emitLines((node.body).statements); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; + } + } + + function emitTypeAliasDeclaration(node: TypeAliasDeclaration) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("type "); + writeTextOfNode(currentSourceFile, node.name); + write(" = "); + emitTypeWithNewGetSymbolAccessibilityDiangostic(node.type, getTypeAliasDeclarationVisibilityError); + write(";"); + writeLine(); + } + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + return { + diagnosticMessage: Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, + errorNode: node.type, + typeName: node.name + }; + } + } + + function emitEnumDeclaration(node: EnumDeclaration) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (isConst(node)) { + write("const ") + } + write("enum "); + writeTextOfNode(currentSourceFile, node.name); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + } + } + + function emitEnumMemberDeclaration(node: EnumMember) { + emitJsDocComments(node); + writeTextOfNode(currentSourceFile, node.name); + var enumMemberValue = resolver.getEnumMemberValue(node); + if (enumMemberValue !== undefined) { + write(" = "); + write(enumMemberValue.toString()); + } + write(","); + writeLine(); + } + + function emitTypeParameters(typeParameters: TypeParameterDeclaration[]) { + function emitTypeParameter(node: TypeParameterDeclaration) { + increaseIndent(); + emitJsDocComments(node); + decreaseIndent(); + writeTextOfNode(currentSourceFile, node.name); + // If there is constraint present and this is not a type parameter of the private method emit the constraint + if (node.constraint && (node.parent.kind !== SyntaxKind.Method || !(node.parent.flags & NodeFlags.Private))) { + write(" extends "); + if (node.parent.kind === SyntaxKind.FunctionType || + node.parent.kind === SyntaxKind.ConstructorType || + (node.parent.parent && node.parent.parent.kind === SyntaxKind.TypeLiteral)) { + Debug.assert(node.parent.kind === SyntaxKind.Method || + node.parent.kind === SyntaxKind.FunctionType || + node.parent.kind === SyntaxKind.ConstructorType || + node.parent.kind === SyntaxKind.CallSignature || + node.parent.kind === SyntaxKind.ConstructSignature); + emitType(node.constraint); + } + else { + emitTypeWithNewGetSymbolAccessibilityDiangostic(node.constraint, getTypeParameterConstraintVisibilityError); + } + } + + function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + // Type parameter constraints are named by user so we should always be able to name it + var diagnosticMessage: DiagnosticMessage; + switch (node.parent.kind) { + case SyntaxKind.ClassDeclaration: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; + break; + + case SyntaxKind.InterfaceDeclaration: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; + break; + + case SyntaxKind.ConstructSignature: + diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + + case SyntaxKind.CallSignature: + diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + + case SyntaxKind.Method: + if (node.parent.flags & NodeFlags.Static) { + diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + } + else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { + diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } + else { + diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + } + break; + + case SyntaxKind.FunctionDeclaration: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; + break; + + default: + Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); + } + + return { + diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } + + if (typeParameters) { + write("<"); + emitCommaList(typeParameters, emitTypeParameter); + write(">"); + } + } + + function emitHeritageClause(typeReferences: TypeReferenceNode[], isImplementsList: boolean) { + if (typeReferences) { + write(isImplementsList ? " implements " : " extends "); + emitCommaList(typeReferences, emitTypeOfTypeReference); + } + + function emitTypeOfTypeReference(node: Node) { + emitTypeWithNewGetSymbolAccessibilityDiangostic(node, getHeritageClauseVisibilityError); + + function getHeritageClauseVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + var diagnosticMessage: DiagnosticMessage; + // Heritage clause is written by user so it can always be named + if (node.parent.kind === SyntaxKind.ClassDeclaration) { + // Class or Interface implemented/extended is inaccessible + diagnosticMessage = isImplementsList ? + Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : + Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + } + else { + // interface is inaccessible + diagnosticMessage = Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; + } + + return { + diagnosticMessage, + errorNode: node, + typeName: (node.parent).name + }; + } + } + } + + function emitClassDeclaration(node: ClassDeclaration) { + function emitParameterProperties(constructorDeclaration: ConstructorDeclaration) { + if (constructorDeclaration) { + forEach(constructorDeclaration.parameters, param => { + if (param.flags & NodeFlags.AccessibilityModifier) { + emitPropertyDeclaration(param); + } + }); + } + } + + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("class "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + if (node.baseType) { + emitHeritageClause([node.baseType], /*isImplementsList*/ false); + } + emitHeritageClause(node.implementedTypes, /*isImplementsList*/ true); + write(" {"); + writeLine(); + increaseIndent(); + emitParameterProperties(getFirstConstructorWithBody(node)); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; + } + } + + function emitInterfaceDeclaration(node: InterfaceDeclaration) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("interface "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + emitHeritageClause(node.baseTypes, /*isImplementsList*/ false); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; + } + } + + function emitPropertyDeclaration(node: PropertyDeclaration) { + emitJsDocComments(node); + emitClassMemberDeclarationFlags(node); + emitVariableDeclaration(node); + write(";"); + writeLine(); + } + + // TODO(jfreeman): Factor out common part of property definition, but treat name differently + function emitVariableDeclaration(node: VariableDeclaration) { + // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted + // so there is no check needed to see if declaration is visible + if (node.kind !== SyntaxKind.VariableDeclaration || resolver.isDeclarationVisible(node)) { + writeTextOfNode(currentSourceFile, node.name); + // If optional property emit ? + if (node.kind === SyntaxKind.Property && (node.flags & NodeFlags.QuestionMark)) { + write("?"); + } + if (node.kind === SyntaxKind.Property && node.parent.kind === SyntaxKind.TypeLiteral) { + emitTypeOfVariableDeclarationFromTypeLiteral(node); + } + else if (!(node.flags & NodeFlags.Private)) { + writeTypeAtLocation(node, node.type, getVariableDeclarationTypeVisibilityError); + } + } + + function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + var diagnosticMessage: DiagnosticMessage; + if (node.kind === SyntaxKind.VariableDeclaration) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; + } + // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit + else if (node.kind === SyntaxKind.Property) { + // TODO(jfreeman): Deal with computed properties in error reporting. + if (node.flags & NodeFlags.Static) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; + } + else if (node.parent.kind === SyntaxKind.ClassDeclaration) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + } + else { + // Interfaces cannot have types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + } + } + + return diagnosticMessage !== undefined ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : undefined; + } + } + + function emitTypeOfVariableDeclarationFromTypeLiteral(node: VariableDeclaration) { + // if this is property of type literal, + // or is parameter of method/call/construct/index signature of type literal + // emit only if type is specified + if (node.type) { + write(": "); + emitType(node.type); + } + } + + function emitVariableStatement(node: VariableStatement) { + var hasDeclarationWithEmit = forEach(node.declarations, varDeclaration => resolver.isDeclarationVisible(varDeclaration)); + if (hasDeclarationWithEmit) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (isLet(node)) { + write("let "); + } + else if (isConst(node)) { + write("const "); + } + else { + write("var "); + } + emitCommaList(node.declarations, emitVariableDeclaration); + write(";"); + writeLine(); + } + } + + function emitAccessorDeclaration(node: AccessorDeclaration) { + var accessors = getAllAccessorDeclarations(node.parent, node); + if (node === accessors.firstAccessor) { + emitJsDocComments(accessors.getAccessor); + emitJsDocComments(accessors.setAccessor); + emitClassMemberDeclarationFlags(node); + writeTextOfNode(currentSourceFile, node.name); + if (!(node.flags & NodeFlags.Private)) { + var accessorWithTypeAnnotation: AccessorDeclaration = node; + var type = getTypeAnnotationFromAccessor(node); + if (!type) { + // couldn't get type for the first accessor, try the another one + var anotherAccessor = node.kind === SyntaxKind.GetAccessor ? accessors.setAccessor : accessors.getAccessor; + type = getTypeAnnotationFromAccessor(anotherAccessor); + if (type) { + accessorWithTypeAnnotation = anotherAccessor; + } + } + writeTypeAtLocation(node, type, getAccessorDeclarationTypeVisibilityError); + } + write(";"); + writeLine(); + } + + function getTypeAnnotationFromAccessor(accessor: AccessorDeclaration): TypeNode { + if (accessor) { + return accessor.kind === SyntaxKind.GetAccessor ? + accessor.type : // Getter - return type + accessor.parameters[0].type; // Setter parameter type + } + } + + function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + var diagnosticMessage: DiagnosticMessage; + if (accessorWithTypeAnnotation.kind === SyntaxKind.SetAccessor) { + // Setters have to have type named and cannot infer it so, the type should always be named + if (accessorWithTypeAnnotation.parent.flags & NodeFlags.Static) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; + } + return { + diagnosticMessage, + errorNode: accessorWithTypeAnnotation.parameters[0], + // TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name + typeName: accessorWithTypeAnnotation.name + }; + } + else { + if (accessorWithTypeAnnotation.flags & NodeFlags.Static) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : + Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : + Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; + } + return { + diagnosticMessage, + errorNode: accessorWithTypeAnnotation.name, + typeName: undefined + }; + } + } + } + + function emitFunctionDeclaration(node: FunctionLikeDeclaration) { + // If we are emitting Method/Constructor it isn't moduleElement and hence already determined to be emitting + // so no need to verify if the declaration is visible + if ((node.kind !== SyntaxKind.FunctionDeclaration || resolver.isDeclarationVisible(node)) && + !resolver.isImplementationOfOverload(node)) { + emitJsDocComments(node); + if (node.kind === SyntaxKind.FunctionDeclaration) { + emitModuleElementDeclarationFlags(node); + } + else if (node.kind === SyntaxKind.Method) { + emitClassMemberDeclarationFlags(node); + } + if (node.kind === SyntaxKind.FunctionDeclaration) { + write("function "); + writeTextOfNode(currentSourceFile, node.name); + } + else if (node.kind === SyntaxKind.Constructor) { + write("constructor"); + } + else { + writeTextOfNode(currentSourceFile, node.name); + if (node.flags & NodeFlags.QuestionMark) { + write("?"); + } + } + emitSignatureDeclaration(node); + } + } + + function emitSignatureDeclarationWithJsDocComments(node: SignatureDeclaration) { + emitJsDocComments(node); + emitSignatureDeclaration(node); + } + + function emitSignatureDeclaration(node: SignatureDeclaration) { + // Construct signature or constructor type write new Signature + if (node.kind === SyntaxKind.ConstructSignature || node.kind === SyntaxKind.ConstructorType) { + write("new "); + } + emitTypeParameters(node.typeParameters); + if (node.kind === SyntaxKind.IndexSignature) { + write("["); + } + else { + write("("); + } + + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + + // Parameters + emitCommaList(node.parameters, emitParameterDeclaration); + + if (node.kind === SyntaxKind.IndexSignature) { + write("]"); + } + else { + write(")"); + } + + // If this is not a constructor and is not private, emit the return type + var isFunctionTypeOrConstructorType = node.kind === SyntaxKind.FunctionType || node.kind === SyntaxKind.ConstructorType; + if (isFunctionTypeOrConstructorType || node.parent.kind === SyntaxKind.TypeLiteral) { + // Emit type literal signature return type only if specified + if (node.type) { + write(isFunctionTypeOrConstructorType ? " => " : ": "); + emitType(node.type); + } + } + else if (node.kind !== SyntaxKind.Constructor && !(node.flags & NodeFlags.Private)) { + writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); + } + + enclosingDeclaration = prevEnclosingDeclaration; + + if (!isFunctionTypeOrConstructorType) { + write(";"); + writeLine(); + } + + function getReturnTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + var diagnosticMessage: DiagnosticMessage; + switch (node.kind) { + case SyntaxKind.ConstructSignature: + // Interfaces cannot have return types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + + case SyntaxKind.CallSignature: + // Interfaces cannot have return types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + + case SyntaxKind.IndexSignature: + // Interfaces cannot have return types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + + case SyntaxKind.Method: + if (node.flags & NodeFlags.Static) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : + Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; + } + else if (node.parent.kind === SyntaxKind.ClassDeclaration) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : + Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; + } + else { + // Interfaces cannot have return types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; + } + break; + + case SyntaxKind.FunctionDeclaration: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : + Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; + break; + + default: + Debug.fail("This is unknown kind for signature: " + node.kind); + } + + return { + diagnosticMessage, + errorNode: node.name || node, + }; + } + } + + function emitParameterDeclaration(node: ParameterDeclaration) { + increaseIndent(); + emitJsDocComments(node); + if (node.flags & NodeFlags.Rest) { + write("..."); + } + writeTextOfNode(currentSourceFile, node.name); + if (node.initializer || (node.flags & NodeFlags.QuestionMark)) { + write("?"); + } + decreaseIndent(); + + if (node.parent.kind === SyntaxKind.FunctionType || + node.parent.kind === SyntaxKind.ConstructorType || + node.parent.parent.kind === SyntaxKind.TypeLiteral) { + emitTypeOfVariableDeclarationFromTypeLiteral(node); + } + else if (!(node.parent.flags & NodeFlags.Private)) { + writeTypeAtLocation(node, node.type, getParameterDeclarationTypeVisibilityError); + } + + function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + var diagnosticMessage: DiagnosticMessage; + switch (node.parent.kind) { + case SyntaxKind.Constructor: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; + break; + + case SyntaxKind.ConstructSignature: + // Interfaces cannot have parameter types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + + case SyntaxKind.CallSignature: + // Interfaces cannot have parameter types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + + case SyntaxKind.Method: + if (node.parent.flags & NodeFlags.Static) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + } + else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } + else { + // Interfaces cannot have parameter types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + } + break; + + case SyntaxKind.FunctionDeclaration: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; + break; + + default: + Debug.fail("This is unknown parent for parameter: " + node.parent.kind); + } + + return { + diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } + + function emitNode(node: Node) { + switch (node.kind) { + case SyntaxKind.Constructor: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + return emitFunctionDeclaration(node); + case SyntaxKind.ConstructSignature: + case SyntaxKind.CallSignature: + case SyntaxKind.IndexSignature: + return emitSignatureDeclarationWithJsDocComments(node); + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return emitAccessorDeclaration(node); + case SyntaxKind.VariableStatement: + return emitVariableStatement(node); + case SyntaxKind.Property: + return emitPropertyDeclaration(node); + case SyntaxKind.InterfaceDeclaration: + return emitInterfaceDeclaration(node); + case SyntaxKind.ClassDeclaration: + return emitClassDeclaration(node); + case SyntaxKind.TypeAliasDeclaration: + return emitTypeAliasDeclaration(node); + case SyntaxKind.EnumMember: + return emitEnumMemberDeclaration(node); + case SyntaxKind.EnumDeclaration: + return emitEnumDeclaration(node); + case SyntaxKind.ModuleDeclaration: + return emitModuleDeclaration(node); + case SyntaxKind.ImportDeclaration: + return emitImportDeclaration(node); + case SyntaxKind.ExportAssignment: + return emitExportAssignment(node); + case SyntaxKind.SourceFile: + return emitSourceFile(node); + } + } + + // Contains the reference paths that needs to go in the declaration file. + // Collecting this separately because reference paths need to be first thing in the declaration file + // and we could be collecting these paths from multiple files into single one with --out option + var referencePathsOutput = ""; + function writeReferencePath(referencedFile: SourceFile) { + var declFileName = referencedFile.flags & NodeFlags.DeclarationFile + ? referencedFile.filename // Declaration file, use declaration file name + : shouldEmitToOwnFile(referencedFile, compilerOptions) + ? getOwnEmitOutputFilePath(referencedFile, program, ".d.ts") // Own output file so get the .d.ts file + : removeFileExtension(compilerOptions.out) + ".d.ts";// Global out file + + declFileName = getRelativePathToDirectoryOrUrl( + getDirectoryPath(normalizeSlashes(jsFilePath)), + declFileName, + compilerHost.getCurrentDirectory(), + compilerHost.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ false); + + referencePathsOutput += "/// " + newLine; + } + + if (root) { + // Emitting just a single file, so emit references in this file only + if (!compilerOptions.noResolve) { + var addedGlobalFileReference = false; + forEach(root.referencedFiles, fileReference => { + var referencedFile = tryResolveScriptReference(program, root, fileReference); + + // All the references that are not going to be part of same file + if (referencedFile && ((referencedFile.flags & NodeFlags.DeclarationFile) || // This is a declare file reference + shouldEmitToOwnFile(referencedFile, compilerOptions) || // This is referenced file is emitting its own js file + !addedGlobalFileReference)) { // Or the global out file corresponding to this reference was not added + + writeReferencePath(referencedFile); + if (!isExternalModuleOrDeclarationFile(referencedFile)) { + addedGlobalFileReference = true; + } + } + }); + } + + emitNode(root); + } + else { + // Emit references corresponding to this file + var emittedReferencedFiles: SourceFile[] = []; + forEach(program.getSourceFiles(), sourceFile => { + if (!isExternalModuleOrDeclarationFile(sourceFile)) { + // Check what references need to be added + if (!compilerOptions.noResolve) { + forEach(sourceFile.referencedFiles, fileReference => { + var referencedFile = tryResolveScriptReference(program, sourceFile, fileReference); + + // If the reference file is a declaration file or an external module, emit that reference + if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && + !contains(emittedReferencedFiles, referencedFile))) { // If the file reference was not already emitted + + writeReferencePath(referencedFile); + emittedReferencedFiles.push(referencedFile); + } + }); + } + + emitNode(sourceFile); + } + }); + } + + return { + reportedDeclarationError, + aliasDeclarationEmitInfo, + synchronousDeclarationOutput: writer.getText(), + referencePathsOutput, + } + } + + export function getDeclarationDiagnostics(program: Program, resolver: EmitResolver, targetSourceFile: SourceFile): Diagnostic[] { + var diagnostics: Diagnostic[] = []; + var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, program, ".js"); + emitDeclarations(program, resolver, diagnostics, jsFilePath, targetSourceFile); + return diagnostics; + } + + // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compilerOnSave feature + export function emitFiles(resolver: EmitResolver, targetSourceFile?: SourceFile): EmitResult { var program = resolver.getProgram(); var compilerHost = program.getCompilerHost(); var compilerOptions = program.getCompilerOptions(); @@ -33,283 +1454,16 @@ module ts { var diagnostics: Diagnostic[] = []; var newLine = program.getCompilerHost().getNewLine(); - function getSourceFilePathInNewDir(newDirPath: string, sourceFile: SourceFile) { - var sourceFilePath = getNormalizedPathFromPathCompoments(getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); - sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); - return combinePaths(newDirPath, sourceFilePath); - } - - function shouldEmitToOwnFile(sourceFile: SourceFile) { - if (!(sourceFile.flags & NodeFlags.DeclarationFile)) { - if ((isExternalModule(sourceFile) || !compilerOptions.out) && !fileExtensionIs(sourceFile.filename, ".js")) { - return true; - } - } - } - - function getOwnEmitOutputFilePath(sourceFile: SourceFile, extension: string) { - if (program.getCompilerOptions().outDir) { - var emitOutputFilePathWithoutExtension = getModuleNameFromFilename(getSourceFilePathInNewDir(program.getCompilerOptions().outDir, sourceFile)); - } - else { - var emitOutputFilePathWithoutExtension = getModuleNameFromFilename(sourceFile.filename); - } - - return emitOutputFilePathWithoutExtension + extension; - } - - function isExternalModuleOrDeclarationFile(sourceFile: SourceFile) { - return isExternalModule(sourceFile) || (sourceFile.flags & NodeFlags.DeclarationFile) !== 0; - } - - function getFirstConstructorWithBody(node: ClassDeclaration): ConstructorDeclaration { - return forEach(node.members, member => { - if (member.kind === SyntaxKind.Constructor && (member).body) { - return member; - } - }); - } - - function getAllAccessorDeclarations(node: ClassDeclaration, accessor: AccessorDeclaration) { - var firstAccessor: AccessorDeclaration; - var getAccessor: AccessorDeclaration; - var setAccessor: AccessorDeclaration; - forEach(node.members, (member: Declaration) => { - if ((member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) && - member.name.text === accessor.name.text && - (member.flags & NodeFlags.Static) === (accessor.flags & NodeFlags.Static)) { - if (!firstAccessor) { - firstAccessor = member; - } - - if (member.kind === SyntaxKind.GetAccessor && !getAccessor) { - getAccessor = member; - } - - if (member.kind === SyntaxKind.SetAccessor && !setAccessor) { - setAccessor = member; - } - } - }); - return { - firstAccessor: firstAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor - }; - } - - function createTextWriter(writeSymbol: (symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags)=> void): EmitTextWriter { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; - - function write(s: string) { - if (s && s.length) { - if (lineStart) { - output += getIndentString(indent); - lineStart = false; - } - output += s; - } - } - - function rawWrite(s: string) { - if (s !== undefined) { - if (lineStart) { - lineStart = false; - } - output += s; - } - } - - function writeLiteral(s: string) { - if (s && s.length) { - write(s); - var lineStartsOfS = getLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; - } - } - } - - function writeLine() { - if (!lineStart) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - } - } - - return { - write: write, - writeSymbol: writeSymbol, - rawWrite: rawWrite, - writeLiteral: writeLiteral, - writeLine: writeLine, - increaseIndent: () => indent++, - decreaseIndent: () => indent--, - getIndent: () => indent, - getTextPos: () => output.length, - getLine: () => lineCount + 1, - getColumn: () => lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1, - getText: () => output, - }; - } - - // Get source text of node in the current source file. Unlike getSourceTextOfNode this function - // doesn't walk the parent chain to find the containing source file, rather it assumes the node is - // in the source file currently being processed. - var currentSourceFile: SourceFile; - function getSourceTextOfLocalNode(node: Node): string { - var text = currentSourceFile.text; - return text.substring(skipTrivia(text, node.pos), node.end); - } - - function getLineOfLocalPosition(pos: number) { - return currentSourceFile.getLineAndCharacterFromPosition(pos).line; - } - - function writeFile(filename: string, data: string, writeByteOrderMark: boolean) { - compilerHost.writeFile(filename, data, writeByteOrderMark, hostErrorMessage => { - diagnostics.push(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, filename, hostErrorMessage)); - }); - } - - function emitComments(comments: Comment[], trailingSeparator: boolean, writer: EmitTextWriter, writeComment: (comment: Comment, writer: EmitTextWriter) => void) { - var emitLeadingSpace = !trailingSeparator; - forEach(comments, comment => { - if (emitLeadingSpace) { - writer.write(" "); - emitLeadingSpace = false; - } - writeComment(comment, writer); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - else if (trailingSeparator) { - writer.write(" "); - } - else { - // Emit leading space to separate comment during next comment emit - emitLeadingSpace = true; - } - }); - } - - function emitNewLineBeforeLeadingComments(node: TextRange, leadingComments: Comment[], writer: EmitTextWriter) { - // If the leading comments start on different line than the start of node, write new line - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(node.pos) !== getLineOfLocalPosition(leadingComments[0].pos)) { - writer.writeLine(); - } - } - - function writeCommentRange(comment: Comment, writer: EmitTextWriter) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk) { - var firstCommentLineAndCharacter = currentSourceFile.getLineAndCharacterFromPosition(comment.pos); - var firstCommentLineIndent: number; - for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = currentSourceFile.getPositionFromLineAndCharacter(currentLine + 1, /*character*/1); - - if (pos !== comment.pos) { - // If we are not emitting first line, we need to write the spaces to adjust the alignment - if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(currentSourceFile.getPositionFromLineAndCharacter(firstCommentLineAndCharacter.line, /*character*/1), - comment.pos); - } - - // These are number of spaces writer is going to write at current indent - var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - - // Number of spaces we want to be writing - // eg: Assume writer indent - // module m { - // /* starts at character 9 this is line 1 - // * starts at character pos 4 line --1 = 8 - 8 + 3 - // More left indented comment */ --2 = 8 - 8 + 2 - // class c { } - // } - // module m { - // /* this is line 1 -- Assume current writer indent 8 - // * line --3 = 8 - 4 + 5 - // More right indented comment */ --4 = 8 - 4 + 11 - // class c { } - // } - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); - if (spacesToEmit > 0) { - var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - - // Write indent size string ( in eg 1: = "", 2: "" , 3: string with 8 spaces 4: string with 12 spaces - writer.rawWrite(indentSizeSpaceString); - - // Emit the single spaces (in eg: 1: 3 spaces, 2: 2 spaces, 3: 1 space, 4: 3 spaces) - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } - else { - // No spaces to emit write empty string - writer.rawWrite(""); - } - } - - // Write the comment line text - writeTrimmedCurrentLine(pos, nextLineStart); - - pos = nextLineStart; - } - } - else { - // Single line comment of style //.... - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - - function writeTrimmedCurrentLine(pos: number, nextLineStart: number) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); - if (currentLineText) { - // trimmed forward and ending spaces text - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - // Empty string - make sure we write empty line - writer.writeLiteral(newLine); - } - } - - function calculateIndent(pos: number, end: number) { - var currentLineIndent = 0; - for (; pos < end && isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === CharacterCodes.tab) { - // Tabs = TabSize = indent size and go to next tabStop - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - // Single space - currentLineIndent++; - } - } - - return currentLineIndent; - } - } - function emitJavaScript(jsFilePath: string, root?: SourceFile) { - var writer = createTextWriter(writeSymbol); + var writer = createTextWriter(newLine); var write = writer.write; + var writeTextOfNode = writer.writeTextOfNode; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; + var currentSourceFile: SourceFile; + var extendsEmitted = false; /** write emitted output to disk*/ @@ -360,8 +1514,6 @@ module ts { /** Sourcemap data that will get encoded */ var sourceMapData: SourceMapData; - function writeSymbol(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) { } - function initializeEmitterWithSourceMaps() { var sourceMapDir: string; // The directory in which sourcemap will be @@ -524,7 +1676,8 @@ module ts { sourceMapData.sourceMapSources.push(getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.filename, compilerHost.getCurrentDirectory(), - /*isAbsolutePathAnUrl*/ true)); + compilerHost.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ true)); sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; // The one that can be used from program to get the actual source file @@ -568,7 +1721,8 @@ module ts { node.kind === SyntaxKind.EnumDeclaration) { // Declaration and has associated name use it if ((node).name) { - scopeName = (node).name.text; + // TODO(jfreeman): Ask shkamat about what this name should be for source maps + scopeName = ((node).name).text; } recordScopeNameStart(scopeName); } @@ -582,23 +1736,48 @@ module ts { sourceMapNameIndices.pop(); }; - function writeCommentRangeWithMap(comment: Comment, writer: EmitTextWriter) { + function writeCommentRangeWithMap(curentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string) { recordSourceMapSpan(comment.pos); - writeCommentRange(comment, writer); + writeCommentRange(currentSourceFile, writer, comment, newLine); recordSourceMapSpan(comment.end); } + function serializeSourceMapContents(version: number, file: string, sourceRoot: string, sources: string[], names: string[], mappings: string) { + if (typeof JSON !== "undefined") { + return JSON.stringify({ + version: version, + file: file, + sourceRoot: sourceRoot, + sources: sources, + names: names, + mappings: mappings + }); + } + + return "{\"version\":" + version + ",\"file\":\"" + escapeString(file) + "\",\"sourceRoot\":\"" + escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + escapeString(mappings) + "\"}"; + + function serializeStringArray(list: string[]): string { + var output = ""; + for (var i = 0, n = list.length; i < n; i++) { + if (i) { + output += ","; + } + output += "\"" + escapeString(list[i]) + "\""; + } + return output; + } + } + function writeJavaScriptAndSourceMapFile(emitOutput: string, writeByteOrderMark: boolean) { // Write source map file encodeLastRecordedSourceMapSpan(); - writeFile(sourceMapData.sourceMapFilePath, JSON.stringify({ - version: 3, - file: sourceMapData.sourceMapFile, - sourceRoot: sourceMapData.sourceMapSourceRoot, - sources: sourceMapData.sourceMapSources, - names: sourceMapData.sourceMapNames, - mappings: sourceMapData.sourceMapMappings - }), /*writeByteOrderMark*/ false); + writeFile(compilerHost, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents( + 3, + sourceMapData.sourceMapFile, + sourceMapData.sourceMapSourceRoot, + sourceMapData.sourceMapSources, + sourceMapData.sourceMapNames, + sourceMapData.sourceMapMappings), /*writeByteOrderMark*/ false); sourceMapDataList.push(sourceMapData); // Write sourcemap url to the js file and write the js file @@ -631,7 +1810,7 @@ module ts { if (root) { // emitting single module file // For modules or multiple emit files the mapRoot will have directory structure like the sources // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map - sourceMapDir = getDirectoryPath(getSourceFilePathInNewDir(sourceMapDir, root)); + sourceMapDir = getDirectoryPath(getSourceFilePathInNewDir(root, program, sourceMapDir)); } if (!isRootedDiskPath(sourceMapDir) && !isUrl(sourceMapDir)) { @@ -641,7 +1820,8 @@ module ts { getDirectoryPath(normalizePath(jsFilePath)), // get the relative sourceMapDir path based on jsFilePath combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), // this is where user expects to see sourceMap compilerHost.getCurrentDirectory(), - /*isAbsolutePathAnUrl*/ true); + compilerHost.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ true); } else { sourceMapData.jsSourceMappingURL = combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); @@ -676,7 +1856,7 @@ module ts { } function writeJavaScriptFile(emitOutput: string, writeByteOrderMark: boolean) { - writeFile(jsFilePath, emitOutput, writeByteOrderMark); + writeFile(compilerHost, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } function emitTokenText(tokenKind: SyntaxKind, startPos: number, emitFn?: () => void) { @@ -697,23 +1877,46 @@ module ts { } } - function emitCommaList(nodes: Node[], count?: number) { - if (!(count >= 0)) count = nodes.length; - if (nodes) { - for (var i = 0; i < count; i++) { - if (i) write(", "); - emit(nodes[i]); + function emitTrailingCommaIfPresent(nodeList: NodeArray, isMultiline: boolean): void { + if (nodeList.hasTrailingComma) { + write(","); + if (isMultiline) { + writeLine(); } } } - function emitMultiLineList(nodes: Node[]) { + function emitCommaList(nodes: NodeArray, includeTrailingComma: boolean, count?: number) { + if (!(count >= 0)) { + count = nodes.length; + } + if (nodes) { + for (var i = 0; i < count; i++) { + if (i) { + write(", "); + } + emit(nodes[i]); + } + + if (includeTrailingComma) { + emitTrailingCommaIfPresent(nodes, /*isMultiline*/ false); + } + } + } + + function emitMultiLineList(nodes: NodeArray, includeTrailingComma: boolean) { if (nodes) { for (var i = 0; i < nodes.length; i++) { - if (i) write(","); + if (i) { + write(","); + } writeLine(); emit(nodes[i]); } + + if (includeTrailingComma) { + emitTrailingCommaIfPresent(nodes, /*isMultiline*/ true); + } } } @@ -729,42 +1932,165 @@ module ts { } function emitLiteral(node: LiteralExpression) { - var text = getSourceTextOfLocalNode(node); - if (node.kind === SyntaxKind.StringLiteral && compilerOptions.sourceMap) { + var text = getLiteralText(); + + if (compilerOptions.sourceMap && (node.kind === SyntaxKind.StringLiteral || isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else { write(text); } + + function getLiteralText() { + if (compilerOptions.target < ScriptTarget.ES6 && isTemplateLiteralKind(node.kind)) { + return getTemplateLiteralAsStringLiteral(node) + } + + return getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + } + } + + function getTemplateLiteralAsStringLiteral(node: LiteralExpression): string { + return '"' + escapeString(node.text) + '"'; + } + + function emitTemplateExpression(node: TemplateExpression): void { + // In ES6 mode and above, we can simply emit each portion of a template in order, but in + // ES3 & ES5 we must convert the template expression into a series of string concatenations. + if (compilerOptions.target >= ScriptTarget.ES6) { + forEachChild(node, emit); + return; + } + + Debug.assert(node.parent.kind !== SyntaxKind.TaggedTemplateExpression); + + var emitOuterParens = isExpression(node.parent) + && templateNeedsParens(node, node.parent); + + if (emitOuterParens) { + write("("); + } + + emitLiteral(node.head); + + forEach(node.templateSpans, templateSpan => { + // Check if the expression has operands and binds its operands less closely than binary '+'. + // If it does, we need to wrap the expression in parentheses. Otherwise, something like + // `abc${ 1 << 2 }` + // becomes + // "abc" + 1 << 2 + "" + // which is really + // ("abc" + 1) << (2 + "") + // rather than + // "abc" + (1 << 2) + "" + var needsParens = templateSpan.expression.kind !== SyntaxKind.ParenExpression + && comparePrecedenceToBinaryPlus(templateSpan.expression) !== Comparison.GreaterThan; + + write(" + "); + + if (needsParens) { + write("("); + } + emit(templateSpan.expression); + if (needsParens) { + write(")"); + } + + // Only emit if the literal is non-empty. + // The binary '+' operator is left-associative, so the first string concatenation + // with the head will force the result up to this point to be a string. + // Emitting a '+ ""' has no semantic effect for middles and tails. + if (templateSpan.literal.text.length !== 0) { + write(" + ") + emitLiteral(templateSpan.literal); + } + }); + + if (emitOuterParens) { + write(")"); + } + + function templateNeedsParens(template: TemplateExpression, parent: Expression) { + switch (parent.kind) { + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + return (parent).func === template; + case SyntaxKind.ParenExpression: + return false; + case SyntaxKind.TaggedTemplateExpression: + Debug.fail("Path should be unreachable; tagged templates not supported pre-ES6."); + default: + return comparePrecedenceToBinaryPlus(parent) !== Comparison.LessThan; + } + } + + /** + * Returns whether the expression has lesser, greater, + * or equal precedence to the binary '+' operator + */ + function comparePrecedenceToBinaryPlus(expression: Expression): Comparison { + // All binary expressions have lower precedence than '+' apart from '*', '/', and '%'. + // All unary operators have a higher precedence apart from yield. + // Arrow functions and conditionals have a lower precedence, + // although we convert the former into regular function expressions in ES5 mode, + // and in ES6 mode this function won't get called anyway. + // + // TODO (drosen): Note that we need to account for the upcoming 'yield' and + // spread ('...') unary operators that are anticipated for ES6. + Debug.assert(compilerOptions.target <= ScriptTarget.ES5); + switch (expression.kind) { + case SyntaxKind.BinaryExpression: + switch ((expression).operator) { + case SyntaxKind.AsteriskToken: + case SyntaxKind.SlashToken: + case SyntaxKind.PercentToken: + return Comparison.GreaterThan; + case SyntaxKind.PlusToken: + return Comparison.EqualTo; + default: + return Comparison.LessThan; + } + case SyntaxKind.ConditionalExpression: + return Comparison.LessThan; + default: + return Comparison.GreaterThan; + } + } + } + + function emitTemplateSpan(span: TemplateSpan) { + emit(span.expression); + emit(span.literal); } // This function specifically handles numeric/string literals for enum and accessor 'identifiers'. // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. - function emitQuotedIdentifier(node: Identifier) { + function emitExpressionForPropertyName(node: DeclarationName) { if (node.kind === SyntaxKind.StringLiteral) { - emitLiteral(node); + emitLiteral(node); } else { write("\""); if (node.kind === SyntaxKind.NumericLiteral) { - write(node.text); + write((node).text); } else { - write(getSourceTextOfLocalNode(node)); + writeTextOfNode(currentSourceFile, node); } write("\""); } } - function isNonExpressionIdentifier(node: Identifier) { + function isNotExpressionIdentifier(node: Identifier) { var parent = node.parent; switch (parent.kind) { case SyntaxKind.Parameter: case SyntaxKind.VariableDeclaration: case SyntaxKind.Property: case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: case SyntaxKind.EnumMember: case SyntaxKind.Method: case SyntaxKind.FunctionDeclaration: @@ -781,22 +2107,29 @@ module ts { case SyntaxKind.ContinueStatement: case SyntaxKind.ExportAssignment: return false; - case SyntaxKind.LabelledStatement: - return (node.parent).label === node; + case SyntaxKind.LabeledStatement: + return (node.parent).label === node; case SyntaxKind.CatchBlock: return (node.parent).variable === node; } } - function emitIdentifier(node: Identifier) { - if (!isNonExpressionIdentifier(node)) { - var prefix = resolver.getExpressionNamePrefix(node); - if (prefix) { - write(prefix); - write("."); - } + function emitExpressionIdentifier(node: Identifier) { + var prefix = resolver.getExpressionNamePrefix(node); + if (prefix) { + write(prefix); + write("."); + } + writeTextOfNode(currentSourceFile, node); + } + + function emitIdentifier(node: Identifier) { + if (!isNotExpressionIdentifier(node)) { + emitExpressionIdentifier(node); + } + else { + writeTextOfNode(currentSourceFile, node); } - write(getSourceTextOfLocalNode(node)); } function emitThis(node: Node) { @@ -825,14 +2158,14 @@ module ts { if (node.flags & NodeFlags.MultiLine) { write("["); increaseIndent(); - emitMultiLineList(node.elements); + emitMultiLineList(node.elements, /*includeTrailingComma*/ true); decreaseIndent(); writeLine(); write("]"); } else { write("["); - emitCommaList(node.elements); + emitCommaList(node.elements, /*includeTrailingComma*/ true); write("]"); } } @@ -844,14 +2177,14 @@ module ts { else if (node.flags & NodeFlags.MultiLine) { write("{"); increaseIndent(); - emitMultiLineList(node.properties); + emitMultiLineList(node.properties, /*includeTrailingComma*/ compilerOptions.target >= ScriptTarget.ES5); decreaseIndent(); writeLine(); write("}"); } else { write("{ "); - emitCommaList(node.properties); + emitCommaList(node.properties, /*includeTrailingComma*/ compilerOptions.target >= ScriptTarget.ES5); write(" }"); } } @@ -864,10 +2197,48 @@ module ts { emitTrailingComments(node); } + function emitShortHandPropertyAssignment(node: ShortHandPropertyDeclaration) { + function emitAsNormalPropertyAssignment() { + emitLeadingComments(node); + // Emit identifier as an identifier + emit(node.name); + write(": "); + // Even though this is stored as identified because it is in short-hand property assignment, + // treated it as expression + emitExpressionIdentifier(node.name); + emitTrailingComments(node); + } + + if (compilerOptions.target < ScriptTarget.ES6) { + emitAsNormalPropertyAssignment(); + } + else if (compilerOptions.target >= ScriptTarget.ES6) { + // If short-hand property has a prefix, then regardless of the target version, we will emit it as normal property assignment + var prefix = resolver.getExpressionNamePrefix(node.name); + if (prefix) { + emitAsNormalPropertyAssignment(); + } + // If short-hand property has no prefix, emit it as short-hand. + else { + emitLeadingComments(node); + emit(node.name); + emitTrailingComments(node); + } + } + } + + function tryEmitConstantValue(node: PropertyAccess | IndexedAccess): boolean { + var constantValue = resolver.getConstantValue(node); + if (constantValue !== undefined) { + var propertyName = node.kind === SyntaxKind.PropertyAccess ? declarationNameToString((node).right) : getTextOfNode((node).index); + write(constantValue.toString() + " /* " + propertyName + " */"); + return true; + } + return false; + } + function emitPropertyAccess(node: PropertyAccess) { - var text = resolver.getPropertyAccessSubstitution(node); - if (text) { - write(text); + if (tryEmitConstantValue(node)) { return; } emit(node.left); @@ -876,6 +2247,9 @@ module ts { } function emitIndexedAccess(node: IndexedAccess) { + if (tryEmitConstantValue(node)) { + return; + } emit(node.object); write("["); emit(node.index); @@ -897,13 +2271,13 @@ module ts { emitThis(node.func); if (node.arguments.length) { write(", "); - emitCommaList(node.arguments); + emitCommaList(node.arguments, /*includeTrailingComma*/ false); } write(")"); } else { write("("); - emitCommaList(node.arguments); + emitCommaList(node.arguments, /*includeTrailingComma*/ false); write(")"); } } @@ -913,11 +2287,18 @@ module ts { emit(node.func); if (node.arguments) { write("("); - emitCommaList(node.arguments); + emitCommaList(node.arguments, /*includeTrailingComma*/ false); write(")"); } } + function emitTaggedTemplateExpression(node: TaggedTemplateExpression): void { + Debug.assert(compilerOptions.target >= ScriptTarget.ES6, "Trying to emit a tagged template in pre-ES6 mode."); + emit(node.tag); + write(" "); + emit(node.template); + } + function emitParenExpression(node: ParenExpression) { if (node.expression.kind === SyntaxKind.TypeAssertion) { var operand = (node.expression).operand; @@ -1084,9 +2465,17 @@ module ts { write(" "); endPos = emitToken(SyntaxKind.OpenParenToken, endPos); if (node.declarations) { - emitToken(SyntaxKind.VarKeyword, endPos); + if (node.declarations[0] && isLet(node.declarations[0])) { + emitToken(SyntaxKind.LetKeyword, endPos); + } + else if (node.declarations[0] && isConst(node.declarations[0])) { + emitToken(SyntaxKind.ConstKeyword, endPos); + } + else { + emitToken(SyntaxKind.VarKeyword, endPos); + } write(" "); - emitCommaList(node.declarations); + emitCommaList(node.declarations, /*includeTrailingComma*/ false); } if (node.initializer) { emit(node.initializer); @@ -1103,10 +2492,18 @@ module ts { var endPos = emitToken(SyntaxKind.ForKeyword, node.pos); write(" "); endPos = emitToken(SyntaxKind.OpenParenToken, endPos); - if (node.declaration) { - emitToken(SyntaxKind.VarKeyword, endPos); - write(" "); - emit(node.declaration); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + if (isLet(decl)) { + emitToken(SyntaxKind.LetKeyword, endPos); + } + else { + emitToken(SyntaxKind.VarKeyword, endPos); + } + write(" "); + emit(decl); + } } else { emit(node.variable); @@ -1153,6 +2550,11 @@ module ts { emitToken(SyntaxKind.CloseBraceToken, node.clauses.end); } + function isOnSameLine(node1: Node, node2: Node) { + return getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node1.pos)) === + getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node2.pos)); + } + function emitCaseOrDefaultClause(node: CaseOrDefaultClause) { if (node.kind === SyntaxKind.CaseClause) { write("case "); @@ -1162,9 +2564,15 @@ module ts { else { write("default:"); } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); + if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) { + write(" "); + emit(node.statements[0]); + } + else { + increaseIndent(); + emitLines(node.statements); + decreaseIndent(); + } } function emitThrowStatement(node: ThrowStatement) { @@ -1200,7 +2608,7 @@ module ts { write(";"); } - function emitLabelledStatement(node: LabelledStatement) { + function emitLabelledStatement(node: LabeledStatement) { emit(node.label); write(": "); emit(node.statement); @@ -1233,8 +2641,18 @@ module ts { function emitVariableStatement(node: VariableStatement) { emitLeadingComments(node); - if (!(node.flags & NodeFlags.Export)) write("var "); - emitCommaList(node.declarations); + if (!(node.flags & NodeFlags.Export)) { + if (isLet(node)) { + write("let "); + } + else if (isConst(node)) { + write("const "); + } + else { + write("var "); + } + } + emitCommaList(node.declarations, /*includeTrailingComma*/ false); write(";"); emitTrailingComments(node); } @@ -1245,7 +2663,7 @@ module ts { emitTrailingComments(node); } - function emitDefaultValueAssignments(node: FunctionDeclaration) { + function emitDefaultValueAssignments(node: FunctionLikeDeclaration) { forEach(node.parameters, param => { if (param.initializer) { writeLine(); @@ -1265,7 +2683,7 @@ module ts { }); } - function emitRestParameter(node: FunctionDeclaration) { + function emitRestParameter(node: FunctionLikeDeclaration) { if (hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; @@ -1311,7 +2729,7 @@ module ts { emitTrailingComments(node); } - function emitFunctionDeclaration(node: FunctionDeclaration) { + function emitFunctionDeclaration(node: FunctionLikeDeclaration) { if (!node.body) { return emitPinnedOrTripleSlashComments(node); } @@ -1339,17 +2757,17 @@ module ts { } } - function emitSignatureParameters(node: FunctionDeclaration) { + function emitSignatureParameters(node: FunctionLikeDeclaration) { increaseIndent(); write("("); if (node) { - emitCommaList(node.parameters, node.parameters.length - (hasRestParameters(node) ? 1 : 0)); + emitCommaList(node.parameters, /*includeTrailingComma*/ false, node.parameters.length - (hasRestParameters(node) ? 1 : 0)); } write(")"); decreaseIndent(); } - function emitSignatureAndBody(node: FunctionDeclaration) { + function emitSignatureAndBody(node: FunctionLikeDeclaration) { emitSignatureParameters(node); write(" {"); scopeEmitStart(node); @@ -1431,7 +2849,7 @@ module ts { function emitParameterPropertyAssignments(node: ConstructorDeclaration) { forEach(node.parameters, param => { - if (param.flags & (NodeFlags.Public | NodeFlags.Private)) { + if (param.flags & NodeFlags.AccessibilityModifier) { writeLine(); emitStart(param); emitStart(param.name); @@ -1446,7 +2864,8 @@ module ts { }); } - function emitMemberAccess(memberName: Identifier) { + // TODO(jfreeman): Account for computed property name + function emitMemberAccess(memberName: DeclarationName) { if (memberName.kind === SyntaxKind.StringLiteral || memberName.kind === SyntaxKind.NumericLiteral) { write("["); emitNode(memberName); @@ -1519,7 +2938,7 @@ module ts { write(".prototype"); } write(", "); - emitQuotedIdentifier((member).name); + emitExpressionForPropertyName((member).name); emitEnd((member).name); write(", {"); increaseIndent(); @@ -1678,6 +3097,11 @@ module ts { } function emitEnumDeclaration(node: EnumDeclaration) { + // const enums are completely erased during compilation. + var isConstEnum = isConst(node); + if (isConstEnum && !compilerOptions.preserveConstEnums) { + return; + } emitLeadingComments(node); if (!(node.flags & NodeFlags.Export)) { emitStart(node); @@ -1695,7 +3119,7 @@ module ts { write(") {"); increaseIndent(); scopeEmitStart(node); - emitEnumMemberDeclarations(); + emitEnumMemberDeclarations(isConstEnum); decreaseIndent(); writeLine(); emitToken(SyntaxKind.CloseBraceToken, node.members.end); @@ -1718,7 +3142,7 @@ module ts { } emitTrailingComments(node); - function emitEnumMemberDeclarations() { + function emitEnumMemberDeclarations(isConstEnum: boolean) { forEach(node.members, member => { writeLine(); emitLeadingComments(member); @@ -1727,16 +3151,16 @@ module ts { write("["); write(resolver.getLocalNameOfContainer(node)); write("["); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); write("] = "); - if (member.initializer) { + if (member.initializer && !isConstEnum) { emit(member.initializer); } else { write(resolver.getEnumMemberValue(member).toString()); } write("] = "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member); write(";"); emitTrailingComments(member); @@ -1752,7 +3176,7 @@ module ts { } function emitModuleDeclaration(node: ModuleDeclaration) { - if (!isInstantiated(node)) { + if (getModuleInstanceState(node) !== ModuleInstanceState.Instantiated) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node); @@ -1804,7 +3228,7 @@ module ts { // preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when // - current file is not external module // - import declaration is top level and target is value imported by entity name - emitImportDeclaration = !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); + emitImportDeclaration = !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { @@ -1848,7 +3272,10 @@ module ts { function getExternalImportDeclarations(node: SourceFile): ImportDeclaration[] { var result: ImportDeclaration[] = []; forEach(node.statements, stat => { - if (stat.kind === SyntaxKind.ImportDeclaration && (stat).externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === SyntaxKind.ImportDeclaration + && (stat).externalModuleName + && resolver.isReferencedImportDeclaration(stat)) { + result.push(stat); } }); @@ -1866,7 +3293,11 @@ module ts { function emitAMDModule(node: SourceFile, startIndex: number) { var imports = getExternalImportDeclarations(node); writeLine(); - write("define([\"require\", \"exports\""); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + write("[\"require\", \"exports\""); forEach(imports, imp => { write(", "); emitLiteral(imp.externalModuleName); @@ -1973,7 +3404,7 @@ module ts { } } - function emitNode(node: Node) { + function emitNode(node: Node): void { if (!node) { return; } @@ -2003,7 +3434,15 @@ module ts { case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: + case SyntaxKind.TemplateTail: return emitLiteral(node); + case SyntaxKind.TemplateExpression: + return emitTemplateExpression(node); + case SyntaxKind.TemplateSpan: + return emitTemplateSpan(node); case SyntaxKind.QualifiedName: return emitPropertyAccess(node); case SyntaxKind.ArrayLiteral: @@ -2012,6 +3451,8 @@ module ts { return emitObjectLiteral(node); case SyntaxKind.PropertyAssignment: return emitPropertyAssignment(node); + case SyntaxKind.ShorthandPropertyAssignment: + return emitShortHandPropertyAssignment(node); case SyntaxKind.PropertyAccess: return emitPropertyAccess(node); case SyntaxKind.IndexedAccess: @@ -2020,6 +3461,8 @@ module ts { return emitCallExpression(node); case SyntaxKind.NewExpression: return emitNewExpression(node); + case SyntaxKind.TaggedTemplateExpression: + return emitTaggedTemplateExpression(node); case SyntaxKind.TypeAssertion: return emit((node).operand); case SyntaxKind.ParenExpression: @@ -2027,7 +3470,7 @@ module ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - return emitFunctionDeclaration(node); + return emitFunctionDeclaration(node); case SyntaxKind.PrefixOperator: case SyntaxKind.PostfixOperator: return emitUnaryExpression(node); @@ -2071,8 +3514,8 @@ module ts { case SyntaxKind.CaseClause: case SyntaxKind.DefaultClause: return emitCaseOrDefaultClause(node); - case SyntaxKind.LabelledStatement: - return emitLabelledStatement(node); + case SyntaxKind.LabeledStatement: + return emitLabelledStatement(node); case SyntaxKind.ThrowStatement: return emitThrowStatement(node); case SyntaxKind.TryStatement: @@ -2104,7 +3547,7 @@ module ts { function getLeadingCommentsWithoutDetachedComments() { // get the leading comments from detachedPos - var leadingComments = getLeadingComments(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); + var leadingComments = getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); } @@ -2115,17 +3558,18 @@ module ts { return leadingComments; } + function getLeadingCommentsToEmit(node: Node) { // Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent.kind === SyntaxKind.SourceFile || node.pos !== node.parent.pos) { - var leadingComments: Comment[]; + var leadingComments: CommentRange[]; if (hasDetachedComments(node.pos)) { // get comments without detached comments leadingComments = getLeadingCommentsWithoutDetachedComments(); } else { // get the leading comments from the node - leadingComments = getLeadingCommentsOfNode(node, currentSourceFile); + leadingComments = getLeadingCommentRangesOfNode(node, currentSourceFile); } return leadingComments; } @@ -2133,45 +3577,45 @@ module ts { function emitLeadingDeclarationComments(node: Node) { var leadingComments = getLeadingCommentsToEmit(node); - emitNewLineBeforeLeadingComments(node, leadingComments, writer); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(leadingComments, /*trailingSeparator*/ true, writer, writeComment); + emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitTrailingDeclarationComments(node: Node) { // Emit the trailing comments only if the parent's end doesn't match if (node.parent.kind === SyntaxKind.SourceFile || node.end !== node.parent.end) { - var trailingComments = getTrailingComments(currentSourceFile.text, node.end); + var trailingComments = getTrailingCommentRanges(currentSourceFile.text, node.end); // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ - emitComments(trailingComments, /*trailingSeparator*/ false, writer, writeComment); + emitComments(currentSourceFile, writer, trailingComments, /*trailingSeparator*/ false, newLine, writeComment); } } function emitLeadingCommentsOfLocalPosition(pos: number) { - var leadingComments: Comment[]; + var leadingComments: CommentRange[]; if (hasDetachedComments(pos)) { // get comments without detached comments leadingComments = getLeadingCommentsWithoutDetachedComments(); } else { // get the leading comments from the node - leadingComments = getLeadingComments(currentSourceFile.text, pos); + leadingComments = getLeadingCommentRanges(currentSourceFile.text, pos); } - emitNewLineBeforeLeadingComments({ pos: pos, end: pos }, leadingComments, writer); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(leadingComments, /*trailingSeparator*/ true, writer, writeComment); + emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitDetachedCommentsAtPosition(node: TextRange) { - var leadingComments = getLeadingComments(currentSourceFile.text, node.pos); + var leadingComments = getLeadingCommentRanges(currentSourceFile.text, node.pos); if (leadingComments) { - var detachedComments: Comment[] = []; - var lastComment: Comment; + var detachedComments: CommentRange[] = []; + var lastComment: CommentRange; forEach(leadingComments, comment => { if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(lastComment.end); - var commentLine = getLineOfLocalPosition(comment.pos); + var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); + var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); if (commentLine >= lastCommentLine + 2) { // There was a blank line between the last comment and this comment. This @@ -2189,12 +3633,12 @@ module ts { // All comments look like they could have been part of the copyright header. Make // sure there is at least one blank line between it and the node. If not, it's not // a copyright header. - var lastCommentLine = getLineOfLocalPosition(detachedComments[detachedComments.length - 1].end); - var astLine = getLineOfLocalPosition(skipTrivia(currentSourceFile.text, node.pos)); + var lastCommentLine = getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + var astLine = getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node.pos)); if (astLine >= lastCommentLine + 2) { // Valid detachedComments - emitNewLineBeforeLeadingComments(node, leadingComments, writer); - emitComments(detachedComments, /*trailingSeparator*/ true, writer, writeComment); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + emitComments(currentSourceFile, writer, detachedComments, /*trailingSeparator*/ true, newLine, writeComment); var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); @@ -2210,7 +3654,7 @@ module ts { function emitPinnedOrTripleSlashCommentsOfNode(node: Node) { var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); - function isPinnedOrTripleSlashComment(comment: Comment) { + function isPinnedOrTripleSlashComment(comment: CommentRange) { if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk) { return currentSourceFile.text.charCodeAt(comment.pos + 2) === CharacterCodes.exclamation; } @@ -2224,9 +3668,9 @@ module ts { } } - emitNewLineBeforeLeadingComments(node, pinnedComments, writer); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, pinnedComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(pinnedComments, /*trailingSeparator*/ true, writer, writeComment); + emitComments(currentSourceFile, writer, pinnedComments, /*trailingSeparator*/ true, newLine, writeComment); } if (compilerOptions.sourceMap) { @@ -2248,943 +3692,89 @@ module ts { writeEmittedFiles(writer.getText(), /*writeByteOrderMark*/ compilerOptions.emitBOM); } - function emitDeclarations(jsFilePath: string, root?: SourceFile) { - var writer = createTextWriter(writeSymbol); - var write = writer.write; - var writeLine = writer.writeLine; - var increaseIndent = writer.increaseIndent; - var decreaseIndent = writer.decreaseIndent; - - var enclosingDeclaration: Node; - var reportedDeclarationError = false; - - var emitJsDocComments = compilerOptions.removeComments ? function (declaration: Declaration) { } : writeJsDocComments; - - var aliasDeclarationEmitInfo: { - declaration: ImportDeclaration; - outputPos: number; - indent: number; - asynchronousOutput?: string; // If the output for alias was written asynchronously, the corresponding output - }[] = []; - - var getSymbolVisibilityDiagnosticMessage: (symbolAccesibilityResult: SymbolAccessiblityResult) => { - errorNode: Node; - diagnosticMessage: DiagnosticMessage; - typeName?: Identifier - } - - function writeAsychronousImportDeclarations(importDeclarations: ImportDeclaration[]) { - var oldWriter = writer; - forEach(importDeclarations, aliasToWrite => { - var aliasEmitInfo = forEach(aliasDeclarationEmitInfo, declEmitInfo => declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined); - writer = createTextWriter(writeSymbol); - for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { - writer.increaseIndent(); - } - - writeImportDeclaration(aliasToWrite); - aliasEmitInfo.asynchronousOutput = writer.getText(); - }); - writer = oldWriter; - } - - function writeSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) { - var symbolAccesibilityResult = resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning); - if (symbolAccesibilityResult.accessibility === SymbolAccessibility.Accessible) { - resolver.writeSymbol(symbol, enclosingDeclaration, meaning, writer); - - // write the aliases - if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); - } - } - else { - // Report error - reportedDeclarationError = true; - var errorInfo = getSymbolVisibilityDiagnosticMessage(symbolAccesibilityResult); - if (errorInfo) { - if (errorInfo.typeName) { - diagnostics.push(createDiagnosticForNode(errorInfo.errorNode, - errorInfo.diagnosticMessage, - getSourceTextOfLocalNode(errorInfo.typeName), - symbolAccesibilityResult.errorSymbolName, - symbolAccesibilityResult.errorModuleName)); - } - else { - diagnostics.push(createDiagnosticForNode(errorInfo.errorNode, - errorInfo.diagnosticMessage, - symbolAccesibilityResult.errorSymbolName, - symbolAccesibilityResult.errorModuleName)); - } - } - } - } - - function emitLines(nodes: Node[]) { - for (var i = 0, n = nodes.length; i < n; i++) { - emitNode(nodes[i]); - } - } - - function emitCommaList(nodes: Node[], eachNodeEmitFn: (node: Node) => void) { - var currentWriterPos = writer.getTextPos(); - for (var i = 0, n = nodes.length; i < n; i++) { - if (currentWriterPos !== writer.getTextPos()) { - write(", "); - } - currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(nodes[i]); - } - } - - function writeJsDocComments(declaration: Declaration) { - if (declaration) { - var jsDocComments = getJsDocComments(declaration, currentSourceFile); - emitNewLineBeforeLeadingComments(declaration, jsDocComments, writer); - // jsDoc comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(jsDocComments, /*trailingSeparator*/ true, writer, writeCommentRange); - } - } - - function emitSourceTextOfNode(node: Node) { - write(getSourceTextOfLocalNode(node)); - } - - function emitSourceFile(node: SourceFile) { - currentSourceFile = node; - enclosingDeclaration = node; - emitLines(node.statements); - } - - function emitExportAssignment(node: ExportAssignment) { - write("export = "); - emitSourceTextOfNode(node.exportName); - write(";"); - writeLine(); - } - - function emitDeclarationFlags(node: Declaration) { - if (node.flags & NodeFlags.Static) { - if (node.flags & NodeFlags.Private) { - write("private "); - } - write("static "); - } - else { - if (node.flags & NodeFlags.Private) { - write("private "); - } - // If the node is parented in the current source file we need to emit export declare or just export - else if (node.parent === currentSourceFile) { - // If the node is exported - if (node.flags & NodeFlags.Export) { - write("export "); - } - - if (node.kind !== SyntaxKind.InterfaceDeclaration) { - write("declare "); - } - } - } - } - - function emitImportDeclaration(node: ImportDeclaration) { - var nodeEmitInfo = { - declaration: node, - outputPos: writer.getTextPos(), - indent: writer.getIndent(), - hasWritten: resolver.isDeclarationVisible(node) - }; - aliasDeclarationEmitInfo.push(nodeEmitInfo); - if (nodeEmitInfo.hasWritten) { - writeImportDeclaration(node); - } - } - - function writeImportDeclaration(node: ImportDeclaration) { - // note usage of writer. methods instead of aliases created, just to make sure we are using - // correct writer especially to handle asynchronous alias writing - emitJsDocComments(node); - if (node.flags & NodeFlags.Export) { - writer.write("export "); - } - writer.write("import "); - writer.write(getSourceTextOfLocalNode(node.name)); - writer.write(" = "); - if (node.entityName) { - checkEntityNameAccessible(); - writer.write(getSourceTextOfLocalNode(node.entityName)); - writer.write(";"); - } - else { - writer.write("require("); - writer.write(getSourceTextOfLocalNode(node.externalModuleName)); - writer.write(");"); - } - writer.writeLine(); - - function checkEntityNameAccessible() { - var symbolAccesibilityResult = resolver.isImportDeclarationEntityNameReferenceDeclarationVisibile(node.entityName); - if (symbolAccesibilityResult.accessibility === SymbolAccessibility.Accessible) { - // write the aliases - if (symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); - } - } - else { - // Report error - reportedDeclarationError = true; - diagnostics.push(createDiagnosticForNode(node, - Diagnostics.Import_declaration_0_is_using_private_name_1, - getSourceTextOfLocalNode(node.name), - symbolAccesibilityResult.errorSymbolName)); - } - } - } - - function emitModuleDeclaration(node: ModuleDeclaration) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("module "); - emitSourceTextOfNode(node.name); - while (node.body.kind !== SyntaxKind.ModuleBlock) { - node = node.body; - write("."); - emitSourceTextOfNode(node.name); - } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - write(" {"); - writeLine(); - increaseIndent(); - emitLines((node.body).statements); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - - function emitEnumDeclaration(node: EnumDeclaration) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("enum "); - emitSourceTextOfNode(node.name); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - } - } - - function emitEnumMemberDeclaration(node: EnumMember) { - emitJsDocComments(node); - emitSourceTextOfNode(node.name); - var enumMemberValue = resolver.getEnumMemberValue(node); - if (enumMemberValue !== undefined) { - write(" = "); - write(enumMemberValue.toString()); - } - write(","); - writeLine(); - } - - function emitTypeParameters(typeParameters: TypeParameterDeclaration[]) { - function emitTypeParameter(node: TypeParameterDeclaration) { - function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - // Type parameter constraints are named by user so we should always be able to name it - var diagnosticMessage: DiagnosticMessage; - switch (node.parent.kind) { - case SyntaxKind.ClassDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; - break; - - case SyntaxKind.InterfaceDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; - break; - - case SyntaxKind.ConstructSignature: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - - case SyntaxKind.CallSignature: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - - case SyntaxKind.Method: - if (node.parent.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; - } - break; - - case SyntaxKind.FunctionDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - - default: - Debug.fail("This is unknown parent for type parameter: " + SyntaxKind[node.parent.kind]); - } - - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - - increaseIndent(); - emitJsDocComments(node); - decreaseIndent(); - emitSourceTextOfNode(node.name); - // If there is constraint present and this is not a type parameter of the private method emit the constraint - if (node.constraint && (node.parent.kind !== SyntaxKind.Method || !(node.parent.flags & NodeFlags.Private))) { - write(" extends "); - getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; - resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } - } - - if (typeParameters) { - write("<"); - emitCommaList(typeParameters, emitTypeParameter); - write(">"); - } - } - - function emitHeritageClause(typeReferences: TypeReferenceNode[], isImplementsList: boolean) { - if (typeReferences) { - write(isImplementsList ? " implements " : " extends "); - emitCommaList(typeReferences, emitTypeOfTypeReference); - } - - function emitTypeOfTypeReference(node: Node) { - getSymbolVisibilityDiagnosticMessage = getHeritageClauseVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.WriteArrayAsGenericType | TypeFormatFlags.UseTypeOfFunction, writer); - - function getHeritageClauseVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage: DiagnosticMessage; - // Heritage clause is written by user so it can always be named - if (node.parent.kind === SyntaxKind.ClassDeclaration) { - // Class - if (symbolAccesibilityResult.errorModuleName) { - // Module is inaccessible - diagnosticMessage = isImplementsList ? - Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; - } - else { - // Class or Interface implemented/extended is inaccessible - diagnosticMessage = isImplementsList ? - Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; - } - } - else { - if (symbolAccesibilityResult.errorModuleName) { - // Module is inaccessible - diagnosticMessage = Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2; - } - else { - // interface is inaccessible - diagnosticMessage = Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; - } - } - - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: (node.parent).name - }; - } - } - } - - function emitClassDeclaration(node: ClassDeclaration) { - function emitParameterProperties(constructorDeclaration: ConstructorDeclaration) { - if (constructorDeclaration) { - forEach(constructorDeclaration.parameters, param => { - if (param.flags & (NodeFlags.Public | NodeFlags.Private)) { - emitPropertyDeclaration(param); - } - }); - } - } - - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("class "); - emitSourceTextOfNode(node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - if (node.baseType) { - emitHeritageClause([node.baseType], /*isImplementsList*/ false); - } - emitHeritageClause(node.implementedTypes, /*isImplementsList*/ true); - write(" {"); - writeLine(); - increaseIndent(); - emitParameterProperties(getFirstConstructorWithBody(node)); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - - function emitInterfaceDeclaration(node: InterfaceDeclaration) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("interface "); - emitSourceTextOfNode(node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - emitHeritageClause(node.baseTypes, /*isImplementsList*/ false); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - - function emitPropertyDeclaration(node: PropertyDeclaration) { - emitJsDocComments(node); - emitDeclarationFlags(node); - emitVariableDeclaration(node); - write(";"); - writeLine(); - } - - function emitVariableDeclaration(node: VariableDeclaration) { - // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted - // so there is no check needed to see if declaration is visible - if (node.kind !== SyntaxKind.VariableDeclaration || resolver.isDeclarationVisible(node)) { - emitSourceTextOfNode(node.name); - // If optional property emit ? - if (node.kind === SyntaxKind.Property && (node.flags & NodeFlags.QuestionMark)) { - write("?"); - } - if (!(node.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getVariableDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } - } - - function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage: DiagnosticMessage; - if (node.kind === SyntaxKind.VariableDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; - } - // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit - else if (node.kind === SyntaxKind.Property) { - if (node.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else { - // Interfaces cannot have types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; - } - } - - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - } : undefined; - } - } - - function emitVariableStatement(node: VariableStatement) { - var hasDeclarationWithEmit = forEach(node.declarations, varDeclaration => resolver.isDeclarationVisible(varDeclaration)); - if (hasDeclarationWithEmit) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("var "); - emitCommaList(node.declarations, emitVariableDeclaration); - write(";"); - writeLine(); - } - } - - function emitAccessorDeclaration(node: AccessorDeclaration) { - var accessors = getAllAccessorDeclarations(node.parent, node); - if (node === accessors.firstAccessor) { - emitJsDocComments(accessors.getAccessor); - emitJsDocComments(accessors.setAccessor); - emitDeclarationFlags(node); - emitSourceTextOfNode(node.name); - if (!(node.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getAccessorDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } - write(";"); - writeLine(); - } - - function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage: DiagnosticMessage; - if (node.kind === SyntaxKind.SetAccessor) { - // Setters have to have type named and cannot infer it so, the type should always be named - if (node.parent.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.parameters[0], - typeName: node.name - }; - } - else { - if (node.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.name, - typeName: undefined - }; - } - } - } - - function emitFunctionDeclaration(node: FunctionDeclaration) { - // If we are emitting Method/Constructor it isn't moduleElement and hence already determined to be emitting - // so no need to verify if the declaration is visible - if ((node.kind !== SyntaxKind.FunctionDeclaration || resolver.isDeclarationVisible(node)) && - !resolver.isImplementationOfOverload(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - if (node.kind === SyntaxKind.FunctionDeclaration) { - write("function "); - emitSourceTextOfNode(node.name); - } - else if (node.kind === SyntaxKind.Constructor) { - write("constructor"); - } - else { - emitSourceTextOfNode(node.name); - if (node.flags & NodeFlags.QuestionMark) { - write("?"); - } - } - emitSignatureDeclaration(node); - } - } - - function emitConstructSignatureDeclaration(node: SignatureDeclaration) { - emitJsDocComments(node); - write("new "); - emitSignatureDeclaration(node); - } - - function emitSignatureDeclaration(node: SignatureDeclaration) { - if (node.kind === SyntaxKind.CallSignature || node.kind === SyntaxKind.IndexSignature) { - // Only index and call signatures are emitted directly, so emit their js doc comments, rest will do that in their own functions - emitJsDocComments(node); - } - emitTypeParameters(node.typeParameters); - if (node.kind === SyntaxKind.IndexSignature) { - write("["); - } - else { - write("("); - } - - // Parameters - emitCommaList(node.parameters, emitParameterDeclaration); - - if (node.kind === SyntaxKind.IndexSignature) { - write("]"); - } - else { - write(")"); - } - - // If this is not a constructor and is not private, emit the return type - if (node.kind !== SyntaxKind.Constructor && !(node.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; - resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } - write(";"); - writeLine(); - - function getReturnTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage: DiagnosticMessage; - switch (node.kind) { - case SyntaxKind.ConstructSignature: - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - - case SyntaxKind.CallSignature: - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - - case SyntaxKind.IndexSignature: - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - - case SyntaxKind.Method: - if (node.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; - } - else if (node.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; - } - else { - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; - } - break; - - case SyntaxKind.FunctionDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; - break; - - default: - Debug.fail("This is unknown kind for signature: " + SyntaxKind[node.kind]); - } - - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.name || node, - }; - } - } - - function emitParameterDeclaration(node: ParameterDeclaration) { - increaseIndent(); - emitJsDocComments(node); - if (node.flags & NodeFlags.Rest) { - write("..."); - } - emitSourceTextOfNode(node.name); - if (node.initializer || (node.flags & NodeFlags.QuestionMark)) { - write("?"); - } - decreaseIndent(); - - if (!(node.parent.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getParameterDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } - - function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage: DiagnosticMessage; - switch (node.parent.kind) { - case SyntaxKind.Constructor: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - break; - - case SyntaxKind.ConstructSignature: - // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - - case SyntaxKind.CallSignature: - // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - - case SyntaxKind.Method: - if (node.parent.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; - } - break; - - case SyntaxKind.FunctionDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - - default: - Debug.fail("This is unknown parent for parameter: " + SyntaxKind[node.parent.kind]); - } - - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - } - - function emitNode(node: Node) { - switch (node.kind) { - case SyntaxKind.Constructor: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.Method: - return emitFunctionDeclaration(node); - case SyntaxKind.ConstructSignature: - return emitConstructSignatureDeclaration(node); - case SyntaxKind.CallSignature: - case SyntaxKind.IndexSignature: - return emitSignatureDeclaration(node); - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - return emitAccessorDeclaration(node); - case SyntaxKind.VariableStatement: - return emitVariableStatement(node); - case SyntaxKind.Property: - return emitPropertyDeclaration(node); - case SyntaxKind.InterfaceDeclaration: - return emitInterfaceDeclaration(node); - case SyntaxKind.ClassDeclaration: - return emitClassDeclaration(node); - case SyntaxKind.EnumMember: - return emitEnumMemberDeclaration(node); - case SyntaxKind.EnumDeclaration: - return emitEnumDeclaration(node); - case SyntaxKind.ModuleDeclaration: - return emitModuleDeclaration(node); - case SyntaxKind.ImportDeclaration: - return emitImportDeclaration(node); - case SyntaxKind.ExportAssignment: - return emitExportAssignment(node); - case SyntaxKind.SourceFile: - return emitSourceFile(node); - } - } - - function resolveScriptReference(sourceFile: SourceFile, reference: FileReference) { - var referenceFileName = normalizePath(combinePaths(getDirectoryPath(sourceFile.filename), reference.filename)); - return program.getSourceFile(referenceFileName); - } - - // Contains the reference paths that needs to go in the declaration file. - // Collecting this separately because reference paths need to be first thing in the declaration file - // and we could be collecting these paths from multiple files into single one with --out option - var referencePathsOutput = ""; - function writeReferencePath(referencedFile: SourceFile) { - var declFileName = referencedFile.flags & NodeFlags.DeclarationFile - ? referencedFile.filename // Declaration file, use declaration file name - : shouldEmitToOwnFile(referencedFile) - ? getOwnEmitOutputFilePath(referencedFile, ".d.ts") // Own output file so get the .d.ts file - : getModuleNameFromFilename(compilerOptions.out) + ".d.ts";// Global out file - - declFileName = getRelativePathToDirectoryOrUrl( - getDirectoryPath(normalizeSlashes(jsFilePath)), - declFileName, - compilerHost.getCurrentDirectory(), - /*isAbsolutePathAnUrl*/ false); - - referencePathsOutput += "/// " + newLine; - } - - if (root) { - // Emitting just a single file, so emit references in this file only - if (!compilerOptions.noResolve) { - var addedGlobalFileReference = false; - forEach(root.referencedFiles, fileReference => { - var referencedFile = resolveScriptReference(root, fileReference); - - // All the references that are not going to be part of same file - if ((referencedFile.flags & NodeFlags.DeclarationFile) || // This is a declare file reference - shouldEmitToOwnFile(referencedFile) || // This is referenced file is emitting its own js file - !addedGlobalFileReference) { // Or the global out file corresponding to this reference was not added - - writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { - addedGlobalFileReference = true; - } - } - }); - } - - emitNode(root); - } - else { - // Emit references corresponding to this file - var emittedReferencedFiles: SourceFile[] = []; - forEach(program.getSourceFiles(), sourceFile => { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - // Check what references need to be added - if (!compilerOptions.noResolve) { - forEach(sourceFile.referencedFiles, fileReference => { - var referencedFile = resolveScriptReference(sourceFile, fileReference); - - // If the reference file is a declaration file or an external module, emit that reference - if (isExternalModuleOrDeclarationFile(referencedFile) && - !contains(emittedReferencedFiles, referencedFile)) { // If the file reference was not already emitted - - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); - } - - emitNode(sourceFile); - } - }); - } - + function writeDeclarationFile(jsFilePath: string, sourceFile: SourceFile) { + var emitDeclarationResult = emitDeclarations(program, resolver, diagnostics, jsFilePath, sourceFile); // TODO(shkamat): Should we not write any declaration file if any of them can produce error, // or should we just not write this file like we are doing now - if (!reportedDeclarationError) { - var declarationOutput = referencePathsOutput; - var synchronousDeclarationOutput = writer.getText(); + if (!emitDeclarationResult.reportedDeclarationError) { + var declarationOutput = emitDeclarationResult.referencePathsOutput; // apply additions var appliedSyncOutputPos = 0; - forEach(aliasDeclarationEmitInfo, aliasEmitInfo => { + forEach(emitDeclarationResult.aliasDeclarationEmitInfo, aliasEmitInfo => { if (aliasEmitInfo.asynchronousOutput) { - declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); + declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); declarationOutput += aliasEmitInfo.asynchronousOutput; appliedSyncOutputPos = aliasEmitInfo.outputPos; } }); - declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); - writeFile(getModuleNameFromFilename(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); + declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos); + writeFile(compilerHost, diagnostics, removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); } } - var shouldEmitDeclarations = resolver.shouldEmitDeclarations(); + var hasSemanticErrors = resolver.hasSemanticErrors(); + var isEmitBlocked = resolver.isEmitBlocked(targetSourceFile); + function emitFile(jsFilePath: string, sourceFile?: SourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (shouldEmitDeclarations) { - emitDeclarations(jsFilePath, sourceFile); + if (!isEmitBlocked) { + emitJavaScript(jsFilePath, sourceFile); + if (!hasSemanticErrors && compilerOptions.declaration) { + writeDeclarationFile(jsFilePath, sourceFile); + } } } - forEach(program.getSourceFiles(), sourceFile => { - if (shouldEmitToOwnFile(sourceFile)) { - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - if (compilerOptions.out) { - emitFile(compilerOptions.out); - } + if (targetSourceFile === undefined) { + // No targetSourceFile is specified (e.g. calling emitter from batch compiler) + forEach(program.getSourceFiles(), sourceFile => { + if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, program, ".js"); + emitFile(jsFilePath, sourceFile); + } + }); + if (compilerOptions.out) { + emitFile(compilerOptions.out); + } + } + else { + // targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service) + if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { + // If shouldEmitToOwnFile returns true or targetSourceFile is an external module file, then emit targetSourceFile in its own output file + var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, program, ".js"); + emitFile(jsFilePath, targetSourceFile); + } + else if (!isDeclarationFile(targetSourceFile) && compilerOptions.out) { + // Otherwise, if --out is specified and targetSourceFile is not a declaration file, + // Emit all, non-external-module file, into one single output file + emitFile(compilerOptions.out); + } + } + // Sort and make the unique list of diagnostics diagnostics.sort(compareDiagnostics); diagnostics = deduplicateSortedDiagnostics(diagnostics); + // Update returnCode if there is any EmitterError + var hasEmitterError = forEach(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error); + + // Check and update returnCode for syntactic and semantic + var emitResultStatus: EmitReturnStatus; + if (isEmitBlocked) { + emitResultStatus = EmitReturnStatus.AllOutputGenerationSkipped; + } else if (hasEmitterError) { + emitResultStatus = EmitReturnStatus.EmitErrorsEncountered; + } else if (hasSemanticErrors && compilerOptions.declaration) { + emitResultStatus = EmitReturnStatus.DeclarationGenerationSkipped; + } else if (hasSemanticErrors && !compilerOptions.declaration) { + emitResultStatus = EmitReturnStatus.JSGeneratedWithSemanticErrors; + } else { + emitResultStatus = EmitReturnStatus.Succeeded; + } + return { - errors: diagnostics, + emitResultStatus, + diagnostics, sourceMaps: sourceMapDataList }; } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 68c076367d4..8d7bf9e4fe7 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -17,20 +17,10 @@ module ts { return node; } - var moduleExtensions = [".d.ts", ".ts", ".js"]; - interface ReferenceComments { referencedFiles: FileReference[]; amdDependencies: string[]; - } - - export function getModuleNameFromFilename(filename: string) { - for (var i = 0; i < moduleExtensions.length; i++) { - var ext = moduleExtensions[i]; - var len = filename.length - ext.length; - if (len > 0 && filename.substr(len) === ext) return filename.substr(0, len); - } - return filename; + amdModuleName: string; } export function getSourceFileOfNode(node: Node): SourceFile { @@ -45,22 +35,30 @@ module ts { return file.filename + "(" + loc.line + "," + loc.character + ")"; } - export function getStartPosOfNode(node: Node): number { return node.pos; } - export function getTokenPosOfNode(node: Node): number { - return skipTrivia(getSourceFileOfNode(node).text, node.pos); + export function getTokenPosOfNode(node: Node, sourceFile?: SourceFile): number { + // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* + // want to skip trivia because this will launch us forward to the next token. + if (node.pos === node.end) { + return node.pos; + } + return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } - export function getSourceTextOfNodeFromSourceText(sourceText: string, node: Node): string { + export function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node): string { + var text = sourceFile.text; + return text.substring(skipTrivia(text, node.pos), node.end); + } + + export function getTextOfNodeFromSourceText(sourceText: string, node: Node): string { return sourceText.substring(skipTrivia(sourceText, node.pos), node.end); } - export function getSourceTextOfNode(node: Node): string { - var text = getSourceFileOfNode(node).text; - return text.substring(skipTrivia(text, node.pos), node.end); + export function getTextOfNode(node: Node): string { + return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node); } // Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' @@ -73,15 +71,16 @@ module ts { return identifier.length >= 3 && identifier.charCodeAt(0) === CharacterCodes._ && identifier.charCodeAt(1) === CharacterCodes._ && identifier.charCodeAt(2) === CharacterCodes._ ? identifier.substr(1) : identifier; } + // TODO(jfreeman): Implement declarationNameToString for computed properties // Return display name of an identifier - export function identifierToString(identifier: Identifier) { - return identifier.kind === SyntaxKind.Missing ? "(Missing)" : getSourceTextOfNode(identifier); + export function declarationNameToString(name: DeclarationName) { + return name.kind === SyntaxKind.Missing ? "(Missing)" : getTextOfNode(name); } export function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); - var start = skipTrivia(file.text, node.pos); + var start = node.kind === SyntaxKind.Missing ? node.pos : skipTrivia(file.text, node.pos); var length = node.end - start; return createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); @@ -122,6 +121,22 @@ module ts { return file.externalModuleIndicator !== undefined; } + export function isDeclarationFile(file: SourceFile): boolean { + return (file.flags & NodeFlags.DeclarationFile) !== 0; + } + + export function isConstEnumDeclaration(node: Declaration): boolean { + return node.kind === SyntaxKind.EnumDeclaration && isConst(node); + } + + export function isConst(node: Declaration): boolean { + return !!(node.flags & NodeFlags.Const); + } + + export function isLet(node: Declaration): boolean { + return !!(node.flags & NodeFlags.Let); + } + export function isPrologueDirective(node: Node): boolean { return node.kind === SyntaxKind.ExpressionStatement && (node).expression.kind === SyntaxKind.StringLiteral; } @@ -138,25 +153,27 @@ module ts { return ((node).expression).text === "use strict"; } - export function getLeadingCommentsOfNode(node: Node, sourceFileOfNode: SourceFile) { + export function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode?: SourceFile) { + sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); + // If parameter/type parameter, the prev token trailing comments are part of this node too if (node.kind === SyntaxKind.Parameter || node.kind === SyntaxKind.TypeParameter) { // e.g. (/** blah */ a, /** blah */ b); - return concatenate(getTrailingComments(sourceFileOfNode.text, node.pos), + return concatenate(getTrailingCommentRanges(sourceFileOfNode.text, node.pos), // e.g.: ( // /** blah */ a, // /** blah */ b); - getLeadingComments(sourceFileOfNode.text, node.pos)); + getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { - return getLeadingComments(sourceFileOfNode.text, node.pos); + return getLeadingCommentRanges(sourceFileOfNode.text, node.pos); } } export function getJsDocComments(node: Declaration, sourceFileOfNode: SourceFile) { - return filter(getLeadingCommentsOfNode(node, sourceFileOfNode), comment => isJsDocComment(comment)); + return filter(getLeadingCommentRangesOfNode(node, sourceFileOfNode), comment => isJsDocComment(comment)); - function isJsDocComment(comment: Comment) { + function isJsDocComment(comment: CommentRange) { // True if the comment starts with '/**' but not if it is '/**/' return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk && sourceFileOfNode.text.charCodeAt(comment.pos + 2) === CharacterCodes.asterisk && @@ -198,9 +215,12 @@ module ts { child((node).initializer); case SyntaxKind.Property: case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: return child((node).name) || child((node).type) || child((node).initializer); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: case SyntaxKind.IndexSignature: @@ -214,11 +234,11 @@ module ts { case SyntaxKind.FunctionExpression: case SyntaxKind.FunctionDeclaration: case SyntaxKind.ArrowFunction: - return child((node).name) || - children((node).typeParameters) || - children((node).parameters) || - child((node).type) || - child((node).body); + return child((node).name) || + children((node).typeParameters) || + children((node).parameters) || + child((node).type) || + child((node).body); case SyntaxKind.TypeReference: return child((node).typeName) || children((node).typeArguments); @@ -228,6 +248,12 @@ module ts { return children((node).members); case SyntaxKind.ArrayType: return child((node).elementType); + case SyntaxKind.TupleType: + return children((node).elementTypes); + case SyntaxKind.UnionType: + return children((node).types); + case SyntaxKind.ParenType: + return child((node).type); case SyntaxKind.ArrayLiteral: return children((node).elements); case SyntaxKind.ObjectLiteral: @@ -243,6 +269,9 @@ module ts { return child((node).func) || children((node).typeArguments) || children((node).arguments); + case SyntaxKind.TaggedTemplateExpression: + return child((node).tag) || + child((node).template); case SyntaxKind.TypeAssertion: return child((node).type) || child((node).operand); @@ -286,7 +315,7 @@ module ts { child((node).iterator) || child((node).statement); case SyntaxKind.ForInStatement: - return child((node).declaration) || + return children((node).declarations) || child((node).variable) || child((node).expression) || child((node).statement); @@ -305,9 +334,9 @@ module ts { case SyntaxKind.DefaultClause: return child((node).expression) || children((node).statements); - case SyntaxKind.LabelledStatement: - return child((node).label) || - child((node).statement); + case SyntaxKind.LabeledStatement: + return child((node).label) || + child((node).statement); case SyntaxKind.ThrowStatement: return child((node).expression); case SyntaxKind.TryStatement: @@ -332,6 +361,9 @@ module ts { children((node).typeParameters) || children((node).baseTypes) || children((node).members); + case SyntaxKind.TypeAliasDeclaration: + return child((node).name) || + child((node).type); case SyntaxKind.EnumDeclaration: return child((node).name) || children((node).members); @@ -347,13 +379,215 @@ module ts { child((node).externalModuleName); case SyntaxKind.ExportAssignment: return child((node).exportName); + case SyntaxKind.TemplateExpression: + return child((node).head) || children((node).templateSpans); + case SyntaxKind.TemplateSpan: + return child((node).expression) || child((node).literal); } } + // Warning: This has the same semantics as the forEach family of functions, + // in that traversal terminates in the event that 'visitor' supplies a truthy value. + export function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T { + + return traverse(body); + + function traverse(node: Node): T { + switch (node.kind) { + case SyntaxKind.ReturnStatement: + return visitor(node); + case SyntaxKind.Block: + case SyntaxKind.FunctionBlock: + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.SwitchStatement: + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + case SyntaxKind.LabeledStatement: + case SyntaxKind.TryStatement: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + return forEachChild(node, traverse); + } + } + } + + export function isAnyFunction(node: Node): boolean { + if (node) { + switch (node.kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ArrowFunction: + case SyntaxKind.Method: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.Constructor: + return true; + } + } + + return false; + } + + export function getContainingFunction(node: Node): SignatureDeclaration { + while (true) { + node = node.parent; + if (!node || isAnyFunction(node)) { + return node; + } + } + } + + export function getThisContainer(node: Node, includeArrowFunctions: boolean): Node { + while (true) { + node = node.parent; + if (!node) { + return undefined; + } + switch (node.kind) { + case SyntaxKind.ArrowFunction: + if (!includeArrowFunctions) { + continue; + } + // Fall through + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.Property: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.SourceFile: + return node; + } + } + } + + export function getSuperContainer(node: Node): Node { + while (true) { + node = node.parent; + if (!node) { + return undefined; + } + switch (node.kind) { + case SyntaxKind.Property: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return node; + } + } + } + + export function getInvokedExpression(node: CallLikeExpression): Expression { + if (node.kind === SyntaxKind.TaggedTemplateExpression) { + return (node).tag; + } + + // Will either be a CallExpression or NewExpression. + return (node).func; + } + + export function isExpression(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.ThisKeyword: + case SyntaxKind.SuperKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.ArrayLiteral: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.PropertyAccess: + case SyntaxKind.IndexedAccess: + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + case SyntaxKind.TaggedTemplateExpression: + case SyntaxKind.TypeAssertion: + case SyntaxKind.ParenExpression: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.PrefixOperator: + case SyntaxKind.PostfixOperator: + case SyntaxKind.BinaryExpression: + case SyntaxKind.ConditionalExpression: + case SyntaxKind.TemplateExpression: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.OmittedExpression: + return true; + case SyntaxKind.QualifiedName: + while (node.parent.kind === SyntaxKind.QualifiedName) node = node.parent; + return node.parent.kind === SyntaxKind.TypeQuery; + case SyntaxKind.Identifier: + if (node.parent.kind === SyntaxKind.TypeQuery) { + return true; + } + // fall through + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + var parent = node.parent; + switch (parent.kind) { + case SyntaxKind.VariableDeclaration: + case SyntaxKind.Parameter: + case SyntaxKind.Property: + case SyntaxKind.EnumMember: + case SyntaxKind.PropertyAssignment: + return (parent).initializer === node; + case SyntaxKind.ExpressionStatement: + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.ReturnStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.SwitchStatement: + case SyntaxKind.CaseClause: + case SyntaxKind.ThrowStatement: + case SyntaxKind.SwitchStatement: + return (parent).expression === node; + case SyntaxKind.ForStatement: + return (parent).initializer === node || + (parent).condition === node || + (parent).iterator === node; + case SyntaxKind.ForInStatement: + return (parent).variable === node || + (parent).expression === node; + case SyntaxKind.TypeAssertion: + return node === (parent).operand; + case SyntaxKind.TemplateSpan: + return node === (parent).expression; + default: + if (isExpression(parent)) { + return true; + } + } + } + return false; + } + export function hasRestParameters(s: SignatureDeclaration): boolean { return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & NodeFlags.Rest) !== 0; } + export function isLiteralKind(kind: SyntaxKind): boolean { + return SyntaxKind.FirstLiteralToken <= kind && kind <= SyntaxKind.LastLiteralToken; + } + + export function isTextualLiteralKind(kind: SyntaxKind): boolean { + return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NoSubstitutionTemplateLiteral; + } + + export function isTemplateLiteralKind(kind: SyntaxKind): boolean { + return SyntaxKind.FirstTemplateToken <= kind && kind <= SyntaxKind.LastTemplateToken; + } + export function isInAmbientContext(node: Node): boolean { while (node) { if (node.flags & (NodeFlags.Ambient | NodeFlags.DeclarationFile)) return true; @@ -369,6 +603,7 @@ module ts { case SyntaxKind.VariableDeclaration: case SyntaxKind.Property: case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: case SyntaxKind.EnumMember: case SyntaxKind.Method: case SyntaxKind.FunctionDeclaration: @@ -376,6 +611,7 @@ module ts { case SyntaxKind.SetAccessor: case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.ImportDeclaration: @@ -384,6 +620,32 @@ module ts { return false; } + export function isStatement(n: Node): boolean { + switch(n.kind) { + case SyntaxKind.BreakStatement: + case SyntaxKind.ContinueStatement: + case SyntaxKind.DebuggerStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.ExpressionStatement: + case SyntaxKind.EmptyStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.IfStatement: + case SyntaxKind.LabeledStatement: + case SyntaxKind.ReturnStatement: + case SyntaxKind.SwitchStatement: + case SyntaxKind.ThrowKeyword: + case SyntaxKind.TryStatement: + case SyntaxKind.VariableStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.ExportAssignment: + return true; + default: + return false; + } + } + // True if the given identifier, string literal, or number literal is the name of a declaration node export function isDeclarationOrFunctionExpressionOrCatchVariableName(name: Node): boolean { if (name.kind !== SyntaxKind.Identifier && name.kind !== SyntaxKind.StringLiteral && name.kind !== SyntaxKind.NumericLiteral) { @@ -402,7 +664,49 @@ module ts { return false; } - enum ParsingContext { + export function tryResolveScriptReference(program: Program, sourceFile: SourceFile, reference: FileReference) { + if (!program.getCompilerOptions().noResolve) { + var referenceFileName = isRootedDiskPath(reference.filename) ? reference.filename : combinePaths(getDirectoryPath(sourceFile.filename), reference.filename); + referenceFileName = getNormalizedAbsolutePath(referenceFileName, program.getCompilerHost().getCurrentDirectory()); + return program.getSourceFile(referenceFileName); + } + } + + export function getAncestor(node: Node, kind: SyntaxKind): Node { + switch (kind) { + // special-cases that can be come first + case SyntaxKind.ClassDeclaration: + while (node) { + switch (node.kind) { + case SyntaxKind.ClassDeclaration: + return node; + case SyntaxKind.EnumDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.ImportDeclaration: + // early exit cases - declarations cannot be nested in classes + return undefined; + default: + node = node.parent; + continue; + } + } + break; + default: + while (node) { + if (node.kind === kind) { + return node; + } + node = node.parent; + } + break; + } + + return undefined; + } + + const enum ParsingContext { SourceElements, // Elements in source file ModuleElements, // Elements in module declaration BlockStatements, // Statements in block @@ -419,10 +723,11 @@ module ts { Parameters, // Parameters in parameter list TypeParameters, // Type parameters in type parameter list TypeArguments, // Type arguments in type argument list + TupleElementTypes, // Element types in tuple element type list Count // Number of parsing contexts } - enum Tristate { + const enum Tristate { False, True, Unknown @@ -446,52 +751,88 @@ module ts { case ParsingContext.Parameters: return Diagnostics.Parameter_declaration_expected; case ParsingContext.TypeParameters: return Diagnostics.Type_parameter_declaration_expected; case ParsingContext.TypeArguments: return Diagnostics.Type_argument_expected; + case ParsingContext.TupleElementTypes: return Diagnostics.Type_expected; } }; - enum LookAheadMode { + const enum LookAheadMode { NotLookingAhead, NoErrorYet, Error } - enum ModifierContext { - SourceElements, // Top level elements in a source file - ModuleElements, // Elements in module declaration - ClassMembers, // Members in class declaration - Parameters, // Parameters in parameter list + export interface ReferencePathMatchResult { + fileReference?: FileReference + diagnostic?: DiagnosticMessage + isNoDefaultLib?: boolean } - enum TrailingCommaBehavior { - Disallow, - Allow, - Preserve - } - - // Tracks whether we nested (directly or indirectly) in a certain control block. - // Used for validating break and continue statements. - enum ControlBlockContext { - NotNested, - Nested, - CrossingFunctionBoundary - } - - interface LabelledStatementInfo { - addLabel(label: Identifier): void; - pushCurrentLabelSet(isIterationStatement: boolean): void; - pushFunctionBoundary(): void; - pop(): void; - nodeIsNestedInLabel(label: Identifier, requireIterationStatement: boolean, stopAtFunctionBoundary: boolean): ControlBlockContext; + export function getFileReferenceFromReferencePath(comment: string, commentRange: CommentRange): ReferencePathMatchResult { + var simpleReferenceRegEx = /^\/\/\/\s*/gim; + if (simpleReferenceRegEx.exec(comment)) { + if (isNoDefaultLibRegEx.exec(comment)) { + return { + isNoDefaultLib: true + } + } + else { + var matchResult = fullTripleSlashReferencePathRegEx.exec(comment); + if (matchResult) { + var start = commentRange.pos; + var end = commentRange.end; + return { + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, + isNoDefaultLib: false + }; + } + else { + return { + diagnostic: Diagnostics.Invalid_reference_directive_syntax, + isNoDefaultLib: false + }; + } + } + } + return undefined; } export function isKeyword(token: SyntaxKind): boolean { return SyntaxKind.FirstKeyword <= token && token <= SyntaxKind.LastKeyword; } + export function isTrivia(token: SyntaxKind) { + return SyntaxKind.FirstTriviaToken <= token && token <= SyntaxKind.LastTriviaToken; + } + + export function isUnterminatedTemplateEnd(node: LiteralExpression) { + Debug.assert(isTemplateLiteralKind(node.kind)); + var sourceText = getSourceFileOfNode(node).text; + + // If we're not at the EOF, we know we must be terminated. + if (node.end !== sourceText.length) { + return false; + } + + // The literal can only be unterminated if it is a template tail or a no-sub template. + if (node.kind !== SyntaxKind.TemplateTail && node.kind !== SyntaxKind.NoSubstitutionTemplateLiteral) { + return false; + } + + // If we didn't end in a backtick, we must still be in the middle of a template. + // If we did, make sure that it's not the *initial* backtick. + return sourceText.charCodeAt(node.end - 1) !== CharacterCodes.backtick || node.text.length === 0; + } + export function isModifier(token: SyntaxKind): boolean { switch (token) { case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: case SyntaxKind.StaticKeyword: case SyntaxKind.ExportKeyword: case SyntaxKind.DeclareKeyword: @@ -500,6 +841,18 @@ module ts { return false; } + function modifierToFlag(token: SyntaxKind): NodeFlags { + switch (token) { + case SyntaxKind.StaticKeyword: return NodeFlags.Static; + case SyntaxKind.PublicKeyword: return NodeFlags.Public; + case SyntaxKind.ProtectedKeyword: return NodeFlags.Protected; + case SyntaxKind.PrivateKeyword: return NodeFlags.Private; + case SyntaxKind.ExportKeyword: return NodeFlags.Export; + case SyntaxKind.DeclareKeyword: return NodeFlags.Ambient; + } + return 0; + } + export function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget, version: string, isOpen: boolean = false): SourceFile { var file: SourceFile; var scanner: Scanner; @@ -510,130 +863,153 @@ module ts { var identifierCount = 0; var nodeCount = 0; var lineStarts: number[]; - var isInStrictMode = false; var lookAheadMode = LookAheadMode.NotLookingAhead; - var inAmbientContext = false; - var inFunctionBody = false; - var inSwitchStatement = ControlBlockContext.NotNested; - var inIterationStatement = ControlBlockContext.NotNested; - // The following is a state machine that tracks what labels are in our current parsing - // context. So if we are parsing a node that is nested (arbitrarily deeply) in a label, - // it will be tracked in this data structure. It is used for checking break/continue - // statements, and checking for duplicate labels. - var labelledStatementInfo: LabelledStatementInfo = (() => { - // These are initialized on demand because labels are rare, so it is usually - // not even necessary to allocate these. - var functionBoundarySentinel: StringSet; - var currentLabelSet: StringSet; - var labelSetStack: StringSet[]; - var isIterationStack: boolean[]; + // Flags that dictate what parsing context we're in. For example: + // Whether or not we are in strict parsing mode. All that changes in strict parsing mode is + // that some tokens that would be considered identifiers may be considered keywords. When + // rewinding, we need to store and restore this as the mode may have changed. + // + // When adding more parser context flags, consider which is the more common case that the + // flag will be in. This should be hte 'false' state for that flag. The reason for this is + // that we don't store data in our nodes unless the value is in the *non-default* state. So, + // for example, more often than code 'allows-in' (or doesn't 'disallow-in'). We opt for + // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost + // all nodes would need extra state on them to store this info. + // + // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 + // grammar specification. + // + // An important thing about these context concepts. By default they are effectively inherited + // while parsing through every grammar production. i.e. if you don't change them, then when + // you parse a sub-production, it will have the same context values as hte parent production. + // This is great most of the time. After all, consider all the 'expression' grammar productions + // and how nearly all of them pass along the 'in' and 'yield' context values: + // + // EqualityExpression[In, Yield] : + // RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] == RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] != RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] === RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] !== RelationalExpression[?In, ?Yield] + // + // Where you have to be careful is then understanding what the points are in the grammar + // where the values are *not* passed along. For example: + // + // SingleNameBinding[Yield,GeneratorParameter] + // [+GeneratorParameter]BindingIdentifier[Yield] Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + // + // Here this is saying that if the GeneratorParameter context flag is set, that we should + // explicitly set the 'yield' context flag to false before calling into the BindingIdentifier + // and we should explicitly unset the 'yield' context flag before calling into the Initializer. + // production. Conversely, if the GeneratorParameter context flag is not set, then we + // should leave the 'yield' context flag alone. + // + // Getting this all correct is tricky and requires careful reading of the grammar to + // understand when these values should be changed versus when they should be inherited. + var contextFlags: ParserContextFlags = 0; - function addLabel(label: Identifier): void { - if (!currentLabelSet) { - currentLabelSet = {}; - } - currentLabelSet[label.text] = true; + function setContextFlag(val: Boolean, flag: ParserContextFlags) { + if (val) { + contextFlags |= flag; + } + else { + contextFlags &= ~flag; + } + } + + function setStrictModeContext(val: boolean) { + setContextFlag(val, ParserContextFlags.StrictMode); + } + + function setDisallowInContext(val: boolean) { + setContextFlag(val, ParserContextFlags.DisallowIn); + } + + function setYieldContext(val: boolean) { + setContextFlag(val, ParserContextFlags.Yield); + } + + function setGeneratorParameterContext(val: boolean) { + setContextFlag(val, ParserContextFlags.GeneratorParameter); + } + + function allowInAnd(func: () => T): T { + if (contextFlags & ParserContextFlags.DisallowIn) { + setDisallowInContext(false); + var result = func(); + setDisallowInContext(true); + return result; + } + + // no need to do anything special if 'in' is already allowed. + return func(); + } + + function disallowInAnd(func: () => T): T { + if (contextFlags & ParserContextFlags.DisallowIn) { + // no need to do anything special if 'in' is already disallowed. + return func(); } - function pushCurrentLabelSet(isIterationStatement: boolean): void { - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - Debug.assert(currentLabelSet !== undefined); - labelSetStack.push(currentLabelSet); - isIterationStack.push(isIterationStatement); - currentLabelSet = undefined; + setDisallowInContext(true); + var result = func(); + setDisallowInContext(false); + return result; + } + + function doInYieldContext(func: () => T): T { + if (contextFlags & ParserContextFlags.Yield) { + // no need to do anything special if we're already in the [Yield] context. + return func(); } - function pushFunctionBoundary(): void { - if (!functionBoundarySentinel) { - functionBoundarySentinel = {}; - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - } - Debug.assert(currentLabelSet === undefined); - labelSetStack.push(functionBoundarySentinel); + setYieldContext(true); + var result = func(); + setYieldContext(false); + return result; + } - // It does not matter what we push here, since we will never ask if a function boundary - // is an iteration statement - isIterationStack.push(false); + function doOutsideOfYieldContext(func: () => T): T { + if (contextFlags & ParserContextFlags.Yield) { + setYieldContext(false); + var result = func(); + setYieldContext(true); + return result; } - function pop(): void { - // Assert that we are in a "pushed" state - Debug.assert(labelSetStack.length && isIterationStack.length && currentLabelSet === undefined); - labelSetStack.pop(); - isIterationStack.pop(); - } + // no need to do anything special if we're not in the [Yield] context. + return func(); + } - function nodeIsNestedInLabel(label: Identifier, requireIterationStatement: boolean, stopAtFunctionBoundary: boolean): ControlBlockContext { - if (!requireIterationStatement && currentLabelSet && hasProperty(currentLabelSet, label.text)) { - return ControlBlockContext.Nested; - } + function inYieldContext() { + return (contextFlags & ParserContextFlags.Yield) !== 0; + } - if (!labelSetStack) { - return ControlBlockContext.NotNested; - } + function inStrictModeContext() { + return (contextFlags & ParserContextFlags.StrictMode) !== 0; + } - // We want to start searching for the label at the lowest point in the tree, - // and climb up from there. So we start at the end of the labelSetStack array. - var crossedFunctionBoundary = false; - for (var i = labelSetStack.length - 1; i >= 0; i--) { - var labelSet = labelSetStack[i]; - // Not allowed to cross function boundaries, so stop if we encounter one - if (labelSet === functionBoundarySentinel) { - if (stopAtFunctionBoundary) { - break; - } - else { - crossedFunctionBoundary = true; - continue; - } - } - - // If we require an iteration statement, only search in the current - // statement if it is an iteration statement - if (requireIterationStatement && isIterationStack[i] === false) { - continue; - } + function inGeneratorParameterContext() { + return (contextFlags & ParserContextFlags.GeneratorParameter) !== 0; + } - if (hasProperty(labelSet, label.text)) { - return crossedFunctionBoundary ? ControlBlockContext.CrossingFunctionBoundary : ControlBlockContext.Nested; - } - } + function inDisallowInContext() { + return (contextFlags & ParserContextFlags.DisallowIn) !== 0; + } - // This is a bit of a misnomer. If the caller passed true for stopAtFunctionBoundary, - // there actually may be an enclosing label across a function boundary, but we will - // just return NotNested - return ControlBlockContext.NotNested; - } + function getLineStarts(): number[] { + return lineStarts || (lineStarts = computeLineStarts(sourceText)); + } - return { - addLabel: addLabel, - pushCurrentLabelSet: pushCurrentLabelSet, - pushFunctionBoundary: pushFunctionBoundary, - pop: pop, - nodeIsNestedInLabel: nodeIsNestedInLabel, - }; - })(); - - function getLineAndCharacterlFromSourcePosition(position: number) { - if (!lineStarts) { - lineStarts = getLineStarts(sourceText); - } - return getLineAndCharacterOfPosition(lineStarts, position); + function getLineAndCharacterFromSourcePosition(position: number) { + return getLineAndCharacterOfPosition(getLineStarts(), position); } function getPositionFromSourceLineAndCharacter(line: number, character: number): number { - if (!lineStarts) { - lineStarts = getLineStarts(sourceText); - } - return getPositionFromLineAndCharacter(lineStarts, line, character); + return getPositionFromLineAndCharacter(getLineStarts(), line, character); } function error(message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { @@ -643,40 +1019,14 @@ module ts { errorAtPos(start, length, message, arg0, arg1, arg2); } - // This is just like createDiagnosticForNode except that it uses the current file - // being parsed instead of the file containing the node. This is because during - // parse, the nodes do not have parent pointers to get to the file. - // - // It is very intentional that we are not checking or changing the lookAheadMode value - // here. 'grammarErrorOnNode' is called when we are doing extra grammar checks and not - // when we are doing the actual parsing to determine what the user wrote. In other - // words, this function is called once we have already parsed the node, and are just - // applying some stricter checks on that node. - function grammarErrorOnNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { - var span = getErrorSpanForNode(node); - var start = skipTrivia(file.text, span.pos); - var length = span.end - start; - - file.syntacticErrors.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - - function reportInvalidUseInStrictMode(node: Identifier): void { - // identifierToString cannot be used here since it uses a backreference to 'parent' that is not yet set - var name = sourceText.substring(skipTrivia(sourceText, node.pos), node.end); - grammarErrorOnNode(node, Diagnostics.Invalid_use_of_0_in_strict_mode, name); - } - - - function grammarErrorAtPos(start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { - file.syntacticErrors.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function errorAtPos(start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { - var lastErrorPos = file.syntacticErrors.length - ? file.syntacticErrors[file.syntacticErrors.length - 1].start + var lastErrorPos = file.parseDiagnostics.length + ? file.parseDiagnostics[file.parseDiagnostics.length - 1].start : -1; if (start !== lastErrorPos) { - file.syntacticErrors.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + var diagnostic = createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); + diagnostic.isParseError = true; + file.parseDiagnostics.push(diagnostic); } if (lookAheadMode === LookAheadMode.NoErrorYet) { @@ -717,11 +1067,15 @@ module ts { return token = scanner.reScanSlashToken(); } + function reScanTemplateToken(): SyntaxKind { + return token = scanner.reScanTemplateToken(); + } + function lookAheadHelper(callback: () => T, alwaysResetState: 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). var saveToken = token; - var saveSyntacticErrorsLength = file.syntacticErrors.length; + var saveSyntacticErrorsLength = file.parseDiagnostics.length; // Keep track of the current look ahead mode (this matters if we have nested // speculative parsing). @@ -743,7 +1097,7 @@ module ts { lookAheadMode = saveLookAheadMode; if (!result || alwaysResetState) { token = saveToken; - file.syntacticErrors.length = saveSyntacticErrorsLength; + file.parseDiagnostics.length = saveSyntacticErrorsLength; } return result; @@ -771,7 +1125,17 @@ module ts { } function isIdentifier(): boolean { - return token === SyntaxKind.Identifier || (isInStrictMode ? token > SyntaxKind.LastFutureReservedWord : token > SyntaxKind.LastReservedWord); + if (token === SyntaxKind.Identifier) { + return true; + } + + // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is + // considered a keyword and is not an identifier. + if (token === SyntaxKind.YieldKeyword && inYieldContext()) { + return false; + } + + return inStrictModeContext() ? token > SyntaxKind.LastFutureReservedWord : token > SyntaxKind.LastReservedWord; } function parseExpected(t: SyntaxKind): boolean { @@ -816,7 +1180,10 @@ module ts { function createNode(kind: SyntaxKind, pos?: number): Node { nodeCount++; var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)))(); - if (!(pos >= 0)) pos = scanner.getStartPos(); + if (!(pos >= 0)) { + pos = scanner.getStartPos(); + } + node.pos = pos; node.end = pos; return node; @@ -824,14 +1191,20 @@ module ts { function finishNode(node: T): T { node.end = scanner.getStartPos(); + + if (contextFlags) { + node.parserContextFlags = contextFlags; + } + return node; } - function createMissingNode(): Node { - return createNode(SyntaxKind.Missing); + function createMissingNode(pos?: number): Node { + return createNode(SyntaxKind.Missing, pos); } function internIdentifier(text: string): string { + text = escapeIdentifier(text); return hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); } @@ -842,13 +1215,14 @@ module ts { identifierCount++; if (isIdentifier) { var node = createNode(SyntaxKind.Identifier); - var text = escapeIdentifier(scanner.getTokenValue()); - node.text = internIdentifier(text); + node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } error(Diagnostics.Identifier_expected); - return createMissingNode(); + var node = createMissingNode(); + node.text = ""; + return node; } function parseIdentifier(): Identifier { @@ -860,7 +1234,9 @@ module ts { } function isPropertyName(): boolean { - return token >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral || token === SyntaxKind.NumericLiteral; + return token >= SyntaxKind.Identifier || + token === SyntaxKind.StringLiteral || + token === SyntaxKind.NumericLiteral; } function parsePropertyName(): Identifier { @@ -880,7 +1256,7 @@ module ts { function parseAnyContextualModifier(): boolean { return isModifier(token) && tryParse(() => { nextToken(); - return token === SyntaxKind.OpenBracketToken || isPropertyName(); + return token === SyntaxKind.OpenBracketToken || token === SyntaxKind.AsteriskToken || isPropertyName(); }); } @@ -896,25 +1272,27 @@ module ts { case ParsingContext.SwitchClauses: return token === SyntaxKind.CaseKeyword || token === SyntaxKind.DefaultKeyword; case ParsingContext.TypeMembers: - return isTypeMember(); + return isStartOfTypeMember(); case ParsingContext.ClassMembers: return lookAhead(isClassMemberStart); case ParsingContext.EnumMembers: - case ParsingContext.ObjectLiteralMembers: return isPropertyName(); + case ParsingContext.ObjectLiteralMembers: + return token === SyntaxKind.AsteriskToken || isPropertyName(); case ParsingContext.BaseTypeReferences: return isIdentifier() && ((token !== SyntaxKind.ExtendsKeyword && token !== SyntaxKind.ImplementsKeyword) || !lookAhead(() => (nextToken(), isIdentifier()))); case ParsingContext.VariableDeclarations: case ParsingContext.TypeParameters: return isIdentifier(); case ParsingContext.ArgumentExpressions: - return isExpression(); + return token === SyntaxKind.CommaToken || isStartOfExpression(); case ParsingContext.ArrayLiteralMembers: - return token === SyntaxKind.CommaToken || isExpression(); + return token === SyntaxKind.CommaToken || isStartOfExpression(); case ParsingContext.Parameters: - return isParameter(); + return isStartOfParameter(); case ParsingContext.TypeArguments: - return isType(); + case ParsingContext.TupleElementTypes: + return token === SyntaxKind.CommaToken || isStartOfType(); } Debug.fail("Non-exhaustive case in 'isListElement'."); @@ -949,6 +1327,7 @@ module ts { // Tokens other than ')' are here for better error recovery return token === SyntaxKind.CloseParenToken || token === SyntaxKind.SemicolonToken; case ParsingContext.ArrayLiteralMembers: + case ParsingContext.TupleElementTypes: return token === SyntaxKind.CloseBracketToken; case ParsingContext.Parameters: // Tokens other than ')' and ']' (the latter for index signatures) are here for better error recovery @@ -1003,16 +1382,16 @@ module ts { parsingContext |= 1 << kind; var result = >[]; result.pos = getNodePos(); - var saveIsInStrictMode = isInStrictMode; + var savedStrictModeContext = inStrictModeContext(); while (!isListTerminator(kind)) { if (isListElement(kind, /* inErrorRecovery */ false)) { var element = parseElement(); result.push(element); // test elements only if we are not already in strict mode - if (!isInStrictMode && checkForStrictMode) { + if (!inStrictModeContext() && checkForStrictMode) { if (isPrologueDirective(element)) { if (isUseStrictPrologueDirective(element)) { - isInStrictMode = true; + setStrictModeContext(true); checkForStrictMode = false; } } @@ -1029,21 +1408,19 @@ module ts { nextToken(); } } - isInStrictMode = saveIsInStrictMode; + setStrictModeContext(savedStrictModeContext); result.end = getNodeEnd(); parsingContext = saveParsingContext; return result; } // Parses a comma-delimited list of elements - function parseDelimitedList(kind: ParsingContext, parseElement: () => T, trailingCommaBehavior: TrailingCommaBehavior): NodeArray { + function parseDelimitedList(kind: ParsingContext, parseElement: () => T): NodeArray { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; var result = >[]; result.pos = getNodePos(); - // Keep track of how many errors we had before the list started. If we don't see any new - // errors resulting from the list being malformed, we are free to complain about a trailing comma. - var errorCountBeforeParsingList = file.syntacticErrors.length; + var commaStart = -1; // Meaning the previous token was not a comma while (true) { if (isListElement(kind, /* inErrorRecovery */ false)) { @@ -1059,19 +1436,6 @@ module ts { error(Diagnostics._0_expected, ","); } else if (isListTerminator(kind)) { - // Check if the last token was a comma. - if (commaStart >= 0) { - if (trailingCommaBehavior === TrailingCommaBehavior.Disallow) { - if (file.syntacticErrors.length === errorCountBeforeParsingList) { - // Report a grammar error so we don't affect lookahead - grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, Diagnostics.Trailing_comma_not_allowed); - } - } - else if (trailingCommaBehavior === TrailingCommaBehavior.Preserve) { - result.push(createNode(SyntaxKind.OmittedExpression)); - } - } - break; } else { @@ -1082,6 +1446,17 @@ module ts { nextToken(); } } + + // Recording the trailing comma is deliberately done after the previous + // loop, and not just if we see a list terminator. This is because the list + // may have ended incorrectly, but it is still important to know if there + // was a trailing comma. + // Check if the last token was a comma. + if (commaStart >= 0) { + // Always preserve a trailing comma by marking it on the NodeArray + result.hasTrailingComma = true; + } + result.end = getNodeEnd(); parsingContext = saveParsingContext; return result; @@ -1095,19 +1470,13 @@ module ts { return result; } - function createNodeArray(node: T): NodeArray { - var result = >[node]; - result.pos = node.pos; - result.end = node.end; - return result; - } - - function parseBracketedList(kind: ParsingContext, parseElement: () => T, startToken: SyntaxKind, endToken: SyntaxKind): NodeArray { - if (parseExpected(startToken)) { - var result = parseDelimitedList(kind, parseElement, TrailingCommaBehavior.Disallow); - parseExpected(endToken); + function parseBracketedList(kind: ParsingContext, parseElement: () => T, open: SyntaxKind, close: SyntaxKind): NodeArray { + if (parseExpected(open)) { + var result = parseDelimitedList(kind, parseElement); + parseExpected(close); return result; } + return createMissingList(); } @@ -1129,7 +1498,48 @@ module ts { return finishNode(node); } - function parseLiteralNode(internName?:boolean): LiteralExpression { + function parseTemplateExpression() { + var template = createNode(SyntaxKind.TemplateExpression); + + template.head = parseLiteralNode(); + Debug.assert(template.head.kind === SyntaxKind.TemplateHead, "Template head has wrong token kind"); + + var templateSpans = >[]; + templateSpans.pos = getNodePos(); + + do { + templateSpans.push(parseTemplateSpan()); + } + while (templateSpans[templateSpans.length - 1].literal.kind === SyntaxKind.TemplateMiddle) + + templateSpans.end = getNodeEnd(); + template.templateSpans = templateSpans; + + return finishNode(template); + } + + function parseTemplateSpan(): TemplateSpan { + var span = createNode(SyntaxKind.TemplateSpan); + span.expression = allowInAnd(parseExpression); + + var literal: LiteralExpression; + + if (token === SyntaxKind.CloseBraceToken) { + reScanTemplateToken() + literal = parseLiteralNode(); + } + else { + error(Diagnostics.Invalid_template_literal_expected); + literal = createMissingNode(); + literal.text = ""; + } + + span.literal = literal; + + return finishNode(span); + } + + function parseLiteralNode(internName?: boolean): LiteralExpression { var node = createNode(token); var text = scanner.getTokenValue(); node.text = internName ? internIdentifier(text) : text; @@ -1141,26 +1551,23 @@ module ts { // Octal literals are not allowed in strict mode or ES5 // Note that theoretically the following condition would hold true literals like 009, // which is not octal.But because of how the scanner separates the tokens, we would - // never get a token like this.Instead, we would get 00 and 9 as two separate tokens. + // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. if (node.kind === SyntaxKind.NumericLiteral && sourceText.charCodeAt(tokenPos) === CharacterCodes._0 && isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - if (isInStrictMode) { - grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= ScriptTarget.ES5) { - grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } + node.flags |= NodeFlags.OctalLiteral; } return node; } function parseStringLiteral(): LiteralExpression { - if (token === SyntaxKind.StringLiteral) return parseLiteralNode(/*internName:*/ true); + if (token === SyntaxKind.StringLiteral) { + return parseLiteralNode(/*internName:*/ true); + } error(Diagnostics.String_literal_expected); return createMissingNode(); } @@ -1191,7 +1598,7 @@ module ts { // user writes a constraint that is an expression and not an actual type, then parse // it out as an expression (so we can recover well), but report that a type is needed // instead. - if (isType() || !isExpression()) { + if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } else { @@ -1202,8 +1609,7 @@ module ts { // // // We do *not* want to consume the > as we're consuming the expression for "". - var expr = parseUnaryExpression(); - grammarErrorOnNode(expr, Diagnostics.Type_expected); + node.expression = parseUnaryExpression(); } } @@ -1212,32 +1618,45 @@ module ts { function parseTypeParameters(): NodeArray { if (token === SyntaxKind.LessThanToken) { - var pos = getNodePos(); - var result = parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); - if (!result.length) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, Diagnostics.Type_parameter_list_cannot_be_empty); - } - return result; + return parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); } } function parseParameterType(): TypeNode { - return parseOptional(SyntaxKind.ColonToken) ? token === SyntaxKind.StringLiteral ? parseStringLiteral() : parseType() : undefined; + return parseOptional(SyntaxKind.ColonToken) + ? token === SyntaxKind.StringLiteral + ? parseStringLiteral() + : parseType() + : undefined; } - function isParameter(): boolean { + function isStartOfParameter(): boolean { return token === SyntaxKind.DotDotDotToken || isIdentifier() || isModifier(token); } - function parseParameter(flags: NodeFlags = 0): ParameterDeclaration { + function setModifiers(node: Node, modifiers: ModifiersArray) { + if (modifiers) { + node.flags |= modifiers.flags; + node.modifiers = modifiers; + } + } + + function parseParameter(): ParameterDeclaration { var node = createNode(SyntaxKind.Parameter); - node.flags |= parseAndCheckModifiers(ModifierContext.Parameters); + var modifiers = parseModifiers(); + setModifiers(node, modifiers); if (parseOptional(SyntaxKind.DotDotDotToken)) { node.flags |= NodeFlags.Rest; } - node.name = parseIdentifier(); + + // SingleNameBinding[Yield,GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + + node.name = inGeneratorParameterContext() + ? doInYieldContext(parseIdentifier) + : parseIdentifier(); + if (node.name.kind === SyntaxKind.Missing && node.flags === 0 && isModifier(token)) { // in cases like // 'use strict' @@ -1254,7 +1673,9 @@ module ts { node.flags |= NodeFlags.QuestionMark; } node.type = parseParameterType(); - node.initializer = parseInitializer(/*inParameter*/ true); + node.initializer = inGeneratorParameterContext() + ? doOutsideOfYieldContext(parseParameterInitializer) + : parseParameterInitializer(); // Do not check for initializers in an ambient context for parameters. This is not // a grammar error because the grammar allows arbitrary call signatures in @@ -1267,164 +1688,123 @@ module ts { return finishNode(node); } - function parseSignature(kind: SyntaxKind, returnToken: SyntaxKind): ParsedSignature { + function parseParameterInitializer() { + return parseInitializer(/*inParameter*/ true); + } + + function parseSignature(kind: SyntaxKind, returnToken: SyntaxKind, returnTokenRequired: boolean, yieldAndGeneratorParameterContext: boolean): ParsedSignature { + var signature = {}; + fillSignature(kind, returnToken, returnTokenRequired, yieldAndGeneratorParameterContext, signature); + return signature; + } + + function fillSignature( + kind: SyntaxKind, + returnToken: SyntaxKind, + returnTokenRequired: boolean, + yieldAndGeneratorParameterContext: boolean, + signature: ParsedSignature): void { + if (kind === SyntaxKind.ConstructSignature) { parseExpected(SyntaxKind.NewKeyword); } - var typeParameters = parseTypeParameters(); - var parameters = parseParameterList(SyntaxKind.OpenParenToken, SyntaxKind.CloseParenToken); - checkParameterList(parameters); - var type = parseOptional(returnToken) ? parseType() : undefined; - return { - typeParameters: typeParameters, - parameters: parameters, - type: type - }; - } + signature.typeParameters = parseTypeParameters(); + signature.parameters = parseParameterList(yieldAndGeneratorParameterContext); - // Because we use this for index signatures as well, we sometimes use - // parentheses, and sometimes use brackets. - function parseParameterList(startDelimiter: SyntaxKind, endDelimiter: SyntaxKind) { - return parseBracketedList(ParsingContext.Parameters, parseParameter, startDelimiter, endDelimiter); - } - - function checkParameterList(parameters: NodeArray): void { - var seenOptionalParameter = false; - var parameterCount = parameters.length; - - for (var i = 0; i < parameterCount; i++) { - var parameter = parameters[i]; - // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the - // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code - // or if its FunctionBody is strict code(11.1.5). - // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a - // strict mode FunctionDeclaration or FunctionExpression(13.1) - if (isInStrictMode && isEvalOrArgumentsIdentifier(parameter.name)) { - reportInvalidUseInStrictMode(parameter.name); - return; - } - else if (parameter.flags & NodeFlags.Rest) { - if (i !== (parameterCount - 1)) { - grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - return; - } - - if (parameter.flags & NodeFlags.QuestionMark) { - grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_be_optional); - return; - } - - if (parameter.initializer) { - grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer); - return; - } - } - else if (parameter.flags & NodeFlags.QuestionMark || parameter.initializer) { - seenOptionalParameter = true; - - if (parameter.flags & NodeFlags.QuestionMark && parameter.initializer) { - grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - return; - } - } - else { - if (seenOptionalParameter) { - grammarErrorOnNode(parameter.name, Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - return; - } - } + if (returnTokenRequired) { + parseExpected(returnToken); + signature.type = parseType(); } + else if (parseOptional(returnToken)) { + signature.type = parseType(); + } + } + + // Note: after careful analysis of the grammar, it does not appear to be possible to + // have 'Yield' And 'GeneratorParameter' not in sync. i.e. any production calling + // this FormalParameters production either always sets both to true, or always sets + // both to false. As such we only have a single parameter to represent both. + function parseParameterList(yieldAndGeneratorParameterContext: boolean) { + // FormalParameters[Yield,GeneratorParameter] : + // ... + // + // FormalParameter[Yield,GeneratorParameter] : + // BindingElement[?Yield, ?GeneratorParameter] + // + // BindingElement[Yield, GeneratorParameter ] : See 13.2.3 + // SingleNameBinding[?Yield, ?GeneratorParameter] + // [+GeneratorParameter]BindingPattern[?Yield, GeneratorParameter]Initializer[In]opt + // [~GeneratorParameter]BindingPattern[?Yield]Initializer[In, ?Yield]opt + // + // SingleNameBinding[Yield, GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + if (parseExpected(SyntaxKind.OpenParenToken)) { + var savedYieldContext = inYieldContext(); + var savedGeneratorParameterContext = inGeneratorParameterContext(); + + setYieldContext(yieldAndGeneratorParameterContext); + setGeneratorParameterContext(yieldAndGeneratorParameterContext); + + var result = parseDelimitedList(ParsingContext.Parameters, parseParameter); + parseExpected(SyntaxKind.CloseParenToken); + + setYieldContext(savedYieldContext); + setGeneratorParameterContext(savedGeneratorParameterContext); + + return result; + } + + return createMissingList(); } function parseSignatureMember(kind: SyntaxKind, returnToken: SyntaxKind): SignatureDeclaration { var node = createNode(kind); - var sig = parseSignature(kind, returnToken); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; + fillSignature(kind, returnToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false, node); parseSemicolon(); return finishNode(node); } - function parseIndexSignatureMember(): SignatureDeclaration { - var node = createNode(SyntaxKind.IndexSignature); - var errorCountBeforeIndexSignature = file.syntacticErrors.length; - var indexerStart = scanner.getTokenPos(); - node.parameters = parseParameterList(SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); - var indexerLength = scanner.getStartPos() - indexerStart; + function parseIndexSignatureMember(fullStart: number, modifiers: ModifiersArray): SignatureDeclaration { + var node = createNode(SyntaxKind.IndexSignature, fullStart); + setModifiers(node, modifiers); + node.parameters = parseBracketedList(ParsingContext.Parameters, parseParameter, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); node.type = parseTypeAnnotation(); parseSemicolon(); - if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { - checkIndexSignature(node, indexerStart, indexerLength); - } - return finishNode(node); - } - - function checkIndexSignature(node: SignatureDeclaration, indexerStart: number, indexerLength: number): void { - var parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - var arityDiagnostic = Diagnostics.An_index_signature_must_have_exactly_one_parameter; - if (parameter) { - grammarErrorOnNode(parameter.name, arityDiagnostic); - } - else { - grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); - } - return; - } - else if (parameter.flags & NodeFlags.Rest) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - return; - } - else if (parameter.flags & NodeFlags.Modifier) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - return; - } - else if (parameter.flags & NodeFlags.QuestionMark) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - return; - } - else if (parameter.initializer) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - return; - } - else if (!parameter.type) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - return; - } - else if (parameter.type.kind !== SyntaxKind.StringKeyword && - parameter.type.kind !== SyntaxKind.NumberKeyword) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); - return; - } - else if (!node.type) { - grammarErrorAtPos(indexerStart, indexerLength, Diagnostics.An_index_signature_must_have_a_type_annotation); - return; - } + return finishNode(node) } function parsePropertyOrMethod(): Declaration { - var node = createNode(SyntaxKind.Unknown); - node.name = parsePropertyName(); + var fullStart = scanner.getStartPos(); + var name = parsePropertyName(); + var flags = 0; if (parseOptional(SyntaxKind.QuestionToken)) { - node.flags |= NodeFlags.QuestionMark; + flags = NodeFlags.QuestionMark; } + if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { - node.kind = SyntaxKind.Method; - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); - (node).typeParameters = sig.typeParameters; - (node).parameters = sig.parameters; - (node).type = sig.type; + var method = createNode(SyntaxKind.Method, fullStart); + method.name = name; + method.flags = flags; + + // Method signatues don't exist in expression contexts. So they have neither + // [Yield] nor [GeneratorParameter] + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false, method); + + parseSemicolon(); + return finishNode(method); } else { - node.kind = SyntaxKind.Property; - (node).type = parseTypeAnnotation(); + var property = createNode(SyntaxKind.Property, fullStart); + property.name = name; + property.flags = flags; + property.type = parseTypeAnnotation(); + parseSemicolon(); + return finishNode(property); } - parseSemicolon(); - return finishNode(node); } - function isTypeMember(): boolean { + function isStartOfTypeMember(): boolean { switch (token) { case SyntaxKind.OpenParenToken: case SyntaxKind.LessThanToken: @@ -1442,7 +1822,7 @@ module ts { case SyntaxKind.LessThanToken: return parseSignatureMember(SyntaxKind.CallSignature, SyntaxKind.ColonToken); case SyntaxKind.OpenBracketToken: - return parseIndexSignatureMember(); + return parseIndexSignatureMember(scanner.getStartPos(), /*modifiers:*/ undefined); case SyntaxKind.NewKeyword: if (lookAhead(() => nextToken() === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken)) { return parseSignatureMember(SyntaxKind.ConstructSignature, SyntaxKind.ColonToken); @@ -1459,25 +1839,41 @@ module ts { function parseTypeLiteral(): TypeLiteralNode { var node = createNode(SyntaxKind.TypeLiteral); - if (parseExpected(SyntaxKind.OpenBraceToken)) { - node.members = parseList(ParsingContext.TypeMembers, /*checkForStrictMode*/ false, parseTypeMember); - parseExpected(SyntaxKind.CloseBraceToken); - } - else { - node.members = createMissingList(); - } + node.members = parseObjectType(); return finishNode(node); } - function parseFunctionType(signatureKind: SyntaxKind): TypeLiteralNode { - var node = createNode(SyntaxKind.TypeLiteral); - var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, SyntaxKind.EqualsGreaterThanToken); - member.typeParameters = sig.typeParameters; - member.parameters = sig.parameters; - member.type = sig.type; - finishNode(member); - node.members = createNodeArray(member); + function parseObjectType(): NodeArray { + var members: NodeArray; + if (parseExpected(SyntaxKind.OpenBraceToken)) { + members = parseList(ParsingContext.TypeMembers, /*checkForStrictMode*/ false, parseTypeMember); + parseExpected(SyntaxKind.CloseBraceToken); + } + else { + members = createMissingList(); + } + + return members; + } + + function parseTupleType(): TupleTypeNode { + var node = createNode(SyntaxKind.TupleType); + node.elementTypes = parseBracketedList(ParsingContext.TupleElementTypes, parseType, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); + return finishNode(node); + } + + function parseParenType(): ParenTypeNode { + var node = createNode(SyntaxKind.ParenType); + parseExpected(SyntaxKind.OpenParenToken); + node.type = parseType(); + parseExpected(SyntaxKind.CloseParenToken); + return finishNode(node); + } + + function parseFunctionType(typeKind: SyntaxKind): SignatureDeclaration { + var node = createNode(typeKind); + fillSignature(typeKind === SyntaxKind.FunctionType ? SyntaxKind.CallSignature : SyntaxKind.ConstructSignature, + SyntaxKind.EqualsGreaterThanToken, /* returnTokenRequired */ true, /*yieldAndGeneratorParameterContext:*/ false, node); return finishNode(node); } @@ -1499,11 +1895,10 @@ module ts { return parseTypeQuery(); case SyntaxKind.OpenBraceToken: return parseTypeLiteral(); + case SyntaxKind.OpenBracketToken: + return parseTupleType(); case SyntaxKind.OpenParenToken: - case SyntaxKind.LessThanToken: - return parseFunctionType(SyntaxKind.CallSignature); - case SyntaxKind.NewKeyword: - return parseFunctionType(SyntaxKind.ConstructSignature); + return parseParenType(); default: if (isIdentifier()) { return parseTypeReference(); @@ -1513,7 +1908,7 @@ module ts { return createMissingNode(); } - function isType(): boolean { + function isStartOfType(): boolean { switch (token) { case SyntaxKind.AnyKeyword: case SyntaxKind.StringKeyword: @@ -1522,24 +1917,25 @@ module ts { case SyntaxKind.VoidKeyword: case SyntaxKind.TypeOfKeyword: case SyntaxKind.OpenBraceToken: + case SyntaxKind.OpenBracketToken: case SyntaxKind.LessThanToken: case SyntaxKind.NewKeyword: return true; case SyntaxKind.OpenParenToken: - // Only consider an ( as the start of a type if we have () or (id - // We don't want to consider things like (1) as a function type. + // Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier, + // or something that starts a type. We don't want to consider things like '(1)' a type. return lookAhead(() => { nextToken(); - return token === SyntaxKind.CloseParenToken || isParameter(); + return token === SyntaxKind.CloseParenToken || isStartOfParameter() || isStartOfType(); }); default: return isIdentifier(); } } - function parseType(): TypeNode { + function parsePrimaryType(): TypeNode { var type = parseNonArrayType(); - while (type && !scanner.hasPrecedingLineBreak() && parseOptional(SyntaxKind.OpenBracketToken)) { + while (!scanner.hasPrecedingLineBreak() && parseOptional(SyntaxKind.OpenBracketToken)) { parseExpected(SyntaxKind.CloseBracketToken); var node = createNode(SyntaxKind.ArrayType, type.pos); node.elementType = type; @@ -1548,13 +1944,88 @@ module ts { return type; } + function parseUnionType(): TypeNode { + var type = parsePrimaryType(); + if (token === SyntaxKind.BarToken) { + var types = >[type]; + types.pos = type.pos; + while (parseOptional(SyntaxKind.BarToken)) { + types.push(parsePrimaryType()); + } + types.end = getNodeEnd(); + var node = createNode(SyntaxKind.UnionType, type.pos); + node.types = types; + type = finishNode(node); + } + return type; + } + + function isStartOfFunctionType(): boolean { + return token === SyntaxKind.LessThanToken || token === SyntaxKind.OpenParenToken && lookAhead(() => { + nextToken(); + if (token === SyntaxKind.CloseParenToken || token === SyntaxKind.DotDotDotToken) { + // ( ) + // ( ... + return true; + } + if (isIdentifier() || isModifier(token)) { + nextToken(); + if (token === SyntaxKind.ColonToken || token === SyntaxKind.CommaToken || + token === SyntaxKind.QuestionToken || token === SyntaxKind.EqualsToken || + isIdentifier() || isModifier(token)) { + // ( id : + // ( id , + // ( id ? + // ( id = + // ( modifier id + return true; + } + if (token === SyntaxKind.CloseParenToken) { + nextToken(); + if (token === SyntaxKind.EqualsGreaterThanToken) { + // ( id ) => + return true; + } + } + } + return false; + }); + } + + function parseType(): TypeNode { + // The rules about 'yield' only apply to actual code/expression contexts. They don't + // apply to 'type' contexts. So we disable these parameters here before moving on. + var savedYieldContext = inYieldContext(); + var savedGeneratorParameterContext = inGeneratorParameterContext(); + + setYieldContext(false); + setGeneratorParameterContext(false); + + var result = parseTypeWorker(); + + setYieldContext(savedYieldContext); + setGeneratorParameterContext(savedGeneratorParameterContext); + + return result; + } + + function parseTypeWorker(): TypeNode { + if (isStartOfFunctionType()) { + return parseFunctionType(SyntaxKind.FunctionType); + } + if (token === SyntaxKind.NewKeyword) { + return parseFunctionType(SyntaxKind.ConstructorType); + } + return parseUnionType(); + } + function parseTypeAnnotation(): TypeNode { return parseOptional(SyntaxKind.ColonToken) ? parseType() : undefined; } // EXPRESSIONS - function isExpression(): boolean { + function isStartOfExpression(): boolean { switch (token) { case SyntaxKind.ThisKeyword: case SyntaxKind.SuperKeyword: @@ -1563,6 +2034,8 @@ module ts { case SyntaxKind.FalseKeyword: case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.TemplateHead: case SyntaxKind.OpenParenToken: case SyntaxKind.OpenBracketToken: case SyntaxKind.OpenBraceToken: @@ -1581,26 +2054,34 @@ module ts { case SyntaxKind.MinusMinusToken: case SyntaxKind.LessThanToken: case SyntaxKind.Identifier: + case SyntaxKind.YieldKeyword: + // Yield always starts an expression. Either it is an identifier (in which case + // it is definitely an expression). Or it's a keyword (either because we're in + // a generator, or in strict mode (or both)) and it started a yield expression. return true; default: return isIdentifier(); } } - function isExpressionStatement(): boolean { + function isStartOfExpressionStatement(): boolean { // As per the grammar, neither '{' nor 'function' can start an expression statement. - return token !== SyntaxKind.OpenBraceToken && token !== SyntaxKind.FunctionKeyword && isExpression(); + return token !== SyntaxKind.OpenBraceToken && token !== SyntaxKind.FunctionKeyword && isStartOfExpression(); } - function parseExpression(noIn?: boolean): Expression { - var expr = parseAssignmentExpression(noIn); + function parseExpression(): Expression { + // Expression[in]: + // AssignmentExpression[in] + // Expression[in] , AssignmentExpression[in] + + var expr = parseAssignmentExpression(); while (parseOptional(SyntaxKind.CommaToken)) { - expr = makeBinaryExpression(expr, SyntaxKind.CommaToken, parseAssignmentExpression(noIn)); + expr = makeBinaryExpression(expr, SyntaxKind.CommaToken, parseAssignmentExpression()); } return expr; } - function parseInitializer(inParameter: boolean, noIn?: boolean): Expression { + function parseInitializer(inParameter: boolean): Expression { if (token !== SyntaxKind.EqualsToken) { // It's not uncommon during typing for the user to miss writing the '=' token. Check if // there is no newline after the last token and if we're on an expression. If so, parse @@ -1610,30 +2091,37 @@ module ts { // it's more likely that a { would be a allowed (as an object literal). While this // is also allowed for parameters, the risk is that we consume the { as an object // literal when it really will be for the block following the parameter. - if (scanner.hasPrecedingLineBreak() || (inParameter && token === SyntaxKind.OpenBraceToken) || !isExpression()) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token === SyntaxKind.OpenBraceToken) || !isStartOfExpression()) { // preceding line break, open brace in a parameter (likely a function body) or current token is not an expression - // do not try to parse initializer return undefined; } } + // Initializer[In, Yield] : + // = AssignmentExpression[?In, ?Yield] + parseExpected(SyntaxKind.EqualsToken); - return parseAssignmentExpression(noIn); + return parseAssignmentExpression(); } - function parseAssignmentExpression(noIn?: boolean): Expression { - // Augmented by TypeScript: - // - // AssignmentExpression[in]: - // 1) ConditionalExpression[in] - // 2) LeftHandSideExpression = AssignmentExpression[in] - // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[in] - // 4) ArrowFunctionExpression <-- added by TypeScript + function parseAssignmentExpression(): Expression { + // AssignmentExpression[in,yield]: + // 1) ConditionalExpression[?in,?yield] + // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] + // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield] + // 4) ArrowFunctionExpression[?in,?yield] + // 5) [+Yield] YieldExpression[?In] // // Note: for ease of implementation we treat productions '2' and '3' as the same thing. // (i.e. they're both BinaryExpressions with an assignment operator in it). - // First, check if we have an arrow function (production '4') that starts with a parenthesized + // First, do the simple check if we have a YieldExpression (production '5'). + if (isYieldExpression()) { + return parseYieldExpression(); + } + + // Then, check if we have an arrow function (production '4') that starts with a parenthesized // parameter list. If we do, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done // with AssignmentExpression if we see one. @@ -1644,7 +2132,7 @@ module ts { // Now try to handle the rest of the cases. First, see if we can parse out up to and // including a conditional expression. - var expr = parseConditionalExpression(noIn); + var expr = parseConditionalExpression(); // To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized // parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single @@ -1654,51 +2142,80 @@ module ts { } // Now see if we might be in cases '2' or '3'. - // If the expression was a LHS expression, and we have an assignment operator, then - // we're in '2' or '3'. Consume the assignment and return. - if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) - reportInvalidUseInStrictMode(expr); - } + // If the expression was a LHS expression, and we have an assignment operator, then + // we're in '2' or '3'. Consume the assignment and return. + if (isLeftHandSideExpression(expr) && isAssignmentOperator(token)) { var operator = token; nextToken(); - return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); + return makeBinaryExpression(expr, operator, parseAssignmentExpression()); } // otherwise this was production '1'. Return whatever we parsed so far. return expr; } - function isLeftHandSideExpression(expr: Expression): boolean { - if (expr) { - switch (expr.kind) { - case SyntaxKind.PropertyAccess: - case SyntaxKind.IndexedAccess: - case SyntaxKind.NewExpression: - case SyntaxKind.CallExpression: - case SyntaxKind.ArrayLiteral: - case SyntaxKind.ParenExpression: - case SyntaxKind.ObjectLiteral: - case SyntaxKind.FunctionExpression: - case SyntaxKind.Identifier: - case SyntaxKind.Missing: - case SyntaxKind.RegularExpressionLiteral: - case SyntaxKind.NumericLiteral: - case SyntaxKind.StringLiteral: - case SyntaxKind.FalseKeyword: - case SyntaxKind.NullKeyword: - case SyntaxKind.ThisKeyword: - case SyntaxKind.TrueKeyword: - case SyntaxKind.SuperKeyword: - return true; + function isYieldExpression(): boolean { + if (token === SyntaxKind.YieldKeyword) { + // If we have a 'yield' keyword, and htis is a context where yield expressions are + // allowed, then definitely parse out a yield expression. + if (inYieldContext()) { + return true; } + + if (inStrictModeContext()) { + // If we're in strict mode, then 'yield' is a keyword, could only ever start + // a yield expression. + return true; + } + + // We're in a context where 'yield expr' is not allowed. However, if we can + // definitely tell that the user was trying to parse a 'yield expr' and not + // just a normal expr that start with a 'yield' identifier, then parse out + // a 'yield expr'. We can then report an error later that they are only + // allowed in generator expressions. + // + // for example, if we see 'yield(foo)', then we'll have to treat that as an + // invocation expression of something called 'yield'. However, if we have + // 'yield foo' then that is not legal as a normal expression, so we can + // definitely recognize this as a yield expression. + // + // for now we just check if the next token is an identifier. More heuristics + // can be added here later as necessary. We just need to make sure that we + // don't accidently consume something legal. + return lookAhead(() => { + nextToken(); + return !scanner.hasPrecedingLineBreak() && isIdentifier(); + }); } return false; } + function parseYieldExpression(): YieldExpression { + var node = createNode(SyntaxKind.YieldExpression); + + // YieldExpression[In] : + // yield + // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] + // yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] + nextToken(); + + if (!scanner.hasPrecedingLineBreak() && + (token === SyntaxKind.AsteriskToken || isStartOfExpression())) { + if (parseOptional(SyntaxKind.AsteriskToken)) { + node.flags = NodeFlags.YieldStar; + } + + node.expression = parseAssignmentExpression(); + return finishNode(node); + } + else { + // if the next token is not on the same line as yield. or we don't have an '*' or + // the start of an expressin, then this is just a simple "yield" expression. + return finishNode(node); + } + } + function parseSimpleArrowFunctionExpression(identifier: Identifier): Expression { Debug.assert(token === SyntaxKind.EqualsGreaterThanToken, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); parseExpected(SyntaxKind.EqualsGreaterThanToken); @@ -1714,7 +2231,7 @@ module ts { var signature = { parameters: parameters }; - return parseArrowExpressionTail(identifier.pos, signature, /*noIn:*/ false); + return parseArrowExpressionTail(identifier.pos, signature); } function tryParseParenthesizedArrowFunctionExpression(): Expression { @@ -1728,12 +2245,13 @@ module ts { var pos = getNodePos(); if (triState === Tristate.True) { - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + // Arrow function are never generators. + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false); // If we have an arrow, then try to parse the body. // Even if not, try to parse if we have an opening brace, just in case we're in an error state. if (parseExpected(SyntaxKind.EqualsGreaterThanToken) || token === SyntaxKind.OpenBraceToken) { - return parseArrowExpressionTail(pos, sig, /* noIn: */ false); + return parseArrowExpressionTail(pos, sig); } else { // If not, we're probably better off bailing out and returning a bogus function expression. @@ -1746,7 +2264,7 @@ module ts { var sig = tryParseSignatureIfArrowOrBraceFollows(); if (sig) { parseExpected(SyntaxKind.EqualsGreaterThanToken); - return parseArrowExpressionTail(pos, sig, /*noIn:*/ false); + return parseArrowExpressionTail(pos, sig); } else { return undefined; @@ -1831,7 +2349,8 @@ module ts { function tryParseSignatureIfArrowOrBraceFollows(): ParsedSignature { return tryParse(() => { - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + // Arrow functions are never generators. + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false); // Parsing a signature isn't enough. // Parenthesized arrow signatures often look like other valid expressions. @@ -1849,13 +2368,13 @@ module ts { }); } - function parseArrowExpressionTail(pos: number, sig: ParsedSignature, noIn: boolean): FunctionExpression { + function parseArrowExpressionTail(pos: number, sig: ParsedSignature): FunctionExpression { var body: Node; if (token === SyntaxKind.OpenBraceToken) { - body = parseBody(/* ignoreMissingOpenBrace */ false); + body = parseFunctionBlock(/*allowYield:*/ false, /* ignoreMissingOpenBrace */ false); } - else if (isStatement(/* inErrorRecovery */ true) && !isExpressionStatement() && token !== SyntaxKind.FunctionKeyword) { + else if (isStatement(/* inErrorRecovery */ true) && !isStartOfExpressionStatement() && token !== SyntaxKind.FunctionKeyword) { // Check if we got a plain statement (i.e. no expression-statements, no functions expressions/declarations) // // Here we try to recover from a potential error situation in the case where the @@ -1870,44 +2389,39 @@ module ts { // up preemptively closing the containing construct. // // Note: even when 'ignoreMissingOpenBrace' is passed as true, parseBody will still error. - body = parseBody(/* ignoreMissingOpenBrace */ true); + body = parseFunctionBlock(/*allowYield:*/ false, /* ignoreMissingOpenBrace */ true); } else { - body = parseAssignmentExpression(noIn); + body = parseAssignmentExpression(); } return makeFunctionExpression(SyntaxKind.ArrowFunction, pos, /* name */ undefined, sig, body); } - function isAssignmentOperator(): boolean { - return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment; - } + function parseConditionalExpression(): Expression { + // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and + // we do not that for the 'whenFalse' part. - function parseConditionalExpression(noIn?: boolean): Expression { - var expr = parseBinaryExpression(noIn); + var expr = parseBinaryOperators(parseUnaryExpression(), /*minPrecedence:*/ 0); while (parseOptional(SyntaxKind.QuestionToken)) { var node = createNode(SyntaxKind.ConditionalExpression, expr.pos); node.condition = expr; - node.whenTrue = parseAssignmentExpression(false); + node.whenTrue = allowInAnd(parseAssignmentExpression); parseExpected(SyntaxKind.ColonToken); - node.whenFalse = parseAssignmentExpression(noIn); + node.whenFalse = parseAssignmentExpression(); expr = finishNode(node); } return expr; } - function parseBinaryExpression(noIn?: boolean): Expression { - return parseBinaryOperators(parseUnaryExpression(), 0, noIn); - } - - function parseBinaryOperators(expr: Expression, minPrecedence: number, noIn?: boolean): Expression { + function parseBinaryOperators(expr: Expression, minPrecedence: number): Expression { while (true) { reScanGreaterToken(); var precedence = getOperatorPrecedence(); - if (precedence && precedence > minPrecedence && (!noIn || token !== SyntaxKind.InKeyword)) { + if (precedence && precedence > minPrecedence && (!inDisallowInContext() || token !== SyntaxKind.InKeyword)) { var operator = token; nextToken(); - expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); + expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence)); continue; } return expr; @@ -1975,21 +2489,7 @@ module ts { case SyntaxKind.MinusMinusToken: var operator = token; nextToken(); - var operand = parseUnaryExpression(); - if (isInStrictMode) { - // The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression - // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator - if ((token === SyntaxKind.PlusPlusToken || token === SyntaxKind.MinusMinusToken) && isEvalOrArgumentsIdentifier(operand)) { - reportInvalidUseInStrictMode(operand); - } - else if (token === SyntaxKind.DeleteKeyword && operand.kind === SyntaxKind.Identifier) { - // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its - // UnaryExpression is a direct reference to a variable, function argument, or function name - grammarErrorOnNode(operand, Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); - } - } - return makeUnaryExpression(SyntaxKind.PrefixOperator, pos, operator, operand); + return makeUnaryExpression(SyntaxKind.PrefixOperator, pos, operator, parseUnaryExpression()); case SyntaxKind.LessThanToken: return parseTypeAssertion(); } @@ -2010,12 +2510,6 @@ module ts { Debug.assert(isLeftHandSideExpression(expr)); if ((token === SyntaxKind.PlusPlusToken || token === SyntaxKind.MinusMinusToken) && !scanner.hasPrecedingLineBreak()) { - // The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression - // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } var operator = token; nextToken(); expr = makeUnaryExpression(SyntaxKind.PostfixOperator, expr.pos, operator, expr); @@ -2042,17 +2536,48 @@ module ts { function parseCallAndAccess(expr: Expression, inNewExpression: boolean): Expression { while (true) { + var dotOrBracketStart = scanner.getTokenPos(); if (parseOptional(SyntaxKind.DotToken)) { var propertyAccess = createNode(SyntaxKind.PropertyAccess, expr.pos); + // Technically a keyword is valid here as all keywords are identifier names. + // However, often we'll encounter this in error situations when the keyword + // is actually starting another valid construct. + // + // So, we check for the following specific case: + // + // name. + // keyword identifierNameOrKeyword + // + // Note: the newlines are important here. For example, if that above code + // were rewritten into: + // + // name.keyword + // identifierNameOrKeyword + // + // Then we would consider it valid. That's because ASI would take effect and + // the code would be implicitly: "name.keyword; identifierNameOrKeyword". + // In the first case though, ASI will not take effect because there is not a + // line terminator after the keyword. + var id: Identifier; + if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { + var matchesPattern = lookAhead(() => { + nextToken(); + return !scanner.hasPrecedingLineBreak() && (scanner.isIdentifier() || scanner.isReservedWord); + }); + + if (matchesPattern) { + errorAtPos(dotOrBracketStart + 1, 0, Diagnostics.Identifier_expected); + id = createMissingNode(); + } + } + propertyAccess.left = expr; - propertyAccess.right = parseIdentifierName(); + propertyAccess.right = id || parseIdentifierName(); expr = finishNode(propertyAccess); continue; } - var bracketStart = scanner.getTokenPos(); if (parseOptional(SyntaxKind.OpenBracketToken)) { - var indexedAccess = createNode(SyntaxKind.IndexedAccess, expr.pos); indexedAccess.object = expr; @@ -2060,10 +2585,9 @@ module ts { // Check for that common pattern and report a better error message. if (inNewExpression && parseOptional(SyntaxKind.CloseBracketToken)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { - indexedAccess.index = parseExpression(); + indexedAccess.index = allowInAnd(parseExpression); if (indexedAccess.index.kind === SyntaxKind.StringLiteral || indexedAccess.index.kind === SyntaxKind.NumericLiteral) { var literal = indexedAccess.index; literal.text = internIdentifier(literal.text); @@ -2087,11 +2611,22 @@ module ts { else { parseExpected(SyntaxKind.OpenParenToken); } - callExpr.arguments = parseDelimitedList(ParsingContext.ArgumentExpressions, parseAssignmentExpression, TrailingCommaBehavior.Disallow); + callExpr.arguments = parseDelimitedList(ParsingContext.ArgumentExpressions, parseArgumentExpression); parseExpected(SyntaxKind.CloseParenToken); expr = finishNode(callExpr); continue; } + + if (token === SyntaxKind.NoSubstitutionTemplateLiteral || token === SyntaxKind.TemplateHead) { + var tagExpression = createNode(SyntaxKind.TaggedTemplateExpression, expr.pos); + tagExpression.tag = expr; + tagExpression.template = token === SyntaxKind.NoSubstitutionTemplateLiteral + ? parseLiteralNode() + : parseTemplateExpression(); + expr = finishNode(tagExpression); + continue; + } + return expr; } } @@ -2103,13 +2638,24 @@ module ts { } function parseTypeArguments(): NodeArray { - var typeArgumentListStart = scanner.getTokenPos(); - var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(ParsingContext.TypeArguments, parseType, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); - if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { - grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, Diagnostics.Type_argument_list_cannot_be_empty); + // We pass parseSingleTypeArgument instead of parseType as the element parser + // because parseSingleTypeArgument knows how to parse a missing type argument. + // This is useful for signature help. parseType has the disadvantage that when + // it sees a missing type, it changes the LookAheadMode to Error, and the result + // is a broken binary expression, which breaks signature help. + return parseBracketedList(ParsingContext.TypeArguments, parseSingleTypeArgument, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); + } + + function parseSingleTypeArgument(): TypeNode { + // Be resilient to something like: Foo<,,>(); + // We want to parse this out as a type argument list (esp. for signature help), and we + // don't want to rollback just because we were missing a type arg. The grammar checker + // will report the actual error later on. + if (token === SyntaxKind.CommaToken) { + return createNode(SyntaxKind.Missing); } - return result; + + return parseType(); } function parsePrimaryExpression(): Expression { @@ -2122,6 +2668,7 @@ module ts { return parseTokenNode(); case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: return parseLiteralNode(); case SyntaxKind.OpenParenToken: return parseParenExpression(); @@ -2139,6 +2686,9 @@ module ts { return parseLiteralNode(); } break; + case SyntaxKind.TemplateHead: + return parseTemplateExpression(); + default: if (isIdentifier()) { return parseIdentifier(); @@ -2151,41 +2701,80 @@ module ts { function parseParenExpression(): ParenExpression { var node = createNode(SyntaxKind.ParenExpression); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); return finishNode(node); } + function parseAssignmentExpressionOrOmittedExpression(): Expression { + return token === SyntaxKind.CommaToken + ? createNode(SyntaxKind.OmittedExpression) + : parseAssignmentExpression(); + } + function parseArrayLiteralElement(): Expression { - return token === SyntaxKind.CommaToken ? createNode(SyntaxKind.OmittedExpression) : parseAssignmentExpression(); + return parseAssignmentExpressionOrOmittedExpression(); + } + + function parseArgumentExpression(): Expression { + return allowInAnd(parseAssignmentExpressionOrOmittedExpression); } function parseArrayLiteral(): ArrayLiteral { var node = createNode(SyntaxKind.ArrayLiteral); parseExpected(SyntaxKind.OpenBracketToken); if (scanner.hasPrecedingLineBreak()) node.flags |= NodeFlags.MultiLine; - node.elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArrayLiteralElement, TrailingCommaBehavior.Preserve); + node.elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArrayLiteralElement); parseExpected(SyntaxKind.CloseBracketToken); return finishNode(node); } - function parsePropertyAssignment(): PropertyDeclaration { - var node = createNode(SyntaxKind.PropertyAssignment); - node.name = parsePropertyName(); - if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); - var body = parseBody(/* ignoreMissingOpenBrace */ false); + function parsePropertyAssignment(): Declaration { + var nodePos = scanner.getStartPos(); + var isGenerator = parseOptional(SyntaxKind.AsteriskToken); + var tokenIsIdentifier = isIdentifier(); + var nameToken = token; + var propertyName = parsePropertyName(); + var node: Declaration; + if (isGenerator || token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { + node = createNode(SyntaxKind.PropertyAssignment, nodePos); + node.name = propertyName; + if (isGenerator) { + node.flags |= NodeFlags.Generator; + } + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator); + + var body = parseFunctionBlock(isGenerator, /* ignoreMissingOpenBrace */ false); // do not propagate property name as name for function expression // for scenarios like // var x = 1; // var y = { x() { } } // otherwise this will bring y.x into the scope of x which is incorrect - node.initializer = makeFunctionExpression(SyntaxKind.FunctionExpression, node.pos, undefined, sig, body); + (node).initializer = makeFunctionExpression(SyntaxKind.FunctionExpression, node.pos, undefined, sig, body); + return finishNode(node); + } + + var flags: NodeFlags = 0; + + // Disallowing of optional property assignments happens in the grammar checker. + if (token === SyntaxKind.QuestionToken) { + flags |= NodeFlags.QuestionMark; + nextToken(); + } + + // Parse to check if it is short-hand property assignment or normal property assignment + if ((token === SyntaxKind.CommaToken || token === SyntaxKind.CloseBraceToken) && tokenIsIdentifier) { + node = createNode(SyntaxKind.ShorthandPropertyAssignment, nodePos); + node.name = propertyName; } else { + node = createNode(SyntaxKind.PropertyAssignment, nodePos); + node.name = propertyName; parseExpected(SyntaxKind.ColonToken); - node.initializer = parseAssignmentExpression(false); + (node).initializer = allowInAnd(parseAssignmentExpression); } + + node.flags = flags; return finishNode(node); } @@ -2194,7 +2783,7 @@ module ts { var initialToken = token; if (parseContextualModifier(SyntaxKind.GetKeyword) || parseContextualModifier(SyntaxKind.SetKeyword)) { var kind = initialToken === SyntaxKind.GetKeyword ? SyntaxKind.GetAccessor : SyntaxKind.SetAccessor; - return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); + return parseMemberAccessorDeclaration(kind, initialPos, /*modifiers*/ undefined); } return parsePropertyAssignment(); } @@ -2206,85 +2795,37 @@ module ts { node.flags |= NodeFlags.MultiLine; } - // ES3 itself does not accept a trailing comma in an object literal, however, we'd like to preserve it in ES5. - var trailingCommaBehavior = languageVersion === ScriptTarget.ES3 ? TrailingCommaBehavior.Allow : TrailingCommaBehavior.Preserve; - - node.properties = parseDelimitedList(ParsingContext.ObjectLiteralMembers, parseObjectLiteralMember, trailingCommaBehavior); + node.properties = parseDelimitedList(ParsingContext.ObjectLiteralMembers, parseObjectLiteralMember); parseExpected(SyntaxKind.CloseBraceToken); - - var seen: Map = {}; - var Property = 1; - var GetAccessor = 2; - var SetAccesor = 4; - var GetOrSetAccessor = GetAccessor | SetAccesor; - forEach(node.properties, (p: Declaration) => { - if (p.kind === SyntaxKind.OmittedExpression) { - return; - } - // ECMA-262 11.1.5 Object Initialiser - // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true - // a.This production is contained in strict code and IsDataDescriptor(previous) is true and - // IsDataDescriptor(propId.descriptor) is true. - // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. - // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. - // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true - // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind: number; - if (p.kind === SyntaxKind.PropertyAssignment) { - currentKind = Property; - } - else if (p.kind === SyntaxKind.GetAccessor) { - currentKind = GetAccessor; - } - else if (p.kind === SyntaxKind.SetAccessor) { - currentKind = SetAccesor; - } - else { - Debug.fail("Unexpected syntax kind:" + SyntaxKind[p.kind]); - } - - if (!hasProperty(seen, p.name.text)) { - seen[p.name.text] = currentKind; - } - else { - var existingKind = seen[p.name.text]; - if (currentKind === Property && existingKind === Property) { - if (isInStrictMode) { - grammarErrorOnNode(p.name, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); - } - } - else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { - if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[p.name.text] = currentKind | existingKind; - } - else { - grammarErrorOnNode(p.name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } - else { - grammarErrorOnNode(p.name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - }); return finishNode(node); } function parseFunctionExpression(): FunctionExpression { + // GeneratorExpression : + // function * BindingIdentifier[Yield]opt (FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } + // FunctionExpression: + // function BindingIdentifieropt(FormalParameters) { FunctionBody } + var pos = getNodePos(); parseExpected(SyntaxKind.FunctionKeyword); - var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); - var body = parseBody(/* ignoreMissingOpenBrace */ false); - if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { - // It is a SyntaxError to use within strict mode code the identifiers eval or arguments as the - // Identifier of a FunctionDeclaration or FunctionExpression or as a formal parameter name(13.1) - reportInvalidUseInStrictMode(name); - } - return makeFunctionExpression(SyntaxKind.FunctionExpression, pos, name, sig, body); + var isGenerator = parseOptional(SyntaxKind.AsteriskToken); + var name = isGenerator ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator); + + var body = parseFunctionBlock(/*allowYield:*/ isGenerator, /* ignoreMissingOpenBrace */ false); + return makeFunctionExpression(SyntaxKind.FunctionExpression, pos, name, sig, body, isGenerator ? NodeFlags.Generator : undefined); } - function makeFunctionExpression(kind: SyntaxKind, pos: number, name: Identifier, sig: ParsedSignature, body: Node): FunctionExpression { + function parseOptionalIdentifier() { + return isIdentifier() ? parseIdentifier() : undefined; + } + + function makeFunctionExpression(kind: SyntaxKind, pos: number, name: Identifier, sig: ParsedSignature, body: Node, flags?: NodeFlags): FunctionExpression { var node = createNode(kind, pos); + if (flags) { + node.flags = flags; + } + node.name = name; node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; @@ -2298,18 +2839,17 @@ module ts { parseExpected(SyntaxKind.NewKeyword); node.func = parseCallAndAccess(parsePrimaryExpression(), /* inNewExpression */ true); if (parseOptional(SyntaxKind.OpenParenToken) || token === SyntaxKind.LessThanToken && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { - node.arguments = parseDelimitedList(ParsingContext.ArgumentExpressions, parseAssignmentExpression, TrailingCommaBehavior.Disallow); + node.arguments = parseDelimitedList(ParsingContext.ArgumentExpressions, parseArgumentExpression); parseExpected(SyntaxKind.CloseParenToken); } return finishNode(node); } // STATEMENTS - function parseBlock(ignoreMissingOpenBrace: boolean, checkForStrictMode: boolean): Block { var node = createNode(SyntaxKind.Block); if (parseExpected(SyntaxKind.OpenBraceToken) || ignoreMissingOpenBrace) { - node.statements = parseList(ParsingContext.BlockStatements,checkForStrictMode, parseStatement); + node.statements = parseList(ParsingContext.BlockStatements, checkForStrictMode, parseStatement); parseExpected(SyntaxKind.CloseBraceToken); } else { @@ -2318,27 +2858,14 @@ module ts { return finishNode(node); } - function parseBody(ignoreMissingOpenBrace: boolean): Block { - var saveInFunctionBody = inFunctionBody; - var saveInSwitchStatement = inSwitchStatement; - var saveInIterationStatement = inIterationStatement; - - inFunctionBody = true; - if (inSwitchStatement === ControlBlockContext.Nested) { - inSwitchStatement = ControlBlockContext.CrossingFunctionBoundary; - } - if (inIterationStatement === ControlBlockContext.Nested) { - inIterationStatement = ControlBlockContext.CrossingFunctionBoundary; - } - labelledStatementInfo.pushFunctionBoundary(); + function parseFunctionBlock(allowYield: boolean, ignoreMissingOpenBrace: boolean): Block { + var savedYieldContext = inYieldContext(); + setYieldContext(allowYield); var block = parseBlock(ignoreMissingOpenBrace, /*checkForStrictMode*/ true); block.kind = SyntaxKind.FunctionBlock; - labelledStatementInfo.pop(); - inFunctionBody = saveInFunctionBody; - inSwitchStatement = saveInSwitchStatement; - inIterationStatement = saveInIterationStatement; + setYieldContext(savedYieldContext); return block; } @@ -2353,7 +2880,7 @@ module ts { var node = createNode(SyntaxKind.IfStatement); parseExpected(SyntaxKind.IfKeyword); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); node.thenStatement = parseStatement(); node.elseStatement = parseOptional(SyntaxKind.ElseKeyword) ? parseStatement() : undefined; @@ -2364,14 +2891,11 @@ module ts { var node = createNode(SyntaxKind.DoStatement); parseExpected(SyntaxKind.DoKeyword); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = ControlBlockContext.Nested; node.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; parseExpected(SyntaxKind.WhileKeyword); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html @@ -2386,13 +2910,10 @@ module ts { var node = createNode(SyntaxKind.WhileStatement); parseExpected(SyntaxKind.WhileKeyword); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = ControlBlockContext.Nested; node.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; return finishNode(node); } @@ -2403,174 +2924,95 @@ module ts { parseExpected(SyntaxKind.OpenParenToken); if (token !== SyntaxKind.SemicolonToken) { if (parseOptional(SyntaxKind.VarKeyword)) { - var declarations = parseVariableDeclarationList(0, true); - if (!declarations.length) { - error(Diagnostics.Variable_declaration_list_cannot_be_empty); - } + var declarations = disallowInAnd(parseVariableDeclarationList); + } + else if (parseOptional(SyntaxKind.LetKeyword)) { + var declarations = setFlag(disallowInAnd(parseVariableDeclarationList), NodeFlags.Let); + } + else if (parseOptional(SyntaxKind.ConstKeyword)) { + var declarations = setFlag(disallowInAnd(parseVariableDeclarationList), NodeFlags.Const); } else { - var varOrInit = parseExpression(true); + var varOrInit = disallowInAnd(parseExpression); } } var forOrForInStatement: IterationStatement; if (parseOptional(SyntaxKind.InKeyword)) { var forInStatement = createNode(SyntaxKind.ForInStatement, pos); if (declarations) { - if (declarations.length > 1) { - error(Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - } - forInStatement.declaration = declarations[0]; + forInStatement.declarations = declarations; } else { forInStatement.variable = varOrInit; } - forInStatement.expression = parseExpression(); + forInStatement.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); forOrForInStatement = forInStatement; } else { var forStatement = createNode(SyntaxKind.ForStatement, pos); - if (declarations) forStatement.declarations = declarations; - if (varOrInit) forStatement.initializer = varOrInit; + if (declarations) { + forStatement.declarations = declarations; + } + if (varOrInit) { + forStatement.initializer = varOrInit; + } + parseExpected(SyntaxKind.SemicolonToken); if (token !== SyntaxKind.SemicolonToken && token !== SyntaxKind.CloseParenToken) { - forStatement.condition = parseExpression(); + forStatement.condition = allowInAnd(parseExpression); } parseExpected(SyntaxKind.SemicolonToken); if (token !== SyntaxKind.CloseParenToken) { - forStatement.iterator = parseExpression(); + forStatement.iterator = allowInAnd(parseExpression); } parseExpected(SyntaxKind.CloseParenToken); forOrForInStatement = forStatement; } - var saveInIterationStatement = inIterationStatement; - inIterationStatement = ControlBlockContext.Nested; forOrForInStatement.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; return finishNode(forOrForInStatement); } function parseBreakOrContinueStatement(kind: SyntaxKind): BreakOrContinueStatement { var node = createNode(kind); - var errorCountBeforeStatement = file.syntacticErrors.length; + parseExpected(kind === SyntaxKind.BreakStatement ? SyntaxKind.BreakKeyword : SyntaxKind.ContinueKeyword); - if (!canParseSemicolon()) node.label = parseIdentifier(); + if (!canParseSemicolon()) { + node.label = parseIdentifier(); + } + parseSemicolon(); - finishNode(node); - - // In an ambient context, we will already give an error for having a statement. - if (!inAmbientContext && errorCountBeforeStatement === file.syntacticErrors.length) { - if (node.label) { - checkBreakOrContinueStatementWithLabel(node); - } - else { - checkBareBreakOrContinueStatement(node); - } - } - return node; - } - - function checkBareBreakOrContinueStatement(node: BreakOrContinueStatement): void { - if (node.kind === SyntaxKind.BreakStatement) { - if (inIterationStatement === ControlBlockContext.Nested - || inSwitchStatement === ControlBlockContext.Nested) { - return; - } - else if (inIterationStatement === ControlBlockContext.NotNested - && inSwitchStatement === ControlBlockContext.NotNested) { - grammarErrorOnNode(node, Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - return; - } - // Fall through - } - else if (node.kind === SyntaxKind.ContinueStatement) { - if (inIterationStatement === ControlBlockContext.Nested) { - return; - } - else if (inIterationStatement === ControlBlockContext.NotNested) { - grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - return; - } - // Fall through - } - else { - Debug.fail("checkAnonymousBreakOrContinueStatement"); - } - - Debug.assert(inIterationStatement === ControlBlockContext.CrossingFunctionBoundary - || inSwitchStatement === ControlBlockContext.CrossingFunctionBoundary); - grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); - } - - function checkBreakOrContinueStatementWithLabel(node: BreakOrContinueStatement): void { - // For error specificity, if the label is not found, we want to distinguish whether it is because - // it crossed a function boundary or it was simply not found. To do this, we pass false for - // stopAtFunctionBoundary. - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, - /*requireIterationStatement*/ node.kind === SyntaxKind.ContinueStatement, - /*stopAtFunctionBoundary*/ false); - if (nodeIsNestedInLabel === ControlBlockContext.Nested) { - return; - } - - if (nodeIsNestedInLabel === ControlBlockContext.CrossingFunctionBoundary) { - grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); - return; - } - - // It is NotNested - if (node.kind === SyntaxKind.ContinueStatement) { - grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - else if (node.kind === SyntaxKind.BreakStatement) { - grammarErrorOnNode(node, Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); - } - else { - Debug.fail("checkBreakOrContinueStatementWithLabel"); - } + return finishNode(node); } function parseReturnStatement(): ReturnStatement { var node = createNode(SyntaxKind.ReturnStatement); - var errorCountBeforeReturnStatement = file.syntacticErrors.length; - var returnTokenStart = scanner.getTokenPos(); - var returnTokenLength = scanner.getTextPos() - returnTokenStart; parseExpected(SyntaxKind.ReturnKeyword); - if (!canParseSemicolon()) node.expression = parseExpression(); - parseSemicolon(); - - // In an ambient context, we will already give an error for having a statement. - if (!inFunctionBody && !inAmbientContext && errorCountBeforeReturnStatement === file.syntacticErrors.length) { - grammarErrorAtPos(returnTokenStart, returnTokenLength, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + if (!canParseSemicolon()) { + node.expression = allowInAnd(parseExpression); } + + parseSemicolon(); return finishNode(node); } function parseWithStatement(): WithStatement { var node = createNode(SyntaxKind.WithStatement); - var startPos = scanner.getTokenPos(); parseExpected(SyntaxKind.WithKeyword); - var endPos = scanner.getStartPos(); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); node.statement = parseStatement(); - node = finishNode(node); - if (isInStrictMode) { - // Strict mode code may not include a WithStatement. The occurrence of a WithStatement in such - // a context is an - grammarErrorAtPos(startPos, endPos - startPos, Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - return node; + return finishNode(node); } function parseCaseClause(): CaseOrDefaultClause { var node = createNode(SyntaxKind.CaseClause); parseExpected(SyntaxKind.CaseKeyword); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.ColonToken); node.statements = parseList(ParsingContext.SwitchClauseStatements, /*checkForStrictMode*/ false, parseStatement); return finishNode(node); @@ -2592,26 +3034,13 @@ module ts { var node = createNode(SyntaxKind.SwitchStatement); parseExpected(SyntaxKind.SwitchKeyword); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); parseExpected(SyntaxKind.OpenBraceToken); - var saveInSwitchStatement = inSwitchStatement; - inSwitchStatement = ControlBlockContext.Nested; node.clauses = parseList(ParsingContext.SwitchClauses, /*checkForStrictMode*/ false, parseCaseOrDefaultClause); - inSwitchStatement = saveInSwitchStatement; parseExpected(SyntaxKind.CloseBraceToken); - - // Error on duplicate 'default' clauses. - var defaultClauses: CaseOrDefaultClause[] = filter(node.clauses, clause => clause.kind === SyntaxKind.DefaultClause); - for (var i = 1, n = defaultClauses.length; i < n; i++) { - var clause = defaultClauses[i]; - var start = skipTrivia(file.text, clause.pos); - var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; - grammarErrorAtPos(start, end - start, Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - } - return finishNode(node); } @@ -2621,7 +3050,7 @@ module ts { if (scanner.hasPrecedingLineBreak()) { error(Diagnostics.Line_break_not_permitted_here); } - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } @@ -2656,23 +3085,14 @@ module ts { parseExpected(SyntaxKind.CatchKeyword); parseExpected(SyntaxKind.OpenParenToken); var variable = parseIdentifier(); - var typeAnnotationColonStart = scanner.getTokenPos(); - var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; var typeAnnotation = parseTypeAnnotation(); parseExpected(SyntaxKind.CloseParenToken); var result = parseBlock(/* ignoreMissingOpenBrace */ false, /*checkForStrictMode*/ false); result.kind = SyntaxKind.CatchBlock; result.pos = pos; result.variable = variable; + result.type = typeAnnotation; - if (typeAnnotation) { - errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(variable)) { - // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the - // Catch production is eval or arguments - reportInvalidUseInStrictMode(variable); - } return result; } @@ -2683,40 +3103,21 @@ module ts { return finishNode(node); } - function isIterationStatementStart(): boolean { - return token === SyntaxKind.WhileKeyword || token === SyntaxKind.DoKeyword || token === SyntaxKind.ForKeyword; - } - - function parseStatementWithLabelSet(): Statement { - labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(); - labelledStatementInfo.pop(); - return statement; - } - function isLabel(): boolean { return isIdentifier() && lookAhead(() => nextToken() === SyntaxKind.ColonToken); } - function parseLabelledStatement(): LabelledStatement { - var node = createNode(SyntaxKind.LabelledStatement); + function parseLabeledStatement(): LabeledStatement { + var node = createNode(SyntaxKind.LabeledStatement); node.label = parseIdentifier(); parseExpected(SyntaxKind.ColonToken); - - if (labelledStatementInfo.nodeIsNestedInLabel(node.label, /*requireIterationStatement*/ false, /*stopAtFunctionBoundary*/ true)) { - grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getSourceTextOfNodeFromSourceText(sourceText, node.label)); - } - labelledStatementInfo.addLabel(node.label); - - // We only want to call parseStatementWithLabelSet when the label set is complete - // Therefore, keep parsing labels until we know we're done. - node.statement = isLabel() ? parseLabelledStatement() : parseStatementWithLabelSet(); + node.statement = parseStatement(); return finishNode(node); } function parseExpressionStatement(): ExpressionStatement { var node = createNode(SyntaxKind.ExpressionStatement); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } @@ -2733,6 +3134,7 @@ module ts { return !inErrorRecovery; case SyntaxKind.OpenBraceToken: case SyntaxKind.VarKeyword: + case SyntaxKind.LetKeyword: case SyntaxKind.FunctionKeyword: case SyntaxKind.IfKeyword: case SyntaxKind.DoKeyword: @@ -2751,17 +3153,26 @@ module ts { case SyntaxKind.CatchKeyword: case SyntaxKind.FinallyKeyword: return true; + case SyntaxKind.ConstKeyword: + // const keyword can precede enum keyword when defining constant enums + // 'const enum' do not start statement. + // In ES 6 'enum' is a future reserved keyword, so it should not be used as identifier + var isConstEnum = lookAhead(() => nextToken() === SyntaxKind.EnumKeyword); + return !isConstEnum; case SyntaxKind.InterfaceKeyword: case SyntaxKind.ClassKeyword: case SyntaxKind.ModuleKeyword: case SyntaxKind.EnumKeyword: + case SyntaxKind.TypeKeyword: // When followed by an identifier, these do not start a statement but might // instead be following declarations - if (isDeclaration()) { + if (isDeclarationStart()) { return false; } + case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: case SyntaxKind.StaticKeyword: // When followed by an identifier or keyword, these do not start a statement but // might instead be following type members @@ -2769,7 +3180,7 @@ module ts { return false; } default: - return isExpression(); + return isStartOfExpression(); } } @@ -2778,9 +3189,12 @@ module ts { case SyntaxKind.OpenBraceToken: return parseBlock(/* ignoreMissingOpenBrace */ false, /*checkForStrictMode*/ false); case SyntaxKind.VarKeyword: - return parseVariableStatement(); + case SyntaxKind.LetKeyword: + case SyntaxKind.ConstKeyword: + // const here should always be parsed as const declaration because of check in 'isStatement' + return parseVariableStatement(scanner.getStartPos(), /*modifiers:*/ undefined); case SyntaxKind.FunctionKeyword: - return parseFunctionDeclaration(); + return parseFunctionDeclaration(scanner.getStartPos(), /*modifiers:*/ undefined); case SyntaxKind.SemicolonToken: return parseEmptyStatement(); case SyntaxKind.IfKeyword: @@ -2811,213 +3225,138 @@ module ts { case SyntaxKind.DebuggerKeyword: return parseDebuggerStatement(); default: - if (isLabel()) { - return parseLabelledStatement(); - } - return parseExpressionStatement(); + return isLabel() + ? parseLabeledStatement() + : parseExpressionStatement(); } } - function parseStatementOrFunction(): Statement { - return token === SyntaxKind.FunctionKeyword ? parseFunctionDeclaration() : parseStatement(); - } - - function parseAndCheckFunctionBody(isConstructor: boolean): Block { - var initialPosition = scanner.getTokenPos(); - var errorCountBeforeBody = file.syntacticErrors.length; + function parseFunctionBlockOrSemicolon(isGenerator: boolean): Block { if (token === SyntaxKind.OpenBraceToken) { - var body = parseBody(/* ignoreMissingOpenBrace */ false); - if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { - var diagnostic = isConstructor ? Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; - grammarErrorAtPos(initialPosition, 1, diagnostic); - } - return body; + return parseFunctionBlock(isGenerator, /* ignoreMissingOpenBrace */ false); } + if (canParseSemicolon()) { parseSemicolon(); return undefined; } + error(Diagnostics.Block_or_expected); // block or ';' expected } // DECLARATIONS - function parseVariableDeclaration(flags: NodeFlags, noIn?: boolean): VariableDeclaration { + function parseVariableDeclaration(): VariableDeclaration { var node = createNode(SyntaxKind.VariableDeclaration); - node.flags = flags; - var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); node.type = parseTypeAnnotation(); - - // Issue any initializer-related errors on the equals token - var initializerStart = scanner.getTokenPos(); - var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; - node.initializer = parseInitializer(/*inParameter*/ false, noIn); - - if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code - // and its Identifier is eval or arguments - reportInvalidUseInStrictMode(node.name); - } + node.initializer = parseInitializer(/*inParameter*/ false); return finishNode(node); } - function parseVariableDeclarationList(flags: NodeFlags, noIn?: boolean): NodeArray { - return parseDelimitedList(ParsingContext.VariableDeclarations, () => parseVariableDeclaration(flags, noIn), TrailingCommaBehavior.Disallow); + function setFlag(array: NodeArray, flag: NodeFlags): NodeArray { + for (var i = 0, n = array.length; i < n; i++) { + array[i].flags |= flag; + } + + return array; } - function parseVariableStatement(pos?: number, flags?: NodeFlags): VariableStatement { - var node = createNode(SyntaxKind.VariableStatement, pos); - if (flags) node.flags = flags; - var errorCountBeforeVarStatement = file.syntacticErrors.length; - parseExpected(SyntaxKind.VarKeyword); - node.declarations = parseVariableDeclarationList(flags, /*noIn*/false); + function parseVariableDeclarationList(): NodeArray { + return parseDelimitedList(ParsingContext.VariableDeclarations, parseVariableDeclaration); + } + + function parseVariableStatement(fullStart: number, modifiers: ModifiersArray): VariableStatement { + var node = createNode(SyntaxKind.VariableStatement, fullStart); + setModifiers(node, modifiers); + + if (token === SyntaxKind.LetKeyword) { + node.flags |= NodeFlags.Let; + } + else if (token === SyntaxKind.ConstKeyword) { + node.flags |= NodeFlags.Const; + } + else { + Debug.assert(token === SyntaxKind.VarKeyword); + } + + nextToken(); + node.declarations = allowInAnd(parseVariableDeclarationList); + setFlag(node.declarations, node.flags); + parseSemicolon(); - if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { - grammarErrorOnNode(node, Diagnostics.Variable_declaration_list_cannot_be_empty); - } return finishNode(node); } - function parseFunctionDeclaration(pos?: number, flags?: NodeFlags): FunctionDeclaration { - var node = createNode(SyntaxKind.FunctionDeclaration, pos); - if (flags) node.flags = flags; + function parseFunctionDeclaration(fullStart: number, modifiers: ModifiersArray): FunctionLikeDeclaration { + var node = createNode(SyntaxKind.FunctionDeclaration, fullStart); + setModifiers(node, modifiers); parseExpected(SyntaxKind.FunctionKeyword); + var isGenerator = parseOptional(SyntaxKind.AsteriskToken); + if (isGenerator) { + node.flags |= NodeFlags.Generator; + } + node.name = parseIdentifier(); - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - node.body = parseAndCheckFunctionBody(/*isConstructor*/ false); - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - // It is a SyntaxError to use within strict mode code the identifiers eval or arguments as the - // Identifier of a FunctionDeclaration or FunctionExpression or as a formal parameter name(13.1) - reportInvalidUseInStrictMode(node.name); - } + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator, node); + node.body = parseFunctionBlockOrSemicolon(isGenerator); return finishNode(node); } - function parseConstructorDeclaration(pos: number, flags: NodeFlags): ConstructorDeclaration { + function parseConstructorDeclaration(pos: number, modifiers: ModifiersArray): ConstructorDeclaration { var node = createNode(SyntaxKind.Constructor, pos); - node.flags = flags; + setModifiers(node, modifiers); parseExpected(SyntaxKind.ConstructorKeyword); - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - node.body = parseAndCheckFunctionBody(/*isConstructor*/ true); - if (node.typeParameters) { - grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - if (node.type) { - grammarErrorOnNode(node.type, Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false, node); + node.body = parseFunctionBlockOrSemicolon(/*isGenerator:*/ false); return finishNode(node); } - function parsePropertyMemberDeclaration(pos: number, flags: NodeFlags): Declaration { - var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; - var name = parsePropertyName(); - - var questionStart = scanner.getTokenPos(); - if (parseOptional(SyntaxKind.QuestionToken)) { - errorAtPos(questionStart, scanner.getStartPos() - questionStart, Diagnostics.A_class_member_cannot_be_declared_optional); + function parsePropertyMemberDeclaration(fullStart: number, modifiers: ModifiersArray): Declaration { + var flags = modifiers ? modifiers.flags : 0; + var isGenerator = parseOptional(SyntaxKind.AsteriskToken); + if (isGenerator) { + flags |= NodeFlags.Generator; } - if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { - var method = createNode(SyntaxKind.Method, pos); - method.flags = flags; + var name = parsePropertyName(); + if (parseOptional(SyntaxKind.QuestionToken)) { + // Note: this is not legal as per the grammar. But we allow it in the parser and + // report an error in the grammar checker. + flags |= NodeFlags.QuestionMark; + } + + if (isGenerator || token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { + var method = createNode(SyntaxKind.Method, fullStart); + setModifiers(method, modifiers); + if (flags) { + method.flags = flags; + } method.name = name; - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); - method.typeParameters = sig.typeParameters; - method.parameters = sig.parameters; - method.type = sig.type; - method.body = parseAndCheckFunctionBody(/*isConstructor*/ false); + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator, method); + method.body = parseFunctionBlockOrSemicolon(isGenerator); return finishNode(method); } else { - var property = createNode(SyntaxKind.Property, pos); - property.flags = flags; + var property = createNode(SyntaxKind.Property, fullStart); + setModifiers(property, modifiers); + if (flags) { + property.flags = flags; + } property.name = name; property.type = parseTypeAnnotation(); - - var initializerStart = scanner.getTokenPos(); - var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; - property.initializer = parseInitializer(/*inParameter*/ false); + property.initializer = allowInAnd(() => parseInitializer(/*inParameter*/ false)); parseSemicolon(); - - if (inAmbientContext && property.initializer && errorCountBeforePropertyDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } return finishNode(property); } } - function parseAndCheckMemberAccessorDeclaration(kind: SyntaxKind, pos: number, flags: NodeFlags): MethodDeclaration { - var errorCountBeforeAccessor = file.syntacticErrors.length; - var accessor = parseMemberAccessorDeclaration(kind, pos, flags); - - if (errorCountBeforeAccessor === file.syntacticErrors.length) { - if (languageVersion < ScriptTarget.ES5) { - grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (inAmbientContext) { - grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); - } - else if (accessor.typeParameters) { - grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_have_type_parameters); - } - else if (kind === SyntaxKind.GetAccessor && accessor.parameters.length) { - grammarErrorOnNode(accessor.name, Diagnostics.A_get_accessor_cannot_have_parameters); - } - else if (kind === SyntaxKind.SetAccessor) { - if (accessor.type) { - grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - else if (accessor.parameters.length !== 1) { - grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_must_have_exactly_one_parameter); - } - else { - var parameter = accessor.parameters[0]; - if (parameter.flags & NodeFlags.Rest) { - grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - else if (parameter.flags & NodeFlags.Modifier) { - grammarErrorOnNode(accessor.name, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - else if (parameter.flags & NodeFlags.QuestionMark) { - grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - else if (parameter.initializer) { - grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - } - } - return accessor; - } - - function parseMemberAccessorDeclaration(kind: SyntaxKind, pos: number, flags: NodeFlags): MethodDeclaration { - var node = createNode(kind, pos); - node.flags = flags; + function parseMemberAccessorDeclaration(kind: SyntaxKind, fullStart: number, modifiers: ModifiersArray): MethodDeclaration { + var node = createNode(kind, fullStart); + setModifiers(node, modifiers); node.name = parsePropertyName(); - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - - // A common error is to try to declare an accessor in an ambient class. - if (inAmbientContext && canParseSemicolon()) { - parseSemicolon(); - node.body = createMissingNode(); - } - else { - node.body = parseBody(/* ignoreMissingOpenBrace */ false); - } - + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false, node); + node.body = parseFunctionBlockOrSemicolon(/*isGenerator:*/ false); return finishNode(node); } @@ -3030,6 +3369,10 @@ module ts { nextToken(); } + if (token === SyntaxKind.AsteriskToken) { + return true; + } + // Try to get the first property-like token following all modifiers. // This can either be an identifier or the 'get' or 'set' keywords. if (isPropertyName()) { @@ -3071,272 +3414,142 @@ module ts { return false; } - function parseAndCheckModifiers(context: ModifierContext): number { + function parseModifiers(): ModifiersArray { var flags = 0; - var lastStaticModifierStart: number; - var lastStaticModifierLength: number; - var lastDeclareModifierStart: number; - var lastDeclareModifierLength: number; - var lastPrivateModifierStart: number; - var lastPrivateModifierLength: number; - + var modifiers: ModifiersArray; while (true) { var modifierStart = scanner.getTokenPos(); - var modifierToken = token; + var modifierKind = token; - // Try to parse the modifier - if (!parseAnyContextualModifier()) break; - - var modifierLength = scanner.getStartPos() - modifierStart; - - switch (modifierToken) { - case SyntaxKind.PublicKeyword: - if (flags & NodeFlags.Private || flags & NodeFlags.Public) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & NodeFlags.Static) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); - } - else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); - } - flags |= NodeFlags.Public; - break; - - case SyntaxKind.PrivateKeyword: - if (flags & NodeFlags.Private || flags & NodeFlags.Public) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & NodeFlags.Static) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); - } - else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); - } - lastPrivateModifierStart = modifierStart; - lastPrivateModifierLength = modifierLength; - flags |= NodeFlags.Private; - break; - - case SyntaxKind.StaticKeyword: - if (flags & NodeFlags.Static) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_already_seen, "static"); - } - else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); - } - else if (context === ModifierContext.Parameters) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } - lastStaticModifierStart = modifierStart; - lastStaticModifierLength = modifierLength; - flags |= NodeFlags.Static; - break; - - case SyntaxKind.ExportKeyword: - if (flags & NodeFlags.Export) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_already_seen, "export"); - } - else if (flags & NodeFlags.Ambient) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } - else if (context === ModifierContext.ClassMembers) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); - } - else if (context === ModifierContext.Parameters) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= NodeFlags.Export; - break; - - case SyntaxKind.DeclareKeyword: - if (flags & NodeFlags.Ambient) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_already_seen, "declare"); - } - else if (context === ModifierContext.ClassMembers) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); - } - else if (context === ModifierContext.Parameters) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } - else if (inAmbientContext && context === ModifierContext.ModuleElements) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } - lastDeclareModifierStart = modifierStart; - lastDeclareModifierLength = modifierLength; - flags |= NodeFlags.Ambient; - break; + if (!parseAnyContextualModifier()) { + break; } - } - if (token === SyntaxKind.ConstructorKeyword && flags & NodeFlags.Static) { - grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); - } - else if (token === SyntaxKind.ConstructorKeyword && flags & NodeFlags.Private) { - grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); - } - else if (token === SyntaxKind.ImportKeyword) { - if (flags & NodeFlags.Ambient) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + if (!modifiers) { + modifiers = []; } + flags |= modifierToFlag(modifierKind); + modifiers.push(finishNode(createNode(modifierKind, modifierStart))); } - else if (token === SyntaxKind.InterfaceKeyword) { - if (flags & NodeFlags.Ambient) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); - } + if (modifiers) { + modifiers.flags = flags; } - else if (token !== SyntaxKind.ExportKeyword && !(flags & NodeFlags.Ambient) && inAmbientContext && context === ModifierContext.SourceElements) { - // A declare modifier is required for any top level .d.ts declaration except export=, interfaces and imports: - // categories: - // - // DeclarationElement: - // ExportAssignment - // export_opt InterfaceDeclaration - // export_opt ImportDeclaration - // export_opt ExternalImportDeclaration - // export_opt AmbientDeclaration - // - var declarationStart = scanner.getTokenPos(); - var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; - grammarErrorAtPos(declarationStart, declarationFirstTokenLength, Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - } - return flags; + return modifiers; } function parseClassMemberDeclaration(): Declaration { - var pos = getNodePos(); - var flags = parseAndCheckModifiers(ModifierContext.ClassMembers); + var fullStart = getNodePos(); + var modifiers = parseModifiers(); if (parseContextualModifier(SyntaxKind.GetKeyword)) { - return parseAndCheckMemberAccessorDeclaration(SyntaxKind.GetAccessor, pos, flags); + return parseMemberAccessorDeclaration(SyntaxKind.GetAccessor, fullStart, modifiers); } if (parseContextualModifier(SyntaxKind.SetKeyword)) { - return parseAndCheckMemberAccessorDeclaration(SyntaxKind.SetAccessor, pos, flags); + return parseMemberAccessorDeclaration(SyntaxKind.SetAccessor, fullStart, modifiers); } if (token === SyntaxKind.ConstructorKeyword) { - return parseConstructorDeclaration(pos, flags); + return parseConstructorDeclaration(fullStart, modifiers); } - if (token >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral || token === SyntaxKind.NumericLiteral) { - return parsePropertyMemberDeclaration(pos, flags); + if (token >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral || token === SyntaxKind.NumericLiteral || token === SyntaxKind.AsteriskToken) { + return parsePropertyMemberDeclaration(fullStart, modifiers); } if (token === SyntaxKind.OpenBracketToken) { - if (flags) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - return parseIndexSignatureMember(); + return parseIndexSignatureMember(fullStart, modifiers); } // 'isClassMemberStart' should have hinted not to attempt parsing. Debug.fail("Should not have attempted to parse class member declaration."); } - function parseClassDeclaration(pos: number, flags: NodeFlags): ClassDeclaration { - var node = createNode(SyntaxKind.ClassDeclaration, pos); - node.flags = flags; - var errorCountBeforeClassDeclaration = file.syntacticErrors.length; + function parseClassDeclaration(fullStart: number, modifiers: ModifiersArray): ClassDeclaration { + var node = createNode(SyntaxKind.ClassDeclaration, fullStart); + setModifiers(node, modifiers); parseExpected(SyntaxKind.ClassKeyword); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); + // TODO(jfreeman): Parse arbitrary sequence of heritage clauses and error for order and duplicates - node.baseType = parseOptional(SyntaxKind.ExtendsKeyword) ? parseTypeReference() : undefined; - var implementsKeywordStart = scanner.getTokenPos(); - var implementsKeywordLength: number; + + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } + + node.baseType = inGeneratorParameterContext() + ? doOutsideOfYieldContext(parseClassBaseType) + : parseClassBaseType(); + if (parseOptional(SyntaxKind.ImplementsKeyword)) { - implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; - node.implementedTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, parseTypeReference, TrailingCommaBehavior.Disallow); + node.implementedTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, parseTypeReference); } - var errorCountBeforeClassBody = file.syntacticErrors.length; if (parseExpected(SyntaxKind.OpenBraceToken)) { - node.members = parseList(ParsingContext.ClassMembers, /*checkForStrictMode*/ false, parseClassMemberDeclaration); + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } + + node.members = inGeneratorParameterContext() + ? doOutsideOfYieldContext(parseClassMembers) + : parseClassMembers(); parseExpected(SyntaxKind.CloseBraceToken); } else { node.members = createMissingList(); } - if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { - grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, Diagnostics._0_list_cannot_be_empty, "implements"); - } return finishNode(node); } - function parseInterfaceDeclaration(pos: number, flags: NodeFlags): InterfaceDeclaration { - var node = createNode(SyntaxKind.InterfaceDeclaration, pos); - node.flags = flags; - var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; + function parseClassMembers() { + return parseList(ParsingContext.ClassMembers, /*checkForStrictMode*/ false, parseClassMemberDeclaration); + } + + function parseClassBaseType(): TypeReferenceNode { + return parseOptional(SyntaxKind.ExtendsKeyword) ? parseTypeReference() : undefined; + } + + function parseInterfaceDeclaration(fullStart: number, modifiers: ModifiersArray): InterfaceDeclaration { + var node = createNode(SyntaxKind.InterfaceDeclaration, fullStart); + setModifiers(node, modifiers); parseExpected(SyntaxKind.InterfaceKeyword); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); // TODO(jfreeman): Parse arbitrary sequence of heritage clauses and error for order and duplicates - var extendsKeywordStart = scanner.getTokenPos(); - var extendsKeywordLength: number; if (parseOptional(SyntaxKind.ExtendsKeyword)) { - extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; - node.baseTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, parseTypeReference, TrailingCommaBehavior.Disallow); - } - var errorCountBeforeInterfaceBody = file.syntacticErrors.length; - node.members = parseTypeLiteral().members; - if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { - grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, Diagnostics._0_list_cannot_be_empty, "extends"); + node.baseTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, parseTypeReference); } + node.members = parseObjectType(); return finishNode(node); } - function parseAndCheckEnumDeclaration(pos: number, flags: NodeFlags): EnumDeclaration { - function isIntegerLiteral(expression: Expression): boolean { - function isInteger(literalExpression: LiteralExpression): boolean { - // Allows for scientific notation since literalExpression.text was formed by - // coercing a number to a string. Sometimes this coercion can yield a string - // in scientific notation. - // We also don't need special logic for hex because a hex integer is converted - // to decimal when it is coerced. - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); - } + function parseTypeAliasDeclaration(fullStart: number, modifiers: ModifiersArray): TypeAliasDeclaration { + var node = createNode(SyntaxKind.TypeAliasDeclaration, fullStart); + setModifiers(node, modifiers); + parseExpected(SyntaxKind.TypeKeyword); + node.name = parseIdentifier(); + parseExpected(SyntaxKind.EqualsToken); + node.type = parseType(); + parseSemicolon(); + return finishNode(node); + } - if (expression.kind === SyntaxKind.PrefixOperator) { - var unaryExpression = expression; - if (unaryExpression.operator === SyntaxKind.PlusToken || unaryExpression.operator === SyntaxKind.MinusToken) { - expression = unaryExpression.operand; - } - } - if (expression.kind === SyntaxKind.NumericLiteral) { - return isInteger(expression); - } + // In an ambient declaration, the grammar only allows integer literals as initializers. + // In a non-ambient declaration, the grammar allows uninitialized members only in a + // ConstantEnumMemberSection, which starts at the beginning of an enum declaration + // or any time an integer literal initializer is encountered. + function parseEnumMember(): EnumMember { + var node = createNode(SyntaxKind.EnumMember, scanner.getStartPos()); + node.name = parsePropertyName(); + node.initializer = allowInAnd(() => parseInitializer(/*inParameter*/ false)); + return finishNode(node); + } - return false; - } - - var inConstantEnumMemberSection = true; - // In an ambient declaration, the grammar only allows integer literals as initializers. - // In a non-ambient declaration, the grammar allows uninitialized members only in a - // ConstantEnumMemberSection, which starts at the beginning of an enum declaration - // or any time an integer literal initializer is encountered. - function parseAndCheckEnumMember(): EnumMember { - var node = createNode(SyntaxKind.EnumMember); - var errorCountBeforeEnumMember = file.syntacticErrors.length; - node.name = parsePropertyName(); - node.initializer = parseInitializer(/*inParameter*/ false); - - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); - } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, Diagnostics.Enum_member_must_have_initializer); - } - return finishNode(node); - } - - var node = createNode(SyntaxKind.EnumDeclaration, pos); + function parseAndCheckEnumDeclaration(fullStart: number, flags: NodeFlags): EnumDeclaration { + var node = createNode(SyntaxKind.EnumDeclaration, fullStart); node.flags = flags; + if (flags & NodeFlags.Const) { + parseExpected(SyntaxKind.ConstKeyword); + } parseExpected(SyntaxKind.EnumKeyword); node.name = parseIdentifier(); if (parseExpected(SyntaxKind.OpenBraceToken)) { - node.members = parseDelimitedList(ParsingContext.EnumMembers, parseAndCheckEnumMember, TrailingCommaBehavior.Allow); + node.members = parseDelimitedList(ParsingContext.EnumMembers, parseEnumMember); parseExpected(SyntaxKind.CloseBraceToken); } else { @@ -3346,7 +3559,7 @@ module ts { } function parseModuleBody(): Block { - var node = createNode(SyntaxKind.ModuleBlock); + var node = createNode(SyntaxKind.ModuleBlock, scanner.getStartPos()); if (parseExpected(SyntaxKind.OpenBraceToken)) { node.statements = parseList(ParsingContext.ModuleElements, /*checkForStrictMode*/ false, parseModuleElement); parseExpected(SyntaxKind.CloseBraceToken); @@ -3357,58 +3570,34 @@ module ts { return finishNode(node); } - function parseInternalModuleTail(pos: number, flags: NodeFlags): ModuleDeclaration { - var node = createNode(SyntaxKind.ModuleDeclaration, pos); + function parseInternalModuleTail(fullStart: number, flags: NodeFlags): ModuleDeclaration { + var node = createNode(SyntaxKind.ModuleDeclaration, fullStart); node.flags = flags; node.name = parseIdentifier(); - if (parseOptional(SyntaxKind.DotToken)) { - node.body = parseInternalModuleTail(getNodePos(), NodeFlags.Export); - } - else { - node.body = parseModuleBody(); - forEach((node.body).statements, s => { - if (s.kind === SyntaxKind.ExportAssignment) { - // Export assignments are not allowed in an internal module - grammarErrorOnNode(s, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); - } - else if (s.kind === SyntaxKind.ImportDeclaration && (s).externalModuleName) { - grammarErrorOnNode(s, Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - }); - } + node.body = parseOptional(SyntaxKind.DotToken) + ? parseInternalModuleTail(getNodePos(), NodeFlags.Export) + : parseModuleBody(); return finishNode(node); } - function parseAmbientExternalModuleDeclaration(pos: number, flags: NodeFlags): ModuleDeclaration { - var node = createNode(SyntaxKind.ModuleDeclaration, pos); + function parseAmbientExternalModuleDeclaration(fullStart: number, flags: NodeFlags): ModuleDeclaration { + var node = createNode(SyntaxKind.ModuleDeclaration, fullStart); node.flags = flags; node.name = parseStringLiteral(); - if (!inAmbientContext) { - var errorCount = file.syntacticErrors.length; - // Only report this error if we have not already errored about a missing declare modifier, - // which would have been at or after pos - if (!errorCount || file.syntacticErrors[errorCount - 1].start < getTokenPos(pos)) { - grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - - // For error recovery, just in case the user forgot the declare modifier on this ambient - // external module, treat it as ambient anyway. - var saveInAmbientContext = inAmbientContext; - inAmbientContext = true; node.body = parseModuleBody(); - inAmbientContext = saveInAmbientContext; return finishNode(node); } - function parseModuleDeclaration(pos: number, flags: NodeFlags): ModuleDeclaration { + function parseModuleDeclaration(fullStart: number, flags: NodeFlags): ModuleDeclaration { parseExpected(SyntaxKind.ModuleKeyword); - return token === SyntaxKind.StringLiteral ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); + return token === SyntaxKind.StringLiteral + ? parseAmbientExternalModuleDeclaration(fullStart, flags) + : parseInternalModuleTail(fullStart, flags); } - function parseImportDeclaration(pos: number, flags: NodeFlags): ImportDeclaration { - var node = createNode(SyntaxKind.ImportDeclaration, pos); - node.flags = flags; + function parseImportDeclaration(fullStart: number, modifiers: ModifiersArray): ImportDeclaration { + var node = createNode(SyntaxKind.ImportDeclaration, fullStart); + setModifiers(node, modifiers); parseExpected(SyntaxKind.ImportKeyword); node.name = parseIdentifier(); parseExpected(SyntaxKind.EqualsToken); @@ -3424,22 +3613,26 @@ module ts { return finishNode(node); } - function parseExportAssignmentTail(pos: number): ExportAssignment { - var node = createNode(SyntaxKind.ExportAssignment, pos); + function parseExportAssignmentTail(fullStart: number, modifiers: ModifiersArray): ExportAssignment { + var node = createNode(SyntaxKind.ExportAssignment, fullStart); + setModifiers(node, modifiers); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); } - function isDeclaration() { + function isDeclarationStart(): boolean { switch (token) { case SyntaxKind.VarKeyword: + case SyntaxKind.LetKeyword: + case SyntaxKind.ConstKeyword: case SyntaxKind.FunctionKeyword: return true; case SyntaxKind.ClassKeyword: case SyntaxKind.InterfaceKeyword: case SyntaxKind.EnumKeyword: case SyntaxKind.ImportKeyword: + case SyntaxKind.TypeKeyword: // Not true keywords so ensure an identifier follows return lookAhead(() => nextToken() >= SyntaxKind.Identifier); case SyntaxKind.ModuleKeyword: @@ -3447,131 +3640,125 @@ module ts { return lookAhead(() => nextToken() >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral); case SyntaxKind.ExportKeyword: // Check for export assignment or modifier on source element - return lookAhead(() => nextToken() === SyntaxKind.EqualsToken || isDeclaration()); + return lookAhead(() => nextToken() === SyntaxKind.EqualsToken || isDeclarationStart()); case SyntaxKind.DeclareKeyword: case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: case SyntaxKind.StaticKeyword: // Check for modifier on source element - return lookAhead(() => { nextToken(); return isDeclaration(); }); + return lookAhead(() => { nextToken(); return isDeclarationStart(); }); } } - function parseDeclaration(modifierContext: ModifierContext): Statement { - var pos = getNodePos(); - var errorCountBeforeModifiers = file.syntacticErrors.length; - var flags = parseAndCheckModifiers(modifierContext); - + function parseDeclaration(): Statement { + var fullStart = getNodePos(); + var modifiers = parseModifiers(); if (token === SyntaxKind.ExportKeyword) { - var modifiersEnd = scanner.getStartPos(); nextToken(); if (parseOptional(SyntaxKind.EqualsToken)) { - var exportAssignmentTail = parseExportAssignmentTail(pos); - if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { - var modifiersStart = skipTrivia(sourceText, pos); - grammarErrorAtPos(modifiersStart, modifiersEnd - modifiersStart, Diagnostics.An_export_assignment_cannot_have_modifiers); - } - return exportAssignmentTail; + return parseExportAssignmentTail(fullStart, modifiers); } } - var saveInAmbientContext = inAmbientContext; - if (flags & NodeFlags.Ambient) { - inAmbientContext = true; - } - + var flags = modifiers ? modifiers.flags : 0; var result: Declaration; switch (token) { case SyntaxKind.VarKeyword: - result = parseVariableStatement(pos, flags); + case SyntaxKind.LetKeyword: + result = parseVariableStatement(fullStart, modifiers); + break; + case SyntaxKind.ConstKeyword: + var isConstEnum = lookAhead(() => nextToken() === SyntaxKind.EnumKeyword); + if (isConstEnum) { + result = parseAndCheckEnumDeclaration(fullStart, flags | NodeFlags.Const); + } + else { + result = parseVariableStatement(fullStart, modifiers); + } break; case SyntaxKind.FunctionKeyword: - result = parseFunctionDeclaration(pos, flags); + result = parseFunctionDeclaration(fullStart, modifiers); break; case SyntaxKind.ClassKeyword: - result = parseClassDeclaration(pos, flags); + result = parseClassDeclaration(fullStart, modifiers); break; case SyntaxKind.InterfaceKeyword: - result = parseInterfaceDeclaration(pos, flags); + result = parseInterfaceDeclaration(fullStart, modifiers); + break; + case SyntaxKind.TypeKeyword: + result = parseTypeAliasDeclaration(fullStart, modifiers); break; case SyntaxKind.EnumKeyword: - result = parseAndCheckEnumDeclaration(pos, flags); + result = parseAndCheckEnumDeclaration(fullStart, flags); break; case SyntaxKind.ModuleKeyword: - result = parseModuleDeclaration(pos, flags); + result = parseModuleDeclaration(fullStart, flags); break; case SyntaxKind.ImportKeyword: - result = parseImportDeclaration(pos, flags); + result = parseImportDeclaration(fullStart, modifiers); break; default: error(Diagnostics.Declaration_expected); } - inAmbientContext = saveInAmbientContext; + if (modifiers) { + result.modifiers = modifiers; + } + return result; } function isSourceElement(inErrorRecovery: boolean): boolean { - return isDeclaration() || isStatement(inErrorRecovery); + return isDeclarationStart() || isStatement(inErrorRecovery); } function parseSourceElement() { - return parseSourceElementOrModuleElement(ModifierContext.SourceElements); + return parseSourceElementOrModuleElement(); } function parseModuleElement() { - return parseSourceElementOrModuleElement(ModifierContext.ModuleElements); + return parseSourceElementOrModuleElement(); } - function parseSourceElementOrModuleElement(modifierContext: ModifierContext): Statement { - if (isDeclaration()) { - return parseDeclaration(modifierContext); - } - - var statementStart = scanner.getTokenPos(); - var statementFirstTokenLength = scanner.getTextPos() - statementStart; - var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(); - - if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { - grammarErrorAtPos(statementStart, statementFirstTokenLength, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - - return statement; + function parseSourceElementOrModuleElement(): Statement { + return isDeclarationStart() + ? parseDeclaration() + : parseStatement(); } function processReferenceComments(): ReferenceComments { var referencedFiles: FileReference[] = []; var amdDependencies: string[] = []; + var amdModuleName: string; commentRanges = []; token = scanner.scan(); for (var i = 0; i < commentRanges.length; i++) { var range = commentRanges[i]; var comment = sourceText.substring(range.pos, range.end); - var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (isNoDefaultLibRegEx.exec(comment)) { - file.hasNoDefaultLib = true; + var referencePathMatchResult = getFileReferenceFromReferencePath(comment, range); + if (referencePathMatchResult) { + var fileReference = referencePathMatchResult.fileReference; + file.hasNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + var diagnostic = referencePathMatchResult.diagnostic; + if (fileReference) { + referencedFiles.push(fileReference); } - else { - var matchResult = fullTripleSlashReferencePathRegEx.exec(comment); - if (!matchResult) { - var start = range.pos; - var length = range.end - start; - errorAtPos(start, length, Diagnostics.Invalid_reference_directive_syntax); - } - else { - referencedFiles.push({ - pos: range.pos, - end: range.end, - filename: matchResult[3] - }); - } + if (diagnostic) { + errorAtPos(range.pos, range.end - range.pos, diagnostic); } } else { + var amdModuleNameRegEx = /^\/\/\/\s* 0) { + // Don't bother doing any grammar checks if there are already parser errors. + // Otherwise we may end up with too many cascading errors. + syntacticDiagnostics = file.parseDiagnostics; + } + else { + // No parser errors were reported. Perform our stricter grammar checks. + syntacticDiagnostics = file.grammarDiagnostics; + checkGrammar(sourceText, languageVersion, file); + } + } + + Debug.assert(syntacticDiagnostics !== undefined); + return syntacticDiagnostics; + } + + scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText, scanError, onComment); var rootNodeFlags: NodeFlags = 0; if (fileExtensionIs(filename, ".d.ts")) { rootNodeFlags = NodeFlags.DeclarationFile; - inAmbientContext = true; } file = createRootNode(SyntaxKind.SourceFile, 0, sourceText.length, rootNodeFlags); file.filename = normalizePath(filename); file.text = sourceText; - file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; + file.getLineAndCharacterFromPosition = getLineAndCharacterFromSourcePosition; file.getPositionFromLineAndCharacter = getPositionFromSourceLineAndCharacter; - file.syntacticErrors = []; - file.semanticErrors = []; + file.getLineStarts = getLineStarts; + file.getSyntacticDiagnostics = getSyntacticDiagnostics; + file.parseDiagnostics = []; + file.grammarDiagnostics = []; + file.semanticDiagnostics = []; var referenceComments = processReferenceComments(); file.referencedFiles = referenceComments.referencedFiles; file.amdDependencies = referenceComments.amdDependencies; + file.amdModuleName = referenceComments.amdModuleName; + file.statements = parseList(ParsingContext.SourceElements, /*checkForStrictMode*/ true, parseSourceElement); file.externalModuleIndicator = getExternalModuleIndicator(); + file.nodeCount = nodeCount; file.identifierCount = identifierCount; file.version = version; @@ -3622,6 +3834,1138 @@ module ts { return file; } + function isLeftHandSideExpression(expr: Expression): boolean { + if (expr) { + switch (expr.kind) { + case SyntaxKind.PropertyAccess: + case SyntaxKind.IndexedAccess: + case SyntaxKind.NewExpression: + case SyntaxKind.CallExpression: + case SyntaxKind.TaggedTemplateExpression: + case SyntaxKind.ArrayLiteral: + case SyntaxKind.ParenExpression: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Identifier: + case SyntaxKind.Missing: + case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.TemplateExpression: + case SyntaxKind.FalseKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.ThisKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.SuperKeyword: + return true; + } + } + + return false; + } + + function isAssignmentOperator(token: SyntaxKind): boolean { + return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment; + } + + function checkGrammar(sourceText: string, languageVersion: ScriptTarget, file: SourceFile) { + var grammarDiagnostics = file.grammarDiagnostics; + + // Create a scanner so we can find the start of tokens to report errors on. + var scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText); + + // We're automatically in an ambient context if this is a .d.ts file. + var inAmbientContext = fileExtensionIs(file.filename, ".d.ts"); + var inFunctionBlock = false; + var parent: Node; + visitNode(file); + + function visitNode(node: Node): void { + // Store and restore our recursive state here. + var savedParent = parent; + node.parent = parent; + parent = node; + + if (!checkModifiers(node)) { + var savedInFunctionBlock = inFunctionBlock; + if (node.kind === SyntaxKind.FunctionBlock) { + inFunctionBlock = true; + } + + var savedInAmbientContext = inAmbientContext + if (node.flags & NodeFlags.Ambient) { + inAmbientContext = true; + } + + checkNodeAndChildren(node); + + inAmbientContext = savedInAmbientContext; + inFunctionBlock = savedInFunctionBlock; + } + + parent = savedParent; + } + + function checkNodeAndChildren(node: Node) { + var nodeKind = node.kind; + // First, check if you have a statement in a place where it is not allowed. We want + // to do this before recursing, because we'd prefer to report these errors at the top + // level instead of at some nested level. + if (inAmbientContext && checkForStatementInAmbientContext(node, nodeKind)) { + return; + } + + // if we got any errors, just stop performing any more checks on this node or higher. + if (checkNode(node, nodeKind)) { + return; + } + + // Otherwise, recurse and see if we have any errors below us. + forEachChild(node, visitNode); + } + + function checkNode(node: Node, nodeKind: SyntaxKind): boolean { + // Now do node specific checks. + switch (nodeKind) { + case SyntaxKind.ArrowFunction: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructorType: + case SyntaxKind.ConstructSignature: + case SyntaxKind.FunctionType: + return checkAnyParsedSignature(node); + case SyntaxKind.BreakStatement: + case SyntaxKind.ContinueStatement: + return checkBreakOrContinueStatement(node); + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + return checkCallOrNewExpression(node); + + case SyntaxKind.EnumDeclaration: return checkEnumDeclaration(node); + case SyntaxKind.BinaryExpression: return checkBinaryExpression(node); + case SyntaxKind.CatchBlock: return checkCatchBlock(node); + case SyntaxKind.ClassDeclaration: return checkClassDeclaration(node); + case SyntaxKind.Constructor: return checkConstructor(node); + case SyntaxKind.ExportAssignment: return checkExportAssignment(node); + case SyntaxKind.ForInStatement: return checkForInStatement(node); + case SyntaxKind.ForStatement: return checkForStatement(node); + case SyntaxKind.FunctionDeclaration: return checkFunctionDeclaration(node); + case SyntaxKind.FunctionExpression: return checkFunctionExpression(node); + case SyntaxKind.GetAccessor: return checkGetAccessor(node); + case SyntaxKind.IndexedAccess: return checkIndexedAccess(node); + case SyntaxKind.IndexSignature: return checkIndexSignature(node); + case SyntaxKind.InterfaceDeclaration: return checkInterfaceDeclaration(node); + case SyntaxKind.LabeledStatement: return checkLabeledStatement(node); + case SyntaxKind.Method: return checkMethod(node); + case SyntaxKind.ModuleDeclaration: return checkModuleDeclaration(node); + case SyntaxKind.ObjectLiteral: return checkObjectLiteral(node); + case SyntaxKind.NumericLiteral: return checkNumericLiteral(node); + case SyntaxKind.Parameter: return checkParameter(node); + case SyntaxKind.PostfixOperator: return checkPostfixOperator(node); + case SyntaxKind.PrefixOperator: return checkPrefixOperator(node); + case SyntaxKind.Property: return checkProperty(node); + case SyntaxKind.PropertyAssignment: return checkPropertyAssignment(node); + case SyntaxKind.ReturnStatement: return checkReturnStatement(node); + case SyntaxKind.SetAccessor: return checkSetAccessor(node); + case SyntaxKind.SourceFile: return checkSourceFile(node); + case SyntaxKind.ShorthandPropertyAssignment: return checkShorthandPropertyAssignment(node); + case SyntaxKind.SwitchStatement: return checkSwitchStatement(node); + case SyntaxKind.TaggedTemplateExpression: return checkTaggedTemplateExpression(node); + case SyntaxKind.TupleType: return checkTupleType(node); + case SyntaxKind.TypeParameter: return checkTypeParameter(node); + case SyntaxKind.TypeReference: return checkTypeReference(node); + case SyntaxKind.VariableDeclaration: return checkVariableDeclaration(node); + case SyntaxKind.VariableStatement: return checkVariableStatement(node); + case SyntaxKind.WithStatement: return checkWithStatement(node); + case SyntaxKind.YieldExpression: return checkYieldExpression(node); + } + } + + function grammarErrorOnFirstToken(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + var start = skipTrivia(sourceText, node.pos); + scanner.setTextPos(start); + scanner.scan(); + var end = scanner.getTextPos(); + grammarDiagnostics.push(createFileDiagnostic(file, start, end - start, message, arg0, arg1, arg2)); + return true; + } + + function grammarErrorOnNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + var span = getErrorSpanForNode(node); + var start = span.end > span.pos ? skipTrivia(file.text, span.pos) : span.pos; + var length = span.end - start; + + grammarDiagnostics.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + + function grammarErrorAtPos(start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + grammarDiagnostics.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + + function reportInvalidUseInStrictMode(node: Identifier): boolean { + // declarationNameToString cannot be used here since it uses a backreference to 'parent' that is not yet set + var name = sourceText.substring(skipTrivia(sourceText, node.pos), node.end); + return grammarErrorOnNode(node, Diagnostics.Invalid_use_of_0_in_strict_mode, name); + } + + function checkForStatementInAmbientContext(node: Node, kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.Block: + case SyntaxKind.EmptyStatement: + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ContinueStatement: + case SyntaxKind.BreakStatement: + case SyntaxKind.ReturnStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.SwitchStatement: + case SyntaxKind.ThrowStatement: + case SyntaxKind.TryStatement: + case SyntaxKind.DebuggerStatement: + case SyntaxKind.LabeledStatement: + case SyntaxKind.ExpressionStatement: + return grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + } + } + + function checkAnyParsedSignature(node: ParsedSignature): boolean { + return checkTypeParameterList(node.typeParameters) || + checkParameterList(node.parameters); + } + + function checkBinaryExpression(node: BinaryExpression) { + if (node.parserContextFlags & ParserContextFlags.StrictMode) { + if (isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operator)) { + if (isEvalOrArgumentsIdentifier(node.left)) { + // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) + return reportInvalidUseInStrictMode(node.left); + } + } + } + } + + function isIterationStatement(node: Node, lookInLabeledStatements: boolean): boolean { + switch (node.kind) { + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + return true; + case SyntaxKind.LabeledStatement: + return lookInLabeledStatements && isIterationStatement((node).statement, lookInLabeledStatements); + } + + return false; + } + + function checkLabeledStatement(node: LabeledStatement): boolean { + // ensure that label is unique + var current = node.parent; + while (current) { + if (isAnyFunction(current)) { + break; + } + if (current.kind === SyntaxKind.LabeledStatement && (current).label.text === node.label.text) { + return grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); + } + current = current.parent; + } + } + + function checkBreakOrContinueStatement(node: BreakOrContinueStatement): boolean { + var current = node; + while (current) { + if (isAnyFunction(current)) { + return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); + } + + switch (current.kind) { + case SyntaxKind.LabeledStatement: + if (node.label && (current).label.text === node.label.text) { + // found matching label - verify that label usage is correct + // continue can only target labels that are on iteration statements + var isMisplacedContinueLabel = node.kind === SyntaxKind.ContinueStatement + && !isIterationStatement((current).statement, /*lookInLabeledStatement*/ true); + + if (isMisplacedContinueLabel) { + return grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); + } + + return false; + } + break; + case SyntaxKind.SwitchStatement: + if (node.kind === SyntaxKind.BreakStatement && !node.label) { + // unlabeled break within switch statement - ok + return false; + } + break; + default: + if (isIterationStatement(current, /*lookInLabeledStatement*/ false) && !node.label) { + // unlabeled break or continue within iteration statement - ok + return false; + } + break; + } + + current = current.parent; + } + + if (node.label) { + var message = node.kind === SyntaxKind.BreakStatement + ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement + : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + + return grammarErrorOnNode(node, message) + } + else { + var message = node.kind === SyntaxKind.BreakStatement + ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement + : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message) + } + } + + function checkCallOrNewExpression(node: CallExpression) { + return checkTypeArguments(node.typeArguments) || + checkArguments(node.arguments); + } + + function checkArguments(arguments: NodeArray) { + return checkForDisallowedTrailingComma(arguments) || + checkForOmittedArgument(arguments); + } + + function checkTypeArguments(typeArguments: NodeArray) { + return checkForDisallowedTrailingComma(typeArguments) || + checkForAtLeastOneTypeArgument(typeArguments) || + checkForMissingTypeArgument(typeArguments); + } + + function checkForOmittedArgument(arguments: NodeArray) { + if (arguments) { + for (var i = 0, n = arguments.length; i < n; i++) { + var arg = arguments[i]; + if (arg.kind === SyntaxKind.OmittedExpression) { + return grammarErrorAtPos(arg.pos, 0, Diagnostics.Argument_expression_expected); + } + } + } + } + + function checkForMissingTypeArgument(typeArguments: NodeArray) { + if (typeArguments) { + for (var i = 0, n = typeArguments.length; i < n; i++) { + var arg = typeArguments[i]; + if (arg.kind === SyntaxKind.Missing) { + return grammarErrorAtPos(arg.pos, 0, Diagnostics.Type_expected); + } + } + } + } + + function checkForAtLeastOneTypeArgument(typeArguments: NodeArray) { + if (typeArguments && typeArguments.length === 0) { + var start = typeArguments.pos - "<".length; + var end = skipTrivia(sourceText, typeArguments.end) + ">".length; + return grammarErrorAtPos(start, end - start, Diagnostics.Type_argument_list_cannot_be_empty); + } + } + + function checkForDisallowedTrailingComma(list: NodeArray): boolean { + if (list && list.hasTrailingComma) { + var start = list.end - ",".length; + var end = list.end; + return grammarErrorAtPos(start, end - start, Diagnostics.Trailing_comma_not_allowed); + } + } + + function checkCatchBlock(node: CatchBlock) { + if (node.type) { + var colonStart = skipTrivia(sourceText, node.variable.end); + return grammarErrorAtPos(colonStart, ":".length, Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); + } + if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.variable)) { + // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the + // Catch production is eval or arguments + return reportInvalidUseInStrictMode(node.variable); + } + } + + function checkClassDeclaration(node: ClassDeclaration) { + return checkForDisallowedTrailingComma(node.implementedTypes) || + checkForAtLeastOneHeritageClause(node.implementedTypes, "implements"); + } + + function checkForAtLeastOneHeritageClause(types: NodeArray, listType: string): boolean { + if (types && types.length === 0) { + return grammarErrorAtPos(types.pos, 0, Diagnostics._0_list_cannot_be_empty, listType) + } + } + + function checkConstructor(node: ConstructorDeclaration) { + return checkAnyParsedSignature(node) || + checkConstructorTypeParameters(node) || + checkConstructorTypeAnnotation(node) || + checkForBodyInAmbientContext(node.body, /*isConstructor:*/ true); + } + + function checkConstructorTypeParameters(node: ConstructorDeclaration) { + if (node.typeParameters) { + return grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + } + + function checkConstructorTypeAnnotation(node: ConstructorDeclaration) { + if (node.type) { + return grammarErrorOnNode(node.type, Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + } + + function checkEnumDeclaration(enumDecl: EnumDeclaration): boolean { + var enumIsConst = (enumDecl.flags & NodeFlags.Const) !== 0; + + var hasError = false; + // skip checks below for const enums - they allow arbitrary initializers as long as they can be evaluated to constant expressions. + // since all values are known in compile time - it is not necessary to check that constant enum section precedes computed enum members. + if (!enumIsConst) { + var inConstantEnumMemberSection = true; + for (var i = 0, n = enumDecl.members.length; i < n; i++) { + var node = enumDecl.members[i]; + if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer)) { + hasError = grammarErrorOnNode(node.name, Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers) || hasError; + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection) { + hasError = grammarErrorOnNode(node.name, Diagnostics.Enum_member_must_have_initializer) || hasError; + } + } + } + + return hasError; + } + + function isIntegerLiteral(expression: Expression): boolean { + function isInteger(literalExpression: LiteralExpression): boolean { + // Allows for scientific notation since literalExpression.text was formed by + // coercing a number to a string. Sometimes this coercion can yield a string + // in scientific notation. + // We also don't need special logic for hex because a hex integer is converted + // to decimal when it is coerced. + return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); + } + + if (expression.kind === SyntaxKind.PrefixOperator) { + var unaryExpression = expression; + if (unaryExpression.operator === SyntaxKind.PlusToken || unaryExpression.operator === SyntaxKind.MinusToken) { + expression = unaryExpression.operand; + } + } + if (expression.kind === SyntaxKind.NumericLiteral) { + return isInteger(expression); + } + + return false; + } + + function checkExportAssignment(node: ExportAssignment) { + if (node.flags & NodeFlags.Modifier) { + return grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); + } + } + + function checkForInStatement(node: ForInStatement) { + return checkVariableDeclarations(node.declarations) || + checkForMoreThanOneDeclaration(node.declarations); + } + + function checkForStatement(node: ForStatement) { + return checkVariableDeclarations(node.declarations); + } + + function checkForMoreThanOneDeclaration(declarations: NodeArray) { + if (declarations && declarations.length > 1) { + return grammarErrorOnFirstToken(declarations[1], Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + } + } + + function checkFunctionDeclaration(node: FunctionLikeDeclaration) { + return checkAnyParsedSignature(node) || + checkFunctionName(node.name) || + checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false); + } + + function checkFunctionExpression(node: FunctionExpression) { + return checkAnyParsedSignature(node) || + checkFunctionName(node.name); + } + + function checkFunctionName(name: Node) { + if (name && name.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(name)) { + // It is a SyntaxError to use within strict mode code the identifiers eval or arguments as the + // Identifier of a FunctionLikeDeclaration or FunctionExpression or as a formal parameter name(13.1) + return reportInvalidUseInStrictMode(name); + } + } + + function checkGetAccessor(node: MethodDeclaration) { + return checkAnyParsedSignature(node) || + checkAccessor(node); + } + + function checkIndexedAccess(node: IndexedAccess) { + if (node.index.kind === SyntaxKind.Missing && + node.parent.kind === SyntaxKind.NewExpression && + (node.parent).func === node) { + + var start = skipTrivia(sourceText, node.parent.pos); + var end = node.end; + return grammarErrorAtPos(start, end - start, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + } + + function checkIndexSignature(node: SignatureDeclaration): boolean { + return checkIndexSignatureParameters(node) || + checkForIndexSignatureModifiers(node); + } + + function checkForIndexSignatureModifiers(node: SignatureDeclaration): boolean { + if (node.flags & NodeFlags.Modifier) { + return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_not_permitted_on_index_signature_members); + } + } + + function checkIndexSignatureParameters(node: SignatureDeclaration): boolean { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + if (parameter) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + else { + return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + } + else if (parameter.flags & NodeFlags.Rest) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + } + else if (parameter.flags & NodeFlags.Modifier) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + } + else if (parameter.flags & NodeFlags.QuestionMark) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + } + else if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + } + else if (!parameter.type) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + } + else if (parameter.type.kind !== SyntaxKind.StringKeyword && parameter.type.kind !== SyntaxKind.NumberKeyword) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); + } + else if (!node.type) { + return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_a_type_annotation); + } + } + + function checkInterfaceDeclaration(node: InterfaceDeclaration) { + return checkForDisallowedTrailingComma(node.baseTypes) || + checkForAtLeastOneHeritageClause(node.baseTypes, "extends"); + } + + function checkMethod(node: MethodDeclaration) { + return checkAnyParsedSignature(node) || + checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false) || + (node.parent.kind === SyntaxKind.ClassDeclaration && checkForInvalidQuestionMark(node, Diagnostics.A_class_member_cannot_be_declared_optional)); + } + + function checkForBodyInAmbientContext(body: Block | Expression, isConstructor: boolean): boolean { + if (inAmbientContext && body && body.kind === SyntaxKind.FunctionBlock) { + var diagnostic = isConstructor + ? Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context + : Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; + return grammarErrorOnFirstToken(body, diagnostic); + } + } + + function checkModuleDeclaration(node: ModuleDeclaration): boolean { + return checkModuleDeclarationName(node) || + checkModuleDeclarationStatements(node); + } + + function checkModuleDeclarationName(node: ModuleDeclaration) { + if (!inAmbientContext && node.name.kind === SyntaxKind.StringLiteral) { + return grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); + } + } + + function checkModuleDeclarationStatements(node: ModuleDeclaration): boolean { + if (node.name.kind === SyntaxKind.Identifier && node.body.kind === SyntaxKind.ModuleBlock) { + var statements = (node.body).statements; + for (var i = 0, n = statements.length; i < n; i++) { + var statement = statements[i]; + + if (statement.kind === SyntaxKind.ExportAssignment) { + // Export assignments are not allowed in an internal module + return grammarErrorOnNode(statement, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + } + else if (statement.kind === SyntaxKind.ImportDeclaration && (statement).externalModuleName) { + return grammarErrorOnNode((statement).externalModuleName, Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + } + } + } + } + + function checkObjectLiteral(node: ObjectLiteral): boolean { + var seen: Map = {}; + var Property = 1; + var GetAccessor = 2; + var SetAccesor = 4; + var GetOrSetAccessor = GetAccessor | SetAccesor; + var inStrictMode = (node.parserContextFlags & ParserContextFlags.StrictMode) !== 0; + + for (var i = 0, n = node.properties.length; i < n; i++) { + var prop = node.properties[i]; + // TODO(jfreeman): continue if we have a computed property + if (prop.kind === SyntaxKind.OmittedExpression) { + continue; + } + + var p = prop; + var name = p.name; + + // ECMA-262 11.1.5 Object Initialiser + // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true + // a.This production is contained in strict code and IsDataDescriptor(previous) is true and + // IsDataDescriptor(propId.descriptor) is true. + // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. + // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. + // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true + // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields + var currentKind: number; + if (p.kind === SyntaxKind.PropertyAssignment) { + currentKind = Property; + } + else if (p.kind === SyntaxKind.ShorthandPropertyAssignment) { + currentKind = Property; + } + else if (p.kind === SyntaxKind.GetAccessor) { + currentKind = GetAccessor; + } + else if (p.kind === SyntaxKind.SetAccessor) { + currentKind = SetAccesor; + } + else { + Debug.fail("Unexpected syntax kind:" + p.kind); + } + + if (!hasProperty(seen, name.text)) { + seen[name.text] = currentKind; + } + else { + var existingKind = seen[name.text]; + if (currentKind === Property && existingKind === Property) { + if (inStrictMode) { + grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + } + } + else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { + if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { + seen[name.text] = currentKind | existingKind; + } + else { + return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + } + } + else { + return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + } + } + } + } + + function checkNumericLiteral(node: LiteralExpression): boolean { + if (node.flags & NodeFlags.OctalLiteral) { + if (node.parserContextFlags & ParserContextFlags.StrictMode) { + return grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); + } + else if (languageVersion >= ScriptTarget.ES5) { + return grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + } + } + } + + function checkModifiers(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.Constructor: + case SyntaxKind.Property: + case SyntaxKind.Method: + case SyntaxKind.IndexSignature: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ExportAssignment: + case SyntaxKind.VariableStatement: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.ImportDeclaration: + case SyntaxKind.Parameter: + break; + default: + return false; + } + + if (!node.modifiers) { + return; + } + + var lastStatic: Node, lastPrivate: Node, lastProtected: Node, lastDeclare: Node; + var flags = 0; + for (var i = 0, n = node.modifiers.length; i < n; i++) { + var modifier = node.modifiers[i]; + + switch (modifier.kind) { + case SyntaxKind.PublicKeyword: + case SyntaxKind.ProtectedKeyword: + case SyntaxKind.PrivateKeyword: + var text: string; + if (modifier.kind === SyntaxKind.PublicKeyword) { + text = "public"; + } + else if (modifier.kind === SyntaxKind.ProtectedKeyword) { + text = "protected"; + lastProtected = modifier; + } + else { + text = "private"; + lastPrivate = modifier; + } + + if (flags & NodeFlags.AccessibilityModifier) { + return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & NodeFlags.Static) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } + else if (node.parent.kind === SyntaxKind.ModuleBlock || node.parent.kind === SyntaxKind.SourceFile) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); + } + flags |= modifierToFlag(modifier.kind); + break; + + case SyntaxKind.StaticKeyword: + if (flags & NodeFlags.Static) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); + } + else if (node.parent.kind === SyntaxKind.ModuleBlock || node.parent.kind === SyntaxKind.SourceFile) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); + } + else if (node.kind === SyntaxKind.Parameter) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } + flags |= NodeFlags.Static; + lastStatic = modifier; + break; + + case SyntaxKind.ExportKeyword: + if (flags & NodeFlags.Export) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); + } + else if (flags & NodeFlags.Ambient) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } + else if (node.parent.kind === SyntaxKind.ClassDeclaration) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); + } + else if (node.kind === SyntaxKind.Parameter) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= NodeFlags.Export; + break; + + case SyntaxKind.DeclareKeyword: + if (flags & NodeFlags.Ambient) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); + } + else if (node.parent.kind === SyntaxKind.ClassDeclaration) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); + } + else if (node.kind === SyntaxKind.Parameter) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } + else if (inAmbientContext && node.parent.kind === SyntaxKind.ModuleBlock) { + return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } + flags |= NodeFlags.Ambient; + lastDeclare = modifier; + break; + } + } + + if (node.kind === SyntaxKind.Constructor) { + if (flags & NodeFlags.Static) { + return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + else if (flags & NodeFlags.Protected) { + return grammarErrorOnNode(lastProtected, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); + } + else if (flags & NodeFlags.Private) { + return grammarErrorOnNode(lastPrivate, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); + } + } + else if (node.kind === SyntaxKind.ImportDeclaration && flags & NodeFlags.Ambient) { + return grammarErrorOnNode(lastDeclare, Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } + else if (node.kind === SyntaxKind.InterfaceDeclaration && flags & NodeFlags.Ambient) { + return grammarErrorOnNode(lastDeclare, Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); + } + } + + function checkParameter(node: ParameterDeclaration): boolean { + // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the + // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code + // or if its FunctionBody is strict code(11.1.5). + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) + if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.name)) { + return reportInvalidUseInStrictMode(node.name); + } + } + + function checkTypeParameterList(typeParameters: NodeArray): boolean { + if (checkForDisallowedTrailingComma(typeParameters)) { + return true; + } + + if (typeParameters && typeParameters.length === 0) { + var start = typeParameters.pos - "<".length; + var end = skipTrivia(sourceText, typeParameters.end) + ">".length; + return grammarErrorAtPos(start, end - start, Diagnostics.Type_parameter_list_cannot_be_empty); + } + } + + function checkParameterList(parameters: NodeArray): boolean { + if (checkForDisallowedTrailingComma(parameters)) { + return true; + } + + var seenOptionalParameter = false; + var parameterCount = parameters.length; + + for (var i = 0; i < parameterCount; i++) { + var parameter = parameters[i]; + if (parameter.flags & NodeFlags.Rest) { + if (i !== (parameterCount - 1)) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + + if (parameter.flags & NodeFlags.QuestionMark) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_be_optional); + } + + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer); + } + } + else if (parameter.flags & NodeFlags.QuestionMark || parameter.initializer) { + seenOptionalParameter = true; + + if (parameter.flags & NodeFlags.QuestionMark && parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + } + } + else { + if (seenOptionalParameter) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + } + } + } + } + + function checkPostfixOperator(node: UnaryExpression) { + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. + if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + } + + function checkPrefixOperator(node: UnaryExpression) { + if (node.parserContextFlags & ParserContextFlags.StrictMode) { + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator + if ((node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken) && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + else if (node.operator === SyntaxKind.DeleteKeyword && node.operand.kind === SyntaxKind.Identifier) { + // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its + // UnaryExpression is a direct reference to a variable, function argument, or function name + return grammarErrorOnNode(node.operand, Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); + } + } + } + + function checkProperty(node: PropertyDeclaration) { + return (node.parent.kind === SyntaxKind.ClassDeclaration && checkForInvalidQuestionMark(node, Diagnostics.A_class_member_cannot_be_declared_optional)) || + checkForInitializerInAmbientContext(node); + } + + function checkForInitializerInAmbientContext(node: PropertyDeclaration) { + if (inAmbientContext && node.initializer) { + return grammarErrorOnFirstToken(node.initializer, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + + function checkPropertyAssignment(node: PropertyDeclaration) { + return checkForInvalidQuestionMark(node, Diagnostics.An_object_member_cannot_be_declared_optional); + } + + function checkForInvalidQuestionMark(node: Declaration, message: DiagnosticMessage) { + if (node.flags & NodeFlags.QuestionMark) { + var pos = skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(pos, "?".length, message); + } + } + + function checkReturnStatement(node: ReturnStatement) { + if (!inFunctionBlock) { + return grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + } + } + + function checkSetAccessor(node: MethodDeclaration) { + return checkAnyParsedSignature(node) || + checkAccessor(node); + } + + function checkAccessor(accessor: MethodDeclaration): boolean { + var kind = accessor.kind; + if (languageVersion < ScriptTarget.ES5) { + return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (inAmbientContext) { + return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); + } + else if (accessor.body === undefined) { + return grammarErrorAtPos(accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); + } + else if (accessor.typeParameters) { + return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_have_type_parameters); + } + else if (kind === SyntaxKind.GetAccessor && accessor.parameters.length) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_get_accessor_cannot_have_parameters); + } + else if (kind === SyntaxKind.SetAccessor) { + if (accessor.type) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + else if (accessor.parameters.length !== 1) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + else { + var parameter = accessor.parameters[0]; + if (parameter.flags & NodeFlags.Rest) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + else if (parameter.flags & NodeFlags.Modifier) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + else if (parameter.flags & NodeFlags.QuestionMark) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + else if (parameter.initializer) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + } + } + + function checkSourceFile(node: SourceFile): boolean { + return inAmbientContext && checkTopLevelElementsForRequiredDeclareModifier(file); + } + + function checkTopLevelElementsForRequiredDeclareModifier(file: SourceFile): boolean { + for (var i = 0, n = file.statements.length; i < n; i++) { + var decl = file.statements[i]; + if (isDeclaration(decl) || decl.kind === SyntaxKind.VariableStatement) { + if (checkTopLevelElementForRequiredDeclareModifier(decl)) { + return true; + } + } + } + } + + function checkTopLevelElementForRequiredDeclareModifier(node: Node): boolean { + // A declare modifier is required for any top level .d.ts declaration except export=, interfaces and imports: + // categories: + // + // DeclarationElement: + // ExportAssignment + // export_opt InterfaceDeclaration + // export_opt ImportDeclaration + // export_opt ExternalImportDeclaration + // export_opt AmbientDeclaration + // + if (node.kind === SyntaxKind.InterfaceDeclaration || + node.kind === SyntaxKind.ImportDeclaration || + node.kind === SyntaxKind.ExportAssignment || + (node.flags & NodeFlags.Ambient)) { + + return false; + } + + return grammarErrorOnFirstToken(node, Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + } + + function checkShorthandPropertyAssignment(node: ShortHandPropertyDeclaration): boolean { + return checkForInvalidQuestionMark(node, Diagnostics.An_object_member_cannot_be_declared_optional); + } + + function checkSwitchStatement(node: SwitchStatement) { + var firstDefaultClause: CaseOrDefaultClause; + + // Error on duplicate 'default' clauses. + for (var i = 0, n = node.clauses.length; i < n; i++) { + var clause = node.clauses[i]; + if (clause.kind === SyntaxKind.DefaultClause) { + if (firstDefaultClause === undefined) { + firstDefaultClause = clause; + } + else { + var start = skipTrivia(file.text, clause.pos); + var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; + return grammarErrorAtPos(start, end - start, Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); + } + } + } + } + + function checkTaggedTemplateExpression(node: TaggedTemplateExpression) { + if (languageVersion < ScriptTarget.ES6) { + return grammarErrorOnFirstToken(node.template, Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + + function checkTupleType(node: TupleTypeNode) { + return checkForDisallowedTrailingComma(node.elementTypes) || + checkForAtLeastOneType(node); + } + + function checkForAtLeastOneType(node: TupleTypeNode): boolean { + if (node.elementTypes.length === 0) { + return grammarErrorOnNode(node, Diagnostics.A_tuple_type_element_list_cannot_be_empty) + } + } + + function checkTypeParameter(node: TypeParameterDeclaration) { + if (node.expression) { + return grammarErrorOnFirstToken(node.expression, Diagnostics.Type_expected); + } + } + + function checkTypeReference(node: TypeReferenceNode) { + return checkTypeArguments(node.typeArguments); + } + + function checkVariableDeclaration(node: VariableDeclaration) { + if (inAmbientContext && node.initializer) { + var equalsPos = node.type ? skipTrivia(sourceText, node.type.end) : skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(equalsPos, "=".length, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + if (!inAmbientContext && !node.initializer && isConst(node)) { + return grammarErrorOnNode(node, Diagnostics.const_declarations_must_be_initialized); + } + if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.name)) { + // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code + // and its Identifier is eval or arguments + return reportInvalidUseInStrictMode(node.name); + } + } + + function checkVariableDeclarations(declarations: NodeArray): boolean { + if (declarations) { + if (checkForDisallowedTrailingComma(declarations)) { + return true; + } + + if (!declarations.length) { + return grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, Diagnostics.Variable_declaration_list_cannot_be_empty); + } + + var decl = declarations[0]; + if (languageVersion < ScriptTarget.ES6) { + if (isLet(decl)) { + return grammarErrorOnFirstToken(decl, Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (isConst(decl)) { + return grammarErrorOnFirstToken(decl, Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + } + } + + function checkVariableStatement(node: VariableStatement) { + return checkVariableDeclarations(node.declarations) || + checkForDisallowedLetOrConstStatement(node); + } + + function checkForDisallowedLetOrConstStatement(node: VariableStatement) { + if (!allowLetAndConstDeclarations(node.parent)) { + if (isLet(node)) { + return grammarErrorOnNode(node, Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (isConst(node)) { + return grammarErrorOnNode(node, Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } + } + + function allowLetAndConstDeclarations(parent: Node): boolean { + switch (parent.kind) { + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + return false; + case SyntaxKind.LabeledStatement: + return allowLetAndConstDeclarations(parent.parent); + } + + return true; + } + + function checkWithStatement(node: WithStatement): boolean { + if (node.parserContextFlags & ParserContextFlags.StrictMode) { + // Strict mode code may not include a WithStatement. The occurrence of a WithStatement in such + // a context is an + return grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + + function checkYieldExpression(node: YieldExpression): boolean { + if (!(node.parserContextFlags & ParserContextFlags.Yield)) { + return grammarErrorOnFirstToken(node, Diagnostics.yield_expression_must_be_contained_within_a_generator_declaration); + } + } + } + export function createProgram(rootNames: string[], options: CompilerOptions, host: CompilerHost): Program { var program: Program; var files: SourceFile[] = []; @@ -3674,17 +5018,31 @@ module ts { var start = refPos; var length = refEnd - refPos; } + var diagnostic: DiagnosticMessage; if (hasExtension(filename)) { if (!fileExtensionIs(filename, ".ts")) { - errors.push(createFileDiagnostic(refFile, start, length, Diagnostics.File_0_must_have_extension_ts_or_d_ts, filename)); + diagnostic = Diagnostics.File_0_must_have_extension_ts_or_d_ts; } else if (!findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) { - errors.push(createFileDiagnostic(refFile, start, length, Diagnostics.File_0_not_found, filename)); + diagnostic = Diagnostics.File_0_not_found; + } + else if (refFile && host.getCanonicalFileName(filename) === host.getCanonicalFileName(refFile.filename)) { + diagnostic = Diagnostics.A_file_cannot_have_a_reference_to_itself; } } else { if (!(findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) || findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd))) { - errors.push(createFileDiagnostic(refFile, start, length, Diagnostics.File_0_not_found, filename + ".ts")); + diagnostic = Diagnostics.File_0_not_found; + filename += ".ts"; + } + } + + if (diagnostic) { + if (refFile) { + errors.push(createFileDiagnostic(refFile, start, length, diagnostic, filename)); + } + else { + errors.push(createCompilerDiagnostic(diagnostic, filename)); } } } @@ -3694,13 +5052,15 @@ module ts { var canonicalName = host.getCanonicalFileName(filename); if (hasProperty(filesByName, canonicalName)) { // We've already looked for this file, use cached result - var file = filesByName[canonicalName]; - if (file && host.useCaseSensitiveFileNames() && canonicalName !== file.filename) { - errors.push(createFileDiagnostic(refFile, refStart, refLength, - Diagnostics.Filename_0_differs_from_already_included_filename_1_only_in_casing, filename, file.filename)); - } + return getSourceFileFromCache(filename, canonicalName, /*useAbsolutePath*/ false); } else { + var normalizedAbsolutePath = getNormalizedAbsolutePath(filename, host.getCurrentDirectory()); + var canonicalAbsolutePath = host.getCanonicalFileName(normalizedAbsolutePath); + if (hasProperty(filesByName, canonicalAbsolutePath)) { + return getSourceFileFromCache(normalizedAbsolutePath, canonicalAbsolutePath, /*useAbsolutePath*/ true); + } + // We haven't looked for this file, do so now and cache result var file = filesByName[canonicalName] = host.getSourceFile(filename, options.target, hostErrorMessage => { errors.push(createFileDiagnostic(refFile, refStart, refLength, @@ -3708,6 +5068,10 @@ module ts { }); if (file) { seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; + + // Set the source file for normalized absolute path + filesByName[canonicalAbsolutePath] = file; + if (!options.noResolve) { var basePath = getDirectoryPath(filename); processReferencedFiles(file, basePath); @@ -3719,17 +5083,30 @@ module ts { else { files.push(file); } - forEach(file.syntacticErrors, e => { + forEach(file.getSyntacticDiagnostics(), e => { errors.push(e); }); } } return file; + + function getSourceFileFromCache(filename: string, canonicalName: string, useAbsolutePath: boolean): SourceFile { + var file = filesByName[canonicalName]; + if (file && host.useCaseSensitiveFileNames()) { + var sourceFileName = useAbsolutePath ? getNormalizedAbsolutePath(file.filename, host.getCurrentDirectory()) : file.filename; + if (canonicalName !== sourceFileName) { + errors.push(createFileDiagnostic(refFile, refStart, refLength, + Diagnostics.Filename_0_differs_from_already_included_filename_1_only_in_casing, filename, sourceFileName)); + } + } + return file; + } } function processReferencedFiles(file: SourceFile, basePath: string) { forEach(file.referencedFiles, ref => { - processSourceFile(normalizePath(combinePaths(basePath, ref.filename)), /* isDefaultLib */ false, file, ref.pos, ref.end); + var referencedFilename = isRootedDiskPath(ref.filename) ? ref.filename : combinePaths(basePath, ref.filename); + processSourceFile(normalizePath(referencedFilename), /* isDefaultLib */ false, file, ref.pos, ref.end); }); } @@ -3754,7 +5131,7 @@ module ts { } } } - else if (node.kind === SyntaxKind.ModuleDeclaration && (node).name.kind === SyntaxKind.StringLiteral && (node.flags & NodeFlags.Ambient || file.flags & NodeFlags.DeclarationFile)) { + else if (node.kind === SyntaxKind.ModuleDeclaration && (node).name.kind === SyntaxKind.StringLiteral && (node.flags & NodeFlags.Ambient || isDeclarationFile(file))) { // TypeScript 1.0 spec (April 2014): 12.1.6 // An AmbientExternalModuleDeclaration declares an external module. // This type of declaration is permitted only in the global module. @@ -3817,11 +5194,11 @@ module ts { // Each file contributes into common source file path if (!(sourceFile.flags & NodeFlags.DeclarationFile) && !fileExtensionIs(sourceFile.filename, ".js")) { - var sourcePathCompoments = getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); - sourcePathCompoments.pop(); // FileName is not part of directory + var sourcePathComponents = getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); + sourcePathComponents.pop(); // FileName is not part of directory if (commonPathComponents) { - for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathCompoments.length); i++) { - if (commonPathComponents[i] !== sourcePathCompoments[i]) { + for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { if (i === 0) { errors.push(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); return; @@ -3834,18 +5211,18 @@ module ts { } // If the fileComponent path completely matched and less than already found update the length - if (sourcePathCompoments.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathCompoments.length; + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; } } else { // first file - commonPathComponents = sourcePathCompoments; + commonPathComponents = sourcePathComponents; } } }); - commonSourceDirectory = getNormalizedPathFromPathCompoments(commonPathComponents); + commonSourceDirectory = getNormalizedPathFromPathComponents(commonPathComponents); if (commonSourceDirectory) { // Make sure directory path ends with directory separator so this string can directly // used to replace with "" to get the relative path of the source file and the relative path doesn't diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 59c7913e24a..4858265932e 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -24,6 +24,7 @@ module ts { isReservedWord(): boolean; reScanGreaterToken(): SyntaxKind; reScanSlashToken(): SyntaxKind; + reScanTemplateToken(): SyntaxKind; scan(): SyntaxKind; setText(text: string): void; setTextPos(textPos: number): void; @@ -80,6 +81,7 @@ module ts { "throw": SyntaxKind.ThrowKeyword, "true": SyntaxKind.TrueKeyword, "try": SyntaxKind.TryKeyword, + "type": SyntaxKind.TypeKeyword, "typeof": SyntaxKind.TypeOfKeyword, "var": SyntaxKind.VarKeyword, "void": SyntaxKind.VoidKeyword, @@ -244,7 +246,7 @@ module ts { return tokenStrings[t]; } - export function getLineStarts(text: string): number[] { + export function computeLineStarts(text: string): number[] { var result: number[] = new Array(); var pos = 0; var lineStart = 0; @@ -292,7 +294,7 @@ module ts { } export function positionToLineAndCharacter(text: string, pos: number) { - var lineStarts = getLineStarts(text); + var lineStarts = computeLineStarts(text); return getLineAndCharacterOfPosition(lineStarts, pos); } @@ -371,8 +373,8 @@ module ts { // between the given position and the next line break are returned. The return value is an array containing a TextRange for each // comment. Single-line comment ranges include the beginning '//' characters but not the ending line break. Multi-line comment // ranges include the beginning '/* and ending '*/' characters. The return value is undefined if no comments were found. - function getCommentRanges(text: string, pos: number, trailing: boolean): Comment[] { - var result: Comment[]; + function getCommentRanges(text: string, pos: number, trailing: boolean): CommentRange[] { + var result: CommentRange[]; var collecting = trailing || pos === 0; while (true) { var ch = text.charCodeAt(pos); @@ -440,11 +442,11 @@ module ts { } } - export function getLeadingComments(text: string, pos: number): Comment[] { + export function getLeadingCommentRanges(text: string, pos: number): CommentRange[] { return getCommentRanges(text, pos, /*trailing*/ false); } - export function getTrailingComments(text: string, pos: number): Comment[] { + export function getTrailingCommentRanges(text: string, pos: number): CommentRange[] { return getCommentRanges(text, pos, /*trailing*/ true); } @@ -460,12 +462,12 @@ module ts { ch > CharacterCodes.maxAsciiCharacter && isUnicodeIdentifierPart(ch, languageVersion); } - export function createScanner(languageVersion: ScriptTarget, text?: string, onError?: ErrorCallback, onComment?: CommentCallback): Scanner { + export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback, onComment?: CommentCallback): Scanner { var pos: number; // Current position (end position of text of current token) var len: number; // Length of text var startPos: number; // Start position of whitespace before current token var tokenPos: number; // Start position of text of current token - var token: number; + var token: SyntaxKind; var tokenValue: string; var precedingLineBreak: boolean; @@ -518,10 +520,10 @@ module ts { return +(text.substring(start, pos)); } - function scanHexDigits(count: number, exact?: boolean): number { + function scanHexDigits(count: number, mustMatchCount?: boolean): number { var digits = 0; var value = 0; - while (digits < count || !exact) { + while (digits < count || !mustMatchCount) { var ch = text.charCodeAt(pos); if (ch >= CharacterCodes._0 && ch <= CharacterCodes._9) { value = value * 16 + ch - CharacterCodes._0; @@ -551,7 +553,7 @@ module ts { while (true) { if (pos >= len) { result += text.substring(start, pos); - error(Diagnostics.Unexpected_end_of_text); + error(Diagnostics.Unterminated_string_literal); break; } var ch = text.charCodeAt(pos); @@ -562,60 +564,7 @@ module ts { } if (ch === CharacterCodes.backslash) { result += text.substring(start, pos); - pos++; - if (pos >= len) { - error(Diagnostics.Unexpected_end_of_text); - break; - } - ch = text.charCodeAt(pos++); - switch (ch) { - case CharacterCodes._0: - result += "\0"; - break; - case CharacterCodes.b: - result += "\b"; - break; - case CharacterCodes.t: - result += "\t"; - break; - case CharacterCodes.n: - result += "\n"; - break; - case CharacterCodes.v: - result += "\v"; - break; - case CharacterCodes.f: - result += "\f"; - break; - case CharacterCodes.r: - result += "\r"; - break; - case CharacterCodes.singleQuote: - result += "\'"; - break; - case CharacterCodes.doubleQuote: - result += "\""; - break; - case CharacterCodes.x: - case CharacterCodes.u: - var ch = scanHexDigits(ch === CharacterCodes.x ? 2 : 4, true); - if (ch >= 0) { - result += String.fromCharCode(ch); - } - else { - error(Diagnostics.Hexadecimal_digit_expected); - } - break; - case CharacterCodes.carriageReturn: - if (pos < len && text.charCodeAt(pos) === CharacterCodes.lineFeed) pos++; - break; - case CharacterCodes.lineFeed: - case CharacterCodes.lineSeparator: - case CharacterCodes.paragraphSeparator: - break; - default: - result += String.fromCharCode(ch); - } + result += scanEscapeSequence(); start = pos; continue; } @@ -629,13 +578,136 @@ module ts { return result; } + /** + * Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or + * a literal component of a TemplateExpression. + */ + function scanTemplateAndSetTokenValue(): SyntaxKind { + var startedWithBacktick = text.charCodeAt(pos) === CharacterCodes.backtick; + + pos++; + var start = pos; + var contents = "" + var resultingToken: SyntaxKind; + + while (true) { + if (pos >= len) { + contents += text.substring(start, pos); + error(Diagnostics.Unterminated_template_literal); + resultingToken = startedWithBacktick ? SyntaxKind.NoSubstitutionTemplateLiteral : SyntaxKind.TemplateTail; + break; + } + + var currChar = text.charCodeAt(pos); + + // '`' + if (currChar === CharacterCodes.backtick) { + contents += text.substring(start, pos); + pos++; + resultingToken = startedWithBacktick ? SyntaxKind.NoSubstitutionTemplateLiteral : SyntaxKind.TemplateTail; + break; + } + + // '${' + if (currChar === CharacterCodes.$ && pos + 1 < len && text.charCodeAt(pos + 1) === CharacterCodes.openBrace) { + contents += text.substring(start, pos); + pos += 2; + resultingToken = startedWithBacktick ? SyntaxKind.TemplateHead : SyntaxKind.TemplateMiddle; + break; + } + + // Escape character + if (currChar === CharacterCodes.backslash) { + contents += text.substring(start, pos); + contents += scanEscapeSequence(); + start = pos; + continue; + } + + // Speculated ECMAScript 6 Spec 11.8.6.1: + // and LineTerminatorSequences are normalized to for Template Values + // An explicit EscapeSequence is needed to include a or sequence. + if (currChar === CharacterCodes.carriageReturn) { + contents += text.substring(start, pos); + + if (pos + 1 < len && text.charCodeAt(pos + 1) === CharacterCodes.lineFeed) { + pos++; + } + pos++; + contents += "\n"; + start = pos; + continue; + } + + pos++; + } + + Debug.assert(resultingToken !== undefined); + + tokenValue = contents; + return resultingToken; + } + + function scanEscapeSequence(): string { + pos++; + if (pos >= len) { + error(Diagnostics.Unexpected_end_of_text); + return ""; + } + var ch = text.charCodeAt(pos++); + switch (ch) { + case CharacterCodes._0: + return "\0"; + case CharacterCodes.b: + return "\b"; + case CharacterCodes.t: + return "\t"; + case CharacterCodes.n: + return "\n"; + case CharacterCodes.v: + return "\v"; + case CharacterCodes.f: + return "\f"; + case CharacterCodes.r: + return "\r"; + case CharacterCodes.singleQuote: + return "\'"; + case CharacterCodes.doubleQuote: + return "\""; + case CharacterCodes.x: + case CharacterCodes.u: + var ch = scanHexDigits(ch === CharacterCodes.x ? 2 : 4, /*mustMatchCount*/ true); + if (ch >= 0) { + return String.fromCharCode(ch); + } + else { + error(Diagnostics.Hexadecimal_digit_expected); + return "" + } + + // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence), + // the line terminator is interpreted to be "the empty code unit sequence". + case CharacterCodes.carriageReturn: + if (pos < len && text.charCodeAt(pos) === CharacterCodes.lineFeed) { + pos++; + } + // fall through + case CharacterCodes.lineFeed: + case CharacterCodes.lineSeparator: + case CharacterCodes.paragraphSeparator: + return "" + default: + return String.fromCharCode(ch); + } + } + // Current character is known to be a backslash. Check for Unicode escape of the form '\uXXXX' // and return code point value if valid Unicode escape is found. Otherwise return -1. function peekUnicodeEscape(): number { if (pos + 5 < len && text.charCodeAt(pos + 1) === CharacterCodes.u) { var start = pos; pos += 2; - var value = scanHexDigits(4, true); + var value = scanHexDigits(4, /*mustMatchCount*/ true); pos = start; return value; } @@ -694,12 +766,34 @@ module ts { case CharacterCodes.lineFeed: case CharacterCodes.carriageReturn: precedingLineBreak = true; + if (skipTrivia) { + pos++; + continue; + } + else { + if (ch === CharacterCodes.carriageReturn && pos + 1 < len && text.charCodeAt(pos + 1) === CharacterCodes.lineFeed) { + // consume both CR and LF + pos += 2; + } + else { + pos++; + } + return token = SyntaxKind.NewLineTrivia; + } case CharacterCodes.tab: case CharacterCodes.verticalTab: case CharacterCodes.formFeed: case CharacterCodes.space: - pos++; - continue; + if (skipTrivia) { + pos++; + continue; + } + else { + while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { + pos++; + } + return token = SyntaxKind.WhitespaceTrivia; + } case CharacterCodes.exclamation: if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { if (text.charCodeAt(pos + 2) === CharacterCodes.equals) { @@ -712,6 +806,8 @@ module ts { case CharacterCodes.singleQuote: tokenValue = scanString(); return token = SyntaxKind.StringLiteral; + case CharacterCodes.backtick: + return token = scanTemplateAndSetTokenValue() case CharacterCodes.percent: if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.PercentEqualsToken; @@ -776,7 +872,13 @@ module ts { if (onComment) { onComment(tokenPos, pos); } - continue; + + if (skipTrivia) { + continue; + } + else { + return token = SyntaxKind.SingleLineCommentTrivia; + } } // Multi-line comment if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) { @@ -806,7 +908,12 @@ module ts { onComment(tokenPos, pos); } - continue; + if (skipTrivia) { + continue; + } + else { + return token = SyntaxKind.MultiLineCommentTrivia; + } } if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { @@ -818,18 +925,18 @@ module ts { case CharacterCodes._0: if (pos + 2 < len && (text.charCodeAt(pos + 1) === CharacterCodes.X || text.charCodeAt(pos + 1) === CharacterCodes.x)) { pos += 2; - var value = scanHexDigits(1, false); + var value = scanHexDigits(1, /*mustMatchCount*/ false); if (value < 0) { error(Diagnostics.Hexadecimal_digit_expected); value = 0; } tokenValue = "" + value; - return SyntaxKind.NumericLiteral; + return token = SyntaxKind.NumericLiteral; } // Try to parse as an octal if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); - return SyntaxKind.NumericLiteral; + return token = SyntaxKind.NumericLiteral; } // This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero // can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being @@ -959,19 +1066,19 @@ module ts { var inEscape = false; var inCharacterClass = false; while (true) { - // If we've hit EOF without closing off the regex, - // simply return the token we originally parsed. + // If we reach the end of a file, or hit a newline, then this is an unterminated + // regex. Report error and return what we have so far. if (p >= len) { - return token; + error(Diagnostics.Unterminated_regular_expression_literal) + break; } var ch = text.charCodeAt(p); - - // Line breaks are not permissible in the middle of a RegExp. if (isLineBreak(ch)) { - return token; + error(Diagnostics.Unterminated_regular_expression_literal) + break; } - + if (inEscape) { // Parsing an escape character; // reset the flag and just advance to the next char. @@ -980,6 +1087,7 @@ module ts { else if (ch === CharacterCodes.slash && !inCharacterClass) { // A slash within a character class is permissible, // but in general it signals the end of the regexp literal. + p++; break; } else if (ch === CharacterCodes.openBracket) { @@ -993,8 +1101,8 @@ module ts { } p++; } - p++; - while (isIdentifierPart(text.charCodeAt(p))) { + + while (p < len && isIdentifierPart(text.charCodeAt(p))) { p++; } pos = p; @@ -1004,6 +1112,15 @@ module ts { return token; } + /** + * Unconditionally back up and scan a template expression portion. + */ + function reScanTemplateToken(): SyntaxKind { + Debug.assert(token === SyntaxKind.CloseBraceToken, "'reScanTemplateToken' should only be called on a '}'"); + pos = tokenPos; + return token = scanTemplateAndSetTokenValue(); + } + function tryScan(callback: () => T): T { var savePos = pos; var saveStartPos = startPos; @@ -1050,12 +1167,13 @@ module ts { hasPrecedingLineBreak: () => precedingLineBreak, isIdentifier: () => token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord, isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan + reScanGreaterToken, + reScanSlashToken, + reScanTemplateToken, + scan, + setText, + setTextPos, + tryScan, }; } } diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 2f5ff604df3..e58d08589ba 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -1,4 +1,3 @@ -/// interface System { args: string[]; @@ -68,7 +67,7 @@ var sys: System = (function () { return fileStream.ReadText(); } catch (e) { - throw e.number === -2147024809 ? new Error(ts.Diagnostics.Unsupported_file_encoding.key) : e; + throw e; } finally { fileStream.Close(); @@ -100,14 +99,14 @@ var sys: System = (function () { } return { - args: args, + args, newLine: "\r\n", useCaseSensitiveFileNames: false, write(s: string): void { WScript.StdOut.Write(s); }, - readFile: readFile, - writeFile: writeFile, + readFile, + writeFile, resolvePath(path: string): string { return fso.GetAbsolutePathName(path); }, @@ -192,8 +191,8 @@ var sys: System = (function () { // 1 is a standard descriptor for stdout _fs.writeSync(1, s); }, - readFile: readFile, - writeFile: writeFile, + readFile, + writeFile, watchFile: (fileName, callback) => { // watchFile polls a file every 250ms, picking up file notifications. _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 8188cb8e4d1..9bb2db719f1 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -9,7 +9,7 @@ /// module ts { - var version = "1.1.0.0"; + var version = "1.3.0.0"; /** * Checks to see if the locale is in the appropriate format, @@ -142,14 +142,19 @@ module ts { // otherwise use toLowerCase as a canonical form. return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } - + + // returned by CScript sys environment + var unsupportedFileEncodingErrorCode = -2147024809; + function getSourceFile(filename: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile { try { var text = sys.readFile(filename, options.charset); } catch (e) { if (onError) { - onError(e.message); + onError(e.number === unsupportedFileEncodingErrorCode ? + getDiagnosticText(Diagnostics.Unsupported_file_encoding) : + e.message); } text = ""; } @@ -187,20 +192,26 @@ module ts { } return { - getSourceFile: getSourceFile, + getSourceFile, getDefaultLibFilename: () => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), "lib.d.ts"), - writeFile: writeFile, + writeFile, getCurrentDirectory: () => currentDirectory || (currentDirectory = sys.getCurrentDirectory()), useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, - getCanonicalFileName: getCanonicalFileName, + getCanonicalFileName, getNewLine: () => sys.newLine }; } export function executeCommandLine(args: string[]): void { var commandLine = parseCommandLine(args); + var compilerOptions = commandLine.options; + + if (compilerOptions.locale) { + if (typeof JSON === "undefined") { + reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--locale")); + return sys.exit(1); + } - if (commandLine.options.locale) { validateLocaleAndSetLanguage(commandLine.options.locale, commandLine.errors); } @@ -208,32 +219,38 @@ module ts { // setting up localization, report them and quit. if (commandLine.errors.length > 0) { reportDiagnostics(commandLine.errors); - return sys.exit(1); + return sys.exit(EmitReturnStatus.CompilerOptionsErrors); } - if (commandLine.options.version) { + if (compilerOptions.version) { reportDiagnostic(createCompilerDiagnostic(Diagnostics.Version_0, version)); - return sys.exit(0); + return sys.exit(EmitReturnStatus.Succeeded); } - if (commandLine.options.help || commandLine.filenames.length === 0) { + if (compilerOptions.help) { printVersion(); printHelp(); - return sys.exit(0); + return sys.exit(EmitReturnStatus.Succeeded); } - var defaultCompilerHost = createCompilerHost(commandLine.options); + if (commandLine.filenames.length === 0) { + printVersion(); + printHelp(); + return sys.exit(EmitReturnStatus.CompilerOptionsErrors); + } + + var defaultCompilerHost = createCompilerHost(compilerOptions); - if (commandLine.options.watch) { + if (compilerOptions.watch) { if (!sys.watchFile) { reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--watch")); - return sys.exit(1); + return sys.exit(EmitReturnStatus.CompilerOptionsErrors); } watchProgram(commandLine, defaultCompilerHost); } else { - var result = compile(commandLine, defaultCompilerHost).errors.length > 0 ? 1 : 0; + var result = compile(commandLine, defaultCompilerHost).exitStatus return sys.exit(result); } } @@ -328,23 +345,34 @@ module ts { function compile(commandLine: ParsedCommandLine, compilerHost: CompilerHost) { var parseStart = new Date().getTime(); - var program = createProgram(commandLine.filenames, commandLine.options, compilerHost); + var compilerOptions = commandLine.options; + var program = createProgram(commandLine.filenames, compilerOptions, compilerHost); var bindStart = new Date().getTime(); - var errors = program.getDiagnostics(); + var errors: Diagnostic[] = program.getDiagnostics(); + var exitStatus: EmitReturnStatus; + if (errors.length) { var checkStart = bindStart; var emitStart = bindStart; var reportStart = bindStart; + exitStatus = EmitReturnStatus.AllOutputGenerationSkipped; } else { var checker = program.getTypeChecker(/*fullTypeCheckMode*/ true); var checkStart = new Date().getTime(); - var semanticErrors = checker.getDiagnostics(); - var emitStart = new Date().getTime(); - var emitErrors = checker.emitFiles().errors; - var reportStart = new Date().getTime(); - errors = concatenate(semanticErrors, emitErrors); + errors = checker.getDiagnostics(); + if (checker.isEmitBlocked()) { + exitStatus = EmitReturnStatus.AllOutputGenerationSkipped; + } + else { + var emitStart = new Date().getTime(); + var emitOutput = checker.emitFiles(); + var emitErrors = emitOutput.diagnostics; + exitStatus = emitOutput.emitResultStatus; + var reportStart = new Date().getTime(); + errors = concatenate(errors, emitErrors); + } } reportDiagnostics(errors); @@ -366,8 +394,7 @@ module ts { reportTimeStatistic("Total time", reportStart - parseStart); } - return { program: program, errors: errors }; - + return { program, exitStatus }; } function printVersion() { @@ -392,7 +419,7 @@ module ts { // Build up the list of examples. var padding = makePadding(marginLength); output += getDiagnosticText(Diagnostics.Examples_Colon_0, makePadding(marginLength - examplesLength) + "tsc hello.ts") + sys.newLine; - output += padding + "tsc --out foo.js foo.ts" + sys.newLine; + output += padding + "tsc --out file.js file.ts" + sys.newLine; output += padding + "tsc @args.txt" + sys.newLine; output += sys.newLine; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 922db40cdec..83937c24ed9 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1,5 +1,4 @@ /// -/// module ts { @@ -9,13 +8,22 @@ module ts { } // token > SyntaxKind.Identifer => token is a keyword - export enum SyntaxKind { + export const enum SyntaxKind { Unknown, EndOfFileToken, + SingleLineCommentTrivia, + MultiLineCommentTrivia, + NewLineTrivia, + WhitespaceTrivia, // Literals NumericLiteral, StringLiteral, RegularExpressionLiteral, + NoSubstitutionTemplateLiteral, + // Pseudo-literals + TemplateHead, + TemplateMiddle, + TemplateTail, // Punctuation OpenBraceToken, CloseBraceToken, @@ -128,6 +136,7 @@ module ts { NumberKeyword, SetKeyword, StringKeyword, + TypeKeyword, // Parse tree nodes Missing, // Names @@ -146,17 +155,24 @@ module ts { IndexSignature, // Type TypeReference, + FunctionType, + ConstructorType, TypeQuery, TypeLiteral, ArrayType, + TupleType, + UnionType, + ParenType, // Expression ArrayLiteral, ObjectLiteral, PropertyAssignment, + ShorthandPropertyAssignment, PropertyAccess, IndexedAccess, CallExpression, NewExpression, + TaggedTemplateExpression, TypeAssertion, ParenExpression, FunctionExpression, @@ -165,6 +181,9 @@ module ts { PostfixOperator, BinaryExpression, ConditionalExpression, + TemplateExpression, + TemplateSpan, + YieldExpression, OmittedExpression, // Element Block, @@ -183,7 +202,7 @@ module ts { SwitchStatement, CaseClause, DefaultClause, - LabelledStatement, + LabeledStatement, ThrowStatement, TryStatement, TryBlock, @@ -195,6 +214,7 @@ module ts { FunctionBlock, ClassDeclaration, InterfaceDeclaration, + TypeAliasDeclaration, EnumDeclaration, ModuleDeclaration, ModuleBlock, @@ -215,42 +235,81 @@ module ts { FirstReservedWord = BreakKeyword, LastReservedWord = WithKeyword, FirstKeyword = BreakKeyword, - LastKeyword = StringKeyword, + LastKeyword = TypeKeyword, FirstFutureReservedWord = ImplementsKeyword, LastFutureReservedWord = YieldKeyword, FirstTypeNode = TypeReference, - LastTypeNode = ArrayType, - FirstPunctuation= OpenBraceToken, - LastPunctuation = CaretEqualsToken + LastTypeNode = ParenType, + FirstPunctuation = OpenBraceToken, + LastPunctuation = CaretEqualsToken, + FirstToken = EndOfFileToken, + LastToken = TypeKeyword, + FirstTriviaToken = SingleLineCommentTrivia, + LastTriviaToken = WhitespaceTrivia, + FirstLiteralToken = NumericLiteral, + LastLiteralToken = NoSubstitutionTemplateLiteral, + FirstTemplateToken = NoSubstitutionTemplateLiteral, + LastTemplateToken = TemplateTail, + FirstOperator = SemicolonToken, + LastOperator = CaretEqualsToken, + FirstBinaryOperator = LessThanToken, + LastBinaryOperator = CaretEqualsToken } - export enum NodeFlags { - Export = 0x00000001, // Declarations - Ambient = 0x00000002, // Declarations - QuestionMark = 0x00000004, // Parameter/Property/Method - Rest = 0x00000008, // Parameter - Public = 0x00000010, // Property/Method - Private = 0x00000020, // Property/Method - Static = 0x00000040, // Property/Method - MultiLine = 0x00000080, // Multi-line array or object literal - Synthetic = 0x00000100, // Synthetic node (for full fidelity) - DeclarationFile = 0x00000200, // Node is a .d.ts file + export const enum NodeFlags { + Export = 0x00000001, // Declarations + Ambient = 0x00000002, // Declarations + QuestionMark = 0x00000004, // Parameter/Property/Method + Rest = 0x00000008, // Parameter + Public = 0x00000010, // Property/Method + Private = 0x00000020, // Property/Method + Protected = 0x00000040, // Property/Method + Static = 0x00000080, // Property/Method + MultiLine = 0x00000100, // Multi-line array or object literal + Synthetic = 0x00000200, // Synthetic node (for full fidelity) + DeclarationFile = 0x00000400, // Node is a .d.ts file + Let = 0x00000800, // Variable declaration + Const = 0x00001000, // Variable declaration + OctalLiteral = 0x00002000, + Generator = 0x00004000, + YieldStar = 0x00008000, - Modifier = Export | Ambient | Public | Private | Static + Modifier = Export | Ambient | Public | Private | Protected | Static, + AccessibilityModifier = Public | Private | Protected, + BlockScoped = Let | Const + } + + export const enum ParserContextFlags { + // Set if this node was parsed in strict mode. Used for grammar error checks, as well as + // checking if the node can be reused in incremental settings. + StrictMode = 1 << 0, + DisallowIn = 1 << 1, + Yield = 1 << 2, + GeneratorParameter = 1 << 3, } export interface Node extends TextRange { kind: SyntaxKind; flags: NodeFlags; + // Specific context the parser was in when this node was created. Normally undefined. + // Only set when the parser was in some interesting context (like async/yield). + parserContextFlags?: ParserContextFlags; id?: number; // Unique id (used to look up NodeLinks) parent?: Node; // Parent node (initialized by binding) symbol?: Symbol; // Symbol declared by node (initialized by binding) locals?: SymbolTable; // Locals associated with node (initialized by binding) nextContainer?: Node; // Next container in declaration order (initialized by binding) localSymbol?: Symbol; // Local symbol declared by node (initialized by binding only for exported nodes) + modifiers?: ModifiersArray; // Array of modifiers } - export interface NodeArray extends Array, TextRange { } + export interface NodeArray extends Array, TextRange { + hasTrailingComma?: boolean; + } + + export interface ModifiersArray extends Array { + flags: number; + } export interface Identifier extends Node { text: string; // Text of identifier (with escapes converted to characters) @@ -262,9 +321,7 @@ module ts { right: Identifier; } - export interface EntityName extends Node { - // Identifier, QualifiedName, or Missing - } + export type EntityName = Identifier | QualifiedName; export interface ParsedSignature { typeParameters?: NodeArray; @@ -272,34 +329,73 @@ module ts { type?: TypeNode; } + export type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName; + export interface Declaration extends Node { - name?: Identifier; + name?: DeclarationName; + } + + export interface ComputedPropertyName extends Node { + expression: Expression; } export interface TypeParameterDeclaration extends Declaration { + name: Identifier; constraint?: TypeNode; + + // For error recovery purposes. + expression?: Expression; } export interface SignatureDeclaration extends Declaration, ParsedSignature { } export interface VariableDeclaration extends Declaration { + name: Identifier; type?: TypeNode; initializer?: Expression; } - export interface PropertyDeclaration extends VariableDeclaration { } + export interface PropertyDeclaration extends Declaration { + type?: TypeNode; + initializer?: Expression; + } + + export interface ShortHandPropertyDeclaration extends Declaration { + name: Identifier; + } export interface ParameterDeclaration extends VariableDeclaration { } - export interface FunctionDeclaration extends Declaration, ParsedSignature { - body?: Node; // Block or Expression + /** + * Several node kinds share function-like features such as a signature, + * a name, and a body. These nodes should extend FunctionLikeDeclaration. + * Examples: + * FunctionDeclaration + * MethodDeclaration + * ConstructorDeclaration + * AccessorDeclaration + * FunctionExpression + */ + export interface FunctionLikeDeclaration extends Declaration, ParsedSignature { + body?: Block | Expression; } - export interface MethodDeclaration extends FunctionDeclaration { } + export interface FunctionDeclaration extends FunctionLikeDeclaration { + name: Identifier; + body?: Block; + } - export interface ConstructorDeclaration extends FunctionDeclaration { } + export interface MethodDeclaration extends FunctionLikeDeclaration { + body?: Block; + } - export interface AccessorDeclaration extends FunctionDeclaration { } + export interface ConstructorDeclaration extends FunctionLikeDeclaration { + body?: Block; + } + + export interface AccessorDeclaration extends FunctionLikeDeclaration { + body?: Block; + } export interface TypeNode extends Node { } @@ -320,6 +416,18 @@ module ts { elementType: TypeNode; } + export interface TupleTypeNode extends TypeNode { + elementTypes: NodeArray; + } + + export interface UnionTypeNode extends TypeNode { + types: NodeArray; + } + + export interface ParenTypeNode extends TypeNode { + type: TypeNode; + } + export interface StringLiteralTypeNode extends TypeNode { text: string; } @@ -332,6 +440,10 @@ module ts { operator: SyntaxKind; operand: Expression; } + + export interface YieldExpression extends Expression { + expression: Expression; + } export interface BinaryExpression extends Expression { left: Expression; @@ -345,17 +457,30 @@ module ts { whenFalse: Expression; } - export interface FunctionExpression extends Expression, FunctionDeclaration { - body: Node; // Required, whereas the member inherited from FunctionDeclaration is optional + export interface FunctionExpression extends Expression, FunctionLikeDeclaration { + name?: Identifier; + body: Block | Expression; // Required, whereas the member inherited from FunctionDeclaration is optional } - // The text property of a LiteralExpression stores the interpreted value of the literal in text form. For a StringLiteral - // this means quotes have been removed and escapes have been converted to actual characters. For a NumericLiteral, the - // stored value is the toString() representation of the number. For example 1, 1.00, and 1e0 are all stored as just "1". + // The text property of a LiteralExpression stores the interpreted value of the literal in text form. For a StringLiteral, + // or any literal of a template, this means quotes have been removed and escapes have been converted to actual characters. + // For a NumericLiteral, the stored value is the toString() representation of the number. For example 1, 1.00, and 1e0 are all stored as just "1". export interface LiteralExpression extends Expression { text: string; } + export interface TemplateExpression extends Expression { + head: LiteralExpression; + templateSpans: NodeArray; + } + + // Each of these corresponds to a substitution expression and a template literal, in that order. + // The template literal must have kind TemplateMiddleLiteral or TemplateTailLiteral. + export interface TemplateSpan extends Node { + expression: Expression; + literal: LiteralExpression; + } + export interface ParenExpression extends Expression { expression: Expression; } @@ -386,6 +511,13 @@ module ts { export interface NewExpression extends CallExpression { } + export interface TaggedTemplateExpression extends Expression { + tag: Expression; + template: LiteralExpression | TemplateExpression; + } + + export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; + export interface TypeAssertion extends Expression { type: TypeNode; operand: Expression; @@ -431,7 +563,7 @@ module ts { } export interface ForInStatement extends IterationStatement { - declaration?: VariableDeclaration; + declarations?: NodeArray; variable?: Expression; expression: Expression; } @@ -459,7 +591,7 @@ module ts { statements: NodeArray; } - export interface LabelledStatement extends Statement { + export interface LabeledStatement extends Statement { label: Identifier; statement: Statement; } @@ -476,9 +608,11 @@ module ts { export interface CatchBlock extends Block { variable: Identifier; + type?: TypeNode; } export interface ClassDeclaration extends Declaration { + name: Identifier; typeParameters?: NodeArray; baseType?: TypeReferenceNode; implementedTypes?: NodeArray; @@ -486,24 +620,34 @@ module ts { } export interface InterfaceDeclaration extends Declaration { + name: Identifier; typeParameters?: NodeArray; baseTypes?: NodeArray; members: NodeArray; } + export interface TypeAliasDeclaration extends Declaration { + name: Identifier; + type: TypeNode; + } + export interface EnumMember extends Declaration { + name: Identifier | LiteralExpression; initializer?: Expression; } export interface EnumDeclaration extends Declaration { + name: Identifier; members: NodeArray; } export interface ModuleDeclaration extends Declaration { - body: Node; // Block or ModuleDeclaration + name: Identifier | LiteralExpression; + body: Block | ModuleDeclaration; } export interface ImportDeclaration extends Declaration { + name: Identifier; entityName?: EntityName; externalModuleName?: LiteralExpression; } @@ -516,19 +660,30 @@ module ts { filename: string; } - export interface Comment extends TextRange { + export interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; } export interface SourceFile extends Block { filename: string; text: string; - getLineAndCharacterFromPosition(position: number): { line: number; character: number }; + getLineAndCharacterFromPosition(position: number): LineAndCharacter; getPositionFromLineAndCharacter(line: number, character: number): number; + getLineStarts(): number[]; amdDependencies: string[]; + amdModuleName: string; referencedFiles: FileReference[]; - syntacticErrors: Diagnostic[]; - semanticErrors: Diagnostic[]; + semanticDiagnostics: Diagnostic[]; + + // Parse errors refer specifically to things the parser could not understand at all (like + // missing tokens, or tokens it didn't know how to deal with). Grammar errors are for + // things the parser understood, but either the ES6 or TS grammars do not allow (like + // putting an 'public' modifier on a 'class declaration'). + parseDiagnostics: Diagnostic[]; + grammarDiagnostics: Diagnostic[]; + + // Returns all + getSyntacticDiagnostics(): Diagnostic[]; hasNoDefaultLib: boolean; externalModuleIndicator: Node; // The first node that causes this file to be an external module nodeCount: number; @@ -552,184 +707,245 @@ module ts { } export interface SourceMapSpan { - /** Line number in the js file*/ - emittedLine: number; - /** Column number in the js file */ - emittedColumn: number; - /** Line number in the ts file */ - sourceLine: number; - /** Column number in the ts file */ - sourceColumn: number; - /** Optional name (index into names array) associated with this span */ - nameIndex?: number; - /** ts file (index into sources array) associated with this span*/ - sourceIndex: number; + emittedLine: number; // Line number in the .js file + emittedColumn: number; // Column number in the .js file + sourceLine: number; // Line number in the .ts file + sourceColumn: number; // Column number in the .ts file + nameIndex?: number; // Optional name (index into names array) associated with this span + sourceIndex: number; // .ts file (index into sources array) associated with this span*/ } export interface SourceMapData { - /** Where the sourcemap file is written */ - sourceMapFilePath: string; - /** source map url written in the js file */ - jsSourceMappingURL: string; - /** Source map's file field - js file name*/ - sourceMapFile: string; - /** Source map's sourceRoot field - location where the sources will be present if not "" */ - sourceMapSourceRoot: string; - /** Source map's sources field - list of sources that can be indexed in this source map*/ - sourceMapSources: string[]; - /** input source file (which one can use on program to get the file) - this is one to one mapping with the sourceMapSources list*/ - inputSourceFileNames: string[]; - /** Source map's names field - list of names that can be indexed in this source map*/ - sourceMapNames?: string[]; - /** Source map's mapping field - encoded source map spans*/ - sourceMapMappings: string; - /** Raw source map spans that were encoded into the sourceMapMappings*/ - sourceMapDecodedMappings: SourceMapSpan[]; + sourceMapFilePath: string; // Where the sourcemap file is written + jsSourceMappingURL: string; // source map URL written in the .js file + sourceMapFile: string; // Source map's file field - .js file name + sourceMapSourceRoot: string; // Source map's sourceRoot field - location where the sources will be present if not "" + sourceMapSources: string[]; // Source map's sources field - list of sources that can be indexed in this source map + inputSourceFileNames: string[]; // Input source file (which one can use on program to get the file), 1:1 mapping with the sourceMapSources list + sourceMapNames?: string[]; // Source map's names field - list of names that can be indexed in this source map + sourceMapMappings: string; // Source map's mapping field - encoded source map spans + sourceMapDecodedMappings: SourceMapSpan[]; // Raw source map spans that were encoded into the sourceMapMappings + } + + // Return code used by getEmitOutput function to indicate status of the function + export enum EmitReturnStatus { + Succeeded = 0, // All outputs generated as requested (.js, .map, .d.ts), no errors reported + AllOutputGenerationSkipped = 1, // No .js generated because of syntax errors, nothing generated + JSGeneratedWithSemanticErrors = 2, // .js and .map generated with semantic errors + DeclarationGenerationSkipped = 3, // .d.ts generation skipped because of semantic errors or declaration emitter specific errors; Output .js with semantic errors + EmitErrorsEncountered = 4, // Emitter errors occurred during emitting process + CompilerOptionsErrors = 5, // Errors occurred in parsing compiler options, nothing generated } export interface EmitResult { - errors: Diagnostic[]; + emitResultStatus: EmitReturnStatus; + diagnostics: Diagnostic[]; sourceMaps: SourceMapData[]; // Array of sourceMapData if compiler emitted sourcemaps } export interface TypeChecker { getProgram(): Program; getDiagnostics(sourceFile?: SourceFile): Diagnostic[]; + getDeclarationDiagnostics(sourceFile: SourceFile): Diagnostic[]; getGlobalDiagnostics(): Diagnostic[]; getNodeCount(): number; getIdentifierCount(): number; getSymbolCount(): number; getTypeCount(): number; checkProgram(): void; - emitFiles(): EmitResult; + emitFiles(targetSourceFile?: SourceFile): EmitResult; getParentOfSymbol(symbol: Symbol): Symbol; - getTypeOfSymbol(symbol: Symbol): Type; + getNarrowedTypeOfSymbol(symbol: Symbol, node: Node): Type; + getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propetyName: string): Symbol; + getPropertyOfType(type: Type, propertyName: string): Symbol; getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; getIndexTypeOfType(type: Type, kind: IndexKind): Type; getReturnTypeOfSignature(signature: Signature): Type; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolInfo(node: Node): Symbol; + getShorthandAssignmentValueSymbol(location: Node): Symbol; getTypeOfNode(node: Node): Type; - getApparentType(type: Type): ApparentType; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getAugmentedPropertiesOfApparentType(type: Type): Symbol[]; - getRootSymbol(symbol: Symbol): Symbol; + getSymbolDisplayBuilder(): SymbolDisplayBuilder; + getFullyQualifiedName(symbol: Symbol): string; + getAugmentedPropertiesOfType(type: Type): Symbol[]; + getRootSymbols(symbol: Symbol): Symbol[]; getContextualType(node: Node): Type; + getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; + getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; + isUndefinedSymbol(symbol: Symbol): boolean; + isArgumentsSymbol(symbol: Symbol): boolean; + isEmitBlocked(sourceFile?: SourceFile): boolean; + // Returns the constant value of this enum member, or 'undefined' if the enum member has a computed value. + getEnumMemberValue(node: EnumMember): number; + isValidPropertyAccess(node: PropertyAccess, propertyName: string): boolean; + getAliasedSymbol(symbol: Symbol): Symbol; } - export interface TextWriter { - write(s: string): void; - writeSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; + export interface SymbolDisplayBuilder { + buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; + buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; + buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + } + + export interface SymbolWriter { + writeKeyword(text: string): void; + writeOperator(text: string): void; + writePunctuation(text: string): void; + writeSpace(text: string): void; + writeStringLiteral(text: string): void; + writeParameter(text: string): void; + writeSymbol(text: string, symbol: Symbol): void; writeLine(): void; increaseIndent(): void; decreaseIndent(): void; - getText(): string; + clear(): void; + + // Called when the symbol writer encounters a symbol to write. Currently only used by the + // declaration emitter to help determine if it should patch up the final declaration file + // with import statements it previously saw (but chose not to emit). + trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; } - export enum TypeFormatFlags { - None = 0x00000000, - - /** writes Array instead T[] */ - WriteArrayAsGenericType = 0x00000001, // Declarations - - UseTypeOfFunction = 0x00000002, // instead of writing signature type of function use typeof + export const enum TypeFormatFlags { + None = 0x00000000, + WriteArrayAsGenericType = 0x00000001, // Write Array instead T[] + UseTypeOfFunction = 0x00000002, // Write typeof instead of function type literal + NoTruncation = 0x00000004, // Don't truncate typeToString result + WriteArrowStyleSignature = 0x00000008, // Write arrow style signature + WriteOwnNameForAnyLike = 0x00000010, // Write symbol's own name instead of 'any' for any like types (eg. unknown, __resolving__ etc) + WriteTypeArgumentsOfSignature = 0x00000020, // Write the type arguments instead of type parameters of the signature + InElementType = 0x00000040, // Writing an array or union element type } - export enum SymbolAccessibility { + export const enum SymbolFormatFlags { + None = 0x00000000, + WriteTypeParametersOrArguments = 0x00000001, // Write symbols's type argument if it is instantiated symbol + // eg. class C { p: T } <-- Show p as C.p here + // var a: C; + // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p + UseOnlyExternalAliasing = 0x00000002, // Use only external alias information to get the symbol name in the given context + // eg. module m { export class c { } } import x = m.c; + // When this flag is specified m.c will be used to refer to the class instead of alias symbol x + } + + export const enum SymbolAccessibility { Accessible, NotAccessible, CannotBeNamed } - export interface SymbolAccessiblityResult { + export interface SymbolVisibilityResult { accessibility: SymbolAccessibility; - errorSymbolName?: string // Optional symbol name that results in error - errorModuleName?: string // If the symbol is not visible from module, module's name aliasesToMakeVisible?: ImportDeclaration[]; // aliases that need to have this symbol visible + errorSymbolName?: string; // Optional symbol name that results in error + errorNode?: Node; // optional node that results in error + } + + export interface SymbolAccessiblityResult extends SymbolVisibilityResult { + errorModuleName?: string // If the symbol is not visible from module, module's name } export interface EmitResolver { getProgram(): Program; - getLocalNameOfContainer(container: Declaration): string; + getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string; getExpressionNamePrefix(node: Identifier): string; - getPropertyAccessSubstitution(node: PropertyAccess): string; getExportAssignmentName(node: SourceFile): string; isReferencedImportDeclaration(node: ImportDeclaration): boolean; - isTopLevelValueImportedViaEntityName(node: ImportDeclaration): boolean; + isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; getNodeCheckFlags(node: Node): NodeCheckFlags; getEnumMemberValue(node: EnumMember): number; - shouldEmitDeclarations(): boolean; + hasSemanticErrors(): boolean; isDeclarationVisible(node: Declaration): boolean; - isImplementationOfOverload(node: FunctionDeclaration): boolean; - writeTypeAtLocation(location: Node, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: TextWriter): void; - writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: TextWriter): void; - writeSymbol(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, writer: TextWriter): void; + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; + writeTypeAtLocation(location: Node, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; + writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName: EntityName): SymbolAccessiblityResult; + isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; + // Returns the constant value this property access resolves to, or 'undefined' for a non-constant + getConstantValue(node: PropertyAccess | IndexedAccess): number; + isEmitBlocked(sourceFile?: SourceFile): boolean; } - export enum SymbolFlags { - Variable = 0x00000001, // Variable or parameter - Property = 0x00000002, // Property or enum member - EnumMember = 0x00000004, // Enum member - Function = 0x00000008, // Function - Class = 0x00000010, // Class - Interface = 0x00000020, // Interface - Enum = 0x00000040, // Enum - ValueModule = 0x00000080, // Instantiated module - NamespaceModule = 0x00000100, // Uninstantiated module - TypeLiteral = 0x00000200, // Type Literal - ObjectLiteral = 0x00000400, // Object Literal - Method = 0x00000800, // Method - Constructor = 0x00001000, // Constructor - GetAccessor = 0x00002000, // Get accessor - SetAccessor = 0x00004000, // Set accessor - CallSignature = 0x00008000, // Call signature - ConstructSignature = 0x00010000, // Construct signature - IndexSignature = 0x00020000, // Index signature - TypeParameter = 0x00040000, // Type parameter + export const enum SymbolFlags { + FunctionScopedVariable = 0x00000001, // Variable (var) or parameter + BlockScopedVariable = 0x00000002, // A block-scoped variable (let or const) + Property = 0x00000004, // Property or enum member + EnumMember = 0x00000008, // Enum member + Function = 0x00000010, // Function + Class = 0x00000020, // Class + Interface = 0x00000040, // Interface + ConstEnum = 0x00000080, // Const enum + RegularEnum = 0x00000100, // Enum + ValueModule = 0x00000200, // Instantiated module + NamespaceModule = 0x00000400, // Uninstantiated module + TypeLiteral = 0x00000800, // Type Literal + ObjectLiteral = 0x00001000, // Object Literal + Method = 0x00002000, // Method + Constructor = 0x00004000, // Constructor + GetAccessor = 0x00008000, // Get accessor + SetAccessor = 0x00010000, // Set accessor + CallSignature = 0x00020000, // Call signature + ConstructSignature = 0x00040000, // Construct signature + IndexSignature = 0x00080000, // Index signature + TypeParameter = 0x00100000, // Type parameter + TypeAlias = 0x00200000, // Type alias // Export markers (see comment in declareModuleMember in binder) - ExportValue = 0x00080000, // Exported value marker - ExportType = 0x00100000, // Exported type marker - ExportNamespace = 0x00200000, // Exported namespace marker - - Import = 0x00400000, // Import - Instantiated = 0x00800000, // Instantiated symbol - Merged = 0x01000000, // Merged symbol (created during program binding) - Transient = 0x02000000, // Transient symbol (created during type check) - Prototype = 0x04000000, // Symbol for the prototype property (without source code representation) + ExportValue = 0x00400000, // Exported value marker + ExportType = 0x00800000, // Exported type marker + ExportNamespace = 0x01000000, // Exported namespace marker + Import = 0x02000000, // Import + Instantiated = 0x04000000, // Instantiated symbol + Merged = 0x08000000, // Merged symbol (created during program binding) + Transient = 0x10000000, // Transient symbol (created during type check) + Prototype = 0x20000000, // Prototype property (no source representation) + UnionProperty = 0x40000000, // Property in union type + Enum = RegularEnum | ConstEnum, + Variable = FunctionScopedVariable | BlockScopedVariable, Value = Variable | Property | EnumMember | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor, - Type = Class | Interface | Enum | TypeLiteral | ObjectLiteral | TypeParameter, + Type = Class | Interface | Enum | TypeLiteral | ObjectLiteral | TypeParameter | TypeAlias, Namespace = ValueModule | NamespaceModule, Module = ValueModule | NamespaceModule, Accessor = GetAccessor | SetAccessor, Signature = CallSignature | ConstructSignature | IndexSignature, + // Variables can be redeclared, but can not redeclare a block-scoped declaration with the + // same name, or any other value that is not a variable, e.g. ValueModule or Class + FunctionScopedVariableExcludes = Value & ~FunctionScopedVariable, + + // Block-scoped declarations are not allowed to be re-declared + // they can not merge with anything in the value space + BlockScopedVariableExcludes = Value, + ParameterExcludes = Value, - VariableExcludes = Value & ~Variable, PropertyExcludes = Value, EnumMemberExcludes = Value, FunctionExcludes = Value & ~(Function | ValueModule), ClassExcludes = (Value | Type) & ~ValueModule, InterfaceExcludes = Type & ~Interface, - EnumExcludes = (Value | Type) & ~(Enum | ValueModule), - ValueModuleExcludes = Value & ~(Function | Class | Enum | ValueModule), + RegularEnumExcludes = (Value | Type) & ~(RegularEnum | ValueModule), // regular enums merge only with regular enums and modules + ConstEnumExcludes = (Value | Type) & ~ConstEnum, // const enums merge only with const enums + ValueModuleExcludes = Value & ~(Function | Class | RegularEnum | ValueModule), NamespaceModuleExcludes = 0, MethodExcludes = Value & ~Method, GetAccessorExcludes = Value & ~SetAccessor, SetAccessorExcludes = Value & ~GetAccessor, TypeParameterExcludes = Type & ~TypeParameter, + TypeAliasExcludes = Type, + ImportExcludes = Import, // Imports collide with all other imports with the same name - // Imports collide with all other imports with the same name. - ImportExcludes = Import, - - ModuleMember = Variable | Function | Class | Interface | Enum | Module | Import, + ModuleMember = Variable | Function | Class | Interface | Enum | Module | TypeAlias | Import, ExportHasLocal = Function | Class | Enum | ValueModule, @@ -737,9 +953,9 @@ module ts { HasExports = Class | Enum | Module, HasMembers = Class | Interface | TypeLiteral | ObjectLiteral, - IsContainer = HasLocals | HasExports | HasMembers, - PropertyOrAccessor = Property | Accessor, - Export = ExportNamespace | ExportType | ExportValue, + IsContainer = HasLocals | HasExports | HasMembers, + PropertyOrAccessor = Property | Accessor, + Export = ExportNamespace | ExportType | ExportValue, } export interface Symbol { @@ -752,7 +968,8 @@ module ts { members?: SymbolTable; // Class, interface or literal instance members exports?: SymbolTable; // Module exports exportSymbol?: Symbol; // Exported symbol associated with this symbol - valueDeclaration?: Declaration // First value declaration of the symbol + valueDeclaration?: Declaration // First value declaration of the symbol, + constEnumOnlyModule?: boolean // For modules - if true - module contains only const enums or other modules with only const enums. } export interface SymbolLinks { @@ -762,6 +979,7 @@ module ts { mapper?: TypeMapper; // Type mapper for instantiation alias referenced?: boolean; // True if alias symbol has been referenced as a value exportAssignSymbol?: Symbol; // Symbol exported from external module + unionType?: UnionType; // Containing union type for union property } export interface TransientSymbol extends Symbol, SymbolLinks { } @@ -770,28 +988,32 @@ module ts { [index: string]: Symbol; } - export enum NodeCheckFlags { - TypeChecked = 0x00000001, // Node has been type checked - LexicalThis = 0x00000002, // Lexical 'this' reference - CaptureThis = 0x00000004, // Lexical 'this' used in body - EmitExtends = 0x00000008, // Emit __extends - SuperInstance = 0x00000010, // Instance 'super' reference - SuperStatic = 0x00000020, // Static 'super' reference - ContextChecked = 0x00000040, // Contextual types have been assigned + export const enum NodeCheckFlags { + TypeChecked = 0x00000001, // Node has been type checked + LexicalThis = 0x00000002, // Lexical 'this' reference + CaptureThis = 0x00000004, // Lexical 'this' used in body + EmitExtends = 0x00000008, // Emit __extends + SuperInstance = 0x00000010, // Instance 'super' reference + SuperStatic = 0x00000020, // Static 'super' reference + ContextChecked = 0x00000040, // Contextual types have been assigned + + // Values for enum members have been computed, and any errors have been reported for them. + EnumValuesComputed = 0x00000080, } export interface NodeLinks { - resolvedType?: Type; // Cached type of type node - resolvedSignature?: Signature; // Cached signature of signature node or call expression - resolvedSymbol?: Symbol; // Cached name resolution result - flags?: NodeCheckFlags; // Set of flags specific to Node - enumMemberValue?: number; // Constant value of enum member + resolvedType?: Type; // Cached type of type node + resolvedSignature?: Signature; // Cached signature of signature node or call expression + resolvedSymbol?: Symbol; // Cached name resolution result + flags?: NodeCheckFlags; // Set of flags specific to Node + enumMemberValue?: number; // Constant value of enum member isIllegalTypeReferenceInConstraint?: boolean; // Is type reference in constraint refers to the type parameter from the same list - isVisible?: boolean; // Is this node visible - localModuleName?: string; // Local name for module instance + isVisible?: boolean; // Is this node visible + localModuleName?: string; // Local name for module instance + assignmentChecks?: Map; // Cache of assignment checks } - export enum TypeFlags { + export const enum TypeFlags { Any = 0x00000001, String = 0x00000002, Number = 0x00000004, @@ -805,13 +1027,16 @@ module ts { Class = 0x00000400, // Class Interface = 0x00000800, // Interface Reference = 0x00001000, // Generic type reference - Anonymous = 0x00002000, // Anonymous - FromSignature = 0x00004000, // Created for signature assignment check + Tuple = 0x00002000, // Tuple + Union = 0x00004000, // Union + Anonymous = 0x00008000, // Anonymous + FromSignature = 0x00010000, // Created for signature assignment check - Intrinsic = Any | String | Number | Boolean | Void | Undefined | Null, + Intrinsic = Any | String | Number | Boolean | Void | Undefined | Null, StringLike = String | StringLiteral, NumberLike = Number | Enum, - ObjectType = Class | Interface | Reference | Anonymous + ObjectType = Class | Interface | Reference | Tuple | Anonymous, + Structured = Any | ObjectType | Union | TypeParameter } // Properties common to all types @@ -834,12 +1059,6 @@ module ts { // Object types (TypeFlags.ObjectType) export interface ObjectType extends Type { } - export interface ApparentType extends Type { - // This property is not used. It is just to make the type system think ApparentType - // is a strict subtype of Type. - _apparentTypeBrand: any; - } - // Class and interface types (TypeFlags.Class and TypeFlags.Interface) export interface InterfaceType extends ObjectType { typeParameters: TypeParameter[]; // Type parameters (undefined if non-generic) @@ -864,8 +1083,18 @@ module ts { openReferenceChecks: Map; // Open type reference check cache } - // Resolved object type - export interface ResolvedObjectType extends ObjectType { + export interface TupleType extends ObjectType { + elementTypes: Type[]; // Element types + baseArrayType: TypeReference; // Array where T is best common type of element types + } + + export interface UnionType extends Type { + types: Type[]; // Constituent types + resolvedProperties: SymbolTable; // Cache of resolved properties + } + + // Resolved object or union type + export interface ResolvedType extends ObjectType, UnionType { members: SymbolTable; // Properties by name properties: Symbol[]; // Properties callSignatures: Signature[]; // Call signatures of type @@ -881,7 +1110,7 @@ module ts { mapper?: TypeMapper; // Instantiation mapper } - export enum SignatureKind { + export const enum SignatureKind { Call, Construct, } @@ -893,14 +1122,15 @@ module ts { resolvedReturnType: Type; // Resolved return type minArgumentCount: number; // Number of non-optional parameters hasRestParameter: boolean; // True if last parameter is rest parameter - hasStringLiterals: boolean; // True if instantiated + hasStringLiterals: boolean; // True if specialized target?: Signature; // Instantiation target mapper?: TypeMapper; // Instantiation mapper + unionSignatures?: Signature[]; // Underlying signatures of a union signature erasedSignatureCache?: Signature; // Erased version of signature (deferred) isolatedSignatureType?: ObjectType; // A manufactured type that just contains the signature for purposes of signature comparison } - export enum IndexKind { + export const enum IndexKind { String, Number, } @@ -909,16 +1139,25 @@ module ts { (t: Type): Type; } + export interface TypeInferences { + primary: Type[]; // Inferences made directly to a type parameter + secondary: Type[]; // Inferences made to a type parameter in a union type + } + export interface InferenceContext { - typeParameters: TypeParameter[]; - inferences: Type[][]; - inferredTypes: Type[]; + typeParameters: TypeParameter[]; // Type parameters 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 + failedTypeParameterIndex?: number; // Index of type parameter for which inference failed + // It is optional because in contextual signature instantiation, nothing fails } export interface DiagnosticMessage { key: string; category: DiagnosticCategory; code: number; + isEarly?: boolean; } // A linked list of formatted diagnostic messages to be used as part of a multiline message. @@ -939,6 +1178,16 @@ module ts { messageText: string; category: DiagnosticCategory; code: number; + /** + * Early error - any error (can be produced at parsing\binding\typechecking step) that blocks emit + */ + isEarly?: boolean; + /** + * Parse error - error produced by parser when it scanner returns a token + * that parser does not understand in its current state + * (as opposed to grammar error when parser can interpret the token but interpretation is not legal from the grammar perespective) + */ + isParseError?: boolean; } export enum DiagnosticCategory { @@ -957,6 +1206,8 @@ module ts { locale?: string; mapRoot?: string; module?: ModuleKind; + noEmitOnError?: boolean; + noErrorTruncation?: boolean; noImplicitAny?: boolean; noLib?: boolean; noLibCheck?: boolean; @@ -969,19 +1220,30 @@ module ts { target?: ScriptTarget; version?: boolean; watch?: boolean; - - [option: string]: any; + preserveConstEnums?: boolean; + [option: string]: string | number | boolean; } - export enum ModuleKind { + export const enum ModuleKind { None, CommonJS, AMD, } - export enum ScriptTarget { + export interface LineAndCharacter { + line: number; + /* + * This value denotes the character position in line and is different from the 'column' because of tab characters. + */ + character: number; + } + + + export const enum ScriptTarget { ES3, ES5, + ES6, + Latest = ES6, } export interface ParsedCommandLine { @@ -992,14 +1254,14 @@ module ts { export interface CommandLineOption { name: string; - type: any; // "string", "number", "boolean", or an object literal mapping named values to actual values + type: string | Map; // "string", "number", "boolean", or an object literal mapping named values to actual values shortName?: string; // A short pneumonic for convenience - for instance, 'h' can be used in place of 'help'. description?: DiagnosticMessage; // The message describing what the command line switch does paramName?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter. error?: DiagnosticMessage; // The error given when the argument does not fit a customized 'type'. } - export enum CharacterCodes { + export const enum CharacterCodes { nullCharacter = 0, maxAsciiCharacter = 0x7F, @@ -1101,6 +1363,7 @@ module ts { asterisk = 0x2A, // * at = 0x40, // @ backslash = 0x5C, // \ + backtick = 0x60, // ` bar = 0x7C, // | caret = 0x5E, // ^ closeBrace = 0x7D, // } @@ -1132,7 +1395,7 @@ module ts { tab = 0x09, // \t verticalTab = 0x0B, // \v } - + export interface CancellationToken { isCancellationRequested(): boolean; } diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 60da87b1dfc..cc04d4813a1 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -3,7 +3,7 @@ /// /// -enum CompilerTestType { +const enum CompilerTestType { Conformance, Regressions, Test262 @@ -61,9 +61,11 @@ class CompilerBaselineRunner extends RunnerBase { var otherFiles: { unitName: string; content: string }[]; var harnessCompiler: Harness.Compiler.HarnessCompiler; - var declToBeCompiled: { unitName: string; content: string }[] = []; - var declOtherFiles: { unitName: string; content: string }[] = []; - var declResult: Harness.Compiler.CompilerResult; + var declFileCompilationResult: { + declInputFiles: { unitName: string; content: string }[]; + declOtherFiles: { unitName: string; content: string }[]; + declResult: Harness.Compiler.CompilerResult; + }; var createNewInstance = false; @@ -147,19 +149,14 @@ class CompilerBaselineRunner extends RunnerBase { toBeCompiled = undefined; otherFiles = undefined; harnessCompiler = undefined; - declToBeCompiled = undefined; - declOtherFiles = undefined; - declResult = undefined; + declFileCompilationResult = undefined; }); function getByteOrderMarkText(file: Harness.Compiler.GeneratedFile): string { return file.writeByteOrderMark ? "\u00EF\u00BB\u00BF" : ""; } - function getErrorBaseline(toBeCompiled: { unitName: string; content: string }[], - otherFiles: { unitName: string; content: string }[], - result: Harness.Compiler.CompilerResult - ) { + function getErrorBaseline(toBeCompiled: { unitName: string; content: string }[], otherFiles: { unitName: string; content: string }[], result: Harness.Compiler.CompilerResult) { return Harness.Compiler.getErrorBaseline(toBeCompiled.concat(otherFiles), result.errors); } @@ -168,7 +165,7 @@ class CompilerBaselineRunner extends RunnerBase { if (this.errors) { Harness.Baseline.runBaseline('Correct errors for ' + fileName, justName.replace(/\.ts$/, '.errors.txt'), (): string => { if (result.errors.length === 0) return null; - + return getErrorBaseline(toBeCompiled, otherFiles, result); }); } @@ -176,61 +173,23 @@ class CompilerBaselineRunner extends RunnerBase { // Source maps? it('Correct sourcemap content for ' + fileName, () => { - if (result.sourceMapRecord) { + if (options.sourceMap) { Harness.Baseline.runBaseline('Correct sourcemap content for ' + fileName, justName.replace(/\.ts$/, '.sourcemap.txt'), () => { - return result.sourceMapRecord; + var record = result.getSourceMapRecord(); + if (options.noEmitOnError && result.errors.length !== 0 && record === undefined) { + // Because of the noEmitOnError option no files are created. We need to return null because baselining isn't required. + return null; + } + return record; }); } }); // Compile .d.ts files it('Correct compiler generated.d.ts for ' + fileName, () => { - if (options.declaration && result.errors.length === 0 && result.declFilesCode.length !== result.files.length) { - throw new Error('There were no errors and declFiles generated did not match number of js files generated'); - } - - // if the .d.ts is non-empty, confirm it compiles correctly as well - if (options.declaration && result.errors.length === 0 && result.declFilesCode.length > 0) { - function addDtsFile(file: { unitName: string; content: string }, dtsFiles: { unitName: string; content: string }[]) { - if (Harness.Compiler.isDTS(file.unitName)) { - dtsFiles.push(file); - } - else { - var declFile = findResultCodeFile(file.unitName); - // Look if there is --out file corresponding to this ts file - if (!declFile && options.out) { - declFile = findResultCodeFile(options.out); - if (!declFile || findUnit(declFile.fileName, declToBeCompiled) || - findUnit(declFile.fileName, declOtherFiles)) { - return; - } - } - - if (declFile) { - dtsFiles.push({ unitName: declFile.fileName, content: declFile.code }); - return; - } - } - - function findResultCodeFile(fileName: string) { - return ts.forEach(result.declFilesCode, - declFile => declFile.fileName === (fileName.substr(0, fileName.length - ".ts".length) + ".d.ts") - ? declFile : undefined); - } - - function findUnit(fileName: string, units: { unitName: string; content: string }[]) { - return ts.forEach(units, unit => unit.unitName === fileName ? unit : undefined); - } - } - - ts.forEach(toBeCompiled, file => addDtsFile(file, declToBeCompiled)); - ts.forEach(otherFiles, file => addDtsFile(file, declOtherFiles)); - harnessCompiler.compileFiles(declToBeCompiled, declOtherFiles, function (compileResult) { - declResult = compileResult; - }, function (settings) { - harnessCompiler.setCompilerSettings(tcSettings); - }); - } + declFileCompilationResult = harnessCompiler.compileDeclarationFiles(toBeCompiled, otherFiles, result, function (settings) { + harnessCompiler.setCompilerSettings(tcSettings); + }, options); }); @@ -270,10 +229,10 @@ class CompilerBaselineRunner extends RunnerBase { } } - if (declResult && declResult.errors.length) { + if (declFileCompilationResult && declFileCompilationResult.declResult.errors.length) { jsCode += '\r\n\r\n//// [DtsFileErrors]\r\n'; jsCode += '\r\n\r\n'; - jsCode += getErrorBaseline(declToBeCompiled, declOtherFiles, declResult); + jsCode += getErrorBaseline(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles, declFileCompilationResult.declResult); } if (jsCode.length > 0) { @@ -292,6 +251,12 @@ class CompilerBaselineRunner extends RunnerBase { } Harness.Baseline.runBaseline('Correct Sourcemap output for ' + fileName, justName.replace(/\.ts/, '.js.map'), () => { + if (options.noEmitOnError && result.errors.length !== 0 && result.sourceMaps.length === 0) { + // We need to return null here or the runBaseLine will actually create a empty file. + // Baselining isn't required here because there is no output. + return null; + } + var sourceMapCode = ''; for (var i = 0; i < result.sourceMaps.length; i++) { sourceMapCode += '//// [' + Harness.Path.getFileName(result.sourceMaps[i].fileName) + ']\r\n'; @@ -331,12 +296,10 @@ class CompilerBaselineRunner extends RunnerBase { typeLines.push('=== ' + file.unitName + ' ===\r\n'); for (var i = 0; i < codeLines.length; i++) { var currentCodeLine = codeLines[i]; - var lastLine = typeLines[typeLines.length]; typeLines.push(currentCodeLine + '\r\n'); if (typeMap[file.unitName]) { var typeInfo = typeMap[file.unitName][i]; if (typeInfo) { - var leadingSpaces = ''; typeInfo.forEach(ty => { typeLines.push('>' + ty + '\r\n'); }); diff --git a/src/harness/external/es5compat.js b/src/harness/external/es5compat.js deleted file mode 100644 index 0fa88ee3685..00000000000 --- a/src/harness/external/es5compat.js +++ /dev/null @@ -1,225 +0,0 @@ -if (!String.prototype.trim) { - String.prototype.trim = function () { - return this.replace(/^\s+|\s+$/g, ''); - }; -} - -if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function (searchElement, fromIndex) { - "use strict"; - if (this == null) { - throw new TypeError(); - } - var t = Object(this); - var len = t.length >>> 0; - if (len === 0) { - return -1; - } - var n = 0; - if (arguments.length > 0) { - n = Number(arguments[1]); - if (n != n) { - n = 0; - } else if (n != 0 && n != Infinity && n != -Infinity) { - n = (n > 0 || -1) * Math.floor(Math.abs(n)); - } - } - if (n >= len) { - return -1; - } - var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); - for (; k < len; k++) { - if (k in t && t[k] === searchElement) { - return k; - } - } - return -1; - }; -} - -if (!Array.prototype.filter) { - Array.prototype.filter = function (fun, thisp) { - "use strict"; - - if (this == null) - throw new TypeError(); - - var t = Object(this); - var len = t.length >>> 0; - if (typeof fun != "function") - throw new TypeError(); - - var res = []; - for (var i = 0; i < len; i++) { - if (i in t) { - var val = t[i]; - if (fun.call(thisp, val, i, t)) - res.push(val); - } - } - - return res; - }; -} - -if (!Array.prototype.map) { - Array.prototype.map = function (callback, thisArg) { - var T = undefined, A, k; - - if (this == null) { - throw new TypeError(" this is null or not defined"); - } - - // 1. Let O be the result of calling ToObject passing the |this| value as the argument. - var O = Object(this); - - // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". - // 3. Let len be ToUint32(lenValue). - var len = O.length >>> 0; - - if ({}.toString.call(callback) != "[object Function]") { - throw new TypeError(callback + " is not a function"); - } - - if (thisArg) { - T = thisArg; - } - - // 6. Let A be a new array created as if by the expression new Array(len) where Array is - // the standard built-in constructor with that name and len is the value of len. - A = new Array(len); - - // 7. Let k be 0 - k = 0; - - while (k < len) { - var kValue, mappedValue; - - if (k in O) { - // i. Let kValue be the result of calling the Get internal method of O with argument Pk. - kValue = O[k]; - - // ii. Let mappedValue be the result of calling the Call internal method of callback - // with T as the this value and argument list containing kValue, k, and O. - mappedValue = callback.call(T, kValue, k, O); - - // iii. Call the DefineOwnProperty internal method of A with arguments - // Pk, Property Descriptor {Value: mappedValue, : true, Enumerable: true, Configurable: true}, - // and false. - // In browsers that support Object.defineProperty, use the following: - // Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true }); - // For best browser support, use the following: - A[k] = mappedValue; - } - - // d. Increase k by 1. - k++; - } - - // 9. return A - return A; - }; -} - -if (!Array.prototype.reduce) { - Array.prototype.reduce = function reduce(accumulator) { - if (this === null || this === undefined) - throw new TypeError("Object is null or undefined"); - var i = 0, l = this.length >> 0, curr; - - if (typeof accumulator !== "function") - throw new TypeError("First argument is not callable"); - - if (arguments.length < 2) { - if (l === 0) - throw new TypeError("Array length is 0 and no second argument"); - curr = this[0]; - i = 1; - } else - curr = arguments[1]; - - while (i < l) { - if (i in this) - curr = accumulator.call(undefined, curr, this[i], i, this); - ++i; - } - - return curr; - }; -} - -if (!Array.prototype.forEach) { - Array.prototype.forEach = function (callback, thisArg) { - var T, k; - - if (this == null) { - throw new TypeError(" this is null or not defined"); - } - - // 1. Let O be the result of calling ToObject passing the |this| value as the argument. - var O = Object(this); - - // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". - // 3. Let len be ToUint32(lenValue). - var len = O.length >>> 0; - - if ({}.toString.call(callback) != "[object Function]") { - throw new TypeError(callback + " is not a function"); - } - - if (thisArg) { - T = thisArg; - } else { - T = undefined; - } - - // 6. Let k be 0 - k = 0; - - while (k < len) { - var kValue; - - if (k in O) { - // i. Let kValue be the result of calling the Get internal method of O with argument Pk. - kValue = O[k]; - - // ii. Call the Call internal method of callback with T as the this value and - // argument list containing kValue, k, and O. - callback.call(T, kValue, k, O); - } - - // d. Increase k by 1. - k++; - } - // 8. return undefined - }; -} - -if (!Date.now) { - Date.now = function () { - return (new Date()).getTime(); - }; -} - -if (!Array.prototype.some) { - Array.prototype.some = function (fun/*, thisp */ ) { - "use strict"; - - if (this == null) - throw new TypeError(); - - var t = Object(this); - var len = t.length >>> 0; - if (typeof fun != "function") - throw new TypeError(); - - var thisp = arguments[1]; - for (var i = 0; i < len; i++) { - var idx = i.toString(); - if (idx in t && fun.call(thisp, t[i], i, t)) - return true; - } - - return false; - }; -} diff --git a/src/harness/external/es5compat.ts b/src/harness/external/es5compat.ts deleted file mode 100644 index 1cd6a50905a..00000000000 --- a/src/harness/external/es5compat.ts +++ /dev/null @@ -1,354 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/*----------------- ThirdPartyNotices ------------------------------------------------------- - -This file is based on or incorporates material from the projects listed below -(collectively "Third Party Code"). Microsoft is not the original author of the -Third Party Code. The original copyright notice and the license, under which -Microsoft received such Third Party Code, are set forth below. Such license and -notices are provided for informational purposes only. Microsoft licenses the Third -Party Code to you under the terms of the Apache 2.0 License. - --- -Array filter Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/filter - -Array forEach Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach - -Array indexOf Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf - -Array map Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map - -Array Reduce Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/Reduce - -Array some Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/some - -String Trim Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim - -Date now Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/now - -Copyright (c) 2007 - 2012 Mozilla Developer Network and individual contributors - -Licensed by Microsoft under the Apache License, Version 2.0 (the "License"); you -may not use this file except in compliance with the License. You may obtain a copy -of the License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR -CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions and -limitations under the License. - --- -Original License provided for Informational Purposes Only -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -------------- End of ThirdPartyNotices --------------------------------------------------- */ - - -// Compatibility with non ES5 compliant engines -if (!String.prototype.trim) { - String.prototype.trim = function() { - return this.replace(/^\s+|\s+$/g, ''); - }; -} - -// Compatibility with non ES5 compliant engines -if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function (searchElement: any, fromIndex?: any) { - "use strict"; - if (this == null) { - throw new TypeError(); - } - var t = Object(this); - var len: any = t.length >>> 0; - if (len === 0) { - return -1; - } - var n: any = 0; - if (arguments.length > 0) { - n = Number(arguments[1]); - if (n != n) { // shortcut for verifying if it's NaN - n = 0; - } - else if (n != 0 && n != Infinity && n != -Infinity) { - n = (n > 0 || -1) * Math.floor(Math.abs(n)); - } - } - if (n >= len) { - return -1; - } - var k: any = n >= 0 ? n : Math.max(len - Math.abs(n), 0); - for (; k < len; k++) { - if (k in t && t[k] === searchElement) { - return k; - } - } - return -1; - } -} - -if (!Array.prototype.filter) -{ - Array.prototype.filter = function(fun: any, thisp?: any) - { - "use strict"; - - if (this == null) - throw new TypeError(); - - var t = Object(this); - var len = t.length >>> 0; - if (typeof fun != "function") - throw new TypeError(); - - var res: any[] = []; - for (var i = 0; i < len; i++) - { - if (i in t) - { - var val = t[i]; // in case fun mutates this - if (fun.call(thisp, val, i, t)) - res.push(val); - } - } - - return res; - }; -} - -// Production steps of ECMA-262, Edition 5, 15.4.4.19 -// Reference: http://es5.github.com/#x15.4.4.19 -if (!Array.prototype.map) { - Array.prototype.map = function(callback: any, thisArg?: any) { - - var T: any = undefined, A: any, k: any; - - if (this == null) { - throw new TypeError(" this is null or not defined"); - } - - // 1. Let O be the result of calling ToObject passing the |this| value as the argument. - var O = Object(this); - - // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". - // 3. Let len be ToUint32(lenValue). - var len = O.length >>> 0; - - // 4. If IsCallable(callback) is false, throw a TypeError exception. - // See: http://es5.github.com/#x9.11 - if ({}.toString.call(callback) != "[object Function]") { - throw new TypeError(callback + " is not a function"); - } - - // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. - if (thisArg) { - T = thisArg; - } - - // 6. Let A be a new array created as if by the expression new Array(len) where Array is - // the standard built-in constructor with that name and len is the value of len. - A = new Array(len); - - // 7. Let k be 0 - k = 0; - - // 8. Repeat, while k < len - while(k < len) { - - var kValue: any, mappedValue: any; - - // a. Let Pk be ToString(k). - // This is implicit for LHS operands of the in operator - // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. - // This step can be combined with c - // c. If kPresent is true, then - if (k in O) { - - // i. Let kValue be the result of calling the Get internal method of O with argument Pk. - kValue = O[ k ]; - - // ii. Let mappedValue be the result of calling the Call internal method of callback - // with T as the this value and argument list containing kValue, k, and O. - mappedValue = callback.call(T, kValue, k, O); - - // iii. Call the DefineOwnProperty internal method of A with arguments - // Pk, Property Descriptor {Value: mappedValue, : true, Enumerable: true, Configurable: true}, - // and false. - - // In browsers that support Object.defineProperty, use the following: - // Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true }); - - // For best browser support, use the following: - A[ k ] = mappedValue; - } - // d. Increase k by 1. - k++; - } - - // 9. return A - return A; - }; -} - -if (!Array.prototype.reduce) { - Array.prototype.reduce = function reduce(accumulator: any){ - if (this===null || this===undefined) throw new TypeError("Object is null or undefined"); - var i = 0, l = this.length >> 0, curr: any; - - if(typeof accumulator !== "function") // ES5 : "If IsCallable(callbackfn) is false, throw a TypeError exception." - throw new TypeError("First argument is not callable"); - - if(arguments.length < 2) { - if (l === 0) throw new TypeError("Array length is 0 and no second argument"); - curr = this[0]; - i = 1; // start accumulating at the second element - } - else - curr = arguments[1]; - - while (i < l) { - if(i in this) curr = accumulator.call(undefined, curr, this[i], i, this); - ++i; - } - - return curr; - }; -} - -// Compatibility with non ES5 compliant engines -// Production steps of ECMA-262, Edition 5, 15.4.4.18 -// Reference: http://es5.github.com/#x15.4.4.18 -if (!Array.prototype.forEach) { - Array.prototype.forEach = function(callback: any, thisArg?: any) { - - var T: any, k: any; - - if (this == null) { - throw new TypeError(" this is null or not defined"); - } - - // 1. Let O be the result of calling ToObject passing the |this| value as the argument. - var O = Object(this); - - // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". - // 3. Let len be ToUint32(lenValue). - var len = O.length >>> 0; // Hack to convert O.length to a UInt32 - - // 4. If IsCallable(callback) is false, throw a TypeError exception. - // See: http://es5.github.com/#x9.11 - if ({ }.toString.call(callback) != "[object Function]") { - throw new TypeError(callback + " is not a function"); - } - - // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. - if (thisArg) { - T = thisArg; - } - else { - T = undefined; // added to stop definite assignment error - } - - // 6. Let k be 0 - k = 0; - - // 7. Repeat, while k < len - while (k < len) { - - var kValue: any; - - // a. Let Pk be ToString(k). - // This is implicit for LHS operands of the in operator - // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. - // This step can be combined with c - // c. If kPresent is true, then - if (k in O) { - - // i. Let kValue be the result of calling the Get internal method of O with argument Pk. - kValue = O[k]; - - // ii. Call the Call internal method of callback with T as the this value and - // argument list containing kValue, k, and O. - callback.call(T, kValue, k, O); - } - // d. Increase k by 1. - k++; - } - // 8. return undefined - }; -} - -// Compatibility with non ES5 compliant engines -if (!Date.now) { - Date.now = function() { - return (new Date()).getTime(); - }; -} - -// Compatibility with non ES5 compliant engines -// Production steps of ECMA-262, Edition 5.1, 15.4.4.17 -if (!Array.prototype.some) -{ - Array.prototype.some = function(fun: any /*, thisp */) - { - "use strict"; - - if (this == null) - throw new TypeError(); - - var t = Object(this); - var len = t.length >>> 0; - if (typeof fun != "function") - throw new TypeError(); - - var thisp = arguments[1]; - for (var i = 0; i < len; i++) - { - var idx = i.toString(); // REVIEW: this line is not from the Mozilla page, necessary to avoid our compile time checks against non-string/any types in an in expression - if (idx in t && fun.call(thisp, t[i], i, t)) - return true; - } - - return false; - }; -} \ No newline at end of file diff --git a/src/harness/external/json2.js b/src/harness/external/json2.js deleted file mode 100644 index 0fe3388d253..00000000000 --- a/src/harness/external/json2.js +++ /dev/null @@ -1,486 +0,0 @@ -/* - json2.js - 2013-05-26 - - Public Domain. - - NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - - See http://www.JSON.org/js.html - - - This code should be minified before deployment. - See http://javascript.crockford.com/jsmin.html - - USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO - NOT CONTROL. - - - This file creates a global JSON object containing two methods: stringify - and parse. - - JSON.stringify(value, replacer, space) - value any JavaScript value, usually an object or array. - - replacer an optional parameter that determines how object - values are stringified for objects. It can be a - function or an array of strings. - - space an optional parameter that specifies the indentation - of nested structures. If it is omitted, the text will - be packed without extra whitespace. If it is a number, - it will specify the number of spaces to indent at each - level. If it is a string (such as '\t' or ' '), - it contains the characters used to indent at each level. - - This method produces a JSON text from a JavaScript value. - - When an object value is found, if the object contains a toJSON - method, its toJSON method will be called and the result will be - stringified. A toJSON method does not serialize: it returns the - value represented by the name/value pair that should be serialized, - or undefined if nothing should be serialized. The toJSON method - will be passed the key associated with the value, and this will be - bound to the value - - For example, this would serialize Dates as ISO strings. - - Date.prototype.toJSON = function (key) { - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - return this.getUTCFullYear() + '-' + - f(this.getUTCMonth() + 1) + '-' + - f(this.getUTCDate()) + 'T' + - f(this.getUTCHours()) + ':' + - f(this.getUTCMinutes()) + ':' + - f(this.getUTCSeconds()) + 'Z'; - }; - - You can provide an optional replacer method. It will be passed the - key and value of each member, with this bound to the containing - object. The value that is returned from your method will be - serialized. If your method returns undefined, then the member will - be excluded from the serialization. - - If the replacer parameter is an array of strings, then it will be - used to select the members to be serialized. It filters the results - such that only members with keys listed in the replacer array are - stringified. - - Values that do not have JSON representations, such as undefined or - functions, will not be serialized. Such values in objects will be - dropped; in arrays they will be replaced with null. You can use - a replacer function to replace those with JSON values. - JSON.stringify(undefined) returns undefined. - - The optional space parameter produces a stringification of the - value that is filled with line breaks and indentation to make it - easier to read. - - If the space parameter is a non-empty string, then that string will - be used for indentation. If the space parameter is a number, then - the indentation will be that many spaces. - - Example: - - text = JSON.stringify(['e', {pluribus: 'unum'}]); - // text is '["e",{"pluribus":"unum"}]' - - - text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); - // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' - - text = JSON.stringify([new Date()], function (key, value) { - return this[key] instanceof Date ? - 'Date(' + this[key] + ')' : value; - }); - // text is '["Date(---current time---)"]' - - - JSON.parse(text, reviver) - This method parses a JSON text to produce an object or array. - It can throw a SyntaxError exception. - - The optional reviver parameter is a function that can filter and - transform the results. It receives each of the keys and values, - and its return value is used instead of the original value. - If it returns what it received, then the structure is not modified. - If it returns undefined then the member is deleted. - - Example: - - // Parse the text. Values that look like ISO date strings will - // be converted to Date objects. - - myData = JSON.parse(text, function (key, value) { - var a; - if (typeof value === 'string') { - a = -/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); - if (a) { - return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], - +a[5], +a[6])); - } - } - return value; - }); - - myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { - var d; - if (typeof value === 'string' && - value.slice(0, 5) === 'Date(' && - value.slice(-1) === ')') { - d = new Date(value.slice(5, -1)); - if (d) { - return d; - } - } - return value; - }); - - - This is a reference implementation. You are free to copy, modify, or - redistribute. -*/ - -/*jslint evil: true, regexp: true */ - -/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, - call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, - getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, - lastIndex, length, parse, prototype, push, replace, slice, stringify, - test, toJSON, toString, valueOf -*/ - - -// Create a JSON object only if one does not already exist. We create the -// methods in a closure to avoid creating global variables. - -if (typeof JSON !== 'object') { - JSON = {}; -} - -(function () { - 'use strict'; - - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - if (typeof Date.prototype.toJSON !== 'function') { - - Date.prototype.toJSON = function () { - - return isFinite(this.valueOf()) - ? this.getUTCFullYear() + '-' + - f(this.getUTCMonth() + 1) + '-' + - f(this.getUTCDate()) + 'T' + - f(this.getUTCHours()) + ':' + - f(this.getUTCMinutes()) + ':' + - f(this.getUTCSeconds()) + 'Z' - : null; - }; - - String.prototype.toJSON = - Number.prototype.toJSON = - Boolean.prototype.toJSON = function () { - return this.valueOf(); - }; - } - - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - - - function quote(string) { - -// If the string contains no control characters, no quote characters, and no -// backslash characters, then we can safely slap some quotes around it. -// Otherwise we must also replace the offending characters with safe escape -// sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' - ? c - : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : '"' + string + '"'; - } - - - function str(key, holder) { - -// Produce a string from holder[key]. - - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - mind = gap, - partial, - value = holder[key]; - -// If the value has a toJSON method, call it to obtain a replacement value. - - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - -// If we were called with a replacer function, then call the replacer to -// obtain a replacement value. - - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - -// What happens next depends on the value's type. - - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - -// JSON numbers must be finite. Encode non-finite numbers as null. - - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - -// If the value is a boolean or null, convert it to a string. Note: -// typeof null does not produce 'null'. The case is included here in -// the remote chance that this gets fixed someday. - - return String(value); - -// If the type is 'object', we might be dealing with an object or an array or -// null. - - case 'object': - -// Due to a specification blunder in ECMAScript, typeof null is 'object', -// so watch out for that case. - - if (!value) { - return 'null'; - } - -// Make an array to hold the partial results of stringifying this object value. - - gap += indent; - partial = []; - -// Is the value an array? - - if (Object.prototype.toString.apply(value) === '[object Array]') { - -// The value is an array. Stringify every element. Use null as a placeholder -// for non-JSON values. - - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - -// Join all of the elements together, separated with commas, and wrap them in -// brackets. - - v = partial.length === 0 - ? '[]' - : gap - ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' - : '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - -// If the replacer is an array, use it to select the members to be stringified. - - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - if (typeof rep[i] === 'string') { - k = rep[i]; - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } else { - -// Otherwise, iterate through all of the keys in the object. - - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - -// Join all of the member texts together, separated with commas, -// and wrap them in braces. - - v = partial.length === 0 - ? '{}' - : gap - ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' - : '{' + partial.join(',') + '}'; - gap = mind; - return v; - } - } - -// If the JSON object does not yet have a stringify method, give it one. - - if (typeof JSON.stringify !== 'function') { - JSON.stringify = function (value, replacer, space) { - -// The stringify method takes a value and an optional replacer, and an optional -// space parameter, and returns a JSON text. The replacer can be a function -// that can replace values, or an array of strings that will select the keys. -// A default replacer method can be provided. Use of the space parameter can -// produce text that is more easily readable. - - var i; - gap = ''; - indent = ''; - -// If the space parameter is a number, make an indent string containing that -// many spaces. - - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - -// If the space parameter is a string, it will be used as the indent string. - - } else if (typeof space === 'string') { - indent = space; - } - -// If there is a replacer, it must be a function or an array. -// Otherwise, throw an error. - - rep = replacer; - if (replacer && typeof replacer !== 'function' && - (typeof replacer !== 'object' || - typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - -// Make a fake root object containing our value under the key of ''. -// Return the result of stringifying the value. - - return str('', {'': value}); - }; - } - - -// If the JSON object does not yet have a parse method, give it one. - - if (typeof JSON.parse !== 'function') { - JSON.parse = function (text, reviver) { - -// The parse method takes a text and an optional reviver function, and returns -// a JavaScript value if the text is a valid JSON text. - - var j; - - function walk(holder, key) { - -// The walk method is used to recursively walk the resulting structure so -// that modifications can be made. - - var k, v, value = holder[key]; - if (value && typeof value === 'object') { - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - } - } - } - return reviver.call(holder, key, value); - } - - -// Parsing happens in four stages. In the first stage, we replace certain -// Unicode characters with escape sequences. JavaScript handles many characters -// incorrectly, either silently deleting them, or treating them as line endings. - - text = String(text); - cx.lastIndex = 0; - if (cx.test(text)) { - text = text.replace(cx, function (a) { - return '\\u' + - ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }); - } - -// In the second stage, we run the text against regular expressions that look -// for non-JSON patterns. We are especially concerned with '()' and 'new' -// because they can cause invocation, and '=' because it can cause mutation. -// But just to be safe, we want to reject all unexpected forms. - -// We split the second stage into 4 regexp operations in order to work around -// crippling inefficiencies in IE's and Safari's regexp engines. First we -// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we -// replace all simple value tokens with ']' characters. Third, we delete all -// open brackets that follow a colon or comma or that begin the text. Finally, -// we look to see that the remaining characters are only whitespace or ']' or -// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. - - if (/^[\],:{}\s]*$/ - .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') - .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') - .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { - -// In the third stage we use the eval function to compile the text into a -// JavaScript structure. The '{' operator is subject to a syntactic ambiguity -// in JavaScript: it can begin a block or an object literal. We wrap the text -// in parens to eliminate the ambiguity. - - j = eval('(' + text + ')'); - -// In the optional fourth stage, we recursively walk the new structure, passing -// each name/value pair to a reviver function for possible transformation. - - return typeof reviver === 'function' - ? walk({'': j}, '') - : j; - } - -// If the text is not JSON parseable, then a SyntaxError is thrown. - - throw new SyntaxError('JSON.parse'); - }; - } -}()); diff --git a/src/harness/external/json2.ts b/src/harness/external/json2.ts deleted file mode 100644 index 4645a0476af..00000000000 --- a/src/harness/external/json2.ts +++ /dev/null @@ -1,486 +0,0 @@ -/* - json2.js - 2013-05-26 - - Public Domain. - - NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - - See http://www.JSON.org/js.html - - - This code should be minified before deployment. - See http://javascript.crockford.com/jsmin.html - - USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO - NOT CONTROL. - - - This file creates a global JSON object containing two methods: stringify - and parse. - - JSON.stringify(value, replacer, space) - value any JavaScript value, usually an object or array. - - replacer an optional parameter that determines how object - values are stringified for objects. It can be a - function or an array of strings. - - space an optional parameter that specifies the indentation - of nested structures. If it is omitted, the text will - be packed without extra whitespace. If it is a number, - it will specify the number of spaces to indent at each - level. If it is a string (such as '\t' or ' '), - it contains the characters used to indent at each level. - - This method produces a JSON text from a JavaScript value. - - When an object value is found, if the object contains a toJSON - method, its toJSON method will be called and the result will be - stringified. A toJSON method does not serialize: it returns the - value represented by the name/value pair that should be serialized, - or undefined if nothing should be serialized. The toJSON method - will be passed the key associated with the value, and this will be - bound to the value - - For example, this would serialize Dates as ISO strings. - - Date.prototype.toJSON = function (key) { - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - return this.getUTCFullYear() + '-' + - f(this.getUTCMonth() + 1) + '-' + - f(this.getUTCDate()) + 'T' + - f(this.getUTCHours()) + ':' + - f(this.getUTCMinutes()) + ':' + - f(this.getUTCSeconds()) + 'Z'; - }; - - You can provide an optional replacer method. It will be passed the - key and value of each member, with this bound to the containing - object. The value that is returned from your method will be - serialized. If your method returns undefined, then the member will - be excluded from the serialization. - - If the replacer parameter is an array of strings, then it will be - used to select the members to be serialized. It filters the results - such that only members with keys listed in the replacer array are - stringified. - - Values that do not have JSON representations, such as undefined or - functions, will not be serialized. Such values in objects will be - dropped; in arrays they will be replaced with null. You can use - a replacer function to replace those with JSON values. - JSON.stringify(undefined) returns undefined. - - The optional space parameter produces a stringification of the - value that is filled with line breaks and indentation to make it - easier to read. - - If the space parameter is a non-empty string, then that string will - be used for indentation. If the space parameter is a number, then - the indentation will be that many spaces. - - Example: - - text = JSON.stringify(['e', {pluribus: 'unum'}]); - // text is '["e",{"pluribus":"unum"}]' - - - text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); - // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' - - text = JSON.stringify([new Date()], function (key, value) { - return this[key] instanceof Date ? - 'Date(' + this[key] + ')' : value; - }); - // text is '["Date(---current time---)"]' - - - JSON.parse(text, reviver) - This method parses a JSON text to produce an object or array. - It can throw a SyntaxError exception. - - The optional reviver parameter is a function that can filter and - transform the results. It receives each of the keys and values, - and its return value is used instead of the original value. - If it returns what it received, then the structure is not modified. - If it returns undefined then the member is deleted. - - Example: - - // Parse the text. Values that look like ISO date strings will - // be converted to Date objects. - - myData = JSON.parse(text, function (key, value) { - var a; - if (typeof value === 'string') { - a = -/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); - if (a) { - return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], - +a[5], +a[6])); - } - } - return value; - }); - - myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { - var d; - if (typeof value === 'string' && - value.slice(0, 5) === 'Date(' && - value.slice(-1) === ')') { - d = new Date(value.slice(5, -1)); - if (d) { - return d; - } - } - return value; - }); - - - This is a reference implementation. You are free to copy, modify, or - redistribute. -*/ - -/*jslint evil: true, regexp: true */ - -/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, - call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, - getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, - lastIndex, length, parse, prototype, push, replace, slice, stringify, - test, toJSON, toString, valueOf -*/ - - -// Create a JSON object only if one does not already exist. We create the -// methods in a closure to avoid creating global variables. - -if (typeof JSON !== 'object') { - JSON = {}; -} - -(function () { - 'use strict'; - - function f(n: any) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - if (typeof Date.prototype.toJSON !== 'function') { - - Date.prototype.toJSON = function () { - - return isFinite(this.valueOf()) - ? this.getUTCFullYear() + '-' + - f(this.getUTCMonth() + 1) + '-' + - f(this.getUTCDate()) + 'T' + - f(this.getUTCHours()) + ':' + - f(this.getUTCMinutes()) + ':' + - f(this.getUTCSeconds()) + 'Z' - : null; - }; - - (String.prototype).toJSON = - (Number.prototype).toJSON = - (Boolean.prototype).toJSON = function () { - return this.valueOf(); - }; - } - - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap: any, - indent: any, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep: any; - - - function quote(string: string) { - -// If the string contains no control characters, no quote characters, and no -// backslash characters, then we can safely slap some quotes around it. -// Otherwise we must also replace the offending characters with safe escape -// sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' - ? c - : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : '"' + string + '"'; - } - - - function str(key: any, holder: any) { - -// Produce a string from holder[key]. - - var i: any, // The loop counter. - k: any, // The member key. - v: any, // The member value. - length: number, - mind = gap, - partial: any, - value = holder[key]; - -// If the value has a toJSON method, call it to obtain a replacement value. - - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - -// If we were called with a replacer function, then call the replacer to -// obtain a replacement value. - - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - -// What happens next depends on the value's type. - - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - -// JSON numbers must be finite. Encode non-finite numbers as null. - - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - -// If the value is a boolean or null, convert it to a string. Note: -// typeof null does not produce 'null'. The case is included here in -// the remote chance that this gets fixed someday. - - return String(value); - -// If the type is 'object', we might be dealing with an object or an array or -// null. - - case 'object': - -// Due to a specification blunder in ECMAScript, typeof null is 'object', -// so watch out for that case. - - if (!value) { - return 'null'; - } - -// Make an array to hold the partial results of stringifying this object value. - - gap += indent; - partial = []; - -// Is the value an array? - - if (Object.prototype.toString.apply(value) === '[object Array]') { - -// The value is an array. Stringify every element. Use null as a placeholder -// for non-JSON values. - - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - -// Join all of the elements together, separated with commas, and wrap them in -// brackets. - - v = partial.length === 0 - ? '[]' - : gap - ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' - : '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - -// If the replacer is an array, use it to select the members to be stringified. - - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - if (typeof rep[i] === 'string') { - k = rep[i]; - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } else { - -// Otherwise, iterate through all of the keys in the object. - - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - -// Join all of the member texts together, separated with commas, -// and wrap them in braces. - - v = partial.length === 0 - ? '{}' - : gap - ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' - : '{' + partial.join(',') + '}'; - gap = mind; - return v; - } - } - -// If the JSON object does not yet have a stringify method, give it one. - - if (typeof JSON.stringify !== 'function') { - JSON.stringify = function (value: any, replacer: any, space: any) { - -// The stringify method takes a value and an optional replacer, and an optional -// space parameter, and returns a JSON text. The replacer can be a function -// that can replace values, or an array of strings that will select the keys. -// A default replacer method can be provided. Use of the space parameter can -// produce text that is more easily readable. - - var i: any; - gap = ''; - indent = ''; - -// If the space parameter is a number, make an indent string containing that -// many spaces. - - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - -// If the space parameter is a string, it will be used as the indent string. - - } else if (typeof space === 'string') { - indent = space; - } - -// If there is a replacer, it must be a function or an array. -// Otherwise, throw an error. - - rep = replacer; - if (replacer && typeof replacer !== 'function' && - (typeof replacer !== 'object' || - typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - -// Make a fake root object containing our value under the key of ''. -// Return the result of stringifying the value. - - return str('', {'': value}); - }; - } - - -// If the JSON object does not yet have a parse method, give it one. - - if (typeof JSON.parse !== 'function') { - JSON.parse = function (text, reviver) { - -// The parse method takes a text and an optional reviver function, and returns -// a JavaScript value if the text is a valid JSON text. - - var j: any; - - function walk(holder: any, key: any) { - -// The walk method is used to recursively walk the resulting structure so -// that modifications can be made. - - var k: any, v: any, value = holder[key]; - if (value && typeof value === 'object') { - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - } - } - } - return reviver.call(holder, key, value); - } - - -// Parsing happens in four stages. In the first stage, we replace certain -// Unicode characters with escape sequences. JavaScript handles many characters -// incorrectly, either silently deleting them, or treating them as line endings. - - text = String(text); - cx.lastIndex = 0; - if (cx.test(text)) { - text = text.replace(cx, function (a) { - return '\\u' + - ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }); - } - -// In the second stage, we run the text against regular expressions that look -// for non-JSON patterns. We are especially concerned with '()' and 'new' -// because they can cause invocation, and '=' because it can cause mutation. -// But just to be safe, we want to reject all unexpected forms. - -// We split the second stage into 4 regexp operations in order to work around -// crippling inefficiencies in IE's and Safari's regexp engines. First we -// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we -// replace all simple value tokens with ']' characters. Third, we delete all -// open brackets that follow a colon or comma or that begin the text. Finally, -// we look to see that the remaining characters are only whitespace or ']' or -// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. - - if (/^[\],:{}\s]*$/ - .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') - .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') - .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { - -// In the third stage we use the eval function to compile the text into a -// JavaScript structure. The '{' operator is subject to a syntactic ambiguity -// in JavaScript: it can begin a block or an object literal. We wrap the text -// in parens to eliminate the ambiguity. - - j = eval('(' + text + ')'); - -// In the optional fourth stage, we recursively walk the new structure, passing -// each name/value pair to a reviver function for possible transformation. - - return typeof reviver === 'function' - ? walk({'': j}, '') - : j; - } - -// If the text is not JSON parseable, then a SyntaxError is thrown. - - throw new SyntaxError('JSON.parse'); - }; - } -}()); diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index c571a7d9f94..05e65f5648f 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -122,11 +122,77 @@ module FourSlash { return s.replace(/[&<>"'\/]/g, ch => entityMap[ch]); } + // Name of testcase metadata including ts.CompilerOptions properties that will be used by globalOptions + // To add additional option, add property into the testOptMetadataNames, refer the property in either globalMetadataNames or fileMetadataNames + // Add cases into convertGlobalOptionsToCompilationsSettings function for the compiler to acknowledge such option from meta data + var testOptMetadataNames = { + baselineFile: 'BaselineFile', + declaration: 'declaration', + emitThisFile: 'emitThisFile', // This flag is used for testing getEmitOutput feature. It allows test-cases to indicate what file to be output in multiple files project + filename: 'Filename', + mapRoot: 'mapRoot', + module: 'module', + out: 'out', + outDir: 'outDir', + sourceMap: 'sourceMap', + sourceRoot: 'sourceRoot', + resolveReference: 'ResolveReference', // This flag is used to specify entry file for resolve file references. The flag is only allow once per test file + }; + // List of allowed metadata names - var fileMetadataNames = ['Filename']; - var globalMetadataNames = ['Module', 'Target', 'BaselineFile']; // Note: Only BaselineFile is actually supported at the moment + var fileMetadataNames = [testOptMetadataNames.filename, testOptMetadataNames.emitThisFile, testOptMetadataNames.resolveReference]; + var globalMetadataNames = [testOptMetadataNames.baselineFile, testOptMetadataNames.declaration, + testOptMetadataNames.mapRoot, testOptMetadataNames.module, testOptMetadataNames.out, + testOptMetadataNames.outDir, testOptMetadataNames.sourceMap, testOptMetadataNames.sourceRoot] + + function convertGlobalOptionsToCompilationSettings(globalOptions: { [idx: string]: string }): ts.CompilationSettings { + var settings: ts.CompilationSettings = {}; + // Convert all property in globalOptions into ts.CompilationSettings + for (var prop in globalOptions) { + if (globalOptions.hasOwnProperty(prop)) { + switch (prop) { + case testOptMetadataNames.declaration: + settings.generateDeclarationFiles = true; + break; + case testOptMetadataNames.mapRoot: + settings.mapRoot = globalOptions[prop]; + break; + case testOptMetadataNames.module: + // create appropriate external module target for CompilationSettings + switch (globalOptions[prop]) { + case "AMD": + settings.moduleGenTarget = ts.ModuleGenTarget.Asynchronous; + break; + case "CommonJS": + settings.moduleGenTarget = ts.ModuleGenTarget.Synchronous; + break; + default: + settings.moduleGenTarget = ts.ModuleGenTarget.Unspecified; + break; + } + break; + case testOptMetadataNames.out: + settings.outFileOption = globalOptions[prop]; + break; + case testOptMetadataNames.outDir: + settings.outDirOption = globalOptions[prop]; + break; + case testOptMetadataNames.sourceMap: + settings.mapSourceFiles = true; + break; + case testOptMetadataNames.sourceRoot: + settings.sourceRoot = globalOptions[prop]; + break; + } + } + } + return settings; + } export var currentTestState: TestState = null; + function assertionMessage(msg: string) { + return "\nMarker: " + currentTestState.lastKnownMarker + "\nChecking: " + msg + "\n\n"; + } export class TestCancellationToken implements ts.CancellationToken { // 0 - cancelled @@ -149,7 +215,7 @@ module FourSlash { } public setCancelled(numberOfCalls: number = 0): void { - TypeScript.Debug.assert(numberOfCalls >= 0); + ts.Debug.assert(numberOfCalls >= 0); this.numberOfCallsBeforeCancellation = numberOfCalls; } @@ -171,13 +237,32 @@ module FourSlash { throw new Error("Operation should be cancelled"); } + // This function creates IScriptSnapshot object for testing getPreProcessedFileInfo + // Return object may lack some functionalities for other purposes. + function createScriptSnapShot(sourceText: string): ts.IScriptSnapshot { + return { + getText: (start: number, end: number) => { + return sourceText.substr(start, end - start); + }, + getLength: () => { + return sourceText.length; + }, + getLineStartPositions: () => { + return []; + }, + getChangeRange: (oldSnapshot: ts.IScriptSnapshot) => { + return undefined; + } + }; + } + export class TestState { // Language service instance public languageServiceShimHost: Harness.LanguageService.TypeScriptLS; private languageService: ts.LanguageService; // A reference to the language service's compiler state's compiler instance - private compiler: () => { getSyntaxTree(fileName: string): TypeScript.SyntaxTree; getSourceUnit(fileName: string): TypeScript.SourceUnitSyntax; }; + private compiler: () => { getSyntaxTree(fileName: string): ts.SourceFile }; // The current caret position in the active file public currentCaretPosition = 0; @@ -199,62 +284,76 @@ module FourSlash { private scenarioActions: string[] = []; private taoInvalidReason: string = null; + private inputFiles: ts.Map = {}; // Map between inputFile's filename and its content for easily looking up when resolving references + + // Add input file which has matched file name with the given reference-file path. + // This is necessary when resolveReference flag is specified + private addMatchedInputFile(referenceFilePath: string) { + var inputFile = this.inputFiles[referenceFilePath]; + if (inputFile && !Harness.isLibraryFile(referenceFilePath)) { + this.languageServiceShimHost.addScript(referenceFilePath, inputFile); + } + } + constructor(public testData: FourSlashData) { // Initialize the language service with all the scripts this.cancellationToken = new TestCancellationToken(); this.languageServiceShimHost = new Harness.LanguageService.TypeScriptLS(this.cancellationToken); - var inputFiles: { unitName: string; content: string }[] = []; + var compilationSettings = convertGlobalOptionsToCompilationSettings(this.testData.globalOptions); + this.languageServiceShimHost.setCompilationSettings(compilationSettings); - testData.files.forEach(file => { - var fixedPath = file.fileName.substr(file.fileName.indexOf('tests/')); - }); + var startResolveFileRef: FourSlashFile = undefined; - // NEWTODO: disable resolution for now. - // If the last unit contains require( or /// reference then consider it the only input file - // and the rest will be added via resolution. If not, then assume we have multiple files - // with 0 references in any of them. We could be smarter here to allow scenarios like - // 2 files without references and 1 file with a reference but we have 0 tests like that - // at the moment and an exhaustive search of the test files for that content could be quite slow. - var lastFile = testData.files[testData.files.length - 1]; - //if (/require\(/.test(lastFile.content) || /reference\spath/.test(lastFile.content)) { - // inputFiles.push({ unitName: lastFile.fileName, content: lastFile.content }); - //} else { - inputFiles = testData.files.map(file => { - return { unitName: file.fileName, content: file.content }; - }); - //} - - - // NEWTODO: Re-implement commented-out section - //harnessCompiler.addInputFiles(inputFiles); - //try { - // var resolvedFiles = harnessCompiler.resolve(); - - // resolvedFiles.forEach(file => { - // if (!Harness.isLibraryFile(file.path)) { - // var fixedPath = file.path.substr(file.path.indexOf('tests/')); - // var content = harnessCompiler.getContentForFile(fixedPath); - // this.languageServiceShimHost.addScript(fixedPath, content); - // } - // }); - - // this.languageServiceShimHost.addScript('lib.d.ts', Harness.Compiler.libTextMinimal); - //} - //finally { - // // harness no longer needs the results of the above work, make sure the next test operations are in a clean state - // harnessCompiler.reset(); - //} - - /// NEWTODO: For now do not resolve, just use the input files - inputFiles.forEach(file => { - if (!Harness.isLibraryFile(file.unitName)) { - this.languageServiceShimHost.addScript(file.unitName, file.content); + ts.forEach(testData.files, file => { + // Create map between fileName and its content for easily looking up when resolveReference flag is specified + this.inputFiles[file.fileName] = file.content; + if (!startResolveFileRef && file.fileOptions[testOptMetadataNames.resolveReference]) { + startResolveFileRef = file; + } else if (startResolveFileRef) { + // If entry point for resolving file references is already specified, report duplication error + throw new Error("There exists a Fourslash file which has resolveReference flag specified; remove duplicated resolveReference flag"); } }); - this.languageServiceShimHost.addDefaultLibrary(); + if (startResolveFileRef) { + // Add the entry-point file itself into the languageServiceShimHost + this.languageServiceShimHost.addScript(startResolveFileRef.fileName, startResolveFileRef.content); + var jsonResolvedResult = JSON.parse(this.languageServiceShimHost.getCoreService().getPreProcessedFileInfo(startResolveFileRef.fileName, + createScriptSnapShot(startResolveFileRef.content))); + var resolvedResult = jsonResolvedResult.result; + var referencedFiles: ts.IFileReference[] = resolvedResult.referencedFiles; + var importedFiles: ts.IFileReference[] = resolvedResult.importedFiles; + + // Add triple reference files into language-service host + ts.forEach(referencedFiles, referenceFile => { + // Fourslash insert tests/cases/fourslash into inputFile.unitName so we will properly append the same base directory to refFile path + var referenceFilePath = "tests/cases/fourslash/" + referenceFile.path; + this.addMatchedInputFile(referenceFilePath); + }); + + // Add import files into language-service host + ts.forEach(importedFiles, importedFile => { + // Fourslash insert tests/cases/fourslash into inputFile.unitName and import statement doesn't require ".ts" + // so convert them before making appropriate comparison + var importedFilePath = "tests/cases/fourslash/" + importedFile.path + ".ts"; + this.addMatchedInputFile(importedFilePath); + }); + + // Check if no-default-lib flag is false and if so add default library + if (!resolvedResult.isLibFile) { + this.languageServiceShimHost.addDefaultLibrary(); + } + } else { + // resolveReference file-option is not specified then do not resolve any files and include all inputFiles + ts.forEachKey(this.inputFiles, fileName => { + if (!Harness.isLibraryFile(fileName)) { + this.languageServiceShimHost.addScript(fileName, this.inputFiles[fileName]); + } + }); + this.languageServiceShimHost.addDefaultLibrary(); + } // Sneak into the language service and get its compiler so we can examine the syntax trees this.languageService = this.languageServiceShimHost.getLanguageService().languageService; @@ -304,8 +403,9 @@ module FourSlash { public goToPosition(pos: number) { this.currentCaretPosition = pos; - var lineCharPos = TypeScript.LineMap1.fromString(this.getCurrentFileContent()).getLineAndCharacterFromPosition(pos); - this.scenarioActions.push(''); + var lineStarts = ts.computeLineStarts(this.getCurrentFileContent()); + var lineCharPos = ts.getLineAndCharacterOfPosition(lineStarts, pos); + this.scenarioActions.push(''); } public moveCaretRight(count = 1) { @@ -346,6 +446,15 @@ module FourSlash { } } + private raiseError(message: string) { + message = this.messageAtLastKnownMarker(message); + throw new Error(message); + } + + private messageAtLastKnownMarker(message: string) { + return "Marker: " + currentTestState.lastKnownMarker + "\n" + message; + } + private getDiagnostics(fileName: string): ts.Diagnostic[] { var syntacticErrors = this.languageService.getSyntacticDiagnostics(fileName); var semanticErrors = this.languageService.getSemanticDiagnostics(fileName); @@ -434,7 +543,7 @@ module FourSlash { this.printErrorLog(false, errors); var errorMsg = "Actual number of errors (" + actual + ") does not match expected number (" + expected + ")"; Harness.IO.log(errorMsg); - throw new Error(errorMsg); + this.raiseError(errorMsg); } } @@ -448,24 +557,24 @@ module FourSlash { var evaluation = new Function(emit.outputFiles[0].text + ';\r\nreturn (' + expr + ');')(); if (evaluation !== value) { - throw new Error('Expected evaluation of expression "' + expr + '" to equal "' + value + '", but got "' + evaluation + '"'); + this.raiseError('Expected evaluation of expression "' + expr + '" to equal "' + value + '", but got "' + evaluation + '"'); } } - public verifyMemberListContains(symbol: string, type?: string, docComment?: string, fullSymbolName?: string, kind?: string) { + public verifyMemberListContains(symbol: string, text?: string, documentation?: string, kind?: string) { this.scenarioActions.push(''); this.scenarioActions.push(''); - if (type || docComment || fullSymbolName || kind) { + if (text || documentation || kind) { this.taoInvalidReason = 'verifyMemberListContains only supports the "symbol" parameter'; } var members = this.getMemberListAtCaret(); if (members) { - this.assertItemInCompletionList(members.entries, symbol, type, docComment, fullSymbolName, kind); + this.assertItemInCompletionList(members.entries, symbol, text, documentation, kind); } else { - throw new Error("Expected a member list, but none was provided"); + this.raiseError("Expected a member list, but none was provided"); } } @@ -488,11 +597,11 @@ module FourSlash { var match = members.entries.length === expectedCount; if ((!match && !negative) || (match && negative)) { - throw new Error("Member list count was " + members.entries.length + ". Expected " + expectedCount); + this.raiseError("Member list count was " + members.entries.length + ". Expected " + expectedCount); } } else if (expectedCount) { - throw new Error("Member list count was 0. Expected " + expectedCount); + this.raiseError("Member list count was 0. Expected " + expectedCount); } } @@ -502,7 +611,7 @@ module FourSlash { var members = this.getMemberListAtCaret(); if (members.entries.filter(e => e.name === symbol).length !== 0) { - throw new Error('Member list did contain ' + symbol); + this.raiseError('Member list did contain ' + symbol); } } @@ -513,7 +622,7 @@ module FourSlash { var itemsCount = completions.entries.length; if (itemsCount <= count) { - throw new Error('Expected completion list items count to be greater than ' + count + ', but is actually ' + itemsCount); + this.raiseError('Expected completion list items count to be greater than ' + count + ', but is actually ' + itemsCount); } } @@ -526,7 +635,7 @@ module FourSlash { var members = this.getMemberListAtCaret(); if ((!members || members.entries.length === 0) && negative) { - throw new Error("Member list is empty at Caret"); + this.raiseError("Member list is empty at Caret"); } else if ((members && members.entries.length !== 0) && !negative) { var errorMsg = "\n" + "Member List contains: [" + members.entries[0].name; @@ -536,7 +645,7 @@ module FourSlash { errorMsg += "]\n"; Harness.IO.log(errorMsg); - throw new Error("Member list is not empty at Caret"); + this.raiseError("Member list is not empty at Caret"); } } @@ -546,7 +655,7 @@ module FourSlash { var completions = this.getCompletionListAtCaret(); if ((!completions || completions.entries.length === 0) && negative) { - throw new Error("Completion list is empty at Caret"); + this.raiseError("Completion list is empty at Caret"); } else if ((completions && completions.entries.length !== 0) && !negative) { var errorMsg = "\n" + "Completion List contains: [" + completions.entries[0].name; @@ -556,14 +665,14 @@ module FourSlash { errorMsg += "]\n"; Harness.IO.log(errorMsg); - throw new Error("Completion list is not empty at Caret"); + this.raiseError("Completion list is not empty at Caret"); } } - public verifyCompletionListContains(symbol: string, type?: string, docComment?: string, fullSymbolName?: string, kind?: string) { + public verifyCompletionListContains(symbol: string, text?: string, documentation?: string, kind?: string) { var completions = this.getCompletionListAtCaret(); - this.assertItemInCompletionList(completions.entries, symbol, type, docComment, fullSymbolName, kind); + this.assertItemInCompletionList(completions.entries, symbol, text, documentation, kind); } public verifyCompletionListDoesNotContain(symbol: string) { @@ -572,27 +681,23 @@ module FourSlash { var completions = this.getCompletionListAtCaret(); if (completions && completions.entries && completions.entries.filter(e => e.name === symbol).length !== 0) { - throw new Error('Completion list did contain ' + symbol); + this.raiseError('Completion list did contain ' + symbol); } } - public verifyCompletionEntryDetails(entryName: string, type: string, docComment?: string, fullSymbolName?: string, kind?: string) { + public verifyCompletionEntryDetails(entryName: string, expectedText: string, expectedDocumentation?: string, kind?: string) { this.taoInvalidReason = 'verifyCompletionEntryDetails NYI'; var details = this.getCompletionEntryDetails(entryName); - assert.equal(details.type, type); + assert.equal(ts.displayPartsToString(details.displayParts), expectedText, assertionMessage("completion entry details text")); - if (docComment != undefined) { - assert.equal(details.docComment, docComment); - } - - if (fullSymbolName !== undefined) { - assert.equal(details.fullSymbolName, fullSymbolName); + if (expectedDocumentation !== undefined) { + assert.equal(ts.displayPartsToString(details.documentation), expectedDocumentation, assertionMessage("completion entry documentation")); } if (kind !== undefined) { - assert.equal(details.kind, kind); + assert.equal(details.kind, kind, assertionMessage("completion entry kind")); } } @@ -602,21 +707,21 @@ module FourSlash { var references = this.getReferencesAtCaret(); if (!references || references.length === 0) { - throw new Error('verifyReferencesAtPositionListContains failed - found 0 references, expected at least one.'); + this.raiseError('verifyReferencesAtPositionListContains failed - found 0 references, expected at least one.'); } for (var i = 0; i < references.length; i++) { var reference = references[i]; if (reference && reference.fileName === fileName && reference.textSpan.start() === start && reference.textSpan.end() === end) { if (typeof isWriteAccess !== "undefined" && reference.isWriteAccess !== isWriteAccess) { - throw new Error('verifyReferencesAtPositionListContains failed - item isWriteAccess value doe not match, actual: ' + reference.isWriteAccess + ', expected: ' + isWriteAccess + '.'); + this.raiseError('verifyReferencesAtPositionListContains failed - item isWriteAccess value doe not match, actual: ' + reference.isWriteAccess + ', expected: ' + isWriteAccess + '.'); } return; } } var missingItem = { fileName: fileName, start: start, end: end, isWriteAccess: isWriteAccess }; - throw new Error('verifyReferencesAtPositionListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(references) + ')'); + this.raiseError('verifyReferencesAtPositionListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(references) + ')'); } public verifyReferencesCountIs(count: number, localFilesOnly: boolean = true) { @@ -640,30 +745,7 @@ module FourSlash { if (referencesCount !== count) { var condition = localFilesOnly ? "excluding libs" : "including libs"; - throw new Error("Expected references count (" + condition + ") to be " + count + ", but is actually " + referencesCount); - } - } - - public verifyImplementorsCountIs(count: number, localFilesOnly: boolean = true) { - var implementors = this.getImplementorsAtCaret(); - var implementorsCount = 0; - - if (localFilesOnly) { - var localFiles = this.testData.files.map(file => file.fileName); - // Count only the references in local files. Filter the ones in lib and other files. - implementors.forEach((entry) => { - if (localFiles.some((filename) => filename === entry.fileName)) { - ++implementorsCount; - } - }); - } - else { - implementorsCount = implementors.length; - } - - if (implementorsCount !== count) { - var condition = localFilesOnly ? "excluding libs" : "including libs"; - throw new Error("Expected implementors count (" + condition + ") to be " + count + ", but is actually " + implementors.length); + this.raiseError("Expected references count (" + condition + ") to be " + count + ", but is actually " + referencesCount); } } @@ -683,69 +765,83 @@ module FourSlash { return this.languageService.getReferencesAtPosition(this.activeFile.fileName, this.currentCaretPosition); } - private getImplementorsAtCaret() { - return this.languageService.getImplementorsAtPosition(this.activeFile.fileName, this.currentCaretPosition); + private assertionMessage(name: string, actualValue: any, expectedValue: any) { + return "\nActual " + name + ":\n\t" + actualValue + "\nExpected value:\n\t" + expectedValue; } - public verifyQuickInfo(negative: boolean, expectedTypeName?: string, docComment?: string, symbolName?: string, kind?: string) { - [expectedTypeName, docComment, symbolName, kind].forEach(str => { + public verifyQuickInfo(negative: boolean, expectedText?: string, expectedDocumentation?: string) { + [expectedText, expectedDocumentation].forEach(str => { if (str) { this.scenarioActions.push(''); this.scenarioActions.push(''); } }); - var actualQuickInfo = this.languageService.getTypeAtPosition(this.activeFile.fileName, this.currentCaretPosition); - var actualQuickInfoMemberName = actualQuickInfo ? actualQuickInfo.memberName.toString() : ""; - var actualQuickInfoDocComment = actualQuickInfo ? actualQuickInfo.docComment : ""; - var actualQuickInfoSymbolName = actualQuickInfo ? actualQuickInfo.fullSymbolName : ""; - var actualQuickInfoKind = actualQuickInfo ? actualQuickInfo.kind : ""; - - function assertionMessage(name: string, actualValue: string, expectedValue: string) { - return "\nActual " + name + ":\n\t" + actualValue + "\nExpected value:\n\t" + expectedValue; - } + var actualQuickInfo = this.languageService.getQuickInfoAtPosition(this.activeFile.fileName, this.currentCaretPosition); + var actualQuickInfoText = actualQuickInfo ? ts.displayPartsToString(actualQuickInfo.displayParts) : ""; + var actualQuickInfoDocumentation = actualQuickInfo ? ts.displayPartsToString(actualQuickInfo.documentation) : ""; if (negative) { - if (expectedTypeName !== undefined) { - assert.notEqual(actualQuickInfoMemberName, expectedTypeName, assertionMessage("quick info member name", actualQuickInfoMemberName, expectedTypeName)); + if (expectedText !== undefined) { + assert.notEqual(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text")); } - if (docComment != undefined) { - assert.notEqual(actualQuickInfoDocComment, docComment, assertionMessage("quick info doc comment", actualQuickInfoDocComment, docComment)); - } - if (symbolName !== undefined) { - assert.notEqual(actualQuickInfoSymbolName, symbolName, assertionMessage("quick info symbol name", actualQuickInfoSymbolName, symbolName)); - } - if (kind !== undefined) { - assert.notEqual(actualQuickInfoKind, kind, assertionMessage("quick info kind", actualQuickInfoKind, kind)); + if (expectedDocumentation != undefined) { + assert.notEqual(actualQuickInfoDocumentation, expectedDocumentation, this.messageAtLastKnownMarker("quick info doc comment")); } } else { - if (expectedTypeName !== undefined) { - assert.equal(actualQuickInfoMemberName, expectedTypeName, assertionMessage("quick info member", actualQuickInfoMemberName, expectedTypeName)); + if (expectedText !== undefined) { + assert.equal(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text")); } - if (docComment != undefined) { - assert.equal(actualQuickInfoDocComment, docComment, assertionMessage("quick info doc", actualQuickInfoDocComment, docComment)); - } - if (symbolName !== undefined) { - assert.equal(actualQuickInfoSymbolName, symbolName, assertionMessage("quick info symbol name", actualQuickInfoSymbolName, symbolName)); - } - if (kind !== undefined) { - assert.equal(actualQuickInfoKind, kind, assertionMessage("quick info kind", actualQuickInfoKind, kind)); + if (expectedDocumentation != undefined) { + assert.equal(actualQuickInfoDocumentation, expectedDocumentation, assertionMessage("quick info doc")); } } } - public verifyQuickInfoExists(negative: number) { + public verifyRenameLocations(findInStrings: boolean, findInComments: boolean) { + var renameInfo = this.languageService.getRenameInfo(this.activeFile.fileName, this.currentCaretPosition); + if (renameInfo.canRename) { + var references = this.languageService.findRenameLocations( + this.activeFile.fileName, this.currentCaretPosition, findInStrings, findInComments); + + var ranges = this.getRanges(); + if (ranges.length !== references.length) { + this.raiseError(this.assertionMessage("Rename locations", references.length, ranges.length)); + } + + ranges = ranges.sort((r1, r2) => r1.start - r2.start); + references = references.sort((r1, r2) => r1.textSpan.start() - r2.textSpan.start()); + + for (var i = 0, n = ranges.length; i < n; i++) { + var reference = references[i]; + var range = ranges[i]; + + if (reference.textSpan.start() !== range.start || + reference.textSpan.end() !== range.end) { + + this.raiseError(this.assertionMessage("Rename location", + "[" + reference.textSpan.start() + "," + reference.textSpan.end() + ")", + "[" + range.start + "," + range.end + ")")); + } + } + } + else { + this.raiseError("Expected rename to succeed, but it actually failed."); + } + } + + public verifyQuickInfoExists(negative: boolean) { this.taoInvalidReason = 'verifyQuickInfoExists NYI'; - var actualQuickInfo = this.languageService.getTypeAtPosition(this.activeFile.fileName, this.currentCaretPosition); + var actualQuickInfo = this.languageService.getQuickInfoAtPosition(this.activeFile.fileName, this.currentCaretPosition); if (negative) { if (actualQuickInfo) { - throw new Error('verifyQuickInfoExists failed. Expected quick info NOT to exist'); + this.raiseError('verifyQuickInfoExists failed. Expected quick info NOT to exist'); } } else { if (!actualQuickInfo) { - throw new Error('verifyQuickInfoExists failed. Expected quick info to exist'); + this.raiseError('verifyQuickInfoExists failed. Expected quick info to exist'); } } } @@ -753,14 +849,17 @@ module FourSlash { public verifyCurrentSignatureHelpIs(expected: string) { this.taoInvalidReason = 'verifyCurrentSignatureHelpIs NYI'; - var help = this.getActiveSignatureHelp(); - assert.equal(help.prefix + help.parameters.map(p => p.display).join(help.separator) + help.suffix, expected); + var help = this.getActiveSignatureHelpItem(); + assert.equal( + ts.displayPartsToString(help.prefixDisplayParts) + + help.parameters.map(p => ts.displayPartsToString(p.displayParts)).join(ts.displayPartsToString(help.separatorDisplayParts)) + + ts.displayPartsToString(help.suffixDisplayParts), expected); } public verifyCurrentParameterIsVariable(isVariable: boolean) { this.taoInvalidReason = 'verifyCurrentParameterIsVariable NYI'; - var signature = this.getActiveSignatureHelp(); + var signature = this.getActiveSignatureHelpItem(); assert.isNotNull(signature); assert.equal(isVariable, signature.isVariadic); } @@ -776,9 +875,9 @@ module FourSlash { public verifyCurrentParameterSpanIs(parameter: string) { this.taoInvalidReason = 'verifyCurrentParameterSpanIs NYI'; - var activeSignature = this.getActiveSignatureHelp(); + var activeSignature = this.getActiveSignatureHelpItem(); var activeParameter = this.getActiveParameter(); - assert.equal(activeParameter.display, parameter); + assert.equal(ts.displayPartsToString(activeParameter.displayParts), parameter); } public verifyCurrentParameterHelpDocComment(docComment: string) { @@ -786,26 +885,26 @@ module FourSlash { var activeParameter = this.getActiveParameter(); var activeParameterDocComment = activeParameter.documentation; - assert.equal(activeParameterDocComment, docComment); + assert.equal(ts.displayPartsToString(activeParameterDocComment), docComment, assertionMessage("current parameter Help DocComment")); } public verifyCurrentSignatureHelpParameterCount(expectedCount: number) { this.taoInvalidReason = 'verifyCurrentSignatureHelpParameterCount NYI'; - assert.equal(this.getActiveSignatureHelp().parameters.length, expectedCount); + assert.equal(this.getActiveSignatureHelpItem().parameters.length, expectedCount); } public verifyCurrentSignatureHelpTypeParameterCount(expectedCount: number) { this.taoInvalidReason = 'verifyCurrentSignatureHelpTypeParameterCount NYI'; - // assert.equal(this.getActiveSignatureHelp().typeParameters.length, expectedCount); + // assert.equal(this.getActiveSignatureHelpItem().typeParameters.length, expectedCount); } public verifyCurrentSignatureHelpDocComment(docComment: string) { this.taoInvalidReason = 'verifyCurrentSignatureHelpDocComment NYI'; - var actualDocComment = this.getActiveSignatureHelp().documentation; - assert.equal(actualDocComment, docComment); + var actualDocComment = this.getActiveSignatureHelpItem().documentation; + assert.equal(ts.displayPartsToString(actualDocComment), docComment, assertionMessage("current signature help doc comment")); } public verifySignatureHelpCount(expected: number) { @@ -817,58 +916,158 @@ module FourSlash { assert.equal(actual, expected); } + public verifySignatureHelpArgumentCount(expected: number) { + this.taoInvalidReason = 'verifySignatureHelpArgumentCount NYI'; + var signatureHelpItems = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); + var actual = signatureHelpItems.argumentCount; + assert.equal(actual, expected); + } + public verifySignatureHelpPresent(shouldBePresent = true) { this.taoInvalidReason = 'verifySignatureHelpPresent NYI'; var actual = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); if (shouldBePresent) { if (!actual) { - throw new Error("Expected signature help to be present, but it wasn't"); + this.raiseError("Expected signature help to be present, but it wasn't"); } } else { if (actual) { - throw new Error("Expected no signature help, but got '" + JSON.stringify(actual) + "'"); + this.raiseError("Expected no signature help, but got '" + JSON.stringify(actual) + "'"); } } } - //private getFormalParameter() { - // var help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); - // return help.formal; - //} + private validate(name: string, expected: string, actual: string) { + if (expected && expected !== actual) { + this.raiseError("Expected " + name + " '" + expected + "'. Got '" + actual + "' instead."); + } + } - private getActiveSignatureHelp() { + public verifyRenameInfoSucceeded(displayName?: string, fullDisplayName?: string, kind?: string, kindModifiers?: string) { + var renameInfo = this.languageService.getRenameInfo(this.activeFile.fileName, this.currentCaretPosition); + if (!renameInfo.canRename) { + this.raiseError("Rename did not succeed"); + } + + this.validate("displayName", displayName, renameInfo.displayName); + this.validate("fullDisplayName", fullDisplayName, renameInfo.fullDisplayName); + this.validate("kind", kind, renameInfo.kind); + this.validate("kindModifiers", kindModifiers, renameInfo.kindModifiers); + + if (this.getRanges().length !== 1) { + this.raiseError("Expected a single range to be selected in the test file."); + } + + var expectedRange = this.getRanges()[0]; + if (renameInfo.triggerSpan.start() !== expectedRange.start || + renameInfo.triggerSpan.end() !== expectedRange.end) { + this.raiseError("Expected triggerSpan [" + expectedRange.start + "," + expectedRange.end + "). Got [" + + renameInfo.triggerSpan.start() + "," + renameInfo.triggerSpan.end() + ") instead."); + } + } + + public verifyRenameInfoFailed(message?: string) { + var renameInfo = this.languageService.getRenameInfo(this.activeFile.fileName, this.currentCaretPosition); + if (renameInfo.canRename) { + this.raiseError("Rename was expected to fail"); + } + + this.validate("error", message, renameInfo.localizedErrorMessage); + } + + private getActiveSignatureHelpItem() { var help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); - - // If the signature hasn't been narrowed down yet (e.g. no parameters have yet been entered), - // 'activeFormal' will be -1 (even if there is only 1 signature). Signature help will show the - // first signature in the signature group, so go with that - var index = help.selectedItemIndex < 0 ? 0 : help.selectedItemIndex; - + var index = help.selectedItemIndex; return help.items[index]; } private getActiveParameter(): ts.SignatureHelpParameter { - var currentSig = this.getActiveSignatureHelp(); var help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); - var item = help.items[help.selectedItemIndex]; - var state = this.languageService.getSignatureHelpCurrentArgumentState(this.activeFile.fileName, this.currentCaretPosition, help.applicableSpan.start()); - - // Same logic as in getActiveSignatureHelp - this value might be -1 until a parameter value actually gets typed - var currentParam = state === null ? 0 : state.argumentIndex; + var currentParam = help.argumentIndex; return item.parameters[currentParam]; } + private alignmentForExtraInfo = 50; + + private spanInfoToString(pos: number, spanInfo: ts.TextSpan, prefixString: string) { + var resultString = "SpanInfo: " + JSON.stringify(spanInfo); + if (spanInfo) { + var spanString = this.activeFile.content.substr(spanInfo.start(), spanInfo.length()); + var spanLineMap = ts.computeLineStarts(spanString); + for (var i = 0; i < spanLineMap.length; i++) { + if (!i) { + resultString += "\n"; + } + resultString += prefixString + spanString.substring(spanLineMap[i], spanLineMap[i + 1]); + } + resultString += "\n" + prefixString + ":=> (" + this.getLineColStringAtPosition(spanInfo.start()) + ") to (" + this.getLineColStringAtPosition(spanInfo.end()) + ")"; + } + + return resultString; + } + + private baselineCurrentFileLocations(getSpanAtPos: (pos: number) => ts.TextSpan): string { + var fileLineMap = ts.computeLineStarts(this.activeFile.content); + var nextLine = 0; + var resultString = ""; + var currentLine: string; + var previousSpanInfo: string; + var startColumn: number; + var length: number; + var prefixString = " >"; + + var addSpanInfoString = () => { + if (previousSpanInfo) { + resultString += currentLine; + var thisLineMarker = repeatString(startColumn, " ") + repeatString(length, "~"); + thisLineMarker += repeatString(this.alignmentForExtraInfo - thisLineMarker.length - prefixString.length + 1, " "); + resultString += thisLineMarker; + resultString += "=> Pos: (" + (pos - length) + " to " + (pos - 1) + ") "; + resultString += " " + previousSpanInfo; + previousSpanInfo = undefined; + } + }; + + for (var pos = 0; pos < this.activeFile.content.length; pos++) { + if (pos === 0 || pos === fileLineMap[nextLine]) { + nextLine++; + addSpanInfoString(); + if (resultString.length) { + resultString += "\n--------------------------------"; + } + currentLine = "\n" + nextLine.toString() + repeatString(3 - nextLine.toString().length, " ") + ">" + this.activeFile.content.substring(pos, fileLineMap[nextLine]) + "\n "; + startColumn = 0; + length = 0; + } + var spanInfo = this.spanInfoToString(pos, getSpanAtPos(pos), prefixString); + if (previousSpanInfo && previousSpanInfo !== spanInfo) { + addSpanInfoString(); + previousSpanInfo = spanInfo; + startColumn = startColumn + length; + length = 1; + } + else { + previousSpanInfo = spanInfo; + length++; + } + } + addSpanInfoString(); + return resultString; + + function repeatString(count: number, char: string) { + var result = ""; + for (var i = 0; i < count; i++) { + result += char; + } + return result; + } + } + public getBreakpointStatementLocation(pos: number) { this.taoInvalidReason = 'getBreakpointStatementLocation NYI'; - - var spanInfo = this.languageService.getBreakpointStatementAtPosition(this.activeFile.fileName, pos); - var resultString = "\n**Pos: " + pos + " SpanInfo: " + JSON.stringify(spanInfo) + "\n** Statement: "; - if (spanInfo !== null) { - resultString = resultString + this.activeFile.content.substr(spanInfo.start(), spanInfo.length()); - } - return resultString; + return this.languageService.getBreakpointStatementAtPosition(this.activeFile.fileName, pos); } public baselineCurrentFileBreakpointLocations() { @@ -876,20 +1075,57 @@ module FourSlash { Harness.Baseline.runBaseline( "Breakpoint Locations for " + this.activeFile.fileName, - this.testData.globalOptions['BaselineFile'], + this.testData.globalOptions[testOptMetadataNames.baselineFile], + () => { + return this.baselineCurrentFileLocations(pos => this.getBreakpointStatementLocation(pos)); + }, + true /* run immediately */); + } + + public baselineGetEmitOutput() { + this.taoInvalidReason = 'baselineGetEmitOutput impossible'; + // Find file to be emitted + var emitFiles: FourSlashFile[] = []; // List of FourSlashFile that has emitThisFile flag on + + var allFourSlashFiles = this.testData.files; + for (var idx = 0; idx < allFourSlashFiles.length; ++idx) { + var file = allFourSlashFiles[idx]; + if (file.fileOptions[testOptMetadataNames.emitThisFile]) { + // Find a file with the flag emitThisFile turned on + emitFiles.push(file); + } + } + + // If there is not emiThisFile flag specified in the test file, throw an error + if (emitFiles.length === 0) { + this.raiseError("No emitThisFile is specified in the test file"); + } + + Harness.Baseline.runBaseline( + "Generate getEmitOutput baseline : " + emitFiles.join(" "), + this.testData.globalOptions[testOptMetadataNames.baselineFile], () => { - var fileLength = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getLength(); var resultString = ""; - for (var pos = 0; pos < fileLength; pos++) { - resultString = resultString + this.getBreakpointStatementLocation(pos); - } + // Loop through all the emittedFiles and emit them one by one + emitFiles.forEach(emitFile => { + var emitOutput = this.languageService.getEmitOutput(emitFile.fileName); + var emitOutputStatus = emitOutput.emitOutputStatus; + // Print emitOutputStatus in readable format + resultString += "EmitOutputStatus : " + ts.EmitReturnStatus[emitOutputStatus]; + resultString += "\n"; + emitOutput.outputFiles.forEach((outputFile, idx, array) => { + var filename = "Filename : " + outputFile.name + "\n"; + resultString = resultString + filename + outputFile.text; + }); + resultString += "\n"; + }); return resultString; }, true /* run immediately */); } public printBreakpointLocation(pos: number) { - Harness.IO.log(this.getBreakpointStatementLocation(pos)); + Harness.IO.log("\n**Pos: " + pos + " " + this.spanInfoToString(pos, this.getBreakpointStatementLocation(pos), " ")); } public printBreakpointAtCurrentLocation() { @@ -902,7 +1138,7 @@ module FourSlash { } public printCurrentQuickInfo() { - var quickInfo = this.languageService.getTypeAtPosition(this.activeFile.fileName, this.currentCaretPosition); + var quickInfo = this.languageService.getQuickInfoAtPosition(this.activeFile.fileName, this.currentCaretPosition); Harness.IO.log(JSON.stringify(quickInfo)); } @@ -937,7 +1173,7 @@ module FourSlash { } public printCurrentSignatureHelp() { - var sigHelp = this.getActiveSignatureHelp(); + var sigHelp = this.getActiveSignatureHelpItem(); Harness.IO.log(JSON.stringify(sigHelp)); } @@ -1162,7 +1398,7 @@ module FourSlash { //var fullSyntaxErrs = JSON.stringify(refSyntaxTree.diagnostics()); //if (incrSyntaxErrs !== fullSyntaxErrs) { - // throw new Error('Mismatched incremental/full syntactic errors for file ' + this.activeFile.fileName + '.\n=== Incremental errors ===\n' + incrSyntaxErrs + '\n=== Full Errors ===\n' + fullSyntaxErrs); + // this.raiseError('Mismatched incremental/full syntactic errors for file ' + this.activeFile.fileName + '.\n=== Incremental errors ===\n' + incrSyntaxErrs + '\n=== Full Errors ===\n' + fullSyntaxErrs); //} // if (this.editValidation !== IncrementalEditValidation.SyntacticOnly) { @@ -1179,7 +1415,7 @@ module FourSlash { // var incrSemanticErrs = JSON.stringify(this.languageService.getSemanticDiagnostics(this.testData.files[i].fileName)); // if (incrSemanticErrs !== refSemanticErrs) { - // throw new Error('Mismatched incremental/full semantic errors for file ' + this.testData.files[i].fileName + '\n=== Incremental errors ===\n' + incrSemanticErrs + '\n=== Full Errors ===\n' + refSemanticErrs); + // this.raiseError('Mismatched incremental/full semantic errors for file ' + this.testData.files[i].fileName + '\n=== Incremental errors ===\n' + incrSemanticErrs + '\n=== Full Errors ===\n' + refSemanticErrs); // } // } // } @@ -1198,7 +1434,7 @@ module FourSlash { private applyEdits(fileName: string, edits: ts.TextChange[], isFormattingEdit = false): number { // We get back a set of edits, but langSvc.editScript only accepts one at a time. Use this to keep track - // of the incremental offest from each edit to the next. Assumption is that these edit ranges don't overlap + // of the incremental offset from each edit to the next. Assumption is that these edit ranges don't overlap var runningOffset = 0; edits = edits.sort((a, b) => a.span.start() - b.span.start()); // Get a snapshot of the content of the file so we can make sure any formatting edits didn't destroy non-whitespace characters @@ -1218,7 +1454,7 @@ module FourSlash { var newContent = snapshot.getText(0, snapshot.getLength()); if (newContent.replace(/\s/g, '') !== oldContent.replace(/\s/g, '')) { - throw new Error('Formatting operation destroyed non-whitespace content'); + this.raiseError('Formatting operation destroyed non-whitespace content'); } } return runningOffset; @@ -1275,11 +1511,11 @@ module FourSlash { var definitions = this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); if (!definitions || !definitions.length) { - throw new Error('goToDefinition failed - expected to at least one defintion location but got 0'); + this.raiseError('goToDefinition failed - expected to at least one definition location but got 0'); } if (definitionIndex >= definitions.length) { - throw new Error('goToDefinition failed - definitionIndex value (' + definitionIndex + ') exceeds definition list size (' + definitions.length + ')'); + this.raiseError('goToDefinition failed - definitionIndex value (' + definitionIndex + ') exceeds definition list size (' + definitions.length + ')'); } var definition = definitions[definitionIndex]; @@ -1295,10 +1531,25 @@ module FourSlash { var foundDefinitions = definitions && definitions.length; if (foundDefinitions && negative) { - throw new Error('goToDefinition - expected to 0 defintion locations but got ' + definitions.length); + this.raiseError('goToDefinition - expected to 0 definition locations but got ' + definitions.length); } else if (!foundDefinitions && !negative) { - throw new Error('goToDefinition - expected to at least one defintion location but got 0'); + this.raiseError('goToDefinition - expected to at least one definition location but got 0'); + } + } + + public verifyDefinitionsName(negative: boolean, expectedName: string, expectedContainerName: string) { + this.taoInvalidReason = 'verifyDefinititionsInfo NYI'; + + var definitions = this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); + var actualDefinitionName = definitions && definitions.length ? definitions[0].name : ""; + var actualDefinitionContainerName = definitions && definitions.length ? definitions[0].containerName : ""; + if (negative) { + assert.notEqual(actualDefinitionName, expectedName, this.messageAtLastKnownMarker("Definition Info Name")); + assert.notEqual(actualDefinitionName, expectedName, this.messageAtLastKnownMarker("Definition Info Container Name")); + } else { + assert.equal(actualDefinitionName, expectedName, this.messageAtLastKnownMarker("Definition Info Name")); + assert.equal(actualDefinitionName, expectedName, this.messageAtLastKnownMarker("Definition Info Container Name")); } } @@ -1320,7 +1571,7 @@ module FourSlash { throw new Error('verifyCaretAtMarker failed - expected to be in file "' + pos.fileName + '", but was in file "' + this.activeFile.fileName + '"'); } if (pos.position !== this.currentCaretPosition) { - throw new Error('verifyCaretAtMarker failed - expected to be at marker "/*' + markerName + '*/, but was at position ' + this.currentCaretPosition + '(' + this.getLineColStringAtCaret() + ')'); + throw new Error('verifyCaretAtMarker failed - expected to be at marker "/*' + markerName + '*/, but was at position ' + this.currentCaretPosition + '(' + this.getLineColStringAtPosition(this.currentCaretPosition) + ')'); } } @@ -1333,7 +1584,7 @@ module FourSlash { var actual = this.getIndentation(this.activeFile.fileName, this.currentCaretPosition); if (actual != numberOfSpaces) { - throw new Error('verifyIndentationAtCurrentPosition failed - expected: ' + numberOfSpaces + ', actual: ' + actual); + this.raiseError('verifyIndentationAtCurrentPosition failed - expected: ' + numberOfSpaces + ', actual: ' + actual); } } @@ -1342,7 +1593,7 @@ module FourSlash { var actual = this.getIndentation(fileName, position); if (actual !== numberOfSpaces) { - throw new Error('verifyIndentationAtPosition failed - expected: ' + numberOfSpaces + ', actual: ' + actual); + this.raiseError('verifyIndentationAtPosition failed - expected: ' + numberOfSpaces + ', actual: ' + actual); } } @@ -1384,27 +1635,23 @@ module FourSlash { this.taoInvalidReason = 'verifyCurrentNameOrDottedNameSpanText NYI'; var span = this.languageService.getNameOrDottedNameSpan(this.activeFile.fileName, this.currentCaretPosition, this.currentCaretPosition); - if (span === null) { - throw new Error('verifyCurrentNameOrDottedNameSpanText\n' + + if (!span) { + this.raiseError('verifyCurrentNameOrDottedNameSpanText\n' + '\tExpected: "' + text + '"\n' + - '\t Actual: null'); + '\t Actual: undefined'); } var actual = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getText(span.start(), span.end()); if (actual !== text) { - throw new Error('verifyCurrentNameOrDottedNameSpanText\n' + + this.raiseError('verifyCurrentNameOrDottedNameSpanText\n' + '\tExpected: "' + text + '"\n' + '\t Actual: "' + actual + '"'); } } private getNameOrDottedNameSpan(pos: number) { - var spanInfo = this.languageService.getNameOrDottedNameSpan(this.activeFile.fileName, pos, pos); - var resultString = "\n**Pos: " + pos + " SpanInfo: " + JSON.stringify(spanInfo) + "\n** Statement: "; - if (spanInfo !== null) { - resultString = resultString + this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getText(spanInfo.start(), spanInfo.end()); - } - return resultString; + this.taoInvalidReason = 'getNameOrDottedNameSpan NYI'; + return this.languageService.getNameOrDottedNameSpan(this.activeFile.fileName, pos, pos); } public baselineCurrentFileNameOrDottedNameSpans() { @@ -1412,20 +1659,79 @@ module FourSlash { Harness.Baseline.runBaseline( "Name OrDottedNameSpans for " + this.activeFile.fileName, - this.testData.globalOptions['BaselineFile'], + this.testData.globalOptions[testOptMetadataNames.baselineFile], () => { - var fileLength = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getLength(); - var resultString = ""; - for (var pos = 0; pos < fileLength; pos++) { - resultString = resultString + this.getNameOrDottedNameSpan(pos); - } - return resultString; + return this.baselineCurrentFileLocations(pos => + this.getNameOrDottedNameSpan(pos)); }, true /* run immediately */); } public printNameOrDottedNameSpans(pos: number) { - Harness.IO.log(this.getNameOrDottedNameSpan(pos)); + Harness.IO.log(this.spanInfoToString(pos, this.getNameOrDottedNameSpan(pos), "**")); + } + + private verifyClassifications(expected: { classificationType: string; text: string; textSpan?: TextSpan }[], actual: ts.ClassifiedSpan[]) { + if (actual.length !== expected.length) { + this.raiseError('verifyClassifications failed - expected total classifications to be ' + expected.length + + ', but was ' + actual.length + + jsonMismatchString()); + } + + for (var i = 0; i < expected.length; i++) { + var expectedClassification = expected[i]; + var actualClassification = actual[i]; + + var expectedType: string = (ts.ClassificationTypeNames)[expectedClassification.classificationType]; + if (expectedType !== actualClassification.classificationType) { + this.raiseError('verifyClassifications failed - expected classifications type to be ' + + expectedType + ', but was ' + + actualClassification.classificationType + + jsonMismatchString()); + } + + var expectedSpan = expectedClassification.textSpan; + var actualSpan = actualClassification.textSpan; + + if (expectedSpan) { + var expectedLength = expectedSpan.end - expectedSpan.start; + + if (expectedSpan.start !== actualSpan.start() || expectedLength !== actualSpan.length()) { + this.raiseError("verifyClassifications failed - expected span of text to be " + + "{start=" + expectedSpan.start + ", length=" + expectedLength + "}, but was " + + "{start=" + actualSpan.start() + ", length=" + actualSpan.length() + "}" + + jsonMismatchString()); + } + } + + var actualText = this.activeFile.content.substr(actualSpan.start(), actualSpan.length()); + if (expectedClassification.text !== actualText) { + this.raiseError('verifyClassifications failed - expected classified text to be ' + + expectedClassification.text + ', but was ' + + actualText + + jsonMismatchString()); + } + } + + function jsonMismatchString() { + return sys.newLine + + "expected: '" + sys.newLine + JSON.stringify(expected, (k,v) => v, 2) + "'" + sys.newLine + + "actual: '" + sys.newLine + JSON.stringify(actual, (k, v) => v, 2) + "'"; + } + } + + public verifySemanticClassifications(expected: { classificationType: string; text: string }[]) { + var actual = this.languageService.getSemanticClassifications(this.activeFile.fileName, + new ts.TextSpan(0, this.activeFile.content.length)); + + this.verifyClassifications(expected, actual); + } + + public verifySyntacticClassifications(expected: { classificationType: string; text: string }[]) { + var actual = this.languageService.getSyntacticClassifications(this.activeFile.fileName, + new ts.TextSpan(0, this.activeFile.content.length)); + + this.verifyClassifications(expected, actual); } public verifyOutliningSpans(spans: TextSpan[]) { @@ -1434,33 +1740,33 @@ module FourSlash { var actual = this.languageService.getOutliningSpans(this.activeFile.fileName); if (actual.length !== spans.length) { - throw new Error('verifyOutliningSpans failed - expected total spans to be ' + spans.length + ', but was ' + actual.length); + this.raiseError('verifyOutliningSpans failed - expected total spans to be ' + spans.length + ', but was ' + actual.length); } for (var i = 0; i < spans.length; i++) { var expectedSpan = spans[i]; var actualSpan = actual[i]; if (expectedSpan.start !== actualSpan.textSpan.start() || expectedSpan.end !== actualSpan.textSpan.end()) { - throw new Error('verifyOutliningSpans failed - span ' + (i + 1) + ' expected: (' + expectedSpan.start + ',' + expectedSpan.end + '), actual: (' + actualSpan.textSpan.start() + ',' + actualSpan.textSpan.end() + ')'); + this.raiseError('verifyOutliningSpans failed - span ' + (i + 1) + ' expected: (' + expectedSpan.start + ',' + expectedSpan.end + '), actual: (' + actualSpan.textSpan.start() + ',' + actualSpan.textSpan.end() + ')'); } } } public verifyTodoComments(descriptors: string[], spans: TextSpan[]) { var actual = this.languageService.getTodoComments(this.activeFile.fileName, - descriptors.map(d => new ts.TodoCommentDescriptor(d, 0))); + descriptors.map(d => { return { text: d, priority: 0 }; })); if (actual.length !== spans.length) { - throw new Error('verifyTodoComments failed - expected total spans to be ' + spans.length + ', but was ' + actual.length); + this.raiseError('verifyTodoComments failed - expected total spans to be ' + spans.length + ', but was ' + actual.length); } for (var i = 0; i < spans.length; i++) { var expectedSpan = spans[i]; var actualComment = actual[i]; - var actualCommentSpan = new TypeScript.TextSpan(actualComment.position, actualComment.message.length); + var actualCommentSpan = new ts.TextSpan(actualComment.position, actualComment.message.length); if (expectedSpan.start !== actualCommentSpan.start() || expectedSpan.end !== actualCommentSpan.end()) { - throw new Error('verifyOutliningSpans failed - span ' + (i + 1) + ' expected: (' + expectedSpan.start + ',' + expectedSpan.end + '), actual: (' + actualCommentSpan.start() + ',' + actualCommentSpan.end() + ')'); + this.raiseError('verifyOutliningSpans failed - span ' + (i + 1) + ' expected: (' + expectedSpan.start + ',' + expectedSpan.end + '), actual: (' + actualCommentSpan.start() + ',' + actualCommentSpan.end() + ')'); } } } @@ -1471,20 +1777,20 @@ module FourSlash { var actual = this.languageService.getBraceMatchingAtPosition(this.activeFile.fileName, bracePosition); if (actual.length !== 2) { - throw new Error('verifyMatchingBracePosition failed - expected result to contain 2 spans, but it had ' + actual.length); + this.raiseError('verifyMatchingBracePosition failed - expected result to contain 2 spans, but it had ' + actual.length); } var actualMatchPosition = -1; - if (bracePosition >= actual[0].start() && bracePosition <= actual[0].end()) { + if (bracePosition === actual[0].start()) { actualMatchPosition = actual[1].start(); - } else if (bracePosition >= actual[1].start() && bracePosition <= actual[1].end()) { + } else if (bracePosition === actual[1].start()) { actualMatchPosition = actual[0].start(); } else { - throw new Error('verifyMatchingBracePosition failed - could not find the brace position: ' + bracePosition + ' in the returned list: (' + actual[0].start() + ',' + actual[0].end() + ') and (' + actual[1].start() + ',' + actual[1].end() + ')'); + this.raiseError('verifyMatchingBracePosition failed - could not find the brace position: ' + bracePosition + ' in the returned list: (' + actual[0].start() + ',' + actual[0].end() + ') and (' + actual[1].start() + ',' + actual[1].end() + ')'); } if (actualMatchPosition !== expectedMatchPosition) { - throw new Error('verifyMatchingBracePosition failed - expected: ' + actualMatchPosition + ', actual: ' + expectedMatchPosition); + this.raiseError('verifyMatchingBracePosition failed - expected: ' + actualMatchPosition + ', actual: ' + expectedMatchPosition); } } @@ -1494,7 +1800,7 @@ module FourSlash { var actual = this.languageService.getBraceMatchingAtPosition(this.activeFile.fileName, bracePosition); if (actual.length !== 0) { - throw new Error('verifyNoMatchingBracePosition failed - expected: 0 spans, actual: ' + actual.length); + this.raiseError('verifyNoMatchingBracePosition failed - expected: 0 spans, actual: ' + actual.length); } } @@ -1518,7 +1824,7 @@ module FourSlash { } for (i = 0; i < positions.length; i++) { - var nameOf = (type: ts.TypeInfo) => type ? type.fullSymbolName : '(none)'; + var nameOf = (type: ts.QuickInfo) => type ? ts.displayPartsToString(type.displayParts) : '(none)'; var pullName: string, refName: string; var anyFailed = false; @@ -1526,7 +1832,7 @@ module FourSlash { var errMsg = ''; try { - var pullType = this.languageService.getTypeAtPosition(this.activeFile.fileName, positions[i]); + var pullType = this.languageService.getQuickInfoAtPosition(this.activeFile.fileName, positions[i]); pullName = nameOf(pullType); } catch (err1) { errMsg = 'Failed to get pull type check. Exception: ' + err1 + '\r\n'; @@ -1536,7 +1842,7 @@ module FourSlash { } try { - var referenceType = referenceLanguageService.getTypeAtPosition(this.activeFile.fileName, positions[i]); + var referenceType = referenceLanguageService.getQuickInfoAtPosition(this.activeFile.fileName, positions[i]); refName = nameOf(referenceType); } catch (err2) { errMsg = 'Failed to get full type check. Exception: ' + err2 + '\r\n'; @@ -1581,7 +1887,7 @@ module FourSlash { } if (expected != actual) { - throw new Error('verifyNavigationItemsCount failed - found: ' + actual + ' navigation items, expected: ' + expected + '.'); + this.raiseError('verifyNavigationItemsCount failed - found: ' + actual + ' navigation items, expected: ' + expected + '.'); } } @@ -1601,7 +1907,7 @@ module FourSlash { var items = this.languageService.getNavigateToItems(searchValue); if (!items || items.length === 0) { - throw new Error('verifyNavigationItemsListContains failed - found 0 navigation items, expected at least one.'); + this.raiseError('verifyNavigationItemsListContains failed - found 0 navigation items, expected at least one.'); } for (var i = 0; i < items.length; i++) { @@ -1617,7 +1923,7 @@ module FourSlash { // if there was an explicit match kind specified, then it should be validated. if (matchKind !== undefined) { var missingItem = { name: name, kind: kind, searchValue: searchValue, matchKind: matchKind, fileName: fileName, parentName: parentName }; - throw new Error('verifyNavigationItemsListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(items) + ')'); + this.raiseError('verifyNavigationItemsListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(items) + ')'); } } @@ -1628,7 +1934,7 @@ module FourSlash { var actual = this.getNavigationBarItemsCount(items); if (expected != actual) { - throw new Error('verifyGetScriptLexicalStructureListCount failed - found: ' + actual + ' navigation items, expected: ' + expected + '.'); + this.raiseError('verifyGetScriptLexicalStructureListCount failed - found: ' + actual + ' navigation items, expected: ' + expected + '.'); } } @@ -1653,7 +1959,7 @@ module FourSlash { var items = this.languageService.getNavigationBarItems(this.activeFile.fileName); if (!items || items.length === 0) { - throw new Error('verifyGetScriptLexicalStructureListContains failed - found 0 navigation items, expected at least one.'); + this.raiseError('verifyGetScriptLexicalStructureListContains failed - found 0 navigation items, expected at least one.'); } if (this.navigationBarItemsContains(items, name, kind)) { @@ -1661,7 +1967,7 @@ module FourSlash { } var missingItem = { name: name, kind: kind }; - throw new Error('verifyGetScriptLexicalStructureListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(items) + ')'); + this.raiseError('verifyGetScriptLexicalStructureListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(items) + ')'); } private navigationBarItemsContains(items: ts.NavigationBarItem[], name: string, kind: string) { @@ -1715,21 +2021,21 @@ module FourSlash { var occurances = this.getOccurancesAtCurrentPosition(); if (!occurances || occurances.length === 0) { - throw new Error('verifyOccurancesAtPositionListContains failed - found 0 references, expected at least one.'); + this.raiseError('verifyOccurancesAtPositionListContains failed - found 0 references, expected at least one.'); } for (var i = 0; i < occurances.length; i++) { var occurance = occurances[i]; if (occurance && occurance.fileName === fileName && occurance.textSpan.start() === start && occurance.textSpan.end() === end) { if (typeof isWriteAccess !== "undefined" && occurance.isWriteAccess !== isWriteAccess) { - throw new Error('verifyOccurancesAtPositionListContains failed - item isWriteAccess value doe not match, actual: ' + occurance.isWriteAccess + ', expected: ' + isWriteAccess + '.'); + this.raiseError('verifyOccurancesAtPositionListContains failed - item isWriteAccess value doe not match, actual: ' + occurance.isWriteAccess + ', expected: ' + isWriteAccess + '.'); } return; } } var missingItem = { fileName: fileName, start: start, end: end, isWriteAccess: isWriteAccess }; - throw new Error('verifyOccurancesAtPositionListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(occurances) + ')'); + this.raiseError('verifyOccurancesAtPositionListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(occurances) + ')'); } public verifyOccurrencesAtPositionListCount(expectedCount: number) { @@ -1738,14 +2044,10 @@ module FourSlash { var occurances = this.getOccurancesAtCurrentPosition(); var actualCount = occurances ? occurances.length : 0; if (expectedCount !== actualCount) { - throw new Error('verifyOccurrencesAtPositionListCount failed - actual: ' + actualCount + ', expected:' + expectedCount); + this.raiseError('verifyOccurrencesAtPositionListCount failed - actual: ' + actualCount + ', expected:' + expectedCount); } } - private getEOF(): number { - return this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getLength(); - } - // Get the text of the entire line the caret is currently at private getCurrentLineContent() { // The current caret position (in line/col terms) @@ -1762,7 +2064,8 @@ module FourSlash { var newlinePos = text.indexOf('\n'); if (newlinePos === -1) { return text; - } else { + } + else { if (text.charAt(newlinePos - 1) === '\r') { newlinePos--; } @@ -1788,33 +2091,30 @@ module FourSlash { return result; } - private assertItemInCompletionList(items: ts.CompletionEntry[], name: string, type?: string, docComment?: string, fullSymbolName?: string, kind?: string) { + private assertItemInCompletionList(items: ts.CompletionEntry[], name: string, text?: string, documentation?: string, kind?: string) { this.scenarioActions.push(''); this.scenarioActions.push(''); - if (type || docComment || fullSymbolName || kind) { + if (text || documentation || kind) { this.taoInvalidReason = 'assertItemInCompletionList only supports the "name" parameter'; } for (var i = 0; i < items.length; i++) { var item = items[i]; - if (item.name == name) { - if (docComment != undefined || type !== undefined || fullSymbolName !== undefined) { + if (item.name === name) { + if (documentation != undefined || text !== undefined) { var details = this.getCompletionEntryDetails(item.name); - if (docComment != undefined) { - assert.equal(details.docComment, docComment); + if (documentation !== undefined) { + assert.equal(ts.displayPartsToString(details.documentation), documentation, assertionMessage("completion item documentation")); } - if (type !== undefined) { - assert.equal(details.type, type); - } - if (fullSymbolName !== undefined) { - assert.equal(details.fullSymbolName, fullSymbolName); + if (text !== undefined) { + assert.equal(ts.displayPartsToString(details.displayParts), text, assertionMessage("completion item detail text")); } } if (kind !== undefined) { - assert.equal(item.kind, kind); + assert.equal(item.kind, kind, assertionMessage("completion item kind")); } return; @@ -1823,7 +2123,7 @@ module FourSlash { var itemsString = items.map((item) => JSON.stringify({ name: item.name, kind: item.kind })).join(",\n"); - throw new Error("Marker: " + currentTestState.lastKnownMarker + "\n" + 'Expected "' + JSON.stringify({ name: name, type: type, docComment: docComment, fullSymbolName: fullSymbolName, kind: kind }) + '" to be in list [' + itemsString + ']'); + this.raiseError('Expected "' + JSON.stringify({ name: name, text: text, documentation: documentation, kind: kind }) + '" to be in list [' + itemsString + ']'); } private findFile(indexOrName: any) { @@ -1863,16 +2163,8 @@ module FourSlash { return result; } - private getCurrentLineNumberZeroBased() { - return this.getCurrentLineNumberOneBased() - 1; - } - - private getCurrentLineNumberOneBased() { - return this.languageServiceShimHost.positionToZeroBasedLineCol(this.activeFile.fileName, this.currentCaretPosition).line + 1; - } - - private getLineColStringAtCaret() { - var pos = this.languageServiceShimHost.positionToZeroBasedLineCol(this.activeFile.fileName, this.currentCaretPosition); + private getLineColStringAtPosition(position: number) { + var pos = this.languageServiceShimHost.positionToZeroBasedLineCol(this.activeFile.fileName, position); return 'line ' + (pos.line + 1) + ', col ' + pos.character; } @@ -1910,9 +2202,6 @@ module FourSlash { xmlData.push(xml); } - // Cache these between executions so we don't have to re-parse them for every test - var fourslashSourceFile: ts.SourceFile = undefined; - export function runFourSlashTestContent(content: string, fileName: string): TestXmlData { // Parse out the files and their metadata var testData = parseTestData(content, fileName); @@ -1920,21 +2209,17 @@ module FourSlash { currentTestState = new TestState(testData); var result = ''; - var fourslashFilename = 'fourslash.ts'; - var tsFn = 'tests/cases/fourslash/' + fourslashFilename; - fourslashSourceFile = fourslashSourceFile || ts.createSourceFile(tsFn, Harness.IO.readFile(tsFn), ts.ScriptTarget.ES5, /*version*/ "0", /*isOpen*/ false); - - var files: { [filename: string]: ts.SourceFile; } = {}; - files[Harness.Compiler.getCanonicalFileName(fourslashFilename)] = fourslashSourceFile; - files[Harness.Compiler.getCanonicalFileName(fileName)] = ts.createSourceFile(fileName, content, ts.ScriptTarget.ES5, /*version*/ "0", /*isOpen*/ false); - files[Harness.Compiler.getCanonicalFileName(Harness.Compiler.defaultLibFileName)] = Harness.Compiler.defaultLibSourceFile; - - var host = Harness.Compiler.createCompilerHost(files, (fn, contents) => result = contents); - var program = ts.createProgram([fourslashFilename, fileName], { out: "fourslashTestOutput.js" }, host); + var host = Harness.Compiler.createCompilerHost([{ unitName: Harness.Compiler.fourslashFilename, content: undefined }, + { unitName: fileName, content: content }], + (fn, contents) => result = contents, + ts.ScriptTarget.Latest, + sys.useCaseSensitiveFileNames); + // TODO (drosen): We need to enforce checking on these tests. + var program = ts.createProgram([Harness.Compiler.fourslashFilename, fileName], { out: "fourslashTestOutput.js", noResolve: true }, host); var checker = ts.createTypeChecker(program, /*fullTypeCheckMode*/ true); checker.checkProgram(); - var errs = checker.getDiagnostics(files[fileName]); + var errs = program.getDiagnostics().concat(checker.getDiagnostics()); if (errs.length > 0) { throw new Error('Error compiling ' + fileName + ': ' + errs.map(e => e.messageText).join('\r\n')); } @@ -1972,7 +2257,7 @@ module FourSlash { // List of all the subfiles we've parsed out var files: FourSlashFile[] = []; // Global options - var opts: { [s: string]: string; } = {}; + var globalOptions: { [s: string]: string; } = {}; // Marker positions // Split up the input file by line @@ -1980,7 +2265,7 @@ module FourSlash { // we have to string-based splitting instead and try to figure out the delimiting chars var lines = contents.split('\n'); - var markerMap: MarkerMap = {}; + var markerPositions: MarkerMap = {}; var markers: Marker[] = []; var ranges: Range[] = []; @@ -2013,15 +2298,15 @@ module FourSlash { // Comment line, check for global/file @options and record them var match = optionRegex.exec(line.substr(2)); if (match) { - var globalNameIndex = globalMetadataNames.indexOf(match[1]); - var fileNameIndex = fileMetadataNames.indexOf(match[1]); - if (globalNameIndex === -1) { - if (fileNameIndex === -1) { + var globalMetadataNamesIndex = globalMetadataNames.indexOf(match[1]); + var fileMetadataNamesIndex = fileMetadataNames.indexOf(match[1]); + if (globalMetadataNamesIndex === -1) { + if (fileMetadataNamesIndex === -1) { throw new Error('Unrecognized metadata name "' + match[1] + '". Available global metadata names are: ' + globalMetadataNames.join(', ') + '; file metadata names are: ' + fileMetadataNames.join(', ')); - } else { + } else if (fileMetadataNamesIndex === fileMetadataNames.indexOf(testOptMetadataNames.filename)) { // Found an @Filename directive, if this is not the first then create a new subfile if (currentFileContent) { - var file = parseFileContent(currentFileContent, currentFileName, markerMap, markers, ranges); + var file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges); file.fileOptions = currentFileOptions; // Store result file @@ -2035,9 +2320,16 @@ module FourSlash { currentFileName = 'tests/cases/fourslash/' + match[2]; currentFileOptions[match[1]] = match[2]; + } else { + // Add other fileMetadata flag + currentFileOptions[match[1]] = match[2]; } } else { - opts[match[1]] = match[2]; + // Check if the match is already existed in the global options + if (globalOptions[match[1]] !== undefined) { + throw new Error("Global Option : '" + match[1] + "' is already existed"); + } + globalOptions[match[1]] = match[2]; } } } else if (line == '' || lineLength === 0) { @@ -2046,7 +2338,7 @@ module FourSlash { } else { // Empty line or code line, terminate current subfile if there is one if (currentFileContent) { - var file = parseFileContent(currentFileContent, currentFileName, markerMap, markers, ranges); + var file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges); file.fileOptions = currentFileOptions; // Store result file @@ -2061,15 +2353,15 @@ module FourSlash { } return { - markerPositions: markerMap, - markers: markers, - globalOptions: opts, - files: files, - ranges: ranges + markerPositions, + markers, + globalOptions, + files, + ranges }; } - enum State { + const enum State { none, inSlashStarMarker, inObjectMarker @@ -2146,7 +2438,7 @@ module FourSlash { /// A list of ranges we've collected so far */ var localRanges: Range[] = []; - /// The latest position of the start of an unflushed plaintext area + /// The latest position of the start of an unflushed plain text area var lastNormalCharPosition: number = 0; /// The total number of metacharacters removed from the file (so far) diff --git a/src/harness/fourslashRunner.ts b/src/harness/fourslashRunner.ts index 102d4433b10..b7e59437456 100644 --- a/src/harness/fourslashRunner.ts +++ b/src/harness/fourslashRunner.ts @@ -20,7 +20,7 @@ class FourslashRunner extends RunnerBase { }); this.tests.forEach((fn: string) => { - fn = Harness.Path.switchToForwardSlashes(fn); + fn = ts.normalizeSlashes(fn); var justName = fn.replace(/^.*[\\\/]/, ''); // Convert to relative path diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 654f240b4b5..1a5938d2be0 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -15,6 +15,7 @@ /// /// +/// /// /// /// @@ -30,7 +31,7 @@ module Utils { var global = Function("return this").call(null); // Setup some globals based on the current environment - export enum ExecutionEnvironment { + export const enum ExecutionEnvironment { Node, Browser, CScript @@ -117,15 +118,11 @@ module Harness.Path { } export function filePath(fullPath: string) { - fullPath = switchToForwardSlashes(fullPath); + fullPath = ts.normalizeSlashes(fullPath); var components = fullPath.split("/"); var path: string[] = components.slice(0, components.length - 1); return path.join("/") + "/"; } - - export function switchToForwardSlashes(path: string) { - return path.replace(/\\/g, "/").replace(/\/\//g, '/'); - } } module Harness { @@ -139,6 +136,7 @@ module Harness { deleteFile(filename: string): void; listFiles(path: string, filter: RegExp, options?: { recursive?: boolean }): string[]; log(text: string): void; + getMemoryUsage? (): number; } module IOImpl { @@ -275,6 +273,13 @@ module Harness { return filesInFolder(path); } + + export var getMemoryUsage: typeof IO.getMemoryUsage = () => { + if (global.gc) { + global.gc(); + } + return process.memoryUsage().heapUsed; + } } export module Network { @@ -532,32 +537,61 @@ module Harness { } export var defaultLibFileName = 'lib.d.ts'; - export var defaultLibSourceFile = ts.createSourceFile(defaultLibFileName, IO.readFile(libFolder + 'lib.core.d.ts'), /*languageVersion*/ ts.ScriptTarget.ES5, /*version:*/ "0"); + export var defaultLibSourceFile = ts.createSourceFile(defaultLibFileName, IO.readFile(libFolder + 'lib.core.d.ts'), /*languageVersion*/ ts.ScriptTarget.Latest, /*version:*/ "0"); + + // Cache these between executions so we don't have to re-parse them for every test + export var fourslashFilename = 'fourslash.ts'; + export var fourslashSourceFile: ts.SourceFile; export function getCanonicalFileName(fileName: string): string { return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } - export function createCompilerHost(filemap: { [filename: string]: ts.SourceFile; }, writeFile: (fn: string, contents: string, writeByteOrderMark:boolean) => void): ts.CompilerHost { + export function createCompilerHost(inputFiles: { unitName: string; content: string; }[], + writeFile: (fn: string, contents: string, writeByteOrderMark: boolean) => void, + scriptTarget: ts.ScriptTarget, + useCaseSensitiveFileNames: boolean): ts.CompilerHost { + + // Local get canonical file name function, that depends on passed in parameter for useCaseSensitiveFileNames + function getCanonicalFileName(fileName: string): string { + return useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); + } + + var filemap: { [filename: string]: ts.SourceFile; } = {}; + // Register input files + function register(file: { unitName: string; content: string; }) { + if (file.content !== undefined) { + var filename = ts.normalizeSlashes(file.unitName); + filemap[getCanonicalFileName(filename)] = ts.createSourceFile(filename, file.content, scriptTarget, /*version:*/ "0"); + } + }; + inputFiles.forEach(register); + return { getCurrentDirectory: sys.getCurrentDirectory, getCancellationToken: (): any => undefined, getSourceFile: (fn, languageVersion) => { if (Object.prototype.hasOwnProperty.call(filemap, getCanonicalFileName(fn))) { return filemap[getCanonicalFileName(fn)]; - } else { + } + else if (fn === fourslashFilename) { + var tsFn = 'tests/cases/fourslash/' + fourslashFilename; + fourslashSourceFile = fourslashSourceFile || ts.createSourceFile(tsFn, Harness.IO.readFile(tsFn), scriptTarget, /*version*/ "0", /*isOpen*/ false); + return fourslashSourceFile; + } + else { var lib = defaultLibFileName; if (fn === defaultLibFileName) { return defaultLibSourceFile; } // Don't throw here -- the compiler might be looking for a test that actually doesn't exist as part of the TC - return null; + return undefined; } }, getDefaultLibFilename: () => defaultLibFileName, - writeFile: writeFile, - getCanonicalFileName: getCanonicalFileName, - useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, + writeFile, + getCanonicalFileName, + useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, getNewLine: ()=> sys.newLine }; } @@ -614,7 +648,7 @@ module Harness { } public compileFiles(inputFiles: { unitName: string; content: string }[], - otherFiles: { unitName: string; content?: string }[], + otherFiles: { unitName: string; content: string }[], onComplete: (result: CompilerResult, checker: ts.TypeChecker) => void, settingsCallback?: (settings: ts.CompilerOptions) => void, options?: ts.CompilerOptions) { @@ -622,14 +656,16 @@ module Harness { options = options || { noResolve: false }; options.target = options.target || ts.ScriptTarget.ES3; options.module = options.module || ts.ModuleKind.None; + options.noErrorTruncation = true; if (settingsCallback) { settingsCallback(null); } + var useCaseSensitiveFileNames = sys.useCaseSensitiveFileNames; this.settings.forEach(setting => { switch (setting.flag.toLowerCase()) { - // "filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outDir", "noimplicitany", "noresolve" + // "filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noimplicitany", "noresolve" case "module": case "modulegentarget": if (typeof setting.value === 'string') { @@ -654,6 +690,8 @@ module Harness { options.target = ts.ScriptTarget.ES3; } else if (setting.value.toLowerCase() === 'es5') { options.target = ts.ScriptTarget.ES5; + } else if (setting.value.toLowerCase() === 'es6') { + options.target = ts.ScriptTarget.ES6; } else { throw new Error('Unknown compile target ' + setting.value); } @@ -662,6 +700,10 @@ module Harness { } break; + case 'noemitonerror': + options.noEmitOnError = !!setting.value; + break; + case 'noresolve': options.noResolve = !!setting.value; break; @@ -705,15 +747,17 @@ module Harness { options.removeComments = setting.value === 'false'; break; + case 'usecasesensitivefilenames': + useCaseSensitiveFileNames = setting.value === 'true'; + break; + case 'mapsourcefiles': case 'maproot': case 'generatedeclarationfiles': - case 'usecasesensitivefileresolution': case 'gatherDiagnostics': case 'codepage': case 'createFileLog': case 'filename': - case 'propagateenumconstants': case 'removecomments': case 'watch': case 'allowautomaticsemicoloninsertion': @@ -725,6 +769,12 @@ module Harness { options.emitBOM = !!setting.value; break; + case 'errortruncation': + options.noErrorTruncation = setting.value === 'false'; + break; + case 'preserveconstenums': + options.preserveConstEnums = setting.value === 'true'; + break; default: throw new Error('Unsupported compiler setting ' + setting.flag); } @@ -733,7 +783,7 @@ module Harness { var filemap: { [name: string]: ts.SourceFile; } = {}; var register = (file: { unitName: string; content: string; }) => { if (file.content !== undefined) { - var filename = Path.switchToForwardSlashes(file.unitName); + var filename = ts.normalizeSlashes(file.unitName); filemap[getCanonicalFileName(filename)] = ts.createSourceFile(filename, file.content, options.target, /*version:*/ "0"); } }; @@ -743,35 +793,104 @@ module Harness { var fileOutputs: GeneratedFile[] = []; var programFiles = inputFiles.map(file => file.unitName); - var program = ts.createProgram(programFiles, options, createCompilerHost(filemap, (fn, contents, writeByteOrderMark) => fileOutputs.push({ fileName: fn, code: contents, writeByteOrderMark: writeByteOrderMark }))); - - var hadParseErrors = program.getDiagnostics().length > 0; + var program = ts.createProgram(programFiles, options, createCompilerHost(inputFiles.concat(otherFiles), + (fn, contents, writeByteOrderMark) => fileOutputs.push({ fileName: fn, code: contents, writeByteOrderMark: writeByteOrderMark }), + options.target, + useCaseSensitiveFileNames)); var checker = program.getTypeChecker(/*fullTypeCheckMode*/ true); checker.checkProgram(); + var isEmitBlocked = checker.isEmitBlocked(); + // only emit if there weren't parse errors var emitResult: ts.EmitResult; - if (!hadParseErrors) { + if (!isEmitBlocked) { emitResult = checker.emitFiles(); } var errors: HarnessDiagnostic[] = []; - program.getDiagnostics().concat(checker.getDiagnostics()).concat(emitResult ? emitResult.errors : []).forEach(err => { + program.getDiagnostics().concat(checker.getDiagnostics()).concat(emitResult ? emitResult.diagnostics : []).forEach(err => { // TODO: new compiler formats errors after this point to add . and newlines so we'll just do it manually for now errors.push(getMinimalDiagnostic(err)); }); this.lastErrors = errors; - var result = new CompilerResult(fileOutputs, errors, []); - // Covert the source Map data into the baseline - result.updateSourceMapRecord(program, emitResult ? emitResult.sourceMaps : undefined); + var result = new CompilerResult(fileOutputs, errors, program, sys.getCurrentDirectory(), emitResult ? emitResult.sourceMaps : undefined); onComplete(result, checker); // reset what newline means in case the last test changed it sys.newLine = '\r\n'; return options; } + + public compileDeclarationFiles(inputFiles: { unitName: string; content: string; }[], + otherFiles: { unitName: string; content: string; }[], + result: CompilerResult, + settingsCallback?: (settings: ts.CompilerOptions) => void, + options?: ts.CompilerOptions) { + if (options.declaration && result.errors.length === 0 && result.declFilesCode.length !== result.files.length) { + throw new Error('There were no errors and declFiles generated did not match number of js files generated'); + } + + // if the .d.ts is non-empty, confirm it compiles correctly as well + if (options.declaration && result.errors.length === 0 && result.declFilesCode.length > 0) { + var declInputFiles: { unitName: string; content: string }[] = []; + var declOtherFiles: { unitName: string; content: string }[] = []; + var declResult: Harness.Compiler.CompilerResult; + + ts.forEach(inputFiles, file => addDtsFile(file, declInputFiles)); + ts.forEach(otherFiles, file => addDtsFile(file, declOtherFiles)); + this.compileFiles(declInputFiles, declOtherFiles, function (compileResult) { + declResult = compileResult; + }, settingsCallback, options); + + return { declInputFiles, declOtherFiles, declResult }; + } + + function addDtsFile(file: { unitName: string; content: string }, dtsFiles: { unitName: string; content: string }[]) { + if (isDTS(file.unitName)) { + dtsFiles.push(file); + } + else if (isTS(file.unitName)) { + var declFile = findResultCodeFile(file.unitName); + if (!findUnit(declFile.fileName, declInputFiles) && !findUnit(declFile.fileName, declOtherFiles)) { + dtsFiles.push({ unitName: declFile.fileName, content: declFile.code }); + } + } + + function findResultCodeFile(fileName: string) { + var dTsFileName = ts.forEach(result.program.getSourceFiles(), sourceFile => { + if (sourceFile.filename === fileName) { + // Is this file going to be emitted separately + var sourceFileName: string; + if (ts.isExternalModule(sourceFile) || !options.out) { + if (options.outDir) { + var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.filename, result.currentDirectoryForProgram); + sourceFilePath = sourceFilePath.replace(result.program.getCommonSourceDirectory(), ""); + sourceFileName = ts.combinePaths(options.outDir, sourceFilePath); + } + else { + sourceFileName = sourceFile.filename; + } + } + else { + // Goes to single --out file + sourceFileName = options.out; + } + + return ts.removeFileExtension(sourceFileName) + ".d.ts"; + } + }); + + return ts.forEach(result.declFilesCode, declFile => declFile.fileName === dTsFileName ? declFile : undefined); + } + + function findUnit(fileName: string, units: { unitName: string; content: string; }[]) { + return ts.forEach(units, unit => unit.unitName === fileName ? unit : undefined); + } + } + } } export function getMinimalDiagnostic(err: ts.Diagnostic): HarnessDiagnostic { @@ -802,9 +921,7 @@ module Harness { return errorOutput; } - export function getErrorBaseline(inputFiles: { unitName: string; content: string }[], - diagnostics: HarnessDiagnostic[] - ) { + export function getErrorBaseline(inputFiles: { unitName: string; content: string }[], diagnostics: HarnessDiagnostic[]) { var outputLines: string[] = []; // Count up all the errors we find so we don't miss any @@ -815,13 +932,13 @@ module Harness { .split('\n') .map(s => s.length > 0 && s.charAt(s.length - 1) === '\r' ? s.substr(0, s.length - 1) : s) .filter(s => s.length > 0) - .map(s => '!!! ' + s); + .map(s => '!!! ' + error.category + " TS" + error.code + ": " + s); errLines.forEach(e => outputLines.push(e)); totalErrorsReported++; } - // Report glovbal errors: + // Report global errors var globalErrors = diagnostics.filter(err => !err.filename); globalErrors.forEach(err => outputErrorText(err)); @@ -843,7 +960,7 @@ module Harness { // Note: IE JS engine incorrectly handles consecutive delimiters here when using RegExp split, so // we have to string-based splitting instead and try to figure out the delimiting chars - var lineStarts = ts.getLineStarts(inputFile.content); + var lineStarts = ts.computeLineStarts(inputFile.content); var lines = inputFile.content.split('\n'); lines.forEach((line, lineIndex) => { if (line.length > 0 && line.charAt(line.length - 1) === '\r') { @@ -888,10 +1005,15 @@ module Harness { assert.equal(markedErrorCount, fileErrors.length, 'count of errors in ' + inputFile.unitName); }); - // Verify we didn't miss any errors in total - assert.equal(totalErrorsReported, diagnostics.length, 'total number of errors'); + var numLibraryDiagnostics = ts.countWhere(diagnostics, diagnostic => { + return diagnostic.filename && isLibraryFile(diagnostic.filename); + }); - return outputLines.join('\r\n'); + // Verify we didn't miss any errors in total + assert.equal(totalErrorsReported + numLibraryDiagnostics, diagnostics.length, 'total number of errors'); + + return minimalDiagnosticsToString(diagnostics) + + sys.newLine + sys.newLine + outputLines.join('\r\n'); } /* TODO: Delete? @@ -908,11 +1030,7 @@ module Harness { } */ - /** Recreate the harness compiler instance to its default settings */ - export function recreate(options?: { useMinimalDefaultLib: boolean; noImplicitAny: boolean; }) { - } - - /** The harness' compiler instance used when tests are actually run. Reseting or changing settings of this compiler instance must be done within a testcase (i.e., describe/it) */ + /** The harness' compiler instance used when tests are actually run. Reseting or changing settings of this compiler instance must be done within a test case (i.e., describe/it) */ var harnessCompiler: HarnessCompiler; /** Returns the singleton harness compiler instance for generating and running tests. @@ -951,6 +1069,10 @@ module Harness { return str.substr(str.length - end.length) === end; } + export function isTS(fileName: string) { + return stringEndsWith(fileName, '.ts'); + } + export function isDTS(fileName: string) { return stringEndsWith(fileName, '.d.ts'); } @@ -969,11 +1091,10 @@ module Harness { public errors: HarnessDiagnostic[] = []; public declFilesCode: GeneratedFile[] = []; public sourceMaps: GeneratedFile[] = []; - public sourceMapRecord: string; /** @param fileResults an array of strings for the fileName and an ITextWriter with its code */ - constructor(fileResults: GeneratedFile[], errors: HarnessDiagnostic[], sourceMapRecordLines: string[]) { - var lines: string[] = []; + constructor(fileResults: GeneratedFile[], errors: HarnessDiagnostic[], public program: ts.Program, + public currentDirectoryForProgram: string, private sourceMapData: ts.SourceMapData[]) { fileResults.forEach(emittedFile => { if (isDTS(emittedFile.fileName)) { @@ -990,12 +1111,11 @@ module Harness { }); this.errors = errors; - this.sourceMapRecord = sourceMapRecordLines.join('\r\n'); } - public updateSourceMapRecord(program: ts.Program, sourceMapData: ts.SourceMapData[]) { - if (sourceMapData) { - this.sourceMapRecord = Harness.SourceMapRecoder.getSourceMapRecord(sourceMapData, program, this.files); + public getSourceMapRecord() { + if (this.sourceMapData) { + return Harness.SourceMapRecoder.getSourceMapRecord(this.sourceMapData, this.program, this.files); } } @@ -1011,7 +1131,7 @@ module Harness { } export module TestCaseParser { - /** all the necesarry information to set the right compiler settings */ + /** all the necessary information to set the right compiler settings */ export interface CompilerSetting { flag: string; value: string; @@ -1030,7 +1150,7 @@ module Harness { var optionRegex = /^[\/]{2}\s*@(\w+)\s*:\s*(\S*)/gm; // multiple matches on multiple lines // List of allowed metadata names - var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outDir", "noimplicitany", "noresolve", "newline", "newlines", "emitbom"]; + var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noemitonerror","noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames", "preserveconstenums"]; function extractCompilerSettings(content: string): CompilerSetting[] { @@ -1049,7 +1169,7 @@ module Harness { var settings = extractCompilerSettings(code); // List of all the subfiles we've parsed out - var files: TestUnitData[] = []; + var testUnitData: TestUnitData[] = []; var lines = Utils.splitContentByNewlines(code); @@ -1085,7 +1205,7 @@ module Harness { originalFilePath: fileName, references: refs }; - files.push(newTestFile); + testUnitData.push(newTestFile); // Reset local data currentFileContent = null; @@ -1110,7 +1230,7 @@ module Harness { } // normalize the fileName for the single file case - currentFileName = files.length > 0 ? currentFileName : Path.getFileName(fileName); + currentFileName = testUnitData.length > 0 ? currentFileName : Path.getFileName(fileName); // EOF, push whatever remains var newTestFile2 = { @@ -1120,15 +1240,14 @@ module Harness { originalFilePath: fileName, references: refs }; - files.push(newTestFile2); + testUnitData.push(newTestFile2); - return { settings: settings, testUnitData: files }; + return { settings, testUnitData }; } } /** Support class for baseline files */ export module Baseline { - var firstRun = true; export interface BaselineOptions { LineEndingSensitive?: boolean; @@ -1169,8 +1288,7 @@ module Harness { IO.createDirectory(dirName); fileCache[dirName] = true; } - var parentDir = IO.directoryName(actualFilename); // .../tests/baselines/local - var parentParentDir = IO.directoryName(IO.directoryName(actualFilename)) // .../tests/baselines + // Create folders if needed createDirectoryStructure(Harness.IO.directoryName(actualFilename)); @@ -1220,7 +1338,7 @@ module Harness { actual = actual.replace(/\r\n?/g, '\n'); } - return { expected: expected, actual: actual }; + return { expected, actual }; } function writeComparison(expected: string, actual: string, relativeFilename: string, actualFilename: string, descriptionForDescribe: string) { diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 1a02157d729..d3082a17ba2 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -4,8 +4,8 @@ module Harness.LanguageService { export class ScriptInfo { public version: number = 1; - public editRanges: { length: number; textChangeRange: TypeScript.TextChangeRange; }[] = []; - public lineMap: TypeScript.LineMap = null; + public editRanges: { length: number; textChangeRange: ts.TextChangeRange; }[] = []; + public lineMap: number[] = null; constructor(public fileName: string, public content: string, public isOpen = true) { this.setContent(content); @@ -13,7 +13,7 @@ module Harness.LanguageService { private setContent(content: string): void { this.content = content; - this.lineMap = TypeScript.LineMap1.fromString(content); + this.lineMap = ts.computeLineStarts(content); } public updateContent(content: string): void { @@ -32,30 +32,30 @@ module Harness.LanguageService { // Store edit range + new length of script this.editRanges.push({ length: this.content.length, - textChangeRange: new TypeScript.TextChangeRange( - TypeScript.TextSpan.fromBounds(minChar, limChar), newText.length) + textChangeRange: new ts.TextChangeRange( + ts.TextSpan.fromBounds(minChar, limChar), newText.length) }); // Update version # this.version++; } - public getTextChangeRangeBetweenVersions(startVersion: number, endVersion: number): TypeScript.TextChangeRange { + public getTextChangeRangeBetweenVersions(startVersion: number, endVersion: number): ts.TextChangeRange { if (startVersion === endVersion) { // No edits! - return TypeScript.TextChangeRange.unchanged; + return ts.TextChangeRange.unchanged; } var initialEditRangeIndex = this.editRanges.length - (this.version - startVersion); var lastEditRangeIndex = this.editRanges.length - (this.version - endVersion); var entries = this.editRanges.slice(initialEditRangeIndex, lastEditRangeIndex); - return TypeScript.TextChangeRange.collapseChangesAcrossMultipleVersions(entries.map(e => e.textChangeRange)); + return ts.TextChangeRange.collapseChangesAcrossMultipleVersions(entries.map(e => e.textChangeRange)); } } class ScriptSnapshotShim implements ts.ScriptSnapshotShim { - private lineMap: TypeScript.LineMap = null; + private lineMap: number[] = null; private textSnapshot: string; private version: number; @@ -74,10 +74,10 @@ module Harness.LanguageService { public getLineStartPositions(): string { if (this.lineMap === null) { - this.lineMap = TypeScript.LineMap1.fromString(this.textSnapshot); + this.lineMap = ts.computeLineStarts(this.textSnapshot); } - return JSON.stringify(this.lineMap.lineStarts()); + return JSON.stringify(this.lineMap); } public getChangeRange(oldScript: ts.ScriptSnapshotShim): string { @@ -108,7 +108,7 @@ module Harness.LanguageService { public acquireDocument( fileName: string, compilationSettings: ts.CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: ts.IScriptSnapshot, version: string, isOpen: boolean): ts.SourceFile { return ts.createSourceFile(fileName, scriptSnapshot.getText(0, scriptSnapshot.getLength()), compilationSettings.target, version, isOpen); @@ -118,10 +118,10 @@ module Harness.LanguageService { document: ts.SourceFile, fileName: string, compilationSettings: ts.CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: ts.IScriptSnapshot, version: string, isOpen: boolean, - textChangeRange: TypeScript.TextChangeRange + textChangeRange: ts.TextChangeRange ): ts.SourceFile { return document.update(scriptSnapshot, version, isOpen, textChangeRange); } @@ -134,6 +134,7 @@ module Harness.LanguageService { private ls: ts.LanguageServiceShim = null; private fileNameToScript: ts.Map = {}; + private settings: ts.CompilationSettings = {}; constructor(private cancellationToken: ts.CancellationToken = CancellationToken.None) { } @@ -199,13 +200,21 @@ module Harness.LanguageService { /// Returns json for Tools.CompilationSettings public getCompilationSettings(): string { - return JSON.stringify({}); // i.e. default settings + return JSON.stringify(this.settings); } public getCancellationToken(): ts.CancellationToken { return this.cancellationToken; } + public getCurrentDirectory(): string { + return ""; + } + + public getDefaultLibFilename(): string { + return ""; + } + public getScriptFileNames(): string { var fileNames: string[] = []; ts.forEachKey(this.fileNameToScript, (fileName) => { fileNames.push(fileName); }); @@ -236,19 +245,31 @@ module Harness.LanguageService { return this.ls; } + public setCompilationSettings(settings: ts.CompilationSettings) { + for (var key in settings) { + if (settings.hasOwnProperty(key)) { + this.settings[key] = settings[key]; + } + } + } + /** Return a new instance of the classifier service shim */ public getClassifier(): ts.ClassifierShim { return new TypeScript.Services.TypeScriptServicesFactory().createClassifierShim(this); } + public getCoreService(): ts.CoreServicesShim { + return new TypeScript.Services.TypeScriptServicesFactory().createCoreServicesShim(this); + } + /** Parse file given its source text */ - public parseSourceText(fileName: string, sourceText: TypeScript.IScriptSnapshot): TypeScript.SourceUnitSyntax { - return TypeScript.Parser.parse(fileName, TypeScript.SimpleText.fromScriptSnapshot(sourceText), ts.ScriptTarget.ES5, TypeScript.isDTSFile(fileName)).sourceUnit(); + public parseSourceText(fileName: string, sourceText: ts.IScriptSnapshot): ts.SourceFile { + return ts.createSourceFile(fileName, sourceText.getText(0, sourceText.getLength()), ts.ScriptTarget.Latest, "1", true); } /** Parse a file on disk given its fileName */ public parseFile(fileName: string) { - var sourceText = TypeScript.ScriptSnapshot.fromString(Harness.IO.readFile(fileName)); + var sourceText = ts.ScriptSnapshot.fromString(Harness.IO.readFile(fileName)); return this.parseSourceText(fileName, sourceText); } @@ -262,22 +283,22 @@ module Harness.LanguageService { assert.isTrue(line >= 1); assert.isTrue(col >= 1); - return script.lineMap.getPosition(line - 1, col - 1); + return ts.getPositionFromLineAndCharacter(script.lineMap, line, col); } /** * @param line 0 based index * @param col 0 based index */ - public positionToZeroBasedLineCol(fileName: string, position: number): TypeScript.ILineAndCharacter { + public positionToZeroBasedLineCol(fileName: string, position: number): ts.LineAndCharacter { var script: ScriptInfo = this.fileNameToScript[fileName]; assert.isNotNull(script); - var result = script.lineMap.getLineAndCharacterFromPosition(position); + var result = ts.getLineAndCharacterOfPosition(script.lineMap, position); - assert.isTrue(result.line() >= 0); - assert.isTrue(result.character() >= 0); - return { line: result.line(), character: result.character() }; + assert.isTrue(result.line >= 1); + assert.isTrue(result.character >= 1); + return { line: result.line - 1, character: result.character - 1 }; } /** Verify that applying edits to sourceFileName result in the content of the file baselineFileName */ diff --git a/src/harness/loggedIO.ts b/src/harness/loggedIO.ts index fc33d08b334..c6305c50c10 100644 --- a/src/harness/loggedIO.ts +++ b/src/harness/loggedIO.ts @@ -175,10 +175,10 @@ module Playback { } function findResultByPath(wrapper: { resolvePath(s: string): string }, logArray: { path: string; result?: T }[], expectedPath: string, defaultValue?: T): T { - var normalizedName = Harness.Path.switchToForwardSlashes(expectedPath).toLowerCase(); + var normalizedName = ts.normalizeSlashes(expectedPath).toLowerCase(); // Try to find the result through normal filename for (var i = 0; i < logArray.length; i++) { - if (Harness.Path.switchToForwardSlashes(logArray[i].path).toLowerCase() === normalizedName) { + if (ts.normalizeSlashes(logArray[i].path).toLowerCase() === normalizedName) { return logArray[i].result; } } @@ -203,7 +203,7 @@ module Playback { function pathsAreEquivalent(left: string, right: string, wrapper: { resolvePath(s: string): string }) { var key = left + '-~~-' + right; function areSame(a: string, b: string) { - return Harness.Path.switchToForwardSlashes(a).toLowerCase() === Harness.Path.switchToForwardSlashes(b).toLowerCase(); + return ts.normalizeSlashes(a).toLowerCase() === ts.normalizeSlashes(b).toLowerCase(); } function check() { if (Harness.Path.getFileName(left).toLowerCase() === Harness.Path.getFileName(right).toLowerCase()) { diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index b0f3e939d30..4734232d280 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -4,7 +4,7 @@ // Test case is json of below type in tests/cases/project/ interface ProjectRunnerTestCase { scenario: string; - projectRoot: string; // project where it lives - this also is the current dictory when compiling + projectRoot: string; // project where it lives - this also is the current directory when compiling inputFiles: string[]; // list of input files to be given to program out?: string; // --out outDir?: string; // --outDir @@ -17,12 +17,13 @@ interface ProjectRunnerTestCase { baselineCheck?: boolean; // Verify the baselines of output files, if this is false, we will write to output to the disk but there is no verification of baselines runTest?: boolean; // Run the resulting test bug?: string; // If there is any bug associated with this test case + noResolve?: boolean; } interface ProjectRunnerTestCaseResolutionInfo extends ProjectRunnerTestCase { // Apart from actual test case the results of the resolution resolvedInputFiles: string[]; // List of files that were asked to read by compiler - emittedFiles: string[]; // List of files that wre emitted by the compiler + emittedFiles: string[]; // List of files that were emitted by the compiler } interface BatchCompileProjectTestCaseEmittedFile extends Harness.Compiler.GeneratedFile { @@ -69,7 +70,7 @@ class ProjectRunner extends RunnerBase { testCase = JSON.parse(testFileText); } catch (e) { - assert(false, "Testcase: " + testCaseFileName + " doesnt not contain valid json format: " + e.message); + assert(false, "Testcase: " + testCaseFileName + " does not contain valid json format: " + e.message); } var testCaseJustName = testCaseFileName.replace(/^.*[\\\/]/, '').replace(/\.json/, ""); @@ -87,7 +88,7 @@ class ProjectRunner extends RunnerBase { } // When test case output goes to tests/baselines/local/projectOutput/testCaseName/moduleKind/ - // We have these two separate locations because when compairing baselines the baseline verifier will delete the existing file + // We have these two separate locations because when comparing baselines the baseline verifier will delete the existing file // so even if it was created by compiler in that location, the file will be deleted by verified before we can read it // so lets keep these two locations separate function getProjectOutputFolder(filename: string, moduleKind: ts.ModuleKind) { @@ -132,7 +133,7 @@ class ProjectRunner extends RunnerBase { var checker = program.getTypeChecker(/*fullTypeCheck*/ true); errors = checker.getDiagnostics(); var emitResult = checker.emitFiles(); - errors = ts.concatenate(errors, emitResult.errors); + errors = ts.concatenate(errors, emitResult.diagnostics); sourceMapData = emitResult.sourceMaps; // Clean up source map data that will be used in baselining @@ -148,10 +149,10 @@ class ProjectRunner extends RunnerBase { } return { - moduleKind: moduleKind, - program: program, - errors: errors, - sourceMapData: sourceMapData + moduleKind, + program, + errors, + sourceMapData }; function createCompilerOptions(): ts.CompilerOptions { @@ -162,7 +163,8 @@ class ProjectRunner extends RunnerBase { outDir: testCase.outDir, mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? sys.resolvePath(testCase.mapRoot) : testCase.mapRoot, sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? sys.resolvePath(testCase.sourceRoot) : testCase.sourceRoot, - module: moduleKind + module: moduleKind, + noResolve: testCase.noResolve }; } @@ -183,10 +185,10 @@ class ProjectRunner extends RunnerBase { function createCompilerHost(): ts.CompilerHost { return { - getSourceFile: getSourceFile, + getSourceFile, getDefaultLibFilename: () => "lib.d.ts", - writeFile: writeFile, - getCurrentDirectory: getCurrentDirectory, + writeFile, + getCurrentDirectory, getCanonicalFileName: Harness.Compiler.getCanonicalFileName, useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, getNewLine: () => sys.newLine @@ -201,12 +203,12 @@ class ProjectRunner extends RunnerBase { var projectCompilerResult = compileProjectFiles(moduleKind, () => testCase.inputFiles, getSourceFileText, writeFile); return { - moduleKind: moduleKind, + moduleKind, program: projectCompilerResult.program, sourceMapData: projectCompilerResult.sourceMapData, - outputFiles: outputFiles, + outputFiles, errors: projectCompilerResult.errors, - nonSubfolderDiskFiles: nonSubfolderDiskFiles, + nonSubfolderDiskFiles, }; function getSourceFileText(filename: string): string { @@ -226,9 +228,10 @@ class ProjectRunner extends RunnerBase { ? filename : ts.normalizeSlashes(testCase.projectRoot) + "/" + ts.normalizeSlashes(filename); - var diskRelativeName = ts.getRelativePathToDirectoryOrUrl(testCase.projectRoot, diskFileName, getCurrentDirectory(), false); + var diskRelativeName = ts.getRelativePathToDirectoryOrUrl(testCase.projectRoot, diskFileName, + getCurrentDirectory(), Harness.Compiler.getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); if (ts.isRootedDiskPath(diskRelativeName) || diskRelativeName.substr(0, 3) === "../") { - // If the generated output file recides in the parent folder or is rooted path, + // If the generated output file resides in the parent folder or is rooted path, // we need to instead create files that can live in the project reference folder // but make sure extension of these files matches with the filename the compiler asked to write diskRelativeName = "diskFile" + nonSubfolderDiskFiles++ + @@ -271,16 +274,40 @@ class ProjectRunner extends RunnerBase { } function compileCompileDTsFiles(compilerResult: BatchCompileProjectTestCaseResult) { - var inputDtsSourceFiles = ts.map(ts.filter(compilerResult.program.getSourceFiles(), - sourceFile => Harness.Compiler.isDTS(sourceFile.filename)), - sourceFile => { - return { emittedFileName: sourceFile.filename, code: sourceFile.text }; - }); + var allInputFiles: { emittedFileName: string; code: string; }[] = []; + var compilerOptions = compilerResult.program.getCompilerOptions(); + var compilerHost = compilerResult.program.getCompilerHost(); + ts.forEach(compilerResult.program.getSourceFiles(), sourceFile => { + if (Harness.Compiler.isDTS(sourceFile.filename)) { + allInputFiles.unshift({ emittedFileName: sourceFile.filename, code: sourceFile.text }); + } + else if (ts.shouldEmitToOwnFile(sourceFile, compilerResult.program.getCompilerOptions())) { + if (compilerOptions.outDir) { + var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.filename, compilerHost.getCurrentDirectory()); + sourceFilePath = sourceFilePath.replace(compilerResult.program.getCommonSourceDirectory(), ""); + var emitOutputFilePathWithoutExtension = ts.removeFileExtension(ts.combinePaths(compilerOptions.outDir, sourceFilePath)); + } + else { + var emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.filename); + } + + var outputDtsFileName = emitOutputFilePathWithoutExtension + ".d.ts"; + allInputFiles.unshift(findOutpuDtsFile(outputDtsFileName)); + } + else { + var outputDtsFileName = ts.removeFileExtension(compilerOptions.out) + ".d.ts"; + var outputDtsFile = findOutpuDtsFile(outputDtsFileName); + if (!ts.contains(allInputFiles, outputDtsFile)) { + allInputFiles.unshift(outputDtsFile); + } + } + }); - var ouputDtsFiles = ts.filter(compilerResult.outputFiles, ouputFile => Harness.Compiler.isDTS(ouputFile.emittedFileName)); - var allInputFiles = inputDtsSourceFiles.concat(ouputDtsFiles); return compileProjectFiles(compilerResult.moduleKind,getInputFiles, getSourceFileText, writeFile); + function findOutpuDtsFile(fileName: string) { + return ts.forEach(compilerResult.outputFiles, outputFile => outputFile.emittedFileName === fileName ? outputFile : undefined); + } function getInputFiles() { return ts.map(allInputFiles, outputFile => outputFile.emittedFileName); } @@ -299,13 +326,11 @@ class ProjectRunner extends RunnerBase { return { unitName: sourceFile.filename, content: sourceFile.text }; }); var diagnostics = ts.map(compilerResult.errors, error => Harness.Compiler.getMinimalDiagnostic(error)); - var errors = Harness.Compiler.minimalDiagnosticsToString(diagnostics); - errors += sys.newLine + sys.newLine + Harness.Compiler.getErrorBaseline(inputFiles, diagnostics); - return errors; + return Harness.Compiler.getErrorBaseline(inputFiles, diagnostics); } - describe('Compiling project for ' + testCase.scenario +': testcase ' + testCaseFileName, () => { + describe('Compiling project for ' + testCase.scenario + ': testcase ' + testCaseFileName, () => { function verifyCompilerResults(compilerResult: BatchCompileProjectTestCaseResult) { function getCompilerResolutionInfo() { var resolutionInfo: ProjectRunnerTestCaseResolutionInfo = { @@ -420,6 +445,16 @@ class ProjectRunner extends RunnerBase { // }) //}); } + + after(() => { + // Mocha holds onto the closure environment of the describe callback even after the test is done. + // Therefore we have to clean out large objects after the test is done. + nodeCompilerResult = undefined; + amdCompilerResult = undefined; + testCase = undefined; + testFileText = undefined; + testCaseJustName = undefined; + }); }); } } \ No newline at end of file diff --git a/src/harness/runner.ts b/src/harness/runner.ts index 331a19819b3..38e23bb10c5 100644 --- a/src/harness/runner.ts +++ b/src/harness/runner.ts @@ -18,7 +18,6 @@ // /// /// /// -/// function runTests(runners: RunnerBase[]) { if (reverse) { @@ -67,9 +66,6 @@ if (testConfigFile !== '') { case 'fourslash-generated': runners.push(new GeneratedFourslashRunner()); break; - case 'unittests': - runners.push(new UnitTestRunner()); - break; case 'rwc': runners.push(new RWCRunner()); break; @@ -93,9 +89,6 @@ if (runners.length === 0) { // language services runners.push(new FourslashRunner()); //runners.push(new GeneratedFourslashRunner()); - - // unittests - runners.push(new UnitTestRunner()); } sys.newLine = '\r\n'; diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index 93d003bf4db..606672e406f 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -23,7 +23,7 @@ module RWC { function collateOutputs(outputFiles: Harness.Compiler.GeneratedFile[], clean?: (s: string) => string) { // Collect, test, and sort the filenames function cleanName(fn: string) { - var lastSlash = Harness.Path.switchToForwardSlashes(fn).lastIndexOf('/'); + var lastSlash = ts.normalizeSlashes(fn).lastIndexOf('/'); return fn.substr(lastSlash + 1).toLowerCase(); } outputFiles.sort((a, b) => cleanName(a.fileName).localeCompare(cleanName(b.fileName))); @@ -46,146 +46,171 @@ module RWC { } export function runRWCTest(jsonPath: string) { - var harnessCompiler = Harness.Compiler.getCompiler(); - var opts: ts.ParsedCommandLine; + describe("Testing a RWC project: " + jsonPath, () => { + var inputFiles: { unitName: string; content: string; }[] = []; + var otherFiles: { unitName: string; content: string; }[] = []; + var compilerResult: Harness.Compiler.CompilerResult; + var compilerOptions: ts.CompilerOptions; + var baselineOpts: Harness.Baseline.BaselineOptions = { Subfolder: 'rwc' }; + var baseName = /(.*)\/(.*).json/.exec(ts.normalizeSlashes(jsonPath))[2]; + // Compile .d.ts files + var declFileCompilationResult: { + declInputFiles: { unitName: string; content: string }[]; + declOtherFiles: { unitName: string; content: string }[]; + declResult: Harness.Compiler.CompilerResult; + }; - var ioLog: IOLog = JSON.parse(Harness.IO.readFile(jsonPath)); - var errors = ''; - - it('has parsable options', () => { - runWithIOLog(ioLog, () => { - opts = ts.parseCommandLine(ioLog.arguments); - assert.equal(opts.errors.length, 0); - }); - }); - - var inputFiles: { unitName: string; content: string; }[] = []; - var otherFiles: { unitName: string; content: string; }[] = []; - var compilerResult: Harness.Compiler.CompilerResult; - it('can compile', () => { - runWithIOLog(ioLog, () => { - harnessCompiler.reset(); - - // Load the files - ts.forEach(opts.filenames, fileName => { - inputFiles.push(getHarnessCompilerInputUnit(fileName)); - }); - - if (!opts.options.noLib) { - // Find the lib.d.ts file in the input file and add it to the input files list - var libFile = ts.forEach(ioLog.filesRead, fileRead=> Harness.isLibraryFile(fileRead.path) ? fileRead.path : undefined); - if (libFile) { - inputFiles.push(getHarnessCompilerInputUnit(libFile)); - } - } - - ts.forEach(ioLog.filesRead, fileRead => { - var resolvedPath = Harness.Path.switchToForwardSlashes(sys.resolvePath(fileRead.path)); - var inInputList = ts.forEach(inputFiles, inputFile=> inputFile.unitName === resolvedPath); - if (!inInputList) { - // Add the file to other files - otherFiles.push(getHarnessCompilerInputUnit(fileRead.path)); - } - }); - - // do not use lib since we already read it in above - opts.options.noLib = true; - - // Emit the results - harnessCompiler.compileFiles(inputFiles, otherFiles, compileResult => { - compilerResult = compileResult; - }, /*settingsCallback*/ undefined, opts.options); + after(() => { + // Mocha holds onto the closure environment of the describe callback even after the test is done. + // Therefore we have to clean out large objects after the test is done. + inputFiles = undefined; + otherFiles = undefined; + compilerResult = undefined; + compilerOptions = undefined; + baselineOpts = undefined; + baseName = undefined; + declFileCompilationResult = undefined; }); - function getHarnessCompilerInputUnit(fileName: string) { - var resolvedPath = Harness.Path.switchToForwardSlashes(sys.resolvePath(fileName)); - try { - var content = sys.readFile(resolvedPath); + it('can compile', () => { + var harnessCompiler = Harness.Compiler.getCompiler(); + var opts: ts.ParsedCommandLine; + + var ioLog: IOLog = JSON.parse(Harness.IO.readFile(jsonPath)); + runWithIOLog(ioLog, () => { + opts = ts.parseCommandLine(ioLog.arguments); + assert.equal(opts.errors.length, 0); + }); + + runWithIOLog(ioLog, () => { + harnessCompiler.reset(); + + // Load the files + ts.forEach(opts.filenames, fileName => { + inputFiles.push(getHarnessCompilerInputUnit(fileName)); + }); + + if (!opts.options.noLib) { + // Find the lib.d.ts file in the input file and add it to the input files list + var libFile = ts.forEach(ioLog.filesRead, fileRead=> Harness.isLibraryFile(fileRead.path) ? fileRead.path : undefined); + if (libFile) { + inputFiles.push(getHarnessCompilerInputUnit(libFile)); + } + } + + ts.forEach(ioLog.filesRead, fileRead => { + var resolvedPath = ts.normalizeSlashes(sys.resolvePath(fileRead.path)); + var inInputList = ts.forEach(inputFiles, inputFile=> inputFile.unitName === resolvedPath); + if (!inInputList) { + // Add the file to other files + otherFiles.push(getHarnessCompilerInputUnit(fileRead.path)); + } + }); + + // do not use lib since we already read it in above + opts.options.noLib = true; + + // Emit the results + compilerOptions = harnessCompiler.compileFiles(inputFiles, otherFiles, compileResult => { + compilerResult = compileResult; + }, /*settingsCallback*/ undefined, opts.options); + }); + + function getHarnessCompilerInputUnit(fileName: string) { + var unitName = ts.normalizeSlashes(sys.resolvePath(fileName)); + try { + var content = sys.readFile(unitName); + } + catch (e) { + // Leave content undefined. + } + return { unitName, content }; } - catch (e) { - // Leave content undefined. - } - return { unitName: resolvedPath, content: content }; - } - }); + }); - // Baselines - var baselineOpts: Harness.Baseline.BaselineOptions = { Subfolder: 'rwc' }; - var baseName = /(.*)\/(.*).json/.exec(Harness.Path.switchToForwardSlashes(jsonPath))[2]; + // Baselines + it('Correct compiler generated.d.ts', () => { + declFileCompilationResult = Harness.Compiler.getCompiler().compileDeclarationFiles(inputFiles, otherFiles, compilerResult, /*settingscallback*/ undefined, compilerOptions); + }); - it('has the expected emitted code', () => { - Harness.Baseline.runBaseline('has the expected emitted code', baseName + '.output.js', () => { - return collateOutputs(compilerResult.files, s => SyntacticCleaner.clean(s)); - }, false, baselineOpts); - }); - it('has the expected declaration file content', () => { - Harness.Baseline.runBaseline('has the expected declaration file content', baseName + '.d.ts', () => { - if (compilerResult.errors.length || !compilerResult.declFilesCode.length) { - return null; - } - return collateOutputs(compilerResult.declFilesCode); - }, false, baselineOpts); - }); - - it('has the expected source maps', () => { - Harness.Baseline.runBaseline('has the expected source maps', baseName + '.map', () => { - if (!compilerResult.sourceMaps.length) { - return null; - } - - return collateOutputs(compilerResult.sourceMaps); - }, false, baselineOpts); - }); - - it('has correct source map record', () => { - if (compilerResult.sourceMapRecord) { - Harness.Baseline.runBaseline('has correct source map record', baseName + '.sourcemap.txt', () => { - return compilerResult.sourceMapRecord; + it('has the expected emitted code', () => { + Harness.Baseline.runBaseline('has the expected emitted code', baseName + '.output.js', () => { + return collateOutputs(compilerResult.files, s => SyntacticCleaner.clean(s)); }, false, baselineOpts); - } - }); + }); - it('has the expected errors', () => { - Harness.Baseline.runBaseline('has the expected errors', baseName + '.errors.txt', () => { - if (compilerResult.errors.length === 0) { - return null; + it('has the expected declaration file content', () => { + Harness.Baseline.runBaseline('has the expected declaration file content', baseName + '.d.ts', () => { + if (compilerResult.errors.length || !compilerResult.declFilesCode.length) { + return null; + } + return collateOutputs(compilerResult.declFilesCode); + }, false, baselineOpts); + }); + + it('has the expected source maps', () => { + Harness.Baseline.runBaseline('has the expected source maps', baseName + '.map', () => { + if (!compilerResult.sourceMaps.length) { + return null; + } + + return collateOutputs(compilerResult.sourceMaps); + }, false, baselineOpts); + }); + + //it('has correct source map record', () => { + // if (compilerOptions.sourceMap) { + // Harness.Baseline.runBaseline('has correct source map record', baseName + '.sourcemap.txt', () => { + // return compilerResult.getSourceMapRecord(); + // }, false, baselineOpts); + // } + //}); + + it('has the expected errors', () => { + Harness.Baseline.runBaseline('has the expected errors', baseName + '.errors.txt', () => { + if (compilerResult.errors.length === 0) { + return null; + } + + return Harness.Compiler.getErrorBaseline(inputFiles.concat(otherFiles), compilerResult.errors); + }, false, baselineOpts); + }); + + it('has no errors in generated declaration files', () => { + if (compilerOptions.declaration && !compilerResult.errors.length) { + Harness.Baseline.runBaseline('has no errors in generated declaration files', baseName + '.dts.errors.txt', () => { + if (declFileCompilationResult.declResult.errors.length === 0) { + return null; + } + + return Harness.Compiler.minimalDiagnosticsToString(declFileCompilationResult.declResult.errors) + + sys.newLine + sys.newLine + + Harness.Compiler.getErrorBaseline(declFileCompilationResult.declInputFiles.concat(declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.errors); + }, false, baselineOpts); } + }); - return Harness.Compiler.minimalDiagnosticsToString(compilerResult.errors) + - sys.newLine + sys.newLine + - Harness.Compiler.getErrorBaseline(inputFiles.concat(otherFiles), compilerResult.errors); - }, false, baselineOpts); + // TODO: Type baselines (need to refactor out from compilerRunner) }); - - // TODO: Type baselines (need to refactor out from compilerRunner) } } class RWCRunner extends RunnerBase { - private runnerPath = "tests/runners/rwc"; - private sourcePath = "tests/cases/rwc/"; - - private harnessCompiler: Harness.Compiler.HarnessCompiler; + private static sourcePath = "tests/cases/rwc/"; /** Setup the runner's tests so that they are ready to be executed by the harness * The first test should be a describe/it block that sets up the harness's compiler instance appropriately */ public initializeTests(): void { - // Recreate the compiler with the default lib - Harness.Compiler.recreate({ useMinimalDefaultLib: false, noImplicitAny: false }); - this.harnessCompiler = Harness.Compiler.getCompiler(); - // Read in and evaluate the test list - var testList = Harness.IO.listFiles(this.sourcePath, /.+\.json$/); + var testList = Harness.IO.listFiles(RWCRunner.sourcePath, /.+\.json$/); for (var i = 0; i < testList.length; i++) { this.runTest(testList[i]); } } private runTest(jsonFilename: string) { - describe("Testing a RWC project: " + jsonFilename, () => { - RWC.runRWCTest(jsonFilename); - }); + RWC.runRWCTest(jsonFilename); } } \ No newline at end of file diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts index f7a6bdbf3e5..f7d6bcfeaa1 100644 --- a/src/harness/sourceMapRecorder.ts +++ b/src/harness/sourceMapRecorder.ts @@ -223,7 +223,7 @@ module Harness.SourceMapRecoder { sourceMapNames = sourceMapData.sourceMapNames; jsFile = currentJsFile; - jsLineMap = ts.getLineStarts(jsFile.code); + jsLineMap = ts.computeLineStarts(jsFile.code); spansOnSingleLine = []; prevWrittenSourcePos = 0; @@ -294,7 +294,7 @@ module Harness.SourceMapRecoder { sourceMapRecoder.WriteLine("sourceFile:" + sourceMapSources[spansOnSingleLine[0].sourceMapSpan.sourceIndex]); sourceMapRecoder.WriteLine("-------------------------------------------------------------------"); - tsLineMap = ts.getLineStarts(newSourceFileCode); + tsLineMap = ts.computeLineStarts(newSourceFileCode); tsCode = newSourceFileCode; prevWrittenSourcePos = 0; } @@ -390,7 +390,7 @@ module Harness.SourceMapRecoder { } } - var tsCodeLineMap = ts.getLineStarts(sourceText); + var tsCodeLineMap = ts.computeLineStarts(sourceText); for (var i = 0; i < tsCodeLineMap.length; i++) { writeSourceMapIndent(prevEmittedCol, i == 0 ? markerIds[index] : " >"); sourceMapRecoder.Write(getTextOfLine(i, tsCodeLineMap, sourceText)); diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index a3b23d10f14..ed8d37c9c7e 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -1,7 +1,7 @@ interface TypeWriterResult { line: number; column: number; - syntaxKind: string; + syntaxKind: number; sourceText: string; type: string; } @@ -67,8 +67,8 @@ class TypeWriterWalker { case ts.SyntaxKind.ContinueStatement: case ts.SyntaxKind.BreakStatement: return (parent).label === identifier; - case ts.SyntaxKind.LabelledStatement: - return (parent).label === identifier; + case ts.SyntaxKind.LabeledStatement: + return (parent).label === identifier; } return false; } @@ -76,7 +76,7 @@ class TypeWriterWalker { private log(node: ts.Node, type: ts.Type): void { var actualPos = ts.skipTrivia(this.currentSourceFile.text, node.pos); var lineAndCharacter = this.currentSourceFile.getLineAndCharacterFromPosition(actualPos); - var sourceText = ts.getSourceTextOfNodeFromSourceText(this.currentSourceFile.text, node); + var sourceText = ts.getTextOfNodeFromSourceText(this.currentSourceFile.text, node); // If we got an unknown type, we temporarily want to fall back to just pretending the name // (source text) of the node is the type. This is to align with the old typeWriter to make @@ -84,15 +84,15 @@ class TypeWriterWalker { this.results.push({ line: lineAndCharacter.line - 1, column: lineAndCharacter.character, - syntaxKind: ts.SyntaxKind[node.kind], + syntaxKind: node.kind, sourceText: sourceText, - type: this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.None) + type: this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.WriteOwnNameForAnyLike) }); } private getTypeOfNode(node: ts.Node): ts.Type { var type = this.checker.getTypeOfNode(node); - ts.Debug.assert(type, "type doesn't exist"); + ts.Debug.assert(type !== undefined, "type doesn't exist"); return type; } } diff --git a/src/harness/unittestrunner.ts b/src/harness/unittestrunner.ts deleted file mode 100644 index c91b82a0d96..00000000000 --- a/src/harness/unittestrunner.ts +++ /dev/null @@ -1,73 +0,0 @@ -/// -/// - -class UnitTestRunner extends RunnerBase { - constructor() { - super(); - } - - public initializeTests() { - this.tests = this.enumerateFiles('tests/cases/unittests/services'); - - var outfile = new Harness.Compiler.WriterAggregator() - var outerr = new Harness.Compiler.WriterAggregator(); - // note this is running immediately to generate tests to be run later inside describe/it - // need a fresh instance so that the previous runner's last test is not hanging around - var harnessCompiler = Harness.Compiler.getCompiler({ useExistingInstance: false }); - - var toBeAdded = this.tests.map(test => { - return { unitName: test, content: Harness.IO.readFile(test) } - }); - harnessCompiler.addInputFiles(toBeAdded); - harnessCompiler.setCompilerOptions({ noResolve: true }); - - var stdout = new Harness.Compiler.EmitterIOHost(); - var emitDiagnostics = harnessCompiler.emitAll(stdout); - var results = stdout.toArray(); - var lines: string[] = []; - results.forEach(v => lines = lines.concat(v.file.lines)); - var code = lines.join("\n") - - var nodeContext: any = undefined; - if (Utils.getExecutionEnvironment() === Utils.ExecutionEnvironment.Node) { - nodeContext = { - require: require, - process: process, - describe: describe, - it: it, - assert: assert, - beforeEach: beforeEach, - afterEach: afterEach, - before: before, - after: after, - Harness: Harness, - IO: Harness.IO, - ts: ts, - TypeScript: TypeScript - // FourSlash: FourSlash - }; - } - - describe("Setup compiler for compiler unittests", () => { - // ensures a clean compiler instance when tests are eventually executed following this describe block - harnessCompiler = Harness.Compiler.getCompiler({ - useExistingInstance: false, - optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: false } - }); - }); - - // this generated code is a series of top level describe/it blocks that will run in between the setup and cleanup blocks in this file - Utils.evalFile(code, "generated_test_code.js", nodeContext); - - describe("Cleanup after unittests", () => { - var harnessCompiler = Harness.Compiler.getCompiler({ - useExistingInstance: false, - optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: false } - }); - }); - - // note this runs immediately (ie before this same code in the describe block above) - // to make sure the next runner doesn't include the previous one's stuff - harnessCompiler = Harness.Compiler.getCompiler({ useExistingInstance: false }); - } -} \ No newline at end of file diff --git a/src/lib/core.d.ts b/src/lib/core.d.ts index 8e16e4bdd6c..7f498488f21 100644 --- a/src/lib/core.d.ts +++ b/src/lib/core.d.ts @@ -484,6 +484,10 @@ declare var Number: { POSITIVE_INFINITY: number; } +interface TemplateStringsArray extends Array { + raw: string[]; +} + interface Math { /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ E: number; diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index 3a093bcfaf4..53f21708b3f 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -1886,6 +1886,23 @@ declare var HTMLCollection: { new(): HTMLCollection; } +interface BlobPropertyBag { + type?: string; + endings?: string; +} + +interface Blob { + type: string; + size: number; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; + msClose(): void; +} +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + interface NavigatorID { appVersion: string; appName: string; @@ -10027,18 +10044,6 @@ declare var FileReader: { new(): FileReader; } -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new(): Blob; -} - interface ApplicationCache extends EventTarget { status: number; ondownloading: (ev: Event) => any; diff --git a/src/lib/extensions.d.ts b/src/lib/extensions.d.ts index 87b78018c7e..82cc129ecbc 100644 --- a/src/lib/extensions.d.ts +++ b/src/lib/extensions.d.ts @@ -63,14 +63,14 @@ interface Int8Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int8Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -121,14 +121,14 @@ interface Uint8Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint8Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -179,14 +179,14 @@ interface Int16Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int16Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -237,14 +237,14 @@ interface Uint16Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint16Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -295,14 +295,14 @@ interface Int32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Int32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -353,14 +353,14 @@ interface Uint32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Uint32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -411,14 +411,14 @@ interface Float32Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Float32Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; @@ -469,14 +469,14 @@ interface Float64Array extends ArrayBufferView { /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: Float64Array, offset?: number): void; /** * Sets a value or an array of values. - * @param A typed or untyped array of values to set. + * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: number[], offset?: number): void; diff --git a/src/lib/webworker.generated.d.ts b/src/lib/webworker.generated.d.ts index 5dfaa2f646f..a6119989164 100644 --- a/src/lib/webworker.generated.d.ts +++ b/src/lib/webworker.generated.d.ts @@ -614,6 +614,11 @@ declare var FileReader: { new(): FileReader; } +interface BlobPropertyBag { + type?: string; + endings?: string; +} + interface Blob { type: string; size: number; @@ -623,7 +628,7 @@ interface Blob { } declare var Blob: { prototype: Blob; - new(): Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; } interface MSStream { diff --git a/src/services/braceMatcher.ts b/src/services/braceMatcher.ts deleted file mode 100644 index 3615f677024..00000000000 --- a/src/services/braceMatcher.ts +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services { - export class BraceMatcher { - - // Given a script name and position in the script, return a pair of text range if the - // position corresponds to a "brace matchin" characters (e.g. "{" or "(", etc.) - // If the position is not on any range, return an empty set. - public static getMatchSpans(syntaxTree: TypeScript.SyntaxTree, position: number): TypeScript.TextSpan[] { - var result: TypeScript.TextSpan[] = []; - - var token = findToken(syntaxTree.sourceUnit(), position); - - if (start(token) === position) { - var matchKind = BraceMatcher.getMatchingTokenKind(token); - - if (matchKind !== null) { - var parentElement = token.parent; - - for (var i = 0, n = childCount(parentElement); i < n; i++) { - var current = childAt(parentElement, i); - - if (current !== null && fullWidth(current) > 0) { - if (current.kind() === matchKind) { - var range1 = new TypeScript.TextSpan(start(token), width(token)); - var range2 = new TypeScript.TextSpan(start(current), width(current)); - if (range1.start() < range2.start()) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - break; - } - } - } - } - } - - return result; - } - - private static getMatchingTokenKind(token: TypeScript.ISyntaxToken): TypeScript.SyntaxKind { - switch (token.kind()) { - case TypeScript.SyntaxKind.OpenBraceToken: return TypeScript.SyntaxKind.CloseBraceToken - case TypeScript.SyntaxKind.OpenParenToken: return TypeScript.SyntaxKind.CloseParenToken; - case TypeScript.SyntaxKind.OpenBracketToken: return TypeScript.SyntaxKind.CloseBracketToken; - case TypeScript.SyntaxKind.LessThanToken: return TypeScript.SyntaxKind.GreaterThanToken; - case TypeScript.SyntaxKind.CloseBraceToken: return TypeScript.SyntaxKind.OpenBraceToken - case TypeScript.SyntaxKind.CloseParenToken: return TypeScript.SyntaxKind.OpenParenToken; - case TypeScript.SyntaxKind.CloseBracketToken: return TypeScript.SyntaxKind.OpenBracketToken; - case TypeScript.SyntaxKind.GreaterThanToken: return TypeScript.SyntaxKind.LessThanToken; - } - - return null; - } - } -} \ No newline at end of file diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 12de22d3bd0..7867751a96f 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -1,1088 +1,504 @@ // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. -/// +/// -module TypeScript.Services.Breakpoints { - function createBreakpointSpanInfo(parentElement: TypeScript.ISyntaxElement, ...childElements: TypeScript.ISyntaxElement[]): TextSpan { - if (!parentElement) { - return null; +module ts.BreakpointResolver { + /** + * Get the breakpoint span in given sourceFile + */ + export function spanInSourceFileAtLocation(sourceFile: SourceFile, position: number) { + // Cannot set breakpoint in dts file + if (sourceFile.flags & NodeFlags.DeclarationFile) { + return undefined; } - if (childElements.length == 0) { - return TextSpan.fromBounds(TypeScript.start(parentElement), TypeScript.end(parentElement)); - } + var tokenAtLocation = getTokenAtPosition(sourceFile, position); + var lineOfPosition = sourceFile.getLineAndCharacterFromPosition(position).line; + if (sourceFile.getLineAndCharacterFromPosition(tokenAtLocation.getStart()).line > lineOfPosition) { + // Get previous token if the token is returned starts on new line + // eg: var x =10; |--- curser is here + // var y = 10; + // token at position will return var keyword on second line as the token but we would like to use + // token on same line if trailing trivia (comments or white spaces on same line) part of the last token on that line + tokenAtLocation = findPrecedingToken(tokenAtLocation.pos, sourceFile); - var start: number; - var end: number; - for (var i = 0; i < childElements.length; i++) { - var element = childElements[i]; - if (element && !isShared(element)) { - if (start == undefined) { - start = TypeScript.start(element); - } - end = TypeScript.end(element); + // Its a blank line + if (!tokenAtLocation || sourceFile.getLineAndCharacterFromPosition(tokenAtLocation.getEnd()).line !== lineOfPosition) { + return undefined; } } - return TextSpan.fromBounds(start, end); - } - - function createBreakpointSpanInfoWithLimChar(startElement: TypeScript.ISyntaxElement, limChar: number): TextSpan { - return TextSpan.fromBounds(start(startElement), limChar); - } - - class BreakpointResolver { - constructor(private posLine: number, private lineMap: TypeScript.LineMap) { + // Cannot set breakpoint in ambient declarations + if (isInAmbientContext(tokenAtLocation)) { + return undefined; } - private breakpointSpanOfToken(positionedToken: TypeScript.ISyntaxToken): TextSpan { - switch (positionedToken.kind()) { - case TypeScript.SyntaxKind.OpenBraceToken: - return this.breakpointSpanOfOpenBrace(positionedToken); + // Get the span in the node based on its syntax + return spanInNode(tokenAtLocation); - case TypeScript.SyntaxKind.CloseBraceToken: - return this.breakpointSpanOfCloseBrace(positionedToken); + function textSpan(startNode: Node, endNode?: Node) { + return TextSpan.fromBounds(startNode.getStart(), (endNode || startNode).getEnd()); + } - case TypeScript.SyntaxKind.CommaToken: - return this.breakpointSpanOfComma(positionedToken); + function spanInNodeIfStartsOnSameLine(node: Node, otherwiseOnNode?: Node): TextSpan { + if (node && lineOfPosition === sourceFile.getLineAndCharacterFromPosition(node.getStart()).line) { + return spanInNode(node); + } + return spanInNode(otherwiseOnNode); + } - case TypeScript.SyntaxKind.SemicolonToken: - case TypeScript.SyntaxKind.EndOfFileToken: - return this.breakpointSpanIfStartsOnSameLine(previousToken(positionedToken)); + function spanInPreviousNode(node: Node): TextSpan { + return spanInNode(findPrecedingToken(node.pos, sourceFile)); + } - case TypeScript.SyntaxKind.CloseParenToken: - return this.breakpointSpanOfCloseParen(positionedToken); + function spanInNextNode(node: Node): TextSpan { + return spanInNode(findNextToken(node, node.parent)); + } - case TypeScript.SyntaxKind.DoKeyword: - var parentElement = positionedToken.parent; - if (parentElement && parentElement.kind() == TypeScript.SyntaxKind.DoStatement) { - return this.breakpointSpanIfStartsOnSameLine(nextToken(positionedToken)); + function spanInNode(node: Node): TextSpan { + if (node) { + if (isExpression(node)) { + if (node.parent.kind === SyntaxKind.DoStatement) { + // Set span as if on while keyword + return spanInPreviousNode(node); } - break; - } - return this.breakpointSpanOfContainingNode(positionedToken); - } + if (node.parent.kind === SyntaxKind.ForStatement) { + // For now lets set the span on this expression, fix it later + return textSpan(node); + } - private breakpointSpanOfOpenBrace(openBraceToken: TypeScript.ISyntaxToken): TextSpan { - var container = Syntax.containingNode(openBraceToken); - if (container) { - var originalContainer = container; - if (container && container.kind() == TypeScript.SyntaxKind.Block) { - // We have to check the parent and decide what to do with the breakpoint - container = Syntax.containingNode(container); - if (!container) { - container = originalContainer; + if (node.parent.kind === SyntaxKind.BinaryExpression && (node.parent).operator === SyntaxKind.CommaToken) { + // if this is comma expression, the breakpoint is possible in this expression + return textSpan(node); + } + + if (node.parent.kind == SyntaxKind.ArrowFunction && (node.parent).body == node) { + // If this is body of arrow function, it is allowed to have the breakpoint + return textSpan(node); } } - switch (container.kind()) { - case TypeScript.SyntaxKind.Block: - if (!this.canHaveBreakpointInBlock(container)) { - return null; - } - return this.breakpointSpanOfFirstStatementInBlock(container); - break; + switch (node.kind) { + case SyntaxKind.VariableStatement: + // Span on first variable declaration + return spanInVariableDeclaration((node).declarations[0]); - case TypeScript.SyntaxKind.ModuleDeclaration: - case TypeScript.SyntaxKind.ClassDeclaration: - case TypeScript.SyntaxKind.FunctionDeclaration: - case TypeScript.SyntaxKind.ConstructorDeclaration: - case TypeScript.SyntaxKind.MemberFunctionDeclaration: - case TypeScript.SyntaxKind.GetAccessor: - case TypeScript.SyntaxKind.SetAccessor: - case TypeScript.SyntaxKind.FunctionExpression: - case TypeScript.SyntaxKind.ParenthesizedArrowFunctionExpression: - case TypeScript.SyntaxKind.SimpleArrowFunctionExpression: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; + case SyntaxKind.VariableDeclaration: + case SyntaxKind.Property: + return spanInVariableDeclaration(node); + + case SyntaxKind.Parameter: + return spanInParameterDeclaration(node); + + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.Constructor: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + return spanInFunctionDeclaration(node); + + case SyntaxKind.FunctionBlock: + return spanInFunctionBlock(node); + + case SyntaxKind.Block: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.ModuleBlock: + return spanInBlock(node); + + case SyntaxKind.ExpressionStatement: + // span on the expression + return textSpan((node).expression); + + case SyntaxKind.ReturnStatement: + // span on return keyword and expression if present + return textSpan(node.getChildAt(0), (node).expression); + + case SyntaxKind.WhileStatement: + // Span on while(...) + return textSpan(node, findNextToken((node).expression, node)); + + case SyntaxKind.DoStatement: + // span in statement of the do statement + return spanInNode((node).statement); + + case SyntaxKind.DebuggerStatement: + // span on debugger keyword + return textSpan(node.getChildAt(0)); + + case SyntaxKind.IfStatement: + // set on if(..) span + return textSpan(node, findNextToken((node).expression, node)); + + case SyntaxKind.LabeledStatement: + // span in statement + return spanInNode((node).statement); + + case SyntaxKind.BreakStatement: + case SyntaxKind.ContinueStatement: + // On break or continue keyword and label if present + return textSpan(node.getChildAt(0), (node).label); + + case SyntaxKind.ForStatement: + return spanInForStatement(node); + + case SyntaxKind.ForInStatement: + // span on for (a in ...) + return textSpan(node, findNextToken((node).expression, node)); + + case SyntaxKind.SwitchStatement: + // span on switch(...) + return textSpan(node, findNextToken((node).expression, node)); + + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + // span in first statement of the clause + return spanInNode((node).statements[0]); + + case SyntaxKind.TryStatement: + // span in try block + return spanInBlock((node).tryBlock); + + case SyntaxKind.ThrowStatement: + // span in throw ... + return textSpan(node, (node).expression); + + case SyntaxKind.ExportAssignment: + // span on export = id + return textSpan(node, (node).exportName); + + case SyntaxKind.ImportDeclaration: + // import statement without including semicolon + return textSpan(node, (node).entityName || (node).externalModuleName); + + case SyntaxKind.ModuleDeclaration: + // span on complete module if it is instantiated + if (getModuleInstanceState(node) !== ModuleInstanceState.Instantiated) { + return undefined; } - if (this.posLine != this.lineMap.getLineNumberFromPosition(start(container))) { - return this.breakpointSpanOfFirstChildOfSyntaxList(this.getSyntaxListOfDeclarationWithElements(container)); + + case SyntaxKind.ClassDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.EnumMember: + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + // span on complete node + return textSpan(node); + + case SyntaxKind.WithStatement: + // span in statement + return spanInNode((node).statement); + + // No breakpoint in interface, type alias + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: + return undefined; + + // Tokens: + case SyntaxKind.SemicolonToken: + case SyntaxKind.EndOfFileToken: + return spanInNodeIfStartsOnSameLine(findPrecedingToken(node.pos, sourceFile)); + + case SyntaxKind.CommaToken: + return spanInPreviousNode(node) + + case SyntaxKind.OpenBraceToken: + return spanInOpenBraceToken(node); + + case SyntaxKind.CloseBraceToken: + return spanInCloseBraceToken(node); + + case SyntaxKind.OpenParenToken: + return spanInOpenParenToken(node); + + case SyntaxKind.CloseParenToken: + return spanInCloseParenToken(node); + + case SyntaxKind.ColonToken: + return spanInColonToken(node); + + case SyntaxKind.GreaterThanToken: + case SyntaxKind.LessThanToken: + return spanInGreaterThanOrLessThanToken(node); + + // Keywords: + case SyntaxKind.WhileKeyword: + return spanInWhileKeyword(node); + + case SyntaxKind.ElseKeyword: + case SyntaxKind.CatchKeyword: + case SyntaxKind.FinallyKeyword: + return spanInNextNode(node); + + default: + // If this is name of property assignment, set breakpoint in the initializer + if (node.parent.kind === SyntaxKind.PropertyAssignment && (node.parent).name === node) { + return spanInNode((node.parent).initializer); + } + + // Breakpoint in type assertion goes to its operand + if (node.parent.kind === SyntaxKind.TypeAssertion && (node.parent).type === node) { + return spanInNode((node.parent).operand); + } + + // return type of function go to previous token + if (isAnyFunction(node.parent) && (node.parent).type === node) { + return spanInPreviousNode(node); + } + + // Default go to parent to set the breakpoint + return spanInNode(node.parent); + } + } + + function spanInVariableDeclaration(variableDeclaration: VariableDeclaration): TextSpan { + // If declaration of for in statement, just set the span in parent + if (variableDeclaration.parent.kind === SyntaxKind.ForInStatement) { + return spanInNode(variableDeclaration.parent); + } + + var isParentVariableStatement = variableDeclaration.parent.kind === SyntaxKind.VariableStatement; + var isDeclarationOfForStatement = variableDeclaration.parent.kind === SyntaxKind.ForStatement && contains((variableDeclaration.parent).declarations, variableDeclaration); + var declarations = isParentVariableStatement + ? (variableDeclaration.parent).declarations + : isDeclarationOfForStatement + ? (variableDeclaration.parent).declarations + : undefined; + + // Breakpoint is possible in variableDeclaration only if there is initialization + if (variableDeclaration.initializer || (variableDeclaration.flags & NodeFlags.Export)) { + if (declarations && declarations[0] === variableDeclaration) { + if (isParentVariableStatement) { + // First declaration - include var keyword + return textSpan(variableDeclaration.parent, variableDeclaration); } else { - return this.breakpointSpanOf(container); + Debug.assert(isDeclarationOfForStatement); + // Include var keyword from for statement declarations in the span + return textSpan(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } - - case TypeScript.SyntaxKind.EnumDeclaration: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - if (this.posLine != this.lineMap.getLineNumberFromPosition(start(container))) { - return this.breakpointSpanOfFirstEnumElement(container); - } - else { - return this.breakpointSpanOf(container); - } - - case TypeScript.SyntaxKind.IfStatement: - case TypeScript.SyntaxKind.ForInStatement: - case TypeScript.SyntaxKind.WhileStatement: - case TypeScript.SyntaxKind.CatchClause: - if (this.posLine != this.lineMap.getLineNumberFromPosition(start(container))) { - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - } - else { - return this.breakpointSpanOf(container); - } - - case TypeScript.SyntaxKind.DoStatement: - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - - case TypeScript.SyntaxKind.ForStatement: - if (this.posLine != this.lineMap.getLineNumberFromPosition(start(container))) { - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - } - else { - return this.breakpointSpanOf(previousToken(openBraceToken)); - } - - case TypeScript.SyntaxKind.ElseClause: - case TypeScript.SyntaxKind.CaseSwitchClause: - case TypeScript.SyntaxKind.DefaultSwitchClause: - case TypeScript.SyntaxKind.WithStatement: - case TypeScript.SyntaxKind.TryStatement: - case TypeScript.SyntaxKind.FinallyClause: - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - - case TypeScript.SyntaxKind.SwitchStatement: - if (this.posLine != this.lineMap.getLineNumberFromPosition(start(container))) { - return this.breakpointSpanOfFirstStatementOfFirstCaseClause(container); - } - else { - return this.breakpointSpanOf(container); - } - } - } - - return null; - } - - private breakpointSpanOfCloseBrace(closeBraceToken: TypeScript.ISyntaxToken): TextSpan { - var container = Syntax.containingNode(closeBraceToken); - if (container) { - var originalContainer = container; - if (container.kind() == TypeScript.SyntaxKind.Block) { - // We have to check the parent and decide what to do with the breakpoint - container = Syntax.containingNode(container); - if (!container) { - container = originalContainer; - } - } - - switch (container.kind()) { - case TypeScript.SyntaxKind.Block: - if (!this.canHaveBreakpointInBlock(container)) { - return null; - } - return this.breakpointSpanOfLastStatementInBlock(container); - break; - - case TypeScript.SyntaxKind.ModuleDeclaration: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - var moduleSyntax = container; - if (moduleSyntax.moduleElements && moduleSyntax.moduleElements.length > 0) { - return createBreakpointSpanInfo(closeBraceToken); - } - else { - return null; - } - - case TypeScript.SyntaxKind.ClassDeclaration: - case TypeScript.SyntaxKind.FunctionDeclaration: - case TypeScript.SyntaxKind.ConstructorDeclaration: - case TypeScript.SyntaxKind.MemberFunctionDeclaration: - case TypeScript.SyntaxKind.GetAccessor: - case TypeScript.SyntaxKind.SetAccessor: - case TypeScript.SyntaxKind.FunctionExpression: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - return createBreakpointSpanInfo(closeBraceToken); - - case TypeScript.SyntaxKind.EnumDeclaration: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - return createBreakpointSpanInfo(closeBraceToken); - - case TypeScript.SyntaxKind.IfStatement: - case TypeScript.SyntaxKind.ElseClause: - case TypeScript.SyntaxKind.ForInStatement: - case TypeScript.SyntaxKind.ForStatement: - case TypeScript.SyntaxKind.WhileStatement: - case TypeScript.SyntaxKind.DoStatement: - case TypeScript.SyntaxKind.CaseSwitchClause: - case TypeScript.SyntaxKind.DefaultSwitchClause: - case TypeScript.SyntaxKind.WithStatement: - case TypeScript.SyntaxKind.TryStatement: - case TypeScript.SyntaxKind.CatchClause: - case TypeScript.SyntaxKind.FinallyClause: - case TypeScript.SyntaxKind.ParenthesizedArrowFunctionExpression: - case TypeScript.SyntaxKind.SimpleArrowFunctionExpression: - return this.breakpointSpanOfLastStatementInBlock(originalContainer); - - case TypeScript.SyntaxKind.SwitchStatement: - return this.breakpointSpanOfLastStatementOfLastCaseClause(container); - } - } - - return null; - } - - - private breakpointSpanOfComma(commaToken: TypeScript.ISyntaxToken): TextSpan { - var commaParent = commaToken.parent; - if (isSeparatedList(commaParent)) { - var grandParent = commaParent.parent; - if (grandParent) { - switch (grandParent.kind()) { - case TypeScript.SyntaxKind.VariableDeclaration: - case TypeScript.SyntaxKind.EnumDeclaration: - case TypeScript.SyntaxKind.ParameterList: - var index = Syntax.childIndex(commaParent, commaToken); - // Use the previous child - if (index > 0) { - var child = childAt(commaParent, index - 1); - return this.breakpointSpanOf(child); - } - - // If we cant set breakpoint on enum element, just dont set breakpoint - if (grandParent.kind() == TypeScript.SyntaxKind.EnumDeclaration) { - return null; - } - break; - } - } - } - - return this.breakpointSpanOfContainingNode(commaToken); - } - - private breakpointSpanOfCloseParen(closeParenToken: TypeScript.ISyntaxToken): TextSpan { - var closeParenParent = closeParenToken.parent; - if (closeParenParent) { - switch (closeParenParent.kind()) { - case TypeScript.SyntaxKind.ForStatement: - case TypeScript.SyntaxKind.ParameterList: - return this.breakpointSpanOf(previousToken(closeParenToken)); - } - } - - return this.breakpointSpanOfContainingNode(closeParenToken); - } - - private canHaveBreakpointInBlock(blockNode: TypeScript.ISyntaxNode) { - if (!blockNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(blockNode)) { - return false; - } - - var blockSyntax = blockNode; - return blockSyntax.statements && blockSyntax.statements.length != 0; - } - - private breakpointSpanOfFirstStatementInBlock(blockNode: TypeScript.ISyntaxNode): TextSpan { - if (!blockNode) { - return null; - } - - var blockSyntax = blockNode; - var statementsNode = blockSyntax.statements; - if (!statementsNode || statementsNode.length == 0) { - return null; - } - - var firstStatement = childAt(statementsNode, 0); - if (firstStatement && firstStatement.kind() == TypeScript.SyntaxKind.Block) { - if (this.canHaveBreakpointInBlock(firstStatement)) { - return this.breakpointSpanOfFirstStatementInBlock(firstStatement); - } - return null; - } - else { - return this.breakpointSpanOf(firstStatement); - } - } - - private breakpointSpanOfLastStatementInBlock(blockNode: TypeScript.ISyntaxNode): TextSpan { - if (!blockNode) { - return null; - } - - var blockSyntax = blockNode; - var statementsNode = blockSyntax.statements; - if (!statementsNode || statementsNode.length == 0) { - return null; - } - - var lastStatement = childAt(statementsNode, statementsNode.length - 1); - if (lastStatement && lastStatement.kind() == TypeScript.SyntaxKind.Block) { - if (this.canHaveBreakpointInBlock(lastStatement)) { - return this.breakpointSpanOfLastStatementInBlock(lastStatement); - } - return null; - } - else { - return this.breakpointSpanOf(lastStatement); - } - } - - private breakpointSpanOfFirstChildOfSyntaxList(positionedList: TypeScript.ISyntaxNodeOrToken[]): TextSpan { - if (!positionedList) { - return null; - } - - // Find the first syntax element - var listSyntax = positionedList; - if (listSyntax.length == 0) { - return null; - } - - var firstStatement = childAt(positionedList, 0); - if (firstStatement && firstStatement.kind() == TypeScript.SyntaxKind.Block) { - if (this.canHaveBreakpointInBlock(firstStatement)) { - return this.breakpointSpanOfFirstStatementInBlock(firstStatement); - } - - return null; - } - else { - return this.breakpointSpanOf(firstStatement); - } - } - - private breakpointSpanOfLastChildOfSyntaxList(positionedList: TypeScript.ISyntaxNodeOrToken[]): TextSpan { - if (!positionedList) { - return null; - } - - // Find the first syntax element - var listSyntax = positionedList; - if (listSyntax.length == 0) { - return null; - } - var lastStatement = childAt(positionedList, 0); - if (lastStatement && lastStatement.kind() == TypeScript.SyntaxKind.Block) { - if (this.canHaveBreakpointInBlock(lastStatement)) { - return this.breakpointSpanOfLastStatementInBlock(lastStatement); - } - return null; - } - else { - return this.breakpointSpanOf(lastStatement); - } - } - - private breakpointSpanOfNode(positionedNode: ISyntaxNode): TextSpan { - var node = positionedNode; - switch (node.kind()) { - // Declarations with elements - case TypeScript.SyntaxKind.ModuleDeclaration: - case TypeScript.SyntaxKind.ClassDeclaration: - case TypeScript.SyntaxKind.FunctionDeclaration: - case TypeScript.SyntaxKind.ConstructorDeclaration: - case TypeScript.SyntaxKind.MemberFunctionDeclaration: - case TypeScript.SyntaxKind.GetAccessor: - case TypeScript.SyntaxKind.SetAccessor: - case TypeScript.SyntaxKind.FunctionExpression: - return this.breakpointSpanOfDeclarationWithElements(positionedNode); - - // Var, parameter and member variable declaration syntax - case TypeScript.SyntaxKind.VariableDeclarator: - return this.breakpointSpanOfVariableDeclarator(positionedNode); - - case TypeScript.SyntaxKind.VariableDeclaration: - return this.breakpointSpanOfVariableDeclaration(positionedNode); - - case TypeScript.SyntaxKind.VariableStatement: - return this.breakpointSpanOfVariableStatement(positionedNode); - - case TypeScript.SyntaxKind.Parameter: - return this.breakpointSpanOfParameter(positionedNode); - - case TypeScript.SyntaxKind.MemberVariableDeclaration: - return this.breakpointSpanOfMemberVariableDeclaration(positionedNode); - - case TypeScript.SyntaxKind.ImportDeclaration: - return this.breakpointSpanOfImportDeclaration(positionedNode); - - case TypeScript.SyntaxKind.EnumDeclaration: - return this.breakpointSpanOfEnumDeclaration(positionedNode); - - case TypeScript.SyntaxKind.EnumElement: - return this.breakpointSpanOfEnumElement(positionedNode); - - // Statements - case TypeScript.SyntaxKind.IfStatement: - return this.breakpointSpanOfIfStatement(positionedNode); - case TypeScript.SyntaxKind.ElseClause: - return this.breakpointSpanOfElseClause(positionedNode); - case TypeScript.SyntaxKind.ForInStatement: - return this.breakpointSpanOfForInStatement(positionedNode); - case TypeScript.SyntaxKind.ForStatement: - return this.breakpointSpanOfForStatement(positionedNode); - case TypeScript.SyntaxKind.WhileStatement: - return this.breakpointSpanOfWhileStatement(positionedNode); - case TypeScript.SyntaxKind.DoStatement: - return this.breakpointSpanOfDoStatement(positionedNode); - case TypeScript.SyntaxKind.SwitchStatement: - return this.breakpointSpanOfSwitchStatement(positionedNode); - case TypeScript.SyntaxKind.CaseSwitchClause: - return this.breakpointSpanOfCaseSwitchClause(positionedNode); - case TypeScript.SyntaxKind.DefaultSwitchClause: - return this.breakpointSpanOfDefaultSwitchClause(positionedNode); - case TypeScript.SyntaxKind.WithStatement: - return this.breakpointSpanOfWithStatement(positionedNode); - case TypeScript.SyntaxKind.TryStatement: - return this.breakpointSpanOfTryStatement(positionedNode); - case TypeScript.SyntaxKind.CatchClause: - return this.breakpointSpanOfCatchClause(positionedNode); - case TypeScript.SyntaxKind.FinallyClause: - return this.breakpointSpanOfFinallyClause(positionedNode); - - // Arrow expressions - case TypeScript.SyntaxKind.ParenthesizedArrowFunctionExpression: - return this.breakpointSpanOfParenthesizedArrowFunctionExpression(positionedNode); - - case TypeScript.SyntaxKind.SimpleArrowFunctionExpression: - return this.breakpointSpanOfSimpleArrowFunctionExpression(positionedNode); - - // Expressions or statements - default: - if (SyntaxUtilities.isStatement(node)) { - return this.breakpointSpanOfStatement(positionedNode); } else { - return this.breakpointOfExpression(positionedNode); + // Span only on this declaration + return textSpan(variableDeclaration); } - } - } - - private isExpressionOfArrowExpressions(expression: ISyntaxElement): boolean { - if (!expression) { - return false; - } - - var expressionParent = expression.parent; - if (expressionParent) { - if (expressionParent.kind() == TypeScript.SyntaxKind.ParenthesizedArrowFunctionExpression) { - var parenthesizedArrowExpression = expressionParent; - var expressionOfParenthesizedArrowExpression = parenthesizedArrowExpression.expression; - return expressionOfParenthesizedArrowExpression == expression; } - else if (expressionParent.kind() == TypeScript.SyntaxKind.SimpleArrowFunctionExpression) { - var simpleArrowExpression = expressionParent; - var expressionOfSimpleArrowExpression = simpleArrowExpression.expression; - return expressionOfSimpleArrowExpression == expression; - } - else if (expressionParent.kind() == TypeScript.SyntaxKind.CommaExpression) { - return this.isExpressionOfArrowExpressions(expressionParent); - } - } - return false; - } - - private isInitializerOfForStatement(expressionNode: TypeScript.ISyntaxNode): boolean { - if (!expressionNode) { - return false; - } - - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == TypeScript.SyntaxKind.ForStatement) { - - var expression = expressionNode; - var forStatement = expressionParent; - var initializer = forStatement.initializer; - return initializer === expression; - } - else if (expressionParent && expressionParent.kind() == TypeScript.SyntaxKind.CommaExpression) { - return this.isInitializerOfForStatement(expressionParent); - } - - return false; - } - - private isConditionOfForStatement(expressionNode: TypeScript.ISyntaxNode): boolean { - if (!expressionNode) { - return false; - } - - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == TypeScript.SyntaxKind.ForStatement) { - var expression = expressionNode; - var forStatement = expressionParent; - var condition = forStatement.condition; - return condition === expression; - } - else if (expressionParent && expressionParent.kind() == TypeScript.SyntaxKind.CommaExpression) { - return this.isConditionOfForStatement(expressionParent); - } - - return false; - } - - private isIncrememtorOfForStatement(expressionNode: TypeScript.ISyntaxNode): boolean { - if (!expressionNode) { - return false; - } - - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == TypeScript.SyntaxKind.ForStatement) { - var expression = expressionNode; - var forStatement = expressionParent; - var incrementor = forStatement.incrementor; - return incrementor === expression; - } - else if (expressionParent && expressionParent.kind() == TypeScript.SyntaxKind.CommaExpression) { - return this.isIncrememtorOfForStatement(expressionParent); - } - - return false; - } - - private breakpointOfLeftOfCommaExpression(commaExpressionNode: TypeScript.ISyntaxNode): TextSpan { - var commaExpression = commaExpressionNode; - return this.breakpointSpanOf(commaExpression.left); - } - - private breakpointOfExpression(expressionNode: TypeScript.ISyntaxNode): TextSpan { - if (this.isInitializerOfForStatement(expressionNode) || - this.isConditionOfForStatement(expressionNode) || - this.isIncrememtorOfForStatement(expressionNode)) { - if (expressionNode.kind() == TypeScript.SyntaxKind.CommaExpression) { - return this.breakpointOfLeftOfCommaExpression(expressionNode); - } - return createBreakpointSpanInfo(expressionNode); - } - - if (this.isExpressionOfArrowExpressions(expressionNode)) { - if (expressionNode.kind() == TypeScript.SyntaxKind.CommaExpression) { - return this.breakpointOfLeftOfCommaExpression(expressionNode); - } - return createBreakpointSpanInfo(expressionNode); - } - - if (expressionNode.kind() == TypeScript.SyntaxKind.ExportAssignment) { - var exportAssignmentSyntax = expressionNode; - return createBreakpointSpanInfo(expressionNode, exportAssignmentSyntax.exportKeyword, exportAssignmentSyntax.equalsToken, exportAssignmentSyntax.identifier); - } - - return this.breakpointSpanOfContainingNode(expressionNode); - } - - private breakpointSpanOfStatement(statementNode: TypeScript.ISyntaxNode): TextSpan { - var statement = statementNode; - if (statement.kind() == TypeScript.SyntaxKind.EmptyStatement) { - return null; - } - - var containingNode = Syntax.containingNode(statementNode); - if (SyntaxUtilities.isStatement(containingNode)) { - // Check if not the declarations and the compound statements - var useNodeForBreakpoint = false; - switch (containingNode.kind()) { - // Declarations - case TypeScript.SyntaxKind.ModuleDeclaration: - case TypeScript.SyntaxKind.ClassDeclaration: - case TypeScript.SyntaxKind.FunctionDeclaration: - case TypeScript.SyntaxKind.ConstructorDeclaration: - case TypeScript.SyntaxKind.MemberFunctionDeclaration: - case TypeScript.SyntaxKind.GetAccessor: - case TypeScript.SyntaxKind.SetAccessor: - case TypeScript.SyntaxKind.Block: - - // Compound Statements - case TypeScript.SyntaxKind.IfStatement: - case TypeScript.SyntaxKind.ElseClause: - case TypeScript.SyntaxKind.ForInStatement: - case TypeScript.SyntaxKind.ForStatement: - case TypeScript.SyntaxKind.WhileStatement: - case TypeScript.SyntaxKind.DoStatement: - case TypeScript.SyntaxKind.SwitchStatement: - case TypeScript.SyntaxKind.CaseSwitchClause: - case TypeScript.SyntaxKind.DefaultSwitchClause: - case TypeScript.SyntaxKind.WithStatement: - case TypeScript.SyntaxKind.TryStatement: - case TypeScript.SyntaxKind.CatchClause: - case TypeScript.SyntaxKind.FinallyClause: - case TypeScript.SyntaxKind.Block: - useNodeForBreakpoint = true; - } - - if (!useNodeForBreakpoint) { - return this.breakpointSpanOfContainingNode(statementNode); + else if (declarations && declarations[0] !== variableDeclaration) { + // If we cant set breakpoint on this declaration, set it on previous one + var indexOfCurrentDeclaration = indexOf(declarations, variableDeclaration); + return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); } } - switch (statement.kind()) { - case TypeScript.SyntaxKind.ExpressionStatement: - var expressionSyntax = statement; - return createBreakpointSpanInfo(expressionSyntax.expression); - - case TypeScript.SyntaxKind.ReturnStatement: - var returnStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, returnStatementSyntax.returnKeyword, returnStatementSyntax.expression); - - case TypeScript.SyntaxKind.ThrowStatement: - var throwStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, throwStatementSyntax.throwKeyword, throwStatementSyntax.expression); - - case TypeScript.SyntaxKind.BreakStatement: - var breakStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, breakStatementSyntax.breakKeyword, breakStatementSyntax.identifier); - - case TypeScript.SyntaxKind.ContinueStatement: - var continueStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, continueStatementSyntax.continueKeyword, continueStatementSyntax.identifier); - - case TypeScript.SyntaxKind.DebuggerStatement: - var debuggerStatementSyntax = statement; - return createBreakpointSpanInfo(debuggerStatementSyntax.debuggerKeyword); - - case TypeScript.SyntaxKind.LabeledStatement: - var labeledStatementSyntax = statement; - return this.breakpointSpanOf(labeledStatementSyntax.statement); + function canHaveSpanInParameterDeclaration(parameter: ParameterDeclaration): boolean { + // Breakpoint is possible on parameter only if it has initializer, is a rest parameter, or has public or private modifier + return !!parameter.initializer || !!(parameter.flags & NodeFlags.Rest) || + !!(parameter.flags & NodeFlags.Public) || !!(parameter.flags & NodeFlags.Private); } - return null; - } - - private getSyntaxListOfDeclarationWithElements(positionedNode: TypeScript.ISyntaxNode) { - var node = positionedNode; - var elementsList: TypeScript.ISyntaxNodeOrToken[]; - var block: TypeScript.BlockSyntax; - - switch (node.kind()) { - case TypeScript.SyntaxKind.ModuleDeclaration: - elementsList = (node).moduleElements; - break; - - case TypeScript.SyntaxKind.ClassDeclaration: - elementsList = (node).classElements; - break; - - case TypeScript.SyntaxKind.FunctionDeclaration: - block = (node).block; - break; - - case TypeScript.SyntaxKind.ConstructorDeclaration: - block = (node).block; - break; - - case TypeScript.SyntaxKind.MemberFunctionDeclaration: - block = (node).block; - break; - - case TypeScript.SyntaxKind.GetAccessor: - block = (node).block; - break; - - case TypeScript.SyntaxKind.SetAccessor: - block = (node).block; - break; - - case TypeScript.SyntaxKind.FunctionExpression: - block = (node).block; - break; - - case TypeScript.SyntaxKind.ParenthesizedArrowFunctionExpression: - block = (node).block; - break; - - case TypeScript.SyntaxKind.SimpleArrowFunctionExpression: - block = (node).block; - break; - - default: - throw TypeScript.Errors.argument('positionNode', 'unknown node kind in getSyntaxListOfDeclarationWithElements'); - } - - var parentElement: TypeScript.ISyntaxElement = positionedNode; - if (block) { - parentElement = block; - elementsList = block.statements; - } - - return elementsList; - } - - private canHaveBreakpointInDeclaration(positionedNode: TypeScript.ISyntaxNode) { - return positionedNode && !TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(positionedNode); - } - - private breakpointSpanOfDeclarationWithElements(positionedNode: TypeScript.ISyntaxNode): TextSpan { - if (!this.canHaveBreakpointInDeclaration(positionedNode)) { - return null; - } - - // If inside another module the whole declaration is debuggable - var node = positionedNode; - var moduleSyntax = positionedNode; - if ((SyntaxUtilities.isModuleElement(node) && Syntax.containingNode(positionedNode).kind() != TypeScript.SyntaxKind.SourceUnit) || - SyntaxUtilities.isClassElement(node) || - (moduleSyntax.kind() == TypeScript.SyntaxKind.ModuleDeclaration && moduleSyntax.name - && moduleSyntax.name.kind() == TypeScript.SyntaxKind.QualifiedName)) { - return createBreakpointSpanInfo(positionedNode); - } - else { - // Try to get the breakpoint in first element declaration - return this.breakpointSpanOfFirstChildOfSyntaxList(this.getSyntaxListOfDeclarationWithElements(positionedNode)); - } - } - - private canHaveBreakpointInVariableDeclarator(varDeclaratorNode: TypeScript.ISyntaxNode) { - if (!varDeclaratorNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varDeclaratorNode)) { - return false; - } - - var varDeclaratorSyntax = varDeclaratorNode; - return !!varDeclaratorSyntax.equalsValueClause; - } - - private breakpointSpanOfVariableDeclarator(varDeclaratorNode: TypeScript.ISyntaxNode): TextSpan { - if (!this.canHaveBreakpointInVariableDeclarator(varDeclaratorNode)) { - return null; - } - - var container = Syntax.containingNode(varDeclaratorNode); - if (container && container.kind() == TypeScript.SyntaxKind.VariableDeclaration) { - var parentDeclaratorsList = varDeclaratorNode.parent; - // If this is the first declarator in the list use the declaration instead - if (parentDeclaratorsList && childAt(parentDeclaratorsList, 0) == varDeclaratorNode) { - return this.breakpointSpanOfVariableDeclaration(container); - } - - // Create breakpoint on this var declarator - if (this.canHaveBreakpointInVariableDeclarator(varDeclaratorNode)) { - return createBreakpointSpanInfo(varDeclaratorNode); + function spanInParameterDeclaration(parameter: ParameterDeclaration): TextSpan { + if (canHaveSpanInParameterDeclaration(parameter)) { + return textSpan(parameter); } else { - return null; - } - } - else if (container) { - // Member Variable syntax - return this.breakpointSpanOfMemberVariableDeclaration(container); - } - - return null; - } - - private canHaveBreakpointInVariableDeclaration(varDeclarationNode: TypeScript.ISyntaxNode) { - if (!varDeclarationNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varDeclarationNode)) { - return false; - } - - var varDeclarationSyntax = varDeclarationNode; - var containerChildren = varDeclarationSyntax.variableDeclarators; - if (!containerChildren || childCount(containerChildren) == 0) { - return false; - } - - var child = childAt(containerChildren, 0); - if (isNode(child)) { - return this.canHaveBreakpointInVariableDeclarator(child); - } - - return false; - } - - private breakpointSpanOfVariableDeclaration(varDeclarationNode: TypeScript.ISyntaxNode): TextSpan { - if (!this.canHaveBreakpointInDeclaration(varDeclarationNode)) { - return null; - } - - var container = Syntax.containingNode(varDeclarationNode); - var varDeclarationSyntax = varDeclarationNode; - var varDeclarators = varDeclarationSyntax.variableDeclarators; - var varDeclaratorsCount = childCount(varDeclarators); // varDeclarators has to be non null because its checked in canHaveBreakpoint - - if (container && container.kind() == TypeScript.SyntaxKind.VariableStatement) { - return this.breakpointSpanOfVariableStatement(container); - } - - if (this.canHaveBreakpointInVariableDeclaration(varDeclarationNode)) { - return createBreakpointSpanInfoWithLimChar(varDeclarationNode, end(childAt(varDeclarators, 0))); - } - else { - return null; - } - } - - private canHaveBreakpointInVariableStatement(varStatementNode: TypeScript.ISyntaxNode) { - if (!varStatementNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varStatementNode)) { - return false; - } - - var variableStatement = varStatementNode; - return this.canHaveBreakpointInVariableDeclaration(variableStatement.variableDeclaration); - } - - private breakpointSpanOfVariableStatement(varStatementNode: TypeScript.ISyntaxNode): TextSpan { - if (!this.canHaveBreakpointInVariableStatement(varStatementNode)) { - return null; - } - - var variableStatement = varStatementNode; - var variableDeclaration = variableStatement.variableDeclaration; - var varDeclarationSyntax = variableDeclaration; - var varDeclarators = varDeclarationSyntax.variableDeclarators; - return createBreakpointSpanInfoWithLimChar(varStatementNode, end(childAt(varDeclarators, 0))); - } - - private breakpointSpanOfParameter(parameterNode: TypeScript.ISyntaxNode): TextSpan { - if (parameterNode.parent.kind() === SyntaxKind.SimpleArrowFunctionExpression) { - return this.breakpointSpanOfNode(parameterNode.parent); - } - - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(parameterNode)) { - return null; - } - - var parameterSyntax = parameterNode; - if (parameterSyntax.dotDotDotToken || parameterSyntax.equalsValueClause || parameterSyntax.modifiers.length > 0) { - return createBreakpointSpanInfo(parameterNode); - } - else { - return null; - } - } - - private breakpointSpanOfMemberVariableDeclaration(memberVarDeclarationNode: TypeScript.ISyntaxNode): TextSpan { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(memberVarDeclarationNode)) { - return null; - } - - var memberVariableDeclaration = memberVarDeclarationNode; - if (this.canHaveBreakpointInVariableDeclarator(memberVariableDeclaration.variableDeclarator)) { - return createBreakpointSpanInfo(memberVarDeclarationNode, memberVariableDeclaration.modifiers, memberVariableDeclaration.variableDeclarator); - } - else { - return null; - } - } - - private breakpointSpanOfImportDeclaration(importDeclarationNode: TypeScript.ISyntaxNode): TextSpan { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(importDeclarationNode)) { - return null; - } - - var importSyntax = importDeclarationNode; - return createBreakpointSpanInfo(importDeclarationNode, importSyntax.modifiers, importSyntax.importKeyword, importSyntax.identifier, importSyntax.equalsToken, importSyntax.moduleReference); - } - - private breakpointSpanOfEnumDeclaration(enumDeclarationNode: TypeScript.ISyntaxNode): TextSpan { - if (!this.canHaveBreakpointInDeclaration(enumDeclarationNode)) { - return null; - } - - return createBreakpointSpanInfo(enumDeclarationNode); - } - - private breakpointSpanOfFirstEnumElement(enumDeclarationNode: TypeScript.ISyntaxNode): TextSpan { - var enumDeclarationSyntax = enumDeclarationNode; - var enumElements = enumDeclarationSyntax.enumElements; - if (enumElements && childCount(enumElements)) { - return this.breakpointSpanOf(childAt(enumElements, 0)); - } - - return null; - } - - private breakpointSpanOfEnumElement(enumElementNode: TypeScript.ISyntaxNode): TextSpan { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(enumElementNode)) { - return null; - } - - return createBreakpointSpanInfo(enumElementNode); - } - - private breakpointSpanOfIfStatement(ifStatementNode: TypeScript.ISyntaxNode): TextSpan { - var ifStatement = ifStatementNode; - return createBreakpointSpanInfo(ifStatementNode, ifStatement.ifKeyword, ifStatement.openParenToken, ifStatement.condition, ifStatement.closeParenToken); - } - - private breakpointSpanOfElseClause(elseClauseNode: TypeScript.ISyntaxNode): TextSpan { - var elseClause = elseClauseNode; - return this.breakpointSpanOf(elseClause.statement); - } - - private breakpointSpanOfForInStatement(forInStatementNode: TypeScript.ISyntaxNode): TextSpan { - var forInStatement = forInStatementNode; - return createBreakpointSpanInfo(forInStatementNode, forInStatement.forKeyword, forInStatement.openParenToken, forInStatement.variableDeclaration, - forInStatement.left, forInStatement.inKeyword, forInStatement.expression, forInStatement.closeParenToken); - } - - private breakpointSpanOfForStatement(forStatementNode: TypeScript.ISyntaxNode): TextSpan { - var forStatement = forStatementNode; - return this.breakpointSpanOf(forStatement.variableDeclaration - ? forStatement.variableDeclaration - : forStatement.initializer); - } - - private breakpointSpanOfWhileStatement(whileStatementNode: TypeScript.ISyntaxNode): TextSpan { - var whileStatement = whileStatementNode; - return createBreakpointSpanInfo(whileStatementNode, whileStatement.whileKeyword, whileStatement.openParenToken, whileStatement.condition, whileStatement.closeParenToken); - } - - private breakpointSpanOfDoStatement(doStatementNode: TypeScript.ISyntaxNode): TextSpan { - var doStatement = doStatementNode; - return createBreakpointSpanInfo(doStatementNode, doStatement.whileKeyword, doStatement.openParenToken, doStatement.condition, doStatement.closeParenToken); - } - - private breakpointSpanOfSwitchStatement(switchStatementNode: TypeScript.ISyntaxNode): TextSpan { - var switchStatement = switchStatementNode; - return createBreakpointSpanInfo(switchStatementNode, switchStatement.switchKeyword, switchStatement.openParenToken, switchStatement.expression, switchStatement.closeParenToken); - } - - private breakpointSpanOfFirstStatementOfFirstCaseClause(switchStatementNode: TypeScript.ISyntaxNode): TextSpan { - var switchStatement = switchStatementNode; - if (switchStatement.switchClauses && switchStatement.switchClauses.length == 0) { - return null; - } - - var switchClauses = switchStatement.switchClauses; - if (switchClauses.length == 0) { - return null; - } - - var firstCaseClause = switchClauses[0]; - var statements = firstCaseClause.statements; - - return this.breakpointSpanOfFirstChildOfSyntaxList(statements); - } - - private breakpointSpanOfLastStatementOfLastCaseClause(switchStatementNode: TypeScript.ISyntaxNode): TextSpan { - var switchStatement = switchStatementNode; - if (switchStatement.switchClauses && switchStatement.switchClauses.length == 0) { - return null; - } - - var switchClauses = switchStatement.switchClauses; - if (switchClauses.length == 0) { - return null; - } - - var lastClauseNode = switchClauses[switchClauses.length - 1]; - var statements = lastClauseNode.statements; - - return this.breakpointSpanOfLastChildOfSyntaxList(statements); - } - - private breakpointSpanOfCaseSwitchClause(caseClauseNode: TypeScript.ISyntaxNode): TextSpan { - var caseSwitchClause = caseClauseNode; - return this.breakpointSpanOfFirstChildOfSyntaxList(caseSwitchClause.statements); - } - - private breakpointSpanOfDefaultSwitchClause(defaultSwithClauseNode: TypeScript.ISyntaxNode): TextSpan { - var defaultSwitchClause = defaultSwithClauseNode; - return this.breakpointSpanOfFirstChildOfSyntaxList(defaultSwitchClause.statements); - } - - private breakpointSpanOfWithStatement(withStatementNode: TypeScript.ISyntaxNode): TextSpan { - var withStatement = withStatementNode; - return this.breakpointSpanOf(withStatement.statement); - } - - private breakpointSpanOfTryStatement(tryStatementNode: TypeScript.ISyntaxNode): TextSpan { - var tryStatement = tryStatementNode; - return this.breakpointSpanOfFirstStatementInBlock(tryStatement.block); - } - - private breakpointSpanOfCatchClause(catchClauseNode: TypeScript.ISyntaxNode): TextSpan { - var catchClause = catchClauseNode; - return createBreakpointSpanInfo(catchClauseNode, catchClause.catchKeyword, catchClause.openParenToken, catchClause.identifier, catchClause.typeAnnotation, catchClause.closeParenToken); - } - - private breakpointSpanOfFinallyClause(finallyClauseNode: TypeScript.ISyntaxNode): TextSpan { - var finallyClause = finallyClauseNode; - return this.breakpointSpanOfFirstStatementInBlock(finallyClause.block); - } - - private breakpointSpanOfParenthesizedArrowFunctionExpression(arrowFunctionExpression: ParenthesizedArrowFunctionExpressionSyntax): TextSpan { - if (arrowFunctionExpression.block) { - return this.breakpointSpanOfFirstStatementInBlock(arrowFunctionExpression.block); - } - else { - return this.breakpointSpanOf(arrowFunctionExpression.expression); - } - } - - private breakpointSpanOfSimpleArrowFunctionExpression(arrowFunctionExpression: SimpleArrowFunctionExpressionSyntax): TextSpan { - if (arrowFunctionExpression.block) { - return this.breakpointSpanOfFirstStatementInBlock(arrowFunctionExpression.block); - } - else { - return this.breakpointSpanOf(arrowFunctionExpression.expression); - } - } - - private breakpointSpanOfContainingNode(positionedElement: ISyntaxElement): TextSpan { - var current = positionedElement.parent; - while (!isNode(current)) { - current = current.parent; - } - - return this.breakpointSpanOf(current); - } - - private breakpointSpanIfStartsOnSameLine(positionedElement: TypeScript.ISyntaxElement): TextSpan { - if (positionedElement && this.posLine == this.lineMap.getLineNumberFromPosition(start(positionedElement))) { - return this.breakpointSpanOf(positionedElement); - } - - return null; - } - - public breakpointSpanOf(positionedElement: TypeScript.ISyntaxElement): TextSpan { - if (!positionedElement) { - return null; - } - - for (var containingNode = Syntax.containingNode(positionedElement); containingNode != null; containingNode = Syntax.containingNode(containingNode)) { - if (containingNode.kind() == TypeScript.SyntaxKind.TypeAnnotation) { - return this.breakpointSpanIfStartsOnSameLine(containingNode); + var functionDeclaration = parameter.parent; + var indexOfParameter = indexOf(functionDeclaration.parameters, parameter); + if (indexOfParameter) { + // Not a first parameter, go to previous parameter + return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); + } + else { + // Set breakpoint in the function declaration body + return spanInNode(functionDeclaration.body); + } } } - var element = positionedElement; - - // Syntax node - if (isNode(element)) { - return this.breakpointSpanOfNode(positionedElement); + function canFunctionHaveSpanInWholeDeclaration(functionDeclaration: FunctionLikeDeclaration) { + return !!(functionDeclaration.flags & NodeFlags.Export) || + (functionDeclaration.parent.kind === SyntaxKind.ClassDeclaration && functionDeclaration.kind !== SyntaxKind.Constructor); } - // Token - if (isToken(element)) { - return this.breakpointSpanOfToken(positionedElement); + function spanInFunctionDeclaration(functionDeclaration: FunctionLikeDeclaration): TextSpan { + // No breakpoints in the function signature + if (!functionDeclaration.body) { + return undefined; + } + + if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) { + // Set the span on whole function declaration + return textSpan(functionDeclaration); + } + + // Set span in function body + return spanInNode(functionDeclaration.body); } - // List - // Separated List - return this.breakpointSpanOfContainingNode(positionedElement); + function spanInFunctionBlock(block: Block): TextSpan { + var nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); + if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { + return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); + } + + return spanInNode(nodeForSpanInBlock); + } + + function spanInBlock(block: Block): TextSpan { + switch (block.parent.kind) { + case SyntaxKind.ModuleDeclaration: + if (getModuleInstanceState(block.parent) !== ModuleInstanceState.Instantiated) { + return undefined; + } + + // Set on parent if on same line otherwise on first statement + case SyntaxKind.WhileStatement: + case SyntaxKind.IfStatement: + case SyntaxKind.ForInStatement: + return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); + + // Set span on previous token if it starts on same line otherwise on the first statement of the block + case SyntaxKind.ForStatement: + return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); + } + + // Default action is to set on first statement + return spanInNode(block.statements[0]); + } + + function spanInForStatement(forStatement: ForStatement): TextSpan { + if (forStatement.declarations) { + return spanInNode(forStatement.declarations[0]); + } + if (forStatement.initializer) { + return spanInNode(forStatement.initializer); + } + if (forStatement.condition) { + return textSpan(forStatement.condition); + } + if (forStatement.iterator) { + return textSpan(forStatement.iterator); + } + } + + // Tokens: + function spanInOpenBraceToken(node: Node): TextSpan { + switch (node.parent.kind) { + case SyntaxKind.EnumDeclaration: + var enumDeclaration = node.parent; + return spanInNodeIfStartsOnSameLine(findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); + + case SyntaxKind.ClassDeclaration: + var classDeclaration = node.parent; + return spanInNodeIfStartsOnSameLine(findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); + + case SyntaxKind.SwitchStatement: + return spanInNodeIfStartsOnSameLine(node.parent, (node.parent).clauses[0]); + } + + // Default to parent node + return spanInNode(node.parent); + } + + function spanInCloseBraceToken(node: Node): TextSpan { + switch (node.parent.kind) { + case SyntaxKind.ModuleBlock: + // If this is not instantiated module block no bp span + if (getModuleInstanceState(node.parent.parent) !== ModuleInstanceState.Instantiated) { + return undefined; + } + + case SyntaxKind.FunctionBlock: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ClassDeclaration: + // Span on close brace token + return textSpan(node); + + case SyntaxKind.Block: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + return spanInNode((node.parent).statements[(node.parent).statements.length - 1]);; + + case SyntaxKind.SwitchStatement: + // breakpoint in last statement of the last clause + var switchStatement = node.parent; + var lastClause = switchStatement.clauses[switchStatement.clauses.length - 1]; + if (lastClause) { + return spanInNode(lastClause.statements[lastClause.statements.length - 1]); + } + return undefined; + + // Default to parent node + default: + return spanInNode(node.parent); + } + } + + function spanInOpenParenToken(node: Node): TextSpan { + if (node.parent.kind === SyntaxKind.DoStatement) { + // Go to while keyword and do action instead + return spanInPreviousNode(node); + } + + // Default to parent node + return spanInNode(node.parent); + } + + function spanInCloseParenToken(node: Node): TextSpan { + // Is this close paren token of parameter list, set span in previous token + switch (node.parent.kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ArrowFunction: + case SyntaxKind.Method: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.Constructor: + case SyntaxKind.WhileStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.ForStatement: + return spanInPreviousNode(node); + + // Default to parent node + default: + return spanInNode(node.parent); + } + + // Default to parent node + return spanInNode(node.parent); + } + + function spanInColonToken(node: Node): TextSpan { + // Is this : specifying return annotation of the function declaration + if (isAnyFunction(node.parent) || node.parent.kind === SyntaxKind.PropertyAssignment) { + return spanInPreviousNode(node); + } + + return spanInNode(node.parent); + } + + function spanInGreaterThanOrLessThanToken(node: Node): TextSpan { + if (node.parent.kind === SyntaxKind.TypeAssertion) { + return spanInNode((node.parent).operand); + } + + return spanInNode(node.parent); + } + + function spanInWhileKeyword(node: Node): TextSpan { + if (node.parent.kind === SyntaxKind.DoStatement) { + // Set span on while expression + return textSpan(node, findNextToken((node.parent).expression, node.parent)); + } + + // Default to parent node + return spanInNode(node.parent); + } } - } - - export function getBreakpointLocation(syntaxTree: TypeScript.SyntaxTree, askedPos: number): TextSpan { - // Cannot set breakpoint in dts file - if (TypeScript.isDTSFile(syntaxTree.fileName())) { - return null; - } - - var sourceUnit = syntaxTree.sourceUnit(); - var positionedToken = TypeScript.findToken(sourceUnit, askedPos); - - var lineMap = syntaxTree.lineMap(); - var posLine = lineMap.getLineNumberFromPosition(askedPos); - var tokenStartLine = lineMap.getLineNumberFromPosition(start(positionedToken)); - if (posLine < tokenStartLine) { - return null; - } - - var breakpointResolver = new BreakpointResolver(posLine, lineMap); - return breakpointResolver.breakpointSpanOf(positionedToken); - } + } } \ No newline at end of file diff --git a/src/services/compiler/ast.ts b/src/services/compiler/ast.ts index 76b4903768d..e69de29bb2d 100644 --- a/src/services/compiler/ast.ts +++ b/src/services/compiler/ast.ts @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript { - export class Comment { - constructor(private _trivia: ISyntaxTrivia, - public endsLine: boolean, - public _start: number, - public _end: number) { - } - - public start(): number { - return this._start; - } - - public end(): number { - return this._end; - } - - public fullText(): string { - return this._trivia.fullText(); - } - - public kind(): SyntaxKind { - return this._trivia.kind(); - } - - public structuralEquals(ast: Comment, includingPosition: boolean): boolean { - if (includingPosition) { - if (this.start() !== ast.start() || this.end() !== ast.end()) { - return false; - } - } - - return this._trivia.fullText() === ast._trivia.fullText() && - this.endsLine === ast.endsLine; - } - } -} \ No newline at end of file diff --git a/src/services/compiler/astHelpers.ts b/src/services/compiler/astHelpers.ts index 589ef4b6340..e69de29bb2d 100644 --- a/src/services/compiler/astHelpers.ts +++ b/src/services/compiler/astHelpers.ts @@ -1,759 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.ASTHelpers { - - - var sentinelEmptyArray: any[] = []; - - //export function scriptIsElided(sourceUnit: SourceUnitSyntax): boolean { - // return isDTSFile(sourceUnit.syntaxTree.fileName()) || moduleMembersAreElided(sourceUnit.moduleElements); - //} - - //export function moduleIsElided(declaration: ModuleDeclarationSyntax): boolean { - // return hasModifier(declaration.modifiers, PullElementFlags.Ambient) || moduleMembersAreElided(declaration.moduleElements); - //} - - //function moduleMembersAreElided(members: IModuleElementSyntax[]): boolean { - // for (var i = 0, n = members.length; i < n; i++) { - // var member = members[i]; - - // // We should emit *this* module if it contains any non-interface types. - // // Caveat: if we have contain a module, then we should be emitted *if we want to - // // emit that inner module as well. - // if (member.kind() === SyntaxKind.ModuleDeclaration) { - // if (!moduleIsElided(member)) { - // return false; - // } - // } - // else if (member.kind() !== SyntaxKind.InterfaceDeclaration) { - // return false; - // } - // } - - // return true; - //} - - //export function enumIsElided(declaration: EnumDeclarationSyntax): boolean { - // if (hasModifier(declaration.modifiers, PullElementFlags.Ambient)) { - // return true; - // } - - // return false; - //} - - export function isValidAstNode(ast: ISyntaxElement): boolean { - return ast && !isShared(ast) && start(ast) !== -1 && end(ast) !== -1; - } - - export function isValidSpan(ast: ISpan): boolean { - if (!ast) - return false; - - if (ast.start() === -1 || ast.end() === -1) - return false; - - return true; - } - - /// - /// Return the ISyntaxElement containing "position" - /// - export function getAstAtPosition(script: ISyntaxElement, pos: number, useTrailingTriviaAsLimChar: boolean = true, forceInclusive: boolean = false): ISyntaxElement { - var top: ISyntaxElement = null; - - var pre = function (cur: ISyntaxElement, walker: IAstWalker) { - if (!isShared(cur) && isValidAstNode(cur)) { - var isInvalid1 = cur.kind() === SyntaxKind.ExpressionStatement && width(cur) === 0; - - if (isInvalid1) { - walker.options.goChildren = false; - } - else { - // Add "cur" to the stack if it contains our position - // For "identifier" nodes, we need a special case: A position equal to "limChar" is - // valid, since the position corresponds to a caret position (in between characters) - // For example: - // bar - // 0123 - // If "position === 3", the caret is at the "right" of the "r" character, which should be considered valid - var inclusive = - forceInclusive || - cur.kind() === SyntaxKind.IdentifierName || - cur.kind() === SyntaxKind.MemberAccessExpression || - cur.kind() === SyntaxKind.QualifiedName || - //cur.kind() === SyntaxKind.TypeRef || - cur.kind() === SyntaxKind.VariableDeclaration || - cur.kind() === SyntaxKind.VariableDeclarator || - cur.kind() === SyntaxKind.InvocationExpression || - pos === end(script) + lastToken(script).trailingTriviaWidth(); // Special "EOF" case - - var minChar = start(cur); - var limChar = end(cur) + (useTrailingTriviaAsLimChar ? trailingTriviaWidth(cur) : 0) + (inclusive ? 1 : 0); - if (pos >= minChar && pos < limChar) { - - // Ignore empty lists - if ((cur.kind() !== SyntaxKind.List && cur.kind() !== SyntaxKind.SeparatedList) || end(cur) > start(cur)) { - // TODO: Since ISyntaxElement is sometimes not correct wrt to position, only add "cur" if it's better - // than top of the stack. - if (top === null) { - top = cur; - } - else if (start(cur) >= start(top) && - (end(cur) + (useTrailingTriviaAsLimChar ? trailingTriviaWidth(cur) : 0)) <= (end(top) + (useTrailingTriviaAsLimChar ? trailingTriviaWidth(top) : 0))) { - // this new node appears to be better than the one we're - // storing. Make this the new node. - - // However, If the current top is a missing identifier, we - // don't want to replace it with another missing identifier. - // We want to return the first missing identifier found in a - // depth first walk of the tree. - if (width(top) !== 0 || width(cur) !== 0) { - top = cur; - } - } - } - } - - // Don't go further down the tree if pos is outside of [minChar, limChar] - walker.options.goChildren = (minChar <= pos && pos <= limChar); - } - } - }; - - getAstWalkerFactory().walk(script, pre); - return top; - } - - export function getExtendsHeritageClause(clauses: HeritageClauseSyntax[]): HeritageClauseSyntax { - return getHeritageClause(clauses, SyntaxKind.ExtendsHeritageClause); - } - - export function getImplementsHeritageClause(clauses: HeritageClauseSyntax[]): HeritageClauseSyntax { - return getHeritageClause(clauses, SyntaxKind.ImplementsHeritageClause); - } - - function getHeritageClause(clauses: HeritageClauseSyntax[], kind: SyntaxKind): HeritageClauseSyntax { - if (clauses) { - for (var i = 0, n = clauses.length; i < n; i++) { - var child = clauses[i]; - - if (child.typeNames.length > 0 && child.kind() === kind) { - return child; - } - } - } - - return null; - } - - export function isCallExpression(ast: ISyntaxElement): boolean { - return (ast && ast.kind() === SyntaxKind.InvocationExpression) || - (ast && ast.kind() === SyntaxKind.ObjectCreationExpression); - } - - export function isCallExpressionTarget(ast: ISyntaxElement): boolean { - return !!getCallExpressionTarget(ast); - } - - export function getCallExpressionTarget(ast: ISyntaxElement): ISyntaxElement { - if (!ast) { - return null; - } - - var current = ast; - - while (current && current.parent) { - if (current.parent.kind() === SyntaxKind.MemberAccessExpression && - (current.parent).name === current) { - current = current.parent; - continue; - } - - break; - } - - if (current && current.parent) { - if (current.parent.kind() === SyntaxKind.InvocationExpression || current.parent.kind() === SyntaxKind.ObjectCreationExpression) { - return current === (current.parent).expression ? current : null; - } - } - return null; - } - - function isNameOfSomeDeclaration(ast: ISyntaxElement) { - if (ast === null || ast.parent === null) { - return false; - } - if (ast.kind() !== SyntaxKind.IdentifierName) { - return false; - } - - switch (ast.parent.kind()) { - case SyntaxKind.ClassDeclaration: - return (ast.parent).identifier === ast; - case SyntaxKind.InterfaceDeclaration: - return (ast.parent).identifier === ast; - case SyntaxKind.EnumDeclaration: - return (ast.parent).identifier === ast; - case SyntaxKind.ModuleDeclaration: - return (ast.parent).name === ast || (ast.parent).stringLiteral === ast; - case SyntaxKind.VariableDeclarator: - return (ast.parent).propertyName === ast; - case SyntaxKind.FunctionDeclaration: - return (ast.parent).identifier === ast; - case SyntaxKind.MemberFunctionDeclaration: - return (ast.parent).propertyName === ast; - case SyntaxKind.Parameter: - return (ast.parent).identifier === ast; - case SyntaxKind.TypeParameter: - return (ast.parent).identifier === ast; - case SyntaxKind.SimplePropertyAssignment: - return (ast.parent).propertyName === ast; - case SyntaxKind.FunctionPropertyAssignment: - return (ast.parent).propertyName === ast; - case SyntaxKind.EnumElement: - return (ast.parent).propertyName === ast; - case SyntaxKind.ImportDeclaration: - return (ast.parent).identifier === ast; - case SyntaxKind.MethodSignature: - return (ast.parent).propertyName === ast; - case SyntaxKind.PropertySignature: - return (ast.parent).propertyName === ast; - } - - return false; - } - - export function isDeclarationASTOrDeclarationNameAST(ast: ISyntaxElement) { - return isNameOfSomeDeclaration(ast) || ASTHelpers.isDeclarationAST(ast); - } - - export function getEnclosingParameterForInitializer(ast: ISyntaxElement): ParameterSyntax { - var current = ast; - while (current) { - switch (current.kind()) { - case SyntaxKind.EqualsValueClause: - if (current.parent && current.parent.kind() === SyntaxKind.Parameter) { - return current.parent; - } - break; - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.ModuleDeclaration: - // exit early - return null; - } - - current = current.parent; - } - return null; - } - - export function getEnclosingMemberDeclaration(ast: ISyntaxElement): ISyntaxElement { - var current = ast; - - while (current) { - switch (current.kind()) { - case SyntaxKind.MemberVariableDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.MemberFunctionDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - return current; - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.ModuleDeclaration: - // exit early - return null; - } - current = current.parent; - } - - return null; - } - - export function isNameOfFunction(ast: ISyntaxElement) { - return ast - && ast.parent - && ast.kind() === SyntaxKind.IdentifierName - && ast.parent.kind() === SyntaxKind.FunctionDeclaration - && (ast.parent).identifier === ast; - } - - export function isNameOfMemberFunction(ast: ISyntaxElement) { - return ast - && ast.parent - && ast.kind() === SyntaxKind.IdentifierName - && ast.parent.kind() === SyntaxKind.MemberFunctionDeclaration - && (ast.parent).propertyName === ast; - } - - export function isNameOfMemberAccessExpression(ast: ISyntaxElement) { - if (ast && - ast.parent && - ast.parent.kind() === SyntaxKind.MemberAccessExpression && - (ast.parent).name === ast) { - - return true; - } - - return false; - } - - export function isRightSideOfQualifiedName(ast: ISyntaxElement) { - if (ast && - ast.parent && - ast.parent.kind() === SyntaxKind.QualifiedName && - (ast.parent).right === ast) { - - return true; - } - - return false; - } - - export function parentIsModuleDeclaration(ast: ISyntaxElement) { - return ast.parent && ast.parent.kind() === SyntaxKind.ModuleDeclaration; - } - - export function isDeclarationAST(ast: ISyntaxElement): boolean { - switch (ast.kind()) { - case SyntaxKind.VariableDeclarator: - return getVariableStatement(ast) !== null; - - case SyntaxKind.ImportDeclaration: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.Parameter: - case SyntaxKind.SimpleArrowFunctionExpression: - case SyntaxKind.ParenthesizedArrowFunctionExpression: - case SyntaxKind.IndexSignature: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.ArrayType: - case SyntaxKind.ObjectType: - case SyntaxKind.TypeParameter: - case SyntaxKind.ConstructorDeclaration: - case SyntaxKind.MemberFunctionDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.MemberVariableDeclaration: - case SyntaxKind.IndexMemberDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.EnumElement: - case SyntaxKind.SimplePropertyAssignment: - case SyntaxKind.FunctionPropertyAssignment: - case SyntaxKind.FunctionExpression: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - case SyntaxKind.MethodSignature: - case SyntaxKind.PropertySignature: - return true; - default: - return false; - } - } - - export function preComments(element: ISyntaxElement, text: ISimpleText): Comment[]{ - if (element) { - switch (element.kind()) { - case SyntaxKind.VariableStatement: - case SyntaxKind.ExpressionStatement: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.ImportDeclaration: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.IfStatement: - case SyntaxKind.SimplePropertyAssignment: - case SyntaxKind.MemberFunctionDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.ReturnStatement: - case SyntaxKind.ConstructorDeclaration: - case SyntaxKind.MemberVariableDeclaration: - case SyntaxKind.EnumElement: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - case SyntaxKind.IndexSignature: - case SyntaxKind.PropertySignature: - case SyntaxKind.MethodSignature: - case SyntaxKind.FunctionPropertyAssignment: - case SyntaxKind.Parameter: - return convertNodeLeadingComments(element, text); - } - } - - return null; - } - - export function postComments(element: ISyntaxElement, text: ISimpleText): Comment[] { - if (element) { - switch (element.kind()) { - case SyntaxKind.ExpressionStatement: - return convertNodeTrailingComments(element, text, /*allowWithNewLine:*/ true); - case SyntaxKind.VariableStatement: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.ImportDeclaration: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.IfStatement: - case SyntaxKind.SimplePropertyAssignment: - case SyntaxKind.MemberFunctionDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.ReturnStatement: - case SyntaxKind.ConstructorDeclaration: - case SyntaxKind.MemberVariableDeclaration: - case SyntaxKind.EnumElement: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - case SyntaxKind.IndexSignature: - case SyntaxKind.PropertySignature: - case SyntaxKind.MethodSignature: - case SyntaxKind.FunctionPropertyAssignment: - case SyntaxKind.Parameter: - return convertNodeTrailingComments(element, text); - } - } - - return null; - } - - function convertNodeTrailingComments(node: ISyntaxElement, text: ISimpleText, allowWithNewLine = false): Comment[]{ - // Bail out quickly before doing any expensive math computation. - var _lastToken = lastToken(node); - if (_lastToken === null || !_lastToken.hasTrailingTrivia()) { - return null; - } - - if (!allowWithNewLine && SyntaxUtilities.isLastTokenOnLine(_lastToken, text)) { - return null; - } - - return convertComments(_lastToken.trailingTrivia(text), fullStart(node) + fullWidth(node) - _lastToken.trailingTriviaWidth(text)); - } - - function convertNodeLeadingComments(element: ISyntaxElement, text: ISimpleText): Comment[]{ - if (element) { - return convertTokenLeadingComments(firstToken(element), text); - } - - return null; - } - - export function convertTokenLeadingComments(token: ISyntaxToken, text: ISimpleText): Comment[]{ - if (token === null) { - return null; - } - - return token.hasLeadingTrivia() - ? convertComments(token.leadingTrivia(text), token.fullStart()) - : null; - } - - export function convertTokenTrailingComments(token: ISyntaxToken, text: ISimpleText): Comment[] { - if (token === null) { - return null; - } - - return token.hasTrailingTrivia() - ? convertComments(token.trailingTrivia(text), fullEnd(token) - token.trailingTriviaWidth(text)) - : null; - } - - function convertComments(triviaList: ISyntaxTriviaList, commentStartPosition: number): Comment[]{ - var result: Comment[] = null; - - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - - if (trivia.isComment()) { - var hasTrailingNewLine = ((i + 1) < n) && triviaList.syntaxTriviaAt(i + 1).isNewLine(); - result = result || []; - result.push(convertComment(trivia, commentStartPosition, hasTrailingNewLine)); - } - - commentStartPosition += trivia.fullWidth(); - } - - return result; - } - - function convertComment(trivia: ISyntaxTrivia, commentStartPosition: number, hasTrailingNewLine: boolean): Comment { - var comment = new Comment(trivia, hasTrailingNewLine, commentStartPosition, commentStartPosition + trivia.fullWidth()); - - return comment; - } - - export function docComments(ast: ISyntaxElement, text: ISimpleText): Comment[] { - if (isDeclarationAST(ast)) { - var comments: Comment[] = null; - - if (ast.kind() === SyntaxKind.VariableDeclarator) { - // Get the doc comments for a variable off of the variable statement. That's what - // they'll be attached to in the tree. - comments = TypeScript.ASTHelpers.preComments(getVariableStatement(ast), text); - } - else if (ast.kind() === SyntaxKind.Parameter) { - // First check if the parameter was written like so: - // ( - // /** blah */ a, - // /** blah */ b); - comments = TypeScript.ASTHelpers.preComments(ast, text); - if (!comments) { - // Now check if it was written like so: - // (/** blah */ a, /** blah */ b); - // In this case, the comment will belong to the preceding token. - var previousToken = findToken(syntaxTree(ast).sourceUnit(), firstToken(ast).fullStart() - 1); - if (previousToken && (previousToken.kind() === SyntaxKind.OpenParenToken || previousToken.kind() === SyntaxKind.CommaToken)) { - comments = convertTokenTrailingComments(previousToken, text); - } - } - } - else { - comments = TypeScript.ASTHelpers.preComments(ast, text); - } - - if (comments && comments.length > 0) { - return comments.filter(c => isDocComment(c)); - } - } - - return sentinelEmptyArray; - } - - export function isDocComment(comment: Comment) { - if (comment.kind() === SyntaxKind.MultiLineCommentTrivia) { - var fullText = comment.fullText(); - return fullText.charAt(2) === "*" && fullText.charAt(3) !== "/"; - } - - return false; - } - - export function getParameterList(ast: ISyntaxElement): ParameterListSyntax { - if (ast) { - switch (ast.kind()) { - case SyntaxKind.ConstructorDeclaration: - return getParameterList((ast).callSignature); - case SyntaxKind.FunctionDeclaration: - return getParameterList((ast).callSignature); - case SyntaxKind.ParenthesizedArrowFunctionExpression: - return getParameterList((ast).callSignature); - case SyntaxKind.ConstructSignature: - return getParameterList((ast).callSignature); - case SyntaxKind.MemberFunctionDeclaration: - return getParameterList((ast).callSignature); - case SyntaxKind.FunctionPropertyAssignment: - return getParameterList((ast).callSignature); - case SyntaxKind.FunctionExpression: - return getParameterList((ast).callSignature); - case SyntaxKind.MethodSignature: - return getParameterList((ast).callSignature); - case SyntaxKind.ConstructorType: - return (ast).parameterList; - case SyntaxKind.FunctionType: - return (ast).parameterList; - case SyntaxKind.CallSignature: - return (ast).parameterList; - case SyntaxKind.GetAccessor: - return getParameterList((ast).callSignature); - case SyntaxKind.SetAccessor: - return getParameterList((ast).callSignature); - } - } - - return null; - } - - export function getType(ast: ISyntaxElement): ITypeSyntax { - if (ast) { - switch (ast.kind()) { - case SyntaxKind.FunctionDeclaration: - return getType((ast).callSignature); - case SyntaxKind.ParenthesizedArrowFunctionExpression: - return getType((ast).callSignature); - case SyntaxKind.ConstructSignature: - return getType((ast).callSignature); - case SyntaxKind.MemberFunctionDeclaration: - return getType((ast).callSignature); - case SyntaxKind.FunctionPropertyAssignment: - return getType((ast).callSignature); - case SyntaxKind.FunctionExpression: - return getType((ast).callSignature); - case SyntaxKind.MethodSignature: - return getType((ast).callSignature); - case SyntaxKind.CallSignature: - return getType((ast).typeAnnotation); - case SyntaxKind.IndexSignature: - return getType((ast).typeAnnotation); - case SyntaxKind.PropertySignature: - return getType((ast).typeAnnotation); - case SyntaxKind.GetAccessor: - return getType((ast).callSignature); - case SyntaxKind.Parameter: - return getType((ast).typeAnnotation); - case SyntaxKind.MemberVariableDeclaration: - return getType((ast).variableDeclarator); - case SyntaxKind.VariableDeclarator: - return getType((ast).typeAnnotation); - case SyntaxKind.CatchClause: - return getType((ast).typeAnnotation); - case SyntaxKind.ConstructorType: - return (ast).type; - case SyntaxKind.FunctionType: - return (ast).type; - case SyntaxKind.TypeAnnotation: - return (ast).type; - } - } - - return null; - } - - function getVariableStatement(variableDeclarator: VariableDeclaratorSyntax): VariableStatementSyntax { - if (variableDeclarator && variableDeclarator.parent && variableDeclarator.parent.parent && variableDeclarator.parent.parent.parent && - variableDeclarator.parent.kind() === SyntaxKind.SeparatedList && - variableDeclarator.parent.parent.kind() === SyntaxKind.VariableDeclaration && - variableDeclarator.parent.parent.parent.kind() === SyntaxKind.VariableStatement) { - - return variableDeclarator.parent.parent.parent; - } - - return null; - } - - export function getVariableDeclaratorModifiers(variableDeclarator: VariableDeclaratorSyntax): ISyntaxToken[] { - var variableStatement = getVariableStatement(variableDeclarator); - return variableStatement ? variableStatement.modifiers : Syntax.emptyList(); - } - - export function isIntegerLiteralAST(expression: ISyntaxElement): boolean { - if (expression) { - switch (expression.kind()) { - case SyntaxKind.PlusExpression: - case SyntaxKind.NegateExpression: - // Note: if there is a + or - sign, we can only allow a normal integer following - // (and not a hex integer). i.e. -0xA is a legal expression, but it is not a - // *literal*. - expression = (expression).operand; - return expression.kind() === SyntaxKind.NumericLiteral && IntegerUtilities.isInteger((expression).text()); - - case SyntaxKind.NumericLiteral: - // If it doesn't have a + or -, then either an integer literal or a hex literal - // is acceptable. - var text = (expression).text(); - return IntegerUtilities.isInteger(text) || IntegerUtilities.isHexInteger(text); - } - } - - return false; - } - - export function getEnclosingModuleDeclaration(ast: ISyntaxElement): ModuleDeclarationSyntax { - while (ast) { - if (ast.kind() === SyntaxKind.ModuleDeclaration) { - return ast; - } - - ast = ast.parent; - } - - return null; - } - - function isEntireNameOfModuleDeclaration(nameAST: ISyntaxElement) { - return parentIsModuleDeclaration(nameAST) && (nameAST.parent).name === nameAST; - } - - export function getModuleDeclarationFromNameAST(ast: ISyntaxElement): ModuleDeclarationSyntax { - if (ast) { - switch (ast.kind()) { - case SyntaxKind.StringLiteral: - if (parentIsModuleDeclaration(ast) && (ast.parent).stringLiteral === ast) { - return ast.parent; - } - return null; - - case SyntaxKind.IdentifierName: - case SyntaxKind.QualifiedName: - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - break; - - default: - return null; - } - - // Only qualified names can be name of module declaration if they didnt satisfy above conditions - for (ast = ast.parent; ast && ast.kind() === SyntaxKind.QualifiedName; ast = ast.parent) { - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - } - } - - return null; - } - - export function isLastNameOfModule(ast: ModuleDeclarationSyntax, astName: ISyntaxElement): boolean { - if (ast) { - if (ast.stringLiteral) { - return astName === ast.stringLiteral; - } - else if (ast.name.kind() === SyntaxKind.QualifiedName) { - return astName === (ast.name).right; - } - else { - return astName === ast.name; - } - } - - return false; - } - - export function getNameOfIdentifierOrQualifiedName(name: ISyntaxElement): string { - if (name.kind() === SyntaxKind.IdentifierName) { - return (name).text(); - } - else { - Debug.assert(name.kind() == SyntaxKind.QualifiedName); - var dotExpr = name; - return getNameOfIdentifierOrQualifiedName(dotExpr.left) + "." + getNameOfIdentifierOrQualifiedName(dotExpr.right); - } - } - - export function getModuleNames(name: ISyntaxElement, result?: ISyntaxToken[]): ISyntaxToken[] { - result = result || []; - - if (name.kind() === SyntaxKind.QualifiedName) { - getModuleNames((name).left, result); - result.push((name).right); - } - else { - result.push(name); - } - - return result; - } -} \ No newline at end of file diff --git a/src/services/compiler/astWalker.ts b/src/services/compiler/astWalker.ts index 53d22142cbb..e69de29bb2d 100644 --- a/src/services/compiler/astWalker.ts +++ b/src/services/compiler/astWalker.ts @@ -1,716 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript { - function walkListChildren(preAst: ISyntaxNodeOrToken[], walker: AstWalker): void { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - - function walkThrowStatementChildren(preAst: ThrowStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkPrefixUnaryExpressionChildren(preAst: PrefixUnaryExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.operand); - } - - function walkPostfixUnaryExpressionChildren(preAst: PostfixUnaryExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.operand); - } - - function walkDeleteExpressionChildren(preAst: DeleteExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkTypeArgumentListChildren(preAst: TypeArgumentListSyntax, walker: AstWalker): void { - walker.walk(preAst.typeArguments); - } - - function walkTypeOfExpressionChildren(preAst: TypeOfExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkVoidExpressionChildren(preAst: VoidExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkArgumentListChildren(preAst: ArgumentListSyntax, walker: AstWalker): void { - walker.walk(preAst.typeArgumentList); - walker.walk(preAst.arguments); - } - - function walkArrayLiteralExpressionChildren(preAst: ArrayLiteralExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expressions); - } - - function walkSimplePropertyAssignmentChildren(preAst: SimplePropertyAssignmentSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.expression); - } - - function walkFunctionPropertyAssignmentChildren(preAst: FunctionPropertyAssignmentSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkGetAccessorChildren(preAst: GetAccessorSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkSeparatedListChildren(preAst: ISyntaxNodeOrToken[], walker: AstWalker): void { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - - function walkSetAccessorChildren(preAst: SetAccessorSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkObjectLiteralExpressionChildren(preAst: ObjectLiteralExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyAssignments); - } - - function walkCastExpressionChildren(preAst: CastExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.type); - walker.walk(preAst.expression); - } - - function walkParenthesizedExpressionChildren(preAst: ParenthesizedExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkElementAccessExpressionChildren(preAst: ElementAccessExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.argumentExpression); - } - - function walkMemberAccessExpressionChildren(preAst: MemberAccessExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.name); - } - - function walkQualifiedNameChildren(preAst: QualifiedNameSyntax, walker: AstWalker): void { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - - function walkBinaryExpressionChildren(preAst: BinaryExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - - function walkEqualsValueClauseChildren(preAst: EqualsValueClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.value); - } - - function walkTypeParameterChildren(preAst: TypeParameterSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.constraint); - } - - function walkTypeParameterListChildren(preAst: TypeParameterListSyntax, walker: AstWalker): void { - walker.walk(preAst.typeParameters); - } - - function walkGenericTypeChildren(preAst: GenericTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.name); - walker.walk(preAst.typeArgumentList); - } - - function walkTypeAnnotationChildren(preAst: TypeAnnotationSyntax, walker: AstWalker): void { - walker.walk(preAst.type); - } - - function walkTypeQueryChildren(preAst: TypeQuerySyntax, walker: AstWalker): void { - walker.walk(preAst.name); - } - - function walkInvocationExpressionChildren(preAst: InvocationExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - - function walkObjectCreationExpressionChildren(preAst: ObjectCreationExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - - function walkTrinaryExpressionChildren(preAst: ConditionalExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.condition); - walker.walk(preAst.whenTrue); - walker.walk(preAst.whenFalse); - } - - function walkFunctionExpressionChildren(preAst: FunctionExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkFunctionTypeChildren(preAst: FunctionTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - - function walkParenthesizedArrowFunctionExpressionChildren(preAst: ParenthesizedArrowFunctionExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - - function walkSimpleArrowFunctionExpressionChildren(preAst: SimpleArrowFunctionExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.parameter); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - - function walkMemberFunctionDeclarationChildren(preAst: MemberFunctionDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkFuncDeclChildren(preAst: FunctionDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkIndexMemberDeclarationChildren(preAst: IndexMemberDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.indexSignature); - } - - function walkIndexSignatureChildren(preAst: IndexSignatureSyntax, walker: AstWalker): void { - walker.walk(preAst.parameters); - walker.walk(preAst.typeAnnotation); - } - - function walkCallSignatureChildren(preAst: CallSignatureSyntax, walker: AstWalker): void { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.typeAnnotation); - } - - function walkConstraintChildren(preAst: ConstraintSyntax, walker: AstWalker): void { - walker.walk(preAst.typeOrExpression); - } - - function walkConstructorDeclarationChildren(preAst: ConstructorDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkConstructorTypeChildren(preAst: FunctionTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - - function walkConstructSignatureChildren(preAst: ConstructSignatureSyntax, walker: AstWalker): void { - walker.walk(preAst.callSignature); - } - - function walkParameterChildren(preAst: ParameterSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - - function walkParameterListChildren(preAst: ParameterListSyntax, walker: AstWalker): void { - walker.walk(preAst.parameters); - } - - function walkPropertySignatureChildren(preAst: PropertySignatureSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - } - - function walkVariableDeclaratorChildren(preAst: VariableDeclaratorSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - - function walkMemberVariableDeclarationChildren(preAst: MemberVariableDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.variableDeclarator); - } - - function walkMethodSignatureChildren(preAst: MethodSignatureSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - } - - function walkReturnStatementChildren(preAst: ReturnStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkForStatementChildren(preAst: ForStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.initializer); - walker.walk(preAst.condition); - walker.walk(preAst.incrementor); - walker.walk(preAst.statement); - } - - function walkForInStatementChildren(preAst: ForInStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.left); - walker.walk(preAst.expression); - walker.walk(preAst.statement); - } - - function walkIfStatementChildren(preAst: IfStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - walker.walk(preAst.elseClause); - } - - function walkElseClauseChildren(preAst: ElseClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.statement); - } - - function walkWhileStatementChildren(preAst: WhileStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkDoStatementChildren(preAst: DoStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkBlockChildren(preAst: BlockSyntax, walker: AstWalker): void { - walker.walk(preAst.statements); - } - - function walkVariableDeclarationChildren(preAst: VariableDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.variableDeclarators); - } - - function walkCaseSwitchClauseChildren(preAst: CaseSwitchClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.statements); - } - - function walkDefaultSwitchClauseChildren(preAst: DefaultSwitchClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.statements); - } - - function walkSwitchStatementChildren(preAst: SwitchStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.switchClauses); - } - - function walkTryStatementChildren(preAst: TryStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.block); - walker.walk(preAst.catchClause); - walker.walk(preAst.finallyClause); - } - - function walkCatchClauseChildren(preAst: CatchClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.block); - } - - function walkExternalModuleReferenceChildren(preAst: ExternalModuleReferenceSyntax, walker: AstWalker): void { - walker.walk(preAst.stringLiteral); - } - - function walkFinallyClauseChildren(preAst: FinallyClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.block); - } - - function walkClassDeclChildren(preAst: ClassDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.classElements); - } - - function walkScriptChildren(preAst: SourceUnitSyntax, walker: AstWalker): void { - walker.walk(preAst.moduleElements); - } - - function walkHeritageClauseChildren(preAst: HeritageClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.typeNames); - } - - function walkInterfaceDeclerationChildren(preAst: InterfaceDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.body); - } - - function walkObjectTypeChildren(preAst: ObjectTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.typeMembers); - } - - function walkArrayTypeChildren(preAst: ArrayTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.type); - } - - function walkModuleDeclarationChildren(preAst: ModuleDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.name); - walker.walk(preAst.stringLiteral); - walker.walk(preAst.moduleElements); - } - - function walkModuleNameModuleReferenceChildren(preAst: ModuleNameModuleReferenceSyntax, walker: AstWalker): void { - walker.walk(preAst.moduleName); - } - - function walkEnumDeclarationChildren(preAst: EnumDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.enumElements); - } - - function walkEnumElementChildren(preAst: EnumElementSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.equalsValueClause); - } - - function walkImportDeclarationChildren(preAst: ImportDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.moduleReference); - } - - function walkExportAssignmentChildren(preAst: ExportAssignmentSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - } - - function walkWithStatementChildren(preAst: WithStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkExpressionStatementChildren(preAst: ExpressionStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkLabeledStatementChildren(preAst: LabeledStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.statement); - } - - function walkVariableStatementChildren(preAst: VariableStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.variableDeclaration); - } - - var childrenWalkers: IAstWalkChildren[] = new Array(SyntaxKind.LastNode + 1); - - // Tokens/trivia can't ever be walked into. - for (var i = SyntaxKind.FirstToken, n = SyntaxKind.LastToken; i <= n; i++) { - childrenWalkers[i] = null; - } - for (var i = SyntaxKind.FirstTrivia, n = SyntaxKind.LastTrivia; i <= n; i++) { - childrenWalkers[i] = null; - } - - childrenWalkers[SyntaxKind.AddAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.AddExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.AndAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.AnyKeyword] = null; - childrenWalkers[SyntaxKind.ArgumentList] = walkArgumentListChildren; - childrenWalkers[SyntaxKind.ArrayLiteralExpression] = walkArrayLiteralExpressionChildren; - childrenWalkers[SyntaxKind.ArrayType] = walkArrayTypeChildren; - childrenWalkers[SyntaxKind.SimpleArrowFunctionExpression] = walkSimpleArrowFunctionExpressionChildren; - childrenWalkers[SyntaxKind.ParenthesizedArrowFunctionExpression] = walkParenthesizedArrowFunctionExpressionChildren; - childrenWalkers[SyntaxKind.AssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.BitwiseAndExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.BitwiseExclusiveOrExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.BitwiseNotExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.BitwiseOrExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.Block] = walkBlockChildren; - childrenWalkers[SyntaxKind.BooleanKeyword] = null; - childrenWalkers[SyntaxKind.BreakStatement] = null; - childrenWalkers[SyntaxKind.CallSignature] = walkCallSignatureChildren; - childrenWalkers[SyntaxKind.CaseSwitchClause] = walkCaseSwitchClauseChildren; - childrenWalkers[SyntaxKind.CastExpression] = walkCastExpressionChildren; - childrenWalkers[SyntaxKind.CatchClause] = walkCatchClauseChildren; - childrenWalkers[SyntaxKind.ClassDeclaration] = walkClassDeclChildren; - childrenWalkers[SyntaxKind.CommaExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.ConditionalExpression] = walkTrinaryExpressionChildren; - childrenWalkers[SyntaxKind.Constraint] = walkConstraintChildren; - childrenWalkers[SyntaxKind.ConstructorDeclaration] = walkConstructorDeclarationChildren; - childrenWalkers[SyntaxKind.ConstructSignature] = walkConstructSignatureChildren; - childrenWalkers[SyntaxKind.ContinueStatement] = null; - childrenWalkers[SyntaxKind.ConstructorType] = walkConstructorTypeChildren; - childrenWalkers[SyntaxKind.DebuggerStatement] = null; - childrenWalkers[SyntaxKind.DefaultSwitchClause] = walkDefaultSwitchClauseChildren; - childrenWalkers[SyntaxKind.DeleteExpression] = walkDeleteExpressionChildren; - childrenWalkers[SyntaxKind.DivideAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.DivideExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.DoStatement] = walkDoStatementChildren; - childrenWalkers[SyntaxKind.ElementAccessExpression] = walkElementAccessExpressionChildren; - childrenWalkers[SyntaxKind.ElseClause] = walkElseClauseChildren; - childrenWalkers[SyntaxKind.EmptyStatement] = null; - childrenWalkers[SyntaxKind.EnumDeclaration] = walkEnumDeclarationChildren; - childrenWalkers[SyntaxKind.EnumElement] = walkEnumElementChildren; - childrenWalkers[SyntaxKind.EqualsExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.EqualsValueClause] = walkEqualsValueClauseChildren; - childrenWalkers[SyntaxKind.EqualsWithTypeConversionExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.ExclusiveOrAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.ExportAssignment] = walkExportAssignmentChildren; - childrenWalkers[SyntaxKind.ExpressionStatement] = walkExpressionStatementChildren; - childrenWalkers[SyntaxKind.ExtendsHeritageClause] = walkHeritageClauseChildren; - childrenWalkers[SyntaxKind.ExternalModuleReference] = walkExternalModuleReferenceChildren; - childrenWalkers[SyntaxKind.FalseKeyword] = null; - childrenWalkers[SyntaxKind.FinallyClause] = walkFinallyClauseChildren; - childrenWalkers[SyntaxKind.ForInStatement] = walkForInStatementChildren; - childrenWalkers[SyntaxKind.ForStatement] = walkForStatementChildren; - childrenWalkers[SyntaxKind.FunctionDeclaration] = walkFuncDeclChildren; - childrenWalkers[SyntaxKind.FunctionExpression] = walkFunctionExpressionChildren; - childrenWalkers[SyntaxKind.FunctionPropertyAssignment] = walkFunctionPropertyAssignmentChildren; - childrenWalkers[SyntaxKind.FunctionType] = walkFunctionTypeChildren; - childrenWalkers[SyntaxKind.GenericType] = walkGenericTypeChildren; - childrenWalkers[SyntaxKind.GetAccessor] = walkGetAccessorChildren; - childrenWalkers[SyntaxKind.GreaterThanExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.GreaterThanOrEqualExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.IfStatement] = walkIfStatementChildren; - childrenWalkers[SyntaxKind.ImplementsHeritageClause] = walkHeritageClauseChildren; - childrenWalkers[SyntaxKind.ImportDeclaration] = walkImportDeclarationChildren; - childrenWalkers[SyntaxKind.IndexMemberDeclaration] = walkIndexMemberDeclarationChildren; - childrenWalkers[SyntaxKind.IndexSignature] = walkIndexSignatureChildren; - childrenWalkers[SyntaxKind.InExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.InstanceOfExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.InterfaceDeclaration] = walkInterfaceDeclerationChildren; - childrenWalkers[SyntaxKind.InvocationExpression] = walkInvocationExpressionChildren; - childrenWalkers[SyntaxKind.LabeledStatement] = walkLabeledStatementChildren; - childrenWalkers[SyntaxKind.LeftShiftAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.LeftShiftExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.LessThanExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.LessThanOrEqualExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.List] = walkListChildren; - childrenWalkers[SyntaxKind.LogicalAndExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.LogicalNotExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.LogicalOrExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.MemberAccessExpression] = walkMemberAccessExpressionChildren; - childrenWalkers[SyntaxKind.MemberFunctionDeclaration] = walkMemberFunctionDeclarationChildren; - childrenWalkers[SyntaxKind.MemberVariableDeclaration] = walkMemberVariableDeclarationChildren; - childrenWalkers[SyntaxKind.MethodSignature] = walkMethodSignatureChildren; - childrenWalkers[SyntaxKind.ModuleDeclaration] = walkModuleDeclarationChildren; - childrenWalkers[SyntaxKind.ModuleNameModuleReference] = walkModuleNameModuleReferenceChildren; - childrenWalkers[SyntaxKind.ModuloAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.ModuloExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.MultiplyAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.MultiplyExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.IdentifierName] = null; - childrenWalkers[SyntaxKind.NegateExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.None] = null; - childrenWalkers[SyntaxKind.NotEqualsExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.NotEqualsWithTypeConversionExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.NullKeyword] = null; - childrenWalkers[SyntaxKind.NumberKeyword] = null; - childrenWalkers[SyntaxKind.NumericLiteral] = null; - childrenWalkers[SyntaxKind.ObjectCreationExpression] = walkObjectCreationExpressionChildren; - childrenWalkers[SyntaxKind.ObjectLiteralExpression] = walkObjectLiteralExpressionChildren; - childrenWalkers[SyntaxKind.ObjectType] = walkObjectTypeChildren; - childrenWalkers[SyntaxKind.OmittedExpression] = null; - childrenWalkers[SyntaxKind.OrAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.Parameter] = walkParameterChildren; - childrenWalkers[SyntaxKind.ParameterList] = walkParameterListChildren; - childrenWalkers[SyntaxKind.ParenthesizedExpression] = walkParenthesizedExpressionChildren; - childrenWalkers[SyntaxKind.PlusExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.PostDecrementExpression] = walkPostfixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.PostIncrementExpression] = walkPostfixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.PreDecrementExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.PreIncrementExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.PropertySignature] = walkPropertySignatureChildren; - childrenWalkers[SyntaxKind.QualifiedName] = walkQualifiedNameChildren; - childrenWalkers[SyntaxKind.RegularExpressionLiteral] = null; - childrenWalkers[SyntaxKind.ReturnStatement] = walkReturnStatementChildren; - childrenWalkers[SyntaxKind.SourceUnit] = walkScriptChildren; - childrenWalkers[SyntaxKind.SeparatedList] = walkSeparatedListChildren; - childrenWalkers[SyntaxKind.SetAccessor] = walkSetAccessorChildren; - childrenWalkers[SyntaxKind.SignedRightShiftAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.SignedRightShiftExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.SimplePropertyAssignment] = walkSimplePropertyAssignmentChildren; - childrenWalkers[SyntaxKind.StringLiteral] = null; - childrenWalkers[SyntaxKind.StringKeyword] = null; - childrenWalkers[SyntaxKind.SubtractAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.SubtractExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.SuperKeyword] = null; - childrenWalkers[SyntaxKind.SwitchStatement] = walkSwitchStatementChildren; - childrenWalkers[SyntaxKind.ThisKeyword] = null; - childrenWalkers[SyntaxKind.ThrowStatement] = walkThrowStatementChildren; - childrenWalkers[SyntaxKind.TriviaList] = null; - childrenWalkers[SyntaxKind.TrueKeyword] = null; - childrenWalkers[SyntaxKind.TryStatement] = walkTryStatementChildren; - childrenWalkers[SyntaxKind.TypeAnnotation] = walkTypeAnnotationChildren; - childrenWalkers[SyntaxKind.TypeArgumentList] = walkTypeArgumentListChildren; - childrenWalkers[SyntaxKind.TypeOfExpression] = walkTypeOfExpressionChildren; - childrenWalkers[SyntaxKind.TypeParameter] = walkTypeParameterChildren; - childrenWalkers[SyntaxKind.TypeParameterList] = walkTypeParameterListChildren; - childrenWalkers[SyntaxKind.TypeQuery] = walkTypeQueryChildren; - childrenWalkers[SyntaxKind.UnsignedRightShiftAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.UnsignedRightShiftExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.VariableDeclaration] = walkVariableDeclarationChildren; - childrenWalkers[SyntaxKind.VariableDeclarator] = walkVariableDeclaratorChildren; - childrenWalkers[SyntaxKind.VariableStatement] = walkVariableStatementChildren; - childrenWalkers[SyntaxKind.VoidExpression] = walkVoidExpressionChildren; - childrenWalkers[SyntaxKind.VoidKeyword] = null; - childrenWalkers[SyntaxKind.WhileStatement] = walkWhileStatementChildren; - childrenWalkers[SyntaxKind.WithStatement] = walkWithStatementChildren; - - // Verify the code is up to date with the enum - for (var e in SyntaxKind) { - if (SyntaxKind.hasOwnProperty(e) && StringUtilities.isString(SyntaxKind[e])) { - TypeScript.Debug.assert(childrenWalkers[e] !== undefined, "Fix initWalkers: " + SyntaxKind[e]); - } - } - - export class AstWalkOptions { - public goChildren = true; - public stopWalking = false; - } - - interface IAstWalkChildren { - (preAst: ISyntaxElement, walker: AstWalker): void; - } - - export interface IAstWalker { - options: AstWalkOptions; - state: any - } - - interface AstWalker { - walk(ast: ISyntaxElement): void; - } - - class SimplePreAstWalker implements AstWalker { - public options: AstWalkOptions = new AstWalkOptions(); - - constructor( - private pre: (ast: ISyntaxElement, state: any) => void, - public state: any) { - } - - public walk(ast: ISyntaxElement): void { - if (!ast) { - return; - } - - this.pre(ast, this.state); - - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - } - } - - class SimplePrePostAstWalker implements AstWalker { - public options: AstWalkOptions = new AstWalkOptions(); - - constructor( - private pre: (ast: ISyntaxElement, state: any) => void, - private post: (ast: ISyntaxElement, state: any) => void, - public state: any) { - } - - public walk(ast: ISyntaxElement): void { - if (!ast) { - return; - } - - this.pre(ast, this.state); - - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - - this.post(ast, this.state); - } - } - - class NormalAstWalker implements AstWalker { - public options: AstWalkOptions = new AstWalkOptions(); - - constructor( - private pre: (ast: ISyntaxElement, walker: IAstWalker) => void, - private post: (ast: ISyntaxElement, walker: IAstWalker) => void, - public state: any) { - } - - public walk(ast: ISyntaxElement): void { - if (!ast) { - return; - } - - // If we're stopping, then bail out immediately. - if (this.options.stopWalking) { - return; - } - - this.pre(ast, this); - - // If we were asked to stop, then stop. - if (this.options.stopWalking) { - return; - } - - if (this.options.goChildren) { - // Call the "walkChildren" function corresponding to "nodeType". - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - } - else { - // no go only applies to children of node issuing it - this.options.goChildren = true; - } - - if (this.post) { - this.post(ast, this); - } - } - } - - export class AstWalkerFactory { - public walk(ast: ISyntaxElement, pre: (ast: ISyntaxElement, walker: IAstWalker) => void, post?: (ast: ISyntaxElement, walker: IAstWalker) => void, state?: any): void { - new NormalAstWalker(pre, post, state).walk(ast); - } - - public simpleWalk(ast: ISyntaxElement, pre: (ast: ISyntaxElement, state: any) => void, post?: (ast: ISyntaxElement, state: any) => void, state?: any): void { - if (post) { - new SimplePrePostAstWalker(pre, post, state).walk(ast); - } - else { - new SimplePreAstWalker(pre, state).walk(ast); - } - } - } - - var globalAstWalkerFactory = new AstWalkerFactory(); - - export function getAstWalkerFactory(): AstWalkerFactory { - return globalAstWalkerFactory; - } -} \ No newline at end of file diff --git a/src/services/compiler/declarationEmitter.ts b/src/services/compiler/declarationEmitter.ts index 85e5bf09647..460904b7e88 100644 --- a/src/services/compiler/declarationEmitter.ts +++ b/src/services/compiler/declarationEmitter.ts @@ -476,8 +476,6 @@ module TypeScript { //} } - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSignature = funcPullDecl.getSignatureSymbol(this.semanticInfoChain); this.emitDeclarationComments(funcDecl); this.emitIndent(); @@ -603,11 +601,6 @@ module TypeScript { private emitConstructSignature(funcDecl: ConstructSignatureSyntax) { var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - this.emitDeclarationComments(funcDecl); this.emitIndent(); @@ -633,11 +626,6 @@ module TypeScript { private emitMethodSignature(funcDecl: MethodSignatureSyntax) { var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - this.emitDeclarationComments(funcDecl); this.emitIndent(); @@ -817,7 +805,6 @@ module TypeScript { var parameter = funcDecl.callSignature.parameterList.parameters[i]; var parameterDecl = this.semanticInfoChain.getDeclForAST(parameter); if (hasFlag(parameterDecl.flags, PullElementFlags.PropertyParameter)) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); this.emitDeclarationComments(parameter); this.declFile.Write(this.getIndentString()); this.emitClassElementModifiers(parameter.modifiers); @@ -838,7 +825,6 @@ module TypeScript { var className = classDecl.identifier.text(); this.emitDeclarationComments(classDecl); - var classPullDecl = this.semanticInfoChain.getDeclForAST(classDecl); this.emitDeclFlags(classDecl, "class"); this.declFile.Write(className); @@ -934,7 +920,6 @@ module TypeScript { var interfaceName = interfaceDecl.identifier.text(); this.emitDeclarationComments(interfaceDecl); - var interfacePullDecl = this.semanticInfoChain.getDeclForAST(interfaceDecl); this.emitDeclFlags(interfaceDecl, "interface"); this.declFile.Write(interfaceName); @@ -980,7 +965,6 @@ module TypeScript { } this.emitDeclarationComments(moduleDecl); - var modulePullDecl = this.semanticInfoChain.getDeclForAST(moduleDecl); this.emitDeclFlags(moduleDecl, "enum"); this.declFile.WriteLine(moduleDecl.identifier.text() + " {"); diff --git a/src/services/compiler/pathUtils.ts b/src/services/compiler/pathUtils.ts index 3868881fc75..88aa3e4f30c 100644 --- a/src/services/compiler/pathUtils.ts +++ b/src/services/compiler/pathUtils.ts @@ -16,56 +16,6 @@ /// module TypeScript { - export function stripStartAndEndQuotes(str: string) { - var firstCharCode = str && str.charCodeAt(0); - if (str && str.length >= 2 && firstCharCode === str.charCodeAt(str.length - 1) && (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) { - return str.substring(1, str.length - 1); - } - - return str; - } - - export function isSingleQuoted(str: string) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === CharacterCodes.singleQuote; - } - - export function isDoubleQuoted(str: string) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === CharacterCodes.doubleQuote; - } - - export function isQuoted(str: string) { - return isDoubleQuoted(str) || isSingleQuoted(str); - } - - export function quoteStr(str: string) { - return "\"" + str + "\""; - } - - var switchToForwardSlashesRegEx = /\\/g; - export function switchToForwardSlashes(path: string) { - return path.replace(switchToForwardSlashesRegEx, "/"); - } - - export function trimModName(modName: string) { - // in case's it's a declare file... - if (modName.length > 5 && modName.substring(modName.length - 5, modName.length) === ".d.ts") { - return modName.substring(0, modName.length - 5); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".ts") { - return modName.substring(0, modName.length - 3); - } - // in case's it's a .js file - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".js") { - return modName.substring(0, modName.length - 3); - } - - return modName; - } - - export function getDeclareFilePath(fname: string) { - return isTSFile(fname) ? changePathToDTS(fname) : changePathToDTS(fname); - } - function isFileOfExtension(fname: string, ext: string) { var invariantFname = fname.toLocaleUpperCase(); var invariantExt = ext.toLocaleUpperCase(); @@ -73,121 +23,7 @@ module TypeScript { return invariantFname.length > extLength && invariantFname.substring(invariantFname.length - extLength, invariantFname.length) === invariantExt; } - export function isTSFile(fname: string) { - return isFileOfExtension(fname, ".ts"); - } - export function isDTSFile(fname: string) { return isFileOfExtension(fname, ".d.ts"); } - - export function getPrettyName(modPath: string, quote=true, treatAsFileName=false): any { - var modName = treatAsFileName ? switchToForwardSlashes(modPath) : trimModName(stripStartAndEndQuotes(modPath)); - var components = this.getPathComponents(modName); - return components.length ? (quote ? quoteStr(components[components.length - 1]) : components[components.length - 1]) : modPath; - } - - export function getPathComponents(path: string) { - return path.split("/"); - } - - export function getRelativePathToFixedPath(fixedModFilePath: string, absoluteModPath: string, isAbsoultePathURL = true) { - absoluteModPath = switchToForwardSlashes(absoluteModPath); - - var modComponents = this.getPathComponents(absoluteModPath); - var fixedModComponents = this.getPathComponents(fixedModFilePath); - - // Find the component that differs - var joinStartIndex = 0; - for (; joinStartIndex < modComponents.length && joinStartIndex < fixedModComponents.length ; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== modComponents[joinStartIndex]) { - break; - } - } - - // Get the relative path - if (joinStartIndex !== 0) { - var relativePath = ""; - var relativePathComponents = modComponents.slice(joinStartIndex, modComponents.length); - for (; joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== "") { - relativePath = relativePath + "../"; - } - } - - return relativePath + relativePathComponents.join("/"); - } - - if (isAbsoultePathURL && absoluteModPath.indexOf("://") === -1) { - absoluteModPath = "file:///" + absoluteModPath; - } - - return absoluteModPath; - } - - export function changePathToDTS(modPath: string) { - return trimModName(stripStartAndEndQuotes(modPath)) + ".d.ts"; - } - - export function isRelative(path: string) { - return path.length > 0 && path.charAt(0) === "."; - } - export function isRooted(path: string) { - return path.length > 0 && (path.charAt(0) === "\\" || path.charAt(0) === "/" || (path.indexOf(":\\") !== -1) || (path.indexOf(":/") !== -1)); - } - - export function getRootFilePath(outFname: string) { - if (outFname === "") { - return outFname; - } - else { - var isPath = outFname.indexOf("/") !== -1; - return isPath ? filePath(outFname) : ""; - } - } - - export function filePathComponents(fullPath: string) { - fullPath = switchToForwardSlashes(fullPath); - var components = getPathComponents(fullPath); - return components.slice(0, components.length - 1); - } - - export function filePath(fullPath: string) { - var path = filePathComponents(fullPath); - return path.join("/") + "/"; - } - - export function convertToDirectoryPath(dirPath: string) { - if (dirPath && dirPath.charAt(dirPath.length - 1) !== "/") { - dirPath += "/"; - } - - return dirPath; - } - - var normalizePathRegEx = /^\\\\[^\\]/; - export function normalizePath(path: string): string { - // If it's a UNC style path (i.e. \\server\share), convert to a URI style (i.e. file://server/share) - if (normalizePathRegEx.test(path)) { - path = "file:" + path; - } - var parts = this.getPathComponents(switchToForwardSlashes(path)); - var normalizedParts: string[] = []; - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part === ".") { - continue; - } - - if (normalizedParts.length > 0 && ArrayUtilities.last(normalizedParts) !== ".." && part === "..") { - normalizedParts.pop(); - continue; - } - - normalizedParts.push(part); - } - - return normalizedParts.join("/"); - } } \ No newline at end of file diff --git a/src/services/compiler/precompile.ts b/src/services/compiler/precompile.ts deleted file mode 100644 index 3ff23d85bea..00000000000 --- a/src/services/compiler/precompile.ts +++ /dev/null @@ -1,208 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -module TypeScript { - export interface ILineAndCharacter { - line: number; - character: number; - } - - // Note: This is being using by the host (VS) and is marshaled back and forth. When changing this make sure the changes - // are reflected in the managed side as well. - export interface IFileReference extends ILineAndCharacter { - path: string; - isResident: boolean; - position: number; - length: number; - } - - /// - /// Preprocessing - /// - export interface IPreProcessedFileInfo { - referencedFiles: IFileReference[]; - importedFiles: IFileReference[]; - diagnostics: Diagnostic[]; - isLibFile: boolean; - } - - interface ITripleSlashDirectiveProperties { - noDefaultLib: boolean; - diagnostics: Diagnostic[]; - referencedFiles: IFileReference[]; - } - - function isNoDefaultLibMatch(comment: string): RegExpExecArray { - var isNoDefaultLibRegex = /^(\/\/\/\s*/gim; - return isNoDefaultLibRegex.exec(comment); - } - - export var tripleSlashReferenceRegExp = /^(\/\/\/\s*/; - - function getFileReferenceFromReferencePath(fileName: string, text: ISimpleText, position: number, comment: string, diagnostics: Diagnostic[]): IFileReference { - // First, just see if they've written: /// = 7 && fullReference[6] === "true"; - return { - line: 0, - character: 0, - position: 0, - length: 0, - path: switchToForwardSlashes(adjustedPath), - isResident: isResident - }; - } - } - } - - return null; - } - - var reportDiagnostic = () => { }; - - function processImports(text: ISimpleText, scanner: Scanner.IScanner, token: ISyntaxToken, importedFiles: IFileReference[]): void { - var lineChar = { line: -1, character: -1 }; - - var lineMap = text.lineMap(); - var start = new Date().getTime(); - // Look for: - // import foo = module("foo") - while (token.kind() !== SyntaxKind.EndOfFileToken) { - if (token.kind() === SyntaxKind.ImportKeyword) { - var importToken = token; - token = scanner.scan(/*allowRegularExpression:*/ false); - - if (SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - token = scanner.scan(/*allowRegularExpression:*/ false); - - if (token.kind() === SyntaxKind.EqualsToken) { - token = scanner.scan(/*allowRegularExpression:*/ false); - - if (token.kind() === SyntaxKind.ModuleKeyword || token.kind() === SyntaxKind.RequireKeyword) { - token = scanner.scan(/*allowRegularExpression:*/ false); - - if (token.kind() === SyntaxKind.OpenParenToken) { - token = scanner.scan(/*allowRegularExpression:*/ false); - - lineMap.fillLineAndCharacterFromPosition(TypeScript.start(importToken, text), lineChar); - - if (token.kind() === SyntaxKind.StringLiteral) { - var ref = { - line: lineChar.line, - character: lineChar.character, - position: TypeScript.start(token, text), - length: width(token), - path: stripStartAndEndQuotes(switchToForwardSlashes(token.text())), - isResident: false - }; - importedFiles.push(ref); - } - } - } - } - } - } - - token = scanner.scan(/*allowRegularExpression:*/ false); - } - - var totalTime = new Date().getTime() - start; - //TypeScript.fileResolutionScanImportsTime += totalTime; - } - - function processTripleSlashDirectives(fileName: string, text: ISimpleText, firstToken: ISyntaxToken): ITripleSlashDirectiveProperties { - var leadingTrivia = firstToken.leadingTrivia(text); - - var position = 0; - var lineChar = { line: -1, character: -1 }; - var noDefaultLib = false; - var diagnostics: Diagnostic[] = []; - var referencedFiles: IFileReference[] = []; - var lineMap = text.lineMap(); - - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - - if (trivia.kind() === SyntaxKind.SingleLineCommentTrivia) { - var triviaText = trivia.fullText(); - var referencedCode = getFileReferenceFromReferencePath(fileName, text, position, triviaText, diagnostics); - - if (referencedCode) { - lineMap.fillLineAndCharacterFromPosition(position, lineChar); - referencedCode.position = position; - referencedCode.length = trivia.fullWidth(); - referencedCode.line = lineChar.line; - referencedCode.character = lineChar.character; - - referencedFiles.push(referencedCode); - } - - // is it a lib file? - var isNoDefaultLib = isNoDefaultLibMatch(triviaText); - if (isNoDefaultLib) { - noDefaultLib = isNoDefaultLib[3] === "true"; - } - } - - position += trivia.fullWidth(); - } - - return { noDefaultLib: noDefaultLib, diagnostics: diagnostics, referencedFiles: referencedFiles }; - } - - export function preProcessFile(fileName: string, sourceText: IScriptSnapshot, readImportFiles = true): IPreProcessedFileInfo { - var text = SimpleText.fromScriptSnapshot(sourceText); - var scanner = Scanner.createScanner(ts.ScriptTarget.ES5, text, reportDiagnostic); - - var firstToken = scanner.scan(/*allowRegularExpression:*/ false); - - // only search out dynamic mods - // if you find a dynamic mod, ignore every other mod inside, until you balance rcurlies - // var position - - var importedFiles: IFileReference[] = []; - if (readImportFiles) { - processImports(text, scanner, firstToken, importedFiles); - } - - var properties = processTripleSlashDirectives(fileName, text, firstToken); - - return { referencedFiles: properties.referencedFiles, importedFiles: importedFiles, isLibFile: properties.noDefaultLib, diagnostics: properties.diagnostics }; - } - - export function getReferencedFiles(fileName: string, sourceText: IScriptSnapshot): IFileReference[] { - return preProcessFile(fileName, sourceText, false).referencedFiles; - } -} // Tools \ No newline at end of file diff --git a/src/services/compiler/references.ts b/src/services/compiler/references.ts index 07ec0fa6043..b2d605d595f 100644 --- a/src/services/compiler/references.ts +++ b/src/services/compiler/references.ts @@ -12,7 +12,6 @@ ///// ///// ///// -///// ///// ///// ///// diff --git a/src/services/compiler/types.ts b/src/services/compiler/types.ts deleted file mode 100644 index 28bef81629b..00000000000 --- a/src/services/compiler/types.ts +++ /dev/null @@ -1,102 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript { - export class MemberName { - public prefix: string = ""; - public suffix: string = ""; - - public isString() { return false; } - public isArray() { return false; } - public isMarker() { return !this.isString() && !this.isArray(); } - - public toString(): string { - return MemberName.memberNameToString(this); - } - - static memberNameToString(memberName: MemberName, markerInfo?: number[], markerBaseLength: number = 0): string { - var result = memberName.prefix; - - if (memberName.isString()) { - result += (memberName).text; - } - else if (memberName.isArray()) { - var ar = memberName; - for (var index = 0; index < ar.entries.length; index++) { - if (ar.entries[index].isMarker()) { - if (markerInfo) { - markerInfo.push(markerBaseLength + result.length); - } - continue; - } - - result += MemberName.memberNameToString(ar.entries[index], markerInfo, markerBaseLength + result.length); - result += ar.delim; - } - } - - result += memberName.suffix; - return result; - } - - static create(text: string): MemberName; - static create(entry: MemberName, prefix: string, suffix: string): MemberName; - static create(arg1: any, arg2?: any, arg3?: any): MemberName { - if (typeof arg1 === "string") { - return new MemberNameString(arg1); - } - else { - var result = new MemberNameArray(); - if (arg2) - result.prefix = arg2; - if (arg3) - result.suffix = arg3; - result.entries.push(arg1); - return result; - } - } - } - - export class MemberNameString extends MemberName { - constructor(public text: string) { - super(); - } - - public isString() { return true; } - } - - export class MemberNameArray extends MemberName { - public delim: string = ""; - public entries: MemberName[] = []; - - public isArray() { return true; } - - public add(entry: MemberName) { - this.entries.push(entry); - } - - public addAll(entries: MemberName[]) { - for (var i = 0 ; i < entries.length; i++) { - this.entries.push(entries[i]); - } - } - - constructor() { - super(); - } - } -} \ No newline at end of file diff --git a/src/services/compiler/typescript.ts b/src/services/compiler/typescript.ts index f98d0baf52b..5671d167d1b 100644 --- a/src/services/compiler/typescript.ts +++ b/src/services/compiler/typescript.ts @@ -512,7 +512,7 @@ module TypeScript { for (var i = 0, n = fileNames.length; i < n; i++) { var fileName = fileNames[i]; - var document = this.getDocument(fileNames[i]); + var document = this.getDocument(fileName); sharedEmitter = this._emitDocumentDeclarations(document, emitOptions, file => emitOutput.outputFiles.push(file), sharedEmitter); @@ -578,7 +578,6 @@ module TypeScript { var sourceUnit = document.sourceUnit(); Debug.assert(this._shouldEmit(document)); - var typeScriptFileName = document.fileName; if (!emitter) { var javaScriptFileName = this.mapOutputFileName(document, emitOptions, TypeScriptCompiler.mapToJSFileName); var outFile = new TextWriter(javaScriptFileName, this.writeByteOrderMarkForDocument(document), OutputFileType.JavaScript); @@ -799,8 +798,6 @@ module TypeScript { } private extractResolutionContextFromAST(resolver: PullTypeResolver, ast: ISyntaxElement, document: Document, propagateContextualTypes: boolean): { ast: ISyntaxElement; enclosingDecl: PullDecl; resolutionContext: PullTypeResolutionContext; inContextuallyTypedAssignment: boolean; inWithBlock: boolean; } { - var scriptName = document.fileName; - var enclosingDecl: PullDecl = null; var enclosingDeclAST: ISyntaxElement = null; var inContextuallyTypedAssignment = false; @@ -981,7 +978,6 @@ module TypeScript { case SyntaxKind.ReturnStatement: if (propagateContextualTypes) { - var returnStatement = current; var contextualType: PullTypeSymbol = null; if (enclosingDecl && (enclosingDecl.kind & PullElementKind.SomeFunction)) { diff --git a/src/services/core/arrayUtilities.ts b/src/services/core/arrayUtilities.ts index 4bfec137664..cfb9a1fd4a2 100644 --- a/src/services/core/arrayUtilities.ts +++ b/src/services/core/arrayUtilities.ts @@ -7,7 +7,7 @@ module TypeScript { return true; } - if (array1 === null || array2 === null) { + if (!array1 || !array2) { return false; } @@ -71,7 +71,7 @@ module TypeScript { } } - return null; + return undefined; } public static firstOrDefault(array: T[], func: (v: T, index: number) => boolean): T { @@ -82,7 +82,7 @@ module TypeScript { } } - return null; + return undefined; } public static first(array: T[], func?: (v: T, index: number) => boolean): T { diff --git a/src/services/core/debug.ts b/src/services/core/debug.ts index e57f9745353..d9e20c27870 100644 --- a/src/services/core/debug.ts +++ b/src/services/core/debug.ts @@ -14,13 +14,14 @@ module TypeScript { return this.currentAssertionLevel >= level; } - public static assert(expression: any, message: string = "", verboseDebugInfo: () => string = null): void { + public static assert(expression: any, message?: string, verboseDebugInfo?: () => string): void { if (!expression) { var verboseDebugString = ""; if (verboseDebugInfo) { verboseDebugString = "\r\nVerbose Debug Information:" + verboseDebugInfo(); } + message = message || ""; throw new Error("Debug Failure. False expression: " + message + verboseDebugString); } } diff --git a/src/services/core/diagnosticCore.ts b/src/services/core/diagnosticCore.ts index b4d95a1c60b..5b860dcd31f 100644 --- a/src/services/core/diagnosticCore.ts +++ b/src/services/core/diagnosticCore.ts @@ -1,8 +1,6 @@ /// module TypeScript { - export var LocalizedDiagnosticMessages: ts.Map = null; - export class Location { private _fileName: string; private _lineMap: LineMap; @@ -52,11 +50,11 @@ module TypeScript { private _arguments: any[]; private _additionalLocations: Location[]; - constructor(fileName: string, lineMap: LineMap, start: number, length: number, diagnosticKey: string, _arguments: any[]= null, additionalLocations: Location[] = null) { + constructor(fileName: string, lineMap: LineMap, start: number, length: number, diagnosticKey: string, _arguments?: any[], additionalLocations?: Location[]) { super(fileName, lineMap, start, length); this._diagnosticKey = diagnosticKey; - this._arguments = (_arguments && _arguments.length > 0) ? _arguments : null; - this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : null; + this._arguments = (_arguments && _arguments.length > 0) ? _arguments : undefined; + this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : undefined; } public toJSON(key: any): any { diff --git a/src/services/core/integerUtilities.ts b/src/services/core/integerUtilities.ts index 0af38471dfd..b0a4d6667b9 100644 --- a/src/services/core/integerUtilities.ts +++ b/src/services/core/integerUtilities.ts @@ -7,12 +7,6 @@ module TypeScript { } export function integerMultiplyLow32Bits(n1: number, n2: number): number { - var n1Low16 = n1 & 0x0000ffff; - var n1High16 = n1 >>> 16; - - var n2Low16 = n2 & 0x0000ffff; - var n2High16 = n2 >>> 16; - var resultLow32 = (((n1 & 0xffff0000) * n2) >>> 0) + (((n1 & 0x0000ffff) * n2) >>> 0) >>> 0; return resultLow32; } diff --git a/src/services/core/lineMap.ts b/src/services/core/lineMap.ts index 8820f55b920..947a4fb0bb2 100644 --- a/src/services/core/lineMap.ts +++ b/src/services/core/lineMap.ts @@ -1,9 +1,14 @@ /// module TypeScript { + export interface ILineAndCharacter { + line: number; + character: number; + } + export class LineMap { public static empty = new LineMap(() => [0], 0); - private _lineStarts: number[] = null; + private _lineStarts: number[] = undefined; constructor(private _computeLineStarts: () => number[], private length: number) { } @@ -18,7 +23,7 @@ module TypeScript { } public lineStarts(): number[] { - if (this._lineStarts === null) { + if (!this._lineStarts) { this._lineStarts = this._computeLineStarts(); } diff --git a/src/services/formatting.ts b/src/services/formatting.ts new file mode 100644 index 00000000000..2fdbebad79c --- /dev/null +++ b/src/services/formatting.ts @@ -0,0 +1,953 @@ +/// +/// +/// +/// + +module ts.formatting { + + export interface TextRangeWithKind extends TextRange { + kind: SyntaxKind; + } + + export interface TokenInfo { + leadingTrivia: TextRangeWithKind[]; + token: TextRangeWithKind; + trailingTrivia: TextRangeWithKind[]; + } + + const enum Constants { + Unknown = -1 + } + + /* + * Indentation for the scope that can be dynamically recomputed. + * i.e + * while(true) + * { var x; + * } + * Normally indentation is applied only to the first token in line so at glance 'var' should not be touched. + * However if some format rule adds new line between '}' and 'var' 'var' will become + * the first token in line so it should be indented + */ + interface DynamicIndentation { + getIndentationForToken(tokenLine: number, tokenKind: SyntaxKind): number; + getIndentationForComment(owningToken: SyntaxKind): number; + /** + * Indentation for open and close tokens of the node if it is block or another node that needs special indentation + * ... { + * ......... + * ....} + * ____ - indentation + * ____ - delta + **/ + getIndentation(): number; + /** + * Prefered relative indentation for child nodes. + * Delta is used to carry the indentation info + * foo(bar({ + * $ + * })) + * Both 'foo', 'bar' introduce new indentation with delta = 4, but total indentation in $ is not 8. + * foo: { indentation: 0, delta: 4 } + * bar: { indentation: foo.indentation + foo.delta = 4, delta: 4} however 'foo' and 'bar' are on the same line + * so bar inherits indentation from foo and bar.delta will be 4 + * + */ + getDelta(): number; + /** + * Formatter calls this function when rule adds or deletes new lines from the text + * so indentation scope can adjust values of indentation and delta. + */ + recomputeIndentation(lineAddedByFormatting: boolean): void; + } + + interface Indentation { + indentation: number; + delta: number + } + + export function formatOnEnter(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { + var line = sourceFile.getLineAndCharacterFromPosition(position).line; + Debug.assert(line >= 2); + // get the span for the previous\current line + var span = { + // get start position for the previous line + pos: getStartPositionOfLine(line - 1, sourceFile), + // get end position for the current line (end value is exclusive so add 1 to the result) + end: getEndLinePosition(line, sourceFile) + 1 + } + return formatSpan(span, sourceFile, options, rulesProvider, FormattingRequestKind.FormatOnEnter); + } + + export function formatOnSemicolon(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { + return formatOutermostParent(position, SyntaxKind.SemicolonToken, sourceFile, options, rulesProvider, FormattingRequestKind.FormatOnSemicolon); + } + + export function formatOnClosingCurly(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { + return formatOutermostParent(position, SyntaxKind.CloseBraceToken, sourceFile, options, rulesProvider, FormattingRequestKind.FormatOnClosingCurlyBrace); + } + + export function formatDocument(sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { + var span = { + pos: 0, + end: sourceFile.text.length + }; + return formatSpan(span, sourceFile, options, rulesProvider, FormattingRequestKind.FormatDocument); + } + + export function formatSelection(start: number, end: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { + // format from the beginning of the line + var span = { + pos: getStartLinePositionForPosition(start, sourceFile), + end: end + }; + return formatSpan(span, sourceFile, options, rulesProvider, FormattingRequestKind.FormatSelection); + } + + function formatOutermostParent(position: number, expectedLastToken: SyntaxKind, sourceFile: SourceFile, options: FormatCodeOptions, rulesProvider: RulesProvider, requestKind: FormattingRequestKind): TextChange[] { + var parent = findOutermostParent(position, expectedLastToken, sourceFile); + if (!parent) { + return []; + } + var span = { + pos: getStartLinePositionForPosition(parent.getStart(sourceFile), sourceFile), + end: parent.end + }; + return formatSpan(span, sourceFile, options, rulesProvider, requestKind); + } + + function findOutermostParent(position: number, expectedTokenKind: SyntaxKind, sourceFile: SourceFile): Node { + var precedingToken = findPrecedingToken(position, sourceFile); + if (!precedingToken || precedingToken.kind !== expectedTokenKind) { + return undefined; + } + + // walk up and search for the parent node that ends at the same position with precedingToken. + // for cases like this + // + // var x = 1; + // while (true) { + // } + // after typing close curly in while statement we want to reformat just the while statement. + // However if we just walk upwards searching for the parent that has the same end value - + // we'll end up with the whole source file. isListElement allows to stop on the list element level + var current = precedingToken; + while (current && + current.parent && + current.parent.end === precedingToken.end && + !isListElement(current.parent, current)) { + current = current.parent; + } + + return current; + } + + // Returns true if node is a element in some list in parent + // i.e. parent is class declaration with the list of members and node is one of members. + function isListElement(parent: Node, node: Node): boolean { + switch (parent.kind) { + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + return rangeContainsRange((parent).members, node); + case SyntaxKind.ModuleDeclaration: + var body = (parent).body; + return body && body.kind === SyntaxKind.Block && rangeContainsRange((body).statements, node); + case SyntaxKind.SourceFile: + case SyntaxKind.Block: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.ModuleBlock: + return rangeContainsRange((parent).statements, node) + } + + return false; + } + + /** find node that fully contains given text range */ + function findEnclosingNode(range: TextRange, sourceFile: SourceFile): Node { + return find(sourceFile); + + function find(n: Node): Node { + var candidate = forEachChild(n, c => startEndContainsRange(c.getStart(sourceFile), c.end, range) && c); + if (candidate) { + var result = find(candidate); + if (result) { + return result; + } + } + + return n; + } + } + + /** formatting is not applied to ranges that contain parse errors. + * This function will return a predicate that for a given text range will tell + * if there are any parse errors that overlap with the range. + */ + function prepareRangeContainsErrorFunction(errors: Diagnostic[], originalRange: TextRange): (r: TextRange) => boolean { + if (!errors.length) { + return rangeHasNoErrors; + } + + // pick only errors that fall in range + var sorted = errors + .filter(d => d.isParseError && rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length)) + .sort((e1, e2) => e1.start - e2.start); + + if (!sorted.length) { + return rangeHasNoErrors; + } + + var index = 0; + + return r => { + // in current implementation sequence of arguments [r1, r2...] is monotonically increasing. + // 'index' tracks the index of the most recent error that was checked. + while (true) { + if (index >= sorted.length) { + // all errors in the range were already checked -> no error in specified range + return false; + } + + var error = sorted[index]; + if (r.end <= error.start) { + // specified range ends before the error refered by 'index' - no error in range + return false; + } + + if (startEndOverlapsWithStartEnd(r.pos, r.end, error.start, error.start + error.length)) { + // specified range overlaps with error range + return true; + } + + index++; + } + }; + + function rangeHasNoErrors(r: TextRange): boolean { + return false; + } + } + + /** + * Start of the original range might fall inside the comment - scanner will not yield appropriate results + * This function will look for token that is located before the start of target range + * and return its end as start position for the scanner. + */ + function getScanStartPosition(enclosingNode: Node, originalRange: TextRange, sourceFile: SourceFile): number { + var start = enclosingNode.getStart(sourceFile); + if (start === originalRange.pos && enclosingNode.end === originalRange.end) { + return start; + } + + var precedingToken = findPrecedingToken(originalRange.pos, sourceFile); + // no preceding token found - start from the beginning of enclosing node + return precedingToken ? precedingToken.end : enclosingNode.pos; + } + + function formatSpan(originalRange: TextRange, + sourceFile: SourceFile, + options: FormatCodeOptions, + rulesProvider: RulesProvider, + requestKind: FormattingRequestKind): TextChange[] { + + var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.getSyntacticDiagnostics(), originalRange); + + // formatting context is used by rules provider + var formattingContext = new FormattingContext(sourceFile, requestKind); + + // find the smallest node that fully wraps the range and compute the initial indentation for the node + var enclosingNode = findEnclosingNode(originalRange, sourceFile); + + var formattingScanner = getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); + + var initialIndentation = SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); + + var previousRangeHasError: boolean; + var previousRange: TextRangeWithKind; + var previousParent: Node; + var previousRangeStartLine: number; + + var edits: TextChange[] = []; + + formattingScanner.advance(); + + if (formattingScanner.isOnToken()) { + var startLine = sourceFile.getLineAndCharacterFromPosition(enclosingNode.getStart(sourceFile)).line; + var delta = SmartIndenter.shouldIndentChildNode(enclosingNode.kind, SyntaxKind.Unknown) ? options.IndentSize : 0; + processNode(enclosingNode, enclosingNode, startLine, initialIndentation, delta); + } + + formattingScanner.close(); + + return edits; + + // local functions + + /** Tries to compute the indentation for a list element. + * If list element is not in range then + * function will pick its actual indentation + * so it can be pushed downstream as inherited indentation. + * If list element is in the range - its indentation will be equal + * to inherited indentation from its predecessors. + */ + function tryComputeIndentationForListItem(startPos: number, + endPos: number, + parentStartLine: number, + range: TextRange, + inheritedIndentation: number): number { + + if (rangeOverlapsWithStartEnd(range, startPos, endPos)) { + if (inheritedIndentation !== Constants.Unknown) { + return inheritedIndentation; + } + } + else { + var startLine = sourceFile.getLineAndCharacterFromPosition(startPos).line; + var startLinePosition = getStartLinePositionForPosition(startPos, sourceFile); + var column = SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); + if (startLine !== parentStartLine || startPos === column) { + return column + } + } + + return Constants.Unknown; + } + + function computeIndentation( + node: TextRangeWithKind, + startLine: number, + inheritedIndentation: number, + parent: Node, + parentDynamicIndentation: DynamicIndentation, + effectiveParentStartLine: number): Indentation { + + var indentation = inheritedIndentation; + if (indentation === Constants.Unknown) { + if (isSomeBlock(node.kind)) { + // blocks should be indented in + // - other blocks + // - source file + // - switch\default clauses + if (isSomeBlock(parent.kind) || + parent.kind === SyntaxKind.SourceFile || + parent.kind === SyntaxKind.CaseClause || + parent.kind === SyntaxKind.DefaultClause) { + + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); + } + else { + indentation = parentDynamicIndentation.getIndentation(); + } + } + else { + if (SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + indentation = parentDynamicIndentation.getIndentation(); + } + else { + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); + } + } + } + + var delta = SmartIndenter.shouldIndentChildNode(node.kind, SyntaxKind.Unknown) ? options.IndentSize : 0; + + if (effectiveParentStartLine === startLine) { + // if node is located on the same line with the parent + // - inherit indentation from the parent + // - push children if either parent of node itself has non-zero delta + indentation = parentDynamicIndentation.getIndentation(); + delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); + } + return { + indentation, + delta + } + } + + function getDynamicIndentation(node: Node, nodeStartLine: number, indentation: number, delta: number): DynamicIndentation { + return { + getIndentationForComment: kind => { + switch (kind) { + // preceding comment to the token that closes the indentation scope inherits the indentation from the scope + // .. { + // // comment + // } + case SyntaxKind.CloseBraceToken: + case SyntaxKind.CloseBracketToken: + return indentation + delta; + } + return indentation; + }, + getIndentationForToken: (line, kind) => { + switch (kind) { + // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent + case SyntaxKind.OpenBraceToken: + case SyntaxKind.CloseBraceToken: + case SyntaxKind.OpenBracketToken: + case SyntaxKind.CloseBracketToken: + case SyntaxKind.ElseKeyword: + case SyntaxKind.WhileKeyword: + return indentation; + default: + // if token line equals to the line of containing node (this is a first token in the node) - use node indentation + return nodeStartLine !== line ? indentation + delta : indentation; + } + }, + getIndentation: () => indentation, + getDelta: () => delta, + recomputeIndentation: lineAdded => { + if (node.parent && SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { + if (lineAdded) { + indentation += options.IndentSize; + } + else { + indentation -= options.IndentSize; + } + + if (SmartIndenter.shouldIndentChildNode(node.kind, SyntaxKind.Unknown)) { + delta = options.IndentSize; + } + else { + delta = 0; + } + } + }, + } + } + + function processNode(node: Node, contextNode: Node, nodeStartLine: number, indentation: number, delta: number) { + if (!rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { + return; + } + + var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta); + + // a useful observations when tracking context node + // / + // [a] + // / | \ + // [b] [c] [d] + // node 'a' is a context node for nodes 'b', 'c', 'd' + // except for the leftmost leaf token in [b] - in this case context node ('e') is located somewhere above 'a' + // this rule can be applied recursively to child nodes of 'a'. + // + // context node is set to parent node value after processing every child node + // context node is set to parent of the token after processing every token + + var childContextNode = contextNode; + + // if there are any tokens that logically belong to node and interleave child nodes + // such tokens will be consumed in processChildNode for for the child that follows them + forEachChild( + node, + child => { + processChildNode(child, /*inheritedIndentation*/ Constants.Unknown, node, nodeDynamicIndentation, nodeStartLine, /*isListElement*/ false) + }, + (nodes: NodeArray) => { + processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); + }); + + // proceed any tokens in the node that are located after child nodes + while (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > node.end) { + break; + } + consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); + } + + function processChildNode( + child: Node, + inheritedIndentation: number, + parent: Node, + parentDynamicIndentation: DynamicIndentation, + parentStartLine: number, + isListItem: boolean): number { + + var childStartPos = child.getStart(sourceFile); + + var childStart = sourceFile.getLineAndCharacterFromPosition(childStartPos); + + // if child is a list item - try to get its indentation + var childIndentationAmount = Constants.Unknown; + if (isListItem) { + childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); + if (childIndentationAmount !== Constants.Unknown) { + inheritedIndentation = childIndentationAmount; + } + } + + // child node is outside the target range - do not dive inside + if (!rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) { + return inheritedIndentation; + } + + if (child.kind === SyntaxKind.Missing) { + return inheritedIndentation; + } + + while (formattingScanner.isOnToken()) { + // proceed any parent tokens that are located prior to child.getStart() + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > childStartPos) { + // stop when formatting scanner advances past the beginning of the child + break; + } + + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + } + + if (!formattingScanner.isOnToken()) { + return inheritedIndentation; + } + + if (isToken(child)) { + // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules + var tokenInfo = formattingScanner.readTokenInfo(node); + Debug.assert(tokenInfo.token.end === child.end); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + return inheritedIndentation; + } + + var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); + + processNode(child, childContextNode, childStart.line, childIndentation.indentation, childIndentation.delta); + + childContextNode = node; + + return inheritedIndentation; + } + + function processChildNodes(nodes: NodeArray, + parent: Node, + parentStartLine: number, + parentDynamicIndentation: DynamicIndentation): void { + + var listStartToken = getOpenTokenForList(parent, nodes); + var listEndToken = getCloseTokenForOpenToken(listStartToken); + + var listDynamicIndentation = parentDynamicIndentation; + var startLine = parentStartLine; + + if (listStartToken !== SyntaxKind.Unknown) { + // introduce a new indentation scope for lists (including list start and end tokens) + while (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.end > nodes.pos) { + // stop when formatting scanner moves past the beginning of node list + break; + } + else if (tokenInfo.token.kind === listStartToken) { + // consume list start token + startLine = sourceFile.getLineAndCharacterFromPosition(tokenInfo.token.pos).line; + var indentation = + computeIndentation(tokenInfo.token, startLine, Constants.Unknown, parent, parentDynamicIndentation, startLine); + + listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation.indentation, indentation.delta); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + } + else { + // consume any tokens that precede the list as child elements of 'node' using its indentation scope + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + } + } + } + + var inheritedIndentation = Constants.Unknown; + for (var i = 0, len = nodes.length; i < len; ++i) { + inheritedIndentation = processChildNode(nodes[i], inheritedIndentation, node, listDynamicIndentation, startLine, /*isListElement*/ true) + } + + if (listEndToken !== SyntaxKind.Unknown) { + if (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.kind === listEndToken) { + // consume list end token + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + } + } + } + } + + function consumeTokenAndAdvanceScanner(currentTokenInfo: TokenInfo, parent: Node, dynamicIndentation: DynamicIndentation): void { + Debug.assert(rangeContainsRange(parent, currentTokenInfo.token)); + + var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); + var indentToken = false; + + if (currentTokenInfo.leadingTrivia) { + processTrivia(currentTokenInfo.leadingTrivia, parent, childContextNode, dynamicIndentation); + } + + var lineAdded: boolean; + var isTokenInRange = rangeContainsRange(originalRange, currentTokenInfo.token); + + var tokenStart = sourceFile.getLineAndCharacterFromPosition(currentTokenInfo.token.pos); + if (isTokenInRange) { + // save prevStartLine since processRange will overwrite this value with current ones + var prevStartLine = previousRangeStartLine; + lineAdded = processRange(currentTokenInfo.token, tokenStart, parent, childContextNode, dynamicIndentation); + if (lineAdded !== undefined) { + indentToken = lineAdded; + } + else { + indentToken = lastTriviaWasNewLine && tokenStart.line !== prevStartLine; + } + } + + if (currentTokenInfo.trailingTrivia) { + processTrivia(currentTokenInfo.trailingTrivia, parent, childContextNode, dynamicIndentation); + } + + if (indentToken) { + var indentNextTokenOrTrivia = true; + if (currentTokenInfo.leadingTrivia) { + for (var i = 0, len = currentTokenInfo.leadingTrivia.length; i < len; ++i) { + var triviaItem = currentTokenInfo.leadingTrivia[i]; + if (!rangeContainsRange(originalRange, triviaItem)) { + continue; + } + + var triviaStartLine = sourceFile.getLineAndCharacterFromPosition(triviaItem.pos).line; + switch (triviaItem.kind) { + case SyntaxKind.MultiLineCommentTrivia: + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + indentMultilineComment(triviaItem, commentIndentation, /*firstLineIsIndented*/ !indentNextTokenOrTrivia); + indentNextTokenOrTrivia = false; + break; + case SyntaxKind.SingleLineCommentTrivia: + if (indentNextTokenOrTrivia) { + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + insertIndentation(triviaItem.pos, commentIndentation, /*lineAdded*/ false); + indentNextTokenOrTrivia = false; + } + break; + case SyntaxKind.NewLineTrivia: + indentNextTokenOrTrivia = true; + break; + } + } + } + + // indent token only if is it is in target range and does not overlap with any error ranges + if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { + var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); + insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); + } + } + + formattingScanner.advance(); + + childContextNode = parent; + } + } + + function processTrivia(trivia: TextRangeWithKind[], parent: Node, contextNode: Node, dynamicIndentation: DynamicIndentation): void { + for (var i = 0, len = trivia.length; i < len; ++i) { + var triviaItem = trivia[i]; + if (isComment(triviaItem.kind) && rangeContainsRange(originalRange, triviaItem)) { + var triviaItemStart = sourceFile.getLineAndCharacterFromPosition(triviaItem.pos); + processRange(triviaItem, triviaItemStart, parent, contextNode, dynamicIndentation); + } + } + } + + function processRange(range: TextRangeWithKind, + rangeStart: LineAndCharacter, + parent: Node, + contextNode: Node, + dynamicIndentation: DynamicIndentation): boolean { + + var rangeHasError = rangeContainsError(range); + var lineAdded: boolean; + if (!rangeHasError && !previousRangeHasError) { + if (!previousRange) { + // trim whitespaces starting from the beginning of the span up to the current line + var originalStart = sourceFile.getLineAndCharacterFromPosition(originalRange.pos); + trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); + } + else { + lineAdded = + processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation) + } + } + + previousRange = range; + previousParent = parent; + previousRangeStartLine = rangeStart.line; + previousRangeHasError = rangeHasError; + + return lineAdded; + } + + function processPair(currentItem: TextRangeWithKind, + currentStartLine: number, + currentParent: Node, + previousItem: TextRangeWithKind, + previousStartLine: number, + previousParent: Node, + contextNode: Node, + dynamicIndentation: DynamicIndentation): boolean { + + formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode); + + var rule = rulesProvider.getRulesMap().GetRule(formattingContext); + + var trimTrailingWhitespaces: boolean; + var lineAdded: boolean; + if (rule) { + applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); + + if (rule.Operation.Action & (RuleAction.Space | RuleAction.Delete) && currentStartLine !== previousStartLine) { + // Handle the case where the next line is moved to be the end of this line. + // In this case we don't indent the next line in the next pass. + if (currentParent.getStart(sourceFile) === currentItem.pos) { + lineAdded = false; + } + } + else if (rule.Operation.Action & RuleAction.NewLine && currentStartLine === previousStartLine) { + // Handle the case where token2 is moved to the new line. + // In this case we indent token2 in the next pass but we set + // sameLineIndent flag to notify the indenter that the indentation is within the line. + if (currentParent.getStart(sourceFile) === currentItem.pos) { + lineAdded = true; + } + } + + if (lineAdded !== undefined) { + dynamicIndentation.recomputeIndentation(lineAdded); + } + + // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line + trimTrailingWhitespaces = + (rule.Operation.Action & (RuleAction.NewLine | RuleAction.Space)) && + rule.Flag !== RuleFlags.CanDeleteNewLines; + } + else { + trimTrailingWhitespaces = true; + } + + if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { + // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line + trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem); + } + + return lineAdded; + } + + function insertIndentation(pos: number, indentation: number, lineAdded: boolean): void { + var indentationString = getIndentationString(indentation, options); + if (lineAdded) { + // new line is added before the token by the formatting rules + // insert indentation string at the very beginning of the token + recordReplace(pos, 0, indentationString); + } + else { + var tokenStart = sourceFile.getLineAndCharacterFromPosition(pos); + if (indentation !== tokenStart.character - 1) { + var startLinePosition = getStartPositionOfLine(tokenStart.line, sourceFile); + recordReplace(startLinePosition, tokenStart.character - 1, indentationString); + } + } + } + + function indentMultilineComment(commentRange: TextRange, indentation: number, firstLineIsIndented: boolean) { + // split comment in lines + var startLine = sourceFile.getLineAndCharacterFromPosition(commentRange.pos).line; + var endLine = sourceFile.getLineAndCharacterFromPosition(commentRange.end).line; + + if (startLine === endLine) { + if (!firstLineIsIndented) { + // treat as single line comment + insertIndentation(commentRange.pos, indentation, /*lineAdded*/ false); + } + return; + } + else { + var parts: TextRange[] = []; + var startPos = commentRange.pos; + for (var line = startLine; line < endLine; ++line) { + var endOfLine = getEndLinePosition(line, sourceFile); + parts.push({ pos: startPos, end: endOfLine }); + startPos = getStartPositionOfLine(line + 1, sourceFile); + } + + parts.push({ pos: startPos, end: commentRange.end }); + } + + var startLinePos = getStartPositionOfLine(startLine, sourceFile); + + var nonWhitespaceColumnInFirstPart = + SmartIndenter.findFirstNonWhitespaceColumn(startLinePos, parts[0].pos, sourceFile, options); + + if (indentation === nonWhitespaceColumnInFirstPart) { + return; + } + + var startIndex = 0; + if (firstLineIsIndented) { + startIndex = 1; + startLine++; + } + + // shift all parts on the delta size + var delta = indentation - nonWhitespaceColumnInFirstPart; + for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { + var startLinePos = getStartPositionOfLine(startLine, sourceFile); + var nonWhitespaceColumn = + i === 0 + ? nonWhitespaceColumnInFirstPart + : SmartIndenter.findFirstNonWhitespaceColumn(parts[i].pos, parts[i].end, sourceFile, options); + + var newIndentation = nonWhitespaceColumn + delta; + if (newIndentation > 0) { + var indentationString = getIndentationString(newIndentation, options); + recordReplace(startLinePos, nonWhitespaceColumn, indentationString); + } + else { + recordDelete(startLinePos, nonWhitespaceColumn); + } + } + } + + function trimTrailingWhitespacesForLines(line1: number, line2: number, range?: TextRangeWithKind) { + for (var line = line1; line < line2; ++line) { + var lineStartPosition = getStartPositionOfLine(line, sourceFile); + var lineEndPosition = getEndLinePosition(line, sourceFile); + + // do not trim whitespaces in comments + if (range && isComment(range.kind) && range.pos <= lineEndPosition && range.end > lineEndPosition) { + continue; + } + + var pos = lineEndPosition; + while (pos >= lineStartPosition && isWhiteSpace(sourceFile.text.charCodeAt(pos))) { + pos--; + } + if (pos !== lineEndPosition) { + Debug.assert(pos === lineStartPosition || !isWhiteSpace(sourceFile.text.charCodeAt(pos))); + recordDelete(pos + 1, lineEndPosition - pos); + } + } + } + + function newTextChange(start: number, len: number, newText: string): TextChange { + return { span: new TextSpan(start, len), newText } + } + + function recordDelete(start: number, len: number) { + if (len) { + edits.push(newTextChange(start, len, "")); + } + } + + function recordReplace(start: number, len: number, newText: string) { + if (len || newText) { + edits.push(newTextChange(start, len, newText)); + } + } + + function applyRuleEdits(rule: Rule, + previousRange: TextRangeWithKind, + previousStartLine: number, + currentRange: TextRangeWithKind, + currentStartLine: number): void { + + var between: TextRange; + switch (rule.Operation.Action) { + case RuleAction.Ignore: + // no action required + return; + case RuleAction.Delete: + if (previousRange.end !== currentRange.pos) { + // delete characters starting from t1.end up to t2.pos exclusive + recordDelete(previousRange.end, currentRange.pos - previousRange.end); + } + break; + case RuleAction.NewLine: + // exit early if we on different lines and rule cannot change number of newlines + // if line1 and line2 are on subsequent lines then no edits are required - ok to exit + // if line1 and line2 are separated with more than one newline - ok to exit since we cannot delete extra new lines + if (rule.Flag !== RuleFlags.CanDeleteNewLines && previousStartLine !== currentStartLine) { + return; + } + + // edit should not be applied only if we have one line feed between elements + var lineDelta = currentStartLine - previousStartLine; + if (lineDelta !== 1) { + recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.NewLineCharacter); + } + break; + case RuleAction.Space: + // exit early if we on different lines and rule cannot change number of newlines + if (rule.Flag !== RuleFlags.CanDeleteNewLines && previousStartLine !== currentStartLine) { + return; + } + + var posDelta = currentRange.pos - previousRange.end; + if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== CharacterCodes.space) { + recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); + } + break; + } + } + } + + function isSomeBlock(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.Block: + case SyntaxKind.FunctionBlock: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.ModuleBlock: + return true; + } + return false; + } + + function getOpenTokenForList(node: Node, list: Node[]) { + switch (node.kind) { + case SyntaxKind.Constructor: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Method: + case SyntaxKind.ArrowFunction: + if ((node).typeParameters === list) { + return SyntaxKind.LessThanToken; + } + else if ((node).parameters === list) { + return SyntaxKind.OpenParenToken; + } + break; + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + if ((node).typeArguments === list) { + return SyntaxKind.LessThanToken; + } + else if ((node).arguments === list) { + return SyntaxKind.OpenParenToken; + } + break; + case SyntaxKind.TypeReference: + if ((node).typeArguments === list) { + return SyntaxKind.LessThanToken; + } + } + + return SyntaxKind.Unknown; + } + + function getCloseTokenForOpenToken(kind: SyntaxKind) { + switch (kind) { + case SyntaxKind.OpenParenToken: + return SyntaxKind.CloseParenToken; + case SyntaxKind.LessThanToken: + return SyntaxKind.GreaterThanToken; + } + + return SyntaxKind.Unknown; + } +} \ No newline at end of file diff --git a/src/services/formatting/formatter.ts b/src/services/formatting/formatter.ts deleted file mode 100644 index e4a1229abef..00000000000 --- a/src/services/formatting/formatter.ts +++ /dev/null @@ -1,320 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - export class Formatter extends MultipleTokenIndenter { - private previousTokenSpan: TokenSpan = null; - private previousTokenParent: IndentationNodeContext = null; - - // TODO: implement it with skipped tokens in Fidelity - private scriptHasErrors: boolean = false; - - private rulesProvider: RulesProvider; - private formattingRequestKind: FormattingRequestKind; - private formattingContext: FormattingContext; - - constructor(textSpan: TextSpan, - sourceUnit: SourceUnitSyntax, - indentFirstToken: boolean, - options: FormattingOptions, - snapshot: ITextSnapshot, - rulesProvider: RulesProvider, - formattingRequestKind: FormattingRequestKind) { - - super(textSpan, sourceUnit, snapshot, indentFirstToken, options); - - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - - this.rulesProvider = rulesProvider; - this.formattingRequestKind = formattingRequestKind; - this.formattingContext = new FormattingContext(this.snapshot(), this.formattingRequestKind); - } - - public static getEdits(textSpan: TextSpan, - sourceUnit: SourceUnitSyntax, - options: FormattingOptions, - indentFirstToken: boolean, - snapshot: ITextSnapshot, - rulesProvider: RulesProvider, - formattingRequestKind: FormattingRequestKind): TextEditInfo[] { - var walker = new Formatter(textSpan, sourceUnit, indentFirstToken, options, snapshot, rulesProvider, formattingRequestKind); - visitNodeOrToken(walker, sourceUnit); - return walker.edits(); - } - - public visitTokenInSpan(token: ISyntaxToken): void { - if (token.fullWidth() !== 0) { - var tokenSpan = new TextSpan(this.position() + token.leadingTriviaWidth(), width(token)); - if (this.textSpan().containsTextSpan(tokenSpan)) { - this.processToken(token); - } - } - - // Call the base class to process the token and indent it if needed - super.visitTokenInSpan(token); - } - - private processToken(token: ISyntaxToken): void { - var position = this.position(); - - // Extract any leading comments - if (token.leadingTriviaWidth() !== 0) { - this.processTrivia(token.leadingTrivia(), position); - position += token.leadingTriviaWidth(); - } - - // Push the token - var currentTokenSpan = new TokenSpan(token.kind(), position, width(token)); - if (!this.parent().hasSkippedOrMissingTokenChild()) { - if (this.previousTokenSpan) { - // Note that formatPair calls TrimWhitespaceInLineRange in between the 2 tokens - this.formatPair(this.previousTokenSpan, this.previousTokenParent, currentTokenSpan, this.parent()); - } - else { - // We still want to trim whitespace even if it is the first trivia of the first token. Trim from the beginning of the span to the trivia - this.trimWhitespaceInLineRange(this.getLineNumber(this.textSpan()), this.getLineNumber(currentTokenSpan)); - } - } - this.previousTokenSpan = currentTokenSpan; - if (this.previousTokenParent) { - // Make sure to clear the previous parent before assigning a new value to it - this.indentationNodeContextPool().releaseNode(this.previousTokenParent, /* recursive */true); - } - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - position += width(token); - - // Extract any trailing comments - if (token.trailingTriviaWidth() !== 0) { - this.processTrivia(token.trailingTrivia(), position); - } - } - - private processTrivia(triviaList: ISyntaxTriviaList, fullStart: number) { - var position = fullStart; - - for (var i = 0, n = triviaList.count(); i < n ; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - // For a comment, format it like it is a token. For skipped text, eat it up as a token, but skip the formatting - if (trivia.isComment() || trivia.isSkippedToken()) { - var currentTokenSpan = new TokenSpan(trivia.kind(), position, trivia.fullWidth()); - if (this.textSpan().containsTextSpan(currentTokenSpan)) { - if (trivia.isComment() && this.previousTokenSpan) { - // Note that formatPair calls TrimWhitespaceInLineRange in between the 2 tokens - this.formatPair(this.previousTokenSpan, this.previousTokenParent, currentTokenSpan, this.parent()); - } - else { - // We still want to trim whitespace even if it is the first trivia of the first token. Trim from the beginning of the span to the trivia - var startLine = this.getLineNumber(this.previousTokenSpan || this.textSpan()); - this.trimWhitespaceInLineRange(startLine, this.getLineNumber(currentTokenSpan)); - } - this.previousTokenSpan = currentTokenSpan; - if (this.previousTokenParent) { - // Make sure to clear the previous parent before assigning a new value to it - this.indentationNodeContextPool().releaseNode(this.previousTokenParent, /* recursive */true); - } - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - } - } - - position += trivia.fullWidth(); - } - } - - private findCommonParents(parent1: IndentationNodeContext, parent2: IndentationNodeContext): IndentationNodeContext { - // TODO: disable debug assert message - - var shallowParent: IndentationNodeContext; - var shallowParentDepth: number; - var deepParent: IndentationNodeContext; - var deepParentDepth: number; - - if (parent1.depth() < parent2.depth()) { - shallowParent = parent1; - shallowParentDepth = parent1.depth(); - deepParent = parent2; - deepParentDepth = parent2.depth(); - } - else { - shallowParent = parent2; - shallowParentDepth = parent2.depth(); - deepParent = parent1; - deepParentDepth = parent1.depth(); - } - - Debug.assert(shallowParentDepth >= 0, "Expected shallowParentDepth >= 0"); - Debug.assert(deepParentDepth >= 0, "Expected deepParentDepth >= 0"); - Debug.assert(deepParentDepth >= shallowParentDepth, "Expected deepParentDepth >= shallowParentDepth"); - - while (deepParentDepth > shallowParentDepth) { - deepParent = deepParent.parent(); - deepParentDepth--; - } - - Debug.assert(deepParentDepth === shallowParentDepth, "Expected deepParentDepth === shallowParentDepth"); - - while (deepParent.node() && shallowParent.node()) { - if (deepParent.node() === shallowParent.node()) { - return deepParent; - } - deepParent = deepParent.parent(); - shallowParent = shallowParent.parent(); - } - - // The root should be the first element in the parent chain, we can not be here unless something wrong - // happened along the way - throw Errors.invalidOperation(); - } - - private formatPair(t1: TokenSpan, t1Parent: IndentationNodeContext, t2: TokenSpan, t2Parent: IndentationNodeContext): void { - var token1Line = this.getLineNumber(t1); - var token2Line = this.getLineNumber(t2); - - // Find common parent - var commonParent= this.findCommonParents(t1Parent, t2Parent); - - // Update the context - this.formattingContext.updateContext(t1, t1Parent, t2, t2Parent, commonParent); - - // Find rules matching the current context - var rule = this.rulesProvider.getRulesMap().GetRule(this.formattingContext); - - if (rule != null) { - // Record edits from the rule - this.RecordRuleEdits(rule, t1, t2); - - // Handle the case where the next line is moved to be the end of this line. - // In this case we don't indent the next line in the next pass. - if ((rule.Operation.Action == RuleAction.Space || rule.Operation.Action == RuleAction.Delete) && - token1Line != token2Line) { - this.forceSkipIndentingNextToken(t2.start()); - } - - // Handle the case where token2 is moved to the new line. - // In this case we indent token2 in the next pass but we set - // sameLineIndent flag to notify the indenter that the indentation is within the line. - if (rule.Operation.Action == RuleAction.NewLine && token1Line == token2Line) { - this.forceIndentNextToken(t2.start()); - } - } - - // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - if (token1Line != token2Line && (!rule || (rule.Operation.Action != RuleAction.Delete && rule.Flag != RuleFlags.CanDeleteNewLines))) { - this.trimWhitespaceInLineRange(token1Line, token2Line, t1); - } - } - - private getLineNumber(span: TextSpan): number { - return this.snapshot().getLineNumberFromPosition(span.start()); - } - - private trimWhitespaceInLineRange(startLine: number, endLine: number, token?: TokenSpan): void { - for (var lineNumber = startLine; lineNumber < endLine; ++lineNumber) { - var line = this.snapshot().getLineFromLineNumber(lineNumber); - - this.trimWhitespace(line, token); - } - } - - private trimWhitespace(line: ITextSnapshotLine, token?: TokenSpan): void { - // Don't remove the trailing spaces inside comments (this includes line comments and block comments) - if (token && (token.kind == SyntaxKind.MultiLineCommentTrivia || token.kind == SyntaxKind.SingleLineCommentTrivia) && token.start() <= line.endPosition() && token.end() >= line.endPosition()) - return; - - var text = line.getText(); - var index = 0; - - for (index = text.length - 1; index >= 0; --index) { - if (!CharacterInfo.isWhitespace(text.charCodeAt(index))) { - break; - } - } - - ++index; - - if (index < text.length) { - this.recordEdit(line.startPosition() + index, line.length() - index, ""); - } - } - - private RecordRuleEdits(rule: Rule, t1: TokenSpan, t2: TokenSpan): void { - if (rule.Operation.Action == RuleAction.Ignore) { - return; - } - - var betweenSpan: TextSpan; - - switch (rule.Operation.Action) { - case RuleAction.Delete: - { - betweenSpan = new TextSpan(t1.end(), t2.start() - t1.end()); - - if (betweenSpan.length() > 0) { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), ""); - return; - } - } - break; - - case RuleAction.NewLine: - { - if (!(rule.Flag == RuleFlags.CanDeleteNewLines || this.getLineNumber(t1) == this.getLineNumber(t2))) { - return; - } - - betweenSpan = new TextSpan(t1.end(), t2.start() - t1.end()); - - var doEdit = false; - var betweenText = this.snapshot().getText(betweenSpan); - - var lineFeedLoc = betweenText.indexOf(this.options.newLineCharacter); - if (lineFeedLoc < 0) { - // no linefeeds, do the edit - doEdit = true; - } - else { - // We only require one line feed. If there is another one, do the edit - lineFeedLoc = betweenText.indexOf(this.options.newLineCharacter, lineFeedLoc + 1); - if (lineFeedLoc >= 0) { - doEdit = true; - } - } - - if (doEdit) { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), this.options.newLineCharacter); - return; - } - } - break; - - case RuleAction.Space: - { - if (!(rule.Flag == RuleFlags.CanDeleteNewLines || this.getLineNumber(t1) == this.getLineNumber(t2))) { - return; - } - - betweenSpan = new TextSpan(t1.end(), t2.start() - t1.end()); - - if (betweenSpan.length() > 1 || this.snapshot().getText(betweenSpan) != " ") { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), " "); - return; - } - } - break; - } - } - } -} \ No newline at end of file diff --git a/src/services/formatting/formattingContext.ts b/src/services/formatting/formattingContext.ts index 9ced31ecef2..2bfb155921e 100644 --- a/src/services/formatting/formattingContext.ts +++ b/src/services/formatting/formattingContext.ts @@ -13,48 +13,48 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class FormattingContext { - public currentTokenSpan: TokenSpan = null; - public nextTokenSpan: TokenSpan = null; - public contextNode: IndentationNodeContext = null; - public currentTokenParent: IndentationNodeContext = null; - public nextTokenParent: IndentationNodeContext = null; + public currentTokenSpan: TextRangeWithKind; + public nextTokenSpan: TextRangeWithKind; + public contextNode: Node; + public currentTokenParent: Node; + public nextTokenParent: Node; - private contextNodeAllOnSameLine: boolean = null; - private nextNodeAllOnSameLine: boolean = null; - private tokensAreOnSameLine: boolean = null; - private contextNodeBlockIsOnOneLine: boolean = null; - private nextNodeBlockIsOnOneLine: boolean = null; + private contextNodeAllOnSameLine: boolean; + private nextNodeAllOnSameLine: boolean; + private tokensAreOnSameLine: boolean; + private contextNodeBlockIsOnOneLine: boolean; + private nextNodeBlockIsOnOneLine: boolean; - constructor(private snapshot: ITextSnapshot, public formattingRequestKind: FormattingRequestKind) { - Debug.assert(this.snapshot != null, "snapshot is null"); + constructor(private sourceFile: SourceFile, public formattingRequestKind: FormattingRequestKind) { } - public updateContext(currentTokenSpan: TokenSpan, currentTokenParent: IndentationNodeContext, nextTokenSpan: TokenSpan, nextTokenParent: IndentationNodeContext, commonParent: IndentationNodeContext) { - Debug.assert(currentTokenSpan != null, "currentTokenSpan is null"); - Debug.assert(currentTokenParent != null, "currentTokenParent is null"); - Debug.assert(nextTokenSpan != null, "nextTokenSpan is null"); - Debug.assert(nextTokenParent != null, "nextTokenParent is null"); - Debug.assert(commonParent != null, "commonParent is null"); + public updateContext(currentRange: TextRangeWithKind, currentTokenParent: Node, nextRange: TextRangeWithKind, nextTokenParent: Node, commonParent: Node) { + Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); + Debug.assert(currentTokenParent !== undefined, "currentTokenParent is null"); + Debug.assert(nextRange !== undefined, "nextTokenSpan is null"); + Debug.assert(nextTokenParent !== undefined, "nextTokenParent is null"); + Debug.assert(commonParent !== undefined, "commonParent is null"); - this.currentTokenSpan = currentTokenSpan; + this.currentTokenSpan = currentRange; this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextTokenSpan; + this.nextTokenSpan = nextRange; this.nextTokenParent = nextTokenParent; this.contextNode = commonParent; - this.contextNodeAllOnSameLine = null; - this.nextNodeAllOnSameLine = null; - this.tokensAreOnSameLine = null; - this.contextNodeBlockIsOnOneLine = null; - this.nextNodeBlockIsOnOneLine = null; + // drop cached results + this.contextNodeAllOnSameLine = undefined; + this.nextNodeAllOnSameLine = undefined; + this.tokensAreOnSameLine = undefined; + this.contextNodeBlockIsOnOneLine = undefined; + this.nextNodeBlockIsOnOneLine = undefined; } public ContextNodeAllOnSameLine(): boolean { - if (this.contextNodeAllOnSameLine === null) { + if (this.contextNodeAllOnSameLine === undefined) { this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); } @@ -62,7 +62,7 @@ module TypeScript.Services.Formatting { } public NextNodeAllOnSameLine(): boolean { - if (this.nextNodeAllOnSameLine === null) { + if (this.nextNodeAllOnSameLine === undefined) { this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); } @@ -70,10 +70,9 @@ module TypeScript.Services.Formatting { } public TokensAreOnSameLine(): boolean { - if (this.tokensAreOnSameLine === null) { - var startLine = this.snapshot.getLineNumberFromPosition(this.currentTokenSpan.start()); - var endLine = this.snapshot.getLineNumberFromPosition(this.nextTokenSpan.start()); - + if (this.tokensAreOnSameLine === undefined) { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(this.currentTokenSpan.pos).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(this.nextTokenSpan.pos).line; this.tokensAreOnSameLine = (startLine == endLine); } @@ -81,7 +80,7 @@ module TypeScript.Services.Formatting { } public ContextNodeBlockIsOnOneLine() { - if (this.contextNodeBlockIsOnOneLine === null) { + if (this.contextNodeBlockIsOnOneLine === undefined) { this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); } @@ -89,28 +88,28 @@ module TypeScript.Services.Formatting { } public NextNodeBlockIsOnOneLine() { - if (this.nextNodeBlockIsOnOneLine === null) { + if (this.nextNodeBlockIsOnOneLine === undefined) { this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); } return this.nextNodeBlockIsOnOneLine; } - public NodeIsOnOneLine(node: IndentationNodeContext): boolean { - var startLine = this.snapshot.getLineNumberFromPosition(node.start()); - var endLine = this.snapshot.getLineNumberFromPosition(node.end()); - + private NodeIsOnOneLine(node: Node): boolean { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(node.getStart(this.sourceFile)).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(node.getEnd()).line; return startLine == endLine; } - // Now we know we have a block (or a fake block represented by some other kind of node with an open and close brace as children). - // IMPORTANT!!! This relies on the invariant that IsBlockContext must return true ONLY for nodes with open and close braces as immediate children - public BlockIsOnOneLine(node: IndentationNodeContext): boolean { - var block = node.node(); - - // Now check if they are on the same line - return this.snapshot.getLineNumberFromPosition(end(block.openBraceToken)) === - this.snapshot.getLineNumberFromPosition(start(block.closeBraceToken)); + private BlockIsOnOneLine(node: Node): boolean { + var openBrace = findChildOfKind(node, SyntaxKind.OpenBraceToken, this.sourceFile); + var closeBrace = findChildOfKind(node, SyntaxKind.CloseBraceToken, this.sourceFile); + if (openBrace && closeBrace) { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(openBrace.getEnd()).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(closeBrace.getStart(this.sourceFile)).line; + return startLine === endLine; + } + return false; } } } \ No newline at end of file diff --git a/src/services/formatting/formattingManager.ts b/src/services/formatting/formattingManager.ts deleted file mode 100644 index 359f19c84ed..00000000000 --- a/src/services/formatting/formattingManager.ts +++ /dev/null @@ -1,123 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - export class FormattingManager { - private options: FormattingOptions; - - constructor(private syntaxTree: SyntaxTree, - private snapshot: ITextSnapshot, - private rulesProvider: RulesProvider, - editorOptions: ts.EditorOptions) { - // - // TODO: convert to use FormattingOptions instead of EditorOptions - this.options = new FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter) - } - - public formatSelection(minChar: number, limChar: number): ts.TextChange[] { - var span = TextSpan.fromBounds(minChar, limChar); - return this.formatSpan(span, FormattingRequestKind.FormatSelection); - } - - public formatDocument(): ts.TextChange[] { - var span = TextSpan.fromBounds(0, this.snapshot.getLength()); - return this.formatSpan(span, FormattingRequestKind.FormatDocument); - } - - public formatOnSemicolon(caretPosition: number): ts.TextChange[] { - var sourceUnit = this.syntaxTree.sourceUnit(); - var semicolonPositionedToken = findToken(sourceUnit, caretPosition - 1); - - if (semicolonPositionedToken.kind() === SyntaxKind.SemicolonToken) { - // Find the outer most parent that this semicolon terminates - var current: ISyntaxElement = semicolonPositionedToken; - while (current.parent !== null && - end(current.parent) === end(semicolonPositionedToken) && - current.parent.kind() !== SyntaxKind.List) { - current = current.parent; - } - - // Compute the span - var span = new TextSpan(fullStart(current), fullWidth(current)); - - // Format the span - return this.formatSpan(span, FormattingRequestKind.FormatOnSemicolon); - } - - return []; - } - - public formatOnClosingCurlyBrace(caretPosition: number): ts.TextChange[] { - var sourceUnit = this.syntaxTree.sourceUnit(); - var closeBracePositionedToken = findToken(sourceUnit, caretPosition - 1); - - if (closeBracePositionedToken.kind() === SyntaxKind.CloseBraceToken) { - // Find the outer most parent that this closing brace terminates - var current: ISyntaxElement = closeBracePositionedToken; - while (current.parent !== null && - end(current.parent) === end(closeBracePositionedToken) && - current.parent.kind() !== SyntaxKind.List) { - current = current.parent; - } - - // Compute the span - var span = new TextSpan(fullStart(current), fullWidth(current)); - - // Format the span - return this.formatSpan(span, FormattingRequestKind.FormatOnClosingCurlyBrace); - } - - return []; - } - - public formatOnEnter(caretPosition: number): ts.TextChange[] { - var lineNumber = this.snapshot.getLineNumberFromPosition(caretPosition); - - if (lineNumber > 0) { - // Format both lines - var prevLine = this.snapshot.getLineFromLineNumber(lineNumber - 1); - var currentLine = this.snapshot.getLineFromLineNumber(lineNumber); - var span = TextSpan.fromBounds(prevLine.startPosition(), currentLine.endPosition()); - - // Format the span - return this.formatSpan(span, FormattingRequestKind.FormatOnEnter); - - } - - return []; - } - - private formatSpan(span: TextSpan, formattingRequestKind: FormattingRequestKind): ts.TextChange[] { - // Always format from the beginning of the line - var startLine = this.snapshot.getLineFromPosition(span.start()); - span = TextSpan.fromBounds(startLine.startPosition(), span.end()); - - var result: ts.TextChange[] = []; - - var formattingEdits = Formatter.getEdits(span, this.syntaxTree.sourceUnit(), this.options, true, this.snapshot, this.rulesProvider, formattingRequestKind); - - // - // TODO: Change the ILanguageService interface to return TextEditInfo (with start, and length) instead of TextEdit (with minChar and limChar) - formattingEdits.forEach((item) => { - var edit = new ts.TextChange(new TextSpan(item.position, item.length), item.replaceWith); - result.push(edit); - }); - - return result; - } - } -} \ No newline at end of file diff --git a/src/services/formatting/formattingRequestKind.ts b/src/services/formatting/formattingRequestKind.ts index b766058e1ca..a66169c1e7c 100644 --- a/src/services/formatting/formattingRequestKind.ts +++ b/src/services/formatting/formattingRequestKind.ts @@ -13,15 +13,14 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { - export enum FormattingRequestKind { +module ts.formatting { + export const enum FormattingRequestKind { FormatDocument, FormatSelection, FormatOnEnter, FormatOnSemicolon, - FormatOnClosingCurlyBrace, - FormatOnPaste + FormatOnClosingCurlyBrace } } \ No newline at end of file diff --git a/src/services/formatting/formattingScanner.ts b/src/services/formatting/formattingScanner.ts new file mode 100644 index 00000000000..9cf2a05a5d9 --- /dev/null +++ b/src/services/formatting/formattingScanner.ts @@ -0,0 +1,222 @@ +/// +/// + +module ts.formatting { + var scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false); + + export interface FormattingScanner { + advance(): void; + isOnToken(): boolean; + readTokenInfo(n: Node): TokenInfo; + lastTrailingTriviaWasNewLine(): boolean; + close(): void; + } + + const enum ScanAction{ + Scan, + RescanGreaterThanToken, + RescanSlashToken, + RescanTemplateToken + } + + export function getFormattingScanner(sourceFile: SourceFile, startPos: number, endPos: number): FormattingScanner { + + scanner.setText(sourceFile.text); + scanner.setTextPos(startPos); + + var wasNewLine: boolean = true; + var leadingTrivia: TextRangeWithKind[]; + var trailingTrivia: TextRangeWithKind[]; + + var savedPos: number; + var lastScanAction: ScanAction; + var lastTokenInfo: TokenInfo; + + return { + advance: advance, + readTokenInfo: readTokenInfo, + isOnToken: isOnToken, + lastTrailingTriviaWasNewLine: () => wasNewLine, + close: () => { + lastTokenInfo = undefined; + scanner.setText(undefined); + } + } + + function advance(): void { + lastTokenInfo = undefined; + var isStarted = scanner.getStartPos() !== startPos; + + if (isStarted) { + if (trailingTrivia) { + Debug.assert(trailingTrivia.length !== 0); + wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === SyntaxKind.NewLineTrivia; + } + else { + wasNewLine = false; + } + } + + leadingTrivia = undefined; + trailingTrivia = undefined; + + if (!isStarted) { + scanner.scan(); + } + + var t: SyntaxKind; + var pos = scanner.getStartPos(); + + // Read leading trivia and token + while (pos < endPos) { + var t = scanner.getToken(); + if (!isTrivia(t)) { + break; + } + + // consume leading trivia + scanner.scan(); + var item = { + pos: pos, + end: scanner.getStartPos(), + kind: t + } + + pos = scanner.getStartPos(); + + if (!leadingTrivia) { + leadingTrivia = []; + } + leadingTrivia.push(item); + } + + savedPos = scanner.getStartPos(); + } + + function shouldRescanGreaterThanToken(container: Node): boolean { + if (container.kind !== SyntaxKind.BinaryExpression) { + return false; + } + switch ((container).operator) { + case SyntaxKind.GreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + case SyntaxKind.GreaterThanGreaterThanToken: + return true; + } + + return false; + } + + function shouldRescanSlashToken(container: Node): boolean { + return container.kind === SyntaxKind.RegularExpressionLiteral; + } + + function shouldRescanTemplateToken(container: Node): boolean { + return container.kind === SyntaxKind.TemplateSpan; + } + + function startsWithSlashToken(t: SyntaxKind): boolean { + return t === SyntaxKind.SlashToken || t === SyntaxKind.SlashEqualsToken; + } + + function readTokenInfo(n: Node): TokenInfo { + if (!isOnToken()) { + // scanner is not on the token (either advance was not called yet or scanner is already past the end position) + return { + leadingTrivia: leadingTrivia, + trailingTrivia: undefined, + token: undefined + }; + } + + // normally scanner returns the smallest available token + // check the kind of context node to determine if scanner should have more greedy behavior and consume more text. + var expectedScanAction = + shouldRescanGreaterThanToken(n) + ? ScanAction.RescanGreaterThanToken + : shouldRescanSlashToken(n) + ? ScanAction.RescanSlashToken + : shouldRescanTemplateToken(n) + ? ScanAction.RescanTemplateToken + : ScanAction.Scan + + if (lastTokenInfo && expectedScanAction === lastScanAction) { + // readTokenInfo was called before with the same expected scan action. + // No need to re-scan text, return existing 'lastTokenInfo' + return lastTokenInfo; + } + + if (scanner.getStartPos() !== savedPos) { + Debug.assert(lastTokenInfo !== undefined); + // readTokenInfo was called before but scan action differs - rescan text + scanner.setTextPos(savedPos); + scanner.scan(); + } + + var currentToken = scanner.getToken(); + + if (expectedScanAction === ScanAction.RescanGreaterThanToken && currentToken === SyntaxKind.GreaterThanToken) { + currentToken = scanner.reScanGreaterToken(); + Debug.assert((n).operator === currentToken); + lastScanAction = ScanAction.RescanGreaterThanToken; + } + else if (expectedScanAction === ScanAction.RescanSlashToken && startsWithSlashToken(currentToken)) { + currentToken = scanner.reScanSlashToken(); + Debug.assert(n.kind === currentToken); + lastScanAction = ScanAction.RescanSlashToken; + } + else if (expectedScanAction === ScanAction.RescanTemplateToken && currentToken === SyntaxKind.CloseBraceToken) { + currentToken = scanner.reScanTemplateToken(); + lastScanAction = ScanAction.RescanTemplateToken; + } + else { + lastScanAction = ScanAction.Scan; + } + + var token: TextRangeWithKind = { + pos: scanner.getStartPos(), + end: scanner.getTextPos(), + kind: currentToken + } + + // consume trailing trivia + while(scanner.getStartPos() < endPos) { + currentToken = scanner.scan(); + if (!isTrivia(currentToken)) { + break; + } + var trivia = { + pos: scanner.getStartPos(), + end: scanner.getTextPos(), + kind: currentToken + }; + + if (!trailingTrivia) { + trailingTrivia = []; + } + + trailingTrivia.push(trivia); + + if (currentToken === SyntaxKind.NewLineTrivia) { + // move past new line + scanner.scan(); + break; + } + } + + return lastTokenInfo = { + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia, + token: token + } + } + + function isOnToken(): boolean { + var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); + var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + return startPos < endPos && current !== SyntaxKind.EndOfFileToken && !isTrivia(current); + } + } +} \ No newline at end of file diff --git a/src/services/formatting/indentation.ts b/src/services/formatting/indentation.ts new file mode 100644 index 00000000000..f6f8fc0319f --- /dev/null +++ b/src/services/formatting/indentation.ts @@ -0,0 +1,54 @@ +module ts.formatting { + + var internedTabsIndentation: string[]; + var internedSpacesIndentation: string[]; + + export function getIndentationString(indentation: number, options: FormatCodeOptions): string { + if (!options.ConvertTabsToSpaces) { + var tabs = Math.floor(indentation / options.TabSize); + var spaces = indentation - tabs * options.TabSize; + + var tabString: string; + if (!internedTabsIndentation) { + internedTabsIndentation = []; + } + + if (internedTabsIndentation[tabs] === undefined) { + internedTabsIndentation[tabs] = tabString = repeat('\t', tabs); + } + else { + tabString = internedTabsIndentation[tabs]; + } + + return spaces ? tabString + repeat(" ", spaces) : tabString; + } + else { + var spacesString: string; + var quotient = Math.floor(indentation / options.IndentSize); + var remainder = indentation % options.IndentSize; + if (!internedSpacesIndentation) { + internedSpacesIndentation = []; + } + + if (internedSpacesIndentation[quotient] === undefined) { + spacesString = repeat(" ", options.IndentSize * quotient); + internedSpacesIndentation[quotient] = spacesString; + } + else { + spacesString = internedSpacesIndentation[quotient]; + } + + + return remainder ? spacesString + repeat(" ", remainder) : spacesString; + } + + function repeat(value: string, count: number): string { + var s = ""; + for (var i = 0; i < count; ++i) { + s += value; + } + + return s; + } + } +} \ No newline at end of file diff --git a/src/services/formatting/indentationNodeContext.ts b/src/services/formatting/indentationNodeContext.ts deleted file mode 100644 index 398d4998eed..00000000000 --- a/src/services/formatting/indentationNodeContext.ts +++ /dev/null @@ -1,103 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - export class IndentationNodeContext { - private _node: ISyntaxNode; - private _parent: IndentationNodeContext; - private _fullStart: number; - private _indentationAmount: number; - private _childIndentationAmountDelta: number; - private _depth: number; - private _hasSkippedOrMissingTokenChild: boolean; - - constructor(parent: IndentationNodeContext, node: ISyntaxNode, fullStart: number, indentationAmount: number, childIndentationAmountDelta: number) { - this.update(parent, node, fullStart, indentationAmount, childIndentationAmountDelta); - } - - public parent(): IndentationNodeContext { - return this._parent; - } - - public node(): ISyntaxNode { - return this._node; - } - - public fullStart(): number { - return this._fullStart; - } - - public fullWidth(): number { - return fullWidth(this._node); - } - - public start(): number { - return this._fullStart + leadingTriviaWidth(this._node); - } - - public end(): number { - return this._fullStart + leadingTriviaWidth(this._node) + width(this._node); - } - - public indentationAmount(): number { - return this._indentationAmount; - } - - public childIndentationAmountDelta(): number { - return this._childIndentationAmountDelta; - } - - public depth(): number { - return this._depth; - } - - public kind(): SyntaxKind { - return this._node.kind(); - } - - public hasSkippedOrMissingTokenChild(): boolean { - if (this._hasSkippedOrMissingTokenChild === null) { - this._hasSkippedOrMissingTokenChild = Syntax.nodeHasSkippedOrMissingTokens(this._node); - } - return this._hasSkippedOrMissingTokenChild; - } - - public clone(pool: IndentationNodeContextPool): IndentationNodeContext { - var parent: IndentationNodeContext = null; - if (this._parent) { - parent = this._parent.clone(pool); - } - return pool.getNode(parent, this._node, this._fullStart, this._indentationAmount, this._childIndentationAmountDelta); - } - - public update(parent: IndentationNodeContext, node: ISyntaxNode, fullStart: number, indentationAmount: number, childIndentationAmountDelta: number) { - this._parent = parent; - this._node = node; - this._fullStart = fullStart; - this._indentationAmount = indentationAmount; - this._childIndentationAmountDelta = childIndentationAmountDelta; - this._hasSkippedOrMissingTokenChild = null; - - if (parent) { - this._depth = parent.depth() + 1; - } - else { - this._depth = 0; - } - } - } -} \ No newline at end of file diff --git a/src/services/formatting/indentationNodeContextPool.ts b/src/services/formatting/indentationNodeContextPool.ts deleted file mode 100644 index ea5b26277b5..00000000000 --- a/src/services/formatting/indentationNodeContextPool.ts +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - export class IndentationNodeContextPool { - private nodes: IndentationNodeContext[] = []; - - public getNode(parent: IndentationNodeContext, node: ISyntaxNode, fullStart: number, indentationLevel: number, childIndentationLevelDelta: number): IndentationNodeContext { - if (this.nodes.length > 0) { - var cachedNode = this.nodes.pop(); - cachedNode.update(parent, node, fullStart, indentationLevel, childIndentationLevelDelta); - return cachedNode; - } - - return new IndentationNodeContext(parent, node, fullStart, indentationLevel, childIndentationLevelDelta); - } - - public releaseNode(node: IndentationNodeContext, recursive: boolean = false): void { - this.nodes.push(node); - - if (recursive) { - var parent = node.parent(); - if (parent) { - this.releaseNode(parent, recursive); - } - } - } - } -} \ No newline at end of file diff --git a/src/services/formatting/indentationTrackingWalker.ts b/src/services/formatting/indentationTrackingWalker.ts deleted file mode 100644 index b07b477623e..00000000000 --- a/src/services/formatting/indentationTrackingWalker.ts +++ /dev/null @@ -1,349 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - export class IndentationTrackingWalker extends SyntaxWalker { - private _position: number = 0; - private _parent: IndentationNodeContext = null; - private _textSpan: TextSpan; - private _snapshot: ITextSnapshot; - private _lastTriviaWasNewLine: boolean; - private _indentationNodeContextPool: IndentationNodeContextPool; - private _text: ISimpleText; - - constructor(textSpan: TextSpan, sourceUnit: SourceUnitSyntax, snapshot: ITextSnapshot, indentFirstToken: boolean, public options: FormattingOptions) { - super(); - - // Create a pool object to manage context nodes while walking the tree - this._indentationNodeContextPool = new IndentationNodeContextPool(); - - this._textSpan = textSpan; - this._text = sourceUnit.syntaxTree.text; - this._snapshot = snapshot; - this._parent = this._indentationNodeContextPool.getNode(null, sourceUnit, 0, 0, 0); - - // Is the first token in the span at the start of a new line. - this._lastTriviaWasNewLine = indentFirstToken; - } - - public position(): number { - return this._position; - } - - public parent(): IndentationNodeContext { - return this._parent; - } - - public textSpan(): TextSpan { - return this._textSpan; - } - - public snapshot(): ITextSnapshot { - return this._snapshot; - } - - public indentationNodeContextPool(): IndentationNodeContextPool { - return this._indentationNodeContextPool; - } - - public forceIndentNextToken(tokenStart: number): void { - this._lastTriviaWasNewLine = true; - this.forceRecomputeIndentationOfParent(tokenStart, true); - } - - public forceSkipIndentingNextToken(tokenStart: number): void { - this._lastTriviaWasNewLine = false; - this.forceRecomputeIndentationOfParent(tokenStart, false); - } - - public indentToken(token: ISyntaxToken, indentationAmount: number, commentIndentationAmount: number): void { - throw Errors.abstract(); - } - - public visitTokenInSpan(token: ISyntaxToken): void { - if (this._lastTriviaWasNewLine) { - // Compute the indentation level at the current token - var indentationAmount = this.getTokenIndentationAmount(token); - var commentIndentationAmount = this.getCommentIndentationAmount(token); - - // Process the token - this.indentToken(token, indentationAmount, commentIndentationAmount); - } - } - - public visitToken(token: ISyntaxToken): void { - var tokenSpan = new TextSpan(this._position, token.fullWidth()); - - if (tokenSpan.intersectsWithTextSpan(this._textSpan)) { - this.visitTokenInSpan(token); - - // Only track new lines on tokens within the range. Make sure to check that the last trivia is a newline, and not just one of the trivia - var trivia = token.trailingTrivia(); - this._lastTriviaWasNewLine = trivia.hasNewLine() && trivia.syntaxTriviaAt(trivia.count() - 1).kind() == SyntaxKind.NewLineTrivia; - } - - // Update the position - this._position += token.fullWidth(); - } - - public visitNode(node: ISyntaxNode): void { - var nodeSpan = new TextSpan(this._position, fullWidth(node)); - - if (nodeSpan.intersectsWithTextSpan(this._textSpan)) { - // Update indentation level - var indentation = this.getNodeIndentation(node); - - // Update the parent - var currentParent = this._parent; - this._parent = this._indentationNodeContextPool.getNode(currentParent, node, this._position, indentation.indentationAmount, indentation.indentationAmountDelta); - - // Visit node - visitNodeOrToken(this, node); - - // Reset state - this._indentationNodeContextPool.releaseNode(this._parent); - this._parent = currentParent; - } - else { - // We're skipping the node, so update our position accordingly. - this._position += fullWidth(node); - } - } - - private getTokenIndentationAmount(token: ISyntaxToken): number { - // If this is the first token of a node, it should follow the node indentation and not the child indentation; - // (e.g.class in a class declaration or module in module declariotion). - // Open and close braces should follow the indentation of thier parent as well(e.g. - // class { - // } - // Also in a do-while statement, the while should be indented like the parent. - if (firstToken(this._parent.node()) === token || - token.kind() === SyntaxKind.OpenBraceToken || token.kind() === SyntaxKind.CloseBraceToken || - token.kind() === SyntaxKind.OpenBracketToken || token.kind() === SyntaxKind.CloseBracketToken || - (token.kind() === SyntaxKind.WhileKeyword && this._parent.node().kind() == SyntaxKind.DoStatement)) { - return this._parent.indentationAmount(); - } - - return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); - } - - private getCommentIndentationAmount(token: ISyntaxToken): number { - // If this is token terminating an indentation scope, leading comments should be indented to follow the children - // indentation level and not the node - - if (token.kind() === SyntaxKind.CloseBraceToken || token.kind() === SyntaxKind.CloseBracketToken) { - return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); - } - return this._parent.indentationAmount(); - } - - private getNodeIndentation(node: ISyntaxNode, newLineInsertedByFormatting?: boolean): { indentationAmount: number; indentationAmountDelta: number; } { - var parent = this._parent; - - // We need to get the parent's indentation, which could be one of 2 things. If first token of the parent is in the span, use the parent's computed indentation. - // If the parent was outside the span, use the actual indentation of the parent. - var parentIndentationAmount: number; - if (this._textSpan.containsPosition(parent.start())) { - parentIndentationAmount = parent.indentationAmount(); - } - else { - if (parent.kind() === SyntaxKind.Block && !this.shouldIndentBlockInParent(this._parent.parent())) { - // Blocks preserve the indentation of their containing node (unless they're a - // standalone block in a list). i.e. if you have: - // - // function foo( - // a: number) { - // - // Then we expect the indentation of the block to be tied to the function, not to - // the line that the block is defined on. If we were to do the latter, then the - // indentation would be here: - // - // function foo( - // a: number) { - // | - // - // Instead of: - // - // function foo( - // a: number) { - // | - parent = this._parent.parent(); - } - - var line = this._snapshot.getLineFromPosition(parent.start()).getText(); - var firstNonWhiteSpacePosition = Indentation.firstNonWhitespacePosition(line); - parentIndentationAmount = Indentation.columnForPositionInString(line, firstNonWhiteSpacePosition, this.options); - } - var parentIndentationAmountDelta = parent.childIndentationAmountDelta(); - - // The indentation level of the node - var indentationAmount: number; - - // The delta it adds to its children. - var indentationAmountDelta: number; - var parentNode = parent.node(); - - switch (node.kind()) { - default: - // General case - // This node should follow the child indentation set by its parent - // This node does not introduce any new indentation scope, indent any decendants of this node (tokens or child nodes) - // using the same indentation level - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - indentationAmountDelta = 0; - break; - - // Statements introducing {} - case SyntaxKind.ClassDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.ObjectType: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.SwitchStatement: - case SyntaxKind.ObjectLiteralExpression: - case SyntaxKind.ConstructorDeclaration: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.FunctionExpression: - case SyntaxKind.MemberFunctionDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.IndexMemberDeclaration: - case SyntaxKind.CatchClause: - // Statements introducing [] - case SyntaxKind.ArrayLiteralExpression: - case SyntaxKind.ArrayType: - case SyntaxKind.ElementAccessExpression: - case SyntaxKind.IndexSignature: - // Other statements - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WithStatement: - case SyntaxKind.CaseSwitchClause: - case SyntaxKind.DefaultSwitchClause: - case SyntaxKind.ReturnStatement: - case SyntaxKind.ThrowStatement: - case SyntaxKind.SimpleArrowFunctionExpression: - case SyntaxKind.ParenthesizedArrowFunctionExpression: - case SyntaxKind.VariableDeclaration: - case SyntaxKind.ExportAssignment: - - // Expressions which have argument lists or parameter lists - case SyntaxKind.InvocationExpression: - case SyntaxKind.ObjectCreationExpression: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - - // These nodes should follow the child indentation set by its parent; - // they introduce a new indenation scope; children should be indented at one level deeper - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - indentationAmountDelta = this.options.indentSpaces; - break; - - case SyntaxKind.IfStatement: - if (parent.kind() === SyntaxKind.ElseClause && - !SyntaxUtilities.isLastTokenOnLine((parentNode).elseKeyword, this._text)) { - // This is an else if statement with the if on the same line as the else, do not indent the if statmement. - // Note: Children indentation has already been set by the parent if statement, so no need to increment - indentationAmount = parentIndentationAmount; - } - else { - // Otherwise introduce a new indenation scope; children should be indented at one level deeper - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - } - indentationAmountDelta = this.options.indentSpaces; - break; - - case SyntaxKind.ElseClause: - // Else should always follow its parent if statement indentation. - // Note: Children indentation has already been set by the parent if statement, so no need to increment - indentationAmount = parentIndentationAmount; - indentationAmountDelta = this.options.indentSpaces; - break; - - - case SyntaxKind.Block: - // Check if the block is a member in a list of statements (if the parent is a source unit, module, or block, or switch clause) - if (this.shouldIndentBlockInParent(parent)) { - indentationAmount = parentIndentationAmount + parentIndentationAmountDelta; - } - else { - indentationAmount = parentIndentationAmount; - } - - indentationAmountDelta = this.options.indentSpaces; - break; - } - - // If the parent happens to start on the same line as this node, then override the current node indenation with that - // of the parent. This avoid having to add an extra level of indentation for the children. e.g.: - // return { - // a:1 - // }; - // instead of: - // return { - // a:1 - // }; - // We also need to pass the delta (if it is nonzero) to the children, so that subsequent lines get indented. Essentially, if any node starting on the given line - // has a nonzero delta , the resulting delta should be inherited from this node. This is to indent cases like the following: - // return a - // || b; - // Lastly, it is possible the node indentation needs to be recomputed because the formatter inserted a newline before its first token. - // If this is the case, we know the node no longer starts on the same line as its parent (or at least we shouldn't treat it as such). - if (parentNode) { - if (!newLineInsertedByFormatting /*This could be false or undefined here*/) { - var parentStartLine = this._snapshot.getLineNumberFromPosition(parent.start()); - var currentNodeStartLine = this._snapshot.getLineNumberFromPosition(this._position + leadingTriviaWidth(node)); - if (parentStartLine === currentNodeStartLine || newLineInsertedByFormatting === false /*meaning a new line was removed and we are force recomputing*/) { - indentationAmount = parentIndentationAmount; - indentationAmountDelta = Math.min(this.options.indentSpaces, parentIndentationAmountDelta + indentationAmountDelta); - } - } - } - - return { - indentationAmount: indentationAmount, - indentationAmountDelta: indentationAmountDelta - }; - } - - private shouldIndentBlockInParent(parent: IndentationNodeContext): boolean { - switch (parent.kind()) { - case SyntaxKind.SourceUnit: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.Block: - case SyntaxKind.CaseSwitchClause: - case SyntaxKind.DefaultSwitchClause: - return true; - - default: - return false; - } - } - - private forceRecomputeIndentationOfParent(tokenStart: number, newLineAdded: boolean /*as opposed to removed*/): void { - var parent = this._parent; - if (parent.fullStart() === tokenStart) { - // Temporarily pop the parent before recomputing - this._parent = parent.parent(); - var indentation = this.getNodeIndentation(parent.node(), /* newLineInsertedByFormatting */ newLineAdded); - parent.update(parent.parent(), parent.node(), parent.fullStart(), indentation.indentationAmount, indentation.indentationAmountDelta); - this._parent = parent; - } - } - } -} \ No newline at end of file diff --git a/src/services/formatting/multipleTokenIndenter.ts b/src/services/formatting/multipleTokenIndenter.ts deleted file mode 100644 index 23181571427..00000000000 --- a/src/services/formatting/multipleTokenIndenter.ts +++ /dev/null @@ -1,206 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - export class MultipleTokenIndenter extends IndentationTrackingWalker { - private _edits: TextEditInfo[] = []; - - constructor(textSpan: TextSpan, sourceUnit: SourceUnitSyntax, snapshot: ITextSnapshot, indentFirstToken: boolean, options: FormattingOptions) { - super(textSpan, sourceUnit, snapshot, indentFirstToken, options); - } - - public indentToken(token: ISyntaxToken, indentationAmount: number, commentIndentationAmount: number): void { - // Ignore generated tokens - if (token.fullWidth() === 0) { - return; - } - - // If we have any skipped tokens as children, do not process this node for indentation or formatting - if (this.parent().hasSkippedOrMissingTokenChild()) { - return; - } - - // Be strict, and only consider nodes that fall inside the span. This avoids indenting a multiline string - // on enter at the end of, as the whole token was not included in the span - var tokenSpan = new TextSpan(this.position() + token.leadingTriviaWidth(), width(token)); - if (!this.textSpan().containsTextSpan(tokenSpan)) { - return; - } - - // Compute an indentation string for this token - var indentationString = Indentation.indentationString(indentationAmount, this.options); - - var commentIndentationString = Indentation.indentationString(commentIndentationAmount, this.options); - - // Record any needed indentation edits - this.recordIndentationEditsForToken(token, indentationString, commentIndentationString); - } - - public edits(): TextEditInfo[]{ - return this._edits; - } - - public recordEdit(position: number, length: number, replaceWith: string): void { - this._edits.push(new TextEditInfo(position, length, replaceWith)); - } - - private recordIndentationEditsForToken(token: ISyntaxToken, indentationString: string, commentIndentationString: string) { - var position = this.position(); - var indentNextTokenOrTrivia = true; - var leadingWhiteSpace = ""; // We need to track the whitespace before a multiline comment - - // Process any leading trivia if any - var triviaList = token.leadingTrivia(); - if (triviaList) { - for (var i = 0, length = triviaList.count(); i < length; i++, position += trivia.fullWidth()) { - var trivia = triviaList.syntaxTriviaAt(i); - // Skip this trivia if it is not in the span - if (!this.textSpan().containsTextSpan(new TextSpan(position, trivia.fullWidth()))) { - continue; - } - - switch (trivia.kind()) { - case SyntaxKind.MultiLineCommentTrivia: - // We will only indent the first line of the multiline comment if we were planning to indent the next trivia. However, - // subsequent lines will always be indented - this.recordIndentationEditsForMultiLineComment(trivia, position, commentIndentationString, leadingWhiteSpace, !indentNextTokenOrTrivia /* already indented first line */); - indentNextTokenOrTrivia = false; - leadingWhiteSpace = ""; - break; - - case SyntaxKind.SingleLineCommentTrivia: - case SyntaxKind.SkippedTokenTrivia: - if (indentNextTokenOrTrivia) { - this.recordIndentationEditsForSingleLineOrSkippedText(trivia, position, commentIndentationString); - indentNextTokenOrTrivia = false; - } - break; - - case SyntaxKind.WhitespaceTrivia: - // If the next trivia is a comment, use the comment indentation level instead of the regular indentation level - // If the next trivia is a newline, this whole line is just whitespace, so don't do anything (trimming will take care of it) - var nextTrivia = length > i + 1 && triviaList.syntaxTriviaAt(i + 1); - var whiteSpaceIndentationString = nextTrivia && nextTrivia.isComment() ? commentIndentationString : indentationString; - if (indentNextTokenOrTrivia) { - if (!(nextTrivia && nextTrivia.isNewLine())) { - this.recordIndentationEditsForWhitespace(trivia, position, whiteSpaceIndentationString); - } - indentNextTokenOrTrivia = false; - } - leadingWhiteSpace += trivia.fullText(); - break; - - case SyntaxKind.NewLineTrivia: - // We hit a newline processing the trivia. We need to add the indentation to the - // next line as well. Note: don't bother indenting the newline itself. This will - // just insert ugly whitespace that most users probably will not want. - indentNextTokenOrTrivia = true; - leadingWhiteSpace = ""; - break; - - default: - throw Errors.invalidOperation(); - } - } - - } - - if (token.kind() !== SyntaxKind.EndOfFileToken && indentNextTokenOrTrivia) { - // If the last trivia item was a new line, or no trivia items were encounterd record the - // indentation edit at the token position - if (indentationString.length > 0) { - this.recordEdit(position, 0, indentationString); - } - } - } - - private recordIndentationEditsForSingleLineOrSkippedText(trivia: ISyntaxTrivia, fullStart: number, indentationString: string): void { - // Record the edit - if (indentationString.length > 0) { - this.recordEdit(fullStart, 0, indentationString); - } - } - - private recordIndentationEditsForWhitespace(trivia: ISyntaxTrivia, fullStart: number, indentationString: string): void { - var text = trivia.fullText(); - - // Check if the current indentation matches the desired indentation or not - if (indentationString === text) { - return; - } - - // Record the edit - this.recordEdit(fullStart, text.length, indentationString); - } - - private recordIndentationEditsForMultiLineComment(trivia: ISyntaxTrivia, fullStart: number, indentationString: string, leadingWhiteSpace: string, firstLineAlreadyIndented: boolean): void { - // If the multiline comment spans multiple lines, we need to add the right indent amount to - // each successive line segment as well. - var position = fullStart; - var segments = Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - - if (segments.length <= 1) { - if (!firstLineAlreadyIndented) { - // Process the one-line multiline comment just like a single line comment - this.recordIndentationEditsForSingleLineOrSkippedText(trivia, fullStart, indentationString); - } - return; - } - - // Find number of columns in first segment - var whiteSpaceColumnsInFirstSegment = Indentation.columnForPositionInString(leadingWhiteSpace, leadingWhiteSpace.length, this.options); - - var indentationColumns = Indentation.columnForPositionInString(indentationString, indentationString.length, this.options); - var startIndex = 0; - if (firstLineAlreadyIndented) { - startIndex = 1; - position += segments[0].length; - } - for (var i = startIndex; i < segments.length; i++) { - var segment = segments[i]; - this.recordIndentationEditsForSegment(segment, position, indentationColumns, whiteSpaceColumnsInFirstSegment); - position += segment.length; - } - } - - private recordIndentationEditsForSegment(segment: string, fullStart: number, indentationColumns: number, whiteSpaceColumnsInFirstSegment: number): void { - // Indent subsequent lines using a column delta of the actual indentation relative to the first line - var firstNonWhitespacePosition = Indentation.firstNonWhitespacePosition(segment); - var leadingWhiteSpaceColumns = Indentation.columnForPositionInString(segment, firstNonWhitespacePosition, this.options); - var deltaFromFirstSegment = leadingWhiteSpaceColumns - whiteSpaceColumnsInFirstSegment; - var finalColumns = indentationColumns + deltaFromFirstSegment; - if (finalColumns < 0) { - finalColumns = 0; - } - var indentationString = Indentation.indentationString(finalColumns, this.options); - - if (firstNonWhitespacePosition < segment.length && - CharacterInfo.isLineTerminator(segment.charCodeAt(firstNonWhitespacePosition))) { - // If this segment was just a newline, then don't bother indenting it. That will just - // leave the user with an ugly indent in their output that they probably do not want. - return; - } - - if (indentationString === segment.substring(0, firstNonWhitespacePosition)) { - return; - } - - // Record the edit - this.recordEdit(fullStart, firstNonWhitespacePosition, indentationString); - } - } -} \ No newline at end of file diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/references.ts similarity index 63% rename from src/services/formatting/formatting.ts rename to src/services/formatting/references.ts index c334e1864ab..9f4b7e37436 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/references.ts @@ -13,12 +13,9 @@ // limitations under the License. // +/// /// -/// -/// -/// /// -/// /// /// /// @@ -28,13 +25,5 @@ /// /// /// -/// -/// /// -/// -/// -/// -/// -/// -/// -/// \ No newline at end of file +/// \ No newline at end of file diff --git a/src/services/formatting/rule.ts b/src/services/formatting/rule.ts index 273f0590ce7..356720d2330 100644 --- a/src/services/formatting/rule.ts +++ b/src/services/formatting/rule.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class Rule { constructor( public Descriptor: RuleDescriptor, diff --git a/src/services/formatting/ruleAction.ts b/src/services/formatting/ruleAction.ts index 32c67c950ca..d2890d8e080 100644 --- a/src/services/formatting/ruleAction.ts +++ b/src/services/formatting/ruleAction.ts @@ -13,13 +13,13 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { - export enum RuleAction { - Ignore, - Space, - NewLine, - Delete +module ts.formatting { + export const enum RuleAction { + Ignore = 0x00000001, + Space = 0x00000002, + NewLine = 0x00000004, + Delete = 0x00000008 } } \ No newline at end of file diff --git a/src/services/formatting/ruleDescriptor.ts b/src/services/formatting/ruleDescriptor.ts index 1e7d822d57b..e5b7d6f3186 100644 --- a/src/services/formatting/ruleDescriptor.ts +++ b/src/services/formatting/ruleDescriptor.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class RuleDescriptor { constructor(public LeftTokenRange: Shared.TokenRange, public RightTokenRange: Shared.TokenRange) { } @@ -34,7 +34,6 @@ module TypeScript.Services.Formatting { } static create3(left: SyntaxKind, right: Shared.TokenRange): RuleDescriptor - //: this(TokenRange.FromToken(left), right) { return RuleDescriptor.create4(Shared.TokenRange.FromToken(left), right); } diff --git a/src/services/formatting/ruleFlag.ts b/src/services/formatting/ruleFlag.ts index d815537dfd9..aaf70639e01 100644 --- a/src/services/formatting/ruleFlag.ts +++ b/src/services/formatting/ruleFlag.ts @@ -13,10 +13,10 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { - export enum RuleFlags { +module ts.formatting { + export const enum RuleFlags { None, CanDeleteNewLines } diff --git a/src/services/formatting/ruleOperation.ts b/src/services/formatting/ruleOperation.ts index 1f74aea0784..c73e3b6bcf7 100644 --- a/src/services/formatting/ruleOperation.ts +++ b/src/services/formatting/ruleOperation.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class RuleOperation { public Context: RuleOperationContext; public Action: RuleAction; diff --git a/src/services/formatting/ruleOperationContext.ts b/src/services/formatting/ruleOperationContext.ts index a1e349210e4..d037f8e70d7 100644 --- a/src/services/formatting/ruleOperationContext.ts +++ b/src/services/formatting/ruleOperationContext.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class RuleOperationContext { private customContextChecks: { (context: FormattingContext): boolean; }[]; diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index ade1dc6b217..2485945df0b 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class Rules { public getRuleName(rule: Rule) { var o: ts.Map = this; @@ -24,7 +24,7 @@ module TypeScript.Services.Formatting { return name; } } - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Unknown_rule, null)); + throw new Error("Unknown rule"); } [name: string]: any; @@ -241,7 +241,7 @@ module TypeScript.Services.Formatting { this.SpaceBeforeOpenBraceInFunction = new Rule(RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, SyntaxKind.OpenBraceToken), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), RuleAction.Space), RuleFlags.CanDeleteNewLines); // Place a space before open brace in a TypeScript declaration that has braces as children (class, module, enum, etc) - this.TypeScriptOpenBraceLeftTokenRange = Shared.TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.MultiLineCommentTrivia]); + this.TypeScriptOpenBraceLeftTokenRange = Shared.TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.MultiLineCommentTrivia]); this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new Rule(RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, SyntaxKind.OpenBraceToken), RuleOperation.create2(new RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), RuleAction.Space), RuleFlags.CanDeleteNewLines); // Place a space before open brace in a control flow construct @@ -299,7 +299,7 @@ module TypeScript.Services.Formatting { // get x() {} // set x(val) {} - this.SpaceAfterGetSetInMember = new Rule(RuleDescriptor.create2(Shared.TokenRange.FromTokens([SyntaxKind.GetKeyword, SyntaxKind.SetKeyword]), SyntaxKind.IdentifierName), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclContext), RuleAction.Space)); + this.SpaceAfterGetSetInMember = new Rule(RuleDescriptor.create2(Shared.TokenRange.FromTokens([SyntaxKind.GetKeyword, SyntaxKind.SetKeyword]), SyntaxKind.Identifier), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclContext), RuleAction.Space)); // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. this.SpaceBeforeBinaryKeywordOperator = new Rule(RuleDescriptor.create4(Shared.TokenRange.Any, Shared.TokenRange.BinaryKeywordOperators), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), RuleAction.Space)); @@ -324,7 +324,7 @@ module TypeScript.Services.Formatting { this.SpaceAfterArrow = new Rule(RuleDescriptor.create3(SyntaxKind.EqualsGreaterThanToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); // Optional parameters and var args - this.NoSpaceAfterEllipsis = new Rule(RuleDescriptor.create1(SyntaxKind.DotDotDotToken, SyntaxKind.IdentifierName), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); + this.NoSpaceAfterEllipsis = new Rule(RuleDescriptor.create1(SyntaxKind.DotDotDotToken, SyntaxKind.Identifier), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); this.NoSpaceAfterOptionalParameters = new Rule(RuleDescriptor.create3(SyntaxKind.QuestionToken, Shared.TokenRange.FromTokens([SyntaxKind.CloseParenToken, SyntaxKind.CommaToken])), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), RuleAction.Delete)); // generics @@ -437,7 +437,7 @@ module TypeScript.Services.Formatting { /// static IsForContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.ForStatement; + return context.contextNode.kind === SyntaxKind.ForStatement; } static IsNotForContext(context: FormattingContext): boolean { @@ -446,51 +446,19 @@ module TypeScript.Services.Formatting { static IsBinaryOpContext(context: FormattingContext): boolean { - switch (context.contextNode.kind()) { - // binary expressions - case SyntaxKind.AssignmentExpression: - case SyntaxKind.AddAssignmentExpression: - case SyntaxKind.SubtractAssignmentExpression: - case SyntaxKind.MultiplyAssignmentExpression: - case SyntaxKind.DivideAssignmentExpression: - case SyntaxKind.ModuloAssignmentExpression: - case SyntaxKind.AndAssignmentExpression: - case SyntaxKind.ExclusiveOrAssignmentExpression: - case SyntaxKind.OrAssignmentExpression: - case SyntaxKind.LeftShiftAssignmentExpression: - case SyntaxKind.SignedRightShiftAssignmentExpression: - case SyntaxKind.UnsignedRightShiftAssignmentExpression: + switch (context.contextNode.kind) { + case SyntaxKind.BinaryExpression: case SyntaxKind.ConditionalExpression: - case SyntaxKind.LogicalOrExpression: - case SyntaxKind.LogicalAndExpression: - case SyntaxKind.BitwiseOrExpression: - case SyntaxKind.BitwiseExclusiveOrExpression: - case SyntaxKind.BitwiseAndExpression: - case SyntaxKind.EqualsWithTypeConversionExpression: - case SyntaxKind.NotEqualsWithTypeConversionExpression: - case SyntaxKind.EqualsExpression: - case SyntaxKind.NotEqualsExpression: - case SyntaxKind.LessThanExpression: - case SyntaxKind.GreaterThanExpression: - case SyntaxKind.LessThanOrEqualExpression: - case SyntaxKind.GreaterThanOrEqualExpression: - case SyntaxKind.InstanceOfExpression: - case SyntaxKind.InExpression: - case SyntaxKind.LeftShiftExpression: - case SyntaxKind.SignedRightShiftExpression: - case SyntaxKind.UnsignedRightShiftExpression: - case SyntaxKind.MultiplyExpression: - case SyntaxKind.DivideExpression: - case SyntaxKind.ModuloExpression: - case SyntaxKind.AddExpression: - case SyntaxKind.SubtractExpression: return true; // equal in import a = module('a'); case SyntaxKind.ImportDeclaration: // equal in var a = 0; - case SyntaxKind.VariableDeclarator: - case SyntaxKind.EqualsValueClause: + case SyntaxKind.VariableDeclaration: + // equal in p = 0; + case SyntaxKind.Parameter: + case SyntaxKind.EnumMember: + case SyntaxKind.Property: return context.currentTokenSpan.kind === SyntaxKind.EqualsToken || context.nextTokenSpan.kind === SyntaxKind.EqualsToken; // "in" keyword in for (var x in []) { } case SyntaxKind.ForInStatement: @@ -546,16 +514,21 @@ module TypeScript.Services.Formatting { } // IMPORTANT!!! This method must return true ONLY for nodes with open and close braces as immediate children - static NodeIsBlockContext(node: IndentationNodeContext): boolean { + static NodeIsBlockContext(node: Node): boolean { if (Rules.NodeIsTypeScriptDeclWithBlockContext(node)) { // This means we are in a context that looks like a block to the user, but in the grammar is actually not a node (it's a class, module, enum, object type literal, etc). return true; } - switch (node.kind()) { + switch (node.kind) { case SyntaxKind.Block: case SyntaxKind.SwitchStatement: - case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.FunctionBlock: + case SyntaxKind.ModuleBlock: return true; } @@ -563,17 +536,20 @@ module TypeScript.Services.Formatting { } static IsFunctionDeclContext(context: FormattingContext): boolean { - switch (context.contextNode.kind()) { + switch (context.contextNode.kind) { case SyntaxKind.FunctionDeclaration: - case SyntaxKind.MemberFunctionDeclaration: + case SyntaxKind.Method: + //case SyntaxKind.MemberFunctionDeclaration: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: - case SyntaxKind.MethodSignature: + ///case SyntaxKind.MethodSignature: case SyntaxKind.CallSignature: case SyntaxKind.FunctionExpression: - case SyntaxKind.ConstructorDeclaration: - case SyntaxKind.SimpleArrowFunctionExpression: - case SyntaxKind.ParenthesizedArrowFunctionExpression: + case SyntaxKind.Constructor: + case SyntaxKind.ArrowFunction: + //case SyntaxKind.ConstructorDeclaration: + //case SyntaxKind.SimpleArrowFunctionExpression: + //case SyntaxKind.ParenthesizedArrowFunctionExpression: case SyntaxKind.InterfaceDeclaration: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } @@ -585,11 +561,12 @@ module TypeScript.Services.Formatting { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); } - static NodeIsTypeScriptDeclWithBlockContext(node: IndentationNodeContext): boolean { - switch (node.kind()) { + static NodeIsTypeScriptDeclWithBlockContext(node: Node): boolean { + switch (node.kind) { case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: case SyntaxKind.EnumDeclaration: - case SyntaxKind.ObjectType: + case SyntaxKind.TypeLiteral: case SyntaxKind.ModuleDeclaration: return true; } @@ -598,11 +575,16 @@ module TypeScript.Services.Formatting { } static IsAfterCodeBlockContext(context: FormattingContext): boolean { - switch (context.currentTokenParent.kind()) { + switch (context.currentTokenParent.kind) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.Block: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.FunctionBlock: + case SyntaxKind.ModuleBlock: case SyntaxKind.SwitchStatement: return true; } @@ -610,7 +592,7 @@ module TypeScript.Services.Formatting { } static IsControlDeclContext(context: FormattingContext): boolean { - switch (context.contextNode.kind()) { + switch (context.contextNode.kind) { case SyntaxKind.IfStatement: case SyntaxKind.SwitchStatement: case SyntaxKind.ForStatement: @@ -619,9 +601,10 @@ module TypeScript.Services.Formatting { case SyntaxKind.TryStatement: case SyntaxKind.DoStatement: case SyntaxKind.WithStatement: - case SyntaxKind.ElseClause: - case SyntaxKind.CatchClause: - case SyntaxKind.FinallyClause: + // TODO + // case SyntaxKind.ElseClause: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: return true; default: @@ -630,15 +613,15 @@ module TypeScript.Services.Formatting { } static IsObjectContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.ObjectLiteralExpression; + return context.contextNode.kind === SyntaxKind.ObjectLiteral; } static IsFunctionCallContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.InvocationExpression; + return context.contextNode.kind === SyntaxKind.CallExpression; } static IsNewContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.ObjectCreationExpression; + return context.contextNode.kind === SyntaxKind.NewExpression; } static IsFunctionCallOrNewContext(context: FormattingContext): boolean { @@ -654,25 +637,43 @@ module TypeScript.Services.Formatting { } static IsModuleDeclContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.ModuleDeclaration; + return context.contextNode.kind === SyntaxKind.ModuleDeclaration; } static IsObjectTypeContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.ObjectType && context.contextNode.parent().kind() !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === SyntaxKind.TypeLiteral;// && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } - static IsTypeArgumentOrParameter(tokenKind: SyntaxKind, parentKind: SyntaxKind): boolean { - return ((tokenKind === SyntaxKind.LessThanToken || tokenKind === SyntaxKind.GreaterThanToken) && - (parentKind === SyntaxKind.TypeParameterList || parentKind === SyntaxKind.TypeArgumentList)); + static IsTypeArgumentOrParameter(token: TextRangeWithKind, parent: Node): boolean { + if (token.kind !== SyntaxKind.LessThanToken && token.kind !== SyntaxKind.GreaterThanToken) { + return false; + } + switch (parent.kind) { + case SyntaxKind.TypeReference: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.Method: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + return true; + default: + return false; + + } } static IsTypeArgumentOrParameterContext(context: FormattingContext): boolean { - return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan.kind, context.currentTokenParent.kind()) || - Rules.IsTypeArgumentOrParameter(context.nextTokenSpan.kind, context.nextTokenParent.kind()); + return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || + Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); } static IsVoidOpContext(context: FormattingContext): boolean { - return context.currentTokenSpan.kind === SyntaxKind.VoidKeyword && context.currentTokenParent.kind() === SyntaxKind.VoidExpression; + return context.currentTokenSpan.kind === SyntaxKind.VoidKeyword && context.currentTokenParent.kind === SyntaxKind.PrefixOperator; } } } \ No newline at end of file diff --git a/src/services/formatting/rulesMap.ts b/src/services/formatting/rulesMap.ts index 0fbe81d16c9..d25320f16a8 100644 --- a/src/services/formatting/rulesMap.ts +++ b/src/services/formatting/rulesMap.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class RulesMap { public map: RulesBucket[]; public mapRowLength: number; diff --git a/src/services/formatting/rulesProvider.ts b/src/services/formatting/rulesProvider.ts index 90b11f01a9b..7ad1b65400c 100644 --- a/src/services/formatting/rulesProvider.ts +++ b/src/services/formatting/rulesProvider.ts @@ -13,16 +13,16 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class RulesProvider { private globalRules: Rules; private options: ts.FormatCodeOptions; private activeRules: Rule[]; private rulesMap: RulesMap; - constructor(private logger: TypeScript.Logger) { + constructor(private logger: Logger) { this.globalRules = new Rules(); } diff --git a/src/services/formatting/singleTokenIndenter.ts b/src/services/formatting/singleTokenIndenter.ts deleted file mode 100644 index 896c2e8ac01..00000000000 --- a/src/services/formatting/singleTokenIndenter.ts +++ /dev/null @@ -1,46 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - export class SingleTokenIndenter extends IndentationTrackingWalker { - private indentationAmount: number = null; - private indentationPosition: number; - - constructor(indentationPosition: number, sourceUnit: SourceUnitSyntax, snapshot: ITextSnapshot, indentFirstToken: boolean, options: FormattingOptions) { - super(new TextSpan(indentationPosition, 1), sourceUnit, snapshot, indentFirstToken, options); - - this.indentationPosition = indentationPosition; - } - - public static getIndentationAmount(position: number, sourceUnit: SourceUnitSyntax, snapshot: ITextSnapshot, options: FormattingOptions): number { - var walker = new SingleTokenIndenter(position, sourceUnit, snapshot, true, options); - visitNodeOrToken(walker, sourceUnit); - return walker.indentationAmount; - } - - public indentToken(token: ISyntaxToken, indentationAmount: number, commentIndentationAmount: number): void { - // Compute an indentation string for this token - if (token.fullWidth() === 0 || (this.indentationPosition - this.position() < token.leadingTriviaWidth())) { - // The position is in the leading trivia, use comment indentation - this.indentationAmount = commentIndentationAmount; - } - else { - this.indentationAmount = indentationAmount; - } - } - } -} \ No newline at end of file diff --git a/src/services/formatting/snapshotPoint.ts b/src/services/formatting/snapshotPoint.ts deleted file mode 100644 index 762748dbc70..00000000000 --- a/src/services/formatting/snapshotPoint.ts +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - - export class SnapshotPoint { - constructor(public snapshot: ITextSnapshot, public position: number) { - } - public getContainingLine(): ITextSnapshotLine { - return this.snapshot.getLineFromPosition(this.position); - } - public add(offset: number): SnapshotPoint { - return new SnapshotPoint(this.snapshot, this.position + offset); - } - } -} \ No newline at end of file diff --git a/src/services/formatting/textEditInfo.ts b/src/services/formatting/textEditInfo.ts deleted file mode 100644 index bdcbdd0ddc8..00000000000 --- a/src/services/formatting/textEditInfo.ts +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - export class TextEditInfo { - - constructor(public position: number, public length: number, public replaceWith: string) { - } - - public toString() { - return "[ position: " + this.position + ", length: " + this.length + ", replaceWith: '" + this.replaceWith + "' ]"; - } - } -} \ No newline at end of file diff --git a/src/services/formatting/textSnapshot.ts b/src/services/formatting/textSnapshot.ts deleted file mode 100644 index 4f2904dd76f..00000000000 --- a/src/services/formatting/textSnapshot.ts +++ /dev/null @@ -1,89 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - export interface ITextSnapshot { - getLength(): number; - getText(span: TextSpan): string; - getLineNumberFromPosition(position: number): number; - getLineFromPosition(position: number): ITextSnapshotLine; - getLineFromLineNumber(lineNumber: number): ITextSnapshotLine; - } - - export class TextSnapshot implements ITextSnapshot { - private lines: TextSnapshotLine[]; - - constructor(private snapshot: ISimpleText) { - this.lines = []; - } - - public getLength(): number { - return this.snapshot.length(); - } - - public getText(span: TextSpan): string { - return this.snapshot.substr(span.start(), span.length()); - } - - public getLineNumberFromPosition(position: number): number { - return this.snapshot.lineMap().getLineNumberFromPosition(position); - } - - public getLineFromPosition(position: number): ITextSnapshotLine { - var lineNumber = this.getLineNumberFromPosition(position); - return this.getLineFromLineNumber(lineNumber); - } - - public getLineFromLineNumber(lineNumber: number): ITextSnapshotLine { - var line = this.lines[lineNumber]; - if (line === undefined) { - line = this.getLineFromLineNumberWorker(lineNumber); - this.lines[lineNumber] = line; - } - return line; - } - - private getLineFromLineNumberWorker(lineNumber: number): ITextSnapshotLine { - var lineMap = this.snapshot.lineMap().lineStarts(); - var lineMapIndex = lineNumber; //Note: lineMap is 0-based - if (lineMapIndex < 0 || lineMapIndex >= lineMap.length) - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Invalid_line_number_0, [lineMapIndex])); - var start = lineMap[lineMapIndex]; - - var end: number; - var endIncludingLineBreak: number; - var lineBreak = ""; - if (lineMapIndex == lineMap.length) { - end = endIncludingLineBreak = this.snapshot.length(); - } - else { - endIncludingLineBreak = (lineMapIndex >= lineMap.length - 1 ? this.snapshot.length() : lineMap[lineMapIndex + 1]); - for (var p = endIncludingLineBreak - 1; p >= start; p--) { - var c = this.snapshot.substr(p, 1); - //TODO: Other ones? - if (c != "\r" && c != "\n") { - break; - } - } - end = p + 1; - lineBreak = this.snapshot.substr(end, endIncludingLineBreak - end); - } - var result = new TextSnapshotLine(this, lineNumber, start, end, lineBreak); - return result; - } - } -} \ No newline at end of file diff --git a/src/services/formatting/textSnapshotLine.ts b/src/services/formatting/textSnapshotLine.ts deleted file mode 100644 index df2d9eff237..00000000000 --- a/src/services/formatting/textSnapshotLine.ts +++ /dev/null @@ -1,80 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/// - -module TypeScript.Services.Formatting { - export interface ITextSnapshotLine { - snapshot(): ITextSnapshot; - - start(): SnapshotPoint; - startPosition(): number; - - end(): SnapshotPoint; - endPosition(): number; - - endIncludingLineBreak(): SnapshotPoint; - endIncludingLineBreakPosition(): number; - - length(): number; - lineNumber(): number; - getText(): string; - } - - export class TextSnapshotLine implements ITextSnapshotLine { - constructor(private _snapshot: ITextSnapshot, private _lineNumber: number, private _start: number, private _end: number, private _lineBreak: string) { - } - - public snapshot() { - return this._snapshot; - } - - public start() { - return new SnapshotPoint(this._snapshot, this._start); - } - - public startPosition() { - return this._start; - } - - public end() { - return new SnapshotPoint(this._snapshot, this._end); - } - - public endPosition() { - return this._end; - } - - public endIncludingLineBreak() { - return new SnapshotPoint(this._snapshot, this._end + this._lineBreak.length); - } - - public endIncludingLineBreakPosition() { - return this._end + this._lineBreak.length; - } - - public length() { - return this._end - this._start; - } - - public lineNumber() { - return this._lineNumber; - } - - public getText(): string { - return this._snapshot.getText(TextSpan.fromBounds(this._start, this._end)); - } - } -} \ No newline at end of file diff --git a/src/services/formatting/tokenRange.ts b/src/services/formatting/tokenRange.ts index 0c06f797025..8d421140e67 100644 --- a/src/services/formatting/tokenRange.ts +++ b/src/services/formatting/tokenRange.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export module Shared { export interface ITokenAccess { GetTokens(): SyntaxKind[]; @@ -41,12 +41,6 @@ module TypeScript.Services.Formatting { public Contains(token: SyntaxKind): boolean { return this.tokens.indexOf(token) >= 0; } - - - public toString(): string { - return "[tokenRangeStart=" + SyntaxKind[this.tokens[0]] + "," + - "tokenRangeEnd=" + SyntaxKind[this.tokens[this.tokens.length - 1]] + "]"; - } } export class TokenValuesAccess implements ITokenAccess { @@ -76,10 +70,6 @@ module TypeScript.Services.Formatting { public Contains(tokenValue: SyntaxKind): boolean { return tokenValue == this.token; } - - public toString(): string { - return "[singleTokenKind=" + SyntaxKind[this.token] + "]"; - } } export class TokenAllAccess implements ITokenAccess { @@ -135,18 +125,18 @@ module TypeScript.Services.Formatting { static Any: TokenRange = TokenRange.AllTokens(); static AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([SyntaxKind.MultiLineCommentTrivia])); static Keywords = TokenRange.FromRange(SyntaxKind.FirstKeyword, SyntaxKind.LastKeyword); - static Operators = TokenRange.FromRange(SyntaxKind.SemicolonToken, SyntaxKind.SlashEqualsToken); - static BinaryOperators = TokenRange.FromRange(SyntaxKind.LessThanToken, SyntaxKind.SlashEqualsToken); + static Operators = TokenRange.FromRange(SyntaxKind.FirstOperator, SyntaxKind.LastOperator); + static BinaryOperators = TokenRange.FromRange(SyntaxKind.FirstBinaryOperator, SyntaxKind.LastBinaryOperator); static BinaryKeywordOperators = TokenRange.FromTokens([SyntaxKind.InKeyword, SyntaxKind.InstanceOfKeyword]); - static ReservedKeywords = TokenRange.FromRange(SyntaxKind.FirstFutureReservedStrictKeyword, SyntaxKind.LastFutureReservedStrictKeyword); + static ReservedKeywords = TokenRange.FromRange(SyntaxKind.FirstFutureReservedWord, SyntaxKind.LastFutureReservedWord); static UnaryPrefixOperators = TokenRange.FromTokens([SyntaxKind.PlusPlusToken, SyntaxKind.MinusMinusToken, SyntaxKind.TildeToken, SyntaxKind.ExclamationToken]); - static UnaryPrefixExpressions = TokenRange.FromTokens([SyntaxKind.NumericLiteral, SyntaxKind.IdentifierName, SyntaxKind.OpenParenToken, SyntaxKind.OpenBracketToken, SyntaxKind.OpenBraceToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); - static UnaryPreincrementExpressions = TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.OpenParenToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); - static UnaryPostincrementExpressions = TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.CloseParenToken, SyntaxKind.CloseBracketToken, SyntaxKind.NewKeyword]); - static UnaryPredecrementExpressions = TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.OpenParenToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); - static UnaryPostdecrementExpressions = TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.CloseParenToken, SyntaxKind.CloseBracketToken, SyntaxKind.NewKeyword]); + static UnaryPrefixExpressions = TokenRange.FromTokens([SyntaxKind.NumericLiteral, SyntaxKind.Identifier, SyntaxKind.OpenParenToken, SyntaxKind.OpenBracketToken, SyntaxKind.OpenBraceToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); + static UnaryPreincrementExpressions = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.OpenParenToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); + static UnaryPostincrementExpressions = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.CloseParenToken, SyntaxKind.CloseBracketToken, SyntaxKind.NewKeyword]); + static UnaryPredecrementExpressions = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.OpenParenToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); + static UnaryPostdecrementExpressions = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.CloseParenToken, SyntaxKind.CloseBracketToken, SyntaxKind.NewKeyword]); static Comments = TokenRange.FromTokens([SyntaxKind.SingleLineCommentTrivia, SyntaxKind.MultiLineCommentTrivia]); - static TypeNames = TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.NumberKeyword, SyntaxKind.StringKeyword, SyntaxKind.BooleanKeyword, SyntaxKind.VoidKeyword, SyntaxKind.AnyKeyword]); + static TypeNames = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.NumberKeyword, SyntaxKind.StringKeyword, SyntaxKind.BooleanKeyword, SyntaxKind.VoidKeyword, SyntaxKind.AnyKeyword]); } } } \ No newline at end of file diff --git a/src/services/formatting/tokenSpan.ts b/src/services/formatting/tokenSpan.ts index aba9c372f35..1d8173a8227 100644 --- a/src/services/formatting/tokenSpan.ts +++ b/src/services/formatting/tokenSpan.ts @@ -13,10 +13,9 @@ // limitations under the License. // -/// +/// - -module TypeScript.Services.Formatting { +module ts.formatting { export class TokenSpan extends TextSpan { constructor(public kind: SyntaxKind, start: number, length: number) { super(start, length); diff --git a/src/services/getScriptLexicalStructureWalker.ts b/src/services/getScriptLexicalStructureWalker.ts deleted file mode 100644 index bfce8e0067c..00000000000 --- a/src/services/getScriptLexicalStructureWalker.ts +++ /dev/null @@ -1,351 +0,0 @@ -/// - -module TypeScript.Services { - export class NavigationBarItemGetter { - private hasGlobalNode = false; - - private getIndent(node: ISyntaxNode): number { - var indent = this.hasGlobalNode ? 1 : 0; - - var current = node.parent; - while (current != null) { - if (current.kind() == SyntaxKind.ModuleDeclaration || current.kind() === SyntaxKind.FunctionDeclaration) { - indent++; - } - - current = current.parent; - } - - return indent; - } - - private getKindModifiers(modifiers: TypeScript.ISyntaxToken[]): string { - var result: string[] = []; - - for (var i = 0, n = modifiers.length; i < n; i++) { - result.push(modifiers[i].text()); - } - - return result.length > 0 ? result.join(',') : ts.ScriptElementKindModifier.none; - } - - public getItems(node: TypeScript.SourceUnitSyntax): ts.NavigationBarItem[] { - return this.getItemsWorker(() => this.getTopLevelNodes(node), n => this.createTopLevelItem(n)); - } - - private getChildNodes(nodes: IModuleElementSyntax[]): ISyntaxNode[] { - var childNodes: ISyntaxNode[] = []; - - for (var i = 0, n = nodes.length; i < n; i++) { - var node = nodes[i]; - - if (node.kind() === SyntaxKind.FunctionDeclaration) { - childNodes.push(node); - } - else if (node.kind() === SyntaxKind.VariableStatement) { - var variableDeclaration = (node).variableDeclaration; - childNodes.push.apply(childNodes, variableDeclaration.variableDeclarators); - } - } - - return childNodes; - } - - private getTopLevelNodes(node: SourceUnitSyntax): ISyntaxNode[] { - var topLevelNodes: ISyntaxNode[] = []; - topLevelNodes.push(node); - - this.addTopLevelNodes(node.moduleElements, topLevelNodes); - - return topLevelNodes; - } - - private addTopLevelNodes(nodes: IModuleElementSyntax[], topLevelNodes: ISyntaxNode[]): void { - for (var i = 0, n = nodes.length; i < n; i++) { - var node = nodes[i]; - switch (node.kind()) { - case SyntaxKind.ClassDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.InterfaceDeclaration: - topLevelNodes.push(node); - break; - - case SyntaxKind.ModuleDeclaration: - var moduleDeclaration = node; - topLevelNodes.push(node); - this.addTopLevelNodes(moduleDeclaration.moduleElements, topLevelNodes); - break; - - case SyntaxKind.FunctionDeclaration: - var functionDeclaration = node; - if (this.isTopLevelFunctionDeclaration(functionDeclaration)) { - topLevelNodes.push(node); - this.addTopLevelNodes(functionDeclaration.block.statements, topLevelNodes); - } - break; - } - } - } - - public isTopLevelFunctionDeclaration(functionDeclaration: FunctionDeclarationSyntax) { - // A function declaration is 'top level' if it contains any function declarations - // within it. - return functionDeclaration.block && ArrayUtilities.any(functionDeclaration.block.statements, s => s.kind() === SyntaxKind.FunctionDeclaration); - } - - private getItemsWorker(getNodes: () => ISyntaxNode[], createItem: (n: ISyntaxNode) => ts.NavigationBarItem): ts.NavigationBarItem[] { - var items: ts.NavigationBarItem[] = []; - - var keyToItem = createIntrinsicsObject(); - - var nodes = getNodes(); - for (var i = 0, n = nodes.length; i < n; i++) { - var child = nodes[i]; - var item = createItem(child); - if (item != null) { - if (item.text.length > 0) { - var key = item.text + "-" + item.kind; - - var itemWithSameName = keyToItem[key]; - if (itemWithSameName) { - // We had an item with the same name. Merge these items together. - this.merge(itemWithSameName, item); - } - else { - keyToItem[key] = item; - items.push(item); - } - } - } - } - - return items; - } - - private merge(target: ts.NavigationBarItem, source: ts.NavigationBarItem) { - // First, add any spans in the source to the target. - target.spans.push.apply(target.spans, source.spans); - - if (source.childItems) { - if (!target.childItems) { - target.childItems = []; - } - - // Next, recursively merge or add any children in the source as appropriate. - outer: - for (var i = 0, n = source.childItems.length; i < n; i++) { - var sourceChild = source.childItems[i]; - - for (var j = 0, m = target.childItems.length; j < m; j++) { - var targetChild = target.childItems[j]; - - if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { - // Found a match. merge them. - this.merge(targetChild, sourceChild); - continue outer; - } - } - - // Didn't find a match, just add this child to the list. - target.childItems.push(sourceChild); - } - } - } - - private createChildItem(node: ISyntaxNode): ts.NavigationBarItem { - switch (node.kind()) { - case SyntaxKind.Parameter: - var parameter = node; - if (parameter.modifiers.length === 0) { - return null; - } - return new ts.NavigationBarItem(parameter.identifier.text(), ts.ScriptElementKind.memberVariableElement, this.getKindModifiers(parameter.modifiers), [TextSpan.fromBounds(start(node), end(node))]); - - case SyntaxKind.MemberFunctionDeclaration: - var memberFunction = node; - return new ts.NavigationBarItem(memberFunction.propertyName.text(), ts.ScriptElementKind.memberFunctionElement, this.getKindModifiers(memberFunction.modifiers), [TextSpan.fromBounds(start(node), end(node))]); - - case SyntaxKind.GetAccessor: - var getAccessor = node; - return new ts.NavigationBarItem(getAccessor.propertyName.text(), ts.ScriptElementKind.memberGetAccessorElement, this.getKindModifiers(getAccessor.modifiers), [TextSpan.fromBounds(start(node), end(node))]); - - case SyntaxKind.SetAccessor: - var setAccessor = node; - return new ts.NavigationBarItem(setAccessor.propertyName.text(), ts.ScriptElementKind.memberSetAccessorElement, this.getKindModifiers(setAccessor.modifiers), [TextSpan.fromBounds(start(node), end(node))]); - - case SyntaxKind.IndexSignature: - var indexSignature = node; - return new ts.NavigationBarItem("[]", ts.ScriptElementKind.indexSignatureElement, ts.ScriptElementKindModifier.none, [TextSpan.fromBounds(start(node), end(node))]); - - case SyntaxKind.EnumElement: - var enumElement = node; - return new ts.NavigationBarItem(enumElement.propertyName.text(), ts.ScriptElementKind.memberVariableElement, ts.ScriptElementKindModifier.none, [TextSpan.fromBounds(start(node), end(node))]); - - case SyntaxKind.CallSignature: - var callSignature = node; - return new ts.NavigationBarItem("()", ts.ScriptElementKind.callSignatureElement, ts.ScriptElementKindModifier.none, [TextSpan.fromBounds(start(node), end(node))]); - - case SyntaxKind.ConstructSignature: - var constructSignature = node; - return new ts.NavigationBarItem("new()", ts.ScriptElementKind.constructSignatureElement, ts.ScriptElementKindModifier.none, [TextSpan.fromBounds(start(node), end(node))]); - - case SyntaxKind.MethodSignature: - var methodSignature = node; - return new ts.NavigationBarItem(methodSignature.propertyName.text(), ts.ScriptElementKind.memberFunctionElement, ts.ScriptElementKindModifier.none, [TextSpan.fromBounds(start(node), end(node))]); - - case SyntaxKind.PropertySignature: - var propertySignature = node; - return new ts.NavigationBarItem(propertySignature.propertyName.text(), ts.ScriptElementKind.memberVariableElement, ts.ScriptElementKindModifier.none, [TextSpan.fromBounds(start(node), end(node))]); - - case SyntaxKind.FunctionDeclaration: - var functionDeclaration = node; - if (!this.isTopLevelFunctionDeclaration(functionDeclaration)) { - return new ts.NavigationBarItem(functionDeclaration.identifier.text(), ts.ScriptElementKind.functionElement, this.getKindModifiers(functionDeclaration.modifiers), [TextSpan.fromBounds(start(node), end(node))]); - } - break; - - case SyntaxKind.MemberVariableDeclaration: - var memberVariableDeclaration = node; - return new ts.NavigationBarItem(memberVariableDeclaration.variableDeclarator.propertyName.text(), ts.ScriptElementKind.memberVariableElement, this.getKindModifiers(memberVariableDeclaration.modifiers), [TextSpan.fromBounds(start(memberVariableDeclaration.variableDeclarator), end(memberVariableDeclaration.variableDeclarator))]); - - case SyntaxKind.VariableDeclarator: - var variableDeclarator = node; - return new ts.NavigationBarItem(variableDeclarator.propertyName.text(), ts.ScriptElementKind.variableElement, ts.ScriptElementKindModifier.none, [TextSpan.fromBounds(start(variableDeclarator), end(variableDeclarator))]); - - case SyntaxKind.ConstructorDeclaration: - var constructorDeclaration = node; - return new ts.NavigationBarItem("constructor", ts.ScriptElementKind.constructorImplementationElement, ts.ScriptElementKindModifier.none, [TextSpan.fromBounds(start(node), end(node))]); - } - - return null; - } - - private createTopLevelItem(node: ISyntaxNode): ts.NavigationBarItem { - switch (node.kind()) { - case SyntaxKind.SourceUnit: - return this.createSourceUnitItem(node); - - case SyntaxKind.ClassDeclaration: - return this.createClassItem(node); - - case SyntaxKind.EnumDeclaration: - return this.createEnumItem(node); - - case SyntaxKind.InterfaceDeclaration: - return this.createIterfaceItem(node); - - case SyntaxKind.ModuleDeclaration: - return this.createModuleItem(node); - - case SyntaxKind.FunctionDeclaration: - return this.createFunctionItem(node); - } - - return null; - } - - private getModuleNames(node: TypeScript.ModuleDeclarationSyntax): string[] { - var result: string[] = []; - - if (node.stringLiteral) { - result.push(node.stringLiteral.text()); - } - else { - this.getModuleNamesHelper(node.name, result); - } - - return result; - } - - private getModuleNamesHelper(name: TypeScript.INameSyntax, result: string[]): void { - if (name.kind() === TypeScript.SyntaxKind.QualifiedName) { - var qualifiedName = name; - this.getModuleNamesHelper(qualifiedName.left, result); - result.push(qualifiedName.right.text()); - } - else { - result.push((name).text()); - } - } - - private createModuleItem(node: ModuleDeclarationSyntax): ts.NavigationBarItem { - var moduleNames = this.getModuleNames(node); - - var childItems = this.getItemsWorker(() => this.getChildNodes(node.moduleElements), n => this.createChildItem(n)); - - return new ts.NavigationBarItem(moduleNames.join("."), - ts.ScriptElementKind.moduleElement, - this.getKindModifiers(node.modifiers), - [TextSpan.fromBounds(start(node), end(node))], - childItems, - this.getIndent(node)); - } - - private createFunctionItem(node: FunctionDeclarationSyntax) { - var childItems = this.getItemsWorker(() => node.block.statements, n => this.createChildItem(n)); - - return new ts.NavigationBarItem(node.identifier.text(), - ts.ScriptElementKind.functionElement, - this.getKindModifiers(node.modifiers), - [TextSpan.fromBounds(start(node), end(node))], - childItems, - this.getIndent(node)); - } - - private createSourceUnitItem(node: SourceUnitSyntax): ts.NavigationBarItem { - var childItems = this.getItemsWorker(() => this.getChildNodes(node.moduleElements), n => this.createChildItem(n)); - - if (childItems === null || childItems.length === 0) { - return null; - } - - this.hasGlobalNode = true; - return new ts.NavigationBarItem("", - ts.ScriptElementKind.moduleElement, - ts.ScriptElementKindModifier.none, - [TextSpan.fromBounds(start(node), end(node))], - childItems); - } - - private createClassItem(node: ClassDeclarationSyntax): ts.NavigationBarItem { - var constructor = ArrayUtilities.firstOrDefault( - node.classElements, n => n.kind() === SyntaxKind.ConstructorDeclaration); - - // Add the constructor parameters in as children of hte class (for property parameters). - var nodes: ISyntaxNode[] = constructor - ? (constructor.callSignature.parameterList.parameters).concat(node.classElements) - : node.classElements; - - var childItems = this.getItemsWorker(() => nodes, n => this.createChildItem(n)); - return new ts.NavigationBarItem( - node.identifier.text(), - ts.ScriptElementKind.classElement, - this.getKindModifiers(node.modifiers), - [TextSpan.fromBounds(start(node), end(node))], - childItems, - this.getIndent(node)); - } - - private createEnumItem(node: TypeScript.EnumDeclarationSyntax): ts.NavigationBarItem { - var childItems = this.getItemsWorker(() => node.enumElements, n => this.createChildItem(n)); - return new ts.NavigationBarItem( - node.identifier.text(), - ts.ScriptElementKind.enumElement, - this.getKindModifiers(node.modifiers), - [TextSpan.fromBounds(start(node), end(node))], - childItems, - this.getIndent(node)); - } - - private createIterfaceItem(node: TypeScript.InterfaceDeclarationSyntax): ts.NavigationBarItem { - var childItems = this.getItemsWorker(() => node.body.typeMembers, n => this.createChildItem(n)); - return new ts.NavigationBarItem( - node.identifier.text(), - ts.ScriptElementKind.interfaceElement, - this.getKindModifiers(node.modifiers), - [TextSpan.fromBounds(start(node), end(node))], - childItems, - this.getIndent(node)); - } - } -} \ No newline at end of file diff --git a/src/services/indentation.ts b/src/services/indentation.ts deleted file mode 100644 index b067e817d99..00000000000 --- a/src/services/indentation.ts +++ /dev/null @@ -1,155 +0,0 @@ -/// - -module TypeScript.Indentation { - export function columnForEndOfTokenAtPosition(syntaxTree: SyntaxTree, position: number, options: FormattingOptions): number { - var token = findToken(syntaxTree.sourceUnit(), position); - return columnForStartOfTokenAtPosition(syntaxTree, position, options) + width(token); - } - - export function columnForStartOfTokenAtPosition(syntaxTree: SyntaxTree, position: number, options: FormattingOptions): number { - var token = findToken(syntaxTree.sourceUnit(), position); - - // Walk backward from this token until we find the first token in the line. For each token - // we see (that is not the first tokem in line), push the entirety of the text into the text - // array. Then, for the first token, add its text (without its leading trivia) to the text - // array. i.e. if we have: - // - // var foo = a => bar(); - // - // And we want the column for the start of 'bar', then we'll add the underlinded portions to - // the text array: - // - // var foo = a => bar(); - // _ - // __ - // __ - // ____ - // ____ - var firstTokenInLine = Syntax.firstTokenInLineContainingPosition(syntaxTree, token.fullStart()); - var leadingTextInReverse: string[] = []; - - var current = token; - while (current !== firstTokenInLine) { - current = previousToken(current); - - if (current === firstTokenInLine) { - // We're at the first token in teh line. - // We don't want the leading trivia for this token. That will be taken care of in - // columnForFirstNonWhitespaceCharacterInLine. So just push the trailing trivia - // and then the token text. - leadingTextInReverse.push(current.trailingTrivia().fullText()); - leadingTextInReverse.push(current.text()); - } - else { - // We're at an intermediate token on the line. Just push all its text into the array. - leadingTextInReverse.push(current.fullText()); - } - } - - // Now, add all trivia to the start of the line on the first token in the list. - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - - export function columnForStartOfFirstTokenInLineContainingPosition(syntaxTree: SyntaxTree, position: number, options: FormattingOptions): number { - // Walk backward through the tokens until we find the first one on the line. - var firstTokenInLine = Syntax.firstTokenInLineContainingPosition(syntaxTree, position); - var leadingTextInReverse: string[] = []; - - // Now, add all trivia to the start of the line on the first token in the list. - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - - // Collect all the trivia that precedes this token. Stopping when we hit a newline trivia - // or a multiline comment that spans multiple lines. This is meant to be called on the first - // token in a line. - function collectLeadingTriviaTextToStartOfLine(firstTokenInLine: ISyntaxToken, - leadingTextInReverse: string[]) { - var leadingTrivia = firstTokenInLine.leadingTrivia(); - - for (var i = leadingTrivia.count() - 1; i >= 0; i--) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === SyntaxKind.NewLineTrivia) { - break; - } - - if (trivia.kind() === SyntaxKind.MultiLineCommentTrivia) { - var lineSegments = Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - leadingTextInReverse.push(ArrayUtilities.last(lineSegments)); - - if (lineSegments.length > 0) { - // This multiline comment actually spanned multiple lines. So we're done. - break; - } - - // It was only on a single line, so keep on going. - } - - leadingTextInReverse.push(trivia.fullText()); - } - } - - function columnForLeadingTextInReverse(leadingTextInReverse: string[], - options: FormattingOptions): number { - var column = 0; - - // walk backwards. This means we're actually walking forward from column 0 to the start of - // the token. - for (var i = leadingTextInReverse.length - 1; i >= 0; i--) { - var text = leadingTextInReverse[i]; - column = columnForPositionInStringWorker(text, text.length, column, options); - } - - return column; - } - - // Returns the column that this input string ends at (assuming it starts at column 0). - export function columnForPositionInString(input: string, position: number, options: FormattingOptions): number { - return columnForPositionInStringWorker(input, position, 0, options); - } - - function columnForPositionInStringWorker(input: string, position: number, startColumn: number, options: FormattingOptions): number { - var column = startColumn; - var spacesPerTab = options.spacesPerTab; - - for (var j = 0; j < position; j++) { - var ch = input.charCodeAt(j); - - if (ch === CharacterCodes.tab) { - column += spacesPerTab - column % spacesPerTab; - } - else { - column++; - } - } - - return column; - } - - export function indentationString(column: number, options: FormattingOptions): string { - var numberOfTabs = 0; - var numberOfSpaces = Math.max(0, column); - - if (options.useTabs) { - numberOfTabs = Math.floor(column / options.spacesPerTab); - numberOfSpaces -= numberOfTabs * options.spacesPerTab; - } - - return StringUtilities.repeat('\t', numberOfTabs) + - StringUtilities.repeat(' ', numberOfSpaces); - } - - export function firstNonWhitespacePosition(value: string): number { - for (var i = 0; i < value.length; i++) { - var ch = value.charCodeAt(i); - if (!CharacterInfo.isWhitespace(ch)) { - return i; - } - } - - return value.length; - } -} \ No newline at end of file diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts new file mode 100644 index 00000000000..6e4303d0cd8 --- /dev/null +++ b/src/services/navigationBar.ts @@ -0,0 +1,437 @@ +/// + +module ts.NavigationBar { + export function getNavigationBarItems(sourceFile: SourceFile): ts.NavigationBarItem[] { + // If the source file has any child items, then it included in the tree + // and takes lexical ownership of all other top-level items. + var hasGlobalNode = false; + + return getItemsWorker(getTopLevelNodes(sourceFile), createTopLevelItem); + + function getIndent(node: Node): number { + // If we have a global node in the tree, + // then it adds an extra layer of depth to all subnodes. + var indent = hasGlobalNode ? 1 : 0; + + var current = node.parent; + while (current) { + switch (current.kind) { + case SyntaxKind.ModuleDeclaration: + // If we have a module declared as A.B.C, it is more "intuitive" + // to say it only has a single layer of depth + do { + current = current.parent; + } + while (current.kind === SyntaxKind.ModuleDeclaration); + + // fall through + case SyntaxKind.ClassDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.FunctionDeclaration: + indent++; + } + + current = current.parent; + } + + return indent; + } + + function getChildNodes(nodes: Node[]): Node[] { + var childNodes: Node[] = []; + + for (var i = 0, n = nodes.length; i < n; i++) { + var node = nodes[i]; + + if (node.kind === SyntaxKind.ClassDeclaration || + node.kind === SyntaxKind.EnumDeclaration || + node.kind === SyntaxKind.InterfaceDeclaration || + node.kind === SyntaxKind.ModuleDeclaration || + node.kind === SyntaxKind.FunctionDeclaration) { + + childNodes.push(node); + } + else if (node.kind === SyntaxKind.VariableStatement) { + childNodes.push.apply(childNodes, (node).declarations); + } + } + + return sortNodes(childNodes); + } + + function getTopLevelNodes(node: SourceFile): Node[] { + var topLevelNodes: Node[] = []; + topLevelNodes.push(node); + + addTopLevelNodes(node.statements, topLevelNodes); + + return topLevelNodes; + } + + function sortNodes(nodes: Node[]): Node[] { + return nodes.slice(0).sort((n1: Declaration, n2: Declaration) => { + if (n1.name && n2.name) { + // TODO(jfreeman): How do we sort declarations with computed names? + return (n1.name).text.localeCompare((n2.name).text); + } + else if (n1.name) { + return 1; + } + else if (n2.name) { + return -1; + } + else { + return n1.kind - n2.kind; + } + }); + } + + function addTopLevelNodes(nodes: Node[], topLevelNodes: Node[]): void { + nodes = sortNodes(nodes); + + for (var i = 0, n = nodes.length; i < n; i++) { + var node = nodes[i]; + switch (node.kind) { + case SyntaxKind.ClassDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.InterfaceDeclaration: + topLevelNodes.push(node); + break; + + case SyntaxKind.ModuleDeclaration: + var moduleDeclaration = node; + topLevelNodes.push(node); + addTopLevelNodes((getInnermostModule(moduleDeclaration).body).statements, topLevelNodes); + break; + + case SyntaxKind.FunctionDeclaration: + var functionDeclaration = node; + if (isTopLevelFunctionDeclaration(functionDeclaration)) { + topLevelNodes.push(node); + addTopLevelNodes((functionDeclaration.body).statements, topLevelNodes); + } + break; + } + } + } + + function isTopLevelFunctionDeclaration(functionDeclaration: FunctionLikeDeclaration) { + if (functionDeclaration.kind === SyntaxKind.FunctionDeclaration) { + // A function declaration is 'top level' if it contains any function declarations + // within it. + if (functionDeclaration.body && functionDeclaration.body.kind === SyntaxKind.FunctionBlock) { + // Proper function declarations can only have identifier names + if (forEach((functionDeclaration.body).statements, + s => s.kind === SyntaxKind.FunctionDeclaration && !isEmpty((s).name.text))) { + + return true; + } + + // Or if it is not parented by another function. i.e all functions + // at module scope are 'top level'. + if (functionDeclaration.parent.kind !== SyntaxKind.FunctionBlock) { + return true; + } + } + } + + return false; + } + + function getItemsWorker(nodes: Node[], createItem: (n: Node) => ts.NavigationBarItem): ts.NavigationBarItem[] { + var items: ts.NavigationBarItem[] = []; + + var keyToItem: Map = {}; + + for (var i = 0, n = nodes.length; i < n; i++) { + var child = nodes[i]; + var item = createItem(child); + if (item !== undefined) { + if (item.text.length > 0) { + var key = item.text + "-" + item.kind + "-" + item.indent; + + var itemWithSameName = keyToItem[key]; + if (itemWithSameName) { + // We had an item with the same name. Merge these items together. + merge(itemWithSameName, item); + } + else { + keyToItem[key] = item; + items.push(item); + } + } + } + } + + return items; + } + + function merge(target: ts.NavigationBarItem, source: ts.NavigationBarItem) { + // First, add any spans in the source to the target. + target.spans.push.apply(target.spans, source.spans); + + if (source.childItems) { + if (!target.childItems) { + target.childItems = []; + } + + // Next, recursively merge or add any children in the source as appropriate. + outer: + for (var i = 0, n = source.childItems.length; i < n; i++) { + var sourceChild = source.childItems[i]; + + for (var j = 0, m = target.childItems.length; j < m; j++) { + var targetChild = target.childItems[j]; + + if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { + // Found a match. merge them. + merge(targetChild, sourceChild); + continue outer; + } + } + + // Didn't find a match, just add this child to the list. + target.childItems.push(sourceChild); + } + } + } + + function createChildItem(node: Node): ts.NavigationBarItem { + switch (node.kind) { + case SyntaxKind.Parameter: + if ((node.flags & NodeFlags.Modifier) === 0) { + return undefined; + } + + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.memberVariableElement); + + case SyntaxKind.Method: + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.memberFunctionElement); + + case SyntaxKind.GetAccessor: + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.memberGetAccessorElement); + + case SyntaxKind.SetAccessor: + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.memberSetAccessorElement); + + case SyntaxKind.IndexSignature: + return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); + + case SyntaxKind.EnumMember: + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.memberVariableElement); + + case SyntaxKind.CallSignature: + return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); + + case SyntaxKind.ConstructSignature: + return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); + + case SyntaxKind.Property: + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.memberVariableElement); + + case SyntaxKind.FunctionDeclaration: + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.functionElement); + + case SyntaxKind.VariableDeclaration: + if (isConst(node)) { + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.constElement); + } + else if (isLet(node)) { + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.letElement); + } + else { + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.variableElement); + } + + case SyntaxKind.Constructor: + return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); + } + + return undefined; + + function createItem(node: Node, name: string, scriptElementKind: string): NavigationBarItem { + return getNavigationBarItem(name, scriptElementKind, getNodeModifiers(node), [getNodeSpan(node)]); + } + } + + function isEmpty(text: string) { + return !text || text.trim() === ""; + } + + function getNavigationBarItem(text: string, kind: string, kindModifiers: string, spans: TextSpan[], childItems: NavigationBarItem[] = [], indent: number = 0): NavigationBarItem { + if (isEmpty(text)) { + return undefined; + } + + return { + text, + kind, + kindModifiers, + spans, + childItems, + indent, + bolded: false, + grayed: false + }; + } + + function createTopLevelItem(node: Node): ts.NavigationBarItem { + switch (node.kind) { + case SyntaxKind.SourceFile: + return createSourceFileItem(node); + + case SyntaxKind.ClassDeclaration: + return createClassItem(node); + + case SyntaxKind.EnumDeclaration: + return createEnumItem(node); + + case SyntaxKind.InterfaceDeclaration: + return createIterfaceItem(node); + + case SyntaxKind.ModuleDeclaration: + return createModuleItem(node); + + case SyntaxKind.FunctionDeclaration: + return createFunctionItem(node); + } + + return undefined; + + function getModuleName(moduleDeclaration: ModuleDeclaration): string { + // We want to maintain quotation marks. + if (moduleDeclaration.name.kind === SyntaxKind.StringLiteral) { + return getTextOfNode(moduleDeclaration.name); + } + + // Otherwise, we need to aggregate each identifier to build up the qualified name. + var result: string[] = []; + + result.push(moduleDeclaration.name.text); + + while (moduleDeclaration.body && moduleDeclaration.body.kind === SyntaxKind.ModuleDeclaration) { + moduleDeclaration = moduleDeclaration.body; + + result.push(moduleDeclaration.name.text); + } + + return result.join("."); + } + + function createModuleItem(node: ModuleDeclaration): NavigationBarItem { + var moduleName = getModuleName(node); + + var childItems = getItemsWorker(getChildNodes((getInnermostModule(node).body).statements), createChildItem); + + return getNavigationBarItem(moduleName, + ts.ScriptElementKind.moduleElement, + getNodeModifiers(node), + [getNodeSpan(node)], + childItems, + getIndent(node)); + } + + function createFunctionItem(node: FunctionDeclaration) { + if (node.name && node.body && node.body.kind === SyntaxKind.FunctionBlock) { + var childItems = getItemsWorker(sortNodes((node.body).statements), createChildItem); + + return getNavigationBarItem(node.name.text, + ts.ScriptElementKind.functionElement, + getNodeModifiers(node), + [getNodeSpan(node)], + childItems, + getIndent(node)); + } + + return undefined; + } + + function createSourceFileItem(node: SourceFile): ts.NavigationBarItem { + var childItems = getItemsWorker(getChildNodes(node.statements), createChildItem); + + if (childItems === undefined || childItems.length === 0) { + return undefined; + } + + hasGlobalNode = true; + var rootName = isExternalModule(node) ? + "\"" + escapeString(getBaseFilename(removeFileExtension(normalizePath(node.filename)))) + "\"" : + "" + + return getNavigationBarItem(rootName, + ts.ScriptElementKind.moduleElement, + ts.ScriptElementKindModifier.none, + [getNodeSpan(node)], + childItems); + } + + function createClassItem(node: ClassDeclaration): ts.NavigationBarItem { + var childItems: NavigationBarItem[]; + + if (node.members) { + var constructor = forEach(node.members, member => { + return member.kind === SyntaxKind.Constructor && member; + }); + + // Add the constructor parameters in as children of the class (for property parameters). + // Note that *all* parameters will be added to the nodes array, but parameters that + // are not properties will be filtered out later by createChildItem. + var nodes: Node[] = constructor + ? node.members.concat(constructor.parameters) + : node.members; + + var childItems = getItemsWorker(sortNodes(nodes), createChildItem); + } + + return getNavigationBarItem( + node.name.text, + ts.ScriptElementKind.classElement, + getNodeModifiers(node), + [getNodeSpan(node)], + childItems, + getIndent(node)); + } + + function createEnumItem(node: EnumDeclaration): ts.NavigationBarItem { + var childItems = getItemsWorker(sortNodes(node.members), createChildItem); + return getNavigationBarItem( + node.name.text, + ts.ScriptElementKind.enumElement, + getNodeModifiers(node), + [getNodeSpan(node)], + childItems, + getIndent(node)); + } + + function createIterfaceItem(node: InterfaceDeclaration): ts.NavigationBarItem { + var childItems = getItemsWorker(sortNodes(node.members), createChildItem); + return getNavigationBarItem( + node.name.text, + ts.ScriptElementKind.interfaceElement, + getNodeModifiers(node), + [getNodeSpan(node)], + childItems, + getIndent(node)); + } + } + + function getInnermostModule(node: ModuleDeclaration): ModuleDeclaration { + while (node.body.kind === SyntaxKind.ModuleDeclaration) { + node = node.body; + } + + return node; + } + + function getNodeSpan(node: Node) { + return node.kind === SyntaxKind.SourceFile + ? TextSpan.fromBounds(node.getFullStart(), node.getEnd()) + : TextSpan.fromBounds(node.getStart(), node.getEnd()); + } + + function getTextOfNode(node: Node): string { + return getTextOfNodeFromSourceText(sourceFile.text, node); + } + } +} \ No newline at end of file diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 92440bfe760..27f75b8d20e 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -13,8 +13,6 @@ // limitations under the License. // -/// - module ts { export interface OutliningSpan { @@ -26,8 +24,8 @@ module ts { * @param autoCollapse Whether or not this region should be automatically collapsed when * the 'Collapse to Definitions' command is invoked. */ - textSpan: TypeScript.TextSpan; - hintSpan: TypeScript.TextSpan; + textSpan: TextSpan; + hintSpan: TextSpan; bannerText: string; autoCollapse: boolean; } @@ -35,19 +33,32 @@ module ts { export module OutliningElementsCollector { export function collectElements(sourceFile: SourceFile): OutliningSpan[] { var elements: OutliningSpan[] = []; + var collapseText = "..."; - function addOutlineRange(hintSpanNode: Node, startElement: Node, endElement: Node) { + function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean) { if (hintSpanNode && startElement && endElement) { var span: OutliningSpan = { - textSpan: TypeScript.TextSpan.fromBounds(startElement.pos, endElement.end), - hintSpan: TypeScript.TextSpan.fromBounds(hintSpanNode.getStart(), hintSpanNode.end), - bannerText: "...", - autoCollapse: false + textSpan: TextSpan.fromBounds(startElement.pos, endElement.end), + hintSpan: TextSpan.fromBounds(hintSpanNode.getStart(), hintSpanNode.end), + bannerText: collapseText, + autoCollapse: autoCollapse }; elements.push(span); } } + function autoCollapse(node: Node) { + switch (node.kind) { + case SyntaxKind.ModuleBlock: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.EnumDeclaration: + return false; + } + + return true; + } + var depth = 0; var maxDepth = 20; function walk(n: Node): void { @@ -56,23 +67,58 @@ module ts { } switch (n.kind) { case SyntaxKind.Block: + var parent = n.parent; + var openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); + var closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); + + // Check if the block is standalone, or 'attached' to some parent statement. + // If the latter, we want to collaps the block, but consider its hint span + // to be the entire span of the parent. + if (parent.kind === SyntaxKind.DoStatement || + parent.kind === SyntaxKind.ForInStatement || + parent.kind === SyntaxKind.ForStatement || + parent.kind === SyntaxKind.IfStatement || + parent.kind === SyntaxKind.WhileStatement || + parent.kind === SyntaxKind.WithStatement) { + + addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + } + else { + // Block was a standalone block. In this case we want to only collapse + // the span of the block, independent of any parent span. + var span = TextSpan.fromBounds(n.getStart(), n.end); + elements.push({ + textSpan: span, + hintSpan: span, + bannerText: collapseText, + autoCollapse: autoCollapse(n) + }); + } + break; + + case SyntaxKind.FunctionBlock: case SyntaxKind.ModuleBlock: case SyntaxKind.TryBlock: - case SyntaxKind.TryBlock: case SyntaxKind.CatchBlock: case SyntaxKind.FinallyBlock: - var openBrace = forEach(n.getChildren(), c => c.kind === SyntaxKind.OpenBraceToken && c); - var closeBrace = forEach(n.getChildren(), c => c.kind === SyntaxKind.CloseBraceToken && c); - addOutlineRange(n.parent, openBrace, closeBrace); + var openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); + var closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); + addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.ObjectLiteral: - var openBrace = forEach(n.getChildren(), c => c.kind === SyntaxKind.OpenBraceToken && c); - var closeBrace = forEach(n.getChildren(), c => c.kind === SyntaxKind.CloseBraceToken && c); - addOutlineRange(n, openBrace, closeBrace); + case SyntaxKind.SwitchStatement: + var openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); + var closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile); + addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + break; + case SyntaxKind.ArrayLiteral: + var openBracket = findChildOfKind(n, SyntaxKind.OpenBracketToken, sourceFile); + var closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile); + addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); break; } depth++; diff --git a/src/services/references.ts b/src/services/references.ts deleted file mode 100644 index f1f4245c122..00000000000 --- a/src/services/references.ts +++ /dev/null @@ -1,26 +0,0 @@ -///// -///// - -//// document.ts depends on incrementalParser.ts being run first. -///// -///// - -///// -///// -///// -///// -///// -///// -///// -///// -///// -///// -///// -///// -///// -///// -///// -///// -///// -///// -///// \ No newline at end of file diff --git a/src/services/resources/diagnosticCode.generated.ts b/src/services/resources/diagnosticCode.generated.ts index 26df20b428d..e5878978fcc 100644 --- a/src/services/resources/diagnosticCode.generated.ts +++ b/src/services/resources/diagnosticCode.generated.ts @@ -5,7 +5,7 @@ module TypeScript { warning_TS_0_1: "warning TS{0}: {1}", Unrecognized_escape_sequence: "Unrecognized escape sequence.", Unexpected_character_0: "Unexpected character {0}.", - Missing_close_quote_character: "Missing close quote character.", + Unterminated_string_literal: "Unterminated string literal.", Identifier_expected: "Identifier expected.", _0_keyword_expected: "'{0}' keyword expected.", _0_expected: "'{0}' expected.", @@ -13,7 +13,6 @@ module TypeScript { Automatic_semicolon_insertion_not_allowed: "Automatic semicolon insertion not allowed.", Unexpected_token_0_expected: "Unexpected token; '{0}' expected.", Trailing_comma_not_allowed: "Trailing comma not allowed.", - AsteriskSlash_expected: "'*/' expected.", public_or_private_modifier_must_precede_static: "'public' or 'private' modifier must precede 'static'.", Unexpected_token: "Unexpected token.", Catch_clause_parameter_cannot_have_a_type_annotation: "Catch clause parameter cannot have a type annotation.", @@ -95,6 +94,11 @@ module TypeScript { return_statement_must_be_contained_within_a_function_body: "'return' statement must be contained within a function body.", Expression_expected: "Expression expected.", Type_expected: "Type expected.", + Template_literal_cannot_be_used_as_an_element_name: "Template literal cannot be used as an element name.", + Computed_property_names_cannot_be_used_here: "Computed property names cannot be used here.", + yield_expression_must_be_contained_within_a_generator_declaration: "'yield' expression must be contained within a generator declaration.", + Unterminated_regular_expression_literal: "Unterminated regular expression literal.", + Unterminated_template_literal: "Unterminated template literal.", Duplicate_identifier_0: "Duplicate identifier '{0}'.", The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.", The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.", diff --git a/src/services/resources/diagnosticInformationMap.generated.ts b/src/services/resources/diagnosticInformationMap.generated.ts index 8d3bc73486e..d6597a008df 100644 --- a/src/services/resources/diagnosticInformationMap.generated.ts +++ b/src/services/resources/diagnosticInformationMap.generated.ts @@ -6,7 +6,7 @@ module TypeScript { "warning TS{0}: {1}": { "code": 1, "category": DiagnosticCategory.NoPrefix }, "Unrecognized escape sequence.": { "code": 1000, "category": DiagnosticCategory.Error }, "Unexpected character {0}.": { "code": 1001, "category": DiagnosticCategory.Error }, - "Missing close quote character.": { "code": 1002, "category": DiagnosticCategory.Error }, + "Unterminated string literal.": { "code": 1002, "category": DiagnosticCategory.Error }, "Identifier expected.": { "code": 1003, "category": DiagnosticCategory.Error }, "'{0}' keyword expected.": { "code": 1004, "category": DiagnosticCategory.Error }, "'{0}' expected.": { "code": 1005, "category": DiagnosticCategory.Error }, @@ -96,6 +96,11 @@ module TypeScript { "'return' statement must be contained within a function body.": { "code": 1108, "category": DiagnosticCategory.Error }, "Expression expected.": { "code": 1109, "category": DiagnosticCategory.Error }, "Type expected.": { "code": 1110, "category": DiagnosticCategory.Error }, + "Template literal cannot be used as an element name.": { "code": 1111, "category": DiagnosticCategory.Error }, + "Computed property names cannot be used here.": { "code": 1112, "category": DiagnosticCategory.Error }, + "'yield' expression must be contained within a generator declaration.": { "code": 1113, "category": DiagnosticCategory.Error }, + "Unterminated regular expression literal.": { "code": 1114, "category": DiagnosticCategory.Error }, + "Unterminated template literal.": { "code": 1115, "category": DiagnosticCategory.Error }, "Duplicate identifier '{0}'.": { "code": 2000, "category": DiagnosticCategory.Error }, "The name '{0}' does not exist in the current scope.": { "code": 2001, "category": DiagnosticCategory.Error }, "The name '{0}' does not refer to a value.": { "code": 2002, "category": DiagnosticCategory.Error }, diff --git a/src/services/resources/diagnosticMessages.json b/src/services/resources/diagnosticMessages.json index bbca8b3f9ce..724edbd8f3b 100644 --- a/src/services/resources/diagnosticMessages.json +++ b/src/services/resources/diagnosticMessages.json @@ -15,7 +15,7 @@ "category": "Error", "code": 1001 }, - "Missing close quote character.": { + "Unterminated string literal.": { "category": "Error", "code": 1002 }, @@ -47,10 +47,6 @@ "category": "Error", "code": 1009 }, - "'*/' expected.": { - "category": "Error", - "code": 1010 - }, "'public' or 'private' modifier must precede 'static'.": { "category": "Error", "code": 1011 @@ -375,6 +371,26 @@ "category": "Error", "code": 1110 }, + "Template literal cannot be used as an element name.": { + "category": "Error", + "code": 1111 + }, + "Computed property names cannot be used here.": { + "category": "Error", + "code": 1112 + }, + "'yield' expression must be contained within a generator declaration.": { + "category": "Error", + "code": 1113 + }, + "Unterminated regular expression literal.": { + "category": "Error", + "code": 1114 + }, + "Unterminated template literal.": { + "category": "Error", + "code": 1115 + }, "Duplicate identifier '{0}'.": { "category": "Error", "code": 2000 diff --git a/src/services/services.ts b/src/services/services.ts index 0069f53922d..67e8aba34d2 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4,47 +4,38 @@ /// /// -/// +/// /// -/// -/// +/// /// -/// -/// - -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// +/// +/// +/// +/// module ts { export interface Node { getSourceFile(): SourceFile; - getChildCount(): number; - getChildAt(index: number): Node; - getChildren(): Node[]; - getStart(): number; + getChildCount(sourceFile?: SourceFile): number; + getChildAt(index: number, sourceFile?: SourceFile): Node; + getChildren(sourceFile?: SourceFile): Node[]; + getStart(sourceFile?: SourceFile): number; getFullStart(): number; getEnd(): number; - getWidth(): number; + getWidth(sourceFile?: SourceFile): number; getFullWidth(): number; - getLeadingTriviaWidth(): number; - getFullText(): string; - getFirstToken(): Node; - getLastToken(): Node; + getLeadingTriviaWidth(sourceFile?: SourceFile): number; + getFullText(sourceFile?: SourceFile): string; + getText(sourceFile?: SourceFile): string; + getFirstToken(sourceFile?: SourceFile): Node; + getLastToken(sourceFile?: SourceFile): Node; } export interface Symbol { getFlags(): SymbolFlags; getName(): string; getDeclarations(): Declaration[]; + getDocumentationComment(): SymbolDisplayPart[]; } export interface Type { @@ -64,18 +55,85 @@ module ts { getTypeParameters(): Type[]; getParameters(): Symbol[]; getReturnType(): Type; + getDocumentationComment(): SymbolDisplayPart[]; } export interface SourceFile { - getSourceUnit(): TypeScript.SourceUnitSyntax; - getSyntaxTree(): TypeScript.SyntaxTree; - getScriptSnapshot(): TypeScript.IScriptSnapshot; - update(scriptSnapshot: TypeScript.IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TypeScript.TextChangeRange): SourceFile; + getScriptSnapshot(): IScriptSnapshot; + getNamedDeclarations(): Declaration[]; + update(scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TextChangeRange): SourceFile; } - var scanner: Scanner = createScanner(ScriptTarget.ES5); + /** + * Represents an immutable snapshot of a script at a specified time.Once acquired, the + * snapshot is observably immutable. i.e. the same calls with the same parameters will return + * the same values. + */ + export interface IScriptSnapshot { + /** Gets a portion of the script snapshot specified by [start, end). */ + getText(start: number, end: number): string; - var emptyArray: any [] = []; + /** Gets the length of this script snapshot. */ + getLength(): number; + + /** + * This call returns the array containing the start position of every line. + * i.e."[0, 10, 55]". TODO: consider making this optional. The language service could + * always determine this (albeit in a more expensive manner). + */ + getLineStartPositions(): number[]; + + /** + * Gets the TextChangeRange that describe how the text changed between this text and + * an older version. This information is used by the incremental parser to determine + * what sections of the script need to be re-parsed. 'undefined' can be returned if the + * change range cannot be determined. However, in that case, incremental parsing will + * not happen and the entire document will be re - parsed. + */ + getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; + } + + export module ScriptSnapshot { + class StringScriptSnapshot implements IScriptSnapshot { + private _lineStartPositions: number[] = undefined; + + constructor(private text: string) { + } + + public getText(start: number, end: number): string { + return this.text.substring(start, end); + } + + public getLength(): number { + return this.text.length; + } + + public getLineStartPositions(): number[] { + if (!this._lineStartPositions) { + this._lineStartPositions = computeLineStarts(this.text); + } + + return this._lineStartPositions; + } + + public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange { + throw new Error("not yet implemented"); + } + } + + export function fromString(text: string): IScriptSnapshot { + return new StringScriptSnapshot(text); + } + } + export interface PreProcessedFileInfo { + referencedFiles: FileReference[]; + importedFiles: FileReference[]; + isLibFile: boolean + } + + var scanner: Scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ true); + + var emptyArray: any[] = []; function createNode(kind: SyntaxKind, pos: number, end: number, flags: NodeFlags, parent?: Node): NodeObject { var node = new (getNodeConstructor(kind))(); @@ -95,13 +153,11 @@ module ts { private _children: Node[]; public getSourceFile(): SourceFile { - var node: Node = this; - while (node.kind !== SyntaxKind.SourceFile) node = node.parent; - return node; + return getSourceFileOfNode(this); } - public getStart(): number { - return getTokenPosOfNode(this); + public getStart(sourceFile?: SourceFile): number { + return getTokenPosOfNode(this, sourceFile); } public getFullStart(): number { @@ -112,20 +168,24 @@ module ts { return this.end; } - public getWidth(): number { - return this.getEnd() - this.getStart(); + public getWidth(sourceFile?: SourceFile): number { + return this.getEnd() - this.getStart(sourceFile); } public getFullWidth(): number { return this.end - this.getFullStart(); } - public getLeadingTriviaWidth(): number { - return this.getStart() - this.pos; + public getLeadingTriviaWidth(sourceFile?: SourceFile): number { + return this.getStart(sourceFile) - this.pos; } - public getFullText(): string { - return this.getSourceFile().text.substring(this.pos, this.end); + public getFullText(sourceFile?: SourceFile): string { + return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); + } + + public getText(sourceFile?: SourceFile): string { + return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd()); } private addSyntheticNodes(nodes: Node[], pos: number, end: number): number { @@ -133,7 +193,7 @@ module ts { while (pos < end) { var token = scanner.scan(); var textPos = scanner.getTextPos(); - var node = nodes.push(createNode(token, pos, textPos, NodeFlags.Synthetic, this)); + nodes.push(createNode(token, pos, textPos, NodeFlags.Synthetic, this)); pos = textPos; } return pos; @@ -157,9 +217,9 @@ module ts { return list; } - private createChildren() { + private createChildren(sourceFile?: SourceFile) { if (this.kind > SyntaxKind.Missing) { - scanner.setText(this.getSourceFile().text); + scanner.setText((sourceFile || this.getSourceFile()).text); var children: Node[] = []; var pos = this.pos; var processNode = (node: Node) => { @@ -185,36 +245,36 @@ module ts { this._children = children || emptyArray; } - public getChildCount(): number { - if (!this._children) this.createChildren(); + public getChildCount(sourceFile?: SourceFile): number { + if (!this._children) this.createChildren(sourceFile); return this._children.length; } - public getChildAt(index: number): Node { - if (!this._children) this.createChildren(); + public getChildAt(index: number, sourceFile?: SourceFile): Node { + if (!this._children) this.createChildren(sourceFile); return this._children[index]; } - public getChildren(): Node[] { - if (!this._children) this.createChildren(); + public getChildren(sourceFile?: SourceFile): Node[] { + if (!this._children) this.createChildren(sourceFile); return this._children; } - public getFirstToken(): Node { + public getFirstToken(sourceFile?: SourceFile): Node { var children = this.getChildren(); for (var i = 0; i < children.length; i++) { var child = children[i]; if (child.kind < SyntaxKind.Missing) return child; - if (child.kind > SyntaxKind.Missing) return child.getFirstToken(); + if (child.kind > SyntaxKind.Missing) return child.getFirstToken(sourceFile); } } - public getLastToken(): Node { - var children = this.getChildren(); + public getLastToken(sourceFile?: SourceFile): Node { + var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; if (child.kind < SyntaxKind.Missing) return child; - if (child.kind > SyntaxKind.Missing) return child.getLastToken(); + if (child.kind > SyntaxKind.Missing) return child.getLastToken(sourceFile); } } } @@ -223,19 +283,352 @@ module ts { flags: SymbolFlags; name: string; declarations: Declaration[]; + + // Undefined is used to indicate the value has not been computed. If, after computing, the + // symbol has no doc comment, then the empty string will be returned. + documentationComment: SymbolDisplayPart[]; + constructor(flags: SymbolFlags, name: string) { this.flags = flags; this.name = name; } + getFlags(): SymbolFlags { return this.flags; } + getName(): string { return this.name; } + getDeclarations(): Declaration[] { return this.declarations; } + + getDocumentationComment(): SymbolDisplayPart[] { + if (this.documentationComment === undefined) { + this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & SymbolFlags.Property)); + } + + return this.documentationComment; + } + } + + function getJsDocCommentsFromDeclarations(declarations: Declaration[], name: string, canUseParsedParamTagComments: boolean) { + var documentationComment = []; + var docComments = getJsDocCommentsSeparatedByNewLines(); + ts.forEach(docComments, docComment => { + if (documentationComment.length) { + documentationComment.push(lineBreakPart()); + } + documentationComment.push(docComment); + }); + + return documentationComment; + + function getJsDocCommentsSeparatedByNewLines() { + var paramTag = "@param"; + var jsDocCommentParts: SymbolDisplayPart[] = []; + + ts.forEach(declarations, declaration => { + var 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) { + ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), jsDocCommentTextRange => { + var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); + if (cleanedParamJsDocComment) { + jsDocCommentParts.push.apply(jsDocCommentParts, cleanedParamJsDocComment); + } + }); + } + + // 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.kind === SyntaxKind.ModuleDeclaration) { + return; + } + + // 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; + } + + // Get the cleaned js doc comment text from the declaration + ts.forEach(getJsDocCommentTextRange( + declaration.kind === SyntaxKind.VariableDeclaration ? declaration.parent : declaration, sourceFileOfDeclaration), jsDocCommentTextRange => { + var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); + if (cleanedJsDocComment) { + jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); + } + }); + }); + + return jsDocCommentParts; + + 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++) { + var ch = sourceFile.text.charCodeAt(pos); + if (!isWhiteSpace(ch) || isLineBreak(ch)) { + // Either found lineBreak or non whiteSpace + 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)) || + isLineBreak(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--) docComments.push(textPart("")); + docComments.push(textPart(text)); + } + + function getCleanedJsDocComment(pos: number, end: number, sourceFile: SourceFile) { + var spacesToRemoveAfterAsterisk: number; + var docComments: SymbolDisplayPart[] = []; + var blankLineCount = 0; + var isInParamTag = false; + + while (pos < end) { + var 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) { + var 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; + } + + // Analyse text on this line + while (pos < end && !isLineBreak(sourceFile.text.charCodeAt(pos))) { + var 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) { + var paramHelpStringMargin: number; + var paramDocComments: SymbolDisplayPart[] = []; + while (pos < end) { + if (isParamTag(pos, end, sourceFile)) { + var blankLineCount = 0; + var 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 (var curlies = 1; pos < end; pos++) { + var 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; + } + + var paramHelpString = ""; + var firstLineParamHelpStringPos = pos; + while (pos < end) { + var 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 seach 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 && isWhiteSpace(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.getLineAndCharacterFromPosition(firstLineParamHelpStringPos).character - 1; + } + + // Now consume white spaces max + var startOfLinePos = pos; + pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile, paramHelpStringMargin); + if (pos >= end) { + return; + } + + var consumedSpaces = pos - startOfLinePos; + if (consumedSpaces < paramHelpStringMargin) { + var ch = sourceFile.text.charCodeAt(pos); + if (ch === CharacterCodes.asterisk) { + // Consume more spaces after asterisk + pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); + } + } + } + } + } } class TypeObject implements Type { @@ -259,8 +652,8 @@ module ts { getProperty(propertyName: string): Symbol { return this.checker.getPropertyOfType(this, propertyName); } - getApparentProperties(): Symbol[]{ - return this.checker.getAugmentedPropertiesOfApparentType(this); + getApparentProperties(): Symbol[] { + return this.checker.getAugmentedPropertiesOfType(this); } getCallSignatures(): Signature[] { return this.checker.getSignaturesOfType(this, SignatureKind.Call); @@ -285,6 +678,11 @@ module ts { minArgumentCount: number; hasRestParameter: boolean; hasStringLiterals: boolean; + + // Undefined is used to indicate the value has not been computed. If, after computing, the + // symbol has no doc comment, then the empty string will be returned. + documentationComment: SymbolDisplayPart[]; + constructor(checker: TypeChecker) { this.checker = checker; } @@ -300,19 +698,36 @@ module ts { getReturnType(): Type { return this.checker.getReturnTypeOfSignature(this); } - } - var incrementalParse: IncrementalParse = TypeScript.IncrementalParser.parse; + getDocumentationComment(): SymbolDisplayPart[] { + if (this.documentationComment === undefined) { + this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations( + [this.declaration], + /*name*/ undefined, + /*canUseParsedParamTagComments*/ false) : []; + } + + return this.documentationComment; + } + } class SourceFileObject extends NodeObject implements SourceFile { public filename: string; public text: string; - public getLineAndCharacterFromPosition(position: number): { line: number; character: number } { return null; } - public getPositionFromLineAndCharacter(line: number, character: number): number { return -1; } + + // These methods will have their implementation provided by the implementation the + // compiler actually exports off of SourceFile. + public getLineAndCharacterFromPosition: (position: number) => LineAndCharacter; + public getPositionFromLineAndCharacter: (line: number, character: number) => number; + public getLineStarts: () => number[]; + public getSyntacticDiagnostics: () => Diagnostic[]; + public amdDependencies: string[]; + public amdModuleName: string; public referencedFiles: FileReference[]; - public syntacticErrors: Diagnostic[]; - public semanticErrors: Diagnostic[]; + public parseDiagnostics: Diagnostic[]; + public grammarDiagnostics: Diagnostic[]; + public semanticDiagnostics: Diagnostic[]; public hasNoDefaultLib: boolean; public externalModuleIndicator: Node; // The first node that causes this file to be an external module public nodeCount: number; @@ -324,80 +739,109 @@ module ts { public languageVersion: ScriptTarget; public identifiers: Map; - private syntaxTree: TypeScript.SyntaxTree; - private scriptSnapshot: TypeScript.IScriptSnapshot; + private scriptSnapshot: IScriptSnapshot; + private namedDeclarations: Declaration[]; - public getSourceUnit(): TypeScript.SourceUnitSyntax { - // If we don't have a script, create one from our parse tree. - return this.getSyntaxTree().sourceUnit(); - } - - public getScriptSnapshot(): TypeScript.IScriptSnapshot { + public getScriptSnapshot(): IScriptSnapshot { return this.scriptSnapshot; } - public getLineMap(): TypeScript.LineMap { - return this.getSyntaxTree().lineMap(); - } + public getNamedDeclarations() { + if (!this.namedDeclarations) { + var sourceFile = this; + var namedDeclarations: Declaration[] = []; - public getSyntaxTree(): TypeScript.SyntaxTree { - if (!this.syntaxTree) { - var start = new Date().getTime(); + forEachChild(sourceFile, function visit(node: Node): void { + switch (node.kind) { + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + var functionDeclaration = node; - this.syntaxTree = TypeScript.Parser.parse( - this.filename, TypeScript.SimpleText.fromScriptSnapshot(this.scriptSnapshot), this.languageVersion, this.isDeclareFile()); + if (functionDeclaration.name && functionDeclaration.name.kind !== SyntaxKind.Missing) { + var lastDeclaration = namedDeclarations.length > 0 ? + namedDeclarations[namedDeclarations.length - 1] : + undefined; - var time = new Date().getTime() - start; + // Check whether this declaration belongs to an "overload group". + if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { + // Overwrite the last declaration if it was an overload + // and this one is an implementation. + if (functionDeclaration.body && !(lastDeclaration).body) { + namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; + } + } + else { + namedDeclarations.push(node); + } - //TypeScript.syntaxTreeParseTime += time; + forEachChild(node, visit); + } + break; + + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.ImportDeclaration: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.TypeLiteral: + if ((node).name) { + namedDeclarations.push(node); + } + // fall through + case SyntaxKind.Constructor: + case SyntaxKind.VariableStatement: + case SyntaxKind.ModuleBlock: + case SyntaxKind.FunctionBlock: + forEachChild(node, visit); + break; + + case SyntaxKind.Parameter: + // Only consider properties defined as constructor parameters + if (!(node.flags & NodeFlags.AccessibilityModifier)) { + break; + } + // fall through + case SyntaxKind.VariableDeclaration: + case SyntaxKind.EnumMember: + case SyntaxKind.Property: + namedDeclarations.push(node); + break; + } + }); + + this.namedDeclarations = namedDeclarations; } - return this.syntaxTree; + return this.namedDeclarations; } - private isDeclareFile(): boolean { - return TypeScript.isDTSFile(this.filename); - } - - public update(scriptSnapshot: TypeScript.IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TypeScript.TextChangeRange): SourceFile { - // See if we are currently holding onto a syntax tree. We may not be because we're - // either a closed file, or we've just been lazy and haven't had to create the syntax - // tree yet. Access the field instead of the method so we don't accidently realize - // the old syntax tree. - var oldSyntaxTree = this.syntaxTree; - + public update(scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TextChangeRange): SourceFile { if (textChangeRange && Debug.shouldAssert(AssertionLevel.Normal)) { var oldText = this.scriptSnapshot; var newText = scriptSnapshot; - TypeScript.Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); + Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); if (Debug.shouldAssert(AssertionLevel.VeryAggressive)) { var oldTextPrefix = oldText.getText(0, textChangeRange.span().start()); var newTextPrefix = newText.getText(0, textChangeRange.span().start()); - TypeScript.Debug.assert(oldTextPrefix === newTextPrefix); + Debug.assert(oldTextPrefix === newTextPrefix); var oldTextSuffix = oldText.getText(textChangeRange.span().end(), oldText.getLength()); var newTextSuffix = newText.getText(textChangeRange.newSpan().end(), newText.getLength()); - TypeScript.Debug.assert(oldTextSuffix === newTextSuffix); + Debug.assert(oldTextSuffix === newTextSuffix); } } - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - - // If we don't have a text change, or we don't have an old syntax tree, then do a full - // parse. Otherwise, do an incremental parse. - var newSyntaxTree = !textChangeRange || !oldSyntaxTree - ? TypeScript.Parser.parse(this.filename, text, this.languageVersion, TypeScript.isDTSFile(this.filename)) - : TypeScript.IncrementalParser.parse(oldSyntaxTree, textChangeRange, text); - - return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen, newSyntaxTree); + return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen); } - public static createSourceFileObject(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot, languageVersion: ScriptTarget, version: string, isOpen: boolean, syntaxTree?: TypeScript.SyntaxTree) { + public static createSourceFileObject(filename: string, scriptSnapshot: IScriptSnapshot, languageVersion: ScriptTarget, version: string, isOpen: boolean) { var newSourceFile = createSourceFile(filename, scriptSnapshot.getText(0, scriptSnapshot.getLength()), languageVersion, version, isOpen); newSourceFile.scriptSnapshot = scriptSnapshot; - newSourceFile.syntaxTree = syntaxTree; return newSourceFile; } } @@ -414,9 +858,11 @@ module ts { getScriptFileNames(): string[]; getScriptVersion(fileName: string): string; getScriptIsOpen(fileName: string): boolean; - getScriptSnapshot(fileName: string): TypeScript.IScriptSnapshot; + getScriptSnapshot(fileName: string): IScriptSnapshot; getLocalizedDiagnosticMessages(): any; getCancellationToken(): CancellationToken; + getCurrentDirectory(): string; + getDefaultLibFilename(): string; } // @@ -430,30 +876,33 @@ module ts { getSemanticDiagnostics(fileName: string): Diagnostic[]; getCompilerOptionsDiagnostics(): Diagnostic[]; + getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + getCompletionsAtPosition(fileName: string, position: number, isMemberCompletion: boolean): CompletionInfo; getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getTypeAtPosition(fileName: string, position: number): TypeInfo; + getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TypeScript.TextSpan; + getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TypeScript.TextSpan; + getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getSignatureHelpCurrentArgumentState(fileName: string, position: number, applicableSpanStart: number): SignatureHelpState; getRenameInfo(fileName: string, position: number): RenameInfo; + findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; + getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getImplementorsAtPosition(fileName: string, position: number): ReferenceEntry[]; getNavigateToItems(searchValue: string): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; getOutliningSpans(fileName: string): OutliningSpan[]; getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TypeScript.TextSpan[]; + getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; @@ -462,73 +911,63 @@ module ts { getEmitOutput(fileName: string): EmitOutput; - //getSyntaxTree(fileName: string): TypeScript.SyntaxTree; + getSourceFile(filename: string): SourceFile; dispose(): void; } - export class NavigationBarItem { - constructor(public text: string, - public kind: string, - public kindModifiers: string, - public spans: TypeScript.TextSpan[], - public childItems: NavigationBarItem[] = null, - public indent = 0, - public bolded = false, - public grayed = false) { - } + export interface ClassifiedSpan { + textSpan: TextSpan; + classificationType: string; // ClassificationTypeNames } - export class TodoCommentDescriptor { - constructor(public text: string, - public priority: number) { - } + export interface NavigationBarItem { + text: string; + kind: string; + kindModifiers: string; + spans: TextSpan[]; + childItems: NavigationBarItem[]; + indent: number; + bolded: boolean; + grayed: boolean; } - export class TodoComment { - constructor(public descriptor: TodoCommentDescriptor, - public message: string, - public position: number) { - } + export interface TodoCommentDescriptor { + text: string; + priority: number; + } + + export interface TodoComment { + descriptor: TodoCommentDescriptor; + message: string; + position: number; } export class TextChange { - constructor(public span: TypeScript.TextSpan, public newText: string) { - } - - static createInsert(pos: number, newText: string): TextChange { - return new TextChange(new TypeScript.TextSpan(pos, 0), newText); - } - static createDelete(start: number, end: number): TextChange { - return new TextChange(TypeScript.TextSpan.fromBounds(start, end), ""); - } - static createReplace(start: number, end: number, newText: string): TextChange { - return new TextChange(TypeScript.TextSpan.fromBounds(start, end), newText); - } + span: TextSpan; + newText: string; } - export class ReferenceEntry { - public fileName: string = ""; - public textSpan: TypeScript.TextSpan; - public isWriteAccess: boolean = false; - - constructor(fileName: string, textSpan: TypeScript.TextSpan, isWriteAccess: boolean) { - this.fileName = fileName; - this.textSpan = textSpan; - this.isWriteAccess = isWriteAccess; - } + export interface RenameLocation { + textSpan: TextSpan; + fileName: string; } - export class NavigateToItem { - constructor(public name: string, - public kind: string, - public kindModifiers: string, - public matchKind: string, - public fileName: string, - public textSpan: TypeScript.TextSpan, - public containerName: string, - public containerKind: string) { - } + export interface ReferenceEntry { + textSpan: TextSpan; + fileName: string; + isWriteAccess: boolean; + } + + export interface NavigateToItem { + name: string; + kind: string; + kindModifiers: string; + matchKind: string; + fileName: string; + textSpan: TextSpan; + containerName: string; + containerKind: string; } export interface EditorOptions { @@ -549,63 +988,68 @@ module ts { PlaceOpenBraceOnNewLineForControlBlocks: boolean; } - export class DefinitionInfo { - constructor(public fileName: string, - public textSpan: TypeScript.TextSpan, - public kind: string, - public name: string, - public containerKind: string, - public containerName: string) { - } + export interface DefinitionInfo { + fileName: string; + textSpan: TextSpan; + kind: string; + name: string; + containerKind: string; + containerName: string; } - export interface MemberName { - prefix: string; - suffix: string; + export enum SymbolDisplayPartKind { + aliasName, + className, + enumName, + fieldName, + interfaceName, + keyword, + lineBreak, + numericLiteral, + stringLiteral, + localName, + methodName, + moduleName, + operator, + parameterName, + propertyName, + punctuation, + space, + text, + typeParameterName, + enumMemberName, + functionName, + regularExpressionLiteral, + } + + export interface SymbolDisplayPart { text: string; + kind: string; + } + + export interface QuickInfo { + kind: string; + kindModifiers: string; + textSpan: TextSpan; + displayParts: SymbolDisplayPart[]; + documentation: SymbolDisplayPart[]; } - export class TypeInfo { - constructor( - public memberName: TypeScript.MemberName, - public docComment: string, - public fullSymbolName: string, - public kind: string, - public textSpan: TypeScript.TextSpan) { - } + export interface RenameInfo { + canRename: boolean; + localizedErrorMessage: string; + displayName: string; + fullDisplayName: string; + kind: string; + kindModifiers: string; + triggerSpan: TextSpan; } - export class RenameInfo { - constructor(public canRename: boolean, - public localizedErrorMessage: string, - public displayName: string, - public fullDisplayName: string, - public kind: string, - public kindModifiers: string, - public triggerSpan: TypeScript.TextSpan) { - } - - public static CreateError(localizedErrorMessage: string) { - return new RenameInfo(/*canRename:*/ false, localizedErrorMessage, - /*displayName:*/ null, /*fullDisplayName:*/ null, - /*kind:*/ null, /*kindModifiers:*/ null, /*triggerSpan:*/ null); - } - - public static Create(displayName: string, - fullDisplayName: string, - kind: string, - kindModifiers: string, - triggerSpan: TypeScript.TextSpan) { - return new RenameInfo(/*canRename:*/ true, /*localizedErrorMessage:*/ null, displayName, fullDisplayName, kind, kindModifiers, triggerSpan); - } - } - - export class SignatureHelpParameter { - constructor(public name: string, - public documentation: string, - public display: string, - public isOptional: boolean) { - } + export interface SignatureHelpParameter { + name: string; + documentation: SymbolDisplayPart[]; + displayParts: SymbolDisplayPart[]; + isOptional: boolean; } /** @@ -615,30 +1059,24 @@ module ts { * an edit has happened, while signature help is still active, the host can ask important * questions like 'what parameter is the user currently contained within?'. */ - export class SignatureHelpItem { - constructor(public isVariadic: boolean, - public prefix: string, - public suffix: string, - public separator: string, - public parameters: SignatureHelpParameter[], - public documentation: string) { - } + export interface SignatureHelpItem { + isVariadic: boolean; + prefixDisplayParts: SymbolDisplayPart[]; + suffixDisplayParts: SymbolDisplayPart[]; + separatorDisplayParts: SymbolDisplayPart[]; + parameters: SignatureHelpParameter[]; + documentation: SymbolDisplayPart[]; } /** * Represents a set of signature help items, and the preferred item that should be selected. */ - export class SignatureHelpItems { - constructor(public items: SignatureHelpItem[], - public applicableSpan: TypeScript.TextSpan, - public selectedItemIndex: number) { - } - } - - export class SignatureHelpState { - constructor(public argumentIndex: number, - public argumentCount: number) { - } + export interface SignatureHelpItems { + items: SignatureHelpItem[]; + applicableSpan: TextSpan; + selectedItemIndex: number; + argumentIndex: number; + argumentCount: number; } export interface CompletionInfo { @@ -656,24 +1094,16 @@ module ts { name: string; kind: string; // see ScriptElementKind kindModifiers: string; // see ScriptElementKindModifier, comma separated - type: string; - fullSymbolName: string; - docComment: string; - } - - export enum EmitOutputResult { - Succeeded, - FailedBecauseOfSyntaxErrors, - FailedBecauseOfCompilerOptionsErrors, - FailedToGenerateDeclarationsBecauseOfSemanticErrors + displayParts: SymbolDisplayPart[]; + documentation: SymbolDisplayPart[]; } export interface EmitOutput { outputFiles: OutputFile[]; - emitOutputResult: EmitOutputResult; + emitOutputStatus: EmitReturnStatus; } - export enum OutputFileType { + export const enum OutputFileType { JavaScript, SourceMap, Declaration @@ -683,16 +1113,13 @@ module ts { name: string; writeByteOrderMark: boolean; text: string; - fileType: OutputFileType; - sourceMapOutput: any; } - export enum EndOfLineState { + export const enum EndOfLineState { Start, InMultiLineCommentTrivia, InSingleQuoteStringLiteral, InDoubleQuoteStringLiteral, - EndingWithDotToken, } export enum TokenClass { @@ -718,14 +1145,14 @@ module ts { } export interface Classifier { - getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult; + getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): ClassificationResult; } export interface DocumentRegistry { acquireDocument( filename: string, compilationSettings: CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean): SourceFile; @@ -733,10 +1160,10 @@ module ts { sourceFile: SourceFile, filename: string, compilationSettings: CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean, - textChangeRange: TypeScript.TextChangeRange + textChangeRange: TextChangeRange ): SourceFile; releaseDocument(filename: string, compilationSettings: CompilerOptions): void @@ -761,6 +1188,9 @@ module ts { // interface Y {} static interfaceElement = "interface"; + // type T = ... + static typeElement = "type"; + // enum E static enumElement = "enum"; @@ -809,26 +1239,48 @@ module ts { static primitiveType = "primitive type"; static label = "label"; + + static alias = "alias"; + + static constElement = "const"; + + static letElement = "let"; } export class ScriptElementKindModifier { static none = ""; static publicMemberModifier = "public"; static privateMemberModifier = "private"; + static protectedMemberModifier = "protected"; static exportedModifier = "export"; static ambientModifier = "declare"; static staticModifier = "static"; } - export class MatchKind { - static none: string = null; - static exact = "exact"; - static subString = "substring"; - static prefix = "prefix"; + export class ClassificationTypeNames { + public static comment = "comment"; + public static identifier = "identifier"; + public static keyword = "keyword"; + public static numericLiteral = "number"; + public static operator = "operator"; + public static stringLiteral = "string"; + public static whiteSpace = "whitespace"; + public static text = "text"; + + public static punctuation = "punctuation"; + + public static className = "class name"; + public static enumName = "enum name"; + public static interfaceName = "interface name"; + public static moduleName = "module name"; + public static typeParameterName = "type parameter name"; } - interface IncrementalParse { - (oldSyntaxTree: TypeScript.SyntaxTree, textChangeRange: TypeScript.TextChangeRange, newText: TypeScript.ISimpleText): TypeScript.SyntaxTree + enum MatchKind { + none = 0, + exact = 1, + substring = 2, + prefix = 3 } /// Language Service @@ -837,9 +1289,8 @@ module ts { filename: string; // the file where the completion was requested position: number; // position in the file where the completion was requested entries: CompletionEntry[]; // entries for this completion - symbols: Map; // symbols by entry name map - location: Node; // the node where the completion was requested - typeChecker: TypeChecker;// the typeChecker used to generate this completion + symbols: Map; // symbols by entry name map + typeChecker: TypeChecker; // the typeChecker used to generate this completion } interface FormattingOptions { @@ -854,7 +1305,7 @@ module ts { filename: string; version: string; isOpen: boolean; - sourceText?: TypeScript.IScriptSnapshot; + sourceText?: IScriptSnapshot; } interface DocumentRegistryEntry { @@ -863,10 +1314,185 @@ module ts { owners: string[]; } - export function getDefaultCompilerOptions(): CompilerOptions { - // Set "ES5" target by default for language service + export function displayPartsToString(displayParts: SymbolDisplayPart[]) { + if (displayParts) { + return map(displayParts, displayPart => displayPart.text).join(""); + } + + return ""; + } + + export interface DisplayPartsSymbolWriter extends SymbolWriter { + displayParts(): SymbolDisplayPart[]; + } + + var displayPartWriter = getDisplayPartWriter(); + function getDisplayPartWriter(): DisplayPartsSymbolWriter { + var displayParts: SymbolDisplayPart[]; + var lineStart: boolean; + var indent: number; + + resetWriter(); return { - target: ScriptTarget.ES5, + displayParts: () => displayParts, + writeKeyword: text => writeKind(text, SymbolDisplayPartKind.keyword), + writeOperator: text => writeKind(text, SymbolDisplayPartKind.operator), + writePunctuation: text => writeKind(text, SymbolDisplayPartKind.punctuation), + writeSpace: text => writeKind(text, SymbolDisplayPartKind.space), + writeStringLiteral: text => writeKind(text, SymbolDisplayPartKind.stringLiteral), + writeParameter: text => writeKind(text, SymbolDisplayPartKind.parameterName), + writeSymbol, + writeLine, + increaseIndent: () => { indent++; }, + decreaseIndent: () => { indent--; }, + clear: resetWriter, + trackSymbol: () => { } + }; + + function writeIndent() { + if (lineStart) { + displayParts.push(displayPart(getIndentString(indent), SymbolDisplayPartKind.space)); + lineStart = false; + } + } + + function writeKind(text: string, kind: SymbolDisplayPartKind) { + writeIndent(); + displayParts.push(displayPart(text, kind)); + } + + function writeSymbol(text: string, symbol: Symbol) { + writeIndent(); + displayParts.push(symbolPart(text, symbol)); + } + + function writeLine() { + displayParts.push(lineBreakPart()); + lineStart = true; + } + + function resetWriter() { + displayParts = [] + lineStart = true; + indent = 0; + } + } + + function displayPart(text: string, kind: SymbolDisplayPartKind, symbol?: Symbol): SymbolDisplayPart { + return { + text: text, + kind: SymbolDisplayPartKind[kind] + }; + } + + export function spacePart() { + return displayPart(" ", SymbolDisplayPartKind.space); + } + + export function keywordPart(kind: SyntaxKind) { + return displayPart(tokenToString(kind), SymbolDisplayPartKind.keyword); + } + + export function punctuationPart(kind: SyntaxKind) { + return displayPart(tokenToString(kind), SymbolDisplayPartKind.punctuation); + } + + export function operatorPart(kind: SyntaxKind) { + return displayPart(tokenToString(kind), SymbolDisplayPartKind.operator); + } + + export function textPart(text: string) { + return displayPart(text, SymbolDisplayPartKind.text); + } + + export function lineBreakPart() { + return displayPart("\n", SymbolDisplayPartKind.lineBreak); + } + + function isFirstDeclarationOfSymbolParameter(symbol: Symbol) { + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === SyntaxKind.Parameter; + } + + 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 (var parent = declaration.parent; parent.kind !== SyntaxKind.FunctionBlock; 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 symbolPart(text: string, symbol: Symbol) { + return displayPart(text, displayPartKind(symbol), symbol); + + function displayPartKind(symbol: Symbol): SymbolDisplayPartKind { + var flags = symbol.flags; + + if (flags & SymbolFlags.Variable) { + return isFirstDeclarationOfSymbolParameter(symbol) ? SymbolDisplayPartKind.parameterName : SymbolDisplayPartKind.localName; + } + else if (flags & SymbolFlags.Property) { return SymbolDisplayPartKind.propertyName; } + else if (flags & SymbolFlags.EnumMember) { return SymbolDisplayPartKind.enumMemberName; } + else if (flags & SymbolFlags.Function) { return SymbolDisplayPartKind.functionName; } + else if (flags & SymbolFlags.Class) { return SymbolDisplayPartKind.className; } + else if (flags & SymbolFlags.Interface) { return SymbolDisplayPartKind.interfaceName; } + else if (flags & SymbolFlags.Enum) { return SymbolDisplayPartKind.enumName; } + else if (flags & SymbolFlags.Module) { return SymbolDisplayPartKind.moduleName; } + else if (flags & SymbolFlags.Method) { return SymbolDisplayPartKind.methodName; } + else if (flags & SymbolFlags.TypeParameter) { return SymbolDisplayPartKind.typeParameterName; } + + return SymbolDisplayPartKind.text; + } + } + + export function mapToDisplayParts(writeDisplayParts: (writer: DisplayPartsSymbolWriter) => void): SymbolDisplayPart[] { + writeDisplayParts(displayPartWriter); + var result = displayPartWriter.displayParts(); + displayPartWriter.clear(); + return result; + } + + export function typeToDisplayParts(typechecker: TypeChecker, type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[] { + return mapToDisplayParts(writer => { + typechecker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + }); + } + + export function symbolToDisplayParts(typeChecker: TypeChecker, symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): SymbolDisplayPart[] { + return mapToDisplayParts(writer => { + typeChecker.getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags); + }); + } + + function signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]{ + return mapToDisplayParts(writer => { + typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); + }); + } + + export function getDefaultCompilerOptions(): CompilerOptions { + // Set "ScriptTarget.Latest" target by default for language service + return { + target: ScriptTarget.Latest, module: ModuleKind.None, }; } @@ -887,7 +1513,7 @@ module ts { export class OperationCanceledException { } - class CancellationTokenObject { + export class CancellationTokenObject { public static None: CancellationTokenObject = new CancellationTokenObject(null) @@ -919,7 +1545,7 @@ module ts { var filenames = host.getScriptFileNames(); for (var i = 0, n = filenames.length; i < n; i++) { var filename = filenames[i]; - this.filenameToEntry[TypeScript.switchToForwardSlashes(filename)] = { + this.filenameToEntry[normalizeSlashes(filename)] = { filename: filename, version: host.getScriptVersion(filename), isOpen: host.getScriptIsOpen(filename) @@ -934,7 +1560,7 @@ module ts { } public getEntry(filename: string): HostFileInformation { - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); return lookUp(this.filenameToEntry, filename); } @@ -969,7 +1595,7 @@ module ts { return this.getEntry(filename).isOpen; } - public getScriptSnapshot(filename: string): TypeScript.IScriptSnapshot { + public getScriptSnapshot(filename: string): IScriptSnapshot { var file = this.getEntry(filename); if (!file.sourceText) { file.sourceText = this.host.getScriptSnapshot(file.filename); @@ -977,10 +1603,10 @@ module ts { return file.sourceText; } - public getChangeRange(filename: string, lastKnownVersion: string, oldScriptSnapshot: TypeScript.IScriptSnapshot): TypeScript.TextChangeRange { + public getChangeRange(filename: string, lastKnownVersion: string, oldScriptSnapshot: IScriptSnapshot): TextChangeRange { var currentVersion = this.getVersion(filename); if (lastKnownVersion === currentVersion) { - return TypeScript.TextChangeRange.unchanged; // "No changes" + return TextChangeRange.unchanged; // "No changes" } var scriptSnapshot = this.getScriptSnapshot(filename); @@ -996,7 +1622,6 @@ module ts { private currentFilename: string = ""; private currentFileVersion: string = null; private currentSourceFile: SourceFile = null; - private currentFileSyntaxTree: TypeScript.SyntaxTree = null; constructor(private host: LanguageServiceHost) { this.hostCache = new HostCache(host); @@ -1004,39 +1629,44 @@ module ts { private initialize(filename: string) { // ensure that both source file and syntax tree are either initialized or not initialized - Debug.assert(!!this.currentFileSyntaxTree === !!this.currentSourceFile); + var start = new Date().getTime(); this.hostCache = new HostCache(this.host); + this.host.log("SyntaxTreeCache.Initialize: new HostCache: " + (new Date().getTime() - start)); var version = this.hostCache.getVersion(filename); - var syntaxTree: TypeScript.SyntaxTree = null; var sourceFile: SourceFile; - if (this.currentFileSyntaxTree === null || this.currentFilename !== filename) { + if (this.currentFilename !== filename) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); - syntaxTree = this.createSyntaxTree(filename, scriptSnapshot); - sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, /*isOpen*/ true); + var start = new Date().getTime(); + sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, /*isOpen*/ true); + this.host.log("SyntaxTreeCache.Initialize: createSourceFile: " + (new Date().getTime() - start)); + + var start = new Date().getTime(); fixupParentReferences(sourceFile); + this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } else if (this.currentFileVersion !== version) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); - syntaxTree = this.updateSyntaxTree(filename, scriptSnapshot, - this.currentSourceFile.getScriptSnapshot(), this.currentFileSyntaxTree, this.currentFileVersion); var editRange = this.hostCache.getChangeRange(filename, this.currentFileVersion, this.currentSourceFile.getScriptSnapshot()); + + var start = new Date().getTime(); sourceFile = !editRange ? createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, /*isOpen*/ true) : this.currentSourceFile.update(scriptSnapshot, version, /*isOpen*/ true, editRange); + this.host.log("SyntaxTreeCache.Initialize: updateSourceFile: " + (new Date().getTime() - start)); + var start = new Date().getTime(); fixupParentReferences(sourceFile); + this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } - if (syntaxTree !== null) { - Debug.assert(sourceFile); + if (sourceFile) { // All done, ensure state is up to date this.currentFileVersion = version; this.currentFilename = filename; - this.currentFileSyntaxTree = syntaxTree; this.currentSourceFile = sourceFile; } @@ -1057,115 +1687,17 @@ module ts { } } - public getCurrentFileSyntaxTree(filename: string): TypeScript.SyntaxTree { - this.initialize(filename); - return this.currentFileSyntaxTree; - } - public getCurrentSourceFile(filename: string): SourceFile { this.initialize(filename); return this.currentSourceFile; } - public getCurrentScriptSnapshot(filename: string): TypeScript.IScriptSnapshot { - // update currentFileScriptSnapshot as a part of 'getCurrentFileSyntaxTree' call - this.getCurrentFileSyntaxTree(filename); + public getCurrentScriptSnapshot(filename: string): IScriptSnapshot { return this.getCurrentSourceFile(filename).getScriptSnapshot(); } - - private createSyntaxTree(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot): TypeScript.SyntaxTree { - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - - // For the purposes of features that use this syntax tree, we can just use the default - // compilation settings. The features only use the syntax (and not the diagnostics), - // and the syntax isn't affected by the compilation settings. - var syntaxTree = TypeScript.Parser.parse(filename, text, getDefaultCompilerOptions().target, TypeScript.isDTSFile(filename)); - - return syntaxTree; - } - - private updateSyntaxTree(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot, previousScriptSnapshot: TypeScript.IScriptSnapshot, previousSyntaxTree: TypeScript.SyntaxTree, previousFileVersion: string): TypeScript.SyntaxTree { - var editRange = this.hostCache.getChangeRange(filename, previousFileVersion, previousScriptSnapshot); - - // Debug.assert(newLength >= 0); - - // The host considers the entire buffer changed. So parse a completely new tree. - if (editRange === null) { - return this.createSyntaxTree(filename, scriptSnapshot); - } - - var nextSyntaxTree = TypeScript.IncrementalParser.parse( - previousSyntaxTree, editRange, TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot)); - - this.ensureInvariants(filename, editRange, nextSyntaxTree, previousScriptSnapshot, scriptSnapshot); - - return nextSyntaxTree; - } - - private ensureInvariants(filename: string, editRange: TypeScript.TextChangeRange, incrementalTree: TypeScript.SyntaxTree, oldScriptSnapshot: TypeScript.IScriptSnapshot, newScriptSnapshot: TypeScript.IScriptSnapshot) { - // First, verify that the edit range and the script snapshots make sense. - - // If this fires, then the edit range is completely bogus. Somehow the lengths of the - // old snapshot, the change range and the new snapshot aren't in sync. This is very - // bad. - var expectedNewLength = oldScriptSnapshot.getLength() - editRange.span().length() + editRange.newLength(); - var actualNewLength = newScriptSnapshot.getLength(); - - function provideMoreDebugInfo() { - - var debugInformation = ["expected length:", expectedNewLength, "and actual length:", actualNewLength, "are not equal\r\n"]; - - var oldSpan = editRange.span(); - - function prettyPrintString(s: string): string { - return '"' + s.replace(/\r/g, '\\r').replace(/\n/g, '\\n') + '"'; - } - - debugInformation.push('Edit range (old text) (start: ' + oldSpan.start() + ', end: ' + oldSpan.end() + ') \r\n'); - debugInformation.push('Old text edit range contents: ' + prettyPrintString(oldScriptSnapshot.getText(oldSpan.start(), oldSpan.end()))); - - var newSpan = editRange.newSpan(); - - debugInformation.push('Edit range (new text) (start: ' + newSpan.start() + ', end: ' + newSpan.end() + ') \r\n'); - debugInformation.push('New text edit range contents: ' + prettyPrintString(newScriptSnapshot.getText(newSpan.start(), newSpan.end()))); - - return debugInformation.join(' '); - } - - Debug.assert( - expectedNewLength === actualNewLength, - "Expected length is different from actual!", - provideMoreDebugInfo); - - if (Debug.shouldAssert(AssertionLevel.VeryAggressive)) { - // If this fires, the text change range is bogus. It says the change starts at point - // 'X', but we can see a text difference *before* that point. - var oldPrefixText = oldScriptSnapshot.getText(0, editRange.span().start()); - var newPrefixText = newScriptSnapshot.getText(0, editRange.span().start()); - Debug.assert(oldPrefixText === newPrefixText, 'Expected equal prefix texts!'); - - // If this fires, the text change range is bogus. It says the change goes only up to - // point 'X', but we can see a text difference *after* that point. - var oldSuffixText = oldScriptSnapshot.getText(editRange.span().end(), oldScriptSnapshot.getLength()); - var newSuffixText = newScriptSnapshot.getText(editRange.newSpan().end(), newScriptSnapshot.getLength()); - Debug.assert(oldSuffixText === newSuffixText, 'Expected equal suffix texts!'); - - // Ok, text change range and script snapshots look ok. Let's verify that our - // incremental parsing worked properly. - //var normalTree = this.createSyntaxTree(filename, newScriptSnapshot); - //Debug.assert(normalTree.structuralEquals(incrementalTree), 'Expected equal incremental and normal trees'); - - // Ok, the trees looked good. So at least our incremental parser agrees with the - // normal parser. Now, verify that the incremental tree matches the contents of the - // script snapshot. - var incrementalTreeText = TypeScript.fullText(incrementalTree.sourceUnit()); - var actualSnapshotText = newScriptSnapshot.getText(0, newScriptSnapshot.getLength()); - Debug.assert(incrementalTreeText === actualSnapshotText, 'Expected full texts to be equal'); - } - } } - function createSourceFileFromScriptSnapshot(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot, settings: CompilerOptions, version: string, isOpen: boolean) { + function createSourceFileFromScriptSnapshot(filename: string, scriptSnapshot: IScriptSnapshot, settings: CompilerOptions, version: string, isOpen: boolean) { return SourceFileObject.createSourceFileObject(filename, scriptSnapshot, settings.target, version, isOpen); } @@ -1173,7 +1705,7 @@ module ts { var buckets: Map> = {}; function getKeyFromCompilationSettings(settings: CompilerOptions): string { - return "_" + ScriptTarget[settings.target]; // + "|" + settings.propagateEnumConstantoString() + return "_" + settings.target; // + "|" + settings.propagateEnumConstantoString() } function getBucketForCompilationSettings(settings: CompilerOptions, createIfMissing: boolean): Map { @@ -1200,7 +1732,7 @@ module ts { sourceFiles.sort((x, y) => y.refCount - x.refCount); return { bucket: name, - sourceFiles: sourceFiles + sourceFiles }; }); return JSON.stringify(bucketInfoArray, null, 2); @@ -1209,7 +1741,7 @@ module ts { function acquireDocument( filename: string, compilationSettings: CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean): SourceFile { @@ -1233,16 +1765,16 @@ module ts { sourceFile: SourceFile, filename: string, compilationSettings: CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean, - textChangeRange: TypeScript.TextChangeRange + textChangeRange: TextChangeRange ): SourceFile { var bucket = getBucketForCompilationSettings(compilationSettings, /*createIfMissing*/ false); - Debug.assert(bucket); + Debug.assert(bucket !== undefined); var entry = lookUp(bucket, filename); - Debug.assert(entry); + Debug.assert(entry !== undefined); if (entry.sourceFile.isOpen === isOpen && entry.sourceFile.version === version) { return entry.sourceFile; @@ -1254,7 +1786,7 @@ module ts { function releaseDocument(filename: string, compilationSettings: CompilerOptions): void { var bucket = getBucketForCompilationSettings(compilationSettings, false); - Debug.assert(bucket); + Debug.assert(bucket !== undefined); var entry = lookUp(bucket, filename); entry.refCount--; @@ -1266,18 +1798,94 @@ module ts { } return { - acquireDocument: acquireDocument, - updateDocument: updateDocument, - releaseDocument: releaseDocument, - reportStats: reportStats + acquireDocument, + updateDocument, + releaseDocument, + reportStats }; } + export function preProcessFile(sourceText: string, readImportFiles = true): PreProcessedFileInfo { + var referencedFiles: FileReference[] = []; + var importedFiles: FileReference[] = []; + var isNoDefaultLib = false; + + function processTripleSlashDirectives(): void { + var commentRanges = getLeadingCommentRanges(sourceText, 0); + forEach(commentRanges, commentRange => { + var comment = sourceText.substring(commentRange.pos, commentRange.end); + var referencePathMatchResult = getFileReferenceFromReferencePath(comment, commentRange); + if (referencePathMatchResult) { + isNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + var fileReference = referencePathMatchResult.fileReference; + if (fileReference) { + referencedFiles.push(fileReference); + } + } + }); + } + + function processImport(): void { + scanner.setText(sourceText); + var token = scanner.scan(); + // Look for: + // import foo = module("foo"); + while (token !== SyntaxKind.EndOfFileToken) { + if (token === SyntaxKind.ImportKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.Identifier) { + token = scanner.scan(); + if (token === SyntaxKind.EqualsToken) { + token = scanner.scan(); + if (token === SyntaxKind.RequireKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.OpenParenToken) { + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + var importPath = scanner.getTokenValue(); + var pos = scanner.getTokenPos(); + importedFiles.push({ + filename: importPath, + pos: pos, + end: pos + importPath.length + }); + } + } + } + } + } + } + token = scanner.scan(); + } + scanner.setText(undefined); + } + + if (readImportFiles) { + processImport(); + } + processTripleSlashDirectives(); + return { referencedFiles, importedFiles, isLibFile: isNoDefaultLib }; + } + /// Helpers + export function getNodeModifiers(node: Node): string { + var flags = node.flags; + var result: string[] = []; + + if (flags & NodeFlags.Private) result.push(ScriptElementKindModifier.privateMemberModifier); + if (flags & NodeFlags.Protected) result.push(ScriptElementKindModifier.protectedMemberModifier); + if (flags & NodeFlags.Public) result.push(ScriptElementKindModifier.publicMemberModifier); + if (flags & NodeFlags.Static) result.push(ScriptElementKindModifier.staticModifier); + if (flags & NodeFlags.Export) result.push(ScriptElementKindModifier.exportedModifier); + if (isInAmbientContext(node)) result.push(ScriptElementKindModifier.ambientModifier); + + return result.length > 0 ? result.join(',') : ScriptElementKindModifier.none; + } + function getTargetLabel(referenceNode: Node, labelName: string): Identifier { while (referenceNode) { - if (referenceNode.kind === SyntaxKind.LabelledStatement && (referenceNode).label.text === labelName) { - return (referenceNode).label; + if (referenceNode.kind === SyntaxKind.LabeledStatement && (referenceNode).label.text === labelName) { + return (referenceNode).label; } referenceNode = referenceNode.parent; } @@ -1292,49 +1900,63 @@ module ts { function isLabelOfLabeledStatement(node: Node): boolean { return node.kind === SyntaxKind.Identifier && - node.parent.kind === SyntaxKind.LabelledStatement && - (node.parent).label === node; + 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 (var 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.PropertyAccess && (node.parent).right === node; + } + function isCallExpressionTarget(node: Node): boolean { - if (node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).right === node) + if (isRightSideOfPropertyAccess(node)) { node = node.parent; - return node.parent.kind === SyntaxKind.CallExpression && (node.parent).func === node; + } + return node && node.parent && node.parent.kind === SyntaxKind.CallExpression && (node.parent).func === node; } function isNewExpressionTarget(node: Node): boolean { - if (node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).right === node) + if (isRightSideOfPropertyAccess(node)) { node = node.parent; - return node.parent.kind === SyntaxKind.NewExpression && (node.parent).func === node; + } + return node && node.parent && node.parent.kind === SyntaxKind.NewExpression && (node.parent).func === node; } - function isAnyFunction(node: Node): boolean { - switch (node.kind) { - case SyntaxKind.FunctionExpression: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ArrowFunction: - case SyntaxKind.Method: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.Constructor: - return true; - } - return false; + function isNameOfModuleDeclaration(node: Node) { + return node.parent.kind === SyntaxKind.ModuleDeclaration && (node.parent).name === node; } function isNameOfFunctionDeclaration(node: Node): boolean { return node.kind === SyntaxKind.Identifier && - isAnyFunction(node.parent) && (node.parent).name === node; + isAnyFunction(node.parent) && (node.parent).name === node; } - /// Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } + /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ function isNameOfPropertyAssignment(node: Node): boolean { return (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral) && - node.parent.kind === SyntaxKind.PropertyAssignment && (node.parent).name === node; + (node.parent.kind === SyntaxKind.PropertyAssignment || node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) && (node.parent).name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node: Node): boolean { @@ -1358,14 +1980,54 @@ module ts { function isNameOfExternalModuleImportOrDeclaration(node: Node): boolean { return node.kind === SyntaxKind.StringLiteral && - ((node.parent.kind === SyntaxKind.ModuleDeclaration && (node.parent).name === node) || + (isNameOfModuleDeclaration(node) || (node.parent.kind === SyntaxKind.ImportDeclaration && (node.parent).externalModuleName === node)); } - enum SearchMeaning { + /** 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) { + var text = sourceFile.text; + var 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 + 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 @@ -1380,33 +2042,51 @@ module ts { export function createLanguageService(host: LanguageServiceHost, documentRegistry: DocumentRegistry): LanguageService { var syntaxTreeCache: SyntaxTreeCache = new SyntaxTreeCache(host); - var formattingRulesProvider: TypeScript.Services.Formatting.RulesProvider; + var ruleProvider: formatting.RulesProvider; var hostCache: HostCache; // A cache of all the information about the files on the host side. var program: Program; + // this checker is used to answer all LS questions except errors var typeInfoResolver: TypeChecker; - // the sole purpose of this checkes is to reutrn semantic diagnostics + + // the sole purpose of this checker is to return semantic diagnostics // creation is deferred - use getFullTypeCheckChecker to get instance var fullTypeCheckChecker_doNotAccessDirectly: TypeChecker; + var useCaseSensitivefilenames = false; var sourceFilesByName: Map = {}; var documentRegistry = documentRegistry; var cancellationToken = new CancellationTokenObject(host.getCancellationToken()); var activeCompletionSession: CompletionSession; // The current active completion session, used to get the completion entry details + var writer: (filename: string, data: string, writeByteOrderMark: boolean) => void = undefined; // Check if the localized messages json is set, otherwise query the host for it - if (!TypeScript.LocalizedDiagnosticMessages) { - TypeScript.LocalizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); + if (!localizedDiagnosticMessages) { + localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); + } + + function getCanonicalFileName(filename: string) { + return useCaseSensitivefilenames ? filename : filename.toLowerCase(); } function getSourceFile(filename: string): SourceFile { - return lookUp(sourceFilesByName, filename); + return lookUp(sourceFilesByName, getCanonicalFileName(filename)); } function getFullTypeCheckChecker() { return fullTypeCheckChecker_doNotAccessDirectly || (fullTypeCheckChecker_doNotAccessDirectly = program.getTypeChecker(/*fullTypeCheck*/ true)); } + function getRuleProvider(options: FormatCodeOptions) { + // Ensure rules are initialized and up to date wrt to formatting options + if (!ruleProvider) { + ruleProvider = new formatting.RulesProvider(host); + } + + ruleProvider.ensureUpToDate(options); + return ruleProvider; + } + function createCompilerHost(): CompilerHost { return { getSourceFile: (filename, languageVersion) => { @@ -1417,15 +2097,14 @@ module ts { getCanonicalFileName: (filename) => useCaseSensitivefilenames ? filename : filename.toLowerCase(), useCaseSensitiveFileNames: () => useCaseSensitivefilenames, getNewLine: () => "\r\n", - // Need something that doesn't depend on sys.ts here getDefaultLibFilename: (): string => { - throw Error("TOD:: getDefaultLibfilename"); + return host.getDefaultLibFilename(); }, writeFile: (filename, data, writeByteOrderMark) => { - throw Error("TODO: write file"); + writer(filename, data, writeByteOrderMark); }, getCurrentDirectory: (): string => { - throw Error("TODO: getCurrentDirectory"); + return host.getCurrentDirectory(); } }; } @@ -1487,7 +2166,7 @@ module ts { var filename = oldSourceFiles[i].filename; if (!hostCache.contains(filename) || changesInCompilationSettingsAffectSyntax) { documentRegistry.releaseDocument(filename, oldSettings); - delete sourceFilesByName[filename]; + delete sourceFilesByName[getCanonicalFileName(filename)]; } } } @@ -1513,12 +2192,12 @@ module ts { } // Only perform incremental parsing on open files that are being edited. If a file was - // open, but is now closed, we want to reparse entirely so we don't have any tokens that + // open, but is now closed, we want to re-parse entirely so we don't have any tokens that // are holding onto expensive script snapshot instances on the host. Similarly, if a - // file was closed, then we always want to reparse. This is so our tree doesn't keep + // file was closed, then we always want to re-parse. This is so our tree doesn't keep // the old buffer alive that represented the file on disk (as the host has moved to a // new text buffer). - var textChangeRange: TypeScript.TextChangeRange = null; + var textChangeRange: TextChangeRange = null; if (sourceFile.isOpen && isOpen) { textChangeRange = hostCache.getChangeRange(filename, sourceFile.version, sourceFile.getScriptSnapshot()); } @@ -1529,8 +2208,8 @@ module ts { sourceFile = documentRegistry.acquireDocument(filename, compilationSettings, scriptSnapshot, version, isOpen); } - // Remeber the new sourceFile - sourceFilesByName[filename] = sourceFile; + // Remember the new sourceFile + sourceFilesByName[getCanonicalFileName(filename)] = sourceFile; } // Now create a new compiler @@ -1539,9 +2218,11 @@ module ts { fullTypeCheckChecker_doNotAccessDirectly = undefined; } - /// Clean up any semantic caches that are not needed. - /// The host can call this method if it wants to jettison unused memory. - /// We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches. + /** + * Clean up any semantic caches that are not needed. + * The host can call this method if it wants to jettison unused memory. + * We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches. + */ function cleanupSemanticCache(): void { if (program) { typeInfoResolver = program.getTypeChecker(/*fullTypeCheckMode*/ false); @@ -1560,17 +2241,32 @@ module ts { function getSyntacticDiagnostics(filename: string) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); return program.getDiagnostics(getSourceFile(filename).getSourceFile()); } + /** + * getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors + * If '-d' enabled, report both semantic and emitter errors + */ function getSemanticDiagnostics(filename: string) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename) + filename = normalizeSlashes(filename) + var compilerOptions = program.getCompilerOptions(); + var checker = getFullTypeCheckChecker(); + var targetSourceFile = getSourceFile(filename); - return getFullTypeCheckChecker().getDiagnostics(getSourceFile(filename)); + // Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file. + // Therefore only get diagnostics for given file. + + var allDiagnostics = checker.getDiagnostics(targetSourceFile); + if (compilerOptions.declaration) { + // If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface + allDiagnostics = allDiagnostics.concat(checker.getDeclarationDiagnostics(targetSourceFile)); + } + return allDiagnostics } function getCompilerOptionsDiagnostics() { @@ -1579,293 +2275,187 @@ module ts { } /// Completion - function getValidCompletionEntryDisplayName(displayName: string, target: ScriptTarget): string { + function getValidCompletionEntryDisplayName(symbol: Symbol, target: ScriptTarget): string { + var displayName = symbol.getName(); if (displayName && displayName.length > 0) { - var firstChar = displayName.charCodeAt(0); - if (firstChar === TypeScript.CharacterCodes.singleQuote || firstChar === TypeScript.CharacterCodes.doubleQuote) { - // If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an - // invalid identifer name. We need to check if whatever was inside the quotes is actually a valid identifier name. - displayName = TypeScript.stripStartAndEndQuotes(displayName); + var 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" { var x; } | // <= request completion here, "http" should not be there) + return undefined; } - if (TypeScript.Scanner.isValidIdentifier(TypeScript.SimpleText.fromString(displayName), target)) { - return displayName; + if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && + (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) { + // 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. + displayName = displayName.substring(1, displayName.length - 1); + } + + var isValid = isIdentifierStart(displayName.charCodeAt(0), target); + for (var i = 1, n = displayName.length; isValid && i < n; i++) { + isValid = isIdentifierPart(displayName.charCodeAt(i), target); + } + + + if (isValid) { + return unescapeIdentifier(displayName); } } return undefined; } - function createCompletionEntry(symbol: Symbol): CompletionEntry { + function createCompletionEntry(symbol: Symbol, typeChecker: TypeChecker, location: Node): CompletionEntry { // Try to get a valid display name for this symbol, if we could not find one, then ignore it. // We would like to only show things that can be added after a dot, so for instance numeric properties can // not be accessed with a dot (a.1 <- invalid) - var displayName = getValidCompletionEntryDisplayName(symbol.getName(), program.getCompilerOptions().target); + var displayName = getValidCompletionEntryDisplayName(symbol, program.getCompilerOptions().target); if (!displayName) { return undefined; } - var declarations = symbol.getDeclarations(); - var firstDeclaration = [0]; + // 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. return { name: displayName, - kind: getSymbolKind(symbol), - kindModifiers: declarations ? getNodeModifiers(declarations[0]) : ScriptElementKindModifier.none + kind: getSymbolKind(symbol, typeChecker, location), + kindModifiers: getSymbolModifiers(symbol) }; } function getCompletionsAtPosition(filename: string, position: number, isMemberCompletion: boolean) { - function getCompletionEntriesFromSymbols(symbols: Symbol[], session: CompletionSession): void { - forEach(symbols, (symbol) => { - var entry = createCompletionEntry(symbol); - if (entry) { - session.entries.push(entry); - session.symbols[entry.name] = symbol; - } - }); - } + synchronizeHostData(); - function isCompletionListBlocker(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean { - // We shouldn't be getting a possition that is outside the file because - // isEntirelyInsideComment can't handle when the position is out of bounds, - // callers should be fixed, however we should be resiliant to bad inputs - // so we return true (this position is a blocker for getting completions) - if (position < 0 || position > TypeScript.fullWidth(sourceUnit)) { - return true; - } + filename = normalizeSlashes(filename); - // This method uses Fidelity completely. Some information can be reached using the AST, but not everything. - return TypeScript.Syntax.isEntirelyInsideComment(sourceUnit, position) || - TypeScript.Syntax.isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) || - isIdentifierDefinitionLocation(sourceUnit, position) || - isRightOfIllegalDot(sourceUnit, position); - } + var syntacticStart = new Date().getTime(); + var sourceFile = getSourceFile(filename); - function getContainingObjectLiteralApplicableForCompletion(sourceUnit: TypeScript.SourceUnitSyntax, position: number): TypeScript.ISyntaxElement { - // The locations in an object literal expression that are applicable for completion are property name definition locations. - var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); - - if (previousToken) { - var parent = previousToken.parent; - - switch (previousToken.kind()) { - case TypeScript.SyntaxKind.OpenBraceToken: // var x = { | - case TypeScript.SyntaxKind.CommaToken: // var x = { a: 0, | - if (parent && parent.kind() === TypeScript.SyntaxKind.SeparatedList) { - parent = parent.parent; - } - - if (parent && parent.kind() === TypeScript.SyntaxKind.ObjectLiteralExpression) { - return parent; - } - - break; - } - } + var start = new Date().getTime(); + var currentToken = getTokenAtPosition(sourceFile, position); + host.log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); + var start = new Date().getTime(); + // Completion not allowed inside comments, bail out if this is the case + var insideComment = isInsideComment(sourceFile, currentToken, position); + host.log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); + + if (insideComment) { + host.log("Returning an empty list because completion was inside a comment."); return undefined; } - function isIdentifierDefinitionLocation(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); + // The decision to provide completion depends on the previous token, so find it + // Note: previousToken can be undefined if we are the beginning of the file + var start = new Date().getTime(); + var previousToken = findPrecedingToken(position, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); - if (positionedToken) { - var containingNodeKind = TypeScript.Syntax.containingNode(positionedToken) && TypeScript.Syntax.containingNode(positionedToken).kind(); - switch (positionedToken.kind()) { - case TypeScript.SyntaxKind.CommaToken: - return containingNodeKind === TypeScript.SyntaxKind.ParameterList || - containingNodeKind === TypeScript.SyntaxKind.VariableDeclaration || - containingNodeKind === TypeScript.SyntaxKind.EnumDeclaration; // enum { foo, | - - case TypeScript.SyntaxKind.OpenParenToken: - return containingNodeKind === TypeScript.SyntaxKind.ParameterList || - containingNodeKind === TypeScript.SyntaxKind.CatchClause; - - case TypeScript.SyntaxKind.OpenBraceToken: - return containingNodeKind === TypeScript.SyntaxKind.EnumDeclaration; // enum { | - - case TypeScript.SyntaxKind.PublicKeyword: - case TypeScript.SyntaxKind.PrivateKeyword: - case TypeScript.SyntaxKind.StaticKeyword: - case TypeScript.SyntaxKind.DotDotDotToken: - return containingNodeKind === TypeScript.SyntaxKind.Parameter; - - case TypeScript.SyntaxKind.ClassKeyword: - case TypeScript.SyntaxKind.ModuleKeyword: - case TypeScript.SyntaxKind.EnumKeyword: - case TypeScript.SyntaxKind.InterfaceKeyword: - case TypeScript.SyntaxKind.FunctionKeyword: - case TypeScript.SyntaxKind.VarKeyword: - case TypeScript.SyntaxKind.GetKeyword: - case TypeScript.SyntaxKind.SetKeyword: - return true; - } - - // Previous token may have been a keyword that was converted to an identifier. - switch (positionedToken.text()) { - case "class": - case "interface": - case "enum": - case "module": - return true; - } - } - - return false; + // 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 to the previous token + if (previousToken && position <= previousToken.end && previousToken.kind === SyntaxKind.Identifier) { + var start = new Date().getTime(); + previousToken = findPrecedingToken(previousToken.pos, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start)); } - function getNonIdentifierCompleteTokenOnLeft(sourceUnit: TypeScript.SourceUnitSyntax, position: number): TypeScript.ISyntaxToken { - var positionedToken = TypeScript.Syntax.findCompleteTokenOnLeft(sourceUnit, position, /*includeSkippedTokens*/true); - - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() == TypeScript.SyntaxKind.EndOfFileToken) { - // EndOfFile token is not intresting, get the one before it - positionedToken = TypeScript. previousToken(positionedToken, /*includeSkippedTokens*/true); - } - - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() === TypeScript.SyntaxKind.IdentifierName) { - // The caret is at the end of an identifier, the decession to provide completion depends on the previous token - positionedToken = TypeScript.previousToken(positionedToken, /*includeSkippedTokens*/true); - } - - return positionedToken; + // Check if this is a valid completion location + if (previousToken && isCompletionListBlocker(previousToken)) { + host.log("Returning an empty list because completion was requested in an invalid position."); + return undefined; } - function isRightOfIllegalDot(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); - - if (positionedToken) { - switch (positionedToken.kind()) { - case TypeScript.SyntaxKind.DotToken: - var leftOfDotPositionedToken = TypeScript.previousToken(positionedToken, /*includeSkippedTokens*/true); - return leftOfDotPositionedToken && leftOfDotPositionedToken.kind() === TypeScript.SyntaxKind.NumericLiteral; - - case TypeScript.SyntaxKind.NumericLiteral: - var text = positionedToken.text(); - return text.charAt(text.length - 1) === "."; - } - } - - return false; - } - - synchronizeHostData(); - - filename = TypeScript.switchToForwardSlashes(filename); - - var sourceFile = getSourceFile(filename); - var sourceUnit = sourceFile.getSourceUnit(); - - if (isCompletionListBlocker(sourceFile.getSyntaxTree().sourceUnit(), position)) { - host.log("Returning an empty list because completion was blocked."); - return null; - } - - var node = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, /*useTrailingTriviaAsLimChar*/ true, /*forceInclusive*/ true); - - if (node && node.kind() === TypeScript.SyntaxKind.IdentifierName && - TypeScript.start(node) === TypeScript.end(node)) { - // Ignore missing name nodes - node = node.parent; - } - - var isRightOfDot = false; - if (node && - node.kind() === TypeScript.SyntaxKind.MemberAccessExpression && - TypeScript.end((node).expression) < position) { - + // Find the node where completion is requested on, in the case of a completion after a dot, it is the member access expression + // other wise, it is a request for all visible symbols in the scope, and the node is the current location + var node: Node; + var isRightOfDot: boolean; + if (previousToken && previousToken.kind === SyntaxKind.DotToken && + (previousToken.parent.kind === SyntaxKind.PropertyAccess || previousToken.parent.kind === SyntaxKind.QualifiedName)) { + node = (previousToken.parent).left; isRightOfDot = true; - node = (node).expression; } - else if (node && - node.kind() === TypeScript.SyntaxKind.QualifiedName && - TypeScript.end((node).left) < position) { - - isRightOfDot = true; - node = (node).left; - } - else if (node && node.parent && - node.kind() === TypeScript.SyntaxKind.IdentifierName && - node.parent.kind() === TypeScript.SyntaxKind.MemberAccessExpression && - (node.parent).name === node) { - - isRightOfDot = true; - node = (node.parent).expression; - } - else if (node && node.parent && - node.kind() === TypeScript.SyntaxKind.IdentifierName && - node.parent.kind() === TypeScript.SyntaxKind.QualifiedName && - (node.parent).right === node) { - - isRightOfDot = true; - node = (node.parent).left; + else { + node = currentToken; + isRightOfDot = false; } - // TODO: this is a hack for now, we need a proper walking mechanism to verify that we have the correct node - var mappedNode = getNodeAtPosition(sourceFile, TypeScript.end(node) - 1); - - Debug.assert(mappedNode, "Could not map a Fidelity node to an AST node"); - - // Get the completions + // Clear the current activeCompletionSession for this session activeCompletionSession = { filename: filename, position: position, entries: [], symbols: {}, - location: mappedNode, typeChecker: typeInfoResolver }; + host.log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); - // Right of dot member completion list + var location = getTouchingPropertyName(sourceFile, position); + // Populate the completion list + var semanticStart = new Date().getTime(); if (isRightOfDot) { - var type: ApparentType = typeInfoResolver.getApparentType(typeInfoResolver.getTypeOfNode(mappedNode)); - if (!type) { - return undefined; + // Right of dot member completion list + var symbols: Symbol[] = []; + isMemberCompletion = true; + + if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccess) { + var symbol = typeInfoResolver.getSymbolInfo(node); + + // This is an alias, follow what it aliases + if (symbol && symbol.flags & SymbolFlags.Import) { + symbol = typeInfoResolver.getAliasedSymbol(symbol); + } + + if (symbol && symbol.flags & SymbolFlags.HasExports) { + // Extract module or enum members + forEachValue(symbol.exports, symbol => { + if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } + }); + } + } + + var type = typeInfoResolver.getTypeOfNode(node); + if (type) { + // Filter private properties + forEach(type.getApparentProperties(), symbol => { + if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } + }); } - var symbols = type.getApparentProperties(); - isMemberCompletion = true; getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } else { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(sourceFile.getSyntaxTree().sourceUnit(), position); - - // Object literal expression, look up possible property names from contextual type + var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(previousToken); if (containingObjectLiteral) { - var searchPosition = Math.min(position, TypeScript.end(containingObjectLiteral)); - var path = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, searchPosition); - // Get the object literal node - - while (node && node.kind() !== TypeScript.SyntaxKind.ObjectLiteralExpression) { - node = node.parent; - } - - if (!node || node.kind() !== TypeScript.SyntaxKind.ObjectLiteralExpression) { - // AST Path look up did not result in the same node as Fidelity Syntax Tree look up. - // Once we remove AST this will no longer be a problem. - return null; - } - + // Object literal expression, look up possible property names from contextual type isMemberCompletion = true; - //// Try to get the object members form contextual typing - //var contextualMembers = compiler.getContextualMembersFromAST(node, document); - //if (contextualMembers && contextualMembers.symbols && contextualMembers.symbols.length > 0) { - // // get existing members - // var existingMembers = compiler.getVisibleMemberSymbolsFromAST(node, document); + var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); + if (!contextualType) { + return undefined; + } - // // Add filtterd items to the completion list - // getCompletionEntriesFromSymbols({ - // symbols: filterContextualMembersList(contextualMembers.symbols, existingMembers, filename, position), - // enclosingScopeSymbol: contextualMembers.enclosingScopeSymbol - // }, entries); - //} + var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); + if (contextualTypeMembers && contextualTypeMembers.length > 0) { + // Add filtered items to the completion list + var filteredMembers = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); + getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); + } } - // Get scope memebers else { + // Get scope members isMemberCompletion = false; + /// TODO filter meaning based on the current context - var symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace; - var symbols = typeInfoResolver.getSymbolsInScope(mappedNode, symbolMeanings); + var symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Import; + var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } @@ -1875,17 +2465,222 @@ module ts { if (!isMemberCompletion) { Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); } + host.log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); return { - isMemberCompletion: isMemberCompletion, + isMemberCompletion, entries: activeCompletionSession.entries }; + + function getCompletionEntriesFromSymbols(symbols: Symbol[], session: CompletionSession): void { + var start = new Date().getTime(); + forEach(symbols, symbol => { + var entry = createCompletionEntry(symbol, session.typeChecker, location); + if (entry) { + var id = escapeIdentifier(entry.name); + if (!lookUp(session.symbols, id)) { + session.entries.push(entry); + session.symbols[id] = symbol; + } + } + }); + host.log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); + } + + function isCompletionListBlocker(previousToken: Node): boolean { + var start = new Date().getTime(); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || + isIdentifierDefinitionLocation(previousToken) || + isRightOfIllegalDot(previousToken); + host.log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); + return result; + } + + function isInStringOrRegularExpressionOrTemplateLiteral(previousToken: Node): boolean { + if (previousToken.kind === SyntaxKind.StringLiteral || isTemplateLiteralKind(previousToken.kind)) { + // The position has to be either: 1. entirely within the token text, or + // 2. at the end position, and the string literal is not terminated + + var start = previousToken.getStart(); + var end = previousToken.getEnd(); + + if (start < position && position < end) { + return true; + } + else if (position === end) { + var width = end - start; + var text = previousToken.getSourceFile().text; + + // If the token is a single character, or its second-to-last charcter indicates an escape code, + // then we can immediately say that we are in the middle of an unclosed string. + if (width <= 1 || text.charCodeAt(end - 2) === CharacterCodes.backslash) { + return true; + } + + // Now check if the last character is a closing character for the token. + switch (previousToken.kind) { + case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + return text.charCodeAt(start) !== text.charCodeAt(end - 1); + + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: + return text.charCodeAt(end - 1) !== CharacterCodes.openBrace + || text.charCodeAt(end - 2) !== CharacterCodes.$; + + case SyntaxKind.TemplateTail: + return text.charCodeAt(end - 1) !== CharacterCodes.backtick; + } + + return false; + } + } + else if (previousToken.kind === SyntaxKind.RegularExpressionLiteral) { + return previousToken.getStart() < position && position < previousToken.getEnd(); + } + + return false; + } + + function getContainingObjectLiteralApplicableForCompletion(previousToken: Node): ObjectLiteral { + // The locations in an object literal expression that are applicable for completion are property name definition locations. + + if (previousToken) { + var parent = previousToken.parent; + + switch (previousToken.kind) { + case SyntaxKind.OpenBraceToken: // var x = { | + case SyntaxKind.CommaToken: // var x = { a: 0, | + if (parent && parent.kind === SyntaxKind.ObjectLiteral) { + return parent; + } + break; + } + } + + return undefined; + } + + function isFunction(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.IndexSignature: + return true; + } + return false; + } + + function isIdentifierDefinitionLocation(previousToken: Node): boolean { + if (previousToken) { + var containingNodeKind = previousToken.parent.kind; + switch (previousToken.kind) { + case SyntaxKind.CommaToken: + return containingNodeKind === SyntaxKind.VariableDeclaration || + containingNodeKind === SyntaxKind.VariableStatement || + containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { foo, | + isFunction(containingNodeKind); + + case SyntaxKind.OpenParenToken: + return containingNodeKind === SyntaxKind.CatchBlock || + isFunction(containingNodeKind); + + case SyntaxKind.OpenBraceToken: + return containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { | + containingNodeKind === SyntaxKind.InterfaceDeclaration; // interface a { | + + case SyntaxKind.SemicolonToken: + return containingNodeKind === SyntaxKind.Property && + previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration; // interface a { f; | + + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.StaticKeyword: + case SyntaxKind.DotDotDotToken: + return containingNodeKind === SyntaxKind.Parameter; + + case SyntaxKind.ClassKeyword: + case SyntaxKind.ModuleKeyword: + case SyntaxKind.EnumKeyword: + case SyntaxKind.InterfaceKeyword: + case SyntaxKind.FunctionKeyword: + case SyntaxKind.VarKeyword: + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + case SyntaxKind.ImportKeyword: + return true; + } + + // Previous token may have been a keyword that was converted to an identifier. + switch (previousToken.getText()) { + case "class": + case "interface": + case "enum": + case "module": + case "function": + case "var": + // TODO: add let and const + return true; + } + } + + return false; + } + + function isRightOfIllegalDot(previousToken: Node): boolean { + if (previousToken && previousToken.kind === SyntaxKind.NumericLiteral) { + var text = previousToken.getFullText(); + return text.charAt(text.length - 1) === "."; + } + + return false; + } + + function filterContextualMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] { + if (!existingMembers || existingMembers.length === 0) { + return contextualMemberSymbols; + } + + var existingMemberNames: Map = {}; + forEach(existingMembers, m => { + if (m.kind !== SyntaxKind.PropertyAssignment && m.kind !== SyntaxKind.ShorthandPropertyAssignment) { + // Ignore omitted expressions for missing members in the object literal + return; + } + + if (m.getStart() <= position && position <= m.getEnd()) { + // If this is the current item we are editing right now, do not filter it out + return; + } + + // TODO(jfreeman): Account for computed property name + existingMemberNames[(m.name).text] = true; + }); + + var filteredMembers: Symbol[] = []; + forEach(contextualMemberSymbols, s => { + if (!existingMemberNames[s.name]) { + filteredMembers.push(s); + } + }); + + return filteredMembers; + } } - function getCompletionEntryDetails(filename: string, position: number, entryName: string) { + function getCompletionEntryDetails(filename: string, position: number, entryName: string): CompletionEntryDetails { // Note: No need to call synchronizeHostData, as we have captured all the data we need - // in the getCompletionsAtPosition erlier - filename = TypeScript.switchToForwardSlashes(filename); + // in the getCompletionsAtPosition earlier + filename = normalizeSlashes(filename); + + var sourceFile = getSourceFile(filename); var session = activeCompletionSession; @@ -1894,18 +2689,22 @@ module ts { return undefined; } - var symbol = lookUp(activeCompletionSession.symbols, entryName); + var symbol = lookUp(activeCompletionSession.symbols, escapeIdentifier(entryName)); if (symbol) { - var type = session.typeChecker.getTypeOfSymbol(symbol); - Debug.assert(type, "Could not find type for symbol"); - var completionEntry = createCompletionEntry(symbol); + var location = getTouchingPropertyName(sourceFile, position); + var completionEntry = createCompletionEntry(symbol, session.typeChecker, location); + // 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. + Debug.assert(session.typeChecker.getNarrowedTypeOfSymbol(symbol, location) !== undefined, "Could not find type for symbol"); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), location, session.typeChecker, location, SemanticMeaning.All); return { name: entryName, - kind: completionEntry.kind, + kind: displayPartsDocumentationsAndSymbolKind.symbolKind, kindModifiers: completionEntry.kindModifiers, - type: session.typeChecker.typeToString(type, session.location), - fullSymbolName: typeInfoResolver.symbolToString(symbol, session.location), - docComment: "" + displayParts: displayPartsDocumentationsAndSymbolKind.displayParts, + documentation: displayPartsDocumentationsAndSymbolKind.documentation }; } else { @@ -1914,36 +2713,17 @@ module ts { name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - type: undefined, - fullSymbolName: entryName, - docComment: undefined + displayParts: [displayPart(entryName, SymbolDisplayPartKind.keyword)], + documentation: undefined }; } } - function getNodeAtPosition(sourceFile: SourceFile, position: number) { - var current: Node = sourceFile; - outer: while (true) { - // find the child that has this - for (var i = 0, n = current.getChildCount(); i < n; i++) { - var child = current.getChildAt(i); - if (child.getStart() <= position && position < child.getEnd()) { - current = child; - continue outer; - } - if (child.end > position) { - break; - } - } - return current; - } - } - function getContainerNode(node: Node): Node { while (true) { node = node.parent; if (!node) { - return node; + return undefined; } switch (node.kind) { case SyntaxKind.SourceFile: @@ -1961,29 +2741,78 @@ module ts { } } - function getSymbolKind(symbol: Symbol): string { + // TODO(drosen): use contextual SemanticMeaning. + function getSymbolKind(symbol: Symbol, typeResolver: TypeChecker, location?: Node): string { var flags = symbol.getFlags(); - if (flags & SymbolFlags.Module) return ScriptElementKind.moduleElement; if (flags & SymbolFlags.Class) return ScriptElementKind.classElement; - if (flags & SymbolFlags.Interface) return ScriptElementKind.interfaceElement; if (flags & SymbolFlags.Enum) return ScriptElementKind.enumElement; - if (flags & SymbolFlags.Variable) return ScriptElementKind.variableElement; - if (flags & SymbolFlags.Function) return ScriptElementKind.functionElement; + if (flags & SymbolFlags.TypeAlias) return ScriptElementKind.typeElement; + if (flags & SymbolFlags.Interface) return ScriptElementKind.interfaceElement; + if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; + + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location); + if (result === ScriptElementKind.unknown) { + if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; + if (flags & SymbolFlags.EnumMember) return ScriptElementKind.variableElement; + if (flags & SymbolFlags.Import) return ScriptElementKind.alias; + } + + return result; + } + + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol: Symbol, flags: SymbolFlags, typeResolver: TypeChecker, location: Node) { + if (typeResolver.isUndefinedSymbol(symbol)) { + return ScriptElementKind.variableElement; + } + if (typeResolver.isArgumentsSymbol(symbol)) { + return ScriptElementKind.localVariableElement; + } + 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, declaration => isLet(declaration))) { + 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.Property) return ScriptElementKind.memberVariableElement; - if (flags & SymbolFlags.IndexSignature) return ScriptElementKind.indexSignatureElement; - if (flags & SymbolFlags.ConstructSignature) return ScriptElementKind.constructSignatureElement; - if (flags & SymbolFlags.CallSignature) return ScriptElementKind.callSignatureElement; if (flags & SymbolFlags.Constructor) return ScriptElementKind.constructorImplementationElement; - if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; - if (flags & SymbolFlags.EnumMember) return ScriptElementKind.variableElement; + + if (flags & SymbolFlags.Property) { + if (flags & SymbolFlags.UnionProperty) { + // If union property is result of union of non method (property/accessors/variables), it is labeled as property + var unionPropertyKind = forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => { + var 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 + var typeOfUnionProperty = typeInfoResolver.getNarrowedTypeOfSymbol(symbol, location); + if (typeOfUnionProperty.getCallSignatures().length) { + return ScriptElementKind.memberFunctionElement; + } + return ScriptElementKind.memberVariableElement; + } + return unionPropertyKind; + } + return ScriptElementKind.memberVariableElement; + } return ScriptElementKind.unknown; } - + function getTypeKind(type: Type): string { var flags = type.getFlags(); @@ -1997,52 +2826,422 @@ module ts { return ScriptElementKind.unknown; } - function getNodeModifiers(node: Node): string { - var flags = node.flags; - var result: string[] = []; - - if (flags & NodeFlags.Private) result.push(ScriptElementKindModifier.privateMemberModifier); - if (flags & NodeFlags.Public) result.push(ScriptElementKindModifier.publicMemberModifier); - if (flags & NodeFlags.Static) result.push(ScriptElementKindModifier.staticModifier); - if (flags & NodeFlags.Export) result.push(ScriptElementKindModifier.exportedModifier); - if (isInAmbientContext(node)) result.push(ScriptElementKindModifier.ambientModifier); - - return result.length > 0 ? result.join(',') : ScriptElementKindModifier.none; + function getNodeKind(node: Node): string { + switch (node.kind) { + case SyntaxKind.ModuleDeclaration: return ScriptElementKind.moduleElement; + case SyntaxKind.ClassDeclaration: 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 isConst(node) + ? ScriptElementKind.constElement + : node.flags & NodeFlags.Let + ? ScriptElementKind.letElement + : ScriptElementKind.variableElement; + case SyntaxKind.FunctionDeclaration: return ScriptElementKind.functionElement; + case SyntaxKind.GetAccessor: return ScriptElementKind.memberGetAccessorElement; + case SyntaxKind.SetAccessor: return ScriptElementKind.memberSetAccessorElement; + case SyntaxKind.Method: return ScriptElementKind.memberFunctionElement; + case SyntaxKind.Property: 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.variableElement; + case SyntaxKind.Parameter: return (node.flags & NodeFlags.AccessibilityModifier) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + } + return ScriptElementKind.unknown; } - /// QuickInfo - function getTypeAtPosition(fileName: string, position: number): TypeInfo { + function getSymbolModifiers(symbol: Symbol): string { + return symbol && symbol.declarations && symbol.declarations.length > 0 + ? getNodeModifiers(symbol.declarations[0]) + : ScriptElementKindModifier.none; + } + + function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol: Symbol, sourceFile: SourceFile, enclosingDeclaration: Node, + typeResolver: TypeChecker, location: Node, + // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location + semanticMeaning = getMeaningFromLocation(location)) { + var displayParts: SymbolDisplayPart[] = []; + var documentation: SymbolDisplayPart[]; + var symbolFlags = symbol.flags; + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); + var hasAddedSymbolInfo: boolean; + // Class at constructor site need to be shown as constructor apart from property,method, vars + if (symbolKind !== ScriptElementKind.unknown || symbolFlags & SymbolFlags.Class || symbolFlags & SymbolFlags.Import) { + // 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; + } + + var type = typeResolver.getNarrowedTypeOfSymbol(symbol, location); + if (type) { + if (location.parent && location.parent.kind === SyntaxKind.PropertyAccess) { + var right = (location.parent).right; + // 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.kind === SyntaxKind.Missing)){ + location = location.parent; + } + } + + // try get the call/construct signature from the type if it matches + var callExpression: CallExpression; + if (location.kind === SyntaxKind.CallExpression || location.kind === SyntaxKind.NewExpression) { + callExpression = location; + } + else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { + callExpression = location.parent; + } + + if (callExpression) { + var candidateSignatures: Signature[] = []; + signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures); + if (!signature && candidateSignatures.length) { + // Use the first candidate: + signature = candidateSignatures[0]; + } + + var useConstructSignatures = callExpression.kind === SyntaxKind.NewExpression || callExpression.func.kind === SyntaxKind.SuperKeyword; + var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); + + if (!contains(allSignatures, signature.target || signature)) { + // Get the first signature if there + 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.Import) { + symbolKind = ScriptElementKind.alias; + displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + displayParts.push(textPart(symbolKind)); + displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + 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.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)) { + displayParts.push.apply(displayParts, symbolToDisplayParts(typeResolver, 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 + var signature: Signature; + var functionDeclaration = location.parent; + var allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getConstructSignatures() : type.getCallSignatures(); + if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { + signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); + } + else { + signature = allSignatures[0]; + } + + if (functionDeclaration.kind === SyntaxKind.Constructor) { + // show (constructor) Type(...) signature + addPrefixForAnyFunctionOrVar(type.symbol, ScriptElementKind.constructorImplementationElement); + } + 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) { + 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); + displayParts.push(spacePart()); + displayParts.push(punctuationPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); + displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); + } + if (symbolFlags & SymbolFlags.Enum) { + addNewLineIfDisplayPartsExist(); + if (forEach(symbol.declarations, declaration => isConstEnumDeclaration(declaration))) { + displayParts.push(keywordPart(SyntaxKind.ConstKeyword)); + displayParts.push(spacePart()); + } + displayParts.push(keywordPart(SyntaxKind.EnumKeyword)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } + if (symbolFlags & SymbolFlags.Module) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(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 + var signatureDeclaration = getDeclarationOfKind(symbol, SyntaxKind.TypeParameter).parent; + var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); + if (signatureDeclaration.kind === SyntaxKind.ConstructSignature) { + displayParts.push(keywordPart(SyntaxKind.NewKeyword)); + displayParts.push(spacePart()); + } + else if (signatureDeclaration.kind !== SyntaxKind.CallSignature && signatureDeclaration.name) { + addFullSymbolName(signatureDeclaration.symbol); + } + displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, sourceFile, TypeFormatFlags.WriteTypeArgumentsOfSignature)); + } + } + if (symbolFlags & SymbolFlags.EnumMember) { + addPrefixForAnyFunctionOrVar(symbol, "enum member"); + var declaration = symbol.declarations[0]; + if (declaration.kind === SyntaxKind.EnumMember) { + var constantValue = typeResolver.getEnumMemberValue(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.Import) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(SyntaxKind.ImportKeyword)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + ts.forEach(symbol.declarations, declaration => { + if (declaration.kind === SyntaxKind.ImportDeclaration) { + var importDeclaration = declaration; + if (importDeclaration.externalModuleName) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); + displayParts.push(keywordPart(SyntaxKind.RequireKeyword)); + displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + displayParts.push(displayPart(getTextOfNode(importDeclaration.externalModuleName), SymbolDisplayPartKind.stringLiteral)); + displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + } + else { + var internalAliasSymbol = typeResolver.getSymbolInfo(importDeclaration.entityName); + if (internalAliasSymbol) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); + addFullSymbolName(internalAliasSymbol, enclosingDeclaration); + } + } + return true; + } + }); + } + if (!hasAddedSymbolInfo) { + if (symbolKind !== ScriptElementKind.unknown) { + if (type) { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + // For properties, variables and local vars: show the type + if (symbolKind === ScriptElementKind.memberVariableElement || + symbolFlags & SymbolFlags.Variable || + symbolKind === ScriptElementKind.localVariableElement) { + 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) { + var typeParameterParts = mapToDisplayParts(writer => { + typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + }); + displayParts.push.apply(displayParts, typeParameterParts); + } + else { + displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, type, enclosingDeclaration)); + } + } + else if (symbolFlags & SymbolFlags.Function || + symbolFlags & SymbolFlags.Method || + symbolFlags & SymbolFlags.Constructor || + symbolFlags & SymbolFlags.Signature || + symbolFlags & SymbolFlags.Accessor || + symbolKind === ScriptElementKind.memberFunctionElement) { + var allSignatures = type.getCallSignatures(); + addSignatureDisplayParts(allSignatures[0], allSignatures); + } + } + } + else { + symbolKind = getSymbolKind(symbol, typeResolver, location); + } + } + + if (!documentation) { + documentation = symbol.getDocumentationComment(); + } + + return { displayParts, documentation, symbolKind }; + + function addNewLineIfDisplayPartsExist() { + if (displayParts.length) { + displayParts.push(lineBreakPart()); + } + } + + function addFullSymbolName(symbol: Symbol, enclosingDeclaration?: Node) { + var fullSymbolDisplayParts = symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined, + SymbolFormatFlags.WriteTypeParametersOrArguments | SymbolFormatFlags.UseOnlyExternalAliasing); + displayParts.push.apply(displayParts, fullSymbolDisplayParts); + } + + function addPrefixForAnyFunctionOrVar(symbol: Symbol, symbolKind: string) { + addNewLineIfDisplayPartsExist(); + if (symbolKind) { + displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + displayParts.push(textPart(symbolKind)); + displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } + } + + function addSignatureDisplayParts(signature: Signature, allSignatures: Signature[], flags?: TypeFormatFlags) { + displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, 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) { + var typeParameterParts = mapToDisplayParts(writer => { + typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + }); + displayParts.push.apply(displayParts, typeParameterParts); + } + } + + function getQuickInfoAtPosition(fileName: string, position: number): QuickInfo { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); - var node = getNodeAtPosition(sourceFile, position); + var node = getTouchingPropertyName(sourceFile, position); if (!node) { return undefined; } var symbol = typeInfoResolver.getSymbolInfo(node); - var type = symbol && typeInfoResolver.getTypeOfSymbol(symbol); - if (type) { - return new TypeInfo( - new TypeScript.MemberNameString(typeInfoResolver.typeToString(type)), - "", typeInfoResolver.symbolToString(symbol, getContainerNode(node)), - getSymbolKind(symbol), TypeScript.TextSpan.fromBounds(node.pos, node.end)); + if (!symbol) { + // Try getting just type at this position and show + switch (node.kind) { + case SyntaxKind.Identifier: + case SyntaxKind.PropertyAccess: + case SyntaxKind.QualifiedName: + case SyntaxKind.ThisKeyword: + case SyntaxKind.SuperKeyword: + // For the identifiers/this/super etc get the type at position + var type = typeInfoResolver.getTypeOfNode(node); + if (type) { + return { + kind: ScriptElementKind.unknown, + kindModifiers: ScriptElementKindModifier.none, + textSpan: new TextSpan(node.getStart(), node.getWidth()), + displayParts: typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)), + documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined + }; + } + } + + return undefined; } - return undefined; + var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node); + return { + kind: displayPartsDocumentationsAndKind.symbolKind, + kindModifiers: getSymbolModifiers(symbol), + textSpan: new TextSpan(node.getStart(), node.getWidth()), + displayParts: displayPartsDocumentationsAndKind.displayParts, + documentation: displayPartsDocumentationsAndKind.documentation + }; } /// Goto definition - function getDefinitionAtPosition(filename: string, position: number): DefinitionInfo[]{ + function getDefinitionAtPosition(filename: string, position: number): DefinitionInfo[] { function getDefinitionInfo(node: Node, symbolKind: string, symbolName: string, containerName: string): DefinitionInfo { - return new DefinitionInfo( - node.getSourceFile().filename, - TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()), - symbolKind, - symbolName, - undefined, - containerName); + return { + fileName: node.getSourceFile().filename, + textSpan: TextSpan.fromBounds(node.getStart(), node.getEnd()), + kind: symbolKind, + name: symbolName, + containerKind: undefined, + containerName + }; } function tryAddSignature(signatureDeclarations: Declaration[], selectConstructors: boolean, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { @@ -2053,7 +3252,7 @@ module ts { if ((selectConstructors && d.kind === SyntaxKind.Constructor) || (!selectConstructors && (d.kind === SyntaxKind.FunctionDeclaration || d.kind === SyntaxKind.Method))) { declarations.push(d); - if ((d).body) definition = d; + if ((d).body) definition = d; } }); @@ -2092,10 +3291,10 @@ module ts { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); var sourceFile = getSourceFile(filename); - var node = getNodeAtPosition(sourceFile, position); + var node = getTouchingPropertyName(sourceFile, position); if (!node) { return undefined; } @@ -2110,12 +3309,16 @@ module ts { /// Triple slash reference comments var comment = forEach(sourceFile.referencedFiles, r => (r.pos <= position && position < r.end) ? r : undefined); if (comment) { - var targetFilename = normalizePath(combinePaths(getDirectoryPath(filename), comment.filename)); - if (program.getSourceFile(targetFilename)) { - return [new DefinitionInfo( - targetFilename, TypeScript.TextSpan.fromBounds(0, 0), - ScriptElementKind.scriptElement, - comment.filename, undefined, undefined)]; + var referenceFile = tryResolveScriptReference(program, sourceFile, comment); + if (referenceFile) { + return [{ + fileName: referenceFile.filename, + textSpan: TextSpan.fromBounds(0, 0), + kind: ScriptElementKind.scriptElement, + name: comment.filename, + containerName: undefined, + containerKind: undefined + }]; } return undefined; } @@ -2124,18 +3327,34 @@ module ts { // 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 || !(symbol.getDeclarations())) { + if (!symbol) { return undefined; } var result: DefinitionInfo[] = []; + // 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) { + var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + var shorthandDeclarations = shorthandSymbol.getDeclarations(); + var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver); + var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol); + var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node); + forEach(shorthandDeclarations, declaration => { + result.push(getDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); + }); + return result + } + var declarations = symbol.getDeclarations(); - var symbolName = typeInfoResolver.symbolToString(symbol, node); - var symbolKind = getSymbolKind(symbol); + var symbolName = typeInfoResolver.symbolToString(symbol); // Do not get scoped name, just the name of the symbol + var symbolKind = getSymbolKind(symbol, typeInfoResolver); var containerSymbol = symbol.parent; var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; - var containerKind = containerSymbol ? getSymbolKind(symbol) : ""; if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { @@ -2148,23 +3367,40 @@ module ts { return result; } - /// Find references + /// References and Occurrences function getOccurrencesAtPosition(filename: string, position: number): ReferenceEntry[] { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); var sourceFile = getSourceFile(filename); - var node = getNodeAtPosition(sourceFile, position); + var node = getTouchingWord(sourceFile, position); if (!node) { return undefined; } - if (node.kind === SyntaxKind.Identifier || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return getReferencesForNode(node, [sourceFile]); + if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ThisKeyword || node.kind === SyntaxKind.SuperKeyword || + isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + return getReferencesForNode(node, [sourceFile], /*findInStrings:*/ false, /*findInComments:*/ false); } 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.TryKeyword: case SyntaxKind.CatchKeyword: case SyntaxKind.FinallyKeyword: @@ -2184,14 +3420,212 @@ module ts { } break; case SyntaxKind.BreakKeyword: - if (hasKind(node.parent, SyntaxKind.BreakStatement)) { - return getBreakStatementOccurences(node.parent); + case SyntaxKind.ContinueKeyword: + if (hasKind(node.parent, SyntaxKind.BreakStatement) || hasKind(node.parent, SyntaxKind.ContinueStatement)) { + return getBreakOrContinueStatementOccurences(node.parent); } break; + case SyntaxKind.ForKeyword: + if (hasKind(node.parent, SyntaxKind.ForStatement) || hasKind(node.parent, SyntaxKind.ForInStatement)) { + 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); + } } return undefined; + function getIfElseOccurrences(ifStatement: IfStatement): ReferenceEntry[] { + var 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) { + var children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], SyntaxKind.IfKeyword); + + // Generally the 'else' keyword is second-to-last, so we traverse backwards. + for (var 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; + } + + var result: ReferenceEntry[] = []; + + // 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 (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === SyntaxKind.ElseKeyword && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + + var shouldHighlightNextKeyword = true; + + // Avoid recalculating getStart() by iterating backwards. + for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!isWhiteSpace(sourceFile.text.charCodeAt(j))) { + shouldHighlightNextKeyword = false; + break; + } + } + + if (shouldHighlightNextKeyword) { + result.push({ + fileName: filename, + textSpan: TextSpan.fromBounds(elseKeyword.getStart(), ifKeyword.end), + isWriteAccess: false + }); + i++; // skip the next keyword + continue; + } + } + + // Ordinary case: just highlight the keyword. + result.push(getReferenceEntryFromNode(keywords[i])); + } + + return result; + } + + function getReturnOccurrences(returnStatement: ReturnStatement): ReferenceEntry[] { + var func = getContainingFunction(returnStatement); + + // If we didn't find a containing function with a block body, bail out. + if (!(func && hasKind(func.body, SyntaxKind.FunctionBlock))) { + return undefined; + } + + var 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, getReferenceEntryFromNode); + } + + function getThrowOccurrences(throwStatement: ThrowStatement) { + var owner = getThrowStatementOwner(throwStatement); + + if (!owner) { + return undefined; + } + + var 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 (owner.kind === SyntaxKind.FunctionBlock) { + forEachReturnStatement(owner, returnStatement => { + pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); + }); + } + + return map(keywords, getReferenceEntryFromNode); + } + + /** + * Aggregates all throw-statements within this node *without* crossing + * into function boundaries and try-blocks with catch-clauses. + */ + function aggregateOwnedThrowStatements(node: Node): ThrowStatement[] { + var 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) { + var tryStatement = node; + + if (tryStatement.catchBlock) { + aggregate(tryStatement.catchBlock); + } + 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 (!isAnyFunction(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 { + var child: Node = throwStatement; + + while (child.parent) { + var parent = child.parent; + + if (parent.kind === SyntaxKind.FunctionBlock || 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) { + var tryStatement = parent; + + if (tryStatement.tryBlock === child && tryStatement.catchBlock) { + return child; + } + } + + child = parent; + } + + return undefined; + } + function getTryCatchFinallyOccurrences(tryStatement: TryStatement): ReferenceEntry[] { var keywords: Node[] = []; @@ -2205,7 +3639,34 @@ module ts { pushKeywordIf(keywords, tryStatement.finallyBlock.getFirstToken(), SyntaxKind.FinallyKeyword); } - return keywordsToReferenceEntries(keywords); + return map(keywords, getReferenceEntryFromNode); + } + + function getLoopBreakContinueOccurrences(loopNode: IterationStatement): ReferenceEntry[] { + var 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) { + var loopTokens = loopNode.getChildren(); + + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], SyntaxKind.WhileKeyword)) { + break; + } + } + } + } + + var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + + forEach(breaksAndContinues, statement => { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword, SyntaxKind.ContinueKeyword); + } + }); + + return map(keywords, getReferenceEntryFromNode); } function getSwitchCaseDefaultOccurrences(switchStatement: SwitchStatement) { @@ -2213,68 +3674,125 @@ module ts { pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword); - // Go through each clause in the switch statement, collecting the clause keywords. + // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. forEach(switchStatement.clauses, clause => { pushKeywordIf(keywords, clause.getFirstToken(), SyntaxKind.CaseKeyword, SyntaxKind.DefaultKeyword); - // For each clause, also recursively traverse the statements where we can find analogous breaks. - forEachChild(clause, function aggregateBreakKeywords(node: Node): void { - switch (node.kind) { - case SyntaxKind.BreakStatement: - // If the break statement has a label, it cannot be part of a switch block. - if (!(node).label) { - pushKeywordIf(keywords, node.getFirstToken(), SyntaxKind.BreakKeyword); - } - // Fall through - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.SwitchStatement: - return; - } + var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - // Do not cross function boundaries. - if (!isAnyFunction(node)) { - forEachChild(node, aggregateBreakKeywords); + forEach(breaksAndContinues, statement => { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword); } }); }); - return keywordsToReferenceEntries(keywords); + return map(keywords, getReferenceEntryFromNode); } - function getBreakStatementOccurences(breakStatement: BreakOrContinueStatement): ReferenceEntry[]{ - // TODO (drosen): Deal with labeled statements. - if (breakStatement.label) { - return undefined; - } - - for (var owner = node.parent; owner; owner = owner.parent) { + function getBreakOrContinueStatementOccurences(breakOrContinueStatement: BreakOrContinueStatement): ReferenceEntry[]{ + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + + if (owner) { switch (owner.kind) { case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.DoStatement: case SyntaxKind.WhileStatement: - // TODO (drosen): Handle loops! - return undefined; - + return getLoopBreakContinueOccurrences(owner) case SyntaxKind.SwitchStatement: return getSwitchCaseDefaultOccurrences(owner); - default: - if (isAnyFunction(owner)) { - return undefined; - } } } return undefined; } + function aggregateAllBreakAndContinueStatements(node: Node): BreakOrContinueStatement[] { + var 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 (!isAnyFunction(node)) { + forEachChild(node, aggregate); + } + }; + } + + function ownsBreakOrContinueStatement(owner: Node, statement: BreakOrContinueStatement): boolean { + var actualOwner = getBreakOrContinueOwner(statement); + + return actualOwner && actualOwner === owner; + } + + function getBreakOrContinueOwner(statement: BreakOrContinueStatement): Node { + for (var 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.WhileStatement: + case SyntaxKind.DoStatement: + if (!statement.label || isLabeledBy(node, statement.label.text)) { + return node; + } + break; + default: + // Don't cross function boundaries. + if (isAnyFunction(node)) { + return undefined; + } + break; + } + } + + return undefined; + } + + function getConstructorOccurrences(constructorDeclaration: ConstructorDeclaration): ReferenceEntry[] { + var declarations = constructorDeclaration.symbol.getDeclarations() + + var keywords: Node[] = []; + + forEach(declarations, declaration => { + forEach(declaration.getChildren(), token => { + return pushKeywordIf(keywords, token, SyntaxKind.ConstructorKeyword); + }); + }); + + return map(keywords, getReferenceEntryFromNode); + } + + function getGetAndSetOccurrences(accessorDeclaration: AccessorDeclaration): ReferenceEntry[] { + var keywords: Node[] = []; + + tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.GetAccessor); + tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.SetAccessor); + + return map(keywords, getReferenceEntryFromNode); + + function tryPushAccessorKeyword(accessorSymbol: Symbol, accessorKind: SyntaxKind): void { + var accessor = getDeclarationOfKind(accessorSymbol, accessorKind); + + if (accessor) { + forEach(accessor.getChildren(), child => pushKeywordIf(keywords, child, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword)); + } + } + } + // returns true if 'node' is defined and has a matching 'kind'. function hasKind(node: Node, kind: SyntaxKind) { - return !!(node && node.kind === kind); + return node !== undefined && node.kind === kind; } // Null-propagating 'parent' function. @@ -2282,51 +3800,56 @@ module ts { return node && node.parent; } - function pushKeywordIf(keywordList: Node[], token: Node, ...expected: SyntaxKind[]): void { - if (!token) { - return; - } - - if (contains(expected, token.kind)) { + function pushKeywordIf(keywordList: Node[], token: Node, ...expected: SyntaxKind[]): boolean { + if (token && contains(expected, token.kind)) { keywordList.push(token); + return true; } - } - function keywordsToReferenceEntries(keywords: Node[]): ReferenceEntry[]{ - return map(keywords, keyword => - new ReferenceEntry(filename, TypeScript.TextSpan.fromBounds(keyword.getStart(), keyword.end), /* isWriteAccess */ false) - ); + return false; } } - function getReferencesAtPosition(filename: string, position: number): ReferenceEntry[] { + function findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] { + return findReferences(fileName, position, findInStrings, findInComments); + } + + function getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] { + return findReferences(fileName, position, /*findInStrings:*/ false, /*findInComments:*/ false); + } + + function findReferences(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): ReferenceEntry[] { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getSourceFile(filename); + fileName = normalizeSlashes(fileName); + var sourceFile = getSourceFile(fileName); - var node = getNodeAtPosition(sourceFile, position); + var node = getTouchingPropertyName(sourceFile, position); if (!node) { return undefined; } if (node.kind !== SyntaxKind.Identifier && + // TODO (drosen): This should be enabled in a later release - currently breaks rename. + //node.kind !== SyntaxKind.ThisKeyword && + //node.kind !== SyntaxKind.SuperKeyword && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } - return getReferencesForNode(node, program.getSourceFiles()); + Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.NumericLiteral || node.kind === SyntaxKind.StringLiteral); + return getReferencesForNode(node, program.getSourceFiles(), findInStrings, findInComments); } - function getReferencesForNode(node: Node, sourceFiles : SourceFile[]): ReferenceEntry[] { + function getReferencesForNode(node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean): ReferenceEntry[] { // Labels if (isLabelName(node)) { if (isJumpStatementTarget(node)) { var 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, just return a set of one for the current node. - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [getReferenceEntry(node)]; + return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [getReferenceEntryFromNode(node)]; } else { // it is a label definition and not a target, search within the parent labeledStatement @@ -2334,58 +3857,86 @@ module ts { } } + if (node.kind === SyntaxKind.ThisKeyword) { + return getReferencesForThisKeyword(node, sourceFiles); + } + + if (node.kind === SyntaxKind.SuperKeyword) { + return getReferencesForSuperKeyword(node); + } + var symbol = typeInfoResolver.getSymbolInfo(node); // Could not find a symbol e.g. unknown identifier if (!symbol) { - // Even if we did not find a symbol, we have an identifer, so there is at least - // one reference that we know of. return than instead of undefined. - return [getReferenceEntry(node)]; + // Even if we did not find a symbol, we have an identifier, so there is at least + // one reference that we know of. return that instead of undefined. + return [getReferenceEntryFromNode(node)]; } - // the symbol was an internal symbol and does not have a declaration e.g.undefined symbol - if (!symbol.getDeclarations()) { + var 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; } var result: ReferenceEntry[]; // Compute the meaning from the location and the symbol it references - var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), symbol.getDeclarations()); + var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); // Get the text to search for, we need to normalize it as external module names will have quote - var symbolName = getNormalizedSymbolName(symbol); + var declaredName = getDeclaredName(symbol); + // 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). var scope = getSymbolScope(symbol); if (scope) { result = []; - getReferencesInNode(scope, symbol, symbolName, node, searchMeaning, result); + getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); } else { + var internedName = getInternedName(symbol, declarations) forEach(sourceFiles, sourceFile => { cancellationToken.throwIfCancellationRequested(); - if (lookUp(sourceFile.identifiers, symbolName)) { + if (lookUp(sourceFile.identifiers, internedName)) { result = result || []; - getReferencesInNode(sourceFile, symbol, symbolName, node, searchMeaning, result); + getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); } }); } return result; - function getNormalizedSymbolName(symbol: Symbol): string { - // Special case for function expressions, whose names are solely local to their bodies. - var functionExpression = getDeclarationOfKind(symbol, SyntaxKind.FunctionExpression); + function getDeclaredName(symbol: Symbol) { + var name = typeInfoResolver.symbolToString(symbol); + return stripQuotes(name); + } + + function getInternedName(symbol: Symbol, declarations: Declaration[]): string { + // Special case for function expressions, whose names are solely local to their bodies. + var functionExpression = forEach(declarations, d => d.kind === SyntaxKind.FunctionExpression ? d : undefined); + + // When a name gets interned into a SourceFile's 'identifiers' Map, + // its name is escaped and stored in the same way its symbol name/identifier + // name should be stored. Function expressions, however, are a special case, + // because despite sometimes having a name, the binder unconditionally binds them + // to a symbol with the name "__function". if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } else { var name = symbol.name; } - + + return stripQuotes(name); + } + + function stripQuotes(name: string) { var length = name.length; if (length >= 2 && name.charCodeAt(0) === CharacterCodes.doubleQuote && name.charCodeAt(length - 1) === CharacterCodes.doubleQuote) { return name.substring(1, length - 1); @@ -2398,7 +3949,7 @@ module ts { if (symbol.getFlags() && (SymbolFlags.Property | SymbolFlags.Method)) { var privateDeclaration = forEach(symbol.getDeclarations(), d => (d.flags & NodeFlags.Private) ? d : undefined); if (privateDeclaration) { - return privateDeclaration.parent; + return getAncestor(privateDeclaration, SyntaxKind.ClassDeclaration); } } @@ -2410,22 +3961,28 @@ module ts { var scope: Node = undefined; var declarations = symbol.getDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - var container = getContainerNode(declarations[i]); + if (declarations) { + for (var i = 0, n = declarations.length; i < n; i++) { + var container = getContainerNode(declarations[i]); - if (scope && scope !== container) { - // Different declarations have different containers, bail out - return undefined; + 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; } - - 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; @@ -2457,8 +4014,8 @@ module ts { // before and after it have to be a non-identifier char). var endPosition = position + symbolNameLength; - if ((position === 0 || !isIdentifierPart(text.charCodeAt(position - 1), ScriptTarget.ES5)) && - (endPosition === sourceLength || !isIdentifierPart(text.charCodeAt(endPosition), ScriptTarget.ES5))) { + 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); } @@ -2476,7 +4033,7 @@ module ts { forEach(possiblePositions, position => { cancellationToken.throwIfCancellationRequested(); - var node = getNodeAtPosition(sourceFile, position); + var node = getTouchingWord(sourceFile, position); if (!node || node.getWidth() !== labelName.length) { return; } @@ -2484,7 +4041,7 @@ module ts { // 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)) { - result.push(getReferenceEntry(node)); + result.push(getReferenceEntryFromNode(node)); } }); return result; @@ -2516,11 +4073,20 @@ module ts { 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: SearchMeaning, result: ReferenceEntry[]): void { + /** 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: ReferenceEntry[]): void { var sourceFile = container.getSourceFile(); + var tripleSlashDirectivePrefixRegex = /^\/\/\/\s* { cancellationToken.throwIfCancellationRequested(); - var referenceLocation = getNodeAtPosition(sourceFile, position); + var 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 ((findInStrings && isInString(position)) || + (findInComments && isInComment(position))) { + result.push({ + fileName: sourceFile.filename, + textSpan: new TextSpan(position, searchText.length), + isWriteAccess: false + }); + } return; } @@ -2541,15 +4118,172 @@ module ts { } var referenceSymbol = typeInfoResolver.getSymbolInfo(referenceLocation); + if (referenceSymbol) { + var referenceSymbolDeclaration = referenceSymbol.valueDeclaration; + var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); + if (isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation)) { + result.push(getReferenceEntryFromNode(referenceLocation)); + } + /* 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) { + result.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); + } + } + }); + } - // 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 (!referenceSymbol || !(referenceSymbol.getDeclarations())) { + function isInString(position: number) { + var token = getTokenAtPosition(sourceFile, position); + return token && token.kind === SyntaxKind.StringLiteral && position > token.getStart(); + } + + function isInComment(position: number) { + var token = getTokenAtPosition(sourceFile, position); + if (token && position < token.getStart()) { + // First, we have to see if this position actually landed in a comment. + var commentRanges = getLeadingCommentRanges(sourceFile.text, token.pos); + + // Then we want to make sure that it wasn't in a "///<" directive comment + // We don't want to unintentionally update a file name. + return forEach(commentRanges, c => { + if (c.pos < position && position < c.end) { + var commentText = sourceFile.text.substring(c.pos, c.end); + if (!tripleSlashDirectivePrefixRegex.test(commentText)) { + return true; + } + } + }); + } + + return false; + } + } + + function getReferencesForSuperKeyword(superKeyword: Node): ReferenceEntry[]{ + var searchSpaceNode = getSuperContainer(superKeyword); + if (!searchSpaceNode) { + return undefined; + } + // Whether 'super' occurs in a static context within a class. + var staticFlag = NodeFlags.Static; + + switch (searchSpaceNode.kind) { + case SyntaxKind.Property: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + staticFlag &= searchSpaceNode.flags; + searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class + break; + default: + return undefined; + } + + var result: ReferenceEntry[] = []; + + var sourceFile = searchSpaceNode.getSourceFile(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); + forEach(possiblePositions, position => { + cancellationToken.throwIfCancellationRequested(); + + var node = getTouchingWord(sourceFile, position); + + if (!node || node.kind !== SyntaxKind.SuperKeyword) { + return; + } + + var container = getSuperContainer(node); + + // 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 && (NodeFlags.Static & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { + result.push(getReferenceEntryFromNode(node)); + } + }); + + return result; + } + + function getReferencesForThisKeyword(thisOrSuperKeyword: Node, sourceFiles: SourceFile[]): ReferenceEntry[] { + var searchSpaceNode = getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); + + // Whether 'this' occurs in a static context within a class. + var staticFlag = NodeFlags.Static; + + switch (searchSpaceNode.kind) { + case SyntaxKind.Property: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + staticFlag &= searchSpaceNode.flags + 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; + default: + return undefined; + } + + var result: ReferenceEntry[] = []; + + if (searchSpaceNode.kind === SyntaxKind.SourceFile) { + forEach(sourceFiles, sourceFile => { + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); + }); + } + else { + var sourceFile = searchSpaceNode.getSourceFile(); + var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result); + } + + return result; + + function getThisReferencesInFile(sourceFile: SourceFile, searchSpaceNode: Node, possiblePositions: number[], result: ReferenceEntry[]): void { + forEach(possiblePositions, position => { + cancellationToken.throwIfCancellationRequested(); + + var node = getTouchingWord(sourceFile, position); + if (!node || node.kind !== SyntaxKind.ThisKeyword) { return; } - if (isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation)) { - result.push(getReferenceEntry(referenceLocation)); + var 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.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 && (container.flags & NodeFlags.Static) === staticFlag) { + result.push(getReferenceEntryFromNode(node)); + } + break; + case SyntaxKind.SourceFile: + if (container.kind === SyntaxKind.SourceFile && !isExternalModule(container)) { + result.push(getReferenceEntryFromNode(node)); + } + break; } }); } @@ -2559,30 +4293,49 @@ module ts { // The search set contains at least the current symbol var result = [symbol]; - // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list - var rootSymbol = typeInfoResolver.getRootSymbol(symbol); - if (rootSymbol && rootSymbol !== symbol) { - result.push(rootSymbol); - } - // If the location is in a context sensitive location (i.e. in an object literal) try // to get a contextual type for it, and add the property symbol from the contextual // type to the search set if (isNameOfPropertyAssignment(location)) { - var symbolFromContextualType = getPropertySymbolFromContextualType(location); - if (symbolFromContextualType) result.push(typeInfoResolver.getRootSymbol(symbolFromContextualType)); + forEach(getPropertySymbolsFromContextualType(location), contextualSymbol => { + result.push.apply(result, typeInfoResolver.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 + * var name = "Foo"; + * var 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. + */ + var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); + if (shorthandValueSymbol) { + result.push(shorthandValueSymbol); + } } - // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions - if (symbol.parent && symbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { - getPropertySymbolsFromBaseTypes(symbol.parent, symbol.getName(), result); - } + // If this is a union property, add all the symbols from all its source symbols in all unioned types. + // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list + forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => { + if (rootSymbol !== symbol) { + result.push(rootSymbol); + } + + // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions + if (rootSymbol.parent && rootSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + } + }); return result; } function getPropertySymbolsFromBaseTypes(symbol: Symbol, propertyName: string, result: Symbol[]): void { - if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { + if (symbol && symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { forEach(symbol.getDeclarations(), declaration => { if (declaration.kind === SyntaxKind.ClassDeclaration) { getPropertySymbolFromTypeReference((declaration).baseType); @@ -2597,25 +4350,22 @@ module ts { function getPropertySymbolFromTypeReference(typeReference: TypeReferenceNode) { if (typeReference) { - // TODO: move to getTypeOfNode instead - var typeReferenceSymbol = typeInfoResolver.getSymbolInfo(typeReference.typeName); - if (typeReferenceSymbol) { - var propertySymbol = typeReferenceSymbol.members[propertyName]; - if (propertySymbol) result.push(typeReferenceSymbol.members[propertyName]); + var type = typeInfoResolver.getTypeOfNode(typeReference); + if (type) { + var propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName); + if (propertySymbol) { + result.push(propertySymbol); + } - // Visit the typeReference as well to see if it directelly or indirectelly use that property - getPropertySymbolsFromBaseTypes(typeReferenceSymbol, propertyName, result); + // Visit the typeReference as well to see if it directly or indirectly use that property + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result); } } } } function isRelatableToSearchSet(searchSymbols: Symbol[], referenceSymbol: Symbol, referenceLocation: Node): boolean { - // Unwrap symbols to get to the root (e.g. triansient symbols as a result of widenning) - var referenceSymbolTarget = typeInfoResolver.getRootSymbol(referenceSymbol); - - // if it is in the list, then we are done - if (searchSymbols.indexOf(referenceSymbolTarget) >= 0) { + if (searchSymbols.indexOf(referenceSymbol) >= 0) { return true; } @@ -2623,161 +4373,74 @@ module ts { // object literal, lookup the property symbol in the contextual type, and use this symbol to // compare to our searchSymbol if (isNameOfPropertyAssignment(referenceLocation)) { - var symbolFromContextualType = getPropertySymbolFromContextualType(referenceLocation); - if (symbolFromContextualType && searchSymbols.indexOf(typeInfoResolver.getRootSymbol(symbolFromContextualType)) >= 0) { + return forEach(getPropertySymbolsFromContextualType(referenceLocation), contextualSymbol => { + return forEach(typeInfoResolver.getRootSymbols(contextualSymbol), s => searchSymbols.indexOf(s) >= 0); + }); + } + + // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) + // Or a union property, use its underlying unioned symbols + return forEach(typeInfoResolver.getRootSymbols(referenceSymbol), rootSymbol => { + // if it is in the list, then we are done + if (searchSymbols.indexOf(rootSymbol) >= 0) { return true; } - } - // Finally, try all properties with the same name in any type the containing type extened or implemented, and - // see if any is in the list - if (referenceSymbol.parent && referenceSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { - var result: Symbol[] = []; - getPropertySymbolsFromBaseTypes(referenceSymbol.parent, referenceSymbol.getName(), result); - return forEach(result, s => searchSymbols.indexOf(s) >= 0); - } + // Finally, try all properties with the same name in any type the containing type extended or implemented, and + // see if any is in the list + if (rootSymbol.parent && rootSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { + var result: Symbol[] = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + return forEach(result, s => searchSymbols.indexOf(s) >= 0); + } - return false; + return false; + }); } - function getPropertySymbolFromContextualType(node: Node): Symbol { + function getPropertySymbolsFromContextualType(node: Node): Symbol[] { if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeInfoResolver.getContextualType(objectLiteral); + var name = (node).text; if (contextualType) { - return typeInfoResolver.getPropertyOfType(contextualType, (node).text); + if (contextualType.flags & TypeFlags.Union) { + // This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types) + // if not, search the constituent types for the property + var unionProperty = contextualType.getProperty(name) + if (unionProperty) { + return [unionProperty]; + } + else { + var result: Symbol[] = []; + forEach((contextualType).types, t => { + var symbol = t.getProperty(name); + if (symbol) { + result.push(symbol); + } + }); + return result; + } + } + else { + var symbol = contextualType.getProperty(name); + if (symbol) { + return [symbol]; + } + } } } return undefined; } - function getReferenceEntry(node: Node): ReferenceEntry { - var start = node.getStart(); - var end = node.getEnd(); - - if (node.kind === SyntaxKind.StringLiteral) { - start += 1; - end -= 1; - } - - return new ReferenceEntry(node.getSourceFile().filename, TypeScript.TextSpan.fromBounds(start, end), isWriteAccess(node)); - } - - function getMeaningFromDeclaration(node: Declaration): SearchMeaning { - switch (node.kind) { - case SyntaxKind.Parameter: - case SyntaxKind.VariableDeclaration: - case SyntaxKind.Property: - case SyntaxKind.PropertyAssignment: - case SyntaxKind.EnumMember: - case SyntaxKind.Method: - case SyntaxKind.Constructor: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.FunctionExpression: - case SyntaxKind.ArrowFunction: - case SyntaxKind.CatchBlock: - return SearchMeaning.Value; - - case SyntaxKind.TypeParameter: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.TypeLiteral: - return SearchMeaning.Type; - - case SyntaxKind.ClassDeclaration: - case SyntaxKind.EnumDeclaration: - return SearchMeaning.Value | SearchMeaning.Type; - - case SyntaxKind.ModuleDeclaration: - if ((node).name.kind === SyntaxKind.StringLiteral) { - return SearchMeaning.Namespace | SearchMeaning.Value; - } - else if (isInstantiated(node)) { - return SearchMeaning.Namespace | SearchMeaning.Value; - } - else { - return SearchMeaning.Namespace; - } - break; - - case SyntaxKind.ImportDeclaration: - return SearchMeaning.Value | SearchMeaning.Type | SearchMeaning.Namespace; - } - Debug.fail("Unkown declaration type"); - } - - function isTypeReference(node: Node): boolean { - if (node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node) - node = node.parent; - - return node.parent.kind === SyntaxKind.TypeReference; - } - - function isNamespaceReference(node: Node): boolean { - var root = node; - var 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: EntityName) { - while (node.parent.kind === SyntaxKind.QualifiedName) { - node = node.parent; - } - - return node.parent.kind === SyntaxKind.ImportDeclaration && (node.parent).entityName === node; - } - - function getMeaningFromRightHandSideOfImport(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.ImportDeclaration) { - return SearchMeaning.Value | SearchMeaning.Type | SearchMeaning.Namespace; - } - return SearchMeaning.Namespace; - } - - function getMeaningFromLocation(node: Node): SearchMeaning { - if (node.parent.kind === SyntaxKind.ExportAssignment) { - return SearchMeaning.Value | SearchMeaning.Type | SearchMeaning.Namespace; - } - else if (isInRightSideOfImport(node)) { - return getMeaningFromRightHandSideOfImport(node); - } - else if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { - return getMeaningFromDeclaration(node.parent); - } - else if (isTypeReference(node)) { - return SearchMeaning.Type; - } - else if (isNamespaceReference(node)) { - return SearchMeaning.Namespace; - } - else { - return SearchMeaning.Value; - } - } - - /// 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: SearchMeaning, declarations: Declaration[]): SearchMeaning { + /** 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) { do { // The result is order-sensitive, for instance if initialMeaning === Namespace, and declarations = [class, instantiated module] @@ -2785,7 +4448,7 @@ module ts { // intersects with the class in the value space. // To achieve that we will keep iterating until the result stabilizes. - // Remeber the last meaning + // Remember the last meaning var lastIterationMeaning = meaning; for (var i = 0, n = declarations.length; i < n; i++) { @@ -2799,280 +4462,724 @@ module ts { } return meaning; } + } - /// A node is considedered 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 && isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + function getReferenceEntryFromNode(node: Node): ReferenceEntry { + var start = node.getStart(); + var end = node.getEnd(); + + if (node.kind === SyntaxKind.StringLiteral) { + start += 1; + end -= 1; + } + + return { + fileName: node.getSourceFile().filename, + textSpan: TextSpan.fromBounds(start, end), + isWriteAccess: isWriteAccess(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 && isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + return true; + } + + var parent = node.parent; + if (parent) { + if (parent.kind === SyntaxKind.PostfixOperator || parent.kind === SyntaxKind.PrefixOperator) { return true; } + else if (parent.kind === SyntaxKind.BinaryExpression && (parent).left === node) { + var operator = (parent).operator; + return SyntaxKind.FirstAssignment <= operator && operator <= SyntaxKind.LastAssignment; + } + } - var parent = node.parent; - if (parent) { - if (parent.kind === SyntaxKind.PostfixOperator || parent.kind === SyntaxKind.PrefixOperator) { + return false; + } + + /// NavigateTo + function getNavigateToItems(searchValue: string): NavigateToItem[] { + synchronizeHostData(); + + // Split search value in terms array + var terms = searchValue.split(" "); + + // default NavigateTo approach: if search term contains only lower-case chars - use case-insensitive search, otherwise switch to case-sensitive version + var searchTerms = map(terms, t => ({ caseSensitive: hasAnyUpperCaseCharacter(t), term: t })); + + var items: NavigateToItem[] = []; + + // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] + forEach(program.getSourceFiles(), sourceFile => { + cancellationToken.throwIfCancellationRequested(); + + var filename = sourceFile.filename; + var declarations = sourceFile.getNamedDeclarations(); + for (var i = 0, n = declarations.length; i < n; i++) { + var declaration = declarations[i]; + // TODO(jfreeman): Skip this declaration if it has a computed name + var name = (declaration.name).text; + var matchKind = getMatchKind(searchTerms, name); + if (matchKind !== MatchKind.none) { + var container = getContainerNode(declaration); + items.push({ + name: name, + kind: getNodeKind(declaration), + kindModifiers: getNodeModifiers(declaration), + matchKind: MatchKind[matchKind], + fileName: filename, + textSpan: TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), + // TODO(jfreeman): What should be the containerName when the container has a computed name? + containerName: container && container.name ? (container.name).text : "", + containerKind: container && container.name ? getNodeKind(container) : "" + }); + } + } + }); + + return items; + + function hasAnyUpperCaseCharacter(s: string): boolean { + for (var i = 0, n = s.length; i < n; i++) { + var c = s.charCodeAt(i); + if ((CharacterCodes.A <= c && c <= CharacterCodes.Z) || + (c >= CharacterCodes.maxAsciiCharacter && s.charAt(i).toLocaleLowerCase() !== s.charAt(i))) { return true; } - else if (parent.kind === SyntaxKind.BinaryExpression && (parent).left === node) { - var operator = (parent).operator; - switch (operator) { - case SyntaxKind.AsteriskEqualsToken: - case SyntaxKind.SlashEqualsToken: - case SyntaxKind.PercentEqualsToken: - case SyntaxKind.MinusEqualsToken: - case SyntaxKind.LessThanLessThanEqualsToken: - case SyntaxKind.GreaterThanGreaterThanEqualsToken: - case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: - case SyntaxKind.BarEqualsToken: - case SyntaxKind.CaretEqualsToken: - case SyntaxKind.AmpersandEqualsToken: - case SyntaxKind.PlusEqualsToken: - case SyntaxKind.EqualsToken: - return true; + } + + return false; + } + + function getMatchKind(searchTerms: { caseSensitive: boolean; term: string }[], name: string): MatchKind { + var matchKind = MatchKind.none; + + if (name) { + for (var j = 0, n = searchTerms.length; j < n; j++) { + var searchTerm = searchTerms[j]; + var nameToSearch = searchTerm.caseSensitive ? name : name.toLocaleLowerCase(); + // in case of case-insensitive search searchTerm.term will already be lower-cased + var index = nameToSearch.indexOf(searchTerm.term); + if (index < 0) { + // Didn't match. + return MatchKind.none; + } + + var termKind = MatchKind.substring; + if (index === 0) { + // here we know that match occur at the beginning of the string. + // if search term and declName has the same length - we have an exact match, otherwise declName have longer length and this will be prefix match + termKind = name.length === searchTerm.term.length ? MatchKind.exact : MatchKind.prefix; + } + + // Update our match kind if we don't have one, or if this match is better. + if (matchKind === MatchKind.none || termKind < matchKind) { + matchKind = termKind; } } - - return false; } + + return matchKind; } } - /// Syntactic features - function getSyntaxTree(filename: string): TypeScript.SyntaxTree { - filename = TypeScript.switchToForwardSlashes(filename); - return syntaxTreeCache.getCurrentFileSyntaxTree(filename); + function containErrors(diagnostics: Diagnostic[]): boolean { + return forEach(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error); } + function getEmitOutput(filename: string): EmitOutput { + synchronizeHostData(); + filename = normalizeSlashes(filename); + var compilerOptions = program.getCompilerOptions(); + var targetSourceFile = program.getSourceFile(filename); // Current selected file to be output + // If --out flag is not specified, shouldEmitToOwnFile is true. Otherwise shouldEmitToOwnFile is false. + var shouldEmitToOwnFile = ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions); + var emitOutput: EmitOutput = { + outputFiles: [], + emitOutputStatus: undefined, + }; + + function getEmitOutputWriter(filename: string, data: string, writeByteOrderMark: boolean) { + emitOutput.outputFiles.push({ + name: filename, + writeByteOrderMark: writeByteOrderMark, + text: data + }); + } + + // Initialize writer for CompilerHost.writeFile + writer = getEmitOutputWriter; + + var containSyntacticErrors = false; + + if (shouldEmitToOwnFile) { + // Check only the file we want to emit + containSyntacticErrors = containErrors(program.getDiagnostics(targetSourceFile)); + } else { + // Check the syntactic of only sourceFiles that will get emitted into single output + // Terminate the process immediately if we encounter a syntax error from one of the sourceFiles + containSyntacticErrors = forEach(program.getSourceFiles(), sourceFile => { + if (!isExternalModuleOrDeclarationFile(sourceFile)) { + // If emit to a single file then we will check all files that do not have external module + return containErrors(program.getDiagnostics(sourceFile)); + } + return false; + }); + } + + if (containSyntacticErrors) { + // If there is a syntax error, terminate the process and report outputStatus + emitOutput.emitOutputStatus = EmitReturnStatus.AllOutputGenerationSkipped; + // Reset writer back to undefined to make sure that we produce an error message + // if CompilerHost.writeFile is called when we are not in getEmitOutput + writer = undefined; + return emitOutput; + } + + // Perform semantic and force a type check before emit to ensure that all symbols are updated + // EmitFiles will report if there is an error from TypeChecker and Emitter + // Depend whether we will have to emit into a single file or not either emit only selected file in the project, emit all files into a single file + var emitFilesResult = getFullTypeCheckChecker().emitFiles(targetSourceFile); + emitOutput.emitOutputStatus = emitFilesResult.emitResultStatus; + + // Reset writer back to undefined to make sure that we produce an error message if CompilerHost.writeFile method is called when we are not in getEmitOutput + writer = undefined; + return emitOutput; + } + + function getMeaningFromDeclaration(node: Declaration): SemanticMeaning { + switch (node.kind) { + case SyntaxKind.Parameter: + case SyntaxKind.VariableDeclaration: + case SyntaxKind.Property: + case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: + case SyntaxKind.EnumMember: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.CatchBlock: + 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 ((node).name.kind === SyntaxKind.StringLiteral) { + return SemanticMeaning.Namespace | SemanticMeaning.Value; + } + else if (getModuleInstanceState(node) === ModuleInstanceState.Instantiated) { + return SemanticMeaning.Namespace | SemanticMeaning.Value; + } + else { + return SemanticMeaning.Namespace; + } + + case SyntaxKind.ImportDeclaration: + return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; + + // An external module can be a Value + case SyntaxKind.SourceFile: + return SemanticMeaning.Namespace | SemanticMeaning.Value; + } + Debug.fail("Unknown declaration type"); + } + + function isTypeReference(node: Node): boolean { + if (isRightSideOfQualifiedName(node)) { + node = node.parent; + } + + return node.parent.kind === SyntaxKind.TypeReference; + } + + function isNamespaceReference(node: Node): boolean { + var root = node; + var 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 node.parent.kind === SyntaxKind.ImportDeclaration && (node.parent).entityName === node; + } + + function getMeaningFromRightHandSideOfImport(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.ImportDeclaration) { + 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 getMeaningFromRightHandSideOfImport(node); + } + else if (isDeclarationOrFunctionExpressionOrCatchVariableName(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. + */ + function getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems { + synchronizeHostData(); + + fileName = normalizeSlashes(fileName); + var sourceFile = getSourceFile(fileName); + + return SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); + } + + /// Syntactic features function getCurrentSourceFile(filename: string): SourceFile { - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); var currentSourceFile = syntaxTreeCache.getCurrentSourceFile(filename); return currentSourceFile; } - function getNameOrDottedNameSpan(filename: string, startPos: number, endPos: number): TypeScript.TextSpan { - function getTypeInfoEligiblePath(filename: string, position: number, isConstructorValidPosition: boolean) { - var sourceUnit = syntaxTreeCache.getCurrentFileSyntaxTree(filename).sourceUnit(); + function getNameOrDottedNameSpan(filename: string, startPos: number, endPos: number): TextSpan { + filename = ts.normalizeSlashes(filename); + // Get node at the location + var node = getTouchingPropertyName(getCurrentSourceFile(filename), startPos); - var ast = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, /*useTrailingTriviaAsLimChar*/ false, /*forceInclusive*/ true); - if (ast === null) { - return null; - } - - if (ast.kind() === TypeScript.SyntaxKind.ParameterList && ast.parent.kind() === TypeScript.SyntaxKind.CallSignature && ast.parent.parent.kind() === TypeScript.SyntaxKind.ConstructorDeclaration) { - ast = ast.parent.parent; - } - - switch (ast.kind()) { - default: - return null; - case TypeScript.SyntaxKind.ConstructorDeclaration: - var constructorAST = ast; - if (!isConstructorValidPosition || !(position >= TypeScript.start(constructorAST) && position <= TypeScript.start(constructorAST) + "constructor".length)) { - return null; - } - else { - return ast; - } - case TypeScript.SyntaxKind.FunctionDeclaration: - return null; - case TypeScript.SyntaxKind.MemberAccessExpression: - case TypeScript.SyntaxKind.QualifiedName: - case TypeScript.SyntaxKind.SuperKeyword: - case TypeScript.SyntaxKind.StringLiteral: - case TypeScript.SyntaxKind.ThisKeyword: - case TypeScript.SyntaxKind.IdentifierName: - return ast; - } + if (!node) { + return; } - filename = TypeScript.switchToForwardSlashes(filename); + switch (node.kind) { + case SyntaxKind.PropertyAccess: + case SyntaxKind.QualifiedName: + case SyntaxKind.StringLiteral: + case SyntaxKind.FalseKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.SuperKeyword: + case SyntaxKind.ThisKeyword: + case SyntaxKind.Identifier: + break; - var node = getTypeInfoEligiblePath(filename, startPos, false); - if (!node) return null; + // Cant create the text span + default: + return; + } - while (node) { - if (TypeScript.ASTHelpers.isNameOfMemberAccessExpression(node) || - TypeScript.ASTHelpers.isRightSideOfQualifiedName(node)) { - node = node.parent; + var nodeForStartPos = node; + while (true) { + if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { + // If on the span is in right side of the the property or qualified name, return the span from the qualified name pos to end of this node + nodeForStartPos = nodeForStartPos.parent; + } + else if (isNameOfModuleDeclaration(nodeForStartPos)) { + // If this is name of a module declarations, check if this is right side of dotted module name + // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of + // Then this name is name from dotted module + if (nodeForStartPos.parent.parent.kind === SyntaxKind.ModuleDeclaration && + (nodeForStartPos.parent.parent).body === nodeForStartPos.parent) { + // Use parent module declarations name for start pos + nodeForStartPos = (nodeForStartPos.parent.parent).name; + } + else { + // We have to use this name for start pos + break; + } } else { + // Is not a member expression so we have found the node for start pos break; } } - return TypeScript.TextSpan.fromBounds( - TypeScript.start(node), - TypeScript.end(node)); + return TextSpan.fromBounds(nodeForStartPos.getStart(), node.getEnd()); } function getBreakpointStatementAtPosition(filename: string, position: number) { // doesn't use compiler - no need to synchronize with host - filename = TypeScript.switchToForwardSlashes(filename); - - var syntaxtree = getSyntaxTree(filename); - return TypeScript.Services.Breakpoints.getBreakpointLocation(syntaxtree, position); + filename = ts.normalizeSlashes(filename); + return BreakpointResolver.spanInSourceFileAtLocation(getCurrentSourceFile(filename), position); } - function getNavigationBarItems(filename: string) { - filename = TypeScript.switchToForwardSlashes(filename); - var syntaxTree = getSyntaxTree(filename); - return new TypeScript.Services.NavigationBarItemGetter().getItems(syntaxTree.sourceUnit()); + function getNavigationBarItems(filename: string): NavigationBarItem[] { + filename = normalizeSlashes(filename); + + return NavigationBar.getNavigationBarItems(getCurrentSourceFile(filename)); + } + + function getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[] { + synchronizeHostData(); + fileName = normalizeSlashes(fileName); + + var sourceFile = getSourceFile(fileName); + + var result: ClassifiedSpan[] = []; + processNode(sourceFile); + + return result; + + function classifySymbol(symbol: Symbol, meaningAtPosition: SemanticMeaning) { + var flags = symbol.getFlags(); + + if (flags & SymbolFlags.Class) { + return ClassificationTypeNames.className; + } + else if (flags & SymbolFlags.Enum) { + return ClassificationTypeNames.enumName; + } + else if (meaningAtPosition & SemanticMeaning.Type) { + if (flags & SymbolFlags.Interface) { + return ClassificationTypeNames.interfaceName; + } + else if (flags & SymbolFlags.TypeParameter) { + return ClassificationTypeNames.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 ClassificationTypeNames.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 && span.intersectsWith(node.getStart(), node.getWidth())) { + if (node.kind === SyntaxKind.Identifier && node.getWidth() > 0) { + var symbol = typeInfoResolver.getSymbolInfo(node); + if (symbol) { + var type = classifySymbol(symbol, getMeaningFromLocation(node)); + if (type) { + result.push({ + textSpan: new TextSpan(node.getStart(), node.getWidth()), + classificationType: type + }); + } + } + } + + forEachChild(node, processNode); + } + } + } + + function getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[] { + // doesn't use compiler - no need to synchronize with host + fileName = normalizeSlashes(fileName); + var sourceFile = getCurrentSourceFile(fileName); + + var result: ClassifiedSpan[] = []; + processElement(sourceFile); + + return result; + + function classifyComment(comment: CommentRange) { + var width = comment.end - comment.pos; + if (span.intersectsWith(comment.pos, width)) { + result.push({ + textSpan: new TextSpan(comment.pos, width), + classificationType: ClassificationTypeNames.comment + }); + } + } + + function classifyToken(token: Node): void { + forEach(getLeadingCommentRanges(sourceFile.text, token.getFullStart()), classifyComment); + + if (token.getWidth() > 0) { + var type = classifyTokenType(token); + if (type) { + result.push({ + textSpan: new TextSpan(token.getStart(), token.getWidth()), + classificationType: type + }); + } + } + + forEach(getTrailingCommentRanges(sourceFile.text, token.getEnd()), classifyComment); + } + + function classifyTokenType(token: Node): string { + var tokenKind = token.kind; + if (isKeyword(tokenKind)) { + return ClassificationTypeNames.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 (getTypeArgumentOrTypeParameterList(token.parent)) { + return ClassificationTypeNames.punctuation; + } + } + + if (isPunctuation(token.kind)) { + // the '=' in a variable declaration is special cased here. + if (token.parent.kind === SyntaxKind.BinaryExpression || + token.parent.kind === SyntaxKind.VariableDeclaration || + token.parent.kind === SyntaxKind.PrefixOperator || + token.parent.kind === SyntaxKind.PostfixOperator || + token.parent.kind === SyntaxKind.ConditionalExpression) { + return ClassificationTypeNames.operator; + } + else { + return ClassificationTypeNames.punctuation; + } + } + else if (tokenKind === SyntaxKind.NumericLiteral) { + return ClassificationTypeNames.numericLiteral; + } + else if (tokenKind === SyntaxKind.StringLiteral) { + return ClassificationTypeNames.stringLiteral; + } + else if (tokenKind === SyntaxKind.RegularExpressionLiteral) { + // TODO: we should get another classification type for these literals. + return ClassificationTypeNames.stringLiteral; + } + else if (isTemplateLiteralKind(tokenKind)) { + // TODO (drosen): we should *also* get another classification type for these literals. + return ClassificationTypeNames.stringLiteral; + } + else if (tokenKind === SyntaxKind.Identifier) { + switch (token.parent.kind) { + case SyntaxKind.ClassDeclaration: + if ((token.parent).name === token) { + return ClassificationTypeNames.className; + } + return; + case SyntaxKind.TypeParameter: + if ((token.parent).name === token) { + return ClassificationTypeNames.typeParameterName; + } + return; + case SyntaxKind.InterfaceDeclaration: + if ((token.parent).name === token) { + return ClassificationTypeNames.interfaceName; + } + return; + case SyntaxKind.EnumDeclaration: + if ((token.parent).name === token) { + return ClassificationTypeNames.enumName; + } + return; + case SyntaxKind.ModuleDeclaration: + if ((token.parent).name === token) { + return ClassificationTypeNames.moduleName; + } + return; + default: + return ClassificationTypeNames.text; + } + } + } + + function processElement(element: Node) { + // Ignore nodes that don't intersect the original span to classify. + if (span.intersectsWith(element.getFullStart(), element.getFullWidth())) { + var children = element.getChildren(); + for (var i = 0, n = children.length; i < n; i++) { + var child = children[i]; + if (isToken(child)) { + classifyToken(child); + } + else { + // Recurse into our child nodes. + processElement(child); + } + } + } + } } function getOutliningSpans(filename: string): OutliningSpan[] { // doesn't use compiler - no need to synchronize with host - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); var sourceFile = getCurrentSourceFile(filename); return OutliningElementsCollector.collectElements(sourceFile); } function getBraceMatchingAtPosition(filename: string, position: number) { - filename = TypeScript.switchToForwardSlashes(filename); - var syntaxTree = getSyntaxTree(filename); - return TypeScript.Services.BraceMatcher.getMatchSpans(syntaxTree, position); + var sourceFile = getCurrentSourceFile(filename); + var result: TextSpan[] = []; + + var token = getTouchingToken(sourceFile, position); + + if (token.getStart(sourceFile) === position) { + var matchKind = getMatchingTokenKind(token); + + // Ensure that there is a corresponding token to match ours. + if (matchKind) { + var parentElement = token.parent; + + var childNodes = parentElement.getChildren(sourceFile); + for (var i = 0, n = childNodes.length; i < n; i++) {33 + var current = childNodes[i]; + + if (current.kind === matchKind) { + var range1 = new TextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); + var range2 = new TextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); + + // We want to order the braces when we return the result. + if (range1.start() < range2.start()) { + result.push(range1, range2); + } + else { + result.push(range2, range1); + } + + break; + } + } + } + } + + return result; + + function getMatchingTokenKind(token: Node): ts.SyntaxKind { + switch (token.kind) { + case ts.SyntaxKind.OpenBraceToken: return ts.SyntaxKind.CloseBraceToken + case ts.SyntaxKind.OpenParenToken: return ts.SyntaxKind.CloseParenToken; + case ts.SyntaxKind.OpenBracketToken: return ts.SyntaxKind.CloseBracketToken; + case ts.SyntaxKind.LessThanToken: return ts.SyntaxKind.GreaterThanToken; + case ts.SyntaxKind.CloseBraceToken: return ts.SyntaxKind.OpenBraceToken + case ts.SyntaxKind.CloseParenToken: return ts.SyntaxKind.OpenParenToken; + case ts.SyntaxKind.CloseBracketToken: return ts.SyntaxKind.OpenBracketToken; + case ts.SyntaxKind.GreaterThanToken: return ts.SyntaxKind.LessThanToken; + } + + return undefined; + } } function getIndentationAtPosition(filename: string, position: number, editorOptions: EditorOptions) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); - var syntaxTree = getSyntaxTree(filename); + var start = new Date().getTime(); + var sourceFile = getCurrentSourceFile(filename); + host.log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start)); - var scriptSnapshot = syntaxTreeCache.getCurrentScriptSnapshot(filename); - var scriptText = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var textSnapshot = new TypeScript.Services.Formatting.TextSnapshot(scriptText); - var options = new TypeScript.FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter) + var start = new Date().getTime(); - return TypeScript.Services.Formatting.SingleTokenIndenter.getIndentationAmount(position, syntaxTree.sourceUnit(), textSnapshot, options); - } + var result = formatting.SmartIndenter.getIndentation(position, sourceFile, editorOptions); + host.log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start)); - function getFormattingManager(filename: string, options: FormatCodeOptions) { - // Ensure rules are initialized and up to date wrt to formatting options - if (formattingRulesProvider == null) { - formattingRulesProvider = new TypeScript.Services.Formatting.RulesProvider(host); - } - - formattingRulesProvider.ensureUpToDate(options); - - // Get the Syntax Tree - var syntaxTree = getSyntaxTree(filename); - - // Convert IScriptSnapshot to ITextSnapshot - var scriptSnapshot = syntaxTreeCache.getCurrentScriptSnapshot(filename); - var scriptText = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var textSnapshot = new TypeScript.Services.Formatting.TextSnapshot(scriptText); - - var manager = new TypeScript.Services.Formatting.FormattingManager(syntaxTree, textSnapshot, formattingRulesProvider, options); - - return manager; + return result; } function getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[] { - fileName = TypeScript.switchToForwardSlashes(fileName); - - var manager = getFormattingManager(fileName, options); - return manager.formatSelection(start, end); + fileName = normalizeSlashes(fileName); + var sourceFile = getCurrentSourceFile(fileName); + return formatting.formatSelection(start, end, sourceFile, getRuleProvider(options), options); } function getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[] { - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); - var manager = getFormattingManager(fileName, options); - return manager.formatDocument(); + var sourceFile = getCurrentSourceFile(fileName); + return formatting.formatDocument(sourceFile, getRuleProvider(options), options); } function getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[] { - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); - var manager = getFormattingManager(fileName, options); + var sourceFile = getCurrentSourceFile(fileName); if (key === "}") { - return manager.formatOnClosingCurlyBrace(position); + return formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(options), options); } else if (key === ";") { - return manager.formatOnSemicolon(position); + return formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(options), options); } else if (key === "\n") { - return manager.formatOnEnter(position); + return formatting.formatOnEnter(position, sourceFile, getRuleProvider(options), options); } return []; } - function escapeRegExp(str: string): string { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - } + 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 + // this on every single file. If we treat this syntactically, then that will cause + // us to populate and throw away the tree in our syntax tree cache for each file. By + // treating this as a semantic operation, we can access any tree without throwing + // anything away. + synchronizeHostData(); - function getTodoCommentsRegExp(descriptors: TodoCommentDescriptor[]): RegExp { - // NOTE: ?: means 'non-capture group'. It allows us to have groups without having to - // filter them out later in the final result array. + filename = normalizeSlashes(filename); - // TODO comments can appear in one of the following forms: - // - // 1) // TODO or /////////// TODO - // - // 2) /* TODO or /********** TODO - // - // 3) /* - // * TODO - // */ - // - // The following three regexps are used to match the start of the text up to the TODO - // comment portion. - var singleLineCommentStart = /(?:\/\/+\s*)/.source; - var multiLineCommentStart = /(?:\/\*+\s*)/.source; - var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; + var sourceFile = getSourceFile(filename); - // Match any of the above three TODO comment start regexps. - // Note that the outermost group *is* a capture group. We want to capture the preamble - // so that we can determine the starting position of the TODO comment match. - var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; - - // Takes the descriptors and forms a regexp that matches them as if they were literals. - // For example, if the descriptors are "TODO(jason)" and "HACK", then this will be: - // - // (?:(TODO\(jason\))|(HACK)) - // - // Note that the outermost group is *not* a capture group, but the innermost groups - // *are* capture groups. By capturing the inner literals we can determine after - // matching which descriptor we are dealing with. - var literals = "(?:" + descriptors.map(d => "(" + escapeRegExp(d.text) + ")").join("|") + ")"; - - // After matching a descriptor literal, the following regexp matches the rest of the - // text up to the end of the line (or */). - var endOfLineOrEndOfComment = /(?:$|\*\/)/.source - var messageRemainder = /(?:.*?)/.source - - // This is the portion of the match we'll return as part of the TODO comment result. We - // match the literal portion up to the end of the line or end of comment. - var messagePortion = "(" + literals + messageRemainder + ")"; - var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; - - // The final regexp will look like this: - // /((?:\/\/+\s*)|(?:\/\*+\s*)|(?:^(?:\s|\*)*))((?:(TODO\(jason\))|(HACK))(?:.*?))(?:$|\*\/)/gim - - // The flags of the regexp are important here. - // 'g' is so that we are doing a global search and can find matches several times - // in the input. - // - // 'i' is for case insensitivity (We do this to match C# TODO comment code). - // - // 'm' is so we can find matches in a multiline input. - return new RegExp(regExpString, "gim"); - } - - function getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[] { - fileName = TypeScript.switchToForwardSlashes(fileName); - - var sourceFile = getCurrentSourceFile(fileName); - var syntaxTree = sourceFile.getSyntaxTree(); cancellationToken.throwIfCancellationRequested(); - var text = syntaxTree.text; - var fileContents = text.substr(0, text.length()); + var fileContents = sourceFile.text; + cancellationToken.throwIfCancellationRequested(); var result: TodoComment[] = []; if (descriptors.length > 0) { - var regExp = getTodoCommentsRegExp(descriptors); + var regExp = getTodoCommentsRegExp(); var matchArray: RegExpExecArray; while (matchArray = regExp.exec(fileContents)) { @@ -3087,7 +5194,7 @@ module ts { // ["// hack 1", "// ", "hack 1", undefined, "hack"] // // Here are the relevant capture groups: - // 0) The full match for the entire regex. + // 0) The full match for the entire regexp. // 1) The preamble to the message portion. // 2) The message portion. // 3...N) The descriptor that was matched - by index. 'undefined' for each @@ -3101,20 +5208,10 @@ module ts { var preamble = matchArray[1]; var matchPosition = matchArray.index + preamble.length; - // Ok, we have found a match in the file. This is ony an acceptable match if + // OK, we have found a match in the file. This is only an acceptable match if // it is contained within a comment. - var token = TypeScript.findToken(syntaxTree.sourceUnit(), matchPosition); - - if (matchPosition >= TypeScript.start(token) && matchPosition < TypeScript.end(token)) { - // match was within the token itself. Not in the comment. Keep searching - // descriptor. - continue; - } - - // Looks to be within the trivia. See if we can find hte comment containing it. - var triviaList = matchPosition < TypeScript.start(token) ? token.leadingTrivia(syntaxTree.text) : token.trailingTrivia(syntaxTree.text); - var trivia = findContainingComment(triviaList, matchPosition); - if (trivia === null) { + var token = getTokenAtPosition(sourceFile, matchPosition); + if (!isInsideComment(sourceFile, token, matchPosition)) { continue; } @@ -3124,7 +5221,7 @@ module ts { descriptor = descriptors[i]; } } - Debug.assert(descriptor); + Debug.assert(descriptor !== undefined); // We don't want to match something like 'TODOBY', so we make sure a non // letter/digit follows the match. @@ -3133,92 +5230,243 @@ module ts { } var message = matchArray[2]; - result.push(new TodoComment(descriptor, message, matchPosition)); + result.push({ + descriptor: descriptor, + message: message, + position: matchPosition + }); } } return result; + + function escapeRegExp(str: string): string { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + } + + function getTodoCommentsRegExp(): RegExp { + // NOTE: ?: means 'non-capture group'. It allows us to have groups without having to + // filter them out later in the final result array. + + // TODO comments can appear in one of the following forms: + // + // 1) // TODO or /////////// TODO + // + // 2) /* TODO or /********** TODO + // + // 3) /* + // * TODO + // */ + // + // The following three regexps are used to match the start of the text up to the TODO + // comment portion. + var singleLineCommentStart = /(?:\/\/+\s*)/.source; + var multiLineCommentStart = /(?:\/\*+\s*)/.source; + var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; + + // Match any of the above three TODO comment start regexps. + // Note that the outermost group *is* a capture group. We want to capture the preamble + // so that we can determine the starting position of the TODO comment match. + var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + + // Takes the descriptors and forms a regexp that matches them as if they were literals. + // For example, if the descriptors are "TODO(jason)" and "HACK", then this will be: + // + // (?:(TODO\(jason\))|(HACK)) + // + // Note that the outermost group is *not* a capture group, but the innermost groups + // *are* capture groups. By capturing the inner literals we can determine after + // matching which descriptor we are dealing with. + var literals = "(?:" + map(descriptors, d => "(" + escapeRegExp(d.text) + ")").join("|") + ")"; + + // After matching a descriptor literal, the following regexp matches the rest of the + // text up to the end of the line (or */). + var endOfLineOrEndOfComment = /(?:$|\*\/)/.source + var messageRemainder = /(?:.*?)/.source + + // This is the portion of the match we'll return as part of the TODO comment result. We + // match the literal portion up to the end of the line or end of comment. + var messagePortion = "(" + literals + messageRemainder + ")"; + var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; + + // The final regexp will look like this: + // /((?:\/\/+\s*)|(?:\/\*+\s*)|(?:^(?:\s|\*)*))((?:(TODO\(jason\))|(HACK))(?:.*?))(?:$|\*\/)/gim + + // The flags of the regexp are important here. + // 'g' is so that we are doing a global search and can find matches several times + // in the input. + // + // 'i' is for case insensitivity (We do this to match C# TODO comment code). + // + // 'm' is so we can find matches in a multi-line input. + return new RegExp(regExpString, "gim"); + } + + function getContainingComment(comments: CommentRange[], position: number): CommentRange { + if (comments) { + for (var i = 0, n = comments.length; i < n; i++) { + var comment = comments[i]; + if (comment.pos <= position && position < comment.end) { + return comment; + } + } + } + + return undefined; + } + + function isLetterOrDigit(char: number): boolean { + return (char >= CharacterCodes.a && char <= CharacterCodes.z) || + (char >= CharacterCodes.A && char <= CharacterCodes.Z) || + (char >= CharacterCodes._0 && char <= CharacterCodes._9); + } } - function isLetterOrDigit(char: number): boolean { - return (char >= TypeScript.CharacterCodes.a && char <= TypeScript.CharacterCodes.z) || - (char >= TypeScript.CharacterCodes.A && char <= TypeScript.CharacterCodes.Z) || - (char >= TypeScript.CharacterCodes._0 && char <= TypeScript.CharacterCodes._9); - } - function findContainingComment(triviaList: TypeScript.ISyntaxTriviaList, position: number): TypeScript.ISyntaxTrivia { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - var fullEnd = trivia.fullStart() + trivia.fullWidth(); - if (trivia.isComment() && trivia.fullStart() <= position && position < fullEnd) { - return trivia; + function getRenameInfo(fileName: string, position: number): RenameInfo { + synchronizeHostData(); + + fileName = normalizeSlashes(fileName); + var sourceFile = getSourceFile(fileName); + + var node = getTouchingWord(sourceFile, position); + + // Can only rename an identifier. + if (node && node.kind === SyntaxKind.Identifier) { + var symbol = typeInfoResolver.getSymbolInfo(node); + + // Only allow a symbol to be renamed if it actually has at least one declaration. + if (symbol && symbol.getDeclarations() && symbol.getDeclarations().length > 0) { + var kind = getSymbolKind(symbol, typeInfoResolver); + if (kind) { + return getRenameInfo(symbol.name, typeInfoResolver.getFullyQualifiedName(symbol), kind, + getSymbolModifiers(symbol), + new TextSpan(node.getStart(), node.getWidth())); + } } } - return null; + return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_this_element.key)); + + function getRenameInfoError(localizedErrorMessage: string): RenameInfo { + return { + canRename: false, + localizedErrorMessage: getLocaleSpecificMessage(Diagnostics.You_cannot_rename_this_element.key), + displayName: undefined, + fullDisplayName: undefined, + kind: undefined, + kindModifiers: undefined, + triggerSpan: undefined + }; + } + + function getRenameInfo(displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: TextSpan): RenameInfo { + return { + canRename: true, + localizedErrorMessage: undefined, + displayName, + fullDisplayName, + kind, + kindModifiers, + triggerSpan + }; + } } return { - dispose: dispose, - cleanupSemanticCache: cleanupSemanticCache, - getSyntacticDiagnostics: getSyntacticDiagnostics, - getSemanticDiagnostics: getSemanticDiagnostics, - getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, - getCompletionsAtPosition: getCompletionsAtPosition, - getCompletionEntryDetails: getCompletionEntryDetails, - getTypeAtPosition: getTypeAtPosition, - getSignatureHelpItems: (filename, position): SignatureHelpItems => null, - getSignatureHelpCurrentArgumentState: (fileName, position, applicableSpanStart): SignatureHelpState => null, - getDefinitionAtPosition: getDefinitionAtPosition, - getReferencesAtPosition: getReferencesAtPosition, - getOccurrencesAtPosition: getOccurrencesAtPosition, - getImplementorsAtPosition: (filename, position) => [], - getNameOrDottedNameSpan: getNameOrDottedNameSpan, - getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, - getNavigateToItems: (searchValue) => [], - getRenameInfo: (fileName, position): RenameInfo => RenameInfo.CreateError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_this_element.key)), - getNavigationBarItems: getNavigationBarItems, - getOutliningSpans: getOutliningSpans, - getTodoComments: getTodoComments, - getBraceMatchingAtPosition: getBraceMatchingAtPosition, - getIndentationAtPosition: getIndentationAtPosition, - getFormattingEditsForRange: getFormattingEditsForRange, - getFormattingEditsForDocument: getFormattingEditsForDocument, - getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, - getEmitOutput: (filename): EmitOutput => null, + dispose, + cleanupSemanticCache, + getSyntacticDiagnostics, + getSemanticDiagnostics, + getCompilerOptionsDiagnostics, + getSyntacticClassifications, + getSemanticClassifications, + getCompletionsAtPosition, + getCompletionEntryDetails, + getSignatureHelpItems, + getQuickInfoAtPosition, + getDefinitionAtPosition, + getReferencesAtPosition, + getOccurrencesAtPosition, + getNameOrDottedNameSpan, + getBreakpointStatementAtPosition, + getNavigateToItems, + getRenameInfo, + findRenameLocations, + getNavigationBarItems, + getOutliningSpans, + getTodoComments, + getBraceMatchingAtPosition, + getIndentationAtPosition, + getFormattingEditsForRange, + getFormattingEditsForDocument, + getFormattingEditsAfterKeystroke, + getEmitOutput, + getSourceFile: getCurrentSourceFile, }; } /// Classifier export function createClassifier(host: Logger): Classifier { - var scanner: Scanner; - var noRegexTable: boolean[]; + var 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. - if (!noRegexTable) { - noRegexTable = []; - 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; + var 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; + + function isAccessibilityModifier(kind: SyntaxKind) { + switch (kind) { + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: + return true; + } + + return false; } - function getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult { + /** 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; + } + + // 'classifyKeywordsInGenerics' should be 'true' when a syntactic classifier is not present. + function getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): ClassificationResult { var offset = 0; - var lastTokenOrCommentEnd = 0; - var lastToken = SyntaxKind.Unknown; - var inUnterminatedMultiLineComment = false; + var token = SyntaxKind.Unknown; + var lastNonTriviaToken = SyntaxKind.Unknown; // 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. @@ -3238,32 +5486,80 @@ module ts { text = "/*\n" + text; offset = 3; break; - case EndOfLineState.EndingWithDotToken: - lastToken = SyntaxKind.DotToken; - break; } + scanner.setText(text); + var result: ClassificationResult = { finalLexState: EndOfLineState.Start, entries: [] }; - scanner = createScanner(ScriptTarget.ES5, text, onError, processComment); + // 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. + var angleBracketStack = 0; - var token = SyntaxKind.Unknown; do { token = scanner.scan(); - if ((token === SyntaxKind.SlashToken || token === SyntaxKind.SlashEqualsToken) && !noRegexTable[lastToken]) { - if (scanner.reScanSlashToken() === SyntaxKind.RegularExpressionLiteral) { - token = SyntaxKind.RegularExpressionLiteral; + 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) { + if (angleBracketStack > 0 && !classifyKeywordsInGenerics) { + // 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 (lastToken === SyntaxKind.DotToken) { - token = SyntaxKind.Identifier; - } - lastToken = token; + lastNonTriviaToken = token; + } processToken(); } @@ -3271,35 +5567,17 @@ module ts { return result; - - function onError(message: DiagnosticMessage): void { - inUnterminatedMultiLineComment = message.key === Diagnostics.Asterisk_Slash_expected.key; - } - - function processComment(start: number, end: number) { - // add Leading white spaces - addLeadingWhiteSpace(start, end); - - // add the comment - addResult(end - start, TokenClass.Comment); - } - function processToken(): void { var start = scanner.getTokenPos(); var end = scanner.getTextPos(); - // add Leading white spaces - addLeadingWhiteSpace(start, end); - // add the token addResult(end - start, classFromKind(token)); if (end >= text.length) { // We're at the end. - if (inUnterminatedMultiLineComment) { - result.finalLexState = EndOfLineState.InMultiLineCommentTrivia; - } - else if (token === SyntaxKind.StringLiteral) { + if (token === SyntaxKind.StringLiteral) { + // Check to see if we finished up on a multiline string literal. var tokenText = scanner.getTokenText(); if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === CharacterCodes.backslash) { var quoteChar = tokenText.charCodeAt(0); @@ -3308,21 +5586,18 @@ module ts { : EndOfLineState.InSingleQuoteStringLiteral; } } - else if (token === SyntaxKind.DotToken) { - result.finalLexState = EndOfLineState.EndingWithDotToken; + else if (token === SyntaxKind.MultiLineCommentTrivia) { + // Check to see if the multiline comment was unclosed. + var tokenText = scanner.getTokenText() + if (!(tokenText.length > 3 && // need to avoid catching '/*/' + tokenText.charCodeAt(tokenText.length - 2) === CharacterCodes.asterisk && + tokenText.charCodeAt(tokenText.length - 1) === CharacterCodes.slash)) { + result.finalLexState = EndOfLineState.InMultiLineCommentTrivia; + } } } } - function addLeadingWhiteSpace(start: number, end: number): void { - if (start > lastTokenOrCommentEnd) { - addResult(start - lastTokenOrCommentEnd, TokenClass.Whitespace); - } - - // Remeber the end of the last token - lastTokenOrCommentEnd = end; - } - function addResult(length: number, classification: TokenClass): void { if (length > 0) { // If this is the first classification we're adding to the list, then remove any @@ -3415,15 +5690,18 @@ module ts { return TokenClass.StringLiteral; case SyntaxKind.RegularExpressionLiteral: return TokenClass.RegExpLiteral; + case SyntaxKind.MultiLineCommentTrivia: + case SyntaxKind.SingleLineCommentTrivia: + return TokenClass.Comment; + case SyntaxKind.WhitespaceTrivia: + return TokenClass.Whitespace; case SyntaxKind.Identifier: default: return TokenClass.Identifier; } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine }; } function initializeServices() { diff --git a/src/services/shims.ts b/src/services/shims.ts index 0659f9f2512..49603fd4a2e 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -15,49 +15,55 @@ /// -/// -/// - var debugObjectHost = (this); module ts { export interface ScriptSnapshotShim { - // Get's a portion of the script snapshot specified by [start, end). + /** Gets a portion of the script snapshot specified by [start, end). */ getText(start: number, end: number): string; - // Get's the length of this script snapshot. + /** Gets the length of this script snapshot. */ getLength(): number; - // This call returns the JSON encoded array of the type: - // number[] + /** This call returns the JSON-encoded array of the type: number[] */ getLineStartPositions(): string; - // Returns a JSON encoded value of the type: - // { span: { start: number; length: number }; newLength: number } - // - // Or null value if there was no change. + /** + * Returns a JSON-encoded value of the type: + * { span: { start: number; length: number }; newLength: number } + * + * Or undefined value if there was no change. + */ getChangeRange(oldSnapshot: ScriptSnapshotShim): string; } - // - // Public interface of the host of a language service shim instance. - // + /** Public interface of the host of a language service shim instance.*/ export interface LanguageServiceShimHost extends Logger { getCompilationSettings(): string; - // Returns a JSON encoded value of the type: - // string[] + /** Returns a JSON-encoded value of the type: string[] */ getScriptFileNames(): string; getScriptVersion(fileName: string): string; getScriptIsOpen(fileName: string): boolean; getScriptSnapshot(fileName: string): ScriptSnapshotShim; getLocalizedDiagnosticMessages(): string; getCancellationToken(): CancellationToken; + getCurrentDirectory(): string; + getDefaultLibFilename(): string; } - // - // Public interface of of a language service instance shim. - // + /// + /// Pre-processing + /// + // Note: This is being using by the host (VS) and is marshaled back and forth. + // When changing this make sure the changes are reflected in the managed side as well + export interface IFileReference { + path: string; + position: number; + length: number; + } + + /** Public interface of a language service instance shim. */ export interface ShimFactory { registerShim(shim: Shim): void; unregisterShim(shim: Shim): void; @@ -80,48 +86,66 @@ module ts { getSemanticDiagnostics(fileName: string): string; getCompilerOptionsDiagnostics(): string; + getSyntacticClassifications(fileName: string, start: number, length: number): string; + getCompletionsAtPosition(fileName: string, position: number, isMemberCompletion: boolean): string; getCompletionEntryDetails(fileName: string, position: number, entryName: string): string; - getTypeAtPosition(fileName: string, position: number): string; + getQuickInfoAtPosition(fileName: string, position: number): string; + getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): string; getBreakpointStatementAtPosition(fileName: string, position: number): string; getSignatureHelpItems(fileName: string, position: number): string; - getSignatureHelpCurrentArgumentState(fileName: string, position: number, applicableSpanStart: number): string; - // Returns a JSON encoded value of the type: - // { canRename: boolean, localizedErrorMessage: string, displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: { start; length } } + /** + * Returns a JSON-encoded value of the type: + * { canRename: boolean, localizedErrorMessage: string, displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: { start; length } } + */ getRenameInfo(fileName: string, position: number): string; - // Returns a JSON encoded value of the type: - // { fileName: string; textSpan: { start: number; length: number}; kind: string; name: string; containerKind: string; containerName: string } - // - // Or null value if no definition can be found. + /** + * Returns a JSON-encoded value of the type: + * { fileName: string, textSpan: { start: number, length: number } }[] + */ + findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): string; + + /** + * Returns a JSON-encoded value of the type: + * { fileName: string; textSpan: { start: number; length: number}; kind: string; name: string; containerKind: string; containerName: string } + * + * Or undefined value if no definition can be found. + */ getDefinitionAtPosition(fileName: string, position: number): string; - // Returns a JSON encoded value of the type: - // { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] + /** + * Returns a JSON-encoded value of the type: + * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] + */ getReferencesAtPosition(fileName: string, position: number): string; - // Returns a JSON encoded value of the type: - // { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] + /** + * Returns a JSON-encoded value of the type: + * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] + */ getOccurrencesAtPosition(fileName: string, position: number): string; - // Returns a JSON encoded value of the type: - // { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] - getImplementorsAtPosition(fileName: string, position: number): string; - - // 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}; } [] = []; + /** + * 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): string; - // Returns a JSON encoded value of the type: - // { text: string; kind: string; kindModifiers: string; bolded: boolean; grayed: boolean; indent: number; spans: { start: number; length: number; }[]; childItems: [] } [] = []; + /** + * Returns a JSON-encoded value of the type: + * { text: string; kind: string; kindModifiers: string; bolded: boolean; grayed: boolean; indent: number; spans: { start: number; length: number; }[]; childItems: [] } [] = []; + */ getNavigationBarItems(fileName: string): string; - // Returns a JSON encoded value of the type: - // { textSpan: { start: number, length: number }; hintSpan: { start: number, length: number }; bannerText: string; autoCollapse: boolean } [] = []; + /** + * Returns a JSON-encoded value of the type: + * { textSpan: { start: number, length: number }; hintSpan: { start: number, length: number }; bannerText: string; autoCollapse: boolean } [] = []; + */ getOutliningSpans(fileName: string): string; getTodoComments(fileName: string, todoCommentDescriptors: string): string; @@ -137,27 +161,28 @@ module ts { } export interface ClassifierShim extends Shim { - getClassificationsForLine(text: string, lexState: EndOfLineState): string; + getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): string; } export interface CoreServicesShim extends Shim { - getPreProcessedFileInfo(fileName: string, sourceText: TypeScript.IScriptSnapshot): string; + getPreProcessedFileInfo(fileName: string, sourceText: IScriptSnapshot): string; getDefaultCompilationSettings(): string; } - /// TODO: delete this, it is only needed untill the VS interface is updated - enum LanguageVersion { + /// TODO: delete this, it is only needed until the VS interface is updated + export const enum LanguageVersion { EcmaScript3 = 0, EcmaScript5 = 1, + EcmaScript6 = 2, } - enum ModuleGenTarget { + export const enum ModuleGenTarget { Unspecified = 0, Synchronous = 1, Asynchronous = 2, } - interface CompilationSettings { + export interface CompilationSettings { propagateEnumConstants?: boolean; removeComments?: boolean; watch?: boolean; @@ -177,15 +202,19 @@ module ts { gatherDiagnostics?: boolean; codepage?: number; emitBOM?: boolean; + + // Declare indexer signature + [index: string]: any; } function languageVersionToScriptTarget(languageVersion: LanguageVersion): ScriptTarget { if (typeof languageVersion === "undefined") return undefined; switch (languageVersion) { - case LanguageVersion.EcmaScript3: return ScriptTarget.ES3; + case LanguageVersion.EcmaScript3: return ScriptTarget.ES3 case LanguageVersion.EcmaScript5: return ScriptTarget.ES5; - default: throw Error("unsuported LanguageVersion value: " + languageVersion); + case LanguageVersion.EcmaScript6: return ScriptTarget.ES6; + default: throw Error("unsupported LanguageVersion value: " + languageVersion); } } @@ -196,7 +225,7 @@ module ts { case ModuleGenTarget.Asynchronous: return ModuleKind.AMD; case ModuleGenTarget.Synchronous: return ModuleKind.CommonJS; case ModuleGenTarget.Unspecified: return ModuleKind.None; - default: throw Error("unsuported ModuleGenTarget value: " + moduleGenTarget); + default: throw Error("unsupported ModuleGenTarget value: " + moduleGenTarget); } } @@ -206,7 +235,8 @@ module ts { switch (scriptTarget) { case ScriptTarget.ES3: return LanguageVersion.EcmaScript3; case ScriptTarget.ES5: return LanguageVersion.EcmaScript5; - default: throw Error("unsuported ScriptTarget value: " + scriptTarget); + case ScriptTarget.ES6: return LanguageVersion.EcmaScript6; + default: throw Error("unsupported ScriptTarget value: " + scriptTarget); } } @@ -217,7 +247,7 @@ module ts { case ModuleKind.AMD: return ModuleGenTarget.Asynchronous; case ModuleKind.CommonJS: return ModuleGenTarget.Synchronous; case ModuleKind.None: return ModuleGenTarget.Unspecified; - default: throw Error("unsuported ModuleKind value: " + moduleKind); + default: throw Error("unsupported ModuleKind value: " + moduleKind); } } @@ -268,7 +298,7 @@ module ts { logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); } - class ScriptSnapshotShimAdapter implements TypeScript.IScriptSnapshot { + class ScriptSnapshotShimAdapter implements IScriptSnapshot { private lineStartPositions: number[] = null; constructor(private scriptSnapshotShim: ScriptSnapshotShim) { @@ -290,7 +320,7 @@ module ts { return this.lineStartPositions; } - public getChangeRange(oldSnapshot: TypeScript.IScriptSnapshot): TypeScript.TextChangeRange { + public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange { var oldSnapshotShim = oldSnapshot; var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); if (encoded == null) { @@ -298,8 +328,8 @@ module ts { } var decoded: { span: { start: number; length: number; }; newLength: number; } = JSON.parse(encoded); - return new TypeScript.TextChangeRange( - new TypeScript.TextSpan(decoded.span.start, decoded.span.length), decoded.newLength); + return new TextChangeRange( + new TextSpan(decoded.span.start, decoded.span.length), decoded.newLength); } } @@ -319,12 +349,6 @@ module ts { } var options = compilationSettingsToCompilerOptions(JSON.parse(settingsJson)); - /// TODO: this should be pushed into VS. - /// We can not ask the LS instance to resolve, as this will lead to asking the host about files it does not know about, - /// something it is not desinged to handle. for now make sure we never get a "noresolve == false". - /// This value should not matter, as the host runs resolution logic independentlly - options.noResolve = true; - return options; } @@ -333,7 +357,7 @@ module ts { return JSON.parse(encoded); } - public getScriptSnapshot(fileName: string): TypeScript.IScriptSnapshot { + public getScriptSnapshot(fileName: string): IScriptSnapshot { return new ScriptSnapshotShimAdapter(this.shimHost.getScriptSnapshot(fileName)); } @@ -350,6 +374,7 @@ module ts { if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { return null; } + try { return JSON.parse(diagnosticMessagesJson); } @@ -362,6 +387,14 @@ module ts { public getCancellationToken(): CancellationToken { return this.shimHost.getCancellationToken(); } + + public getDefaultLibFilename(): string { + return this.shimHost.getDefaultLibFilename(); + } + + public getCurrentDirectory(): string { + return this.shimHost.getCurrentDirectory(); + } } function simpleForwardCall(logger: Logger, actionDescription: string, action: () => any): any { @@ -418,9 +451,12 @@ module ts { return forwardJSONCall(this.logger, actionDescription, action); } - // DISPOSE - // Ensure (almost) determinstic release of internal Javascript resources when - // some external native objects holds onto us (e.g. Com/Interop). + /// DISPOSE + + /** + * Ensure (almost) deterministic release of internal Javascript resources when + * some external native objects holds onto us (e.g. Com/Interop). + */ public dispose(dummy: any): void { this.logger.log("dispose()"); this.languageService.dispose(); @@ -437,8 +473,11 @@ module ts { super.dispose(dummy); } - // REFRESH - // Update the list of scripts known to the compiler + /// REFRESH + + /** + * Update the list of scripts known to the compiler + */ public refresh(throwOnError: boolean): void { this.forwardJSONCall( "refresh(" + throwOnError + ")", @@ -462,19 +501,27 @@ module ts { start: diagnostic.start, length: diagnostic.length, /// TODO: no need for the tolowerCase call - category: DiagnosticCategory[diagnostic.category].toLowerCase() + category: DiagnosticCategory[diagnostic.category].toLowerCase(), + code: diagnostic.code }; } - private realizeDiagnosticWithFileName(diagnostic: Diagnostic): { fileName: string; message: string; start: number; length: number; category: string; } { - return { - fileName: diagnostic.file.filename, - message: diagnostic.messageText, - start: diagnostic.start, - length: diagnostic.length, - /// TODO: no need for the tolowerCase call - category: DiagnosticCategory[diagnostic.category].toLowerCase() - }; + public getSyntacticClassifications(fileName: string, start: number, length: number): string { + return this.forwardJSONCall( + "getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", + () => { + var classifications = this.languageService.getSyntacticClassifications(fileName, new TextSpan(start, length)); + return classifications; + }); + } + + public getSemanticClassifications(fileName: string, start: number, length: number): string { + return this.forwardJSONCall( + "getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", + () => { + var classifications = this.languageService.getSemanticClassifications(fileName, new TextSpan(start, length)); + return classifications; + }); } public getSyntacticDiagnostics(fileName: string): string { @@ -500,25 +547,32 @@ module ts { "getCompilerOptionsDiagnostics()", () => { var errors = this.languageService.getCompilerOptionsDiagnostics(); - return errors.map(d => this.realizeDiagnosticWithFileName(d)) + return errors.map(LanguageServiceShimObject.realizeDiagnostic) }); } /// QUICKINFO - /// Computes a string representation of the type at the requested position - /// in the active file. - public getTypeAtPosition(fileName: string, position: number): string { + + /** + * Computes a string representation of the type at the requested position + * in the active file. + */ + public getQuickInfoAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( - "getTypeAtPosition('" + fileName + "', " + position + ")", + "getQuickInfoAtPosition('" + fileName + "', " + position + ")", () => { - var typeInfo = this.languageService.getTypeAtPosition(fileName, position); - return typeInfo; + var quickInfo = this.languageService.getQuickInfoAtPosition(fileName, position); + return quickInfo; }); } + /// NAMEORDOTTEDNAMESPAN - /// Computes span information of the name or dotted name at the requested position - // in the active file. + + /** + * Computes span information of the name or dotted name at the requested position + * in the active file. + */ public getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): string { return this.forwardJSONCall( "getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", @@ -528,8 +582,10 @@ module ts { }); } - /// STATEMENTSPAN - /// Computes span information of statement at the requested position in the active file. + /** + * STATEMENTSPAN + * Computes span information of statement at the requested position in the active file. + */ public getBreakpointStatementAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( "getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", @@ -550,19 +606,12 @@ module ts { }); } - public getSignatureHelpCurrentArgumentState(fileName: string, position: number, applicableSpanStart: number): string { - return this.forwardJSONCall( - "getSignatureHelpCurrentArgumentState('" + fileName + "', " + position + ", " + applicableSpanStart + ")", - () => { - var signatureInfo = this.languageService.getSignatureHelpItems(fileName, position); - return signatureInfo; - }); - } - - /// GOTO DEFINITION - /// Computes the definition location and file for the symbol - /// at the requested position. + + /** + * Computes the definition location and file for the symbol + * at the requested position. + */ public getDefinitionAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( "getDefinitionAtPosition('" + fileName + "', " + position + ")", @@ -579,6 +628,14 @@ module ts { }); } + public findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): string { + return this.forwardJSONCall( + "findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", + () => { + return this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); + }); + } + /// GET BRACE MATCHING public getBraceMatchingAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( @@ -600,9 +657,12 @@ module ts { } /// GET REFERENCES - /// Return references to a symbol at the requested position. - /// References are separated by "\n". - /// Each reference is a "fileindex min lim" sub-string. + + /** + * Return references to a symbol at the requested position. + * References are separated by "\n". + * Each reference is a "fileindex min lim" sub-string. + */ public getReferencesAtPosition(fileName: string, position: number): string { return this.forwardJSONCall( "getReferencesAtPosition('" + fileName + "', " + position + ")", @@ -619,20 +679,13 @@ module ts { }); } - /// GET IMPLEMENTORS - public getImplementorsAtPosition(fileName: string, position: number): string { - return this.forwardJSONCall( - "getImplementorsAtPosition('" + fileName + "', " + position + ")", - () => { - return this.languageService.getImplementorsAtPosition(fileName, position); - }); - } - - /// COMPLETION LISTS - /// Get a string based representation of the completions - /// to provide at the given source position and providing a member completion - /// list if requested. + + /** + * Get a string based representation of the completions + * to provide at the given source position and providing a member completion + * list if requested. + */ public getCompletionsAtPosition(fileName: string, position: number, isMemberCompletion: boolean) { return this.forwardJSONCall( "getCompletionsAtPosition('" + fileName + "', " + position + ", " + isMemberCompletion + ")", @@ -642,7 +695,7 @@ module ts { }); } - /// Get a string based representation of a completion list entry details + /** Get a string based representation of a completion list entry details */ public getCompletionEntryDetails(fileName: string, position: number, entryName: string) { return this.forwardJSONCall( "getCompletionEntryDetails('" + fileName + "', " + position + ", " + entryName + ")", @@ -683,7 +736,8 @@ module ts { } /// NAVIGATE TO - /// Return a list of symbols that are interesting to navigate to + + /** Return a list of symbols that are interesting to navigate to */ public getNavigateToItems(searchValue: string): string { return this.forwardJSONCall( "getNavigateToItems('" + searchValue + "')", @@ -740,8 +794,8 @@ module ts { } /// COLORIZATION - public getClassificationsForLine(text: string, lexState: EndOfLineState): string { - var classification = this.classifier.getClassificationsForLine(text, lexState); + public getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): string { + var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); var items = classification.entries; var result = ""; for (var i = 0; i < items.length; i++) { @@ -762,21 +816,36 @@ module ts { return forwardJSONCall(this.logger, actionDescription, action); } - /// - /// getPreProcessedFileInfo - /// - public getPreProcessedFileInfo(fileName: string, sourceText: TypeScript.IScriptSnapshot): string { + public getPreProcessedFileInfo(fileName: string, sourceTextSnapshot: IScriptSnapshot): string { return this.forwardJSONCall( "getPreProcessedFileInfo('" + fileName + "')", () => { - var result = TypeScript.preProcessFile(fileName, sourceText); - return result; + var result = preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength())); + var convertResult = { + referencedFiles: [], + importedFiles: [], + isLibFile: result.isLibFile + }; + + forEach(result.referencedFiles, refFile => { + convertResult.referencedFiles.push({ + path: normalizePath(refFile.filename), + position: refFile.pos, + length: refFile.end - refFile.pos + }); + }); + + forEach(result.importedFiles, importedFile => { + convertResult.importedFiles.push({ + path: normalizeSlashes(importedFile.filename), + position: importedFile.pos, + length: importedFile.end - importedFile.pos + }); + }); + return convertResult; }); } - /// - /// getDefaultCompilationSettings - /// public getDefaultCompilationSettings(): string { return this.forwardJSONCall( "getDefaultCompilationSettings()", @@ -840,13 +909,13 @@ module ts { } } - throw TypeScript.Errors.invalidOperation(); + throw new Error("Invalid operation"); } } } -/// TODO: this is used by VS, clean this up on both sides of the interfrace +/// TODO: this is used by VS, clean this up on both sides of the interface module TypeScript.Services { export var TypeScriptServicesFactory = ts.TypeScriptServicesFactory; } diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts new file mode 100644 index 00000000000..e2b65e3c6e1 --- /dev/null +++ b/src/services/signatureHelp.ts @@ -0,0 +1,550 @@ +/// + +module ts.SignatureHelp { + + // A partially written generic type expression is not guaranteed to have the correct syntax tree. the expression could be parsed as less than/greater than expression or a comma expression + // or some other combination depending on what the user has typed so far. For the purposes of signature help we need to consider any location after "<" as a possible generic type reference. + // To do this, the method will back parse the expression starting at the position required. it will try to parse the current expression as a generic type expression, if it did succeed it + // will return the generic identifier that started the expression (e.g. "foo" in "foo[]; + var resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates); + cancellationToken.throwIfCancellationRequested(); + + if (!candidates.length) { + return undefined; + } + + return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); + + /** + * Returns relevant information for the argument list and the current argument if we are + * in the argument of an invocation; returns undefined otherwise. + */ + function getImmediatelyContainingArgumentInfo(node: Node): ArgumentListInfo { + if (node.parent.kind === SyntaxKind.CallExpression || node.parent.kind === SyntaxKind.NewExpression) { + var callExpression = node.parent; + // There are 3 cases to handle: + // 1. The token introduces a list, and should begin a sig help session + // 2. The token is either not associated with a list, or ends a list, so the session should end + // 3. The token is buried inside a list, and should give sig help + // + // The following are examples of each: + // + // Case 1: + // foo<#T, U>(#a, b) -> The token introduces a list, and should begin a sig help session + // Case 2: + // fo#o#(a, b)# -> The token is either not associated with a list, or ends a list, so the session should end + // Case 3: + // foo(a#, #b#) -> The token is buried inside a list, and should give sig help + // Find out if 'node' is an argument, a type argument, or neither + if (node.kind === SyntaxKind.LessThanToken || + node.kind === SyntaxKind.OpenParenToken) { + // Find the list that starts right *after* the < or ( token. + // If the user has just opened a list, consider this item 0. + var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile); + var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; + Debug.assert(list !== undefined); + return { + kind: isTypeArgList ? ArgumentListKind.TypeArguments : ArgumentListKind.CallArguments, + invocation: callExpression, + argumentsSpan: getApplicableSpanForArguments(list), + argumentIndex: 0, + argumentCount: getCommaBasedArgCount(list) + }; + } + + // findListItemInfo can return undefined if we are not in parent's argument list + // or type argument list. This includes cases where the cursor is: + // - To the right of the closing paren, non-substitution template, or template tail. + // - Between the type arguments and the arguments (greater than token) + // - On the target of the call (parent.func) + // - On the 'new' keyword in a 'new' expression + var listItemInfo = findListItemInfo(node); + if (listItemInfo) { + var list = listItemInfo.list; + var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; + + // The listItemIndex we got back includes commas. Our goal is to return the index of the proper + // item (not including commas). Here are some examples: + // 1. foo(a, b, c #) -> the listItemIndex is 4, we want to return 2 + // 2. foo(a, b, # c) -> listItemIndex is 3, we want to return 2 + // 3. foo(#a) -> listItemIndex is 0, we want to return 0 + // + // In general, we want to subtract the number of commas before the current index. + // But if we are on a comma, we also want to pretend we are on the argument *following* + // the comma. That amounts to taking the ceiling of half the index. + var argumentIndex = (listItemInfo.listItemIndex + 1) >> 1; + + return { + kind: isTypeArgList ? ArgumentListKind.TypeArguments : ArgumentListKind.CallArguments, + invocation: callExpression, + argumentsSpan: getApplicableSpanForArguments(list), + argumentIndex: argumentIndex, + argumentCount: getCommaBasedArgCount(list) + }; + } + } + else if (node.kind === SyntaxKind.NoSubstitutionTemplateLiteral && node.parent.kind === SyntaxKind.TaggedTemplateExpression) { + // Check if we're actually inside the template; + // otherwise we'll fall out and return undefined. + if (isInsideTemplateLiteral(node, position)) { + return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0); + } + } + else if (node.kind === SyntaxKind.TemplateHead && node.parent.parent.kind === SyntaxKind.TaggedTemplateExpression) { + var templateExpression = node.parent; + var tagExpression = templateExpression.parent; + Debug.assert(templateExpression.kind === SyntaxKind.TemplateExpression); + + var argumentIndex = isInsideTemplateLiteral(node, position) ? 0 : 1; + + return getArgumentListInfoForTemplate(tagExpression, argumentIndex); + } + else if (node.parent.kind === SyntaxKind.TemplateSpan && node.parent.parent.parent.kind === SyntaxKind.TaggedTemplateExpression) { + var templateSpan = node.parent; + var templateExpression = templateSpan.parent; + var tagExpression = templateExpression.parent; + Debug.assert(templateExpression.kind === SyntaxKind.TemplateExpression); + + // If we're just after a template tail, don't show signature help. + if (node.kind === SyntaxKind.TemplateTail && position >= node.getEnd() && !isUnterminatedTemplateEnd(node)) { + return undefined; + } + + var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); + var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node); + + return getArgumentListInfoForTemplate(tagExpression, argumentIndex); + } + + return undefined; + } + + function getCommaBasedArgCount(argumentsList: Node) { + // The number of arguments is the number of commas plus one, unless the list + // is completely empty, in which case there are 0 arguments. + return argumentsList.getChildCount() === 0 + ? 0 + : 1 + countWhere(argumentsList.getChildren(), arg => arg.kind === SyntaxKind.CommaToken); + } + + // spanIndex is either the index for a given template span. + // This does not give appropriate results for a NoSubstitutionTemplateLiteral + function getArgumentIndexForTemplatePiece(spanIndex: number, node: Node): number { + // Because the TemplateStringsArray is the first argument, we have to offset each substitution expression by 1. + // There are three cases we can encounter: + // 1. We are precisely in the template literal (argIndex = 0). + // 2. We are in or to the right of the substitution expression (argIndex = spanIndex + 1). + // 3. We are directly to the right of the template literal, but because we look for the token on the left, + // not enough to put us in the substitution expression; we should consider ourselves part of + // the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1). + // + // Example: f `# abcd $#{# 1 + 1# }# efghi ${ #"#hello"# } # ` + // ^ ^ ^ ^ ^ ^ ^ ^ ^ + // Case: 1 1 3 2 1 3 2 2 1 + Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); + if (isTemplateLiteralKind(node.kind)) { + if (isInsideTemplateLiteral(node, position)) { + return 0; + } + return spanIndex + 2; + } + return spanIndex + 1; + } + + function getArgumentListInfoForTemplate(tagExpression: TaggedTemplateExpression, argumentIndex: number): ArgumentListInfo { + // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. + var argumentCount = tagExpression.template.kind === SyntaxKind.NoSubstitutionTemplateLiteral + ? 1 + : (tagExpression.template).templateSpans.length + 1; + + return { + kind: ArgumentListKind.TaggedTemplateArguments, + invocation: tagExpression, + argumentsSpan: getApplicableSpanForTaggedTemplate(tagExpression), + argumentIndex: argumentIndex, + argumentCount: argumentCount + }; + } + + function getApplicableSpanForArguments(argumentsList: Node): TextSpan { + // We use full start and skip trivia on the end because we want to include trivia on + // both sides. For example, + // + // foo( /*comment */ a, b, c /*comment*/ ) + // | | + // + // The applicable span is from the first bar to the second bar (inclusive, + // but not including parentheses) + var applicableSpanStart = argumentsList.getFullStart(); + var applicableSpanEnd = skipTrivia(sourceFile.text, argumentsList.getEnd(), /*stopAfterLineBreak*/ false); + return new TextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + } + + function getApplicableSpanForTaggedTemplate(taggedTemplate: TaggedTemplateExpression): TextSpan { + var template = taggedTemplate.template; + var applicableSpanStart = template.getStart(); + var applicableSpanEnd = template.getEnd(); + + // We need to adjust the end position for the case where the template does not have a tail. + // Otherwise, we will not show signature help past the expression. + // For example, + // + // ` ${ 1 + 1 foo(10) + // | | + // + // This is because a Missing node has no width. However, what we actually want is to include trivia + // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. + if (template.kind === SyntaxKind.TemplateExpression) { + var lastSpan = lastOrUndefined((template).templateSpans); + if (lastSpan.literal.kind === SyntaxKind.Missing) { + applicableSpanEnd = skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); + } + } + + return new TextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + } + + function getContainingArgumentInfo(node: Node): ArgumentListInfo { + for (var n = node; n.kind !== SyntaxKind.SourceFile; n = n.parent) { + if (n.kind === SyntaxKind.FunctionBlock) { + return undefined; + } + + // If the node is not a subspan of its parent, this is a big problem. + // There have been crashes that might be caused by this violation. + if (n.pos < n.parent.pos || n.end > n.parent.end) { + Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); + } + + var argumentInfo = getImmediatelyContainingArgumentInfo(n); + if (argumentInfo) { + return argumentInfo; + } + + + // TODO: Handle generic call with incomplete syntax + } + return undefined; + } + + function getChildListThatStartsWithOpenerToken(parent: Node, openerToken: Node, sourceFile: SourceFile): Node { + var children = parent.getChildren(sourceFile); + var indexOfOpenerToken = children.indexOf(openerToken); + Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); + return children[indexOfOpenerToken + 1]; + } + + /** + * The selectedItemIndex could be negative for several reasons. + * 1. There are too many arguments for all of the overloads + * 2. None of the overloads were type compatible + * The solution here is to try to pick the best overload by picking + * either the first one that has an appropriate number of parameters, + * or the one with the most parameters. + */ + function selectBestInvalidOverloadIndex(candidates: Signature[], argumentCount: number): number { + var maxParamsSignatureIndex = -1; + var maxParams = -1; + for (var i = 0; i < candidates.length; i++) { + var candidate = candidates[i]; + + if (candidate.hasRestParameter || candidate.parameters.length >= argumentCount) { + return i; + } + + if (candidate.parameters.length > maxParams) { + maxParams = candidate.parameters.length; + maxParamsSignatureIndex = i; + } + } + + return maxParamsSignatureIndex; + } + + function createSignatureHelpItems(candidates: Signature[], bestSignature: Signature, argumentListInfo: ArgumentListInfo): SignatureHelpItems { + var applicableSpan = argumentListInfo.argumentsSpan; + var isTypeParameterList = argumentListInfo.kind === ArgumentListKind.TypeArguments; + + var invocation = argumentListInfo.invocation; + var callTarget = getInvokedExpression(invocation) + var callTargetSymbol = typeInfoResolver.getSymbolInfo(callTarget); + var callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeInfoResolver, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined); + var items: SignatureHelpItem[] = map(candidates, candidateSignature => { + var signatureHelpParameters: SignatureHelpParameter[]; + var prefixDisplayParts: SymbolDisplayPart[] = []; + var suffixDisplayParts: SymbolDisplayPart[] = []; + + if (callTargetDisplayParts) { + prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); + } + + if (isTypeParameterList) { + prefixDisplayParts.push(punctuationPart(SyntaxKind.LessThanToken)); + var typeParameters = candidateSignature.typeParameters; + signatureHelpParameters = typeParameters && typeParameters.length > 0 ? map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; + suffixDisplayParts.push(punctuationPart(SyntaxKind.GreaterThanToken)); + var parameterParts = mapToDisplayParts(writer => + typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation)); + suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); + } + else { + var typeParameterParts = mapToDisplayParts(writer => + typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation)); + prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); + prefixDisplayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + + var parameters = candidateSignature.parameters; + signatureHelpParameters = parameters.length > 0 ? map(parameters, createSignatureHelpParameterForParameter) : emptyArray; + suffixDisplayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + } + + var returnTypeParts = mapToDisplayParts(writer => + typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation)); + suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); + + return { + isVariadic: candidateSignature.hasRestParameter, + prefixDisplayParts, + suffixDisplayParts, + separatorDisplayParts: [punctuationPart(SyntaxKind.CommaToken), spacePart()], + parameters: signatureHelpParameters, + documentation: candidateSignature.getDocumentationComment() + }; + }); + + var argumentIndex = argumentListInfo.argumentIndex; + + // argumentCount is the *apparent* number of arguments. + var argumentCount = argumentListInfo.argumentCount; + + var selectedItemIndex = candidates.indexOf(bestSignature); + if (selectedItemIndex < 0) { + selectedItemIndex = selectBestInvalidOverloadIndex(candidates, argumentCount); + } + + return { + items, + applicableSpan, + selectedItemIndex, + argumentIndex, + argumentCount + }; + + function createSignatureHelpParameterForParameter(parameter: Symbol): SignatureHelpParameter { + var displayParts = mapToDisplayParts(writer => + typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation)); + + var isOptional = !!(parameter.valueDeclaration.flags & NodeFlags.QuestionMark); + + return { + name: parameter.name, + documentation: parameter.getDocumentationComment(), + displayParts, + isOptional + }; + } + + function createSignatureHelpParameterForTypeParameter(typeParameter: TypeParameter): SignatureHelpParameter { + var displayParts = mapToDisplayParts(writer => + typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation)); + + return { + name: typeParameter.symbol.name, + documentation: emptyArray, + displayParts, + isOptional: false + }; + } + } + } +} \ No newline at end of file diff --git a/src/services/signatureInfoHelpers.ts b/src/services/signatureInfoHelpers.ts deleted file mode 100644 index 145dcc02381..00000000000 --- a/src/services/signatureInfoHelpers.ts +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. -// See LICENSE.txt in the project root for complete license information. - -/// - -module TypeScript.Services { - - export interface IPartiallyWrittenTypeArgumentListInformation { - genericIdentifer: TypeScript.ISyntaxToken; - lessThanToken: TypeScript.ISyntaxToken; - argumentIndex: number; - } - - export interface IExpressionWithArgumentListSyntax extends IExpressionSyntax { - expression: IExpressionSyntax; - argumentList: ArgumentListSyntax; - } - - export class SignatureInfoHelpers { - - // A partially written generic type expression is not guaranteed to have the correct syntax tree. the expression could be parsed as less than/greater than expression or a comma expression - // or some other combination depending on what the user has typed so far. For the purposes of signature help we need to consider any location after "<" as a possible generic type reference. - // To do this, the method will back parse the expression starting at the position required. it will try to parse the current expression as a generic type expression, if it did succeed it - // will return the generic identifier that started the expression (e.g. "foo" in "foo 1; - - for (var i = 0, n = signatures.length; i < n; i++) { - var signature = signatures[i]; - - // filter out the definition signature if there are overloads - if (hasOverloads && signature.isDefinition()) { - continue; - } - - var signatureGroupInfo = new FormalSignatureItemInfo(); - var paramIndexInfo: number[] = []; - var functionName = signature.getScopedNameEx(enclosingScopeSymbol).toString(); - if (!functionName && (!symbol.isType() || (symbol).isNamedTypeSymbol())) { - functionName = symbol.getScopedNameEx(enclosingScopeSymbol).toString(); - } - - var signatureMemberName = signature.getSignatureTypeNameEx(functionName, /*shortform*/ false, /*brackets*/ false, enclosingScopeSymbol, /*getParamMarkerInfo*/ true, /*getTypeParameterMarkerInfo*/ true); - signatureGroupInfo.signatureInfo = TypeScript.MemberName.memberNameToString(signatureMemberName, paramIndexInfo); - signatureGroupInfo.docComment = signature.docComments(); - - var parameterMarkerIndex = 0; - - if (signature.isGeneric()) { - var typeParameters = signature.getTypeParameters(); - for (var j = 0, m = typeParameters.length; j < m; j++) { - var typeParameter = typeParameters[j]; - var signatureTypeParameterInfo = new FormalTypeParameterInfo(); - signatureTypeParameterInfo.name = typeParameter.getDisplayName(); - signatureTypeParameterInfo.docComment = typeParameter.docComments(); - signatureTypeParameterInfo.minChar = paramIndexInfo[2 * parameterMarkerIndex]; - signatureTypeParameterInfo.limChar = paramIndexInfo[2 * parameterMarkerIndex + 1]; - parameterMarkerIndex++; - signatureGroupInfo.typeParameters.push(signatureTypeParameterInfo); - } - } - - var parameters = signature.parameters; - for (var j = 0, m = parameters.length; j < m; j++) { - var parameter = parameters[j]; - var signatureParameterInfo = new FormalParameterInfo(); - signatureParameterInfo.isVariable = signature.hasVarArgs && (j === parameters.length - 1); - signatureParameterInfo.name = parameter.getDisplayName(); - signatureParameterInfo.docComment = parameter.docComments(); - signatureParameterInfo.minChar = paramIndexInfo[2 * parameterMarkerIndex]; - signatureParameterInfo.limChar = paramIndexInfo[2 * parameterMarkerIndex + 1]; - parameterMarkerIndex++; - signatureGroupInfo.parameters.push(signatureParameterInfo); - } - - signatureGroup.push(signatureGroupInfo); - } - - return signatureGroup; - } - - public static getSignatureInfoFromGenericSymbol(symbol: TypeScript.PullSymbol, enclosingScopeSymbol: TypeScript.PullSymbol, compilerState: LanguageServiceCompiler) { - var signatureGroupInfo = new FormalSignatureItemInfo(); - - var paramIndexInfo: number[] = []; - var symbolName = symbol.getScopedNameEx(enclosingScopeSymbol, /*skipTypeParametersInName*/ false, /*useConstaintInName*/ true, /*getPrettyTypeName*/ false, /*getTypeParamMarkerInfo*/ true); - - signatureGroupInfo.signatureInfo = TypeScript.MemberName.memberNameToString(symbolName, paramIndexInfo); - signatureGroupInfo.docComment = symbol.docComments(); - - var parameterMarkerIndex = 0; - - var typeSymbol = symbol.type; - - var typeParameters = typeSymbol.getTypeParameters(); - for (var i = 0, n = typeParameters.length; i < n; i++) { - var typeParameter = typeParameters[i]; - var signatureTypeParameterInfo = new FormalTypeParameterInfo(); - signatureTypeParameterInfo.name = typeParameter.getDisplayName(); - signatureTypeParameterInfo.docComment = typeParameter.docComments(); - signatureTypeParameterInfo.minChar = paramIndexInfo[2 * i]; - signatureTypeParameterInfo.limChar = paramIndexInfo[2 * i + 1]; - signatureGroupInfo.typeParameters.push(signatureTypeParameterInfo); - } - - return [signatureGroupInfo]; - } - - public static getActualSignatureInfoFromCallExpression(ast: IExpressionWithArgumentListSyntax, caretPosition: number, typeParameterInformation: IPartiallyWrittenTypeArgumentListInformation): ActualSignatureInfo { - if (!ast) { - return null; - } - - var result = new ActualSignatureInfo(); - - // The expression is not guaranteed to be complete, we need to populate the min and lim with the most accurate information we have about - // type argument and argument lists - var parameterMinChar = caretPosition; - var parameterLimChar = caretPosition; - - if (ast.argumentList.typeArgumentList) { - parameterMinChar = Math.min(start(ast.argumentList.typeArgumentList)); - parameterLimChar = Math.max(Math.max(start(ast.argumentList.typeArgumentList), end(ast.argumentList.typeArgumentList) + trailingTriviaWidth(ast.argumentList.typeArgumentList))); - } - - if (ast.argumentList.arguments) { - parameterMinChar = Math.min(parameterMinChar, end(ast.argumentList.openParenToken)); - parameterLimChar = Math.max(parameterLimChar, - ast.argumentList.closeParenToken.fullWidth() > 0 ? start(ast.argumentList.closeParenToken) : fullEnd(ast.argumentList)); - } - - result.parameterMinChar = parameterMinChar; - result.parameterLimChar = parameterLimChar; - result.currentParameterIsTypeParameter = false; - result.currentParameter = -1; - - if (typeParameterInformation) { - result.currentParameterIsTypeParameter = true; - result.currentParameter = typeParameterInformation.argumentIndex; - } - else if (ast.argumentList.arguments && ast.argumentList.arguments.length > 0) { - result.currentParameter = 0; - for (var index = 0; index < ast.argumentList.arguments.length; index++) { - if (caretPosition > end(ast.argumentList.arguments[index]) + lastToken(ast.argumentList.arguments[index]).trailingTriviaWidth()) { - result.currentParameter++; - } - } - } - - return result; - } - - public static getActualSignatureInfoFromPartiallyWritenGenericExpression(caretPosition: number, typeParameterInformation: IPartiallyWrittenTypeArgumentListInformation): ActualSignatureInfo { - var result = new ActualSignatureInfo(); - - result.parameterMinChar = start(typeParameterInformation.lessThanToken); - result.parameterLimChar = Math.max(fullEnd(typeParameterInformation.lessThanToken), caretPosition); - result.currentParameterIsTypeParameter = true; - result.currentParameter = typeParameterInformation.argumentIndex; - - return result; - } - - public static isSignatureHelpBlocker(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean { - // We shouldn't be getting a possition that is outside the file because - // isEntirelyInsideComment can't handle when the position is out of bounds, - // callers should be fixed, however we should be resiliant to bad inputs - // so we return true (this position is a blocker for getting signature help) - if (position < 0 || position > fullWidth(sourceUnit)) { - return true; - } - - return TypeScript.Syntax.isEntirelyInsideComment(sourceUnit, position); - } - - public static isTargetOfObjectCreationExpression(positionedToken: TypeScript.ISyntaxToken): boolean { - var positionedParent = TypeScript.Syntax.getAncestorOfKind(positionedToken, TypeScript.SyntaxKind.ObjectCreationExpression); - if (positionedParent) { - var objectCreationExpression = positionedParent; - var expressionRelativeStart = objectCreationExpression.newKeyword.fullWidth(); - var tokenRelativeStart = positionedToken.fullStart() - fullStart(positionedParent); - return tokenRelativeStart >= expressionRelativeStart && - tokenRelativeStart <= (expressionRelativeStart + fullWidth(objectCreationExpression.expression)); - } - - return false; - } - - private static moveBackUpTillMatchingTokenKind(token: TypeScript.ISyntaxToken, tokenKind: TypeScript.SyntaxKind, matchingTokenKind: TypeScript.SyntaxKind): TypeScript.ISyntaxToken { - if (!token || token.kind() !== tokenKind) { - throw TypeScript.Errors.invalidOperation(); - } - - // Skip the current token - token = previousToken(token, /*includeSkippedTokens*/ true); - - var stack = 0; - - while (token) { - if (token.kind() === matchingTokenKind) { - if (stack === 0) { - // Found the matching token, return - return token; - } - else if (stack < 0) { - // tokens overlapped.. bail out. - break; - } - else { - stack--; - } - } - else if (token.kind() === tokenKind) { - stack++; - } - - // Move back - token = previousToken(token, /*includeSkippedTokens*/ true); - } - - // Did not find matching token - return null; - } - } -} \ No newline at end of file diff --git a/src/services/smartIndenter.ts b/src/services/smartIndenter.ts new file mode 100644 index 00000000000..e593c6cfd66 --- /dev/null +++ b/src/services/smartIndenter.ts @@ -0,0 +1,449 @@ +/// + +module ts.formatting { + export module SmartIndenter { + export function getIndentation(position: number, sourceFile: SourceFile, options: EditorOptions): number { + if (position > sourceFile.text.length) { + return 0; // past EOF + } + + var precedingToken = findPrecedingToken(position, sourceFile); + if (!precedingToken) { + return 0; + } + + // no indentation in string \regex literals + if ((precedingToken.kind === SyntaxKind.StringLiteral || precedingToken.kind === SyntaxKind.RegularExpressionLiteral) && + precedingToken.getStart(sourceFile) <= position && + precedingToken.end > position) { + return 0; + } + + var lineAtPosition = sourceFile.getLineAndCharacterFromPosition(position).line; + + if (precedingToken.kind === SyntaxKind.CommaToken && precedingToken.parent.kind !== SyntaxKind.BinaryExpression) { + // previous token is comma that separates items in list - find the previous item and try to derive indentation from it + var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation; + } + } + + // try to find node that can contribute to indentation and includes 'position' starting from 'precedingToken' + // if such node is found - compute initial indentation for 'position' inside this node + var previous: Node; + var current = precedingToken; + var currentStart: LineAndCharacter; + var indentationDelta: number; + + while (current) { + if (positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : SyntaxKind.Unknown)) { + currentStart = getStartLineAndCharacterForNode(current, sourceFile); + + if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { + indentationDelta = 0; + } + else { + indentationDelta = lineAtPosition !== currentStart.line ? options.IndentSize : 0; + } + + break; + } + + // check if current node is a list item - if yes, take indentation from it + var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation; + } + + previous = current; + current = current.parent; + } + + if (!current) { + // no parent was found - return 0 to be indented on the level of SourceFile + return 0; + } + + return getIndentationForNodeWorker(current, currentStart, /*ignoreActualIndentationRange*/ undefined, indentationDelta, sourceFile, options); + } + + export function getIndentationForNode(n: Node, ignoreActualIndentationRange: TextRange, sourceFile: SourceFile, options: FormatCodeOptions): number { + var start = sourceFile.getLineAndCharacterFromPosition(n.getStart(sourceFile)); + return getIndentationForNodeWorker(n, start, ignoreActualIndentationRange, /*indentationDelta*/ 0, sourceFile, options); + } + + function getIndentationForNodeWorker( + current: Node, + currentStart: LineAndCharacter, + ignoreActualIndentationRange: TextRange, + indentationDelta: number, + sourceFile: SourceFile, + options: EditorOptions): number { + + var parent: Node = current.parent; + var parentStart: LineAndCharacter; + + // walk upwards and collect indentations for pairs of parent-child nodes + // indentation is not added if parent and child nodes start on the same line or if parent is IfStatement and child starts on the same line with 'else clause' + while (parent) { + var useActualIndentation = true; + if (ignoreActualIndentationRange) { + var start = current.getStart(sourceFile); + useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; + } + + if (useActualIndentation) { + // check if current node is a list item - if yes, take indentation from it + var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } + } + parentStart = getParentStart(parent, current, sourceFile); + var parentAndChildShareLine = + parentStart.line === currentStart.line || + childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); + + if (useActualIndentation) { + // try to fetch actual indentation for current node from source text + var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } + } + + // increase indentation if parent node wants its content to be indented and parent and child nodes don't start on the same line + if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { + indentationDelta += options.IndentSize; + } + + current = parent; + currentStart = parentStart; + parent = current.parent; + } + + return indentationDelta; + } + + + function getParentStart(parent: Node, child: Node, sourceFile: SourceFile): LineAndCharacter { + var containingList = getContainingList(child, sourceFile); + if (containingList) { + return sourceFile.getLineAndCharacterFromPosition(containingList.pos); + } + + return sourceFile.getLineAndCharacterFromPosition(parent.getStart(sourceFile)); + } + + /* + * Function returns -1 if indentation cannot be determined + */ + function getActualIndentationForListItemBeforeComma(commaToken: Node, sourceFile: SourceFile, options: EditorOptions): number { + // previous token is comma that separates items in list - find the previous item and try to derive indentation from it + var commaItemInfo = findListItemInfo(commaToken); + Debug.assert(commaItemInfo && commaItemInfo.listItemIndex > 0); + // The item we're interested in is right before the comma + return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); + } + + /* + * Function returns -1 if actual indentation for node should not be used (i.e because node is nested expression) + */ + function getActualIndentationForNode(current: Node, + parent: Node, + currentLineAndChar: LineAndCharacter, + parentAndChildShareLine: boolean, + sourceFile: SourceFile, + options: EditorOptions): number { + + // actual indentation is used for statements\declarations if one of cases below is true: + // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually + // - parent and child are not on the same line + var useActualIndentation = + (isDeclaration(current) || isStatement(current)) && + (parent.kind === SyntaxKind.SourceFile || !parentAndChildShareLine); + + if (!useActualIndentation) { + return -1; + } + + return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); + } + + function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken: Node, current: Node, lineAtPosition: number, sourceFile: SourceFile): boolean { + var nextToken = findNextToken(precedingToken, current); + if (!nextToken) { + return false; + } + + if (nextToken.kind === SyntaxKind.OpenBraceToken) { + // open braces are always indented at the parent level + return true; + } + else if (nextToken.kind === SyntaxKind.CloseBraceToken) { + // close braces are indented at the parent level if they are located on the same line with cursor + // this means that if new line will be added at $ position, this case will be indented + // class A { + // $ + // } + /// and this one - not + // class A { + // $} + + var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; + return lineAtPosition === nextTokenStartLine; + } + + return false; + } + + function getStartLineAndCharacterForNode(n: Node, sourceFile: SourceFile): LineAndCharacter { + return sourceFile.getLineAndCharacterFromPosition(n.getStart(sourceFile)); + } + + function positionBelongsToNode(candidate: Node, position: number, sourceFile: SourceFile): boolean { + return candidate.end > position || !isCompletedNode(candidate, sourceFile); + } + + export function childStartsOnTheSameLineWithElseInIfStatement(parent: Node, child: TextRangeWithKind, childStartLine: number, sourceFile: SourceFile): boolean { + if (parent.kind === SyntaxKind.IfStatement && (parent).elseStatement === child) { + var elseKeyword = findChildOfKind(parent, SyntaxKind.ElseKeyword, sourceFile); + Debug.assert(elseKeyword !== undefined); + + var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; + return elseKeywordStartLine === childStartLine; + } + + return false; + } + + function getContainingList(node: Node, sourceFile: SourceFile): NodeArray { + if (node.parent) { + switch (node.parent.kind) { + case SyntaxKind.TypeReference: + if ((node.parent).typeArguments && + rangeContainsStartEnd((node.parent).typeArguments, node.getStart(sourceFile), node.getEnd())) { + return (node.parent).typeArguments; + } + break; + case SyntaxKind.ObjectLiteral: + return (node.parent).properties; + case SyntaxKind.ArrayLiteral: + return (node.parent).elements; + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.Method: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + var start = node.getStart(sourceFile); + if ((node.parent).typeParameters && + rangeContainsStartEnd((node.parent).typeParameters, start, node.getEnd())) { + return (node.parent).typeParameters; + } + if (rangeContainsStartEnd((node.parent).parameters, start, node.getEnd())) { + return (node.parent).parameters; + } + break; + case SyntaxKind.NewExpression: + case SyntaxKind.CallExpression: + var start = node.getStart(sourceFile); + if ((node.parent).typeArguments && + rangeContainsStartEnd((node.parent).typeArguments, start, node.getEnd())) { + return (node.parent).typeArguments; + } + if (rangeContainsStartEnd((node.parent).arguments, start, node.getEnd())) { + return (node.parent).arguments; + } + break; + } + } + return undefined; + } + + function getActualIndentationForListItem(node: Node, sourceFile: SourceFile, options: EditorOptions): number { + var containingList = getContainingList(node, sourceFile); + return containingList ? getActualIndentationFromList(containingList) : -1; + + function getActualIndentationFromList(list: Node[]): number { + var index = indexOf(list, node); + return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1; + } + } + + + function deriveActualIndentationFromList(list: Node[], index: number, sourceFile: SourceFile, options: EditorOptions): number { + Debug.assert(index >= 0 && index < list.length); + var node = list[index]; + + // walk toward the start of the list starting from current node and check if the line is the same for all items. + // if end line for item [i - 1] differs from the start line for item [i] - find column of the first non-whitespace character on the line of item [i] + var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); + for (var i = index - 1; i >= 0; --i) { + if (list[i].kind === SyntaxKind.CommaToken) { + continue; + } + // skip list items that ends on the same line with the current list element + var prevEndLine = sourceFile.getLineAndCharacterFromPosition(list[i].end).line; + if (prevEndLine !== lineAndCharacter.line) { + return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options); + } + + lineAndCharacter = getStartLineAndCharacterForNode(list[i], sourceFile); + } + return -1; + } + + function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter: LineAndCharacter, sourceFile: SourceFile, options: EditorOptions): number { + var lineStart = sourceFile.getPositionFromLineAndCharacter(lineAndCharacter.line, 1); + return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); + } + + export function findFirstNonWhitespaceColumn(startPos: number, endPos: number, sourceFile: SourceFile, options: EditorOptions): number { + var column = 0; + for (var pos = startPos; pos < endPos; ++pos) { + var ch = sourceFile.text.charCodeAt(pos); + if (!isWhiteSpace(ch)) { + return column; + } + + if (ch === CharacterCodes.tab) { + column += options.TabSize + (column % options.TabSize); + } + else { + column++; + } + } + return column; + } + + function nodeContentIsAlwaysIndented(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ArrayLiteral: + case SyntaxKind.Block: + case SyntaxKind.FunctionBlock: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.ModuleBlock: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.TypeLiteral: + case SyntaxKind.SwitchStatement: + case SyntaxKind.DefaultClause: + case SyntaxKind.CaseClause: + case SyntaxKind.ParenExpression: + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + case SyntaxKind.VariableStatement: + case SyntaxKind.VariableDeclaration: + case SyntaxKind.ExportAssignment: + case SyntaxKind.ReturnStatement: + return true; + } + return false; + } + + export function shouldIndentChildNode(parent: SyntaxKind, child: SyntaxKind): boolean { + if (nodeContentIsAlwaysIndented(parent)) { + return true; + } + switch (parent) { + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.IfStatement: + return child !== SyntaxKind.Block; + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Method: + case SyntaxKind.ArrowFunction: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return child !== SyntaxKind.FunctionBlock; + default: + return false; + } + } + + /* + * Checks if node ends with 'expectedLastToken'. + * If child at position 'length - 1' is 'SemicolonToken' it is skipped and 'expectedLastToken' is compared with child at position 'length - 2'. + */ + function nodeEndsWith(n: Node, expectedLastToken: SyntaxKind, sourceFile: SourceFile): boolean { + var children = n.getChildren(sourceFile); + if (children.length) { + var last = children[children.length - 1]; + if (last.kind === expectedLastToken) { + return true; + } + else if (last.kind === SyntaxKind.SemicolonToken && children.length !== 1) { + return children[children.length - 2].kind === expectedLastToken; + } + } + return false; + } + + /* + * This function is always called when position of the cursor is located after the node + */ + function isCompletedNode(n: Node, sourceFile: SourceFile): boolean { + switch (n.kind) { + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.Block: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.FunctionBlock: + case SyntaxKind.ModuleBlock: + case SyntaxKind.SwitchStatement: + return nodeEndsWith(n, SyntaxKind.CloseBraceToken, sourceFile); + case SyntaxKind.ParenExpression: + case SyntaxKind.CallSignature: + case SyntaxKind.CallExpression: + case SyntaxKind.ConstructSignature: + return nodeEndsWith(n, SyntaxKind.CloseParenToken, sourceFile); + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Method: + case SyntaxKind.ArrowFunction: + return !(n).body || isCompletedNode((n).body, sourceFile); + case SyntaxKind.ModuleDeclaration: + return (n).body && isCompletedNode((n).body, sourceFile); + case SyntaxKind.IfStatement: + if ((n).elseStatement) { + return isCompletedNode((n).elseStatement, sourceFile); + } + return isCompletedNode((n).thenStatement, sourceFile); + case SyntaxKind.ExpressionStatement: + return isCompletedNode((n).expression, sourceFile); + case SyntaxKind.ArrayLiteral: + return nodeEndsWith(n, SyntaxKind.CloseBracketToken, sourceFile); + case SyntaxKind.Missing: + return false; + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + // there is no such thing as terminator token for CaseClause\DefaultClause so for simplicitly always consider them non-completed + return false; + case SyntaxKind.WhileStatement: + return isCompletedNode((n).statement, sourceFile); + case SyntaxKind.DoStatement: + // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; + var hasWhileKeyword = findChildOfKind(n, SyntaxKind.WhileKeyword, sourceFile); + if (hasWhileKeyword) { + return nodeEndsWith(n, SyntaxKind.CloseParenToken, sourceFile); + } + return isCompletedNode((n).statement, sourceFile); + default: + return true; + } + } + } +} \ No newline at end of file diff --git a/src/services/syntax/SyntaxGenerator.js b/src/services/syntax/SyntaxGenerator.js new file mode 100644 index 00000000000..6e1039cb8b0 --- /dev/null +++ b/src/services/syntax/SyntaxGenerator.js @@ -0,0 +1,2252 @@ +var sys = (function () { + function getWScriptSystem() { + var fso = new ActiveXObject("Scripting.FileSystemObject"); + var fileStream = new ActiveXObject("ADODB.Stream"); + fileStream.Type = 2; + var binaryStream = new ActiveXObject("ADODB.Stream"); + binaryStream.Type = 1; + var args = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + function readFile(fileName, encoding) { + if (!fso.FileExists(fileName)) { + return undefined; + } + fileStream.Open(); + try { + if (encoding) { + fileStream.Charset = encoding; + fileStream.LoadFromFile(fileName); + } + else { + fileStream.Charset = "x-ansi"; + fileStream.LoadFromFile(fileName); + var bom = fileStream.ReadText(2) || ""; + fileStream.Position = 0; + fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; + } + return fileStream.ReadText(); + } + catch (e) { + throw e; + } + finally { + fileStream.Close(); + } + } + function writeFile(fileName, data, writeByteOrderMark) { + fileStream.Open(); + binaryStream.Open(); + try { + fileStream.Charset = "utf-8"; + fileStream.WriteText(data); + if (writeByteOrderMark) { + fileStream.Position = 0; + } + else { + fileStream.Position = 3; + } + fileStream.CopyTo(binaryStream); + binaryStream.SaveToFile(fileName, 2); + } + finally { + binaryStream.Close(); + fileStream.Close(); + } + } + return { + args: args, + newLine: "\r\n", + useCaseSensitiveFileNames: false, + write: function (s) { + WScript.StdOut.Write(s); + }, + readFile: readFile, + writeFile: writeFile, + resolvePath: function (path) { + return fso.GetAbsolutePathName(path); + }, + fileExists: function (path) { + return fso.FileExists(path); + }, + directoryExists: function (path) { + return fso.FolderExists(path); + }, + createDirectory: function (directoryName) { + if (!this.directoryExists(directoryName)) { + fso.CreateFolder(directoryName); + } + }, + getExecutingFilePath: function () { + return WScript.ScriptFullName; + }, + getCurrentDirectory: function () { + return new ActiveXObject("WScript.Shell").CurrentDirectory; + }, + exit: function (exitCode) { + try { + WScript.Quit(exitCode); + } + catch (e) { + } + } + }; + } + function getNodeSystem() { + var _fs = require("fs"); + var _path = require("path"); + var _os = require('os'); + var platform = _os.platform(); + var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; + function readFile(fileName, encoding) { + if (!_fs.existsSync(fileName)) { + return undefined; + } + var buffer = _fs.readFileSync(fileName); + var len = buffer.length; + if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) { + len &= ~1; + for (var i = 0; i < len; i += 2) { + var temp = buffer[i]; + buffer[i] = buffer[i + 1]; + buffer[i + 1] = temp; + } + return buffer.toString("utf16le", 2); + } + if (len >= 2 && buffer[0] === 0xFF && buffer[1] === 0xFE) { + return buffer.toString("utf16le", 2); + } + if (len >= 3 && buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { + return buffer.toString("utf8", 3); + } + return buffer.toString("utf8"); + } + function writeFile(fileName, data, writeByteOrderMark) { + if (writeByteOrderMark) { + data = '\uFEFF' + data; + } + _fs.writeFileSync(fileName, data, "utf8"); + } + return { + args: process.argv.slice(2), + newLine: _os.EOL, + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + write: function (s) { + _fs.writeSync(1, s); + }, + readFile: readFile, + writeFile: writeFile, + watchFile: function (fileName, callback) { + _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); + return { + close: function () { + _fs.unwatchFile(fileName, fileChanged); + } + }; + function fileChanged(curr, prev) { + if (+curr.mtime <= +prev.mtime) { + return; + } + callback(fileName); + } + ; + }, + resolvePath: function (path) { + return _path.resolve(path); + }, + fileExists: function (path) { + return _fs.existsSync(path); + }, + directoryExists: function (path) { + return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); + }, + createDirectory: function (directoryName) { + if (!this.directoryExists(directoryName)) { + _fs.mkdirSync(directoryName); + } + }, + getExecutingFilePath: function () { + return process.mainModule.filename; + }, + getCurrentDirectory: function () { + return process.cwd(); + }, + getMemoryUsage: function () { + if (global.gc) { + global.gc(); + } + return process.memoryUsage().heapUsed; + }, + exit: function (exitCode) { + process.exit(exitCode); + } + }; + } + if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { + return getWScriptSystem(); + } + else if (typeof module !== "undefined" && module.exports) { + return getNodeSystem(); + } + else { + return undefined; + } +})(); +var TypeScript; +(function (TypeScript) { + var Errors = (function () { + function Errors() { + } + Errors.argument = function (argument, message) { + return new Error("Invalid argument: " + argument + ". " + message); + }; + Errors.argumentOutOfRange = function (argument) { + return new Error("Argument out of range: " + argument); + }; + Errors.argumentNull = function (argument) { + return new Error("Argument null: " + argument); + }; + Errors.abstract = function () { + return new Error("Operation not implemented properly by subclass."); + }; + Errors.notYetImplemented = function () { + return new Error("Not yet implemented."); + }; + Errors.invalidOperation = function (message) { + return new Error("Invalid operation: " + message); + }; + return Errors; + })(); + TypeScript.Errors = Errors; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + var ArrayUtilities = (function () { + function ArrayUtilities() { + } + ArrayUtilities.sequenceEquals = function (array1, array2, equals) { + if (array1 === array2) { + return true; + } + if (!array1 || !array2) { + return false; + } + if (array1.length !== array2.length) { + return false; + } + for (var i = 0, n = array1.length; i < n; i++) { + if (!equals(array1[i], array2[i])) { + return false; + } + } + return true; + }; + ArrayUtilities.contains = function (array, value) { + for (var i = 0; i < array.length; i++) { + if (array[i] === value) { + return true; + } + } + return false; + }; + ArrayUtilities.distinct = function (array, equalsFn) { + var result = []; + for (var i = 0, n = array.length; i < n; i++) { + var current = array[i]; + for (var j = 0; j < result.length; j++) { + if (equalsFn(result[j], current)) { + break; + } + } + if (j === result.length) { + result.push(current); + } + } + return result; + }; + ArrayUtilities.last = function (array) { + if (array.length === 0) { + throw TypeScript.Errors.argumentOutOfRange('array'); + } + return array[array.length - 1]; + }; + ArrayUtilities.lastOrDefault = function (array, predicate) { + for (var i = array.length - 1; i >= 0; i--) { + var v = array[i]; + if (predicate(v, i)) { + return v; + } + } + return undefined; + }; + ArrayUtilities.firstOrDefault = function (array, func) { + for (var i = 0, n = array.length; i < n; i++) { + var value = array[i]; + if (func(value, i)) { + return value; + } + } + return undefined; + }; + ArrayUtilities.first = function (array, func) { + for (var i = 0, n = array.length; i < n; i++) { + var value = array[i]; + if (!func || func(value, i)) { + return value; + } + } + throw TypeScript.Errors.invalidOperation(); + }; + ArrayUtilities.sum = function (array, func) { + var result = 0; + for (var i = 0, n = array.length; i < n; i++) { + result += func(array[i]); + } + return result; + }; + ArrayUtilities.select = function (values, func) { + var result = new Array(values.length); + for (var i = 0; i < values.length; i++) { + result[i] = func(values[i]); + } + return result; + }; + ArrayUtilities.where = function (values, func) { + var result = new Array(); + for (var i = 0; i < values.length; i++) { + if (func(values[i])) { + result.push(values[i]); + } + } + return result; + }; + ArrayUtilities.any = function (array, func) { + for (var i = 0, n = array.length; i < n; i++) { + if (func(array[i])) { + return true; + } + } + return false; + }; + ArrayUtilities.all = function (array, func) { + for (var i = 0, n = array.length; i < n; i++) { + if (!func(array[i])) { + return false; + } + } + return true; + }; + ArrayUtilities.binarySearch = function (array, value) { + var low = 0; + var high = array.length - 1; + while (low <= high) { + var middle = low + ((high - low) >> 1); + var midValue = array[middle]; + if (midValue === value) { + return middle; + } + else if (midValue > value) { + high = middle - 1; + } + else { + low = middle + 1; + } + } + return ~low; + }; + ArrayUtilities.createArray = function (length, defaultValue) { + var result = new Array(length); + for (var i = 0; i < length; i++) { + result[i] = defaultValue; + } + return result; + }; + ArrayUtilities.grow = function (array, length, defaultValue) { + var count = length - array.length; + for (var i = 0; i < count; i++) { + array.push(defaultValue); + } + }; + ArrayUtilities.copy = function (sourceArray, sourceIndex, destinationArray, destinationIndex, length) { + for (var i = 0; i < length; i++) { + destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; + } + }; + ArrayUtilities.indexOf = function (array, predicate) { + for (var i = 0, n = array.length; i < n; i++) { + if (predicate(array[i])) { + return i; + } + } + return -1; + }; + return ArrayUtilities; + })(); + TypeScript.ArrayUtilities = ArrayUtilities; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + var StringUtilities = (function () { + function StringUtilities() { + } + StringUtilities.isString = function (value) { + return Object.prototype.toString.apply(value, []) === '[object String]'; + }; + StringUtilities.endsWith = function (string, value) { + return string.substring(string.length - value.length, string.length) === value; + }; + StringUtilities.startsWith = function (string, value) { + return string.substr(0, value.length) === value; + }; + StringUtilities.repeat = function (value, count) { + return Array(count + 1).join(value); + }; + return StringUtilities; + })(); + TypeScript.StringUtilities = StringUtilities; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + (function (SyntaxKind) { + SyntaxKind[SyntaxKind["None"] = 0] = "None"; + SyntaxKind[SyntaxKind["List"] = 1] = "List"; + SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 2] = "WhitespaceTrivia"; + SyntaxKind[SyntaxKind["NewLineTrivia"] = 3] = "NewLineTrivia"; + SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 4] = "MultiLineCommentTrivia"; + SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 5] = "SingleLineCommentTrivia"; + SyntaxKind[SyntaxKind["SkippedTokenTrivia"] = 6] = "SkippedTokenTrivia"; + SyntaxKind[SyntaxKind["ErrorToken"] = 7] = "ErrorToken"; + SyntaxKind[SyntaxKind["EndOfFileToken"] = 8] = "EndOfFileToken"; + SyntaxKind[SyntaxKind["IdentifierName"] = 9] = "IdentifierName"; + SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 10] = "RegularExpressionLiteral"; + SyntaxKind[SyntaxKind["NumericLiteral"] = 11] = "NumericLiteral"; + SyntaxKind[SyntaxKind["StringLiteral"] = 12] = "StringLiteral"; + SyntaxKind[SyntaxKind["NoSubstitutionTemplateToken"] = 13] = "NoSubstitutionTemplateToken"; + SyntaxKind[SyntaxKind["TemplateStartToken"] = 14] = "TemplateStartToken"; + SyntaxKind[SyntaxKind["TemplateMiddleToken"] = 15] = "TemplateMiddleToken"; + SyntaxKind[SyntaxKind["TemplateEndToken"] = 16] = "TemplateEndToken"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 17] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 18] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 19] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 20] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 21] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 22] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 23] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 24] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 25] = "ElseKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 26] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 27] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 28] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 29] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 30] = "IfKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 31] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 32] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 33] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 34] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 35] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 36] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 37] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 38] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 39] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 40] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 41] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 42] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 43] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 44] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 45] = "WithKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 46] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 47] = "ConstKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 48] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 49] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 50] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 51] = "ImportKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 52] = "SuperKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 53] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 54] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 55] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 56] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 57] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 58] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 59] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 60] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 61] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 62] = "AnyKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 63] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 64] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 65] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 66] = "GetKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 67] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 68] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 69] = "NumberKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 70] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 71] = "StringKeyword"; + SyntaxKind[SyntaxKind["OpenBraceToken"] = 72] = "OpenBraceToken"; + SyntaxKind[SyntaxKind["CloseBraceToken"] = 73] = "CloseBraceToken"; + SyntaxKind[SyntaxKind["OpenParenToken"] = 74] = "OpenParenToken"; + SyntaxKind[SyntaxKind["CloseParenToken"] = 75] = "CloseParenToken"; + SyntaxKind[SyntaxKind["OpenBracketToken"] = 76] = "OpenBracketToken"; + SyntaxKind[SyntaxKind["CloseBracketToken"] = 77] = "CloseBracketToken"; + SyntaxKind[SyntaxKind["DotToken"] = 78] = "DotToken"; + SyntaxKind[SyntaxKind["DotDotDotToken"] = 79] = "DotDotDotToken"; + SyntaxKind[SyntaxKind["SemicolonToken"] = 80] = "SemicolonToken"; + SyntaxKind[SyntaxKind["CommaToken"] = 81] = "CommaToken"; + SyntaxKind[SyntaxKind["LessThanToken"] = 82] = "LessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanToken"] = 83] = "GreaterThanToken"; + SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 84] = "LessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 85] = "GreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 86] = "EqualsEqualsToken"; + SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 87] = "EqualsGreaterThanToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 88] = "ExclamationEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 89] = "EqualsEqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 90] = "ExclamationEqualsEqualsToken"; + SyntaxKind[SyntaxKind["PlusToken"] = 91] = "PlusToken"; + SyntaxKind[SyntaxKind["MinusToken"] = 92] = "MinusToken"; + SyntaxKind[SyntaxKind["AsteriskToken"] = 93] = "AsteriskToken"; + SyntaxKind[SyntaxKind["PercentToken"] = 94] = "PercentToken"; + SyntaxKind[SyntaxKind["PlusPlusToken"] = 95] = "PlusPlusToken"; + SyntaxKind[SyntaxKind["MinusMinusToken"] = 96] = "MinusMinusToken"; + SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 97] = "LessThanLessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 98] = "GreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 99] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["AmpersandToken"] = 100] = "AmpersandToken"; + SyntaxKind[SyntaxKind["BarToken"] = 101] = "BarToken"; + SyntaxKind[SyntaxKind["CaretToken"] = 102] = "CaretToken"; + SyntaxKind[SyntaxKind["ExclamationToken"] = 103] = "ExclamationToken"; + SyntaxKind[SyntaxKind["TildeToken"] = 104] = "TildeToken"; + SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 105] = "AmpersandAmpersandToken"; + SyntaxKind[SyntaxKind["BarBarToken"] = 106] = "BarBarToken"; + SyntaxKind[SyntaxKind["QuestionToken"] = 107] = "QuestionToken"; + SyntaxKind[SyntaxKind["ColonToken"] = 108] = "ColonToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 109] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 110] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 111] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 112] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 113] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 114] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 115] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 116] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 117] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 118] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 119] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["SlashToken"] = 120] = "SlashToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 121] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["SourceUnit"] = 122] = "SourceUnit"; + SyntaxKind[SyntaxKind["QualifiedName"] = 123] = "QualifiedName"; + SyntaxKind[SyntaxKind["ObjectType"] = 124] = "ObjectType"; + SyntaxKind[SyntaxKind["FunctionType"] = 125] = "FunctionType"; + SyntaxKind[SyntaxKind["ArrayType"] = 126] = "ArrayType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 127] = "ConstructorType"; + SyntaxKind[SyntaxKind["GenericType"] = 128] = "GenericType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 129] = "TypeQuery"; + SyntaxKind[SyntaxKind["TupleType"] = 130] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 131] = "UnionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 132] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 133] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 134] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 135] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 136] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 137] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 138] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 139] = "ExportAssignment"; + SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 140] = "MemberFunctionDeclaration"; + SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 141] = "MemberVariableDeclaration"; + SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 142] = "ConstructorDeclaration"; + SyntaxKind[SyntaxKind["IndexMemberDeclaration"] = 143] = "IndexMemberDeclaration"; + SyntaxKind[SyntaxKind["GetAccessor"] = 144] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 145] = "SetAccessor"; + SyntaxKind[SyntaxKind["PropertySignature"] = 146] = "PropertySignature"; + SyntaxKind[SyntaxKind["CallSignature"] = 147] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 148] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 149] = "IndexSignature"; + SyntaxKind[SyntaxKind["MethodSignature"] = 150] = "MethodSignature"; + SyntaxKind[SyntaxKind["Block"] = 151] = "Block"; + SyntaxKind[SyntaxKind["IfStatement"] = 152] = "IfStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 153] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 154] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 155] = "ReturnStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 156] = "SwitchStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 157] = "BreakStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 158] = "ContinueStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 159] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 160] = "ForInStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 161] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 162] = "ThrowStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 163] = "WhileStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 164] = "TryStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 165] = "LabeledStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 166] = "DoStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 167] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 168] = "WithStatement"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 169] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 170] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 171] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 172] = "VoidExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 173] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 174] = "BinaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 175] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["MemberAccessExpression"] = 176] = "MemberAccessExpression"; + SyntaxKind[SyntaxKind["InvocationExpression"] = 177] = "InvocationExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 178] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 179] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectCreationExpression"] = 180] = "ObjectCreationExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 181] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["ParenthesizedArrowFunctionExpression"] = 182] = "ParenthesizedArrowFunctionExpression"; + SyntaxKind[SyntaxKind["SimpleArrowFunctionExpression"] = 183] = "SimpleArrowFunctionExpression"; + SyntaxKind[SyntaxKind["CastExpression"] = 184] = "CastExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 185] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 186] = "FunctionExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 187] = "OmittedExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 188] = "TemplateExpression"; + SyntaxKind[SyntaxKind["TemplateAccessExpression"] = 189] = "TemplateAccessExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 190] = "YieldExpression"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 191] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarator"] = 192] = "VariableDeclarator"; + SyntaxKind[SyntaxKind["ArgumentList"] = 193] = "ArgumentList"; + SyntaxKind[SyntaxKind["ParameterList"] = 194] = "ParameterList"; + SyntaxKind[SyntaxKind["TypeArgumentList"] = 195] = "TypeArgumentList"; + SyntaxKind[SyntaxKind["TypeParameterList"] = 196] = "TypeParameterList"; + SyntaxKind[SyntaxKind["HeritageClause"] = 197] = "HeritageClause"; + SyntaxKind[SyntaxKind["EqualsValueClause"] = 198] = "EqualsValueClause"; + SyntaxKind[SyntaxKind["CaseSwitchClause"] = 199] = "CaseSwitchClause"; + SyntaxKind[SyntaxKind["DefaultSwitchClause"] = 200] = "DefaultSwitchClause"; + SyntaxKind[SyntaxKind["ElseClause"] = 201] = "ElseClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 202] = "CatchClause"; + SyntaxKind[SyntaxKind["FinallyClause"] = 203] = "FinallyClause"; + SyntaxKind[SyntaxKind["TemplateClause"] = 204] = "TemplateClause"; + SyntaxKind[SyntaxKind["TypeParameter"] = 205] = "TypeParameter"; + SyntaxKind[SyntaxKind["Constraint"] = 206] = "Constraint"; + SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 207] = "SimplePropertyAssignment"; + SyntaxKind[SyntaxKind["FunctionPropertyAssignment"] = 208] = "FunctionPropertyAssignment"; + SyntaxKind[SyntaxKind["Parameter"] = 209] = "Parameter"; + SyntaxKind[SyntaxKind["EnumElement"] = 210] = "EnumElement"; + SyntaxKind[SyntaxKind["TypeAnnotation"] = 211] = "TypeAnnotation"; + SyntaxKind[SyntaxKind["ExpressionBody"] = 212] = "ExpressionBody"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 213] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 214] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 215] = "ModuleNameModuleReference"; + SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword"; + SyntaxKind[SyntaxKind["LastStandardKeyword"] = SyntaxKind.WithKeyword] = "LastStandardKeyword"; + SyntaxKind[SyntaxKind["FirstFutureReservedKeyword"] = SyntaxKind.ClassKeyword] = "FirstFutureReservedKeyword"; + SyntaxKind[SyntaxKind["LastFutureReservedKeyword"] = SyntaxKind.SuperKeyword] = "LastFutureReservedKeyword"; + SyntaxKind[SyntaxKind["FirstFutureReservedStrictKeyword"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedStrictKeyword"; + SyntaxKind[SyntaxKind["LastFutureReservedStrictKeyword"] = SyntaxKind.YieldKeyword] = "LastFutureReservedStrictKeyword"; + SyntaxKind[SyntaxKind["FirstTypeScriptKeyword"] = SyntaxKind.AnyKeyword] = "FirstTypeScriptKeyword"; + SyntaxKind[SyntaxKind["LastTypeScriptKeyword"] = SyntaxKind.StringKeyword] = "LastTypeScriptKeyword"; + SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.FirstStandardKeyword] = "FirstKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.LastTypeScriptKeyword] = "LastKeyword"; + SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.ErrorToken] = "FirstToken"; + SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.SlashEqualsToken] = "LastToken"; + SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.SlashEqualsToken] = "LastPunctuation"; + SyntaxKind[SyntaxKind["FirstFixedWidth"] = SyntaxKind.FirstKeyword] = "FirstFixedWidth"; + SyntaxKind[SyntaxKind["LastFixedWidth"] = SyntaxKind.LastPunctuation] = "LastFixedWidth"; + SyntaxKind[SyntaxKind["FirstTrivia"] = SyntaxKind.WhitespaceTrivia] = "FirstTrivia"; + SyntaxKind[SyntaxKind["LastTrivia"] = SyntaxKind.SkippedTokenTrivia] = "LastTrivia"; + SyntaxKind[SyntaxKind["FirstNode"] = SyntaxKind.SourceUnit] = "FirstNode"; + SyntaxKind[SyntaxKind["LastNode"] = SyntaxKind.ModuleNameModuleReference] = "LastNode"; + })(TypeScript.SyntaxKind || (TypeScript.SyntaxKind = {})); + var SyntaxKind = TypeScript.SyntaxKind; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + var SyntaxFacts; + (function (SyntaxFacts) { + var textToKeywordKind = { + "any": 62 /* AnyKeyword */, + "boolean": 63 /* BooleanKeyword */, + "break": 17 /* BreakKeyword */, + "case": 18 /* CaseKeyword */, + "catch": 19 /* CatchKeyword */, + "class": 46 /* ClassKeyword */, + "continue": 20 /* ContinueKeyword */, + "const": 47 /* ConstKeyword */, + "constructor": 64 /* ConstructorKeyword */, + "debugger": 21 /* DebuggerKeyword */, + "declare": 65 /* DeclareKeyword */, + "default": 22 /* DefaultKeyword */, + "delete": 23 /* DeleteKeyword */, + "do": 24 /* DoKeyword */, + "else": 25 /* ElseKeyword */, + "enum": 48 /* EnumKeyword */, + "export": 49 /* ExportKeyword */, + "extends": 50 /* ExtendsKeyword */, + "false": 26 /* FalseKeyword */, + "finally": 27 /* FinallyKeyword */, + "for": 28 /* ForKeyword */, + "function": 29 /* FunctionKeyword */, + "get": 66 /* GetKeyword */, + "if": 30 /* IfKeyword */, + "implements": 53 /* ImplementsKeyword */, + "import": 51 /* ImportKeyword */, + "in": 31 /* InKeyword */, + "instanceof": 32 /* InstanceOfKeyword */, + "interface": 54 /* InterfaceKeyword */, + "let": 55 /* LetKeyword */, + "module": 67 /* ModuleKeyword */, + "new": 33 /* NewKeyword */, + "null": 34 /* NullKeyword */, + "number": 69 /* NumberKeyword */, + "package": 56 /* PackageKeyword */, + "private": 57 /* PrivateKeyword */, + "protected": 58 /* ProtectedKeyword */, + "public": 59 /* PublicKeyword */, + "require": 68 /* RequireKeyword */, + "return": 35 /* ReturnKeyword */, + "set": 70 /* SetKeyword */, + "static": 60 /* StaticKeyword */, + "string": 71 /* StringKeyword */, + "super": 52 /* SuperKeyword */, + "switch": 36 /* SwitchKeyword */, + "this": 37 /* ThisKeyword */, + "throw": 38 /* ThrowKeyword */, + "true": 39 /* TrueKeyword */, + "try": 40 /* TryKeyword */, + "typeof": 41 /* TypeOfKeyword */, + "var": 42 /* VarKeyword */, + "void": 43 /* VoidKeyword */, + "while": 44 /* WhileKeyword */, + "with": 45 /* WithKeyword */, + "yield": 61 /* YieldKeyword */, + "{": 72 /* OpenBraceToken */, + "}": 73 /* CloseBraceToken */, + "(": 74 /* OpenParenToken */, + ")": 75 /* CloseParenToken */, + "[": 76 /* OpenBracketToken */, + "]": 77 /* CloseBracketToken */, + ".": 78 /* DotToken */, + "...": 79 /* DotDotDotToken */, + ";": 80 /* SemicolonToken */, + ",": 81 /* CommaToken */, + "<": 82 /* LessThanToken */, + ">": 83 /* GreaterThanToken */, + "<=": 84 /* LessThanEqualsToken */, + ">=": 85 /* GreaterThanEqualsToken */, + "==": 86 /* EqualsEqualsToken */, + "=>": 87 /* EqualsGreaterThanToken */, + "!=": 88 /* ExclamationEqualsToken */, + "===": 89 /* EqualsEqualsEqualsToken */, + "!==": 90 /* ExclamationEqualsEqualsToken */, + "+": 91 /* PlusToken */, + "-": 92 /* MinusToken */, + "*": 93 /* AsteriskToken */, + "%": 94 /* PercentToken */, + "++": 95 /* PlusPlusToken */, + "--": 96 /* MinusMinusToken */, + "<<": 97 /* LessThanLessThanToken */, + ">>": 98 /* GreaterThanGreaterThanToken */, + ">>>": 99 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 100 /* AmpersandToken */, + "|": 101 /* BarToken */, + "^": 102 /* CaretToken */, + "!": 103 /* ExclamationToken */, + "~": 104 /* TildeToken */, + "&&": 105 /* AmpersandAmpersandToken */, + "||": 106 /* BarBarToken */, + "?": 107 /* QuestionToken */, + ":": 108 /* ColonToken */, + "=": 109 /* EqualsToken */, + "+=": 110 /* PlusEqualsToken */, + "-=": 111 /* MinusEqualsToken */, + "*=": 112 /* AsteriskEqualsToken */, + "%=": 113 /* PercentEqualsToken */, + "<<=": 114 /* LessThanLessThanEqualsToken */, + ">>=": 115 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 117 /* AmpersandEqualsToken */, + "|=": 118 /* BarEqualsToken */, + "^=": 119 /* CaretEqualsToken */, + "/": 120 /* SlashToken */, + "/=": 121 /* SlashEqualsToken */ + }; + var kindToText = new Array(); + for (var name in textToKeywordKind) { + if (textToKeywordKind.hasOwnProperty(name)) { + kindToText[textToKeywordKind[name]] = name; + } + } + kindToText[64 /* ConstructorKeyword */] = "constructor"; + function getTokenKind(text) { + if (textToKeywordKind.hasOwnProperty(text)) { + return textToKeywordKind[text]; + } + return 0 /* None */; + } + SyntaxFacts.getTokenKind = getTokenKind; + function getText(kind) { + var result = kindToText[kind]; + return result; + } + SyntaxFacts.getText = getText; + function isAnyKeyword(kind) { + return kind >= TypeScript.SyntaxKind.FirstKeyword && kind <= TypeScript.SyntaxKind.LastKeyword; + } + SyntaxFacts.isAnyKeyword = isAnyKeyword; + function isAnyPunctuation(kind) { + return kind >= TypeScript.SyntaxKind.FirstPunctuation && kind <= TypeScript.SyntaxKind.LastPunctuation; + } + SyntaxFacts.isAnyPunctuation = isAnyPunctuation; + function isPrefixUnaryExpressionOperatorToken(tokenKind) { + switch (tokenKind) { + case 91 /* PlusToken */: + case 92 /* MinusToken */: + case 104 /* TildeToken */: + case 103 /* ExclamationToken */: + case 95 /* PlusPlusToken */: + case 96 /* MinusMinusToken */: + return true; + default: + return false; + } + } + SyntaxFacts.isPrefixUnaryExpressionOperatorToken = isPrefixUnaryExpressionOperatorToken; + function isBinaryExpressionOperatorToken(tokenKind) { + switch (tokenKind) { + case 93 /* AsteriskToken */: + case 120 /* SlashToken */: + case 94 /* PercentToken */: + case 91 /* PlusToken */: + case 92 /* MinusToken */: + case 97 /* LessThanLessThanToken */: + case 98 /* GreaterThanGreaterThanToken */: + case 99 /* GreaterThanGreaterThanGreaterThanToken */: + case 82 /* LessThanToken */: + case 83 /* GreaterThanToken */: + case 84 /* LessThanEqualsToken */: + case 85 /* GreaterThanEqualsToken */: + case 32 /* InstanceOfKeyword */: + case 31 /* InKeyword */: + case 86 /* EqualsEqualsToken */: + case 88 /* ExclamationEqualsToken */: + case 89 /* EqualsEqualsEqualsToken */: + case 90 /* ExclamationEqualsEqualsToken */: + case 100 /* AmpersandToken */: + case 102 /* CaretToken */: + case 101 /* BarToken */: + case 105 /* AmpersandAmpersandToken */: + case 106 /* BarBarToken */: + case 118 /* BarEqualsToken */: + case 117 /* AmpersandEqualsToken */: + case 119 /* CaretEqualsToken */: + case 114 /* LessThanLessThanEqualsToken */: + case 115 /* GreaterThanGreaterThanEqualsToken */: + case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 110 /* PlusEqualsToken */: + case 111 /* MinusEqualsToken */: + case 112 /* AsteriskEqualsToken */: + case 121 /* SlashEqualsToken */: + case 113 /* PercentEqualsToken */: + case 109 /* EqualsToken */: + case 81 /* CommaToken */: + return true; + default: + return false; + } + } + SyntaxFacts.isBinaryExpressionOperatorToken = isBinaryExpressionOperatorToken; + function isAssignmentOperatorToken(tokenKind) { + switch (tokenKind) { + case 118 /* BarEqualsToken */: + case 117 /* AmpersandEqualsToken */: + case 119 /* CaretEqualsToken */: + case 114 /* LessThanLessThanEqualsToken */: + case 115 /* GreaterThanGreaterThanEqualsToken */: + case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 110 /* PlusEqualsToken */: + case 111 /* MinusEqualsToken */: + case 112 /* AsteriskEqualsToken */: + case 121 /* SlashEqualsToken */: + case 113 /* PercentEqualsToken */: + case 109 /* EqualsToken */: + return true; + default: + return false; + } + } + SyntaxFacts.isAssignmentOperatorToken = isAssignmentOperatorToken; + function isType(kind) { + switch (kind) { + case 126 /* ArrayType */: + case 62 /* AnyKeyword */: + case 69 /* NumberKeyword */: + case 63 /* BooleanKeyword */: + case 71 /* StringKeyword */: + case 43 /* VoidKeyword */: + case 125 /* FunctionType */: + case 124 /* ObjectType */: + case 127 /* ConstructorType */: + case 129 /* TypeQuery */: + case 128 /* GenericType */: + case 123 /* QualifiedName */: + case 9 /* IdentifierName */: + return true; + } + return false; + } + SyntaxFacts.isType = isType; + })(SyntaxFacts = TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); +})(TypeScript || (TypeScript = {})); +var forPrettyPrinter = false; +var interfaces = { + IMemberDeclarationSyntax: 'IClassElementSyntax', + IStatementSyntax: 'IModuleElementSyntax', + INameSyntax: 'ITypeSyntax', + IUnaryExpressionSyntax: 'IExpressionSyntax', + IPostfixExpressionSyntax: 'IUnaryExpressionSyntax', + ILeftHandSideExpressionSyntax: 'IPostfixExpressionSyntax', + IMemberExpressionSyntax: 'ILeftHandSideExpressionSyntax', + ICallExpressionSyntax: 'ILeftHandSideExpressionSyntax', + IPrimaryExpressionSyntax: 'IMemberExpressionSyntax' +}; +var definitions = [ + { + name: 'SourceUnitSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'moduleElements', isList: true, elementType: 'IModuleElementSyntax' }, + { name: 'endOfFileToken', isToken: true } + ] + }, + { + name: 'ExternalModuleReferenceSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleReferenceSyntax'], + children: [ + { name: 'requireKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'stringLiteral', isToken: true }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ModuleNameModuleReferenceSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleReferenceSyntax'], + children: [ + { name: 'moduleName', type: 'INameSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ImportDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'importKeyword', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'equalsToken', isToken: true, excludeFromAST: true }, + { name: 'moduleReference', type: 'IModuleReferenceSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ExportAssignmentSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'exportKeyword', isToken: true, excludeFromAST: true }, + { name: 'equalsToken', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ClassDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'classKeyword', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, + { name: 'heritageClauses', isList: true, elementType: 'HeritageClauseSyntax' }, + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'classElements', isList: true, elementType: 'IClassElementSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'InterfaceDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'interfaceKeyword', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, + { name: 'heritageClauses', isList: true, elementType: 'HeritageClauseSyntax' }, + { name: 'body', type: 'ObjectTypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'HeritageClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'extendsOrImplementsKeyword', isToken: true }, + { name: 'typeNames', isSeparatedList: true, requiresAtLeastOneItem: true, elementType: 'INameSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ModuleDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'moduleKeyword', isToken: true, excludeFromAST: true }, + { name: 'name', type: 'INameSyntax' }, + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'moduleElements', isList: true, elementType: 'IModuleElementSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'FunctionDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, + { name: 'functionKeyword', isToken: true, excludeFromAST: true }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'identifier', isToken: true }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } + ] + }, + { + name: 'ExpressionBody', + baseType: 'ISyntaxNode', + children: [ + { name: 'equalsGreaterThanToken', isToken: true }, + { name: 'expression', type: 'IExpressionSyntax' } + ] + }, + { + name: 'VariableStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, + { name: 'variableDeclaration', type: 'VariableDeclarationSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'VariableDeclarationSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'varKeyword', isToken: true }, + { name: 'variableDeclarators', isSeparatedList: true, requiresAtLeastOneItem: true, elementType: 'VariableDeclaratorSyntax' } + ] + }, + { + name: 'VariableDeclaratorSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true }, + { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } + ] + }, + { + name: 'EqualsValueClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'equalsToken', isToken: true, excludeFromAST: true }, + { name: 'value', type: 'IExpressionSyntax' } + ] + }, + { + name: 'PrefixUnaryExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'operatorToken', isToken: true }, + { name: 'operand', type: 'IUnaryExpressionSyntax' } + ] + }, + { + name: 'ArrayLiteralExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'openBracketToken', isToken: true, excludeFromAST: true }, + { name: 'expressions', isSeparatedList: true, elementType: 'IExpressionSyntax' }, + { name: 'closeBracketToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'OmittedExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IExpressionSyntax'], + children: [] + }, + { + name: 'ParenthesizedExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'SimpleArrowFunctionExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'parameter', type: 'ParameterSyntax' }, + { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, + { name: 'body', type: 'BlockSyntax | IExpressionSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ParenthesizedArrowFunctionExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, + { name: 'body', type: 'BlockSyntax | IExpressionSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'QualifiedNameSyntax', + baseType: 'ISyntaxNode', + interfaces: ['INameSyntax'], + children: [ + { name: 'left', type: 'INameSyntax' }, + { name: 'dotToken', isToken: true, excludeFromAST: true }, + { name: 'right', isToken: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'TypeArgumentListSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'lessThanToken', isToken: true }, + { name: 'typeArguments', isSeparatedList: true, elementType: 'ITypeSyntax' }, + { name: 'greaterThanToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ConstructorTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'newKeyword', isToken: true, excludeFromAST: true }, + { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, + { name: 'parameterList', type: 'ParameterListSyntax' }, + { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'FunctionTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, + { name: 'parameterList', type: 'ParameterListSyntax' }, + { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ObjectTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'typeMembers', isSeparatedList: true, elementType: 'ITypeMemberSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ArrayTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'type', type: 'ITypeSyntax' }, + { name: 'openBracketToken', isToken: true, excludeFromAST: true }, + { name: 'closeBracketToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'GenericTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'name', type: 'INameSyntax' }, + { name: 'typeArgumentList', type: 'TypeArgumentListSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'TypeQuerySyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'typeOfKeyword', isToken: true, excludeFromAST: true }, + { name: 'name', type: 'INameSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'TupleTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'openBracketToken', isToken: true, excludeFromAST: true }, + { name: 'types', isSeparatedList: true, elementType: 'ITypeSyntax' }, + { name: 'closeBracketToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'UnionTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'left', type: 'ITypeSyntax' }, + { name: 'barToken', isToken: true, excludeFromAST: true }, + { name: 'right', type: 'ITypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ParenthesizedTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'TypeAnnotationSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'BlockSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'equalsGreaterThanToken', isToken: true, isOptional: 'true' }, + { name: 'openBraceToken', isToken: true }, + { name: 'statements', isList: true, elementType: 'IStatementSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'ParameterSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'dotDotDotToken', isToken: true, isOptional: true, isTypeScriptSpecific: true }, + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'identifier', isToken: true }, + { name: 'questionToken', isToken: true, isOptional: true, isTypeScriptSpecific: true }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true }, + { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true, isTypeScriptSpecific: true } + ] + }, + { + name: 'MemberAccessExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'], + children: [ + { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'dotToken', isToken: true, excludeFromAST: true }, + { name: 'name', isToken: true } + ] + }, + { + name: 'PostfixUnaryExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPostfixExpressionSyntax'], + children: [ + { name: 'operand', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'operatorToken', isToken: true } + ] + }, + { + name: 'ElementAccessExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'], + children: [ + { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'openBracketToken', isToken: true, excludeFromAST: true }, + { name: 'argumentExpression', type: 'IExpressionSyntax', isOptional: true }, + { name: 'closeBracketToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'TemplateAccessExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'], + children: [ + { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'templateExpression', type: 'IPrimaryExpressionSyntax' } + ] + }, + { + name: 'TemplateExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'templateStartToken', isToken: true, excludeFromAST: true }, + { name: 'templateClauses', isList: true, elementType: 'TemplateClauseSyntax' } + ] + }, + { + name: 'TemplateClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'templateMiddleOrEndToken', isToken: true, elementType: 'TemplateSpanSyntax' } + ] + }, + { + name: 'InvocationExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ICallExpressionSyntax'], + children: [ + { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'argumentList', type: 'ArgumentListSyntax' } + ] + }, + { + name: 'ArgumentListSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'typeArgumentList', type: 'TypeArgumentListSyntax', isOptional: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'arguments', isSeparatedList: true, elementType: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'BinaryExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IExpressionSyntax'], + children: [ + { name: 'left', type: 'IExpressionSyntax' }, + { name: 'operatorToken', isToken: true }, + { name: 'right', type: 'IExpressionSyntax' } + ] + }, + { + name: 'ConditionalExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IExpressionSyntax'], + children: [ + { name: 'condition', type: 'IExpressionSyntax' }, + { name: 'questionToken', isToken: true, excludeFromAST: true }, + { name: 'whenTrue', type: 'IExpressionSyntax' }, + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'whenFalse', type: 'IExpressionSyntax' } + ] + }, + { + name: 'ConstructSignatureSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeMemberSyntax'], + children: [ + { name: 'newKeyword', isToken: true, excludeFromAST: true }, + { name: 'callSignature', type: 'CallSignatureSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'MethodSignatureSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeMemberSyntax'], + children: [ + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'questionToken', isToken: true, isOptional: true, itTypeScriptSpecific: true }, + { name: 'callSignature', type: 'CallSignatureSyntax' } + ] + }, + { + name: 'IndexSignatureSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeMemberSyntax'], + children: [ + { name: 'openBracketToken', isToken: true }, + { name: 'parameters', isSeparatedList: true, elementType: 'ParameterSyntax' }, + { name: 'closeBracketToken', isToken: true }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'PropertySignatureSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeMemberSyntax'], + children: [ + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'questionToken', isToken: true, isOptional: true }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'CallSignatureSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeMemberSyntax'], + children: [ + { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true, isTypeScriptSpecific: true }, + { name: 'parameterList', type: 'ParameterListSyntax' }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true } + ] + }, + { + name: 'ParameterListSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'parameters', isSeparatedList: true, elementType: 'ParameterSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'TypeParameterListSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'lessThanToken', isToken: true }, + { name: 'typeParameters', isSeparatedList: true, elementType: 'TypeParameterSyntax' }, + { name: 'greaterThanToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'TypeParameterSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'identifier', isToken: true }, + { name: 'constraint', type: 'ConstraintSyntax', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ConstraintSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'extendsKeyword', isToken: true, excludeFromAST: true }, + { name: 'typeOrExpression', type: 'ISyntaxNodeOrToken' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ElseClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'elseKeyword', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'IfStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'ifKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'condition', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' }, + { name: 'elseClause', type: 'ElseClauseSyntax', isOptional: true } + ] + }, + { + name: 'ExpressionStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'ConstructorDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IClassElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'constructorKeyword', isToken: true }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'MemberFunctionDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberDeclarationSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'GetAccessorSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IAccessorSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, + { name: 'getKeyword', isToken: true, excludeFromAST: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } + ] + }, + { + name: 'SetAccessorSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IAccessorSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, + { name: 'setKeyword', isToken: true, excludeFromAST: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'MemberVariableDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberDeclarationSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'variableDeclarator', type: 'VariableDeclaratorSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'IndexMemberDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IClassElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'indexSignature', type: 'IndexSignatureSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ThrowStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'throwKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IExpressionSyntax', isOptional: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'ReturnStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'returnKeyword', isToken: true }, + { name: 'expression', type: 'IExpressionSyntax', isOptional: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'ObjectCreationExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'newKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IMemberExpressionSyntax' }, + { name: 'argumentList', type: 'ArgumentListSyntax', isOptional: true } + ] + }, + { + name: 'SwitchStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'switchKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'switchClauses', isList: true, elementType: 'ISwitchClauseSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'CaseSwitchClauseSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ISwitchClauseSyntax'], + children: [ + { name: 'caseKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'statements', isList: true, elementType: 'IStatementSyntax' } + ] + }, + { + name: 'DefaultSwitchClauseSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ISwitchClauseSyntax'], + children: [ + { name: 'defaultKeyword', isToken: true, excludeFromAST: true }, + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'statements', isList: true, elementType: 'IStatementSyntax' } + ] + }, + { + name: 'BreakStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'breakKeyword', isToken: true }, + { name: 'identifier', isToken: true, isOptional: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'ContinueStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'continueKeyword', isToken: true }, + { name: 'identifier', isToken: true, isOptional: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'ForStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'forKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'initializer', type: 'VariableDeclarationSyntax | IExpressionSyntax', isOptional: true }, + { name: 'firstSemicolonToken', isToken: true, excludeFromAST: true }, + { name: 'condition', type: 'IExpressionSyntax', isOptional: true }, + { name: 'secondSemicolonToken', isToken: true, excludeFromAST: true }, + { name: 'incrementor', type: 'IExpressionSyntax', isOptional: true }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'ForInStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'forKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'left', type: 'VariableDeclarationSyntax | IExpressionSyntax' }, + { name: 'inKeyword', isToken: true, excludeFromAST: true }, + { name: 'right', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'WhileStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'whileKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'condition', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'WithStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'withKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'condition', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'EnumDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'enumKeyword', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'enumElements', isSeparatedList: true, elementType: 'EnumElementSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'EnumElementSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } + ] + }, + { + name: 'CastExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'lessThanToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' }, + { name: 'greaterThanToken', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IUnaryExpressionSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ObjectLiteralExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'propertyAssignments', isSeparatedList: true, elementType: 'IPropertyAssignmentSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'ComputedPropertyNameSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPropertyNameSyntax'], + children: [ + { name: 'openBracketToken', isToken: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'closeBracketToken', isToken: true } + ] + }, + { + name: 'SimplePropertyAssignmentSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPropertyAssignmentSyntax'], + children: [ + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IExpressionSyntax' } + ] + }, + { + name: 'FunctionPropertyAssignmentSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPropertyAssignmentSyntax'], + children: [ + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } + ] + }, + { + name: 'FunctionExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'functionKeyword', isToken: true, excludeFromAST: true }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'identifier', isToken: true, isOptional: true }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } + ] + }, + { + name: 'EmptyStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'semicolonToken', isToken: true } + ] + }, + { + name: 'TryStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'tryKeyword', isToken: true, excludeFromAST: true }, + { name: 'block', type: 'BlockSyntax' }, + { name: 'catchClause', type: 'CatchClauseSyntax', isOptional: true }, + { name: 'finallyClause', type: 'FinallyClauseSyntax', isOptional: true } + ] + }, + { + name: 'CatchClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'catchKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecified: true }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'block', type: 'BlockSyntax' } + ] + }, + { + name: 'FinallyClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'finallyKeyword', isToken: true, excludeFromAST: true }, + { name: 'block', type: 'BlockSyntax' } + ] + }, + { + name: 'LabeledStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'identifier', isToken: true }, + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'DoStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'doKeyword', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' }, + { name: 'whileKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'condition', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'TypeOfExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'typeOfKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IUnaryExpressionSyntax' } + ] + }, + { + name: 'DeleteExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'deleteKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IUnaryExpressionSyntax' } + ] + }, + { + name: 'VoidExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'voidKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IUnaryExpressionSyntax' } + ] + }, + { + name: 'YieldExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IExpressionSyntax'], + children: [ + { name: 'yieldKeyword', isToken: true }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'expression', type: 'IExpressionSyntax', isOptional: true } + ] + }, + { + name: 'DebuggerStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'debuggerKeyword', isToken: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + } +]; +function firstKind(definition) { + var kindName = getNameWithoutSuffix(definition); + return TypeScript.SyntaxKind[kindName]; +} +definitions.sort(function (d1, d2) { return firstKind(d1) - firstKind(d2); }); +function getStringWithoutSuffix(definition) { + if (TypeScript.StringUtilities.endsWith(definition, "Syntax")) { + return definition.substring(0, definition.length - "Syntax".length); + } + return definition; +} +function getNameWithoutSuffix(definition) { + return getStringWithoutSuffix(definition.name); +} +function getType(child) { + if (child.isToken) { + return "ISyntaxToken"; + } + else if (child.isSeparatedList) { + return "ISeparatedSyntaxList<" + child.elementType + ">"; + } + else if (child.isList) { + return child.elementType + "[]"; + } + else { + return child.type; + } +} +function camelCase(value) { + return value.substr(0, 1).toLowerCase() + value.substr(1); +} +function getSafeName(child) { + if (child.name === "arguments") { + return "_" + child.name; + } + return child.name; +} +function generateConstructorFunction(definition) { + var result = " export var " + definition.name + ": " + getNameWithoutSuffix(definition) + "Constructor = function(data: number"; + for (var i = 0; i < definition.children.length; i++) { + var child = definition.children[i]; + result += ", "; + result += getSafeName(child); + result += ": " + getType(child); + } + result += ") {\r\n"; + result += " if (data) { this.__data = data; }\r\n"; + if (definition.children.length) { + result += " "; + for (var i = 0; i < definition.children.length; i++) { + if (i) { + result += ", "; + } + var child = definition.children[i]; + result += "this." + child.name + " = " + getSafeName(child); + } + result += ";\r\n"; + } + if (definition.children.length > 0) { + result += " "; + for (var i = 0; i < definition.children.length; i++) { + if (i) { + result += ", "; + } + var child = definition.children[i]; + if (child.isOptional) { + result += getSafeName(child) + " && (" + getSafeName(child) + ".parent = this)"; + } + else { + result += getSafeName(child) + ".parent = this"; + } + } + result += ";\r\n"; + } + result += " };\r\n"; + result += " " + definition.name + ".prototype.kind = SyntaxKind." + getNameWithoutSuffix(definition) + ";\r\n"; + result += " " + definition.name + ".prototype.childCount = " + definition.children.length + ";\r\n"; + result += " " + definition.name + ".prototype.childAt = function(index: number): ISyntaxElement {\r\n"; + if (definition.children.length) { + result += " switch (index) {\r\n"; + for (var j = 0; j < definition.children.length; j++) { + result += " case " + j + ": return this." + definition.children[j].name + ";\r\n"; + } + result += " }\r\n"; + } + else { + result += " throw Errors.invalidOperation();\r\n"; + } + result += " }\r\n"; + return result; +} +function generateSyntaxInterfaces() { + var result = "///\r\n\r\n"; + result += "module TypeScript {\r\n"; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; + if (i > 0) { + result += "\r\n"; + } + result += generateSyntaxInterface(definition); + } + result += "}"; + return result; +} +function generateSyntaxInterface(definition) { + var result = " export interface " + definition.name + " extends ISyntaxNode"; + if (definition.interfaces) { + result += ", "; + result += definition.interfaces.join(", "); + } + result += " {\r\n"; + if (definition.name === "SourceUnitSyntax") { + result += " syntaxTree: SyntaxTree;\r\n"; + } + for (var i = 0; i < definition.children.length; i++) { + var child = definition.children[i]; + result += " " + child.name + ": " + getType(child) + ";\r\n"; + } + result += " }\r\n"; + result += " export interface " + getNameWithoutSuffix(definition) + "Constructor {"; + result += " new (data: number"; + for (var i = 0; i < definition.children.length; i++) { + var child = definition.children[i]; + result += ", "; + result += getSafeName(child); + result += ": " + getType(child); + } + result += "): " + definition.name; + result += " }\r\n"; + return result; +} +function generateNodes() { + var result = "///\r\n\r\n"; + result += "module TypeScript"; + result += " {\r\n"; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; + if (i) { + result += "\r\n"; + } + result += generateConstructorFunction(definition); + } + result += "}"; + return result; +} +function isInterface(name) { + return name.substr(0, 1) === "I" && name.substr(1, 1).toUpperCase() === name.substr(1, 1); +} +function generateWalker() { + var result = ""; + result += "///\r\n" + "\r\n" + "module TypeScript {\r\n" + " export class SyntaxWalker implements ISyntaxVisitor {\r\n" + " public visitToken(token: ISyntaxToken): void {\r\n" + " }\r\n" + "\r\n" + " private visitOptionalToken(token: ISyntaxToken): void {\r\n" + " if (token === undefined) {\r\n" + " return;\r\n" + " }\r\n" + "\r\n" + " this.visitToken(token);\r\n" + " }\r\n" + "\r\n" + " public visitList(list: ISyntaxNodeOrToken[]): void {\r\n" + " for (var i = 0, n = list.length; i < n; i++) {\r\n" + " visitNodeOrToken(this, list[i]);\r\n" + " }\r\n" + " }\r\n"; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; + result += "\r\n"; + result += " public visit" + getNameWithoutSuffix(definition) + "(node: " + definition.name + "): void {\r\n"; + for (var j = 0; j < definition.children.length; j++) { + var child = definition.children[j]; + if (child.isToken) { + if (child.isOptional) { + result += " this.visitOptionalToken(node." + child.name + ");\r\n"; + } + else { + result += " this.visitToken(node." + child.name + ");\r\n"; + } + } + else if (child.isList || child.isSeparatedList) { + result += " this.visitList(node." + child.name + ");\r\n"; + } + else if (child.isToken) { + if (child.isOptional) { + result += " this.visitOptionalToken(node." + child.name + ");\r\n"; + } + else { + result += " this.visitToken(node." + child.name + ");\r\n"; + } + } + else { + result += " visitNodeOrToken(this, node." + child.name + ");\r\n"; + } + } + result += " }\r\n"; + } + result += " }"; + result += "\r\n}"; + return result; +} +function firstEnumName(e, value) { + for (var name in e) { + if (e[name] === value) { + return name; + } + } +} +function groupBy(array, func) { + var result = {}; + for (var i = 0, n = array.length; i < n; i++) { + var v = array[i]; + var k = func(v); + var list = result[k] || []; + list.push(v); + result[k] = list; + } + return result; +} +function generateKeywordCondition(keywords, currentCharacter, indent) { + var length = keywords[0].text.length; + var result = ""; + var index; + if (keywords.length === 1) { + var keyword = keywords[0]; + if (currentCharacter === length) { + return " return SyntaxKind." + firstEnumName(TypeScript.SyntaxKind, keyword.kind) + ";\r\n"; + } + var keywordText = keywords[0].text; + result = " return ("; + for (var i = currentCharacter; i < length; i++) { + if (i > currentCharacter) { + result += " && "; + } + index = i === 0 ? "start" : ("start + " + i); + result += "str.charCodeAt(" + index + ") === CharacterCodes." + keywordText.substr(i, 1); + } + result += ") ? SyntaxKind." + firstEnumName(TypeScript.SyntaxKind, keyword.kind) + " : SyntaxKind.IdentifierName;\r\n"; + } + else { + result += " // " + TypeScript.ArrayUtilities.select(keywords, function (k) { return k.text; }).join(", ") + "\r\n"; + index = currentCharacter === 0 ? "start" : ("start + " + currentCharacter); + result += indent + "switch(str.charCodeAt(" + index + ")) {\r\n"; + var groupedKeywords = groupBy(keywords, function (k) { return k.text.substr(currentCharacter, 1); }); + for (var c in groupedKeywords) { + if (groupedKeywords.hasOwnProperty(c)) { + result += indent + " case CharacterCodes." + c + ":"; + result += generateKeywordCondition(groupedKeywords[c], currentCharacter + 1, indent + " "); + } + } + result += indent + " default: return SyntaxKind.IdentifierName;\r\n"; + result += indent + "}\r\n"; + } + return result; +} +function min(array, func) { + var min = func(array[0]); + for (var i = 1; i < array.length; i++) { + var next = func(array[i]); + if (next < min) { + min = next; + } + } + return min; +} +function max(array, func) { + var max = func(array[0]); + for (var i = 1; i < array.length; i++) { + var next = func(array[i]); + if (next > max) { + max = next; + } + } + return max; +} +function generateUtilities() { + var result = ""; + result += " var fixedWidthArray = ["; + for (var i = 0; i <= TypeScript.SyntaxKind.LastFixedWidth; i++) { + if (i) { + result += ", "; + } + if (i < TypeScript.SyntaxKind.FirstFixedWidth) { + result += "0"; + } + else { + result += TypeScript.SyntaxFacts.getText(i).length; + } + } + result += "];\r\n"; + result += " function fixedWidthTokenLength(kind: SyntaxKind) {\r\n"; + result += " return fixedWidthArray[kind];\r\n"; + result += " }\r\n"; + return result; +} +function generateScannerUtilities() { + var result = "///\r\n" + "\r\n" + "module TypeScript {\r\n" + " export module ScannerUtilities {\r\n"; + var i; + var keywords = []; + for (i = TypeScript.SyntaxKind.FirstKeyword; i <= TypeScript.SyntaxKind.LastKeyword; i++) { + keywords.push({ kind: i, text: TypeScript.SyntaxFacts.getText(i) }); + } + keywords.sort(function (a, b) { return a.text.localeCompare(b.text); }); + result += " export function identifierKind(str: string, start: number, length: number): SyntaxKind {\r\n"; + var minTokenLength = min(keywords, function (k) { return k.text.length; }); + var maxTokenLength = max(keywords, function (k) { return k.text.length; }); + result += " switch (length) {\r\n"; + for (i = minTokenLength; i <= maxTokenLength; i++) { + var keywordsOfLengthI = TypeScript.ArrayUtilities.where(keywords, function (k) { return k.text.length === i; }); + if (keywordsOfLengthI.length > 0) { + result += " case " + i + ":"; + result += generateKeywordCondition(keywordsOfLengthI, 0, " "); + } + } + result += " default: return SyntaxKind.IdentifierName;\r\n"; + result += " }\r\n"; + result += " }\r\n"; + result += " }\r\n"; + result += "}"; + return result; +} +function syntaxKindName(kind) { + for (var name in TypeScript.SyntaxKind) { + if (TypeScript.SyntaxKind[name] === kind) { + return name; + } + } + throw new Error(); +} +function generateVisitor() { + var result = ""; + result += "///\r\n\r\n"; + result += "module TypeScript {\r\n"; + result += " export function visitNodeOrToken(visitor: ISyntaxVisitor, element: ISyntaxNodeOrToken): any {\r\n"; + result += " if (element === undefined) { return undefined; }\r\n"; + result += " switch (element.kind) {\r\n"; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; + result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": "; + result += "return visitor.visit" + getNameWithoutSuffix(definition) + "(<" + definition.name + ">element);\r\n"; + } + result += " default: return visitor.visitToken(element);\r\n"; + result += " }\r\n"; + result += " }\r\n\r\n"; + result += " export interface ISyntaxVisitor {\r\n"; + result += " visitToken(token: ISyntaxToken): any;\r\n"; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; + result += " visit" + getNameWithoutSuffix(definition) + "(node: " + definition.name + "): any;\r\n"; + } + result += " }"; + result += "\r\n}"; + return result; +} +var syntaxNodesConcrete = generateNodes(); +var syntaxInterfaces = generateSyntaxInterfaces(); +var walker = generateWalker(); +var scannerUtilities = generateScannerUtilities(); +var visitor = generateVisitor(); +var utilities = generateUtilities(); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxNodes.concrete.generated.ts", syntaxNodesConcrete, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxInterfaces.generated.ts", syntaxInterfaces, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxWalker.generated.ts", walker, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\scannerUtilities.generated.ts", scannerUtilities, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxVisitor.generated.ts", visitor, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\utilities.generated.ts", utilities, false); +//# sourceMappingURL=file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.js.map diff --git a/src/services/syntax/SyntaxGenerator.js.map b/src/services/syntax/SyntaxGenerator.js.map new file mode 100644 index 00000000000..662350f9032 --- /dev/null +++ b/src/services/syntax/SyntaxGenerator.js.map @@ -0,0 +1,53 @@ +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< Updated upstream +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IA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,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,Q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CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,IAAIA,MAAMA,GAAGA,GAAGA,CAACA,YAAYA,CAACA,QAAQA,CAACA,CAACA;YACxCA,IAAIA,GAAGA,GAAGA,MAAMA,CAACA,MAAMA,CAACA;YACxBA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAK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MA,IAAIA,OAAOA,CAACA;IAElBA,MAAMA,IAAIA,OAAOA,CAACA;IAElBA,MAAMA,CAACA,MAAMA,CAACA;AAClBA,CAACA;AAED,IAAI,mBAAmB,GAAG,aAAa,EAAE,CAAC;AAC1C,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,MAAM,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> Stashed changes +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,UAAUA,CAACA,IAAIA,EAAEA,CAACA;YAClBA,IAAAA,CAACA;gBACGA,EAAEA,CAACA,CAACA,QAAQA,CAACA,CAACA,CAACA;oBAC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ACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAE7EA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,EAAEA,CAACA,CAACA,CAACA;YACtCA,CAACA;YAEDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA;QACnCA,CAACA;QAEDD,SAASA,SAASA,CAACA,QA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S,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> 1324350... Simplify module name parsing. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA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GAAGA,KAAKA,CAACA,CAACA,CAACA,CAACA;gBACvBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,MAAMA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;oBACrCA,EAAEA,CAACA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA,CAACA,EAAEA,OAAOA,CAACA,CAACA,CAACA,CAACA;wBAC/BA,KAAKA,CAACA;oBACVA,CAACA;gBACLA,CAACA;gBAEDA,EAAEA,CAACA,CAACA,CAACA,KAAKA,MAAMA,CAACA,MAAMA,CAACA,CAACA,CAACA;oBACtBA,MAAMA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA;gBACzBA,CAACA;YACLA,CAACA;YAEDA,MAAMA,CAACA,MAAMA,CAACA;QAClBA,CAACA;QAEaJ,mBAAIA,GAAlBA,UAAsBA,KAAUA;YAC5BK,EAAEA,CAACA,CAACA,KAAKA,CAACA,MAAMA,KAAKA,CAACA,CAACA,CAACA,CAACA;gBACrBA,MAAMA,iBAAMA,CAACA,kBAAkBA,CAACA,OAAOA,CAACA,CAACA;YAC7CA,CAACA;YAEDA,MAAMA,CAACA,KAAKA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA;QACnCA,CAACA;QAEaL,4BAAaA,GAA3BA,UAA+BA,KAAUA,EAAEA,SAA2CA;YAClFM,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBACzCA,IAAIA,CAACA,GAAGA,KAAKA,CAACA,CAACA,CAACA,CAACA;gBACjBA,EAAEA,CAACA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA,CAACA,CAACA;oBAClBA,MAAMA,CAACA,CAACA,CAACA;gBACbA,CAACA;YACLA,CAACA;Y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A,IAAIA,GAAGA,aAAaA,CAACA;IAC/GA,CAACA;IAEDA,MAAMA,IAAIA,OAAOA,CAACA;IAElBA,MAAMA,IAAIA,OAAOA,CAACA;IAElBA,MAAMA,CAACA,MAAMA,CAACA;AAClBA,CAACA;AAED,IAAI,mBAAmB,GAAG,aAAa,EAAE,CAAC;AAC1C,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,MAAM,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> e8c937b... Simplify API for nodes htat have both a block and a semicolon token. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,UAAUA,CAACA,IAAIA,EAAEA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,CAACA;YACxBA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAE7EA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,EAAEA,CAACA,CAACA,CAACA;YACtCA,CAACA;YAEDA,MAAMA,CAACA,MAA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,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> e070f8f... Simplify API for nodes that have both a block and an expression. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;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,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,IAAIA,MAAMA,GAAGA,GAAGA,CAACA,YAAYA,CAACA,QAAQA,CAACA,CAACA;YACxCA,IAAIA,GAAGA,GAAGA,MAAMA,CAACA,MAAMA,CAACA;YACxBA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MA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G,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> f2c20c8... Use union types to make For/ForIn statements simpler. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,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,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,IAAIA,MAAMA,GAAGA,GAAGA,CAACA,YAAYA,CAACA,QAAQA,CAACA,CAACA;YACxCA,IAAIA,GAAGA,GAAGA,MAAMA,CAACA,MAAMA,CAACA;YACxBA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAK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AAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> 6d94dc3... Body is optional. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAI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,CAACA;QAEtGA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,IAAIA,MAAMA,GAAGA,GAAGA,CAACA,YAAYA,CAACA,QAAQA,CAACA,CAACA;YACxCA,IAAIA,GAAGA,GAAGA,MAAMA,CAACA,MAAMA,CAACA;YACxBA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA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AIA,OAAOA,CAACA;IAElBA,MAAMA,IAAIA,OAAOA,CAACA;IAElBA,MAAMA,CAACA,MAAMA,CAACA;AAClBA,CAACA;AAED,IAAI,mBAAmB,GAAG,aAAa,EAAE,CAAC;AAC1C,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,MAAM,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> f4fb252... Add support for parsing generator declarations. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,UAAUA,CAACA,IAAIA,EAAEA,CAACA;YAClBA,IAAAA,CAACA;gBACGA,EAAEA,CAACA,CAACA,QAAQA,CAACA,CAACA,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,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAE7EA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,EAAEA,CAACA,CAACA,CAACA;YACtCA,CAACA;YAEDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA;QACnCA,CAACA;QAEDD,SAASA,SAASA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Ae,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> a5407f9... Function property assignments can also be generators. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAA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gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> 99981aa... Add support for parsing yield expressions. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,UAAUA,CAACA,IAAIA,EAAEA,CAACA;YAClBA,IAAAA,CAACA;gBACGA,EAAEA,CAACA,CAACA,QAAQA,CAACA,CAACA,CAACA;oBACXA,UAAUA,CAACA,OAAOA,GAAGA,QAAQA,CAACA;oBAC9BA,UAAUA,CAACA,YAAYA,CAACA,QAAQA,CAACA,CAACA;gBACtCA,CAACA;gBACDA,IAAIA,CAACA,CAACA;oBAEFA,UAAUA,CAACA,OAAOA,GAAGA,QAAQA,CAACA;oBAC9BA,UAAUA,CAACA,YAAYA,CAACA,QAAQA,CAAC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AAI,MAAM,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> 8097afa... Move parser error to grammar check phase. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,UAAUA,CAACA,IAAIA,EAAEA,CAACA;YAClBA,IAAAA,CAACA;gBACGA,EAAEA,CAACA,CAACA,QAAQA,CAACA,CAACA,CAACA;oBACXA,UAAUA,CAACA,OAAOA,GAAGA,QAAQA,CAACA;oBAC9BA,UAAUA,CAACA,YAAYA,CAACA,QAAQA,CAACA,CAACA;gBACtCA,CAACA;gBACDA,IAAIA,CAACA,CAACA;oBAEFA,UAAUA,CAACA,OAAOA,GAAGA,QAAQA,CAACA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aAAa,EAAE,CAAC;AAC1C,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,MAAM,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> 67123d7... Move parser error to the grammar checker. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,UAAUA,CAACA,IAAIA,EAAEA,CAACA;YAClBA,IAAAA,CAACA;gBACGA,EAAEA,CAACA,CAACA,QAAQA,CAACA,CAACA,CAACA;oBACXA,UAAUA,CAACA,OAAOA,GAAGA,QAAQA,CAACA;oBAC9BA,UAAUA,CAACA,YAAYA,CAACA,QAAQA,CAACA,CAACA;gBACtCA,CAACA;g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qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> e97cba0... Make parser more lenient with what it allows as the body of a function. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GA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AEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,IAAIA,MAAMA,GAAGA,GAAGA,CAACA,YAAYA,CAACA,QAAQA,CAACA,CAACA;YACxCA,IAAIA,GAAGA,GAAGA,MAAMA,CAACA,MAAMA,CAACA;YACxBA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAI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AAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> f41e8c3... Rename 'block' to 'body'. diff --git a/src/services/syntax/constants.ts b/src/services/syntax/constants.ts index 13b3d8ad754..87d4a6a2c77 100644 --- a/src/services/syntax/constants.ts +++ b/src/services/syntax/constants.ts @@ -1,26 +1,24 @@ /// module TypeScript { - export enum SyntaxConstants { + export const enum ParserContextFlags { + StrictMode = 1 << 0, + DisallowIn = 1 << 1, + Yield = 1 << 2, + GeneratorParameter = 1 << 3, + + Mask = 0xF + } + + export enum SyntaxNodeConstants { None = 0, - // Masks that we use to place information about a node into a single int. The first bit tells - // us if we've computed the data for a node. - // - // The second bit tells us if the node is incrementally reusable if it does not - // containe any skipped tokens, zero width tokens, regex tokens in it ("/", "/=" or "/.../"), - // and contains no tokens that were parser generated. - // - // The next bit lets us know if the nodes was parsed in a strict context or node. A node can - // only be used by the incremental parser if it is parsed in the same strict context as before. - // last masks off the part of the int - // - // The width of the node is stored in the remainder of the int. This allows us up to 512MB - // for a node by using all 29 bits. However, in the common case, we'll use less than 29 bits + // The first four bit of the flags are used to store parser context flags. + // The width of the node is stored in the remainder of the int. This allows us up to 128MB + // for a node by using all 27 bits. However, in the common case, we'll use less than 27 bits // for the width. Thus, the info will be stored in a single int in chakra. - NodeDataComputed = 0x00000001, // 0000 0000 0000 0000 0000 0000 0000 0001 - NodeIncrementallyUnusableMask = 0x00000002, // 0000 0000 0000 0000 0000 0000 0000 0010 - NodeParsedInStrictModeMask = 0x00000004, // 0000 0000 0000 0000 0000 0000 0000 0100 - NodeFullWidthShift = 3, // 1111 1111 1111 1111 1111 1111 1111 1000 + DataComputed = 1 << 4, // 0000 0000 0000 0000 0000 0000 0001 0000 + IncrementallyUnusableMask = 1 << 5, // 0000 0000 0000 0000 0000 0000 0010 0000 + FullWidthShift = 1 << 6, // 1111 1111 1111 1111 1111 1111 1100 0000 } } \ No newline at end of file diff --git a/src/services/syntax/defaultSyntaxVisitor.generated.ts b/src/services/syntax/defaultSyntaxVisitor.generated.ts deleted file mode 100644 index 041b72b9359..00000000000 --- a/src/services/syntax/defaultSyntaxVisitor.generated.ts +++ /dev/null @@ -1,353 +0,0 @@ -/// - -module TypeScript { - export class SyntaxVisitor implements ISyntaxVisitor { - public defaultVisit(node: ISyntaxNodeOrToken): any { - return null; - } - - public visitToken(token: ISyntaxToken): any { - return this.defaultVisit(token); - } - - public visitSourceUnit(node: SourceUnitSyntax): any { - return this.defaultVisit(node); - } - - public visitQualifiedName(node: QualifiedNameSyntax): any { - return this.defaultVisit(node); - } - - public visitObjectType(node: ObjectTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitFunctionType(node: FunctionTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitArrayType(node: ArrayTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitConstructorType(node: ConstructorTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitGenericType(node: GenericTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeQuery(node: TypeQuerySyntax): any { - return this.defaultVisit(node); - } - - public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitFunctionDeclaration(node: FunctionDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitModuleDeclaration(node: ModuleDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitClassDeclaration(node: ClassDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitEnumDeclaration(node: EnumDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitImportDeclaration(node: ImportDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitExportAssignment(node: ExportAssignmentSyntax): any { - return this.defaultVisit(node); - } - - public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitGetAccessor(node: GetAccessorSyntax): any { - return this.defaultVisit(node); - } - - public visitSetAccessor(node: SetAccessorSyntax): any { - return this.defaultVisit(node); - } - - public visitPropertySignature(node: PropertySignatureSyntax): any { - return this.defaultVisit(node); - } - - public visitCallSignature(node: CallSignatureSyntax): any { - return this.defaultVisit(node); - } - - public visitConstructSignature(node: ConstructSignatureSyntax): any { - return this.defaultVisit(node); - } - - public visitIndexSignature(node: IndexSignatureSyntax): any { - return this.defaultVisit(node); - } - - public visitMethodSignature(node: MethodSignatureSyntax): any { - return this.defaultVisit(node); - } - - public visitBlock(node: BlockSyntax): any { - return this.defaultVisit(node); - } - - public visitIfStatement(node: IfStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitVariableStatement(node: VariableStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitExpressionStatement(node: ExpressionStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitReturnStatement(node: ReturnStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitSwitchStatement(node: SwitchStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitBreakStatement(node: BreakStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitContinueStatement(node: ContinueStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitForStatement(node: ForStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitForInStatement(node: ForInStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitEmptyStatement(node: EmptyStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitThrowStatement(node: ThrowStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitWhileStatement(node: WhileStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitTryStatement(node: TryStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitLabeledStatement(node: LabeledStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitDoStatement(node: DoStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitDebuggerStatement(node: DebuggerStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitWithStatement(node: WithStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitDeleteExpression(node: DeleteExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeOfExpression(node: TypeOfExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitVoidExpression(node: VoidExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitConditionalExpression(node: ConditionalExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitBinaryExpression(node: BinaryExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitInvocationExpression(node: InvocationExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitObjectCreationExpression(node: ObjectCreationExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitParenthesizedExpression(node: ParenthesizedExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitSimpleArrowFunctionExpression(node: SimpleArrowFunctionExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitCastExpression(node: CastExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitElementAccessExpression(node: ElementAccessExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitFunctionExpression(node: FunctionExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitOmittedExpression(node: OmittedExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitVariableDeclaration(node: VariableDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitVariableDeclarator(node: VariableDeclaratorSyntax): any { - return this.defaultVisit(node); - } - - public visitArgumentList(node: ArgumentListSyntax): any { - return this.defaultVisit(node); - } - - public visitParameterList(node: ParameterListSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeArgumentList(node: TypeArgumentListSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeParameterList(node: TypeParameterListSyntax): any { - return this.defaultVisit(node); - } - - public visitHeritageClause(node: HeritageClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitEqualsValueClause(node: EqualsValueClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitCaseSwitchClause(node: CaseSwitchClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitDefaultSwitchClause(node: DefaultSwitchClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitElseClause(node: ElseClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitCatchClause(node: CatchClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitFinallyClause(node: FinallyClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeParameter(node: TypeParameterSyntax): any { - return this.defaultVisit(node); - } - - public visitConstraint(node: ConstraintSyntax): any { - return this.defaultVisit(node); - } - - public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): any { - return this.defaultVisit(node); - } - - public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): any { - return this.defaultVisit(node); - } - - public visitParameter(node: ParameterSyntax): any { - return this.defaultVisit(node); - } - - public visitEnumElement(node: EnumElementSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeAnnotation(node: TypeAnnotationSyntax): any { - return this.defaultVisit(node); - } - - public visitExternalModuleReference(node: ExternalModuleReferenceSyntax): any { - return this.defaultVisit(node); - } - - public visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): any { - return this.defaultVisit(node); - } - } -} \ No newline at end of file diff --git a/src/services/syntax/depthLimitedWalker.ts b/src/services/syntax/depthLimitedWalker.ts index 79df1ebd836..e69de29bb2d 100644 --- a/src/services/syntax/depthLimitedWalker.ts +++ b/src/services/syntax/depthLimitedWalker.ts @@ -1,21 +0,0 @@ -/// - -module TypeScript { - export class DepthLimitedWalker extends SyntaxWalker { - private _depth: number = 0; - private _maximumDepth: number = 0; - - constructor(maximumDepth: number) { - super(); - this._maximumDepth = maximumDepth; - } - - public visitNode(node: ISyntaxNode): void { - if (this._depth < this._maximumDepth) { - this._depth++; - super.visitNode(node); - this._depth--; - } - } - } -} \ No newline at end of file diff --git a/src/services/syntax/incrementalParser.ts b/src/services/syntax/incrementalParser.ts index 94423418f42..273b3eec5fe 100644 --- a/src/services/syntax/incrementalParser.ts +++ b/src/services/syntax/incrementalParser.ts @@ -4,8 +4,10 @@ module TypeScript.IncrementalParser { interface IParserRewindPoint { // Information used by the incremental parser source. oldSourceUnitCursor: SyntaxCursor; - changeDelta: number; - changeRange: TextChangeRange; + } + + interface ISyntaxElementInternal extends ISyntaxElement { + intersectsChange: boolean; } // Parser source used in incremental scenarios. This parser source wraps an old tree, text @@ -21,9 +23,6 @@ module TypeScript.IncrementalParser { // prevent this level of reuse include substantially destructive operations like introducing // "/*" without a "*/" nearby to terminate the comment. function createParserSource(oldSyntaxTree: SyntaxTree, textChangeRange: TextChangeRange, text: ISimpleText): Parser.IParserSource { - var fileName = oldSyntaxTree.fileName(); - var languageVersion = oldSyntaxTree.languageVersion(); - // The underlying source that we will use to scan tokens from any new text, or any tokens // from the old tree that we decide we can't use for any reason. We will also continue // scanning tokens from this source until we've decided that we're resynchronized and can @@ -31,40 +30,15 @@ module TypeScript.IncrementalParser { // // This parser source also keeps track of the absolute position in the text that we're in, // and any token diagnostics produced. That way we dont' have to track that ourselves. - var _scannerParserSource: Scanner.IScannerParserSource; - - // The range of text in the *original* text that was changed, and the new length of it after - // the change. - var _changeRange: TextChangeRange; - - // Cached value of _changeRange.newSpan(). Cached for performance. - var _changeRangeNewSpan: TextSpan; - - // This number represents how our position in the old tree relates to the position we're - // pointing at in the new text. If it is 0 then our positions are in sync and we can read - // nodes or tokens from the old tree. If it is non-zero, then our positions are not in - // sync and we cannot use nodes or tokens from the old tree. - // - // Now, changeDelta could be negative or positive. Negative means 'the position we're at - // in the original tree is behind the position we're at in the text'. In this case we - // keep throwing out old nodes or tokens (and thus move forward in the original tree) until - // changeDelta becomes 0 again or positive. If it becomes 0 then we are resynched and can - // read nodes or tokesn from the tree. - // - // If changeDelta is positive, that means the current node or token we're pointing at in - // the old tree is at a further ahead position than the position we're pointing at in the - // new text. In this case we have no choice but to scan tokens from teh new text. We will - // continue to do so until, again, changeDelta becomes 0 and we've resynced, or change delta - // becomes negative and we need to skip nodes or tokes in the original tree. - var _changeDelta: number = 0; + var _scannerParserSource = Scanner.createParserSource(oldSyntaxTree.fileName(), text, oldSyntaxTree.languageVersion()); // The cursor we use to navigate through and retrieve nodes and tokens from the old tree. - var _oldSourceUnitCursor = getSyntaxCursor(); var oldSourceUnit = oldSyntaxTree.sourceUnit(); var _outstandingRewindPointCount = 0; // Start the cursor pointing at the first element in the source unit (if it exists). + var _oldSourceUnitCursor = getSyntaxCursor(); if (oldSourceUnit.moduleElements.length > 0) { _oldSourceUnitCursor.pushElement(childAt(oldSourceUnit.moduleElements, 0), /*indexInParent:*/ 0); } @@ -74,8 +48,10 @@ module TypeScript.IncrementalParser { // time this could be problematic would be if the user made a ton of discontinuous edits. // For example, doing a column select on a *large* section of a code. If this is a // problem, we can always update this code to handle multiple changes. - _changeRange = extendToAffectedRange(textChangeRange, oldSourceUnit); - _changeRangeNewSpan = _changeRange.newSpan(); + var _changeRange = extendToAffectedRange(textChangeRange, oldSourceUnit); + + // Cached value of _changeRange.newSpan(). Cached for performance. + var _changeRangeNewSpan = _changeRange.newSpan(); // The old tree's length, plus whatever length change was caused by the edit // Had better equal the new text's length! @@ -83,18 +59,32 @@ module TypeScript.IncrementalParser { Debug.assert((fullWidth(oldSourceUnit) - _changeRange.span().length() + _changeRange.newLength()) === text.length()); } - // Set up a scanner so that we can scan tokens out of the new text. - _scannerParserSource = Scanner.createParserSource(oldSyntaxTree.fileName(), text, oldSyntaxTree.languageVersion()); + var delta = _changeRange.newSpan().length() - _changeRange.span().length(); + // If we added or removed characters during the edit, then we need to go and adjust all + // the nodes after the edit. Those nodes may move forward down (if we inserted chars) + // or they may move backward (if we deleted chars). + // + // Doing this helps us out in two ways. First, it means that any nodes/tokens we want + // to reuse are already at the appropriate position in the new text. That way when we + // reuse them, we don't have to figure out if they need to be adjusted. Second, it makes + // it very easy to determine if we can reuse a node. If the node's position is at where + // we are in the text, then we can reuse it. Otherwise we can't. If hte node's position + // is ahead of us, then we'll need to rescan tokens. If the node's position is behind + // us, then we'll need to skip it or crumble it as appropriate + // + // Also, mark any syntax elements that intersect the changed span. We know, up front, + // that we cannot reuse these elements. + updateTokenPositionsAndMarkElements(oldSourceUnit, + _changeRange.span().start(), _changeRange.span().end(), delta, /*fullStart:*/ 0); function release() { _scannerParserSource.release(); - _scannerParserSource = null; - _oldSourceUnitCursor = null; + _scannerParserSource = undefined; + _oldSourceUnitCursor = undefined; _outstandingRewindPointCount = 0; } - function extendToAffectedRange(changeRange: TextChangeRange, - sourceUnit: SourceUnitSyntax): TextChangeRange { + function extendToAffectedRange(changeRange: TextChangeRange, sourceUnit: SourceUnitSyntax): TextChangeRange { // Consider the following code: // void foo() { /; } // @@ -105,14 +95,6 @@ module TypeScript.IncrementalParser { // (as it does not intersect the actual original change range). Because an edit may // change the token touching it, we actually need to look back *at least* one token so // that the prior token sees that change. - // - // Note: i believe (outside of regex tokens) max lookahead is just one token for - // TypeScript. However, if this turns out to be wrong, we may have to increase how much - // futher we look back. - // - // Note: lookahead handling for regex characters is handled specially in during - // incremental parsing, and does not need to be handled here. - var maxLookahead = 1; var start = changeRange.span().start(); @@ -122,10 +104,6 @@ module TypeScript.IncrementalParser { // start of the tree. for (var i = 0; start > 0 && i <= maxLookahead; i++) { var token = findToken(sourceUnit, start); - - // Debug.assert(token.kind !== SyntaxKind.None); - // Debug.assert(token.kind() === SyntaxKind.EndOfFileToken || token.fullWidth() > 0); - var position = token.fullStart(); start = Math.max(0, position - 1); @@ -149,17 +127,8 @@ module TypeScript.IncrementalParser { // Get a rewind point for our new text reader and for our old source unit cursor. var rewindPoint = _scannerParserSource.getRewindPoint(); - // Clone our cursor. That way we can restore to that point if hte parser needs to rewind. - var oldSourceUnitCursorClone = cloneSyntaxCursor(_oldSourceUnitCursor); - - // Store where we were when the rewind point was created. - rewindPoint.changeDelta = _changeDelta; - rewindPoint.changeRange = _changeRange; - rewindPoint.oldSourceUnitCursor = _oldSourceUnitCursor; - - _oldSourceUnitCursor = oldSourceUnitCursorClone; - - // Debug.assert(rewindPoint.pinCount === _oldSourceUnitCursor.pinCount()); + // Clone our cursor. That way we can restore to that point if the parser needs to rewind. + rewindPoint.oldSourceUnitCursor = cloneSyntaxCursor(_oldSourceUnitCursor); _outstandingRewindPointCount++; return rewindPoint; @@ -167,23 +136,21 @@ module TypeScript.IncrementalParser { function rewind(rewindPoint: IParserRewindPoint): void { // Restore our state to the values when the rewind point was created. - _changeRange = rewindPoint.changeRange; - _changeDelta = rewindPoint.changeDelta; // Reset the cursor to what it was when we got the rewind point. Make sure to return // our existing cursor to the pool so it can be reused. returnSyntaxCursor(_oldSourceUnitCursor); _oldSourceUnitCursor = rewindPoint.oldSourceUnitCursor; - // Null out the cursor that the rewind point points to. This way we don't try + // Clear the cursor that the rewind point points to. This way we don't try // to return it in 'releaseRewindPoint'. - rewindPoint.oldSourceUnitCursor = null; + rewindPoint.oldSourceUnitCursor = undefined; _scannerParserSource.rewind(rewindPoint); } function releaseRewindPoint(rewindPoint: IParserRewindPoint): void { - if (rewindPoint.oldSourceUnitCursor !== null) { + if (rewindPoint.oldSourceUnitCursor) { returnSyntaxCursor(rewindPoint.oldSourceUnitCursor); } @@ -196,7 +163,7 @@ module TypeScript.IncrementalParser { return _outstandingRewindPointCount > 0; } - function canReadFromOldSourceUnit() { + function trySynchronizeCursorToPosition() { // If we're currently pinned, then do not want to touch the cursor. Here's why. First, // recall that we're 'pinned' when we're speculatively parsing. So say we were to allow // returning old nodes/tokens while speculatively parsing. Then, the parser might start @@ -218,63 +185,84 @@ module TypeScript.IncrementalParser { return false; } - // If our current absolute position is in the middle of the changed range in the new text - // then we definitely can't read from the old source unit right now. - if (_changeRange !== null && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { - return false; - } + var absolutePos = absolutePosition(); + while (true) { + if (_oldSourceUnitCursor.isFinished()) { + // Can't synchronize the cursor to the current position if the cursor is finished. + return false; + } - // First, try to sync up with the new text if we're behind. - syncCursorToNewTextIfBehind(); + // Start with the current node or token the cursor is pointing at. + var currentNodeOrToken = _oldSourceUnitCursor.currentNodeOrToken(); - // Now, if we're synced up *and* we're not currently pinned in the new text scanner, - // then we can read a node from the cursor. If we're pinned in the scanner then we - // can't read a node from the cursor because we will mess up the pinned scanner when - // we try to move it forward past this node. - return _changeDelta === 0 && - !_oldSourceUnitCursor.isFinished(); - } + // Node, move the cursor past any nodes or tokens that intersect the change range + // 1) they are never reusable. + // 2) their positions are wacky as they refer to the original text. + // + // We consider these nodes and tokens essentially invisible to all further parts + // of the incremental algorithm. + if ((currentNodeOrToken).intersectsChange) { + if (isNode(currentNodeOrToken)) { + _oldSourceUnitCursor.moveToFirstChild(); + } + else { + _oldSourceUnitCursor.moveToNextSibling(); + } + continue; + } - function updateTokens(nodeOrToken: ISyntaxNodeOrToken): void { - // If we got a node or token, and we're past the range of edited text, then walk its - // constituent tokens, making sure all their positions are correct. We don't need to - // do this for the tokens before the edited range (since their positions couldn't have - // been affected by the edit), and we don't need to do this for the tokens in the - // edited range, as their positions will be correct when the underlying parser source - // creates them. + var currentNodeOrTokenFullStart = fullStart(currentNodeOrToken); + if (currentNodeOrTokenFullStart === absolutePos) { + // We were able to synchronize the cursor to the current position. We can + // read from the cursor + return true; + } - var position = absolutePosition(); - var tokenWasMoved = isPastChangeRange() && fullStart(nodeOrToken) !== position; + if (currentNodeOrTokenFullStart > absolutePos) { + // The node or token is ahead of the current position. We'll need to rescan + // tokens until we catch up. + return false; + } - if (tokenWasMoved) { - setTokenFullStartWalker.position = position; + // The node or is behind the current position we're at in the text. - visitNodeOrToken(setTokenFullStartWalker, nodeOrToken); + var currentNodeOrTokenFullWidth = fullWidth(currentNodeOrToken); + var currentNodeOrTokenFullEnd = currentNodeOrTokenFullStart + currentNodeOrTokenFullWidth; + + // If we're pointing at a node, and that node ends before our current position, we + // can just skip the node entirely. Or, if we're pointing at a token, we won't be + // able to break up that token any further and we should just move to the next + // token. + if (currentNodeOrTokenFullEnd <= absolutePos || isToken(currentNodeOrToken)) { + _oldSourceUnitCursor.moveToNextSibling(); + } + else { + // We have a node, and it started before our absolute pos, and ended after our + // pos. Try to crumble this node to see if we'll be able to skip the first node + // or token contained within. + _oldSourceUnitCursor.moveToFirstChild(); + } } } function currentNode(): ISyntaxNode { - if (canReadFromOldSourceUnit()) { + if (trySynchronizeCursorToPosition()) { // Try to read a node. If we can't then our caller will call back in and just try // to get a token. var node = tryGetNodeFromOldSourceUnit(); - if (node !== null) { - // Make sure the positions for the tokens in this node are correct. - updateTokens(node); + if (node) { return node; } } // Either we were ahead of the old text, or we were pinned. No node can be read here. - return null; + return undefined; } function currentToken(): ISyntaxToken { - if (canReadFromOldSourceUnit()) { + if (trySynchronizeCursorToPosition()) { var token = tryGetTokenFromOldSourceUnit(); - if (token !== null) { - // Make sure the token's position/text is correct. - updateTokens(token); + if (token) { return token; } } @@ -289,85 +277,24 @@ module TypeScript.IncrementalParser { return _scannerParserSource.currentContextualToken(); } - function syncCursorToNewTextIfBehind() { - while (true) { - if (_oldSourceUnitCursor.isFinished()) { - // Can't sync up if the cursor is finished. - break; - } - - if (_changeDelta >= 0) { - // Nothing to do if we're synced up or ahead of the text. - break; - } - - // We're behind in the original tree. Throw out a node or token in an attempt to - // catch up to the position we're at in the new text. - - var currentNodeOrToken = _oldSourceUnitCursor.currentNodeOrToken(); - - // If we're pointing at a node, and that node's width is less than our delta, - // then we can just skip that node. Otherwise, if we're pointing at a node - // whose width is greater than the delta, then crumble it and try again. - // Otherwise, we must be pointing at a token. Just skip it and try again. - - if (isNode(currentNodeOrToken) && (fullWidth(currentNodeOrToken) > Math.abs(_changeDelta))) { - // We were pointing at a node whose width was more than changeDelta. Crumble the - // node and try again. Note: we haven't changed changeDelta. So the callers loop - // will just repeat this until we get to a node or token that we can skip over. - _oldSourceUnitCursor.moveToFirstChild(); - } - else { - _oldSourceUnitCursor.moveToNextSibling(); - - // Get our change delta closer to 0 as we skip past this item. - _changeDelta += fullWidth(currentNodeOrToken); - - // If this was a node, then our changeDelta is 0 or negative. If this was a - // token, then we could still be negative (and we have to read another token), - // we could be zero (we're done), or we could be positive (we've moved ahead - // of the new text). Only if we're negative will we continue looping. - } - } - - // At this point, we must be either: - // a) done with the cursor - // b) (ideally) caught up to the new text position. - // c) ahead of the new text position. - // In case 'b' we can try to reuse a node from teh old tree. - // Debug.assert(_oldSourceUnitCursor.isFinished() || _changeDelta >= 0); - } - - function intersectsWithChangeRangeSpanInOriginalText(start: number, length: number) { - return !isPastChangeRange() && _changeRange.span().intersectsWith(start, length); - } - function tryGetNodeFromOldSourceUnit(): ISyntaxNode { - // Debug.assert(canReadFromOldSourceUnit()); - // Keep moving the cursor down to the first node that is safe to return. A node is // safe to return if: - // a) it does not intersect the changed text. - // b) it does not contain skipped text. - // c) it does not have any zero width tokens in it. - // d) it does not have a regex token in it. - // e) we are still in the same strict or non-strict state that the node was originally parsed in. + // a) it does not contain skipped text. + // b) it does not have any zero width tokens in it. + // c) it does not have a regex token in it. + // d) we are still in the same strict or non-strict state that the node was originally parsed in. while (true) { var node = _oldSourceUnitCursor.currentNode(); - if (node === null) { + if (node === undefined) { // Couldn't even read a node, nothing to return. - return null; + return undefined; } - if (!intersectsWithChangeRangeSpanInOriginalText(absolutePosition(), fullWidth(node))) { - // Didn't intersect with the change range. - var isIncrementallyUnusuable = TypeScript.isIncrementallyUnusable(node); - if (!isIncrementallyUnusuable) { - - // Didn't contain anything that would make it unusable. Awesome. This is - // a node we can reuse. - return node; - } + if (!TypeScript.isIncrementallyUnusable(node)) { + // Didn't contain anything that would make it unusable. Awesome. This is + // a node we can reuse. + return node; } // We couldn't use currentNode. Try to move to its first child (in case that's a @@ -377,9 +304,9 @@ module TypeScript.IncrementalParser { } } - function canReuseTokenFromOldSourceUnit(position: number, token: ISyntaxToken): boolean { + function canReuseTokenFromOldSourceUnit(token: ISyntaxToken): boolean { // A token is safe to return if: - // a) it does not intersect the changed text. + // a) it did not intersect the change range. // b) it does not contain skipped text. // c) it is not zero width. // d) it is not a contextual parser token. @@ -395,35 +322,23 @@ module TypeScript.IncrementalParser { // need to make sure that if that the parser asks for a *token* we don't return it. // Converted identifiers can't ever be created by the scanner, and as such, should not // be returned by this source. - if (token !== null) { - if (!intersectsWithChangeRangeSpanInOriginalText(position, token.fullWidth())) { - // Didn't intersect with the change range. - if (!token.isIncrementallyUnusable() && !Scanner.isContextualToken(token)) { - - // Didn't contain anything that would make it unusable. Awesome. This is - // a token we can reuse. - return true; - } - } - } - - return false; + return token && + !(token).intersectsChange && + !token.isIncrementallyUnusable() && + !Scanner.isContextualToken(token); } function tryGetTokenFromOldSourceUnit(): ISyntaxToken { - // Debug.assert(canReadFromOldSourceUnit()); - // get the current token that the cursor is pointing at. var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(absolutePosition(), token) - ? token : null; + return canReuseTokenFromOldSourceUnit(token) ? token : undefined; } function peekToken(n: number): ISyntaxToken { - if (canReadFromOldSourceUnit()) { + if (trySynchronizeCursorToPosition()) { var token = tryPeekTokenFromOldSourceUnit(n); - if (token !== null) { + if (token) { return token; } } @@ -433,8 +348,6 @@ module TypeScript.IncrementalParser { } function tryPeekTokenFromOldSourceUnit(n: number): ISyntaxToken { - // Debug.assert(canReadFromOldSourceUnit()); - // clone the existing cursor so we can move it forward and then restore ourselves back // to where we started from. @@ -449,11 +362,6 @@ module TypeScript.IncrementalParser { } function tryPeekTokenFromOldSourceUnitWorker(n: number): ISyntaxToken { - // In order to peek the 'nth' token we need all the tokens up to that point. That way - // we know we know position that the nth token is at. The position is necessary so - // that we can test if this token (or any that precede it cross the change range). - var currentPosition = absolutePosition(); - // First, make sure the cursor is pointing at a token. _oldSourceUnitCursor.moveToFirstToken(); @@ -461,109 +369,31 @@ module TypeScript.IncrementalParser { for (var i = 0; i < n; i++) { var interimToken = _oldSourceUnitCursor.currentToken(); - if (!canReuseTokenFromOldSourceUnit(currentPosition, interimToken)) { - return null; + if (!canReuseTokenFromOldSourceUnit(interimToken)) { + return undefined; } - currentPosition += interimToken.fullWidth(); _oldSourceUnitCursor.moveToNextSibling(); } var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(currentPosition, token) - ? token : null; + return canReuseTokenFromOldSourceUnit(token) ? token : undefined; } - function consumeNode(node: ISyntaxNode): void { - // A node could have only come from the old source unit cursor. Update it and our - // current state. - // Debug.assert(_changeDelta === 0); - // Debug.assert(currentNode() === node); - - _oldSourceUnitCursor.moveToNextSibling(); - - // Update the underlying source with where it should now be currently pointin. - var _absolutePosition = absolutePosition() + fullWidth(node); - _scannerParserSource.resetToPosition(_absolutePosition); - - // Debug.assert(previousToken !== null); - // Debug.assert(previousToken.width() > 0); - - //if (!isPastChangeRange()) { - // // If we still have a change range, then this node must have ended before the - // // change range starts. Thus, we don't need to call 'skipPastChanges'. - // Debug.assert(absolutePosition() < _changeRange.span().start()); - //} - } - - function consumeToken(currentToken: ISyntaxToken): void { - // This token may have come from the old source unit, or from the new text. Handle - // both accordingly. - - if (_oldSourceUnitCursor.currentToken() === currentToken) { - // The token came from the old source unit. So our tree and text must be in sync. - // Debug.assert(_changeDelta === 0); - - // Move the cursor past this token. - _oldSourceUnitCursor.moveToNextSibling(); - - // Debug.assert(!_normalParserSource.isPinned()); - - // Update the underlying source with where it should now be currently pointing. We - // don't need to do this when the token came from the new text as the source will - // automatically be placed in the right position. - var _absolutePosition = absolutePosition() + currentToken.fullWidth(); - _scannerParserSource.resetToPosition(_absolutePosition); - - // Debug.assert(previousToken !== null); - // Debug.assert(previousToken.width() > 0); - - //if (!isPastChangeRange()) { - // // If we still have a change range, then this token must have ended before the - // // change range starts. Thus, we don't need to call 'skipPastChanges'. - // Debug.assert(absolutePosition() < _changeRange.span().start()); - //} - } - else { - // the token came from the new text. That means the normal source moved forward, - // while the syntax cursor stayed in the same place. Thus our delta moves even - // further back. - _changeDelta -= currentToken.fullWidth(); - - // Move our underlying source forward. - _scannerParserSource.consumeToken(currentToken); - - // Because we read a token from the new text, we may have moved ourselves past the - // change range. If we did, then we may also have to update our change delta to - // compensate for the length change between the old and new text. - if (!isPastChangeRange()) { - // var changeEndInNewText = _changeRange.span().start() + _changeRange.newLength(); - if (absolutePosition() >= _changeRangeNewSpan.end()) { - _changeDelta += _changeRange.newLength() - _changeRange.span().length(); - - // Once we're past the change range, we no longer need it. Null it out. - // From now on we can check if we're past the change range just by seeing - // if this is null. - _changeRange = null; - } - } - } - } - - function isPastChangeRange(): boolean { - return _changeRange === null; + function consumeNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void { + _scannerParserSource.consumeNodeOrToken(nodeOrToken); } return { text: text, - fileName: fileName, - languageVersion: languageVersion, + fileName: oldSyntaxTree.fileName(), + languageVersion: oldSyntaxTree.languageVersion(), + absolutePosition: absolutePosition, currentNode: currentNode, currentToken: currentToken, currentContextualToken: currentContextualToken, peekToken: peekToken, - consumeNode: consumeNode, - consumeToken: consumeToken, + consumeNodeOrToken: consumeNodeOrToken, getRewindPoint: getRewindPoint, rewind: rewind, releaseRewindPoint: releaseRewindPoint, @@ -605,7 +435,7 @@ module TypeScript.IncrementalParser { if (syntaxCursorPoolCount > 0) { // If we reused an existing cursor, take it out of the pool so no one else uses it. syntaxCursorPoolCount--; - syntaxCursorPool[syntaxCursorPoolCount] = null; + syntaxCursorPool[syntaxCursorPoolCount] = undefined; } return cursor; @@ -652,11 +482,11 @@ module TypeScript.IncrementalParser { for (var i = 0, n = pieces.length; i < n; i++) { var piece = pieces[i]; - if (piece.element === null) { + if (piece.element === undefined) { break; } - piece.element = null; + piece.element = undefined; piece.indexInParent = -1; } @@ -665,18 +495,15 @@ module TypeScript.IncrementalParser { // Makes this cursor into a deep copy of the cursor passed in. function deepCopyFrom(other: SyntaxCursor): void { - // Debug.assert(currentPieceIndex === -1); for (var i = 0, n = other.pieces.length; i < n; i++) { var piece = other.pieces[i]; - if (piece.element === null) { + if (piece.element === undefined) { break; } pushElement(piece.element, piece.indexInParent); } - - // Debug.assert(currentPieceIndex === other.currentPieceIndex); } function isFinished(): boolean { @@ -685,26 +512,27 @@ module TypeScript.IncrementalParser { function currentNodeOrToken(): ISyntaxNodeOrToken { if (isFinished()) { - return null; + return undefined; } var result = pieces[currentPieceIndex].element; // The current element must always be a node or a token. - // Debug.assert(result !== null); - // Debug.assert(result.isNode() || result.isToken()); - return result; } function currentNode(): ISyntaxNode { var element = currentNodeOrToken(); - return isNode(element) ? element : null; + return isNode(element) ? element : undefined; + } + + function isEmptyList(element: ISyntaxElement) { + return isList(element) && (element).length === 0; } function moveToFirstChild() { var nodeOrToken = currentNodeOrToken(); - if (nodeOrToken === null) { + if (nodeOrToken === undefined) { return; } @@ -713,15 +541,12 @@ module TypeScript.IncrementalParser { return; } - // The last element must be a token or a node. - // Debug.assert(isNode(nodeOrToken)); - // Either the node has some existent child, then move to it. if it doesn't, then it's // an empty node. Conceptually the first child of an empty node is really just the // next sibling of the empty node. for (var i = 0, n = childCount(nodeOrToken); i < n; i++) { var child = childAt(nodeOrToken, i); - if (child !== null && !isShared(child)) { + if (child && !isEmptyList(child)) { // Great, we found a real child. Push that. pushElement(child, /*indexInParent:*/ i); @@ -734,8 +559,6 @@ module TypeScript.IncrementalParser { // This element must have been an empty node. Moving to its 'first child' is equivalent to just // moving to the next sibling. - - // Debug.assert(fullWidth(nodeOrToken) === 0); moveToNextSibling(); } @@ -749,14 +572,13 @@ module TypeScript.IncrementalParser { for (var i = currentPiece.indexInParent + 1, n = childCount(parent); i < n; i++) { var sibling = childAt(parent, i); - if (sibling !== null && !isShared(sibling)) { + if (sibling && !isEmptyList(sibling)) { // We found a good sibling that we can move to. Just reuse our existing piece // so we don't have to push/pop. currentPiece.element = sibling; currentPiece.indexInParent = i; - // The sibling might have been a list. Move to it's first child. it must have - // one since this was a non-shared element. + // The sibling might have been a list. Move to it's first child. moveToFirstChildIfList(); return; } @@ -766,7 +588,7 @@ module TypeScript.IncrementalParser { // Clear the data from the old piece. We don't want to keep any elements around // unintentionally. - currentPiece.element = null; + currentPiece.element = undefined; currentPiece.indexInParent = -1; // Point at the parent. if we move past the top of the path, then we're finished. @@ -777,18 +599,14 @@ module TypeScript.IncrementalParser { function moveToFirstChildIfList(): void { var element = pieces[currentPieceIndex].element; - if (isList(element) || isSeparatedList(element)) { + if (isList(element)) { // We cannot ever get an empty list in our piece path. Empty lists are 'shared' and // we make sure to filter that out before pushing any children. - // Debug.assert(childCount(element) > 0); - pushElement(childAt(element, 0), /*indexInParent:*/ 0); } } function pushElement(element: ISyntaxElement, indexInParent: number): void { - // Debug.assert(element !== null); - // Debug.assert(indexInParent >= 0); currentPieceIndex++; // Reuse an existing piece if we have one. Otherwise, push a new piece to our list. @@ -810,7 +628,6 @@ module TypeScript.IncrementalParser { continue; } - // Debug.assert(isToken(element)); return; } } @@ -819,8 +636,7 @@ module TypeScript.IncrementalParser { moveToFirstToken(); var element = currentNodeOrToken(); - // Debug.assert(element === null || element.isToken()); - return element === null ? null : element; + return element; } return { @@ -841,21 +657,105 @@ module TypeScript.IncrementalParser { // A simple walker we use to hit all the tokens of a node and update their positions when they // are reused in a different location because of an incremental parse. - class SetTokenFullStartWalker extends SyntaxWalker { - public position: number; + class TokenCollectorWalker extends SyntaxWalker { + public tokens: ISyntaxToken[] = []; public visitToken(token: ISyntaxToken): void { - var position = this.position; - token.setFullStart(position); - - this.position = position + token.fullWidth(); + this.tokens.push(token); } } - var setTokenFullStartWalker = new SetTokenFullStartWalker(); + var tokenCollectorWalker = new TokenCollectorWalker(); + function updateTokenPositionsAndMarkElements(element: ISyntaxElement, changeStart: number, changeRangeOldEnd: number, delta: number, fullStart: number): void { + // First, try to skip past any elements that we dont' need to move. We don't need to + // move any elements that don't start after the end of the change range. + if (fullStart > changeRangeOldEnd) { + // Note, we only move elements that are truly after the end of the change range. + // We consider elements that are touching the end of the change range to be unusable. + forceUpdateTokenPositionsForElement(element, delta); + } + else { + // Check if the element intersects the change range. If it does, then it is not + // reusable. Also, we'll need to recurse to see what constituent portions we may + // be able to use. + var fullEnd = fullStart + fullWidth(element); + if (fullEnd >= changeStart) { + (element).intersectsChange = true; + + if (isList(element)) { + var list = element; + for (var i = 0, n = list.length; i < n; i++) { + var child: ISyntaxElement = list[i]; + updateTokenPositionsAndMarkElements(child, changeStart, changeRangeOldEnd, delta, fullStart); + fullStart += fullWidth(child); + } + } + else if (isNode(element)) { + var node = element; + for (var i = 0, n = node.childCount; i < n; i++) { + var child = node.childAt(i); + if (child) { + updateTokenPositionsAndMarkElements(child, changeStart, changeRangeOldEnd, delta, fullStart); + fullStart += fullWidth(child); + } + } + } + } + // else { + // This element ended strictly before the edited range. We don't need to do anything + // with it. + // } + } + } + + function forceUpdateTokenPositionsForElement(element: ISyntaxElement, delta: number) { + // No need to move anything if the delta is 0. + if (delta !== 0) { + if (isList(element)) { + var list = element; + for (var i = 0, n = list.length; i < n; i++) { + forceUpdateTokenPositionForNodeOrToken(list[i], delta); + } + } + else { + forceUpdateTokenPositionForNodeOrToken(element, delta); + } + } + } + + function forceUpdateTokenPosition(token: ISyntaxToken, delta: number) { + token.setFullStart(token.fullStart() + delta); + } + + function forceUpdateTokenPositionForNodeOrToken(nodeOrToken: ISyntaxNodeOrToken, delta: number) { + if (isToken(nodeOrToken)) { + forceUpdateTokenPosition(nodeOrToken, delta); + } + else { + var node = nodeOrToken; + var tokens = getTokens(node); + for (var i = 0, n = tokens.length; i < n; i++) { + forceUpdateTokenPosition(tokens[i], delta); + } + } + } + + function getTokens(node: ISyntaxNode): ISyntaxToken[] { + var tokens = node.__cachedTokens; + if (!tokens) { + tokens = []; + tokenCollectorWalker.tokens = tokens; + + visitNodeOrToken(tokenCollectorWalker, node); + + node.__cachedTokens = tokens; + tokenCollectorWalker.tokens = undefined; + } + + return tokens; + } export function parse(oldSyntaxTree: SyntaxTree, textChangeRange: TextChangeRange, newText: ISimpleText): SyntaxTree { - Debug.assert(oldSyntaxTree.isConcrete(), "Can only incrementally parse a concrete syntax tree."); if (textChangeRange.isUnchanged()) { return oldSyntaxTree; } diff --git a/src/services/syntax/parser.ts b/src/services/syntax/parser.ts index 31a87b857b1..53f4608ff57 100644 --- a/src/services/syntax/parser.ts +++ b/src/services/syntax/parser.ts @@ -1,10 +1,6 @@ /// module TypeScript.Parser { - // The factory used to produce parse tree nodes. Injected normally by the - // TypeScript.Syntax.Abstract or TypeScript.Syntax.Conrete modules. - export var syntaxFactory: Syntax.ISyntaxFactory; - // Interface that represents the source that the parser pulls tokens from. Essentially, this // is the interface that the parser needs an underlying scanner to provide. This allows us to // separate out "what" the parser does with the tokens it retrieves versus "how" it obtains @@ -49,6 +45,9 @@ module TypeScript.Parser { // but can affect the diagnostics produced while parsing. languageVersion: ts.ScriptTarget; + // The place in the source text that we're currently pointing at. + absolutePosition(): number; + // The current syntax node the source is pointing at. Only available in incremental settings. // The source can point at a node if that node doesn't intersect any of the text changes in // the file, and doesn't contain certain unacceptable constructs. For example, if the node @@ -71,8 +70,7 @@ module TypeScript.Parser { // Called to move the source to the next node or token once the parser has consumed the // current one. - consumeNode(node: ISyntaxNode): void; - consumeToken(token: ISyntaxToken): void; + consumeNodeOrToken(node: ISyntaxNodeOrToken): void; // Gets a rewind point that the parser can use to move back to after it speculatively // parses something. The source guarantees that if the parser calls 'rewind' with that @@ -120,33 +118,6 @@ module TypeScript.Parser { export interface IRewindPoint { } - var arrayPool: any[][] = []; - var arrayPoolCount: number = 0; - - function getArray(): any[] { - if (arrayPoolCount === 0) { - return []; - } - - arrayPoolCount--; - var result = arrayPool[arrayPoolCount]; - arrayPool[arrayPoolCount] = null; - - return result; - } - - function returnZeroLengthArray(array: any[]) { - if (array.length === 0) { - returnArray(array); - } - } - - function returnArray(array: any[]) { - array.length = 0; - arrayPool[arrayPoolCount] = array; - arrayPoolCount++; - } - interface IParserRewindPoint extends IRewindPoint { // As we speculatively parse, we may build up diagnostics. When we rewind we want to // 'forget' that information.In order to do that we store the count of diagnostics and @@ -154,13 +125,11 @@ module TypeScript.Parser { // speculative parse does not affect any further results. diagnosticsCount: number; - // isInStrictMode and listParsingState should not have to be tracked by a rewind point. - // Because they are naturally mutated and restored based on the normal stack movement of - // the parser, they should automatically return to whatever value they had to begin with - // if the parser decides to rewind or not. However, to ensure that this is true, we track - // these variables and check if they have the same value when we're rewinding/releasing. - isInStrictMode: boolean; - listParsingState: ListParsingState; + // As we speculatively parse we may end up adding additional skipped tokens to the + // _skippedTokens array in the parser. When we rewind we don't want those items in the + // array. We may also, during speculative parsing, attach our skipped tokens to some + // new token. When we rewind we need to restore whatever skipped tokens we started with. + skippedTokens: ISyntaxToken[]; } // Contains the actual logic to parse typescript/javascript. This is the code that generally @@ -187,7 +156,46 @@ module TypeScript.Parser { // TODO: do we need to store/restore this when speculative parsing? I don't think so. The // parsing logic already handles storing/restoring this and should work properly even if we're // speculative parsing. - var isInStrictMode: boolean = false; + // + // When adding more parser context flags, consider which is the more common case that the + // flag will be in. This should be hte 'false' state for that flag. The reason for this is + // that we don't store data in our nodes unless the value is in the *non-default* state. So, + // for example, more often than code 'allows-in' (or doesn't 'disallow-in'). We opt for + // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost + // all nodes would need extra state on them to store this info. + // + // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 + // grammar specification. + // + // An important thing about these context concepts. By default they are effectively inherited + // while parsing through every grammar production. i.e. if you don't change them, then when + // you parse a sub-production, it will have the same context values as hte parent production. + // This is great most of the time. After all, consider all the 'expression' grammar productions + // and how nearly all of them pass along the 'in' and 'yield' context values: + // + // EqualityExpression[In, Yield] : + // RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] == RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] != RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] === RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] !== RelationalExpression[?In, ?Yield] + // + // Where you have to be careful is then understanding what the points are in the grammar + // where the values are *not* passed along. For example: + // + // SingleNameBinding[Yield,GeneratorParameter] + // [+GeneratorParameter]BindingIdentifier[Yield] Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + // + // Here this is saying that if the GeneratorParameter context flag is set, that we should + // explicitly set the 'yield' context flag to false before calling into the BindingIdentifier + // and we should explicitly unset the 'yield' context flag before calling into the Initializer. + // production. Conversely, if the GeneratorParameter context flag is not set, then we + // should leave the 'yield' context flag alone. + // + // Getting this all correct is tricky and requires careful reading of the grammar to + // understand when these values should be changed versus when they should be inherited. + var contextFlags: ParserContextFlags = 0; // Current state of the parser. If we need to rewind we will store and reset these values as // appropriate. @@ -198,7 +206,7 @@ module TypeScript.Parser { // started at. var diagnostics: Diagnostic[] = []; - var parseNodeData: number = 0; + var _skippedTokens: ISyntaxToken[] = undefined; function parseSyntaxTree(_source: IParserSource, isDeclaration: boolean): SyntaxTree { // First, set up our state. @@ -211,10 +219,11 @@ module TypeScript.Parser { // Now, clear out our state so that our singleton parser doesn't keep things alive. diagnostics = []; - parseNodeData = SyntaxConstants.None; - fileName = null; + contextFlags = 0; + fileName = undefined; source.release(); - source = null; _source = null; + source = undefined; + _source = undefined; return result; } @@ -225,17 +234,16 @@ module TypeScript.Parser { var allDiagnostics = source.tokenDiagnostics().concat(diagnostics); allDiagnostics.sort((a: Diagnostic, b: Diagnostic) => a.start() - b.start()); - return new SyntaxTree(syntaxFactory.isConcrete, sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); + return new SyntaxTree(sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); } function getRewindPoint(): IParserRewindPoint { var rewindPoint = source.getRewindPoint(); + // See the comments in IParserRewindPoint for the explanation on why we need to store + // this data, and what it is used for. rewindPoint.diagnosticsCount = diagnostics.length; - - // Values we keep around for debug asserting purposes. - rewindPoint.isInStrictMode = isInStrictMode; - rewindPoint.listParsingState = listParsingState; + rewindPoint.skippedTokens = _skippedTokens ? _skippedTokens.slice(0) : undefined; return rewindPoint; } @@ -244,6 +252,7 @@ module TypeScript.Parser { source.rewind(rewindPoint); diagnostics.length = rewindPoint.diagnosticsCount; + _skippedTokens = rewindPoint.skippedTokens; } function releaseRewindPoint(rewindPoint: IParserRewindPoint): void { @@ -254,22 +263,30 @@ module TypeScript.Parser { } function currentNode(): ISyntaxNode { - var node = source.currentNode(); + // If we have any outstanding tokens, then don't reuse a node. + // TODO(cyrusn): This may be too conservative. Perhaps we could reuse hte node and + // attach the skipped tokens in front? For now though, being conservative is nice and + // safe, and likely won't ever affect perf. + if (!_skippedTokens) { + var node = source.currentNode(); - // We can only reuse a node if it was parsed under the same strict mode that we're - // currently in. i.e. if we originally parsed a node in non-strict mode, but then - // the user added 'using strict' at the top of the file, then we can't use that node - // again as the presense of strict mode may cause us to parse the tokens in the file - // differetly. - // - // Note: we *can* reuse tokens when the strict mode changes. That's because tokens - // are unaffected by strict mode. It's just the parser will decide what to do with it - // differently depending on what mode it is in. - if (node === null || parsedInStrictMode(node) !== isInStrictMode) { - return null; + // We can only reuse a node if it was parsed under the same strict mode that we're + // currently in. i.e. if we originally parsed a node in non-strict mode, but then + // the user added 'using strict' at the top of the file, then we can't use that node + // again as the presense of strict mode may cause us to parse the tokens in the file + // differetly. + // + // Note: we *can* reuse tokens when the strict mode changes. That's because tokens + // are unaffected by strict mode. It's just the parser will decide what to do with it + // differently depending on what mode it is in. + if (node && + parserContextFlags(node) === contextFlags) { + + return node; + } } - return node; + return undefined; } function currentToken(): ISyntaxToken { @@ -286,20 +303,87 @@ module TypeScript.Parser { return source.peekToken(n); } + function skipToken(token: ISyntaxToken): void { + _skippedTokens = _skippedTokens || []; + _skippedTokens.push(token); + + // directly tell the source to just consume the token we're skipping. i.e. do not + // call 'consumeToken'. Doing so would attempt to add any previous skipped tokens + // to this token we're skipping. We don't want to do that. Instead, we want to add + // all the skipped tokens when we finally eat the next good token. + source.consumeNodeOrToken(token) + } + function consumeToken(token: ISyntaxToken): ISyntaxToken { - source.consumeToken(token); + // Debug.assert(token.fullWidth() > 0 || token.kind === SyntaxKind.EndOfFileToken); + + // First, tell our source that the token has been consumed. + source.consumeNodeOrToken(token); + + // Now, if we had any skipped tokens, we want to add them to the start of this token + // we're consuming. + if (_skippedTokens) { + token = addSkippedTokensBeforeToken(token, _skippedTokens); + _skippedTokens = undefined; + } + return token; } + function addSkippedTokensBeforeToken(token: ISyntaxToken, skippedTokens: ISyntaxToken[]): ISyntaxToken { + //Debug.assert(token.fullWidth() > 0 || token.kind === SyntaxKind.EndOfFileToken); + //Debug.assert(skippedTokens.length > 0); + + var leadingTrivia: ISyntaxTrivia[] = []; + for (var i = 0, n = skippedTokens.length; i < n; i++) { + var skippedToken = skippedTokens[i]; + addSkippedTokenToTriviaArray(leadingTrivia, skippedToken); + } + + addTriviaTo(token.leadingTrivia(source.text), leadingTrivia); + + var updatedToken = Syntax.withLeadingTrivia(token, Syntax.triviaList(leadingTrivia), source.text); + + // We've prepending this token with new leading trivia. This means the full start of + // the token is not where the scanner originally thought it was, but is instead at the + // start of the first skipped token. + updatedToken.setFullStart(skippedTokens[0].fullStart()); + + return updatedToken; + } + + function addSkippedTokenToTriviaArray(array: ISyntaxTrivia[], skippedToken: ISyntaxToken): void { + // Debug.assert(skippedToken.text().length > 0); + + // first, add the leading trivia of the skipped token to the array + addTriviaTo(skippedToken.leadingTrivia(source.text), array); + + // now, add the text of the token as skipped text to the trivia array. + var trimmedToken = Syntax.withLeadingTrivia(skippedToken, Syntax.emptyTriviaList, source.text); + + // Because we removed the leading trivia from the skipped token, the full start of the + // trimmed token is the start of the skipped token. + trimmedToken.setFullStart(start(skippedToken, source.text)); + + array.push(Syntax.skippedTokenTrivia(trimmedToken, source.text)); + } + + function addTriviaTo(list: ISyntaxTriviaList, array: ISyntaxTrivia[]): void { + for (var i = 0, n = list.count(); i < n; i++) { + array.push(list.syntaxTriviaAt(i)); + } + } + function consumeNode(node: ISyntaxNode): void { - source.consumeNode(node); + Debug.assert(_skippedTokens === undefined); + source.consumeNodeOrToken(node); } //this method is called very frequently //we should keep it simple so that it can be inlined. function eatToken(kind: SyntaxKind): ISyntaxToken { var token = currentToken(); - if (token.kind() === kind) { + if (token.kind === kind) { return consumeToken(token); } @@ -310,11 +394,11 @@ module TypeScript.Parser { // Eats the token if it is there. Otherwise does nothing. Will not report errors. function tryEatToken(kind: SyntaxKind): ISyntaxToken { var _currentToken = currentToken(); - if (_currentToken.kind() === kind) { + if (_currentToken.kind === kind) { return consumeToken(_currentToken); } - return null; + return undefined; } // An identifier is basically any word, unless it is a reserved keyword. so 'foo' is an @@ -322,19 +406,25 @@ module TypeScript.Parser { // on the state of the parser. For example, 'yield' is an identifier *unless* the parser // is in strict mode. function isIdentifier(token: ISyntaxToken): boolean { - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.IdentifierName) { return true; } + // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is + // considered a keyword and is not an identifier. + if (tokenKind === SyntaxKind.YieldKeyword && inYieldContext()) { + return false; + } + // Keywords are only identifiers if they're FutureReservedStrictWords and we're in // strict mode. *Or* if it's a typescript 'keyword'. if (tokenKind >= SyntaxKind.FirstFutureReservedStrictKeyword) { if (tokenKind <= SyntaxKind.LastFutureReservedStrictKeyword) { // Could be a keyword or identifier. It's an identifier if we're not in strict // mode. - return !isInStrictMode; + return !inStrictModeContext(); } // If it's typescript keyword, then it's actually a javascript identifier. @@ -351,7 +441,7 @@ module TypeScript.Parser { var token = currentToken(); // If we have an identifier name, then consume and return it. - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.IdentifierName) { return consumeToken(token); } @@ -367,7 +457,7 @@ module TypeScript.Parser { } function eatOptionalIdentifierToken(): ISyntaxToken { - return isIdentifier(currentToken()) ? eatIdentifierToken() : null; + return isIdentifier(currentToken()) ? eatIdentifierToken() : undefined; } // This method should be called when the grammar calls for an *Identifier* and not an @@ -375,39 +465,25 @@ module TypeScript.Parser { function eatIdentifierToken(diagnosticCode?: string): ISyntaxToken { var token = currentToken(); if (isIdentifier(token)) { - consumeToken(token); - - if (token.kind() === SyntaxKind.IdentifierName) { - return token; + if (token.kind === SyntaxKind.IdentifierName) { + return consumeToken(token); } - return TypeScript.Syntax.convertKeywordToIdentifier(token); + return TypeScript.Syntax.convertKeywordToIdentifier(consumeToken(token)); } return createMissingToken(SyntaxKind.IdentifierName, token, diagnosticCode); } - function previousTokenHasTrailingNewLine(token: ISyntaxToken): boolean { - var tokenFullStart = token.fullStart(); - if (tokenFullStart === 0) { - // First token in the document. Thus it has no 'previous' token, and there is - // no preceding newline. - return false; - } - - // If our previous token ended with a newline, then *by definition* we must have started - // at the beginning of a line. - var lineNumber = source.text.lineMap().getLineNumberFromPosition(tokenFullStart); - var lineStart = source.text.lineMap().getLineStartPosition(lineNumber); - - return lineStart == tokenFullStart; + function isOnDifferentLineThanPreviousToken(token: ISyntaxToken): boolean { + return token.hasLeadingNewLine(); } function canEatAutomaticSemicolon(allowWithoutNewLine: boolean): boolean { var token = currentToken(); // An automatic semicolon is always allowed if we're at the end of the file. - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.EndOfFileToken) { return true; } @@ -422,7 +498,7 @@ module TypeScript.Parser { } // It is also allowed if there is a newline between the last token seen and the next one. - if (previousTokenHasTrailingNewLine(token)) { + if (isOnDifferentLineThanPreviousToken(token)) { return true; } @@ -432,7 +508,7 @@ module TypeScript.Parser { function canEatExplicitOrAutomaticSemicolon(allowWithoutNewline: boolean): boolean { var token = currentToken(); - if (token.kind() === SyntaxKind.SemicolonToken) { + if (token.kind === SyntaxKind.SemicolonToken) { return true; } @@ -443,15 +519,15 @@ module TypeScript.Parser { var token = currentToken(); // If we see a semicolon, then we can definitely eat it. - if (token.kind() === SyntaxKind.SemicolonToken) { + if (token.kind === SyntaxKind.SemicolonToken) { return consumeToken(token); } // Check if an automatic semicolon could go here. If so, then there's no problem and - // we can proceed without error. Return 'null' as there's no actual token for this + // we can proceed without error. Return 'undefined' as there's no actual token for this // position. if (canEatAutomaticSemicolon(allowWithoutNewline)) { - return null; + return undefined; } // No semicolon could be consumed here at all. Just call the standard eating function @@ -459,19 +535,37 @@ module TypeScript.Parser { return eatToken(SyntaxKind.SemicolonToken); } - function createMissingToken(expectedKind: SyntaxKind, actual: ISyntaxToken, diagnosticCode?: string): ISyntaxToken { - var diagnostic = getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode); + function createEmptyToken(kind: SyntaxKind): ISyntaxToken { + // The position of the empty token we're creating is not necessarily the position that + // the parser is at now. This is because we may have seen some existing missing tokens + // before finally deciding we needed a missing token. For example, if you have: + // + // Foo(a, # + // + // We will need to create a empty token for the missing ")". However, we will have + // skipped the "#" token, and thus will be right after the "#". Because the "#" token + // will actually become *skipped* trivia on the *next* token we see, the close paren + // should not be considered to be after #, and should instead be after the ",". + // + // So, if we have any skipped tokens, then the position of the empty token should be + // the position of the first skipped token we have. Otherwise it's just at the position + // of the parser. + var fullStart = _skippedTokens ? _skippedTokens[0].fullStart() : source.absolutePosition(); + return Syntax.emptyToken(kind, fullStart); + } + + function createMissingToken(expectedKind: SyntaxKind, actual: ISyntaxToken, diagnosticCode?: string, args?: any[]): ISyntaxToken { + var diagnostic = getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode, args); addDiagnostic(diagnostic); // The missing token will be at the full start of the current token. That way empty tokens // will always be between real tokens and not inside an actual token. - return Syntax.emptyToken(expectedKind); + return createEmptyToken(expectedKind); } - function getExpectedTokenDiagnostic(expectedKind: SyntaxKind, actual: ISyntaxToken, diagnosticCode: string): Diagnostic { + function getExpectedTokenDiagnostic(expectedKind: SyntaxKind, actual?: ISyntaxToken, diagnosticCode?: string, args?: any[]): Diagnostic { var token = currentToken(); - var args: any[] = null; // If a specialized diagnostic message was provided, just use that. if (!diagnosticCode) { // They wanted something specific, just report that that token was missing. @@ -483,9 +577,9 @@ module TypeScript.Parser { // They wanted an identifier. // If the user supplied a keyword, give them a specialized message. - if (actual !== null && SyntaxFacts.isAnyKeyword(actual.kind())) { + if (actual && SyntaxFacts.isAnyKeyword(actual.kind)) { diagnosticCode = DiagnosticCode.Identifier_expected_0_is_a_keyword; - args = [SyntaxFacts.getText(actual.kind())]; + args = [SyntaxFacts.getText(actual.kind)]; } else { // Otherwise just report that an identifier was expected. @@ -532,194 +626,60 @@ module TypeScript.Parser { throw Errors.invalidOperation(); } - function addSkippedTokenAfterNodeOrToken(nodeOrToken: ISyntaxNodeOrToken, skippedToken: ISyntaxToken): ISyntaxNodeOrToken { - if (isToken(nodeOrToken)) { - return addSkippedTokenAfterToken(nodeOrToken, skippedToken); - } - else if (isNode(nodeOrToken)) { - return addSkippedTokenAfterNode(nodeOrToken, skippedToken); + function setContextFlag(val: boolean, flag: ParserContextFlags) { + if (val) { + contextFlags |= flag; } else { - throw Errors.invalidOperation(); + contextFlags &= ~flag; } } - function replaceTokenInParent(node: ISyntaxNode, oldToken: ISyntaxToken, newToken: ISyntaxToken): void { - // oldToken may be parented by a node or a list. - replaceTokenInParentWorker(oldToken, newToken); - - var parent = oldToken.parent; - newToken.parent = parent; - - // Walk upwards to our outermost node, clearing hte cached 'data' in it. This will - // make sure that the fullWidths and incrementally unusable bits are computed correctly - // when next requested. - while (true) { - // Parent must be a list or a node. All of those have a 'data' element. - Debug.assert(isNode(parent) || isList(parent) || isSeparatedList(parent)); - var dataElement = <{ data: number }>parent; - if (dataElement.data) { - dataElement.data &= SyntaxConstants.NodeParsedInStrictModeMask - } - - if (parent === node) { - break; - } - - parent = parent.parent; - } + function setStrictModeContext(val: boolean) { + setContextFlag(val, ParserContextFlags.StrictMode); } - function replaceTokenInParentWorker(oldToken: ISyntaxToken, newToken: ISyntaxToken): void { - var parent = oldToken.parent; - - if (isNode(parent)) { - var node = parent; - for (var key in node) { - if (node[key] === oldToken) { - node[key] = newToken; - return; - } - } - } - else if (isList(parent)) { - var list1 = parent; - for (var i = 0, n = list1.length; i < n; i++) { - if (list1[i] === oldToken) { - list1[i] = newToken; - return; - } - } - } - else if (isSeparatedList(parent)) { - var list2 = parent; - for (var i = 0, n = childCount(list2); i < n; i++) { - if (childAt(list2, i) === oldToken) { - if (i % 2 === 0) { - list2[i / 2] = newToken; - } - else { - list2.separators[(i - 1) / 2] = newToken; - } - return; - } - } - } - - throw Errors.invalidOperation(); + function setDisallowInContext(val: boolean) { + setContextFlag(val, ParserContextFlags.DisallowIn); } - function addSkippedTokenAfterNode(node: ISyntaxNode, skippedToken: ISyntaxToken): ISyntaxNode { - var oldToken = lastToken(node); - var newToken = addSkippedTokenAfterToken(oldToken, skippedToken); - - replaceTokenInParent(node, oldToken, newToken); - return node; + function setYieldContext(val: boolean) { + setContextFlag(val, ParserContextFlags.Yield); } - function addSkippedTokensBeforeNode(node: ISyntaxNode, skippedTokens: ISyntaxToken[]): ISyntaxNode { - if (skippedTokens.length > 0) { - var oldToken = firstToken(node); - var newToken = addSkippedTokensBeforeToken(oldToken, skippedTokens); - - replaceTokenInParent(node, oldToken, newToken); - } - - return node; + function setGeneratorParameterContext(val: boolean) { + setContextFlag(val, ParserContextFlags.GeneratorParameter); } - function addSkippedTokensBeforeToken(token: ISyntaxToken, skippedTokens: ISyntaxToken[]): ISyntaxToken { - // Debug.assert(token.fullWidth() > 0 || token.kind() === SyntaxKind.EndOfFileToken); - // Debug.assert(skippedTokens.length > 0); - - var leadingTrivia: ISyntaxTrivia[] = []; - for (var i = 0, n = skippedTokens.length; i < n; i++) { - var skippedToken = skippedTokens[i]; - addSkippedTokenToTriviaArray(leadingTrivia, skippedToken); - } - - addTriviaTo(token.leadingTrivia(source.text), leadingTrivia); - - var updatedToken = Syntax.withLeadingTrivia(token, Syntax.triviaList(leadingTrivia), source.text); - - // We've prepending this token with new leading trivia. This means the full start of - // the token is not where the scanner originally thought it was, but is instead at the - // start of the first skipped token. - updatedToken.setFullStart(skippedTokens[0].fullStart()); - - // Don't need this array anymore. Give it back so we can reuse it. - returnArray(skippedTokens); - - return updatedToken; + function inStrictModeContext() { + return (contextFlags & ParserContextFlags.StrictMode) !== 0; } - function addSkippedTokensAfterToken(token: ISyntaxToken, skippedTokens: ISyntaxToken[]): ISyntaxToken { - // Debug.assert(token.fullWidth() > 0); - if (skippedTokens.length === 0) { - returnArray(skippedTokens); - return token; - } - - var trailingTrivia = token.trailingTrivia(source.text).toArray(); - - for (var i = 0, n = skippedTokens.length; i < n; i++) { - addSkippedTokenToTriviaArray(trailingTrivia, skippedTokens[i]); - } - - // Don't need this array anymore. Give it back so we can reuse it. - returnArray(skippedTokens); - return Syntax.withTrailingTrivia(token, Syntax.triviaList(trailingTrivia), source.text); + function inDisallowInContext() { + return (contextFlags & ParserContextFlags.DisallowIn) !== 0; } - function addSkippedTokenAfterToken(token: ISyntaxToken, skippedToken: ISyntaxToken): ISyntaxToken { - // Debug.assert(token.fullWidth() > 0); - var trailingTrivia = token.trailingTrivia(source.text).toArray(); - addSkippedTokenToTriviaArray(trailingTrivia, skippedToken); - - return Syntax.withTrailingTrivia(token, Syntax.triviaList(trailingTrivia), source.text); + function inYieldContext() { + return (contextFlags & ParserContextFlags.Yield) !== 0; } - function addSkippedTokenToTriviaArray(array: ISyntaxTrivia[], skippedToken: ISyntaxToken): void { - // Debug.assert(skippedToken.text().length > 0); - - // first, add the leading trivia of the skipped token to the array - addTriviaTo(skippedToken.leadingTrivia(source.text), array); - - // now, add the text of the token as skipped text to the trivia array. - var trimmedToken = Syntax.withTrailingTrivia(Syntax.withLeadingTrivia(skippedToken, Syntax.emptyTriviaList, source.text), Syntax.emptyTriviaList, source.text); - - // Because we removed the leading trivia from the skipped token, the full start of the - // trimmed token is the start of the skipped token. - trimmedToken.setFullStart(start(skippedToken, source.text)); - - array.push(Syntax.skippedTokenTrivia(trimmedToken, source.text)); - - // Finally, add the trailing trivia of the skipped token to the trivia array. - addTriviaTo(skippedToken.trailingTrivia(source.text), array); - } - - function addTriviaTo(list: ISyntaxTriviaList, array: ISyntaxTrivia[]): void { - for (var i = 0, n = list.count(); i < n; i++) { - array.push(list.syntaxTriviaAt(i)); - } - } - - function setStrictMode(_isInStrictMode: boolean) { - isInStrictMode = _isInStrictMode; - parseNodeData = _isInStrictMode ? SyntaxConstants.NodeParsedInStrictModeMask : 0; + function inGeneratorParameterContext() { + return (contextFlags & ParserContextFlags.GeneratorParameter) !== 0; } function parseSourceUnit(): SourceUnitSyntax { - var savedIsInStrictMode = isInStrictMode + // Note: saving and restoring the 'isInStrictMode' state is not really necessary here + // (as it will never be read afterwards). However, for symmetry with the rest of the + // parsing code, we do the same here. + var savedIsInStrictMode = inStrictModeContext() - var skippedTokens: ISyntaxToken[] = getArray(); - var moduleElements = parseSyntaxList(ListParsingState.SourceUnit_ModuleElements, skippedTokens, updateStrictModeState); - - setStrictMode(savedIsInStrictMode); - - var sourceUnit = new syntaxFactory.SourceUnitSyntax(parseNodeData, moduleElements, currentToken()); - - sourceUnit = addSkippedTokensBeforeNode(sourceUnit, skippedTokens); + // Note: any skipped tokens produced after the end of all the module elements will be + // added as skipped trivia to the start of the EOF token. + var moduleElements = parseSyntaxList(ListParsingState.SourceUnit_ModuleElements, updateStrictModeState); + + setStrictModeContext(savedIsInStrictMode); + + var sourceUnit = new SourceUnitSyntax(contextFlags, moduleElements, consumeToken(currentToken())); if (Debug.shouldAssert(AssertionLevel.Aggressive)) { Debug.assert(fullWidth(sourceUnit) === source.text.length()); @@ -732,17 +692,21 @@ module TypeScript.Parser { return sourceUnit; } + function isDirectivePrologueElement(node: ISyntaxNodeOrToken): boolean { + return node.kind === SyntaxKind.ExpressionStatement && + (node).expression.kind === SyntaxKind.StringLiteral; + } + function updateStrictModeState(items: any[]): void { - if (!isInStrictMode) { + if (!inStrictModeContext()) { // Check if all the items are directive prologue elements. - for (var i = 0; i < items.length; i++) { - var item = items[i]; - if (!SyntaxFacts.isDirectivePrologueElement(item)) { + for (var i = 0, n = items.length; i < n; i++) { + if (!isDirectivePrologueElement(items[i])) { return; } } - setStrictMode(SyntaxFacts.isUseStrictDirective(items[items.length - 1])); + setStrictModeContext(SyntaxFacts.isUseStrictDirective(items[items.length - 1])); } } @@ -769,7 +733,7 @@ module TypeScript.Parser { if (_modifierCount) { // if we have modifiers, then these are definitely TS constructs and we can // immediately start parsing them. - switch (peekToken(_modifierCount).kind()) { + switch (peekToken(_modifierCount).kind) { case SyntaxKind.ImportKeyword: return parseImportDeclaration(); case SyntaxKind.ModuleKeyword: return parseModuleDeclaration(); case SyntaxKind.InterfaceKeyword: return parseInterfaceDeclaration(); @@ -785,10 +749,10 @@ module TypeScript.Parser { // consuming these, we only parse them out if we can see enough context to 'prove' that // they really do start the module element var nextToken = peekToken(1); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.ModuleKeyword: - if (isIdentifier(nextToken) || nextToken.kind() === SyntaxKind.StringLiteral) { + if (isIdentifier(nextToken) || nextToken.kind === SyntaxKind.StringLiteral) { return parseModuleDeclaration(); } break; @@ -820,7 +784,7 @@ module TypeScript.Parser { case SyntaxKind.ExportKeyword: // 'export' could be a modifier on a statement (like export var ...). So we // only want to parse out an export assignment here if we actually see the equals. - if (nextToken.kind() === SyntaxKind.EqualsToken) { + if (nextToken.kind === SyntaxKind.EqualsToken) { return parseExportAssignment(); } break; @@ -830,12 +794,12 @@ module TypeScript.Parser { } function parseImportDeclaration(): ImportDeclarationSyntax { - return new syntaxFactory.ImportDeclarationSyntax(parseNodeData, + return new ImportDeclarationSyntax(contextFlags, parseModifiers(), eatToken(SyntaxKind.ImportKeyword), eatIdentifierToken(), eatToken(SyntaxKind.EqualsToken), parseModuleReference(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseExportAssignment(): ExportAssignmentSyntax { - return new syntaxFactory.ExportAssignmentSyntax(parseNodeData, + return new ExportAssignmentSyntax(contextFlags, eatToken(SyntaxKind.ExportKeyword), eatToken(SyntaxKind.EqualsToken), eatIdentifierToken(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } @@ -844,35 +808,32 @@ module TypeScript.Parser { } function isExternalModuleReference(): boolean { - return currentToken().kind() === SyntaxKind.RequireKeyword && - peekToken(1).kind() === SyntaxKind.OpenParenToken; + return currentToken().kind === SyntaxKind.RequireKeyword && + peekToken(1).kind === SyntaxKind.OpenParenToken; } function parseExternalModuleReference(): ExternalModuleReferenceSyntax { - return new syntaxFactory.ExternalModuleReferenceSyntax(parseNodeData, + return new ExternalModuleReferenceSyntax(contextFlags, eatToken(SyntaxKind.RequireKeyword), eatToken(SyntaxKind.OpenParenToken), eatToken(SyntaxKind.StringLiteral), eatToken(SyntaxKind.CloseParenToken)); } function parseModuleNameModuleReference(): ModuleNameModuleReferenceSyntax { - return new syntaxFactory.ModuleNameModuleReferenceSyntax(parseNodeData, parseName(/*allowIdentifierNames:*/ false)); + return new ModuleNameModuleReferenceSyntax(contextFlags, parseName(/*allowIdentifierNames:*/ false)); } function tryParseTypeArgumentList(inExpression: boolean): TypeArgumentListSyntax { var _currentToken = currentToken(); - if (_currentToken.kind() !== SyntaxKind.LessThanToken) { - return null; + if (_currentToken.kind !== SyntaxKind.LessThanToken) { + return undefined; } if (!inExpression) { // if we're not in an expression, this must be a type argument list. Just parse // it out as such. - var lessThanToken = consumeToken(_currentToken); - - var skippedTokens: ISyntaxToken[] = getArray(); - var typeArguments = parseSeparatedSyntaxList(ListParsingState.TypeArgumentList_Types, skippedTokens); - lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - - return new syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, eatToken(SyntaxKind.GreaterThanToken)); + return new TypeArgumentListSyntax(contextFlags, + consumeToken(_currentToken), + parseSeparatedSyntaxList(ListParsingState.TypeArgumentList_Types), + eatToken(SyntaxKind.GreaterThanToken)); } // If we're in an expression, then we only want to consume this as a type argument list @@ -882,24 +843,20 @@ module TypeScript.Parser { // We've seen a '<'. Try to parse it out as a type argument list. var lessThanToken = consumeToken(_currentToken); - - var skippedTokens: ISyntaxToken[] = getArray(); - var typeArguments = parseSeparatedSyntaxList(ListParsingState.TypeArgumentList_Types, skippedTokens); - var lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - + var typeArguments = parseSeparatedSyntaxList(ListParsingState.TypeArgumentList_Types); var greaterThanToken = eatToken(SyntaxKind.GreaterThanToken); // We're in a context where '<' could be the start of a type argument list, or part // of an arithmetic expression. We'll presume it's the latter unless we see the '>' // and a following token that guarantees that it's supposed to be a type argument list. - if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind())) { + if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind)) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { releaseRewindPoint(rewindPoint); - return new syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); + return new TypeArgumentListSyntax(contextFlags, lessThanToken, typeArguments, greaterThanToken); } } @@ -964,8 +921,8 @@ module TypeScript.Parser { // the code would be implicitly: "name.keyword; identifierNameOrKeyword". // In the first case though, ASI will not take effect because there is not a // line terminator after the keyword. - if (SyntaxFacts.isAnyKeyword(_currentToken.kind()) && - previousTokenHasTrailingNewLine(_currentToken)) { + if (SyntaxFacts.isAnyKeyword(_currentToken.kind) && + isOnDifferentLineThanPreviousToken(_currentToken)) { var token1 = peekToken(1); if (!existsNewLineBetweenTokens(_currentToken, token1, source.text) && @@ -982,17 +939,17 @@ module TypeScript.Parser { var token0 = currentToken(); var shouldContinue = isIdentifier(token0); if (!shouldContinue) { - return null; + return undefined; } // Call eatIdentifierName to convert the token to an identifier if it is as keyword. var current: INameSyntax = eatIdentifierToken(); - while (shouldContinue && currentToken().kind() === SyntaxKind.DotToken) { + while (shouldContinue && currentToken().kind === SyntaxKind.DotToken) { var dotToken = consumeToken(currentToken()); var identifierName = eatRightSideOfName(allowIdentifierNames); - current = new syntaxFactory.QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); + current = new QualifiedNameSyntax(contextFlags, current, dotToken, identifierName); shouldContinue = identifierName.fullWidth() > 0; } @@ -1000,47 +957,90 @@ module TypeScript.Parser { } function parseEnumDeclaration(): EnumDeclarationSyntax { - var modifiers = parseModifiers(); - var enumKeyword = eatToken(SyntaxKind.EnumKeyword); - var identifier = eatIdentifierToken(); + var openBraceToken: ISyntaxToken; - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - var enumElements = Syntax.emptySeparatedList(); - - if (openBraceToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - enumElements = parseSeparatedSyntaxList(ListParsingState.EnumDeclaration_EnumElements, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - - return new syntaxFactory.EnumDeclarationSyntax(parseNodeData, modifiers, enumKeyword, identifier, openBraceToken, enumElements, eatToken(SyntaxKind.CloseBraceToken)); + return new EnumDeclarationSyntax(contextFlags, + parseModifiers(), + eatToken(SyntaxKind.EnumKeyword), + eatIdentifierToken(), + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSeparatedSyntaxList(ListParsingState.EnumDeclaration_EnumElements) : [], + eatToken(SyntaxKind.CloseBraceToken)); } function isEnumElement(inErrorRecovery: boolean): boolean { var node = currentNode(); - if (node !== null && node.kind() === SyntaxKind.EnumElement) { + if (node && node.kind === SyntaxKind.EnumElement) { return true; } - return isPropertyName(currentToken(), inErrorRecovery); + return isPropertyName(/*peekToken:*/ 0, inErrorRecovery); } + function allowInAnd(func: () => T): T { + if (inDisallowInContext()) { + setDisallowInContext(false); + var result = func(); + setDisallowInContext(true); + return result; + } + + // no need to do anything special if 'in' is already allowed. + return func(); + } + + function disallowInAnd(func: () => T): T { + if (inDisallowInContext()) { + // no need to do anything special if 'in' is already disallowed. + return func(); + } + + setDisallowInContext(true); + var result = func(); + setDisallowInContext(false); + return result; + } + + function enterYieldContextAnd(func: () => T): T { + if (inYieldContext()) { + // no need to do anything special if we're already in the [Yield] context. + return func(); + } + + setYieldContext(true); + var result = func(); + setYieldContext(false); + return result; + } + + function exitYieldContextAnd(func: () => T): T { + if (inYieldContext()) { + setYieldContext(false); + var result = func(); + setYieldContext(true); + return result; + } + + // no need to do anything special if we're not in the [Yield] context. + return func(); + } + function tryParseEnumElementEqualsValueClause(): EqualsValueClauseSyntax { - return isEqualsValueClause(/*inParameter*/ false) ? parseEqualsValueClause(/*allowIn:*/ true) : null; + return isEqualsValueClause(/*inParameter*/ false) ? allowInAnd(parseEqualsValueClause) : undefined; } function tryParseEnumElement(inErrorRecovery: boolean): EnumElementSyntax { var node = currentNode(); - if (node !== null && node.kind() === SyntaxKind.EnumElement) { + if (node && node.kind === SyntaxKind.EnumElement) { consumeNode(node); return node; } - if (!isPropertyName(currentToken(), inErrorRecovery)) { - return null; + if (!isPropertyName(/*peekToken:*/ 0, inErrorRecovery)) { + return undefined; } - return new syntaxFactory.EnumElementSyntax(parseNodeData, eatPropertyName(), tryParseEnumElementEqualsValueClause()); + return new EnumElementSyntax(contextFlags, parsePropertyName(), tryParseEnumElementEqualsValueClause()); } function isModifierKind(kind: SyntaxKind): boolean { @@ -1048,6 +1048,7 @@ module TypeScript.Parser { case SyntaxKind.ExportKeyword: case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: case SyntaxKind.StaticKeyword: case SyntaxKind.DeclareKeyword: return true; @@ -1057,19 +1058,22 @@ module TypeScript.Parser { } function isModifier(token: ISyntaxToken, index: number): boolean { - if (isModifierKind(token.kind())) { + if (isModifierKind(token.kind)) { // These are modifiers only if we see an actual keyword, identifier, string literal // or number following. - // Note: we also allow [ for error conditions. - // [ is for: static [a: number] + // + // [ is for: static [a: number] ... + // [ is for: static [computedProp()] ... var nextToken = peekToken(index + 1); - var nextTokenKind = nextToken.kind(); + var nextTokenKind = nextToken.kind; switch (nextTokenKind) { case SyntaxKind.IdentifierName: case SyntaxKind.OpenBracketToken: case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateToken: + case SyntaxKind.AsteriskToken: return true; default: return SyntaxFacts.isAnyKeyword(nextTokenKind); @@ -1089,7 +1093,7 @@ module TypeScript.Parser { } function parseModifiers(): ISyntaxToken[] { - var tokens: ISyntaxToken[] = getArray(); + var tokens: ISyntaxToken[] = []; while (true) { var token = currentToken(); @@ -1101,89 +1105,100 @@ module TypeScript.Parser { break; } - var result = Syntax.list(tokens); - - // If the tokens array is greater than one, then we can't return it. It will have been - // copied directly into the syntax list. - returnZeroLengthArray(tokens); - - return result; + return Syntax.list(tokens); } - function parseHeritageClauses(): HeritageClauseSyntax[] { - var heritageClauses = Syntax.emptyList(); + function parseHeritageClauses(isClassHeritageClause: boolean): HeritageClauseSyntax[] { + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } if (isHeritageClause()) { - // NOTE: we can pass "null" for the skipped tokens here as we know we can't get - // any leading skipped tokens. We have an 'extends' or 'implements' keyword, so - // any skipped tokeds will get attached to that instead. - heritageClauses= parseSyntaxList(ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses, null); + return isClassHeritageClause && inGeneratorParameterContext() + ? exitYieldContextAnd(parseHeritageClausesWorker) + : parseHeritageClausesWorker(); } - return heritageClauses; + return []; + } + + function parseHeritageClausesWorker() { + return parseSyntaxList(ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses) } function tryParseHeritageClauseTypeName(): ITypeSyntax { - return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : null; + return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : undefined; } function parseClassDeclaration(): ClassDeclarationSyntax { - var modifiers = parseModifiers(); - var classKeyword = eatToken(SyntaxKind.ClassKeyword); - var identifier = eatIdentifierToken(); - var typeParameterList = tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false); - var heritageClauses = parseHeritageClauses(); - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - var classElements = Syntax.emptyList(); + var openBraceToken: ISyntaxToken; + return new ClassDeclarationSyntax(contextFlags, + parseModifiers(), + eatToken(SyntaxKind.ClassKeyword), + eatIdentifierToken(), + tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), + parseHeritageClauses(/*isClassHeritageClauses:*/ true), + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSyntaxList(ListParsingState.ClassDeclaration_ClassElements) : [], + eatToken(SyntaxKind.CloseBraceToken)); + } + + function parseClassElement(openBraceToken: ISyntaxToken): IClassElementSyntax[] { + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } if (openBraceToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - classElements = parseSyntaxList(ListParsingState.ClassDeclaration_ClassElements, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - }; + return inGeneratorParameterContext() + ? exitYieldContextAnd(parseClassElements) + : parseClassElements(); + } - return new syntaxFactory.ClassDeclarationSyntax(parseNodeData, - modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, eatToken(SyntaxKind.CloseBraceToken)); + return []; + } + + function parseClassElements() { + return parseSyntaxList(ListParsingState.ClassDeclaration_ClassElements) } function isAccessor(modifierCount: number, inErrorRecovery: boolean): boolean { - var tokenKind = peekToken(modifierCount).kind(); + var tokenKind = peekToken(modifierCount).kind; if (tokenKind !== SyntaxKind.GetKeyword && tokenKind !== SyntaxKind.SetKeyword) { return false; } - return isPropertyName(peekToken(modifierCount + 1), inErrorRecovery); + return isPropertyName(/*peekIndex:*/ modifierCount + 1, inErrorRecovery); } - function parseAccessor(checkForStrictMode: boolean): ISyntaxNode { + function parseAccessor(): IAccessorSyntax { var modifiers = parseModifiers(); - var _currenToken = currentToken(); - var tokenKind = _currenToken.kind(); + var _currentToken = currentToken(); + var tokenKind = _currentToken.kind; if (tokenKind === SyntaxKind.GetKeyword) { - return parseGetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); + return parseGetAccessor(modifiers, _currentToken); } else if (tokenKind === SyntaxKind.SetKeyword) { - return parseSetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); + return parseSetAccessor(modifiers, _currentToken); } else { throw Errors.invalidOperation(); } } - function parseGetMemberAccessorDeclaration(modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, checkForStrictMode: boolean): GetAccessorSyntax { - return new syntaxFactory.GetAccessorSyntax(parseNodeData, - modifiers, consumeToken(getKeyword), eatPropertyName(), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false), - parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, checkForStrictMode)); + function parseGetAccessor(modifiers: ISyntaxToken[], getKeyword: ISyntaxToken): GetAccessorSyntax { + return new GetAccessorSyntax(contextFlags, + modifiers, consumeToken(getKeyword), parsePropertyName(), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false), + parseFunctionBody(/*isGenerator:*/ false)); } - function parseSetMemberAccessorDeclaration(modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, checkForStrictMode: boolean): SetAccessorSyntax { - return new syntaxFactory.SetAccessorSyntax(parseNodeData, - modifiers, consumeToken(setKeyword), eatPropertyName(), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false), - parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, checkForStrictMode)); + function parseSetAccessor(modifiers: ISyntaxToken[], setKeyword: ISyntaxToken): SetAccessorSyntax { + return new SetAccessorSyntax(contextFlags, + modifiers, consumeToken(setKeyword), parsePropertyName(), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false), + parseFunctionBody(/*isGenerator:*/ false)); } function isClassElement(inErrorRecovery: boolean): boolean { @@ -1195,10 +1210,65 @@ module TypeScript.Parser { // checks for a subset of the conditions of the previous two calls. var _modifierCount = modifierCount(); return isConstructorDeclaration(_modifierCount) || - isMemberFunctionDeclaration(_modifierCount, inErrorRecovery) || isAccessor(_modifierCount, inErrorRecovery) || - isMemberVariableDeclaration(_modifierCount, inErrorRecovery) || - isIndexMemberDeclaration(_modifierCount); + isIndexMemberDeclaration(_modifierCount) || + isMemberVariableOrFunctionDeclaration(_modifierCount, inErrorRecovery); + } + + function isMemberVariableOrFunctionDeclaration(peekIndex: number, inErrorRecovery: boolean) { + var tokenN = peekToken(peekIndex); + var tokenNKind = tokenN.kind; + + // If we have a '*', then this is a generator function. + if (tokenNKind === SyntaxKind.AsteriskToken) { + if (inErrorRecovery) { + // If we're in error recovery, we might see a random * that is part of some + // expression. Really, in order to view this as a generator function, we want + // to see at least '*id<' or '*id('. Otherwise, we won't think of this as the + // start of a member variable/function. + return peekToken(peekIndex + 1).kind === SyntaxKind.IdentifierName && + (peekToken(peekIndex + 2).kind === SyntaxKind.LessThanToken || peekToken(peekIndex + 2).kind === SyntaxKind.OpenParenToken); + } + + return true; + } + + // Check if its the start of a property or method. Both must start with a property name. + if (!isPropertyName(peekIndex, inErrorRecovery)) { + return false; + } + + if (!SyntaxFacts.isAnyKeyword(tokenNKind)) { + // It wasn't a keyword. So this is definitely a member variable or function. + return true; + } + + // Keywords *can* technically start properties and methods. However, they often + // are actually intended to start a real ts/js construct. Only accept a keyword + // if it is definitely a property or method. + // keywords are also property names. Only accept a keyword as a property + // name if is of the form: + // public; + // public= + // public: + // public } + // public( + // public< + // public + // public + var nextToken = peekToken(peekIndex + 1); + switch (nextToken.kind) { + case SyntaxKind.SemicolonToken: + case SyntaxKind.EqualsToken: + case SyntaxKind.ColonToken: + case SyntaxKind.CloseBraceToken: + case SyntaxKind.OpenParenToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.EndOfFileToken: + return true; + default: + return isOnDifferentLineThanPreviousToken(nextToken); + } } function tryParseClassElement(inErrorRecovery: boolean): IClassElementSyntax { @@ -1208,24 +1278,36 @@ module TypeScript.Parser { return node; } + // Have to check for indexers before anything else. That way if we see "[foo:" we + // parse it out as an indexer and not a member function or variable. var _modifierCount = modifierCount(); if (isConstructorDeclaration(_modifierCount)) { return parseConstructorDeclaration(); } - else if (isMemberFunctionDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberFunctionDeclaration(); - } - else if (isAccessor(_modifierCount, inErrorRecovery)) { - return parseAccessor(/*checkForStrictMode:*/ false); - } - else if (isMemberVariableDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberVariableDeclaration(); - } else if (isIndexMemberDeclaration(_modifierCount)) { return parseIndexMemberDeclaration(); } + else if (isAccessor(_modifierCount, inErrorRecovery)) { + return parseAccessor(); + } + else if (isMemberVariableOrFunctionDeclaration(/*peekIndex:*/ _modifierCount, inErrorRecovery)) { + var modifiers = parseModifiers(); + var asterixToken = tryEatToken(SyntaxKind.AsteriskToken); + var propertyName = parsePropertyName(); + + // If we got a '*', then this is definitely a method. If we didn't get a '*', then + // we must have gotten a property name. And if that's all we have, we have to check + // if we have a call signature. If so, then this is a member function, otherwise + // it's a member variable. + if (asterixToken || isCallSignature(/*peekIndex:*/ 0)) { + return parseMemberFunctionDeclaration(modifiers, asterixToken, propertyName); + } + else { + return parseMemberVariableDeclaration(modifiers, propertyName); + } + } else { - return null; + return undefined; } } @@ -1234,89 +1316,40 @@ module TypeScript.Parser { // assume this is a constructor. That means, if a user writes "public constructor;" // it won't be viewed as a member. As a workaround, they can simply write: // public 'constructor'; - return peekToken(modifierCount).kind() === SyntaxKind.ConstructorKeyword; + return peekToken(modifierCount).kind === SyntaxKind.ConstructorKeyword; } function parseConstructorDeclaration(): ConstructorDeclarationSyntax { - var modifiers = parseModifiers(); - var constructorKeyword = eatToken(SyntaxKind.ConstructorKeyword); - var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ false); - - var semicolonToken: ISyntaxToken = null; - var block: BlockSyntax = null; - - if (isBlock()) { - block = parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ true); - } - else { - semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); - } - - return new syntaxFactory.ConstructorDeclarationSyntax(parseNodeData, modifiers, constructorKeyword, callSignature, block, semicolonToken); + // Note: if we see an arrow after the close paren, then try to parse out a function + // block anyways. It's likely the user just though '=> expr' was legal anywhere a + // block was legal. + return new ConstructorDeclarationSyntax(contextFlags, + parseModifiers(), + eatToken(SyntaxKind.ConstructorKeyword), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false), + parseFunctionBody(/*isGenerator:*/ false)); } - function isMemberFunctionDeclaration(modifierCount: number, inErrorRecovery: boolean): boolean { - return isPropertyName(peekToken(modifierCount), inErrorRecovery) && isCallSignature(modifierCount + 1); - } - - function parseMemberFunctionDeclaration(): MemberFunctionDeclarationSyntax { - var modifiers = parseModifiers(); - var propertyName = eatPropertyName(); - var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ false); - - // If we got an errant => then we want to parse what's coming up without requiring an - // open brace. - var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - - var block: BlockSyntax = null; - var semicolon: ISyntaxToken = null; - - if (parseBlockEvenWithNoOpenBrace || isBlock()) { - block = parseBlock(parseBlockEvenWithNoOpenBrace, /*checkForStrictMode:*/ true); - } - else { - semicolon = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); - } - - return new syntaxFactory.MemberFunctionDeclarationSyntax(parseNodeData, modifiers, propertyName, callSignature, block, semicolon); + function parseMemberFunctionDeclaration(modifiers: ISyntaxToken[], asteriskToken: ISyntaxToken, propertyName: IPropertyNameSyntax): MemberFunctionDeclarationSyntax { + // Note: if we see an arrow after the close paren, then try to parse out a function + // block anyways. It's likely the user just though '=> expr' was legal anywhere a + // block was legal. + var isGenerator = asteriskToken !== undefined; + return new MemberFunctionDeclarationSyntax(contextFlags, + modifiers, + asteriskToken, + propertyName, + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ isGenerator), + parseFunctionBody(isGenerator)); } - function isDefinitelyMemberVariablePropertyName(index: number): boolean { - // keywords are also property names. Only accept a keyword as a property - // name if is of the form: - // public; - // public= - // public: - // public } - // public - // public - if (SyntaxFacts.isAnyKeyword(peekToken(index).kind())) { - var nextToken = peekToken(index + 1); - switch (nextToken.kind()) { - case SyntaxKind.SemicolonToken: - case SyntaxKind.EqualsToken: - case SyntaxKind.ColonToken: - case SyntaxKind.CloseBraceToken: - case SyntaxKind.EndOfFileToken: - return true; - default: - return previousTokenHasTrailingNewLine(nextToken); - } - } - else { - // If was a property name and not a keyword, then we're good to go. - return true; - } - } - - function isMemberVariableDeclaration(modifierCount: number, inErrorRecover: boolean): boolean { - return isPropertyName(peekToken(modifierCount), inErrorRecover) && isDefinitelyMemberVariablePropertyName(modifierCount); - } - - function parseMemberVariableDeclaration(): MemberVariableDeclarationSyntax { - return new syntaxFactory.MemberVariableDeclarationSyntax(parseNodeData, - parseModifiers(), - tryParseVariableDeclarator(/*allowIn:*/ true, /*allowPropertyName:*/ true), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + function parseMemberVariableDeclaration(modifiers: ISyntaxToken[], propertyName: IPropertyNameSyntax): MemberVariableDeclarationSyntax { + return new MemberVariableDeclarationSyntax(contextFlags, + modifiers, + new VariableDeclaratorSyntax(contextFlags, propertyName, + parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false), + isEqualsValueClause(/*inParameter*/ false) ? allowInAnd(parseEqualsValueClause) : undefined), + eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function isIndexMemberDeclaration(modifierCount: number): boolean { @@ -1324,114 +1357,81 @@ module TypeScript.Parser { } function parseIndexMemberDeclaration(): IndexMemberDeclarationSyntax { - return new syntaxFactory.IndexMemberDeclarationSyntax(parseNodeData, + return new IndexMemberDeclarationSyntax(contextFlags, parseModifiers(), parseIndexSignature(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewLine:*/ false)); } - function tryAddUnexpectedEqualsGreaterThanToken(callSignature: CallSignatureSyntax): boolean { - var token0 = currentToken(); - - var hasEqualsGreaterThanToken = token0.kind() === SyntaxKind.EqualsGreaterThanToken; - if (hasEqualsGreaterThanToken) { - // We can only do this if the call signature actually contains a final token that we - // could add the => to. - var _lastToken = lastToken(callSignature); - if (_lastToken && _lastToken.fullWidth() > 0) { - // Previously the language allowed "function f() => expr;" as a shorthand for - // "function f() { return expr; }. - // - // Detect if the user is typing this and attempt recovery. - var diagnostic = new Diagnostic(fileName, source.text.lineMap(), - start(token0, source.text), width(token0), DiagnosticCode.Unexpected_token_0_expected, [SyntaxFacts.getText(SyntaxKind.OpenBraceToken)]); - addDiagnostic(diagnostic); - - consumeToken(token0); - - // Note: we only do this if we're creating a concrete syntax tree (which contains - // everything, including skipped tokens, in it). - if (syntaxFactory.isConcrete) { - addSkippedTokenAfterNode(callSignature, token0); - } - return true; - } - } - - - return false; - } - function isFunctionDeclaration(modifierCount: number): boolean { - return peekToken(modifierCount).kind() === SyntaxKind.FunctionKeyword; + return peekToken(modifierCount).kind === SyntaxKind.FunctionKeyword; } function parseFunctionDeclaration(): FunctionDeclarationSyntax { - var modifiers = parseModifiers(); - var functionKeyword = eatToken(SyntaxKind.FunctionKeyword); - var identifier = eatIdentifierToken(); - var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ false); + return parseFunctionDeclarationWorker( + parseModifiers(), eatToken(SyntaxKind.FunctionKeyword), tryEatToken(SyntaxKind.AsteriskToken)); + } - // If we got an errant => then we want to parse what's coming up without requiring an - // open brace. - var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); + function parseFunctionDeclarationWorker(modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asteriskToken: ISyntaxToken): FunctionDeclarationSyntax { + // FunctionDeclaration[Yield, Default] : // function BindingIdentifier[?Yield] ( FormalParameters ) { FunctionBody } + // GeneratorDeclaration[Yield, Default] : + // function * BindingIdentifier[?Yield](FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } - var semicolonToken: ISyntaxToken = null; - var block: BlockSyntax = null; + var isGenerator = asteriskToken !== undefined; + return new FunctionDeclarationSyntax(contextFlags, + modifiers, + functionKeyword, + asteriskToken, + eatIdentifierToken(), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ isGenerator), + parseFunctionBody(isGenerator)); + } - // Parse a block if we're on a bock, or if we saw a '=>' - if (parseBlockEvenWithNoOpenBrace || isBlock()) { - block = parseBlock(parseBlockEvenWithNoOpenBrace, /*checkForStrictMode:*/ true); - } - else { - semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); - } + function parseFunctionBody(isGenerator: boolean): BlockSyntax | ExpressionBody | ISyntaxToken { + return isBlockOrArrow() + ? parseFunctionBlockOrExpressionBody(/*yieldContext:*/ isGenerator) + : eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); + } - return new syntaxFactory.FunctionDeclarationSyntax(parseNodeData, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); + function parseModuleName(): INameSyntax { + return currentToken().kind === SyntaxKind.StringLiteral + ? eatToken(SyntaxKind.StringLiteral) + : parseName(/*allowIdentifierNames*/ false); } function parseModuleDeclaration(): ModuleDeclarationSyntax { - var modifiers = parseModifiers(); - var moduleKeyword = eatToken(SyntaxKind.ModuleKeyword); - - var moduleName: INameSyntax = null; - var stringLiteral: ISyntaxToken = null; - - if (currentToken().kind() === SyntaxKind.StringLiteral) { - stringLiteral = eatToken(SyntaxKind.StringLiteral); - } - else { - moduleName = parseName(/*allowIdentifierNames*/ false); - } - - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - - var moduleElements = Syntax.emptyList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - moduleElements = parseSyntaxList(ListParsingState.ModuleDeclaration_ModuleElements, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - - return new syntaxFactory.ModuleDeclarationSyntax(parseNodeData, - modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements, eatToken(SyntaxKind.CloseBraceToken)); + var openBraceToken: ISyntaxToken; + return new ModuleDeclarationSyntax(contextFlags, + parseModifiers(), + eatToken(SyntaxKind.ModuleKeyword), + parseModuleName(), + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSyntaxList(ListParsingState.ModuleDeclaration_ModuleElements) : [], + eatToken(SyntaxKind.CloseBraceToken)); } function parseInterfaceDeclaration(): InterfaceDeclarationSyntax { - return new syntaxFactory.InterfaceDeclarationSyntax(parseNodeData, - parseModifiers(), eatToken(SyntaxKind.InterfaceKeyword), eatIdentifierToken(), - tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), parseHeritageClauses(), parseObjectType()); + return new InterfaceDeclarationSyntax(contextFlags, + parseModifiers(), + eatToken(SyntaxKind.InterfaceKeyword), + eatIdentifierToken(), + tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), + parseHeritageClauses(/*isClassHeritageClauses:*/ false), + parseObjectType()); } function parseObjectType(): ObjectTypeSyntax { - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); + var openBraceToken: ISyntaxToken; + + return new ObjectTypeSyntax(contextFlags, + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSeparatedSyntaxList(ListParsingState.ObjectType_TypeMembers) : [], + eatToken(SyntaxKind.CloseBraceToken)); + } - var typeMembers = Syntax.emptySeparatedList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - typeMembers = parseSeparatedSyntaxList(ListParsingState.ObjectType_TypeMembers, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - - return new syntaxFactory.ObjectTypeSyntax(parseNodeData, openBraceToken, typeMembers, eatToken(SyntaxKind.CloseBraceToken)); + function parseTupleType(currentToken: ISyntaxToken): TupleTypeSyntax { + return new TupleTypeSyntax(contextFlags, + consumeToken(currentToken), + parseSeparatedSyntaxList(ListParsingState.TupleType_Types), + eatToken(SyntaxKind.CloseBracketToken)); } function isTypeMember(inErrorRecovery: boolean): boolean { @@ -1442,99 +1442,10 @@ module TypeScript.Parser { return isCallSignature(/*tokenIndex:*/ 0) || isConstructSignature() || isIndexSignature(/*tokenIndex:*/ 0) || - isMethodSignature(inErrorRecovery) || - isPropertySignature(inErrorRecovery); + isMethodOrPropertySignature(inErrorRecovery); } - function tryParseTypeMember(inErrorRecovery: boolean): ITypeMemberSyntax { - var node = currentNode(); - if (SyntaxUtilities.isTypeMember(node)) { - consumeNode(node); - return node; - } - - if (isCallSignature(/*tokenIndex:*/ 0)) { - return parseCallSignature(/*requireCompleteTypeParameterList:*/ false); - } - else if (isConstructSignature()) { - return parseConstructSignature(); - } - else if (isIndexSignature(/*tokenIndex:*/ 0)) { - return parseIndexSignature(); - } - else if (isMethodSignature(inErrorRecovery)) { - // Note: it is important that isFunctionSignature is called before isPropertySignature. - // isPropertySignature checks for a subset of isFunctionSignature. - return parseMethodSignature(); - } - else if (isPropertySignature(inErrorRecovery)) { - return parsePropertySignature(); - } - else { - return null; - } - } - - function parseConstructSignature(): ConstructSignatureSyntax { - return new syntaxFactory.ConstructSignatureSyntax(parseNodeData, eatToken(SyntaxKind.NewKeyword), parseCallSignature(/*requireCompleteTypeParameterList:*/ false)); - } - - function parseIndexSignature(): IndexSignatureSyntax { - var openBracketToken = eatToken(SyntaxKind.OpenBracketToken); - - var skippedTokens: ISyntaxToken[] = getArray(); - var parameters = parseSeparatedSyntaxList(ListParsingState.IndexSignature_Parameters, skippedTokens); - openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - - return new syntaxFactory.IndexSignatureSyntax(parseNodeData, - openBracketToken, parameters, eatToken(SyntaxKind.CloseBracketToken), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); - } - - function parseMethodSignature(): MethodSignatureSyntax { - return new syntaxFactory.MethodSignatureSyntax(parseNodeData, - eatPropertyName(), tryEatToken(SyntaxKind.QuestionToken), parseCallSignature(/*requireCompleteTypeParameterList:*/ false)); - } - - function parsePropertySignature(): PropertySignatureSyntax { - return new syntaxFactory.PropertySignatureSyntax(parseNodeData, - eatPropertyName(), tryEatToken(SyntaxKind.QuestionToken), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); - } - - function isCallSignature(peekIndex: number): boolean { - var tokenKind = peekToken(peekIndex).kind(); - return tokenKind === SyntaxKind.OpenParenToken || tokenKind === SyntaxKind.LessThanToken; - } - - function isConstructSignature(): boolean { - if (currentToken().kind() !== SyntaxKind.NewKeyword) { - return false; - } - - return isCallSignature(/*peekIndex:*/1); - } - - function isIndexSignature(peekIndex: number): boolean { - return peekToken(peekIndex).kind() === SyntaxKind.OpenBracketToken; - } - - function isMethodSignature(inErrorRecovery: boolean): boolean { - if (isPropertyName(currentToken(), inErrorRecovery)) { - // id( - if (isCallSignature(1)) { - return true; - } - - // id?( - if (peekToken(1).kind() === SyntaxKind.QuestionToken && - isCallSignature(2)) { - return true; - } - } - - return false; - } - - function isPropertySignature(inErrorRecovery: boolean): boolean { + function isMethodOrPropertySignature(inErrorRecovery: boolean): boolean { var _currentToken = currentToken(); // Keywords can start properties. However, they're often intended to start something @@ -1550,8 +1461,9 @@ module TypeScript.Parser { // // Then we *should* parse it as a property name, as ASI takes effect here. if (isModifier(_currentToken, /*index:*/ 0)) { - if (!existsNewLineBetweenTokens(_currentToken, peekToken(1), source.text) && - isPropertyName(peekToken(1), inErrorRecovery)) { + var token1 = peekToken(1); + if (!existsNewLineBetweenTokens(_currentToken, token1, source.text) && + isPropertyNameToken(token1, inErrorRecovery)) { return false; } @@ -1559,16 +1471,123 @@ module TypeScript.Parser { // Note: property names also start function signatures. So it's important that we call this // after we calll isFunctionSignature. - return isPropertyName(_currentToken, inErrorRecovery); + return isPropertyName(/*peekIndex:*/ 0, inErrorRecovery); + } + + function tryParseTypeMember(inErrorRecovery: boolean): ITypeMemberSyntax { + var node = currentNode(); + if (SyntaxUtilities.isTypeMember(node)) { + consumeNode(node); + return node; + } + + if (isCallSignature(/*tokenIndex:*/ 0)) { + // A call signature for a type member can both use 'yield' as a parameter name, and + // does not have parameter initializers. So we can pass 'false' for both [Yield] + // and [GeneratorParameter]. + return parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false); + } + else if (isConstructSignature()) { + return parseConstructSignature(); + } + else if (isIndexSignature(/*tokenIndex:*/ 0)) { + return parseIndexSignature(); + } + else if (isMethodOrPropertySignature(inErrorRecovery)) { + var propertyName = parsePropertyName(); + var questionToken = tryEatToken(SyntaxKind.QuestionToken); + + if (isCallSignature(/*peekIndex:*/ 0)) { + return parseMethodSignature(propertyName, questionToken); + } + else { + return parsePropertySignature(propertyName, questionToken); + } + } + else { + return undefined; + } + } + + function parseConstructSignature(): ConstructSignatureSyntax { + // Construct signatures have no [Yield] or [GeneratorParameter] restrictions. + return new ConstructSignatureSyntax(contextFlags, + eatToken(SyntaxKind.NewKeyword), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false)); + } + + function parseIndexSignature(): IndexSignatureSyntax { + return new IndexSignatureSyntax(contextFlags, + eatToken(SyntaxKind.OpenBracketToken), + parseSeparatedSyntaxList(ListParsingState.IndexSignature_Parameters), + eatToken(SyntaxKind.CloseBracketToken), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); + } + + function parseMethodSignature(propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken): MethodSignatureSyntax { + // Method signatues don't exist in expression contexts. So they have neither + // [Yield] nor [GeneratorParameter] + return new MethodSignatureSyntax(contextFlags, + propertyName, + questionToken, + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false)); + } + + function parsePropertySignature(propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken): PropertySignatureSyntax { + return new PropertySignatureSyntax(contextFlags, + propertyName, questionToken, parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); + } + + function isCallSignature(peekIndex: number): boolean { + var tokenKind = peekToken(peekIndex).kind; + return tokenKind === SyntaxKind.OpenParenToken || tokenKind === SyntaxKind.LessThanToken; + } + + function isConstructSignature(): boolean { + if (currentToken().kind !== SyntaxKind.NewKeyword) { + return false; + } + + return isCallSignature(/*peekIndex:*/1); + } + + function isIndexSignature(peekIndex: number): boolean { + // In order to be considered an index signature, we need to see at least: + // + // [a: + // [... + // [a, + // [public a + // [] + // + // Otherwise, we will think that this is the start of a computed property name + // for a function or variable. + if (peekToken(peekIndex).kind === SyntaxKind.OpenBracketToken) { + var token1 = peekToken(peekIndex + 1); + if (token1.kind === SyntaxKind.DotDotDotToken || token1.kind === SyntaxKind.CloseBracketToken) { + return true; + } + if (isIdentifier(token1)) { + var token2 = peekToken(peekIndex + 2); + if (token2.kind === SyntaxKind.ColonToken || token2.kind === SyntaxKind.CommaToken) { + return true; + } + } + if (token1.kind === SyntaxKind.PublicKeyword || token1.kind === SyntaxKind.PrivateKeyword) { + var token2 = peekToken(peekIndex + 2); + return isIdentifier(token2); + } + } + + return false; } function isHeritageClause(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; return tokenKind === SyntaxKind.ExtendsKeyword || tokenKind === SyntaxKind.ImplementsKeyword; } function isNotHeritageClauseTypeName(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.ImplementsKeyword || tokenKind === SyntaxKind.ExtendsKeyword) { @@ -1590,26 +1609,20 @@ module TypeScript.Parser { function tryParseHeritageClause(): HeritageClauseSyntax { var extendsOrImplementsKeyword = currentToken(); - var tokenKind = extendsOrImplementsKeyword.kind(); + var tokenKind = extendsOrImplementsKeyword.kind; if (tokenKind !== SyntaxKind.ExtendsKeyword && tokenKind !== SyntaxKind.ImplementsKeyword) { - return null; + return undefined; } - consumeToken(extendsOrImplementsKeyword); - - var skippedTokens: ISyntaxToken[] = getArray(); - var typeNames = parseSeparatedSyntaxList(ListParsingState.HeritageClause_TypeNameList, skippedTokens); - extendsOrImplementsKeyword = addSkippedTokensAfterToken(extendsOrImplementsKeyword, skippedTokens); - - return new syntaxFactory.HeritageClauseSyntax(parseNodeData, extendsOrImplementsKeyword, typeNames); + return new HeritageClauseSyntax(contextFlags, + consumeToken(extendsOrImplementsKeyword), + parseSeparatedSyntaxList(ListParsingState.HeritageClause_TypeNameList)); } - function isInterfaceEnumClassModuleImportOrExport(modifierCount: number): boolean { - var _currentToken = currentToken(); - + function isInterfaceEnumClassModuleImportOrExport(modifierCount: number, _currentToken?: ISyntaxToken): boolean { if (modifierCount) { // Any of these keywords following a modifier is definitely a TS construct. - switch (peekToken(modifierCount).kind()) { + switch (peekToken(modifierCount).kind) { case SyntaxKind.ImportKeyword: case SyntaxKind.ModuleKeyword: case SyntaxKind.InterfaceKeyword: @@ -1619,6 +1632,8 @@ module TypeScript.Parser { } } + _currentToken = _currentToken || currentToken(); + // no modifiers. While certain of these keywords are javascript keywords as well, it // is possible to run into them in some circumstances in error recovery where we don't // want to consider them the start of the module element construct. For example, they @@ -1626,27 +1641,18 @@ module TypeScript.Parser { // make sure it really is the start of a module element. var nextToken = peekToken(1); - switch (_currentToken.kind()) { + switch (_currentToken.kind) { case SyntaxKind.ModuleKeyword: - if (isIdentifier(nextToken) || nextToken.kind() === SyntaxKind.StringLiteral) { - return true; - } - break; + return isIdentifier(nextToken) || nextToken.kind === SyntaxKind.StringLiteral; case SyntaxKind.ImportKeyword: case SyntaxKind.ClassKeyword: case SyntaxKind.EnumKeyword: case SyntaxKind.InterfaceKeyword: - if (isIdentifier(nextToken)) { - return true; - } - break; + return isIdentifier(nextToken); case SyntaxKind.ExportKeyword: - if (nextToken.kind() === SyntaxKind.EqualsToken) { - return true; - } - break; + return nextToken.kind === SyntaxKind.EqualsToken; } return false; @@ -1658,11 +1664,12 @@ module TypeScript.Parser { } var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { // ERROR RECOVERY case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: case SyntaxKind.StaticKeyword: // None of the above are actually keywords. And they might show up in a real // statement (i.e. "public();"). However, if we see 'public ' then @@ -1698,7 +1705,7 @@ module TypeScript.Parser { // do not want to consume. This can happen when the user does not terminate their // existing block properly. We don't want to accidently consume these as expression // below. - if (isInterfaceEnumClassModuleImportOrExport(modifierCount)) { + if (isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken)) { return false; } @@ -1722,7 +1729,7 @@ module TypeScript.Parser { } var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; return tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount(), inErrorRecovery); } @@ -1731,6 +1738,7 @@ module TypeScript.Parser { // ERROR RECOVERY case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: case SyntaxKind.StaticKeyword: // None of the above are actually keywords. And they might show up in a real // statement (i.e. "public();"). However, if we see 'public ' then @@ -1738,14 +1746,14 @@ module TypeScript.Parser { // and we should not parse it out here. if (SyntaxFacts.isIdentifierNameOrAnyKeyword(peekToken(1))) { // Definitely not a statement. - return null; + return undefined; } else { break; } case SyntaxKind.IfKeyword: return parseIfStatement(_currentToken); - case SyntaxKind.OpenBraceToken: return parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ false); + case SyntaxKind.OpenBraceToken: return parseStatementBlock(); case SyntaxKind.ReturnKeyword: return parseReturnStatement(_currentToken); case SyntaxKind.SwitchKeyword: return parseSwitchStatement(_currentToken); case SyntaxKind.ThrowKeyword: return parseThrowStatement(_currentToken); @@ -1763,8 +1771,8 @@ module TypeScript.Parser { // do not want to consume. This can happen when the user does not terminate their // existing block properly. We don't want to accidently consume these as expression // below. - if (isInterfaceEnumClassModuleImportOrExport(modifierCount)) { - return null; + if (isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken)) { + return undefined; } else if (isVariableStatement(modifierCount)) { return parseVariableStatement(); @@ -1782,30 +1790,33 @@ module TypeScript.Parser { return parseExpressionStatement(); } else { - return null; + return undefined; } } function parseDebuggerStatement(debuggerKeyword: ISyntaxToken): DebuggerStatementSyntax { - return new syntaxFactory.DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + return new DebuggerStatementSyntax(contextFlags, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseDoStatement(doKeyword: ISyntaxToken): DoStatementSyntax { + // IterationStatement[Yield, Return] : + // do Statement[?Yield, ?Return]while (Expression[In, ?Yield]); opt + // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby // do;while(0)x will have a semicolon inserted before x. - return new syntaxFactory.DoStatementSyntax(parseNodeData, + return new DoStatementSyntax(contextFlags, consumeToken(doKeyword), parseStatement(/*inErrorRecovery:*/ false), eatToken(SyntaxKind.WhileKeyword), eatToken(SyntaxKind.OpenParenToken), - parseExpression(/*allowIn:*/ true), eatToken(SyntaxKind.CloseParenToken), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ true)); + allowInAnd(parseExpression), eatToken(SyntaxKind.CloseParenToken), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ true)); } function isLabeledStatement(currentToken: ISyntaxToken): boolean { - return isIdentifier(currentToken) && peekToken(1).kind() === SyntaxKind.ColonToken; + return isIdentifier(currentToken) && peekToken(1).kind === SyntaxKind.ColonToken; } function parseLabeledStatement(identifierToken: ISyntaxToken): LabeledStatementSyntax { - return new syntaxFactory.LabeledStatementSyntax(parseNodeData, + return new LabeledStatementSyntax(contextFlags, consumeToken(identifierToken), eatToken(SyntaxKind.ColonToken), parseStatement(/*inErrorRecovery:*/ false)); } @@ -1814,52 +1825,67 @@ module TypeScript.Parser { var savedListParsingState = listParsingState; listParsingState |= (1 << ListParsingState.TryBlock_Statements); - var block = parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ false); + var block = parseStatementBlock(); listParsingState = savedListParsingState; - var catchClause: CatchClauseSyntax = null; - if (currentToken().kind() === SyntaxKind.CatchKeyword) { + var catchClause: CatchClauseSyntax = undefined; + if (currentToken().kind === SyntaxKind.CatchKeyword) { catchClause = parseCatchClause(); } // If we don't have a catch clause, then we must have a finally clause. Try to parse // one out no matter what. - var finallyClause: FinallyClauseSyntax = null; - if (catchClause === null || currentToken().kind() === SyntaxKind.FinallyKeyword) { + var finallyClause: FinallyClauseSyntax = undefined; + if (!catchClause || currentToken().kind === SyntaxKind.FinallyKeyword) { finallyClause = parseFinallyClause(); } - return new syntaxFactory.TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); + return new TryStatementSyntax(contextFlags, tryKeyword, block, catchClause, finallyClause); } function parseCatchClauseBlock(): BlockSyntax { var savedListParsingState = listParsingState; listParsingState |= (1 << ListParsingState.CatchBlock_Statements); - var block = parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ false); + var block = parseStatementBlock(); listParsingState = savedListParsingState; return block; } function parseCatchClause(): CatchClauseSyntax { - return new syntaxFactory.CatchClauseSyntax(parseNodeData, + return new CatchClauseSyntax(contextFlags, eatToken(SyntaxKind.CatchKeyword), eatToken(SyntaxKind.OpenParenToken), eatIdentifierToken(), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false), eatToken(SyntaxKind.CloseParenToken), parseCatchClauseBlock()); } function parseFinallyClause(): FinallyClauseSyntax { - return new syntaxFactory.FinallyClauseSyntax(parseNodeData, - eatToken(SyntaxKind.FinallyKeyword), parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ false)); + return new FinallyClauseSyntax(contextFlags, + eatToken(SyntaxKind.FinallyKeyword), + parseStatementBlock()); } function parseWithStatement(withKeyword: ISyntaxToken): WithStatementSyntax { - return new syntaxFactory.WithStatementSyntax(parseNodeData, - consumeToken(withKeyword), eatToken(SyntaxKind.OpenParenToken), parseExpression(/*allowIn:*/ true), eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); + // WithStatement[Yield, Return] : + // with (Expression[In, ?Yield]) Statement[?Yield, ?Return] + + return new WithStatementSyntax(contextFlags, + consumeToken(withKeyword), + eatToken(SyntaxKind.OpenParenToken), + allowInAnd(parseExpression), + eatToken(SyntaxKind.CloseParenToken), + parseStatement(/*inErrorRecovery:*/ false)); } function parseWhileStatement(whileKeyword: ISyntaxToken): WhileStatementSyntax { - return new syntaxFactory.WhileStatementSyntax(parseNodeData, - consumeToken(whileKeyword), eatToken(SyntaxKind.OpenParenToken), parseExpression(/*allowIn:*/ true), eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); + // IterationStatement[Yield, Return] : + // while (Expression[In, ?Yield]) Statement[?Yield, ?Return] + + return new WhileStatementSyntax(contextFlags, + consumeToken(whileKeyword), + eatToken(SyntaxKind.OpenParenToken), + allowInAnd(parseExpression), + eatToken(SyntaxKind.CloseParenToken), + parseStatement(/*inErrorRecovery:*/ false)); } function isEmptyStatement(currentToken: ISyntaxToken, inErrorRecovery: boolean): boolean { @@ -1873,151 +1899,134 @@ module TypeScript.Parser { return false; } - return currentToken.kind() === SyntaxKind.SemicolonToken; + return currentToken.kind === SyntaxKind.SemicolonToken; } function parseEmptyStatement(semicolonToken: ISyntaxToken): EmptyStatementSyntax { - return new syntaxFactory.EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); + return new EmptyStatementSyntax(contextFlags, consumeToken(semicolonToken)); } function parseForOrForInStatement(forKeyword: ISyntaxToken): IStatementSyntax { // Debug.assert(isForOrForInStatement()); - consumeToken(forKeyword); + forKeyword = consumeToken(forKeyword); var openParenToken = eatToken(SyntaxKind.OpenParenToken); var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); - if (tokenKind === SyntaxKind.VarKeyword) { - // for ( var VariableDeclarationListNoIn; Expressionopt ; Expressionopt ) Statement - // for ( var VariableDeclarationNoIn in Expression ) Statement - return parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken); - } - else if (tokenKind === SyntaxKind.SemicolonToken) { - // for ( ; Expressionopt ; Expressionopt ) Statement - return parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken); + var tokenKind = _currentToken.kind; + + // If we see 'for ( ;' then there is no initializer, and this must be a 'for' statement. + // If we don't see a semicolon, then parse our a variable declaration or an initializer + // expression. Both could be hte start of a 'for' or 'for-in' statement. So, after that + // check to see if we have an 'in' keyword to make the final determination as to what we + // have. + + // When trying to parse either a variable declaration or an expression do not allow 'in' + // to be parsed, as that will actually be consumed by the 'for in' statement production + // instead. Also, we allow any expression here (even though the grammar only allows for + // LeftHandSideExpression). We will make sure we actually have a LHS expression in the + // grammar walker. + var initializer = tokenKind === SyntaxKind.SemicolonToken + ? undefined + : tokenKind === SyntaxKind.VarKeyword + ? disallowInAnd(parseVariableDeclaration) + : disallowInAnd(parseExpression) + + // In order to be a 'for-in' statement, we had to have an initializer of some sort, and + // we had to actually get an 'in' keyword. + if (initializer !== undefined && currentToken().kind === SyntaxKind.InKeyword) { + // for ([lookahead not-in {let [ }] LeftHandSideExpression[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return] + // for ( var ForBinding[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return] + // for ( ForDeclaration[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return] + + return new ForInStatementSyntax(contextFlags, + forKeyword, openParenToken, initializer, eatToken(SyntaxKind.InKeyword), + allowInAnd(parseExpression), eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); } else { - // for ( ExpressionNoInopt; Expressionopt ; Expressionopt ) Statement - // for ( LeftHandSideExpression in Expression ) Statement - return parseForOrForInStatementWithInitializer(forKeyword, openParenToken); + // NOTE: From the es5 section on Automatic Semicolon Insertion. + // a semicolon is never inserted automatically if the semicolon would then ... become + // one of the two semicolons in the header of a for statement + + // for (ExpressionNoInopt; Expressionopt ; Expressionopt ) Statement + // for (var VariableDeclarationListNoIn; Expressionopt; Expressionopt) Statement + return new ForStatementSyntax(contextFlags, + forKeyword, openParenToken, initializer, + eatToken(SyntaxKind.SemicolonToken), tryParseForStatementCondition(), + eatToken(SyntaxKind.SemicolonToken), tryParseForStatementIncrementor(), + eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); } } - function parseForOrForInStatementWithVariableDeclaration(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken): IStatementSyntax { - // Debug.assert(forKeyword.kind === SyntaxKind.ForKeyword && openParenToken.kind() === SyntaxKind.OpenParenToken); - // Debug.assert(currentToken().kind() === SyntaxKind.VarKeyword); - - // for ( var VariableDeclarationListNoIn; Expressionopt ; Expressionopt ) Statement - // for ( var VariableDeclarationNoIn in Expression ) Statement - - var variableDeclaration = parseVariableDeclaration(/*allowIn:*/ false); - return currentToken().kind() === SyntaxKind.InKeyword - ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null) - : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null); - } - - function parseForInStatementWithVariableDeclarationOrInitializer(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax): ForInStatementSyntax { - // for ( var VariableDeclarationNoIn in Expression ) Statement - - return new syntaxFactory.ForInStatementSyntax(parseNodeData, - forKeyword, openParenToken, variableDeclaration, initializer, eatToken(SyntaxKind.InKeyword), - parseExpression(/*allowIn:*/ true), eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); - } - - function parseForOrForInStatementWithInitializer(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken): IStatementSyntax { - // Debug.assert(forKeyword.kind() === SyntaxKind.ForKeyword && openParenToken.kind() === SyntaxKind.OpenParenToken); - - // for ( ExpressionNoInopt; Expressionopt ; Expressionopt ) Statement - // for ( LeftHandSideExpression in Expression ) Statement - - var initializer = parseExpression(/*allowIn:*/ false); - return currentToken().kind() === SyntaxKind.InKeyword - ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer) - : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer); - } - - function parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken): ForStatementSyntax { - // Debug.assert(forKeyword.kind() === SyntaxKind.ForKeyword && openParenToken.kind() === SyntaxKind.OpenParenToken); - // Debug.assert(currentToken().kind() === SyntaxKind.SemicolonToken); - // for ( ; Expressionopt ; Expressionopt ) Statement - - return parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, /*variableDeclaration:*/ null, /*initializer:*/ null); - } - function tryParseForStatementCondition(): IExpressionSyntax { - var tokenKind = currentToken().kind(); + // for ( Expression[?Yield]opt ; Expression[In, ?Yield]opt ; Expression[In, ?Yield]opt ) + + var tokenKind = currentToken().kind; if (tokenKind !== SyntaxKind.SemicolonToken && tokenKind !== SyntaxKind.CloseParenToken && tokenKind !== SyntaxKind.EndOfFileToken) { - return parseExpression(/*allowIn:*/ true); + return allowInAnd(parseExpression); } - return null; + return undefined; } function tryParseForStatementIncrementor(): IExpressionSyntax { - var tokenKind = currentToken().kind(); + // for ( Expression[?Yield]opt ; Expression[In, ?Yield]opt ; Expression[In, ?Yield]opt ) + var tokenKind = currentToken().kind; if (tokenKind !== SyntaxKind.CloseParenToken && tokenKind !== SyntaxKind.EndOfFileToken) { - return parseExpression(/*allowIn:*/ true); + return allowInAnd(parseExpression); } - return null; - } - - function parseForStatementWithVariableDeclarationOrInitializer(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax): ForStatementSyntax { - // NOTE: From the es5 section on Automatic Semicolon Insertion. - // a semicolon is never inserted automatically if the semicolon would then ... become - // one of the two semicolons in the header of a for statement - - return new syntaxFactory.ForStatementSyntax(parseNodeData, - forKeyword, openParenToken, variableDeclaration, initializer, - eatToken(SyntaxKind.SemicolonToken), tryParseForStatementCondition(), - eatToken(SyntaxKind.SemicolonToken), tryParseForStatementIncrementor(), - eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); + return undefined; } function tryEatBreakOrContinueLabel(): ISyntaxToken { // If there is no newline after the break keyword, then we can consume an optional // identifier. - var identifier: ISyntaxToken = null; + var identifier: ISyntaxToken = undefined; if (!canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)) { if (isIdentifier(currentToken())) { return eatIdentifierToken(); } } - return null; + return undefined; } function parseBreakStatement(breakKeyword: ISyntaxToken): BreakStatementSyntax { - return new syntaxFactory.BreakStatementSyntax(parseNodeData, + return new BreakStatementSyntax(contextFlags, consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseContinueStatement(continueKeyword: ISyntaxToken): ContinueStatementSyntax { - return new syntaxFactory.ContinueStatementSyntax(parseNodeData, + return new ContinueStatementSyntax(contextFlags, consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } + function parseSwitchExpression(openParenToken: ISyntaxToken) { + // SwitchStatement[Yield, Return] : + // switch (Expression[In, ?Yield] ) CaseBlock[?Yield, ?Return] + + return openParenToken.fullWidth() === 0 && currentToken().kind === SyntaxKind.OpenBraceToken + ? eatIdentifierToken() + : allowInAnd(parseExpression); + } + function parseSwitchStatement(switchKeyword: ISyntaxToken) { // Debug.assert(isSwitchStatement()); + var openParenToken: ISyntaxToken; + var openBraceToken: ISyntaxToken; - consumeToken(switchKeyword); - var openParenToken = eatToken(SyntaxKind.OpenParenToken); - var expression = parseExpression(/*allowIn:*/ true); - var closeParenToken = eatToken(SyntaxKind.CloseParenToken); - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - - var switchClauses = Syntax.emptyList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - switchClauses = parseSyntaxList(ListParsingState.SwitchStatement_SwitchClauses, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - - return new syntaxFactory.SwitchStatementSyntax(parseNodeData, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, eatToken(SyntaxKind.CloseBraceToken)); + return new SwitchStatementSyntax(contextFlags, + consumeToken(switchKeyword), + openParenToken = eatToken(SyntaxKind.OpenParenToken), + parseSwitchExpression(openParenToken), + eatToken(SyntaxKind.CloseParenToken), + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSyntaxList(ListParsingState.SwitchStatement_SwitchClauses) : [], + eatToken(SyntaxKind.CloseBraceToken)); } function isSwitchClause(): boolean { @@ -2025,7 +2034,7 @@ module TypeScript.Parser { return true; } - var currentTokenKind = currentToken().kind(); + var currentTokenKind = currentToken().kind; return currentTokenKind === SyntaxKind.CaseKeyword || currentTokenKind === SyntaxKind.DefaultKeyword; } @@ -2038,7 +2047,7 @@ module TypeScript.Parser { } var _currentToken = currentToken(); - var kind = _currentToken.kind(); + var kind = _currentToken.kind; if (kind === SyntaxKind.CaseKeyword) { return parseCaseSwitchClause(_currentToken); } @@ -2046,98 +2055,95 @@ module TypeScript.Parser { return parseDefaultSwitchClause(_currentToken); } else { - return null; + return undefined; } } function parseCaseSwitchClause(caseKeyword: ISyntaxToken): CaseSwitchClauseSyntax { // Debug.assert(isCaseSwitchClause()); + // CaseClause[Yield, Return] : + // case Expression[In, ?Yield] : StatementList[?Yield, ?Return]opt - consumeToken(caseKeyword); - var expression = parseExpression(/*allowIn:*/ true); - var colonToken = eatToken(SyntaxKind.ColonToken); - var statements = Syntax.emptyList(); - - // TODO: allow parsing of the list evne if there's no colon. However, we have to make - // sure we add any skipped tokens to the right previous node or token. - if (colonToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - statements = parseSyntaxList(ListParsingState.SwitchClause_Statements, skippedTokens); - colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); - } - - return new syntaxFactory.CaseSwitchClauseSyntax(parseNodeData, caseKeyword, expression, colonToken, statements); + return new CaseSwitchClauseSyntax(contextFlags, + consumeToken(caseKeyword), + allowInAnd(parseExpression), + eatToken(SyntaxKind.ColonToken), + parseSyntaxList(ListParsingState.SwitchClause_Statements)); } function parseDefaultSwitchClause(defaultKeyword: ISyntaxToken): DefaultSwitchClauseSyntax { // Debug.assert(isDefaultSwitchClause()); - consumeToken(defaultKeyword); - var colonToken = eatToken(SyntaxKind.ColonToken); - var statements = Syntax.emptyList(); - - // TODO: Allow parsing without a colon here. However, ensure that we attach any skipped - // tokens to the defaultKeyword. - if (colonToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - statements = parseSyntaxList(ListParsingState.SwitchClause_Statements, skippedTokens); - colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); - } - - return new syntaxFactory.DefaultSwitchClauseSyntax(parseNodeData, defaultKeyword, colonToken, statements); - } - - function parseThrowStatementExpression(): IExpressionSyntax { - // Because of automatic semicolon insertion, we need to report error if this - // throw could be terminated with a semicolon. Note: we can't call 'parseExpression' - // directly as that might consume an expression on the following line. - return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) - ? createMissingToken(SyntaxKind.IdentifierName, null) - : parseExpression(/*allowIn:*/ true); + return new DefaultSwitchClauseSyntax(contextFlags, + consumeToken(defaultKeyword), + eatToken(SyntaxKind.ColonToken), + parseSyntaxList(ListParsingState.SwitchClause_Statements)); } function parseThrowStatement(throwKeyword: ISyntaxToken): ThrowStatementSyntax { - return new syntaxFactory.ThrowStatementSyntax(parseNodeData, - consumeToken(throwKeyword), parseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + return new ThrowStatementSyntax(contextFlags, + consumeToken(throwKeyword), tryParseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } - function tryParseReturnStatementExpression(): IExpressionSyntax { - return !canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) ? parseExpression(/*allowIn:*/ true) : null; + function tryParseThrowStatementExpression(): IExpressionSyntax { + // ThrowStatement[Yield] : + // throw [no LineTerminator here]Expression[In, ?Yield]; + + // Because of automatic semicolon insertion, we need to report error if this + // throw could be terminated with a semicolon. Note: we can't call 'parseExpression' + // directly as that might consume an expression on the following line. + // We just return 'undefined' in that case. The actual error will be reported in the + // grammar walker. + return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) ? undefined : allowInAnd(parseExpression); } function parseReturnStatement(returnKeyword: ISyntaxToken): ReturnStatementSyntax { - return new syntaxFactory.ReturnStatementSyntax(parseNodeData, + return new ReturnStatementSyntax(contextFlags, consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } + function tryParseReturnStatementExpression(): IExpressionSyntax { + // ReturnStatement[Yield] : + // return [no LineTerminator here]Expression[In, ?Yield]; + + return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) ? undefined : allowInAnd(parseExpression); + } + function isExpressionStatement(currentToken: ISyntaxToken): boolean { // As per the gramar, neither { nor 'function' can start an expression statement. - var tokenKind = currentToken.kind(); + var tokenKind = currentToken.kind; return tokenKind !== SyntaxKind.OpenBraceToken && tokenKind !== SyntaxKind.FunctionKeyword && isExpression(currentToken); } function isAssignmentOrOmittedExpression(): boolean { var _currentToken = currentToken(); - return _currentToken.kind() === SyntaxKind.CommaToken || isExpression(_currentToken); + return _currentToken.kind === SyntaxKind.CommaToken || isExpression(_currentToken); } function tryParseAssignmentOrOmittedExpression(): IExpressionSyntax { // Debug.assert(isAssignmentOrOmittedExpression()); - if (currentToken().kind() === SyntaxKind.CommaToken) { - return new syntaxFactory.OmittedExpressionSyntax(parseNodeData); + // ElementList[Yield] : + // Elisionopt AssignmentExpression[In, ?Yield] + + if (currentToken().kind === SyntaxKind.CommaToken) { + return new OmittedExpressionSyntax(contextFlags); } - return tryParseAssignmentExpressionOrHigher(/*force:*/ false, /*allowIn:*/ true); + return allowInAnd(tryParseAssignmentExpressionOrHigher); } function isExpression(currentToken: ISyntaxToken): boolean { - switch (currentToken.kind()) { + switch (currentToken.kind) { // Literals case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: case SyntaxKind.RegularExpressionLiteral: + // Templates + case SyntaxKind.NoSubstitutionTemplateToken: + case SyntaxKind.TemplateStartToken: + // For array literals. case SyntaxKind.OpenBracketToken: @@ -2166,14 +2172,9 @@ module TypeScript.Parser { case SyntaxKind.SlashToken: case SyntaxKind.SlashEqualsToken: - // Note: if we see a / or /= token then we always consider this an expression. Why? - // Well, either that / or /= is actually a regular expression, in which case we're - // definitely an expression. Or, it's actually a divide. In which case, we *still* - // want to think of ourself as an expression. "But wait", you say. '/' doesn't - // start an expression. That's true. BUt like the above check for =>, for error - // tolerance, we will consider ourselves in an expression. We'll then parse out an - // missing identifier and then will consume the / token naturally as a binary - // expression. + // Note: if we see a / or /= token then we always consider this an expression. + // The / or /= will actually be the start of a regex that we will contextually + // rescan. // Simple epxressions. case SyntaxKind.SuperKeyword: @@ -2193,58 +2194,70 @@ module TypeScript.Parser { // For function expressions. case SyntaxKind.FunctionKeyword: return true; + + case SyntaxKind.YieldKeyword: + // Yield always starts an expression. Either it is an identifier (in which case + // it is definitely an expression). Or it's a keyword (either because we're in + // a generator, or in strict mode (or both)) and it started a yield expression. + return true; } return isIdentifier(currentToken); } function parseExpressionStatement(): ExpressionStatementSyntax { - return new syntaxFactory.ExpressionStatementSyntax(parseNodeData, parseExpression(/*allowIn:*/ true), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + // ExpressionStatement[Yield] : + // [lookahead not-in {{, function, class, let [ }] Expression[In, ?Yield]; + + return new ExpressionStatementSyntax(contextFlags, + allowInAnd(parseExpression), + eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseIfStatement(ifKeyword: ISyntaxToken): IfStatementSyntax { - return new syntaxFactory.IfStatementSyntax(parseNodeData, - consumeToken(ifKeyword), eatToken(SyntaxKind.OpenParenToken), parseExpression(/*allowIn:*/ true), - eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false), parseOptionalElseClause()); + // IfStatement[Yield, Return] : + // if (Expression[In, ?Yield]) Statement[?Yield, ?Return] else Statement[?Yield, ?Return] + // if (Expression[In, ?Yield]) Statement[?Yield, ?Return] + + return new IfStatementSyntax(contextFlags, + consumeToken(ifKeyword), + eatToken(SyntaxKind.OpenParenToken), + allowInAnd(parseExpression), + eatToken(SyntaxKind.CloseParenToken), + parseStatement(/*inErrorRecovery:*/ false), parseOptionalElseClause()); } function parseOptionalElseClause(): ElseClauseSyntax { - return currentToken().kind() === SyntaxKind.ElseKeyword ? parseElseClause() : null; + return currentToken().kind === SyntaxKind.ElseKeyword ? parseElseClause() : undefined; } function parseElseClause(): ElseClauseSyntax { - return new syntaxFactory.ElseClauseSyntax(parseNodeData, eatToken(SyntaxKind.ElseKeyword), parseStatement(/*inErrorRecovery:*/ false)); + return new ElseClauseSyntax(contextFlags, eatToken(SyntaxKind.ElseKeyword), parseStatement(/*inErrorRecovery:*/ false)); } function isVariableStatement(modifierCount: number): boolean { - return peekToken(modifierCount).kind() === SyntaxKind.VarKeyword; + return peekToken(modifierCount).kind === SyntaxKind.VarKeyword; } function parseVariableStatement(): VariableStatementSyntax { - return new syntaxFactory.VariableStatementSyntax(parseNodeData, - parseModifiers(), parseVariableDeclaration(/*allowIn:*/ true), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + // VariableStatement[Yield] : + // var VariableDeclarationList[In, ?Yield]; + + return new VariableStatementSyntax(contextFlags, + parseModifiers(), allowInAnd(parseVariableDeclaration), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } - function parseVariableDeclaration(allowIn: boolean): VariableDeclarationSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.VarKeyword); + function parseVariableDeclaration(): VariableDeclarationSyntax { + // Debug.assert(currentToken().kind === SyntaxKind.VarKeyword); - var varKeyword = eatToken(SyntaxKind.VarKeyword); - // Debug.assert(varKeyword.fullWidth() > 0); - - var listParsingState = allowIn - ? ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn - : ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn; - - var skippedTokens: ISyntaxToken[] = getArray(); - var variableDeclarators = parseSeparatedSyntaxList(listParsingState, skippedTokens); - varKeyword = addSkippedTokensAfterToken(varKeyword, skippedTokens); - - return new syntaxFactory.VariableDeclarationSyntax(parseNodeData, varKeyword, variableDeclarators); + return new VariableDeclarationSyntax(contextFlags, + eatToken(SyntaxKind.VarKeyword), + parseSeparatedSyntaxList(ListParsingState.VariableDeclaration_VariableDeclarators)); } function isVariableDeclarator(): boolean { var node = currentNode(); - if (node !== null && node.kind() === SyntaxKind.VariableDeclarator) { + if (node && node.kind === SyntaxKind.VariableDeclarator) { return true; } @@ -2252,7 +2265,7 @@ module TypeScript.Parser { } function canReuseVariableDeclaratorNode(node: ISyntaxNode) { - if (node === null || node.kind() !== SyntaxKind.VariableDeclarator) { + if (!node || node.kind !== SyntaxKind.VariableDeclarator) { return false; } @@ -2271,56 +2284,46 @@ module TypeScript.Parser { // In order to prevent this, we do not allow a variable declarator to be reused if it // has an initializer. var variableDeclarator = node; - return variableDeclarator.equalsValueClause === null; + return variableDeclarator.equalsValueClause === undefined; } - function tryParseVariableDeclarator(allowIn: boolean, allowPropertyName: boolean): VariableDeclaratorSyntax { - // TODO(cyrusn): What if the 'allowIn' context has changed between when we last parsed - // and now? We could end up with an incorrect tree. For example, say we had in the old - // tree "var i = a in b". Then, in the new tree the declarator portion moved into: - // "for (var i = a in b". We would not want to reuse the declarator as the "in b" portion - // would need to be consumed by the for declaration instead. Need to see if it is possible - // to hit this case. + function tryParseVariableDeclarator(): VariableDeclaratorSyntax { var node = currentNode(); if (canReuseVariableDeclaratorNode(node)) { consumeNode(node); return node; } - if (allowPropertyName) { - // Debug.assert(isPropertyName(currentToken(), /*inErrorRecovery:*/ false)); + if (!isIdentifier(currentToken())) { + return undefined; } - if (!allowPropertyName && !isIdentifier(currentToken())) { - return null; - } + var propertyName = eatIdentifierToken(); + var equalsValueClause: EqualsValueClauseSyntax = undefined; + var typeAnnotation: TypeAnnotationSyntax = undefined; - var propertyName = allowPropertyName ? eatPropertyName() : eatIdentifierToken(); - var equalsValueClause: EqualsValueClauseSyntax = null; - var typeAnnotation: TypeAnnotationSyntax = null; - - if (propertyName.fullWidth() > 0) { + if (fullWidth(propertyName) > 0) { typeAnnotation = parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false); if (isEqualsValueClause(/*inParameter*/ false)) { - equalsValueClause = parseEqualsValueClause(allowIn); + equalsValueClause = parseEqualsValueClause(); } } - return new syntaxFactory.VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); + return new VariableDeclaratorSyntax(contextFlags, propertyName, typeAnnotation, equalsValueClause); } function isEqualsValueClause(inParameter: boolean): boolean { var token0 = currentToken(); - if (token0.kind() === SyntaxKind.EqualsToken) { + if (token0.kind === SyntaxKind.EqualsToken) { return true; } // It's not uncommon during typing for the user to miss writing the '=' token. Check if // there is no newline after the last token and if we're on an expression. If so, parse // this as an equals-value clause with a missing equals. - if (!previousTokenHasTrailingNewLine(token0)) { - var tokenKind = token0.kind(); + if (!isOnDifferentLineThanPreviousToken(token0)) { + var tokenKind = token0.kind; // The 'isExpression' call below returns true for "=>". That's because it smartly // assumes that there is just a missing identifier and the user wanted a lambda. @@ -2347,52 +2350,55 @@ module TypeScript.Parser { return false; } - function parseEqualsValueClause(allowIn: boolean): EqualsValueClauseSyntax { - return new syntaxFactory.EqualsValueClauseSyntax(parseNodeData, - eatToken(SyntaxKind.EqualsToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn)); + function parseEqualsValueClause(): EqualsValueClauseSyntax { + // Initializer[In, Yield] : + // = AssignmentExpression[?In, ?Yield] + + return new EqualsValueClauseSyntax(contextFlags, + eatToken(SyntaxKind.EqualsToken), + parseAssignmentExpressionOrHigher()); } - function parseExpression(allowIn: boolean): IExpressionSyntax { + function parseExpression(): IExpressionSyntax { // Expression[in]: // AssignmentExpression[in] // Expression[in] , AssignmentExpression[in] - var leftOperand = tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn); + var leftOperand = parseAssignmentExpressionOrHigher(); while (true) { var _currentToken = currentToken(); - if (_currentToken.kind() !== SyntaxKind.CommaToken) { + if (_currentToken.kind !== SyntaxKind.CommaToken) { break; } - leftOperand = new syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), - tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn)); + leftOperand = new BinaryExpressionSyntax(contextFlags, + leftOperand, + consumeToken(_currentToken), + parseAssignmentExpressionOrHigher()); } return leftOperand; } + function tryParseAssignmentExpressionOrHigher(): IExpressionSyntax { + return tryParseAssignmentExpressionOrHigherWorker(/*force:*/ false); + } + + function parseAssignmentExpressionOrHigher(): IExpressionSyntax { + return tryParseAssignmentExpressionOrHigherWorker(/*force:*/ true); + } + // Called when you need to parse an expression, but you do not want to allow 'CommaExpressions'. // i.e. if you have "var a = 1, b = 2" then when we parse '1' we want to parse with higher // precedence than 'comma'. Otherwise we'll get: "var a = (1, (b = 2))", instead of // "var a = (1), b = (2)"); - function tryParseAssignmentExpressionOrHigher(force: boolean, allowIn: boolean): IExpressionSyntax { - // Augmented by TypeScript: - // - // AssignmentExpression[in]: - // 1) ConditionalExpression[in] - // 2) LeftHandSideExpression = AssignmentExpression[in] - // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[in] - // 4) ArrowFunctionExpression <-- added by TypeScript - // - // Open spec question. Right now, there is no 'ArrowFunctionExpression[in]' variant. - // Thus, if the user has: - // - // for (var a = () => b in c) {} - // - // Then we will fail to parse (because the 'in' will be consumed as part of the body of - // the lambda, and not as part of the 'for' statement). This is likely not an issue - // whatsoever as there seems to be no good reason why anyone would ever write code like - // the above. + function tryParseAssignmentExpressionOrHigherWorker(force: boolean): IExpressionSyntax { + // AssignmentExpression[in,yield]: + // 1) ConditionalExpression[?in,?yield] + // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] + // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield] + // 4) ArrowFunctionExpression[?in,?yield] + // 5) [+Yield] YieldExpression[?In] // // Note: for ease of implementation we treat productions '2' and '3' as the same thing. // (i.e. they're both BinaryExpressions with an assignment operator in it). @@ -2402,8 +2408,12 @@ module TypeScript.Parser { // LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done // with AssignmentExpression if we see one. var _currentToken = currentToken(); + if (isYieldExpression(_currentToken)) { + return parseYieldExpression(_currentToken); + } + var arrowFunction = tryParseAnyArrowFunctionExpression(_currentToken); - if (arrowFunction !== null) { + if (arrowFunction) { return arrowFunction; } @@ -2416,9 +2426,9 @@ module TypeScript.Parser { // Otherwise, we try to parse out the conditional expression bit. We want to allow any // binary expression here, so we pass in the 'lowest' precedence here so that it matches // and consumes anything. - var leftOperand = tryParseBinaryExpressionOrHigher(_currentToken, force, BinaryExpressionPrecedence.Lowest, allowIn); - if (leftOperand === null) { - return null; + var leftOperand = tryParseBinaryExpressionOrHigher(_currentToken, force, BinaryExpressionPrecedence.Lowest); + if (leftOperand === undefined) { + return undefined; } if (SyntaxUtilities.isLeftHandSizeExpression(leftOperand)) { @@ -2427,14 +2437,74 @@ module TypeScript.Parser { var operatorToken = currentOperatorToken(); // Check for recursive assignment expressions. - if (SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind())) { - return new syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), - tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn)); + if (SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind)) { + return new BinaryExpressionSyntax(contextFlags, + leftOperand, + consumeToken(operatorToken), + parseAssignmentExpressionOrHigher()); } } // It wasn't an assignment or a lambda. This is a conditional expression: - return parseConditionalExpressionRest(allowIn, leftOperand); + return parseConditionalExpressionRest(leftOperand); + } + + function isYieldExpression(_currentToken: ISyntaxToken): boolean { + if (_currentToken.kind === SyntaxKind.YieldKeyword) { + // If we have a 'yield' keyword, and htis is a context where yield expressions are + // allowed, then definitely parse out a yield expression. + if (inYieldContext()) { + return true; + } + + if (inStrictModeContext()) { + // If we're in strict mode, then 'yield' is a keyword, could only ever start + // a yield expression. + return true; + } + + // We're in a context where 'yield expr' is not allowed. However, if we can + // definitely tell that the user was trying to parse a 'yield expr' and not + // just a normal expr that start with a 'yield' identifier, then parse out + // a 'yield expr'. We can then report an error later that they are only + // allowed in generator expressions. + // + // for example, if we see 'yield(foo)', then we'll have to treat that as an + // invocation expression of something called 'yield'. However, if we have + // 'yield foo' then that is not legal as a normal expression, so we can + // definitely recognize this as a yield expression. + // + // for now we just check if the next token is an identifier. More heuristics + // can be added here later as necessary. We just need to make sure that we + // don't accidently consume something legal. + var token1 = peekToken(1); + if (!isOnDifferentLineThanPreviousToken(token1) && isIdentifier(token1)) { + return true; + } + } + + return false; + } + + function parseYieldExpression(yieldKeyword: ISyntaxToken): YieldExpressionSyntax { + // YieldExpression[In] : + // yield + // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] + // yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] + + yieldKeyword = consumeToken(yieldKeyword); + var _currentToken = currentToken(); + + if (!isOnDifferentLineThanPreviousToken(_currentToken) && + (_currentToken.kind === SyntaxKind.AsteriskToken || isExpression(_currentToken))) { + + return new YieldExpressionSyntax(contextFlags, yieldKeyword, tryEatToken(SyntaxKind.AsteriskToken), parseAssignmentExpressionOrHigher()); + } + else { + // if the next token is not on the same line as yield. or we don't have an '*' or + // the start of an expressin, then this is just a simple "yield" expression. + return new YieldExpressionSyntax(contextFlags, yieldKeyword, /*asterixToken:*/ undefined, /*expression;*/ undefined); + } } function tryParseAnyArrowFunctionExpression(_currentToken: ISyntaxToken): IExpressionSyntax { @@ -2444,7 +2514,7 @@ module TypeScript.Parser { } function tryParseUnaryExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean): IUnaryExpressionSyntax { - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.PlusToken: @@ -2453,7 +2523,7 @@ module TypeScript.Parser { case SyntaxKind.ExclamationToken: case SyntaxKind.PlusPlusToken: case SyntaxKind.MinusMinusToken: - return new syntaxFactory.PrefixUnaryExpressionSyntax(parseNodeData, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new PrefixUnaryExpressionSyntax(contextFlags, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); case SyntaxKind.TypeOfKeyword: return parseTypeOfExpression(_currentToken); case SyntaxKind.VoidKeyword: return parseVoidExpression(_currentToken); case SyntaxKind.DeleteKeyword: return parseDeleteExpression(_currentToken); @@ -2463,7 +2533,7 @@ module TypeScript.Parser { } } - function tryParseBinaryExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean, precedence: BinaryExpressionPrecedence, allowIn: boolean): IExpressionSyntax { + function tryParseBinaryExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean, precedence: BinaryExpressionPrecedence): IExpressionSyntax { // The binary expressions are incredibly left recursive in their definitions. We // clearly can't implement that through recursion. So, instead, we first bottom out // of all the recursion by jumping to this production and consuming a UnaryExpression @@ -2472,39 +2542,42 @@ module TypeScript.Parser { // MultiplicativeExpression: See 11.5 // UnaryExpression var leftOperand = tryParseUnaryExpressionOrHigher(_currentToken, force); - if (leftOperand === null) { - return null; + if (leftOperand === undefined) { + return undefined; } // We then pop up the stack consuming the other side of the binary exprssion if it exists. - return parseBinaryExpressionRest(precedence, allowIn, leftOperand); + return parseBinaryExpressionRest(precedence, leftOperand); } - function parseConditionalExpressionRest(allowIn: boolean, leftOperand: IExpressionSyntax): IExpressionSyntax { + function parseConditionalExpressionRest(leftOperand: IExpressionSyntax): IExpressionSyntax { // Note: we are passed in an expression which was produced from parseBinaryExpressionOrHigher. var _currentToken = currentToken(); // Now check for conditional expression. - if (_currentToken.kind() !== SyntaxKind.QuestionToken) { + if (_currentToken.kind !== SyntaxKind.QuestionToken) { return leftOperand; } - // Note: we explicitly do *not* pass 'allowIn' to the whenTrue part. An 'in' expression is always - // allowed in the 'true' part of a conditional expression. + // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and + // we do not that for the 'whenFalse' part. - return new syntaxFactory.ConditionalExpressionSyntax(parseNodeData, - leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true), - eatToken(SyntaxKind.ColonToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn)); + return new ConditionalExpressionSyntax(contextFlags, + leftOperand, + consumeToken(_currentToken), + allowInAnd(parseAssignmentExpressionOrHigher), + eatToken(SyntaxKind.ColonToken), + parseAssignmentExpressionOrHigher()); } - function parseBinaryExpressionRest(precedence: BinaryExpressionPrecedence, allowIn: boolean, leftOperand: IExpressionSyntax): IExpressionSyntax { + function parseBinaryExpressionRest(precedence: BinaryExpressionPrecedence, leftOperand: IExpressionSyntax): IExpressionSyntax { while (true) { // We either have a binary operator here, or we're finished. We call // currentOperatorToken versus currentToken here so that we merge token sequences // like > and = into >= var operatorToken = currentOperatorToken(); - var tokenKind = operatorToken.kind(); + var tokenKind = operatorToken.kind; // Only proceed if we see binary expression token. However we don't parse // assignment expressions or comma expressions here. Those are taken care of @@ -2517,7 +2590,7 @@ module TypeScript.Parser { } // also, if it's the 'in' operator, only allow if our caller allows it. - if (tokenKind === SyntaxKind.InKeyword && !allowIn) { + if (tokenKind === SyntaxKind.InKeyword && inDisallowInContext()) { break; } @@ -2534,8 +2607,8 @@ module TypeScript.Parser { // Precedence is okay, so we'll "take" this operator. // Now skip the operator token we're on. - leftOperand = new syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), - tryParseBinaryExpressionOrHigher(currentToken(), /*force:*/ true, newPrecedence, allowIn)); + leftOperand = new BinaryExpressionSyntax(contextFlags, leftOperand, consumeToken(operatorToken), + tryParseBinaryExpressionOrHigher(currentToken(), /*force:*/ true, newPrecedence)); } return leftOperand; @@ -2546,7 +2619,7 @@ module TypeScript.Parser { // If we see a > we need to see if we can actually merge this contextually into a // >> >>> >= >>= >>>= token. - if (token0.kind() === SyntaxKind.GreaterThanToken) { + if (token0.kind === SyntaxKind.GreaterThanToken) { return currentContextualToken(); // var kind = token0.kind; //Debug.assert(kind() === SyntaxKind.GreaterThanToken || kind() === SyntaxKind.GreaterThanGreaterThanToken || @@ -2557,7 +2630,7 @@ module TypeScript.Parser { return token0; } - function tryParseMemberExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean, inObjectCreation: boolean): IMemberExpressionSyntax { + function tryParseMemberExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean): IMemberExpressionSyntax { // Note: to make our lives simpler, we decompose the the NewExpression productions and // place ObjectCreationExpression and FunctionExpression into PrimaryExpression. // like so: @@ -2606,21 +2679,21 @@ module TypeScript.Parser { // Because CallExpression and MemberExpression are left recursive, we need to bottom out // of the recursion immediately. So we parse out a primary expression to start with. var expression: IMemberExpressionSyntax = tryParsePrimaryExpression(_currentToken, force); - if (expression === null) { - return null; + if (expression === undefined) { + return undefined; } - return parseMemberExpressionRest(expression, inObjectCreation); + return parseMemberExpressionRest(expression); } function parseCallExpressionRest(expression: ILeftHandSideExpressionSyntax): ILeftHandSideExpressionSyntax { while (true) { var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.OpenParenToken: - expression = new syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(/*typeArgumentList:*/ null)); + expression = new InvocationExpressionSyntax(contextFlags, expression, parseArgumentList(/*typeArgumentList:*/ undefined, _currentToken)); continue; case SyntaxKind.LessThanToken: @@ -2629,19 +2702,24 @@ module TypeScript.Parser { // part of an arithmetic expression. Break out so we consume it higher in the // stack. var argumentList = tryParseArgumentList(); - if (argumentList === null) { + if (argumentList === undefined) { break; } - expression = new syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, argumentList); + expression = new InvocationExpressionSyntax(contextFlags, expression, argumentList); continue; case SyntaxKind.OpenBracketToken: - expression = parseElementAccessExpression(expression, _currentToken, /*inObjectCreation:*/ false); + expression = parseElementAccessExpression(expression, _currentToken); continue; case SyntaxKind.DotToken: - expression = new syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + expression = new MemberAccessExpressionSyntax(contextFlags, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + continue; + + case SyntaxKind.NoSubstitutionTemplateToken: + case SyntaxKind.TemplateStartToken: + expression = new TemplateAccessExpressionSyntax(contextFlags, expression, parseTemplateExpression(_currentToken)); continue; } @@ -2649,18 +2727,23 @@ module TypeScript.Parser { } } - function parseMemberExpressionRest(expression: IMemberExpressionSyntax, inObjectCreation: boolean): IMemberExpressionSyntax { + function parseMemberExpressionRest(expression: IMemberExpressionSyntax): IMemberExpressionSyntax { while (true) { var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.OpenBracketToken: - expression = parseElementAccessExpression(expression, _currentToken, inObjectCreation); + expression = parseElementAccessExpression(expression, _currentToken); continue; case SyntaxKind.DotToken: - expression = new syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + expression = new MemberAccessExpressionSyntax(contextFlags, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + continue; + + case SyntaxKind.NoSubstitutionTemplateToken: + case SyntaxKind.TemplateStartToken: + expression = new TemplateAccessExpressionSyntax(contextFlags, expression, parseTemplateExpression(_currentToken)); continue; } @@ -2700,14 +2783,14 @@ module TypeScript.Parser { // completes the LeftHandSideExpression, or starts the beginning of the first four // CallExpression productions. - var expression: ILeftHandSideExpressionSyntax = null; - if (_currentToken.kind() === SyntaxKind.SuperKeyword) { + var expression: ILeftHandSideExpressionSyntax = undefined; + if (_currentToken.kind === SyntaxKind.SuperKeyword) { expression = parseSuperExpression(_currentToken); } else { - expression = tryParseMemberExpressionOrHigher(_currentToken, force, /*inObjectCreation:*/ false); - if (expression === null) { - return null; + expression = tryParseMemberExpressionOrHigher(_currentToken, force); + if (expression === undefined) { + return undefined; } } @@ -2717,63 +2800,65 @@ module TypeScript.Parser { } function parseSuperExpression(superToken: ISyntaxToken): ILeftHandSideExpressionSyntax { - var expression: ILeftHandSideExpressionSyntax = consumeToken(superToken); + var expression = consumeToken(superToken); // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var currentTokenKind = currentToken().kind(); + var currentTokenKind = currentToken().kind; return currentTokenKind === SyntaxKind.OpenParenToken || currentTokenKind === SyntaxKind.DotToken ? expression - : new syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(SyntaxKind.DotToken), eatIdentifierNameToken()); + : new MemberAccessExpressionSyntax(contextFlags, expression, eatToken(SyntaxKind.DotToken), eatIdentifierNameToken()); } function tryParsePostfixExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean): IPostfixExpressionSyntax { var expression = tryParseLeftHandSideExpressionOrHigher(_currentToken, force); - if (expression === null) { - return null; + if (expression === undefined) { + return undefined; } var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.PlusPlusToken: case SyntaxKind.MinusMinusToken: // Because of automatic semicolon insertion, we should only consume the ++ or -- // if it is on the same line as the previous token. - if (previousTokenHasTrailingNewLine(_currentToken)) { + if (isOnDifferentLineThanPreviousToken(_currentToken)) { break; } - return new syntaxFactory.PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); + return new PostfixUnaryExpressionSyntax(contextFlags, expression, consumeToken(_currentToken)); } return expression; } function tryParseGenericArgumentList(): ArgumentListSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.LessThanToken); + // Debug.assert(currentToken().kind === SyntaxKind.LessThanToken); // If we have a '<', then only parse this as a arugment list if the type arguments // are complete and we have an open paren. if we don't, rewind and return nothing. var rewindPoint = getRewindPoint(); var typeArgumentList = tryParseTypeArgumentList(/*inExpression:*/ true); var token0 = currentToken(); - var tokenKind = token0.kind(); + var tokenKind = token0.kind; var isOpenParen = tokenKind === SyntaxKind.OpenParenToken; var isDot = tokenKind === SyntaxKind.DotToken; var isOpenParenOrDot = isOpenParen || isDot; - var argumentList: ArgumentListSyntax = null; - if (typeArgumentList === null || !isOpenParenOrDot) { + var argumentList: ArgumentListSyntax = undefined; + if (!typeArgumentList || !isOpenParenOrDot) { // Wasn't generic. Rewind to where we started so this can be parsed as an // arithmetic expression. rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { + Debug.assert(typeArgumentList && isOpenParenOrDot); + releaseRewindPoint(rewindPoint); // It's not uncommon for a user to type: "Foo." // @@ -2782,81 +2867,69 @@ module TypeScript.Parser { // we'll bail out here and give a poor error message when we try to parse this // as an arithmetic expression. if (isDot) { - // A parameter list must follow a generic type argument list. - var diagnostic = new Diagnostic(fileName, source.text.lineMap(), start(token0, source.text), width(token0), - DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, null); - addDiagnostic(diagnostic); - - return new syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, - Syntax.emptyToken(SyntaxKind.OpenParenToken), Syntax.emptySeparatedList(), Syntax.emptyToken(SyntaxKind.CloseParenToken)); + return new ArgumentListSyntax(contextFlags, typeArgumentList, + createMissingToken(SyntaxKind.OpenParenToken, undefined, DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected), + [], + eatToken(SyntaxKind.CloseParenToken)); } else { - return parseArgumentList(typeArgumentList); + Debug.assert(token0.kind === SyntaxKind.OpenParenToken); + return parseArgumentList(typeArgumentList, token0); } } } function tryParseArgumentList(): ArgumentListSyntax { - var tokenKind = currentToken().kind(); + var _currentToken = currentToken(); + var tokenKind = _currentToken.kind; if (tokenKind === SyntaxKind.LessThanToken) { return tryParseGenericArgumentList(); } if (tokenKind === SyntaxKind.OpenParenToken) { - return parseArgumentList(null); + return parseArgumentList(/*typeArgumentList:*/ undefined, /*openParenToken:*/ _currentToken); } - return null; + return undefined; } - function parseArgumentList(typeArgumentList: TypeArgumentListSyntax): ArgumentListSyntax { - var openParenToken = eatToken(SyntaxKind.OpenParenToken); + function parseArgumentList(typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken): ArgumentListSyntax { + Debug.assert(openParenToken.kind === SyntaxKind.OpenParenToken && openParenToken.fullWidth() > 0); - // Don't use the name 'arguments' it prevents V8 from optimizing this method. - var _arguments = Syntax.emptySeparatedList(); - - if (openParenToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - _arguments = parseSeparatedSyntaxList(ListParsingState.ArgumentList_AssignmentExpressions, skippedTokens); - openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); - } - - return new syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, openParenToken, _arguments, eatToken(SyntaxKind.CloseParenToken)); + return new ArgumentListSyntax(contextFlags, + typeArgumentList, + consumeToken(openParenToken), + parseSeparatedSyntaxList(ListParsingState.ArgumentList_AssignmentExpressions), + eatToken(SyntaxKind.CloseParenToken)); } function tryParseArgumentListExpression(): IExpressionSyntax { + // ArgumentList[Yield] : + // AssignmentExpression[In, ?Yield] + // Generally while parsing lists, we don't want to 'force' the parser to parse - // the item. That way, if the expected item isn't htere, we can bail out and + // the item. That way, if the expected item isn't there, we can bail out and // move to a higher stage of list parsing. However, it's extremely common to // see something like "Foo(, a". in this case, even though there isn't an expression // after the open paren, we still want to force parsing an expression (which will // cause a missing identiifer to be created), so that we will then consume the // comma and the following list items). - var force = currentToken().kind() === SyntaxKind.CommaToken; - return tryParseAssignmentExpressionOrHigher(force, /*allowIn:*/ true); + var force = currentToken().kind === SyntaxKind.CommaToken; + return allowInAnd(force ? parseAssignmentExpressionOrHigher : tryParseAssignmentExpressionOrHigher); } - function parseElementAccessArgumentExpression(openBracketToken: ISyntaxToken, inObjectCreation: boolean) { - // It's not uncommon for a user to write: "new Type[]". Check for that common pattern - // and report a better error message. - if (inObjectCreation && currentToken().kind() === SyntaxKind.CloseBracketToken) { - var errorStart = start(openBracketToken, source.text); - var errorEnd = end(currentToken(), source.text); - var diagnostic = new Diagnostic(fileName, source.text.lineMap(), errorStart, errorEnd - errorStart, - DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, null); - addDiagnostic(diagnostic); + function parseElementAccessArgumentExpression(openBracketToken: ISyntaxToken) { + // MemberExpression[?Yield] [ Expression[In, ?Yield] ] - return Syntax.emptyToken(SyntaxKind.IdentifierName); - } - else { - return parseExpression(/*allowIn:*/ true); - } + // For error recovery purposes. Allow a missing expression here. We'll report the + // appropriate message in the grammar checker. + return currentToken().kind === SyntaxKind.CloseBracketToken ? undefined : allowInAnd(parseExpression); } - function parseElementAccessExpression(expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, inObjectCreation: boolean): ElementAccessExpressionSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.OpenBracketToken); - return new syntaxFactory.ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), - parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(SyntaxKind.CloseBracketToken)); + function parseElementAccessExpression(expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken): ElementAccessExpressionSyntax { + // Debug.assert(currentToken().kind === SyntaxKind.OpenBracketToken); + return new ElementAccessExpressionSyntax(contextFlags, expression, consumeToken(openBracketToken), + parseElementAccessArgumentExpression(openBracketToken), eatToken(SyntaxKind.CloseBracketToken)); } function tryParsePrimaryExpression(_currentToken: ISyntaxToken, force: boolean): IPrimaryExpressionSyntax { @@ -2864,7 +2937,7 @@ module TypeScript.Parser { return eatIdentifierToken(); } - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.ThisKeyword: case SyntaxKind.TrueKeyword: @@ -2875,39 +2948,37 @@ module TypeScript.Parser { case SyntaxKind.StringLiteral: return consumeToken(_currentToken); - case SyntaxKind.FunctionKeyword: return parseFunctionExpression(_currentToken); - case SyntaxKind.OpenBracketToken: return parseArrayLiteralExpression(_currentToken); - case SyntaxKind.OpenBraceToken: return parseObjectLiteralExpression(_currentToken); - case SyntaxKind.OpenParenToken: return parseParenthesizedExpression(_currentToken); - case SyntaxKind.NewKeyword: return parseObjectCreationExpression(_currentToken); + case SyntaxKind.FunctionKeyword: return parseFunctionExpression(_currentToken); + case SyntaxKind.OpenBracketToken: return parseArrayLiteralExpression(_currentToken); + case SyntaxKind.OpenBraceToken: return parseObjectLiteralExpression(_currentToken); + case SyntaxKind.OpenParenToken: return parseParenthesizedExpression(_currentToken); + case SyntaxKind.NewKeyword: return parseObjectCreationExpression(_currentToken); + + case SyntaxKind.NoSubstitutionTemplateToken: + case SyntaxKind.TemplateStartToken: + return parseTemplateExpression(_currentToken); case SyntaxKind.SlashToken: case SyntaxKind.SlashEqualsToken: - // If we see a standalone / or /= and we're expecting a term, then try to reparse + // If we see a standalone / or /= and we're expecting an expression, then reparse // it as a regular expression. - var result = tryReparseDivideAsRegularExpression(); - - // If we get a result, then use it. Otherwise, create a missing identifier so - // that parsing can continue. Note: we do this even if 'force' is false. That's - // because we *do* want to consider a standalone / as an expression that should be - // returned from tryParseExpression even when 'force' is set to false. - return result || eatIdentifierToken(DiagnosticCode.Expression_expected); + return reparseDivideAsRegularExpression(); } if (!force) { - return null; + return undefined; } // Nothing else worked, report an error and produce a missing token. return eatIdentifierToken(DiagnosticCode.Expression_expected); } - function tryReparseDivideAsRegularExpression(): IPrimaryExpressionSyntax { + function reparseDivideAsRegularExpression(): IPrimaryExpressionSyntax { // If we see a / or /= token, then that may actually be the start of a regex in certain // contexts. // var currentToken = this.currentToken(); - // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken.kind())); + // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken.kind)); // Ok, from our quick lexical check, this could be a place where a regular expression could // go. Now we have to do a bunch of work. Ask the source to retrive the token at the @@ -2916,40 +2987,43 @@ module TypeScript.Parser { // Note: we *must* have gotten a /, /= or regular expression. Or else something went *very* // wrong with our logic above. - // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(currentToken.kind())); + // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(currentToken.kind)); - var tokenKind = currentToken.kind(); - if (tokenKind === SyntaxKind.SlashToken || tokenKind === SyntaxKind.SlashEqualsToken) { - // Still came back as a / or /=. This is not a regular expression literal. - return null; - } - else if (tokenKind === SyntaxKind.RegularExpressionLiteral) { - return consumeToken(currentToken); - } - else { - // Something *very* wrong happened. This is an internal parser fault that we need - // to figure out and fix. - throw Errors.invalidOperation(); - } + var tokenKind = currentToken.kind; + Debug.assert(tokenKind === SyntaxKind.RegularExpressionLiteral); + + return consumeToken(currentToken); } function parseTypeOfExpression(typeOfKeyword: ISyntaxToken): TypeOfExpressionSyntax { - return new syntaxFactory.TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new TypeOfExpressionSyntax(contextFlags, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseDeleteExpression(deleteKeyword: ISyntaxToken): DeleteExpressionSyntax { - return new syntaxFactory.DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new DeleteExpressionSyntax(contextFlags, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseVoidExpression(voidKeyword: ISyntaxToken): VoidExpressionSyntax { - return new syntaxFactory.VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new VoidExpressionSyntax(contextFlags, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseFunctionExpression(functionKeyword: ISyntaxToken): FunctionExpressionSyntax { - return new syntaxFactory.FunctionExpressionSyntax(parseNodeData, - consumeToken(functionKeyword), eatOptionalIdentifierToken(), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false), - parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ true)); + return parseFunctionExpressionWorker(consumeToken(functionKeyword), tryEatToken(SyntaxKind.AsteriskToken)); + } + + function parseFunctionExpressionWorker(functionKeyword: ISyntaxToken, asteriskToken: ISyntaxToken) { + // GeneratorExpression : + // function * BindingIdentifier[Yield]opt (FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } + // FunctionExpression: + // function BindingIdentifieropt(FormalParameters) { FunctionBody } + + var isGenerator = asteriskToken !== undefined; + return new FunctionExpressionSyntax(contextFlags, + functionKeyword, + asteriskToken, + asteriskToken ? enterYieldContextAnd(eatOptionalIdentifierToken) : eatOptionalIdentifierToken(), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ isGenerator), + parseFunctionBody(isGenerator)); } function parseObjectCreationExpression(newKeyword: ISyntaxToken): ObjectCreationExpressionSyntax { @@ -2962,24 +3036,68 @@ module TypeScript.Parser { // See comment in tryParseMemberExpressionOrHigher for a more complete explanation of // this decision. - return new syntaxFactory.ObjectCreationExpressionSyntax(parseNodeData, - consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), /*force:*/ true, /*inObjectCreation:*/ true), tryParseArgumentList()); + return new ObjectCreationExpressionSyntax(contextFlags, + consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), /*force:*/ true), tryParseArgumentList()); + } + + function parseTemplateExpression(startToken: ISyntaxToken): IPrimaryExpressionSyntax { + startToken = consumeToken(startToken); + + if (startToken.kind === SyntaxKind.NoSubstitutionTemplateToken) { + return startToken; + } + + var templateClauses: TemplateClauseSyntax[] = []; + + do { + // Keep consuming template spans as long as the last one we keep getting template + // middle pieces. + templateClauses.push(parseTemplateClause()); + } + while (templateClauses[templateClauses.length - 1].templateMiddleOrEndToken.kind === SyntaxKind.TemplateMiddleToken); + + return new TemplateExpressionSyntax(contextFlags, startToken, Syntax.list(templateClauses)); + } + + function parseTemplateClause(): TemplateClauseSyntax { + // TemplateLiteral[Yield] : See 12.2.8 + // NoSubstitutionTemplate + // TemplateHead Expression[In, ?Yield] + // [Lexical goal InputElementTemplateTail] TemplateSpans[?Yield] + + var expression = allowInAnd(parseExpression); + var token = currentToken(); + + if (token.kind === SyntaxKind.CloseBraceToken) { + token = currentContextualToken(); + Debug.assert(token.kind === SyntaxKind.TemplateMiddleToken || token.kind === SyntaxKind.TemplateEndToken); + token = consumeToken(token); + } + else { + token = createMissingToken(SyntaxKind.TemplateEndToken, undefined, DiagnosticCode._0_expected, ["{"]); + } + + return new TemplateClauseSyntax(contextFlags, expression, token); } function parseCastExpression(lessThanToken: ISyntaxToken): CastExpressionSyntax { - return new syntaxFactory.CastExpressionSyntax(parseNodeData, + return new CastExpressionSyntax(contextFlags, consumeToken(lessThanToken), parseType(), eatToken(SyntaxKind.GreaterThanToken), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseParenthesizedExpression(openParenToken: ISyntaxToken): ParenthesizedExpressionSyntax { - return new syntaxFactory.ParenthesizedExpressionSyntax(parseNodeData, - consumeToken(openParenToken), parseExpression(/*allowIn:*/ true), eatToken(SyntaxKind.CloseParenToken)); + // ( Expression[In, ?Yield] ) + + return new ParenthesizedExpressionSyntax(contextFlags, + consumeToken(openParenToken), + allowInAnd(parseExpression), + eatToken(SyntaxKind.CloseParenToken)); } function tryParseParenthesizedArrowFunctionExpression(): ParenthesizedArrowFunctionExpressionSyntax { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind !== SyntaxKind.OpenParenToken && tokenKind !== SyntaxKind.LessThanToken) { - return null; + return undefined; } // Because arrow functions and parenthesized expressions look similar, we have to check far @@ -3000,14 +3118,14 @@ module TypeScript.Parser { // Now, look for cases where we're sure it's not an arrow function. This will help save us // a costly parse. if (!isPossiblyArrowFunctionExpression()) { - return null; + return undefined; } // Then, try to actually parse it as a arrow function, and only return if we see an => var rewindPoint = getRewindPoint(); var arrowFunction = tryParseParenthesizedArrowFunctionExpressionWorker(/*requiresArrow:*/ true); - if (arrowFunction === null) { + if (arrowFunction === undefined) { rewind(rewindPoint); } @@ -3017,95 +3135,102 @@ module TypeScript.Parser { function tryParseParenthesizedArrowFunctionExpressionWorker(requireArrow: boolean): ParenthesizedArrowFunctionExpressionSyntax { var _currentToken = currentToken(); - // Debug.assert(currentToken.kind() === SyntaxKind.OpenParenToken || currentToken.kind() === SyntaxKind.LessThanToken); + // Debug.assert(currentToken.kind === SyntaxKind.OpenParenToken || currentToken.kind === SyntaxKind.LessThanToken); - var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ true); + // From the static semantic section: + // 1.If the [Yield] grammar parameter is present for CoverParenthesizedExpressionAndArrowParameterList[Yield] + // return the result of parsing the lexical token stream matched by CoverParenthesizedExpressionAndArrowParameterList[Yield] + // using ArrowFormalParameters[Yield, GeneratorParameter] as the goal symbol. + // 2.If the [Yield] grammar parameter is not present for CoverParenthesizedExpressionAndArrowParameterList[Yield] + // return the result of parsing the lexical token stream matched by CoverParenthesizedExpressionAndArrowParameterList + // using ArrowFormalParameters as the goal symbol. + var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ true, /*yieldAndGeneratorParameterContext:*/ inYieldContext()); - if (requireArrow && currentToken().kind() !== SyntaxKind.EqualsGreaterThanToken) { - return null; + if (requireArrow && currentToken().kind !== SyntaxKind.EqualsGreaterThanToken) { + return undefined; } - var equalsGreaterThanToken = eatToken(SyntaxKind.EqualsGreaterThanToken); - - var block = tryParseArrowFunctionBlock(); - var expression: IExpressionSyntax = null; - if (block === null) { - expression = tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true); - } - - return new syntaxFactory.ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, callSignature, equalsGreaterThanToken, block, expression); + return new ParenthesizedArrowFunctionExpressionSyntax(contextFlags, + callSignature, + eatToken(SyntaxKind.EqualsGreaterThanToken), + parseArrowFunctionBody()); } - function tryParseArrowFunctionBlock(): BlockSyntax { - if (isBlock()) { - return parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ false); + function parseArrowFunctionBody(): BlockSyntax | IExpressionSyntax { + // ConciseBody[In] : + // [lookahead not in {] AssignmentExpression[?In] + // { FunctionBody } + + if (currentToken().kind === SyntaxKind.OpenBraceToken) { + return parseFunctionBlock(/*allowYield:*/ false, /*equalsGreaterThanToken:*/ undefined); } - else { - // We didn't have a block. However, we may be in an error situation. For example, - // if the user wrote: - // - // a => - // var v = 0; - // } - // - // (i.e. they're missing the open brace). See if that's the case so we can try to - // recover better. If we don't do this, then the next close curly we see may end - // up preemptively closing the containing construct. - var _modifierCount = modifierCount(); - if (isStatement(_modifierCount, /*inErrorRecovery:*/ false) && - !isExpressionStatement(currentToken()) && - !isFunctionDeclaration(_modifierCount)) { - // We've seen a statement (and it isn't an expressionStatement like 'foo()'), - // so treat this like a block with a missing open brace. - return parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ true, /*checkForStrictMode:*/ false); - } - else { - return null; - } + + // We didn't have a block. However, we may be in an error situation. For example, + // if the user wrote: + // + // a => + // var v = 0; + // } + // + // (i.e. they're missing the open brace). See if that's the case so we can try to + // recover better. If we don't do this, then the next close curly we see may end + // up preemptively closing the containing construct. + var _modifierCount = modifierCount(); + if (isStatement(_modifierCount, /*inErrorRecovery:*/ false) && + !isExpression(currentToken())) { + // We've seen a statement (and it isn't an expressionStatement like 'foo()'), so + // treat this like a block with a missing open brace. + + return new BlockSyntax(contextFlags, + /*equalsGreaterThanToken*/ undefined, + eatToken(SyntaxKind.OpenBraceToken), + parseFunctionBlockStatements(), + eatToken(SyntaxKind.CloseBraceToken)); } + + return parseAssignmentExpressionOrHigher(); } function isSimpleArrowFunctionExpression(_currentToken: ISyntaxToken): boolean { // ERROR RECOVERY TWEAK: // If we see a standalone => try to parse it as an arrow function as that's likely what // the user intended to write. - if (_currentToken.kind() === SyntaxKind.EqualsGreaterThanToken) { + if (_currentToken.kind === SyntaxKind.EqualsGreaterThanToken) { return true; } return isIdentifier(_currentToken) && - peekToken(1).kind() === SyntaxKind.EqualsGreaterThanToken; + peekToken(1).kind === SyntaxKind.EqualsGreaterThanToken; } function parseSimpleArrowFunctionExpression(): SimpleArrowFunctionExpressionSyntax { // Debug.assert(isSimpleArrowFunctionExpression()); - - var parameter = eatSimpleParameter(); - var equalsGreaterThanToken = eatToken(SyntaxKind.EqualsGreaterThanToken); - - var block = tryParseArrowFunctionBlock(); - var expression: IExpressionSyntax = null; - if (block === null) { - expression = tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true); - } - - return new syntaxFactory.SimpleArrowFunctionExpressionSyntax(parseNodeData, parameter, equalsGreaterThanToken, block, expression); + return new SimpleArrowFunctionExpressionSyntax(contextFlags, + eatSimpleParameter(), + eatToken(SyntaxKind.EqualsGreaterThanToken), + parseArrowFunctionBody()); } - function isBlock(): boolean { - return currentToken().kind() === SyntaxKind.OpenBraceToken; + function isFunctionBlock(): boolean { + var currentTokenKind = currentToken().kind; + return currentTokenKind === SyntaxKind.OpenBraceToken || currentTokenKind === SyntaxKind.EqualsGreaterThanToken; + } + + function isBlockOrArrow(): boolean { + var _currentToken = currentToken(); + return _currentToken.kind === SyntaxKind.OpenBraceToken || _currentToken.kind === SyntaxKind.EqualsGreaterThanToken; } function isDefinitelyArrowFunctionExpression(): boolean { var token0 = currentToken(); - if (token0.kind() !== SyntaxKind.OpenParenToken) { + if (token0.kind !== SyntaxKind.OpenParenToken) { // If it didn't start with an (, then it could be generic. That's too complicated // and we can't say it's 'definitely' an arrow function. return false; } var token1 = peekToken(1); - var token1Kind = token1.kind(); + var token1Kind = token1.kind; var token2: ISyntaxToken; @@ -3118,7 +3243,7 @@ module TypeScript.Parser { // "():" or "() =>" or "() {}". Note: the last one is illegal. However it // most likely is a missing => and not a parenthesized expression. token2 = peekToken(2); - var token2Kind = token2.kind(); + var token2Kind = token2.kind; return token2Kind === SyntaxKind.ColonToken || token2Kind === SyntaxKind.EqualsGreaterThanToken || token2Kind === SyntaxKind.OpenBraceToken; @@ -3131,9 +3256,9 @@ module TypeScript.Parser { } token2 = peekToken(2); - token2Kind = token2.kind(); + token2Kind = token2.kind; - if (token1Kind === SyntaxKind.PublicKeyword || token1Kind === SyntaxKind.PrivateKeyword) { + if (SyntaxFacts.isAccessibilityModifier(token1Kind)) { if (isIdentifier(token2)) { // "(public id" or "(function id". Definitely an arrow function. Could never // be a parenthesized expression. Note: this will be an *illegal* arrow @@ -3160,7 +3285,7 @@ module TypeScript.Parser { } var token3 = peekToken(3); - var token3Kind = token3.kind(); + var token3Kind = token3.kind; if (token2Kind === SyntaxKind.QuestionToken) { // (id? // Could be an arrow function, or a parenthesized conditional expression. @@ -3203,7 +3328,7 @@ module TypeScript.Parser { function isPossiblyArrowFunctionExpression(): boolean { var token0 = currentToken(); - if (token0.kind() !== SyntaxKind.OpenParenToken) { + if (token0.kind !== SyntaxKind.OpenParenToken) { // If it didn't start with an (, then it could be generic. That's too complicated // and we have to say it's possibly an arrow function. return true; @@ -3218,7 +3343,7 @@ module TypeScript.Parser { } var token2 = peekToken(2); - var token2Kind = token2.kind(); + var token2Kind = token2.kind; if (token2Kind === SyntaxKind.EqualsToken) { // (id = // @@ -3241,7 +3366,7 @@ module TypeScript.Parser { // (id) var token3 = peekToken(3); - if (token3.kind() === SyntaxKind.ColonToken) { + if (token3.kind === SyntaxKind.ColonToken) { // (id): // // This could be an arrow function. i.e. (id): number => { } @@ -3256,69 +3381,95 @@ module TypeScript.Parser { } function parseObjectLiteralExpression(openBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.OpenBraceToken); - - consumeToken(openBraceToken); - // Debug.assert(openBraceToken.fullWidth() > 0); - - var skippedTokens: ISyntaxToken[] = getArray(); - var propertyAssignments = parseSeparatedSyntaxList(ListParsingState.ObjectLiteralExpression_PropertyAssignments, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - - return new syntaxFactory.ObjectLiteralExpressionSyntax(parseNodeData, openBraceToken, propertyAssignments, eatToken(SyntaxKind.CloseBraceToken)); + // Debug.assert(currentToken().kind === SyntaxKind.OpenBraceToken); + return new ObjectLiteralExpressionSyntax(contextFlags, + consumeToken(openBraceToken), + parseSeparatedSyntaxList(ListParsingState.ObjectLiteralExpression_PropertyAssignments), + eatToken(SyntaxKind.CloseBraceToken)); } function tryParsePropertyAssignment(inErrorRecovery: boolean): IPropertyAssignmentSyntax { // Debug.assert(isPropertyAssignment(/*inErrorRecovery:*/ false)); if (isAccessor(modifierCount(), inErrorRecovery)) { - return parseAccessor(/*checkForStrictMode:*/ true); + return parseAccessor(); } - else if (isFunctionPropertyAssignment(inErrorRecovery)) { - return parseFunctionPropertyAssignment(); + + // Note: we don't want to call parsePropertyName here yet as it will convert a keyword + // to an identifier name. We don't want to do that yet as a keyword is not legal as a + // shorthand property assignment. + + var _currentToken = currentToken(); + if (isIdentifier(_currentToken)) { + var token1 = peekToken(1); + if (token1.kind !== SyntaxKind.ColonToken && + token1.kind !== SyntaxKind.OpenParenToken && + token1.kind !== SyntaxKind.LessThanToken) { + + // If we don't have one of: + // + // id: + // id( + // id< + // + // then this is a shorthand property assignment. Just return the identifier + // token as is. + return consumeToken(_currentToken); + } } - else if (isSimplePropertyAssignment(inErrorRecovery)) { - return parseSimplePropertyAssignment(); - } - else { - return null; + + // All the rest of the property assignments start with property names or an asterix. + // They are: + // id: e + // [e1]: e2 + // id() { } + // [e]() { } + // *id() { } + // *[e]() { } + if (_currentToken.kind === SyntaxKind.AsteriskToken || isPropertyName(/*peekIndex:*/ 0, inErrorRecovery)) { + var asterixToken = tryEatToken(SyntaxKind.AsteriskToken); + var propertyName = parsePropertyName(); + + if (asterixToken !== undefined || isCallSignature(/*peekIndex:*/ 0)) { + return parseFunctionPropertyAssignment(asterixToken, propertyName); + } + else { + // PropertyName[?Yield] : AssignmentExpression[In, ?Yield] + + // If we didn't have an identifier, then we must have gotten a keyword or a + // literal. Neither of these are allowed in a shorthand property, so this must + // be a simple property assignment. + // + // Also, if we have an identifier and it is followed by a colon then this is + // definitely a simple property assignment. + return new SimplePropertyAssignmentSyntax(contextFlags, + propertyName, + eatToken(SyntaxKind.ColonToken), + allowInAnd(parseAssignmentExpressionOrHigher)); + } } + + return undefined; } function isPropertyAssignment(inErrorRecovery: boolean): boolean { return isAccessor(modifierCount(), inErrorRecovery) || - isFunctionPropertyAssignment(inErrorRecovery) || - isSimplePropertyAssignment(inErrorRecovery); + currentToken().kind === SyntaxKind.AsteriskToken || + isPropertyName(/*peekIndex:*/ 0, inErrorRecovery); } - function eatPropertyName(): ISyntaxToken { - var _currentToken = currentToken(); - return SyntaxFacts.isIdentifierNameOrAnyKeyword(_currentToken) - ? eatIdentifierNameToken() - : consumeToken(_currentToken); + function isPropertyName(peekIndex: number, inErrorRecovery: boolean): boolean { + var token = peekToken(peekIndex); + if (token.kind === SyntaxKind.OpenBracketToken) { + // A '[' only starts a property name as long as we're sure it doesn't start an + // index signature. + return !isIndexSignature(peekIndex); + } + + return isPropertyNameToken(token, inErrorRecovery); } - function isFunctionPropertyAssignment(inErrorRecovery: boolean): boolean { - return isPropertyName(currentToken(), inErrorRecovery) && - isCallSignature(/*peekIndex:*/ 1); - } - - function parseFunctionPropertyAssignment(): FunctionPropertyAssignmentSyntax { - return new syntaxFactory.FunctionPropertyAssignmentSyntax(parseNodeData, - eatPropertyName(), parseCallSignature(/*requireCompleteTypeParameterList:*/ false), - parseBlock(/*parseBlockEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ true)); - } - - function isSimplePropertyAssignment(inErrorRecovery: boolean): boolean { - return isPropertyName(currentToken(), inErrorRecovery); - } - - function parseSimplePropertyAssignment(): SimplePropertyAssignmentSyntax { - return new syntaxFactory.SimplePropertyAssignmentSyntax(parseNodeData, - eatPropertyName(), eatToken(SyntaxKind.ColonToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true)); - } - - function isPropertyName(token: ISyntaxToken, inErrorRecovery: boolean): boolean { + function isPropertyNameToken(token: ISyntaxToken, inErrorRecovery: boolean): boolean { // NOTE: we do *not* want to check "isIdentifier" here. Any IdentifierName is // allowed here, even reserved words like keywords. if (SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { @@ -3337,70 +3488,143 @@ module TypeScript.Parser { } } - var kind = token.kind(); - return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral; + return isLiteralPropertyName(token); + } + + function isLiteralPropertyName(token: ISyntaxToken): boolean { + // We allow a template literal while parser for error tolerance. We'll report errors + // on this later in the grammar checker walker. + var kind = token.kind; + return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral || kind === SyntaxKind.NoSubstitutionTemplateToken; + } + + function parsePropertyName(): IPropertyNameSyntax { + // PropertyName[Yield,GeneratorParameter] : See 12.2.5 + // LiteralPropertyName + // [+GeneratorParameter]ComputedPropertyName + // [~GeneratorParameter]ComputedPropertyName[?Yield] + + var _currentToken = currentToken(); + if (_currentToken.kind === SyntaxKind.OpenBracketToken) { + return inGeneratorParameterContext() + ? exitYieldContextAnd(parseComputedPropertyName) + : parseComputedPropertyName(); + } + else if (SyntaxFacts.isIdentifierNameOrAnyKeyword(_currentToken)) { + // If it was a keyword, convert it to an identifier name. + return eatIdentifierNameToken(); + } + else if (isLiteralPropertyName(_currentToken)) { + // Must have been a literal. + return consumeToken(_currentToken); + } + else { + return eatIdentifierToken(); + } + } + + function parseComputedPropertyName(): ComputedPropertyNameSyntax { + // ComputedPropertyName[Yield] : + // [AssignmentExpression[In, ?Yield]] + + return new ComputedPropertyNameSyntax(contextFlags, + eatToken(SyntaxKind.OpenBracketToken), + allowInAnd(parseAssignmentExpressionOrHigher), + eatToken(SyntaxKind.CloseBracketToken)); + } + + function parseFunctionPropertyAssignment(asteriskToken: ISyntaxToken, propertyName: IPropertyNameSyntax): FunctionPropertyAssignmentSyntax { + var isGenerator = asteriskToken !== undefined; + return new FunctionPropertyAssignmentSyntax(contextFlags, + asteriskToken, + propertyName, + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ isGenerator), + parseFunctionBody(isGenerator)); } function parseArrayLiteralExpression(openBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.OpenBracketToken); - consumeToken(openBracketToken); - // Debug.assert(openBracketToken.fullWidth() > 0); - - var skippedTokens: ISyntaxToken[] = getArray(); - var expressions = parseSeparatedSyntaxList(ListParsingState.ArrayLiteralExpression_AssignmentExpressions, skippedTokens); - openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - - return new syntaxFactory.ArrayLiteralExpressionSyntax(parseNodeData, openBracketToken, expressions, eatToken(SyntaxKind.CloseBracketToken)); + // Debug.assert(currentToken().kind === SyntaxKind.OpenBracketToken); + return new ArrayLiteralExpressionSyntax(contextFlags, + consumeToken(openBracketToken), + parseSeparatedSyntaxList(ListParsingState.ArrayLiteralExpression_AssignmentExpressions), + eatToken(SyntaxKind.CloseBracketToken)); } - function parseBlock(parseBlockEvenWithNoOpenBrace: boolean, checkForStrictMode: boolean): BlockSyntax { - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - var statements = Syntax.emptyList(); + function parseStatementBlock(): BlockSyntax { + // Different from function blocks in that we don't check for strict mode, nor do accept + // a block without an open curly. + var openBraceToken: ISyntaxToken; + return new BlockSyntax(contextFlags, + tryEatToken(SyntaxKind.EqualsGreaterThanToken), + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSyntaxList(ListParsingState.Block_Statements) : [], + eatToken(SyntaxKind.CloseBraceToken)); + } - if (parseBlockEvenWithNoOpenBrace || openBraceToken.fullWidth() > 0) { - var savedIsInStrictMode = isInStrictMode; - - var processItems = checkForStrictMode ? updateStrictModeState : null; - var skippedTokens: ISyntaxToken[] = getArray(); - var statements = parseSyntaxList(ListParsingState.Block_Statements, skippedTokens, processItems); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - - setStrictMode(savedIsInStrictMode); + function parseFunctionBlockOrExpressionBody(_allowYield: boolean): BlockSyntax | ExpressionBody { + // If we got an errant => then we want to parse what's coming up without requiring an + // open brace. We do this because it's not uncommon for people to get confused as to + // where/when they can use an => and we want to have good error recovery here. + var equalsGreaterThanToken = tryEatToken(SyntaxKind.EqualsGreaterThanToken); + if (equalsGreaterThanToken) { + // check if they wrote something like: => expr + // or if it was more like : => statement + if (isExpression(currentToken())) { + return new ExpressionBody(contextFlags, equalsGreaterThanToken, parseExpression()); + } } - return new syntaxFactory.BlockSyntax(parseNodeData, openBraceToken, statements, eatToken(SyntaxKind.CloseBraceToken)); + return parseFunctionBlock(_allowYield, equalsGreaterThanToken); } - function parseCallSignature(requireCompleteTypeParameterList: boolean): CallSignatureSyntax { - return new syntaxFactory.CallSignatureSyntax(parseNodeData, - tryParseTypeParameterList(requireCompleteTypeParameterList), parseParameterList(), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); + function parseFunctionBlock(_allowYield: boolean, equalsGreaterThanToken: ISyntaxToken): BlockSyntax { + var openBraceToken: ISyntaxToken; + return new BlockSyntax(contextFlags, + equalsGreaterThanToken, + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + equalsGreaterThanToken || openBraceToken.fullWidth() > 0 + ? _allowYield ? enterYieldContextAnd(parseFunctionBlockStatements) : exitYieldContextAnd(parseFunctionBlockStatements) + : [], + eatToken(SyntaxKind.CloseBraceToken)); + } + + function parseFunctionBlockStatements() { + var savedIsInStrictMode = inStrictModeContext(); + var statements = parseSyntaxList(ListParsingState.Block_Statements, updateStrictModeState); + setStrictModeContext(savedIsInStrictMode); + + return statements; + } + + function parseCallSignature(requireCompleteTypeParameterList: boolean, yieldAndGeneratorParameterContext: boolean): CallSignatureSyntax { + return new CallSignatureSyntax(contextFlags, + tryParseTypeParameterList(requireCompleteTypeParameterList), + parseParameterList(yieldAndGeneratorParameterContext), + parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); } function tryParseTypeParameterList(requireCompleteTypeParameterList: boolean): TypeParameterListSyntax { var _currentToken = currentToken(); - if (_currentToken.kind() !== SyntaxKind.LessThanToken) { - return null; + if (_currentToken.kind !== SyntaxKind.LessThanToken) { + return undefined; } var rewindPoint = getRewindPoint(); var lessThanToken = consumeToken(_currentToken); - - var skippedTokens: ISyntaxToken[] = getArray(); - var typeParameters = parseSeparatedSyntaxList(ListParsingState.TypeParameterList_TypeParameters, skippedTokens); - lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); + var typeParameters = parseSeparatedSyntaxList(ListParsingState.TypeParameterList_TypeParameters); var greaterThanToken = eatToken(SyntaxKind.GreaterThanToken); - // return null if we were required to have a '>' token and we did not have one. + // return undefined if we were required to have a '>' token and we did not have one. if (requireCompleteTypeParameterList && greaterThanToken.fullWidth() === 0) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { releaseRewindPoint(rewindPoint); - return new syntaxFactory.TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); + return new TypeParameterListSyntax(contextFlags, lessThanToken, typeParameters, greaterThanToken); } } @@ -3411,53 +3635,67 @@ module TypeScript.Parser { function tryParseTypeParameter(): TypeParameterSyntax { // Debug.assert(isTypeParameter()); if (!isIdentifier(currentToken())) { - return null; + return undefined; } - return new syntaxFactory.TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); + return new TypeParameterSyntax(contextFlags, eatIdentifierToken(), tryParseConstraint()); } function tryParseConstraint(): ConstraintSyntax { - if (currentToken().kind() !== SyntaxKind.ExtendsKeyword) { - return null; + if (currentToken().kind !== SyntaxKind.ExtendsKeyword) { + return undefined; } - return new syntaxFactory.ConstraintSyntax(parseNodeData, eatToken(SyntaxKind.ExtendsKeyword), parseTypeOrExpression()); + return new ConstraintSyntax(contextFlags, eatToken(SyntaxKind.ExtendsKeyword), parseTypeOrExpression()); } - function tryParseParameterList(): ParameterListSyntax { - if (currentToken().kind() === SyntaxKind.OpenParenToken) { - var token1 = peekToken(1); + // Note: after careful analysis of the grammar, it does not appear to be possible to + // have 'Yield' And 'GeneratorParameter' not in sync. i.e. any production calling + // this FormalParameters production either always sets both to true, or always sets + // both to false. As such we only have a single parameter to represent both. + function parseParameterList(yieldAndGeneratorParameterContext: boolean): ParameterListSyntax { + // FormalParameters[Yield,GeneratorParameter] : + // ... + // + // FormalParameter[Yield,GeneratorParameter] : + // BindingElement[?Yield, ?GeneratorParameter] + // + // BindingElement[Yield, GeneratorParameter ] : See 13.2.3 + // SingleNameBinding[?Yield, ?GeneratorParameter] + // [+GeneratorParameter]BindingPattern[?Yield, GeneratorParameter]Initializer[In]opt + // [~GeneratorParameter]BindingPattern[?Yield]Initializer[In, ?Yield]opt + // + // SingleNameBinding[Yield, GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt - if (token1.kind() === SyntaxKind.CloseParenToken || isParameterHelper(token1)) { - return parseParameterList(); - } - } - return null; - } + var savedYieldContext = inYieldContext(); + var savedGeneratorParameterContext = inGeneratorParameterContext(); - function parseParameterList(): ParameterListSyntax { - var openParenToken = eatToken(SyntaxKind.OpenParenToken); - var parameters = Syntax.emptySeparatedList(); + setYieldContext(yieldAndGeneratorParameterContext); + setGeneratorParameterContext(yieldAndGeneratorParameterContext); - if (openParenToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - parameters = parseSeparatedSyntaxList(ListParsingState.ParameterList_Parameters, skippedTokens); - openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); - } + var openParenToken: ISyntaxToken; + var result = new ParameterListSyntax(contextFlags, + openParenToken = eatToken(SyntaxKind.OpenParenToken), + openParenToken.fullWidth() > 0 ? parseSeparatedSyntaxList(ListParsingState.ParameterList_Parameters) : [], + eatToken(SyntaxKind.CloseParenToken)); - return new syntaxFactory.ParameterListSyntax(parseNodeData, openParenToken, parameters, eatToken(SyntaxKind.CloseParenToken)); + setYieldContext(savedYieldContext); + setGeneratorParameterContext(savedGeneratorParameterContext); + + return result; } function parseOptionalTypeAnnotation(allowStringLiteral: boolean): TypeAnnotationSyntax { - return currentToken().kind() === SyntaxKind.ColonToken ? parseTypeAnnotation(allowStringLiteral) : null; + return currentToken().kind === SyntaxKind.ColonToken ? parseTypeAnnotation(allowStringLiteral) : undefined; } function parseTypeAnnotationType(allowStringLiteral: boolean): ITypeSyntax { if (allowStringLiteral) { var _currentToken = currentToken(); - if (_currentToken.kind() === SyntaxKind.StringLiteral) { + if (_currentToken.kind === SyntaxKind.StringLiteral) { return consumeToken(_currentToken); } } @@ -3466,13 +3704,13 @@ module TypeScript.Parser { } function parseTypeAnnotation(allowStringLiteral: boolean): TypeAnnotationSyntax { - return new syntaxFactory.TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); + return new TypeAnnotationSyntax(contextFlags, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); } function isType(): boolean { var _currentToken = currentToken(); - switch (_currentToken.kind()) { + switch (_currentToken.kind) { case SyntaxKind.TypeOfKeyword: case SyntaxKind.AnyKeyword: case SyntaxKind.NumberKeyword: @@ -3516,6 +3754,52 @@ module TypeScript.Parser { } function tryParseType(): ITypeSyntax { + // The rules about 'yield' only apply to actual code/expression contexts. They don't + // apply to 'type' contexts. So we disable these parameters here before moving on. + var savedYieldContext = inYieldContext(); + var savedGeneratorParameterContext = inGeneratorParameterContext(); + + setYieldContext(false); + setGeneratorParameterContext(false); + + var result = tryParseTypeWorker(); + + setYieldContext(savedYieldContext); + setGeneratorParameterContext(savedGeneratorParameterContext); + + return result; + } + + function tryParseTypeWorker(): ITypeSyntax { + if (isFunctionType()) { + return parseFunctionType(); + } + + if (currentToken().kind === SyntaxKind.NewKeyword) { + return parseConstructorType(); + } + + return tryParseUnionTypeOrHigher(); + } + + function tryParseUnionTypeOrHigher(): ITypeSyntax { + var type = tryParsePrimaryType(); + + if (type) { + var barToken: ISyntaxToken; + while ((barToken = currentToken()).kind === SyntaxKind.BarToken) { + type = new UnionTypeSyntax(contextFlags, type, consumeToken(barToken), parsePrimaryType()); + } + } + + return type; + } + + function parsePrimaryType(): ITypeSyntax { + return tryParsePrimaryType() || eatIdentifierToken(DiagnosticCode.Type_expected); + } + + function tryParsePrimaryType(): ITypeSyntax { // First consume any underlying element type. var type = tryParseNonArrayType(); @@ -3527,91 +3811,152 @@ module TypeScript.Parser { while (type) { var _currentToken = currentToken(); - if (previousTokenHasTrailingNewLine(_currentToken) || - _currentToken.kind() !== SyntaxKind.OpenBracketToken) { + if (isOnDifferentLineThanPreviousToken(_currentToken) || + _currentToken.kind !== SyntaxKind.OpenBracketToken) { break; } - type = new syntaxFactory.ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(SyntaxKind.CloseBracketToken)); + type = new ArrayTypeSyntax(contextFlags, type, consumeToken(_currentToken), eatToken(SyntaxKind.CloseBracketToken)); } return type; } function parseTypeQuery(typeOfKeyword: ISyntaxToken): TypeQuerySyntax { - return new syntaxFactory.TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(/*allowIdentifierNames:*/ true)); + return new TypeQuerySyntax(contextFlags, consumeToken(typeOfKeyword), parseName(/*allowIdentifierNames:*/ true)); } function tryParseNonArrayType(): ITypeSyntax { var _currentToken = currentToken(); - switch (_currentToken.kind()) { + switch (_currentToken.kind) { case SyntaxKind.AnyKeyword: case SyntaxKind.NumberKeyword: case SyntaxKind.BooleanKeyword: case SyntaxKind.StringKeyword: // if any of these are followed by '.', then this is actually a module name, // and these keywords will be reinterpreted as an identifier. - if (peekToken(1).kind() === SyntaxKind.DotToken) { + if (peekToken(1).kind === SyntaxKind.DotToken) { break; } return consumeToken(_currentToken); - case SyntaxKind.OpenParenToken: - case SyntaxKind.LessThanToken: return tryParseFunctionType(); - case SyntaxKind.VoidKeyword: return consumeToken(_currentToken); - case SyntaxKind.OpenBraceToken: return parseObjectType(); - case SyntaxKind.NewKeyword: return parseConstructorType(); - case SyntaxKind.TypeOfKeyword: return parseTypeQuery(_currentToken); + case SyntaxKind.VoidKeyword: return consumeToken(_currentToken); + case SyntaxKind.OpenParenToken: return parseParenthesizedType(_currentToken); + case SyntaxKind.OpenBraceToken: return parseObjectType(); + case SyntaxKind.TypeOfKeyword: return parseTypeQuery(_currentToken); + case SyntaxKind.OpenBracketToken: return parseTupleType(_currentToken); } return tryParseNameOrGenericType(); } + function parseParenthesizedType(openParenToken: ISyntaxToken): ParenthesizedTypeSyntax { + return new ParenthesizedTypeSyntax(contextFlags, consumeToken(openParenToken), parseType(), eatToken(SyntaxKind.CloseParenToken)); + } + function tryParseNameOrGenericType(): ITypeSyntax { var name = tryParseName(/*allowIdentifierNames*/ false); - if (name === null) { - return null; + if (name === undefined) { + return undefined; } // TypeReference: // TypeName [no LineTerminator here] TypeArgumentsopt // // Only consume type arguments if they appear on the same line. - if (previousTokenHasTrailingNewLine(currentToken())) { + if (isOnDifferentLineThanPreviousToken(currentToken())) { return name; } var typeArgumentList = tryParseTypeArgumentList(/*inExpression:*/ false); - return typeArgumentList === null + return !typeArgumentList ? name - : new syntaxFactory.GenericTypeSyntax(parseNodeData, name, typeArgumentList); + : new GenericTypeSyntax(contextFlags, name, typeArgumentList); } - function tryParseFunctionType(): FunctionTypeSyntax { - var typeParameterList = tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false); - var parameterList: ParameterListSyntax = null; - if (typeParameterList === null) { - parameterList = tryParseParameterList(); - if (parameterList === null) { - return null; - } - } - else { - parameterList = parseParameterList(); + function isFunctionType(): boolean { + var token0 = currentToken(); + var token0Kind = token0.kind; + + // If we see a < then we consider ourselves to be definitely in a (generic) function type. + if (token0Kind === SyntaxKind.LessThanToken) { + return true; } - return new syntaxFactory.FunctionTypeSyntax(parseNodeData, - typeParameterList, parameterList, eatToken(SyntaxKind.EqualsGreaterThanToken), parseType()); + // If we don't see a < then we have to see an open paren for this to be a function + // type. However, an open paren may also start a parenthesized type. So we need to + // do some lookahead to see what we've actually got. If we don't see enough to be + // sure that it's a function type, then we go ahead with the assumption that it's a + // parenthesized type. + if (token0Kind === SyntaxKind.OpenParenToken) { + var token1 = peekToken(1); + var token1Kind = token1.kind; + + if (token1Kind === SyntaxKind.CloseParenToken || token1Kind === SyntaxKind.DotDotDotToken) { + // () + // (... + // + // Both are definitely function types, and could not be paren types. + return true; + } + + if (isModifierKind(token1Kind) || isIdentifier(token1)) { + // (id + // could be a function type or a parenthesized type. + + var token2 = peekToken(2); + var token2Kind = token2.kind; + + if (token2Kind === SyntaxKind.ColonToken || + token2Kind === SyntaxKind.CommaToken || + token2Kind === SyntaxKind.QuestionToken || + token2Kind === SyntaxKind.EqualsToken || + isIdentifier(token2) || + isModifierKind(token2Kind)) { + // ( id : + // ( id , + // ( id ? + // ( id = + // ( modifier id + // + // All of these are definitely a function type and not a parenthesized type. + return true; + } + + if (token2Kind === SyntaxKind.CloseParenToken) { + // ( id ) + // + // Only a function type if we see an arrow following it. + return peekToken(3).kind === SyntaxKind.EqualsGreaterThanToken; + } + } + } + + // Anything else is a parenthesized type. + return false; + } + + function parseFunctionType(): FunctionTypeSyntax { + // Function types only exist in the type space and not the expression space. So they + // aren't in the [Yield] or [GeneratorParameter] context. + return new FunctionTypeSyntax(contextFlags, + tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), + parseParameterList(/*yieldAndGeneratorParameterContext:*/ false), + eatToken(SyntaxKind.EqualsGreaterThanToken), parseType()); } function parseConstructorType(): ConstructorTypeSyntax { - return new syntaxFactory.ConstructorTypeSyntax(parseNodeData, - eatToken(SyntaxKind.NewKeyword), tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), - parseParameterList(), eatToken(SyntaxKind.EqualsGreaterThanToken), parseType()); + // Constructor types only exist in the type space and not the expression space. So they + // aren't in the [Yield] or [GeneratorParameter] context. + return new ConstructorTypeSyntax(contextFlags, + eatToken(SyntaxKind.NewKeyword), + tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), + parseParameterList(/*yieldAndGeneratorParameterContext:*/ false), + eatToken(SyntaxKind.EqualsGreaterThanToken), parseType()); } function isParameter(): boolean { - if (currentNode() !== null && currentNode().kind() === SyntaxKind.Parameter) { + if (currentNode() && currentNode().kind === SyntaxKind.Parameter) { return true; } @@ -3619,21 +3964,21 @@ module TypeScript.Parser { } function isParameterHelper(token: ISyntaxToken): boolean { - var tokenKind = token.kind(); + var tokenKind = token.kind; return tokenKind === SyntaxKind.DotDotDotToken || isModifierKind(tokenKind) || isIdentifier(token); } function eatSimpleParameter() { - return new syntaxFactory.ParameterSyntax(parseNodeData, - /*dotDotDotToken:*/ null, /*modifiers:*/ Syntax.emptyList(), eatIdentifierToken(), - /*questionToken:*/ null, /*typeAnnotation:*/ null, /*equalsValueClause:*/ null); + return new ParameterSyntax(contextFlags, + /*dotDotDotToken:*/ undefined, /*modifiers:*/ [], eatIdentifierToken(), + /*questionToken:*/ undefined, /*typeAnnotation:*/ undefined, /*equalsValueClause:*/ undefined); } function tryParseParameter(): ParameterSyntax { var node = currentNode(); - if (node !== null && node.kind() === SyntaxKind.Parameter) { + if (node && node.kind === SyntaxKind.Parameter) { consumeNode(node); return node; } @@ -3644,48 +3989,56 @@ module TypeScript.Parser { // If we're not forcing, and we don't see anything to indicate this is a parameter, then // bail out. var _currentToken = currentToken(); - if (!isIdentifier(_currentToken) && dotDotDotToken === null && modifiers.length === 0) { + if (!isIdentifier(_currentToken) && !dotDotDotToken && modifiers.length === 0) { // ERROR RECOVERY: // If we see a modifier alone in a parameter list, like: foo(static) // // then treat it like modifier, and continue parsing the parameter. - if (isModifierKind(_currentToken.kind())) { + if (isModifierKind(_currentToken.kind)) { modifiers = Syntax.list([consumeToken(_currentToken)]); } else { - return null; + return undefined; } } - var identifier = eatIdentifierToken(); + // SingleNameBinding[Yield,GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + + var identifier = inGeneratorParameterContext() + ? enterYieldContextAnd(eatIdentifierToken) + : eatIdentifierToken(); + var questionToken = tryEatToken(SyntaxKind.QuestionToken); var typeAnnotation = parseOptionalTypeAnnotation(/*allowStringLiteral:*/ true); - var equalsValueClause: EqualsValueClauseSyntax = null; + var equalsValueClause: EqualsValueClauseSyntax = undefined; if (isEqualsValueClause(/*inParameter*/ true)) { - equalsValueClause = parseEqualsValueClause(/*allowIn:*/ true); + equalsValueClause = inGeneratorParameterContext() + ? exitYieldContextAnd(parseEqualsValueClause) + : parseEqualsValueClause(); } - return new syntaxFactory.ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); + return new ParameterSyntax(contextFlags, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); } - function parseSyntaxList( - currentListType: ListParsingState, skippedTokens: ISyntaxToken[], processItems: (items: any[]) => void = null): T[] { + function parseSyntaxList(currentListType: ListParsingState, processItems?: (items: any[]) => void): T[] { var savedListParsingState = listParsingState; listParsingState |= (1 << currentListType); - var result = parseSyntaxListWorker(currentListType, skippedTokens, processItems); + var result = parseSyntaxListWorker(currentListType, processItems); listParsingState = savedListParsingState; return result; } - function parseSeparatedSyntaxList(currentListType: ListParsingState, skippedTokens: ISyntaxToken[]): T[] { + function parseSeparatedSyntaxList(currentListType: ListParsingState): ISeparatedSyntaxList { var savedListParsingState = listParsingState; listParsingState |= (1 << currentListType); - var result = parseSeparatedSyntaxListWorker(currentListType, skippedTokens); + var result = parseSeparatedSyntaxListWorker(currentListType); listParsingState = savedListParsingState; @@ -3693,8 +4046,7 @@ module TypeScript.Parser { } // Returns true if we should abort parsing. - function abortParsingListOrMoveToNextToken( - currentListType: ListParsingState, nodes: T[], separators: ISyntaxToken[], skippedTokens: ISyntaxToken[]): boolean { + function abortParsingListOrMoveToNextToken(currentListType: ListParsingState): boolean { // Ok. We're at a token that is not a terminator for the list and wasn't the start of // an item in the list. Definitely report an error for this token. reportUnexpectedTokenDiagnostic(currentListType); @@ -3714,72 +4066,45 @@ module TypeScript.Parser { // Otherwise, if none of the lists we're in can capture this token, then we need to // unilaterally skip it. Note: we've already reported an error above. - addSkippedTokenToList(nodes, separators, skippedTokens, consumeToken(currentToken())); - + skipToken(currentToken()); + // Continue parsing this list. Attach this token to whatever we've seen already. return false; } - - function addSkippedTokenToList( - nodes: T[], separators: ISyntaxToken[], skippedTokens: ISyntaxToken[], skippedToken: ISyntaxToken): void { - // Now, add this skipped token to the last item we successfully parsed in the list. Or - // add it to the list of skipped tokens if we haven't parsed anything. Our caller will - // have to deal with them. - // - // Note: we only bother doing this if we're creating a concrete syntax tree. - if (syntaxFactory.isConcrete) { - var length = nodes.length + (separators ? separators.length : 0); - for (var i = length - 1; i >= 0; i--) { - var array: ISyntaxNodeOrToken[] = separators && (i % 2 === 1) ? separators : nodes; - var arrayIndex = separators ? IntegerUtilities.integerDivide(i, 2) : i; + function tryParseExpectedListItem( + currentListType: ListParsingState, + inErrorRecovery: boolean, + items: T[], + processItems: (items: ISyntaxNodeOrToken[]) => void): void { + var item = tryParseExpectedListItemWorker(currentListType, inErrorRecovery); - var item = array[arrayIndex]; - var _lastToken = lastToken(item); - if (_lastToken && _lastToken.fullWidth() > 0) { - array[arrayIndex] = addSkippedTokenAfterNodeOrToken(item, skippedToken); - return; - } + if (item !== undefined) { + // Debug.assert(item !== undefined); + + items.push(item); + + if (processItems) { + processItems(items); } - - // Didn't have anything in the list we could add to. Add to the skipped items array - // for our caller to handle. - skippedTokens.push(skippedToken); } } - function tryParseExpectedListItem( - currentListType: ListParsingState, inErrorRecovery: boolean, items: ISyntaxElement[], processItems: (items: any[]) => void): boolean { - var item = tryParseExpectedListItemWorker(currentListType, inErrorRecovery); - - if (item === null) { - return false; - } - // Debug.assert(item !== null); - - items.push(item); - - if (processItems !== null) { - processItems(items); - } - - return true; - } - function listIsTerminated(currentListType: ListParsingState): boolean { return isExpectedListTerminator(currentListType) || - currentToken().kind() === SyntaxKind.EndOfFileToken; + currentToken().kind === SyntaxKind.EndOfFileToken; } - function parseSyntaxListWorker(currentListType: ListParsingState, skippedTokens: ISyntaxToken[], processItems: (items: any[]) => void ): T[] { - var items: T[] = getArray(); + function parseSyntaxListWorker(currentListType: ListParsingState, processItems: (items: ISyntaxNodeOrToken[]) => void ): T[] { + var items: T[] = []; while (true) { // Try to parse an item of the list. If we fail then decide if we need to abort or // continue parsing. - var succeeded = tryParseExpectedListItem(currentListType, /*inErrorRecovery:*/ false, items, processItems); + var oldItemsLength = items.length; + tryParseExpectedListItem(currentListType, /*inErrorRecovery:*/ false, items, processItems); - if (!succeeded) { + if (items.length === oldItemsLength) { // We weren't able to parse out a list element. // That may have been because the list is complete. In that case, break out @@ -3790,7 +4115,7 @@ module TypeScript.Parser { // List wasn't complete and we didn't get an item. Figure out if we should bail out // or skip a token and continue. - var abort = abortParsingListOrMoveToNextToken(currentListType, items, null, skippedTokens); + var abort = abortParsingListOrMoveToNextToken(currentListType); if (abort) { break; } @@ -3800,18 +4125,11 @@ module TypeScript.Parser { // and didn't want to abort. Continue parsing elements. } - var result = Syntax.list(items); - - // Can't return if it has more then 1 element. In that case, the list will have been - // copied into the SyntaxList. - returnZeroLengthArray(items); - - return result; + return Syntax.list(items); } - function parseSeparatedSyntaxListWorker(currentListType: ListParsingState, skippedTokens: ISyntaxToken[]): T[] { - var nodes: T[] = getArray(); - var separators: ISyntaxToken[] = getArray(); + function parseSeparatedSyntaxListWorker(currentListType: ListParsingState): ISeparatedSyntaxList { + var nodesAndSeparators: ISyntaxNodeOrToken[] = []; // Debug.assert(nodes.length === 0); // Debug.assert(separators.length === 0); @@ -3829,11 +4147,12 @@ module TypeScript.Parser { // continue parsing. // Debug.assert(oldItemsCount % 2 === 0); - var succeeded = tryParseExpectedListItem(currentListType, inErrorRecovery, nodes, null); + var oldArrayLength = nodesAndSeparators.length; + tryParseExpectedListItem(currentListType, inErrorRecovery, nodesAndSeparators, /*processItems:*/ undefined); - if (!succeeded) { + if (nodesAndSeparators.length === oldArrayLength) { // We weren't able to parse out a list element. - // Debug.assert(items === null || items.length % 2 === 0); + // Debug.assert(items === undefined || items.length % 2 === 0); // That may have been because the list is complete. In that case, break out // and return the items we were able parse. @@ -3843,7 +4162,7 @@ module TypeScript.Parser { // List wasn't complete and we didn't get an item. Figure out if we should bail out // or skip a token and continue. - var abort = abortParsingListOrMoveToNextToken(currentListType, nodes, separators, skippedTokens); + var abort = abortParsingListOrMoveToNextToken(currentListType); if (abort) { break; } @@ -3865,10 +4184,10 @@ module TypeScript.Parser { // allow 'comma' as a separator (for error tolerance). We will later do a post pass // to report when a comma was used improperly in a list that needed semicolons. var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); + var tokenKind = _currentToken.kind; if (tokenKind === _separatorKind || tokenKind === SyntaxKind.CommaToken) { // Consume the last separator and continue parsing list elements. - separators.push(consumeToken(_currentToken)); + nodesAndSeparators.push(consumeToken(_currentToken)); continue; } @@ -3895,8 +4214,8 @@ module TypeScript.Parser { // consume the '}' just fine. So ASI doesn't apply. if (allowAutomaticSemicolonInsertion && canEatAutomaticSemicolon(/*allowWithoutNewline:*/ false)) { - var semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) || Syntax.emptyToken(SyntaxKind.SemicolonToken); - separators.push(semicolonToken); + var semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) || createEmptyToken(SyntaxKind.SemicolonToken); + nodesAndSeparators.push(semicolonToken); // Debug.assert(items.length % 2 === 0); continue; } @@ -3906,7 +4225,7 @@ module TypeScript.Parser { // This time mark that we're in error recovery mode though. // // Note: trying to eat this token will emit the appropriate diagnostic. - separators.push(eatToken(_separatorKind)); + nodesAndSeparators.push(eatToken(_separatorKind)); // Now that we're in 'error recovery' mode we cantweak some parsing rules as // appropriate. For example, if we have: @@ -3922,14 +4241,7 @@ module TypeScript.Parser { inErrorRecovery = true; } - var result = Syntax.separatedList(nodes, separators); - - // Can't return if it has more then 0 elements. In that case, the list will have been - // copied into the SyntaxList. - returnZeroLengthArray(nodes); - returnZeroLengthArray(separators); - - return result; + return Syntax.separatedList(nodesAndSeparators); } function reportUnexpectedTokenDiagnostic(listType: ListParsingState): void { @@ -3964,8 +4276,7 @@ module TypeScript.Parser { case ListParsingState.ObjectType_TypeMembers: return isExpectedObjectType_TypeMembersTerminator(); case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(); case ListParsingState.HeritageClause_TypeNameList: return isExpectedHeritageClause_TypeNameListTerminator(); - case ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn: return isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(); - case ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn: return isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(); + case ListParsingState.VariableDeclaration_VariableDeclarators: return isExpectedVariableDeclaration_VariableDeclaratorsTerminator(); case ListParsingState.ArgumentList_AssignmentExpressions: return isExpectedArgumentList_AssignmentExpressionsTerminator(); case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(); case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return isExpectedLiteralExpression_AssignmentExpressionsTerminator(); @@ -3973,38 +4284,39 @@ module TypeScript.Parser { case ListParsingState.IndexSignature_Parameters: return isExpectedIndexSignature_ParametersTerminator(); case ListParsingState.TypeArgumentList_Types: return isExpectedTypeArgumentList_TypesTerminator(); case ListParsingState.TypeParameterList_TypeParameters: return isExpectedTypeParameterList_TypeParametersTerminator(); + case ListParsingState.TupleType_Types: return isExpectedTupleType_TypesTerminator(); default: throw Errors.invalidOperation(); } } function isExpectedSourceUnit_ModuleElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.EndOfFileToken; + return currentToken().kind === SyntaxKind.EndOfFileToken; } function isExpectedEnumDeclaration_EnumElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedModuleDeclaration_ModuleElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedObjectType_TypeMembersTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedLiteralExpression_AssignmentExpressionsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBracketToken; + return currentToken().kind === SyntaxKind.CloseBracketToken; } function isExpectedTypeArgumentList_TypesTerminator(): boolean { var token = currentToken(); - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.GreaterThanToken) { return true; } @@ -4019,8 +4331,19 @@ module TypeScript.Parser { return false; } + function isExpectedTupleType_TypesTerminator(): boolean { + var token = currentToken(); + var tokenKind = token.kind; + if (tokenKind === SyntaxKind.CloseBracketToken) { + return true; + } + + // TODO: add more cases as necessary for error tolerance. + return false; + } + function isExpectedTypeParameterList_TypeParametersTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.GreaterThanToken) { return true; } @@ -4038,7 +4361,7 @@ module TypeScript.Parser { } function isExpectedParameterList_ParametersTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.CloseParenToken) { return true; } @@ -4059,7 +4382,7 @@ module TypeScript.Parser { } function isExpectedIndexSignature_ParametersTerminator() { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.CloseBracketToken) { return true; } @@ -4073,39 +4396,40 @@ module TypeScript.Parser { return false; } - function isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(): boolean { - // This is the case when we're parsing variable declarations in a for/for-in statement. - var tokenKind = currentToken().kind(); + function isExpectedVariableDeclaration_VariableDeclaratorsTerminator(): boolean { + if (inDisallowInContext()) { + // This is the case when we're parsing variable declarations in a for/for-in statement. + var tokenKind = currentToken().kind; - if (tokenKind === SyntaxKind.SemicolonToken || - tokenKind === SyntaxKind.CloseParenToken) { - return true; + if (tokenKind === SyntaxKind.SemicolonToken || + tokenKind === SyntaxKind.CloseParenToken) { + return true; + } + + if (tokenKind === SyntaxKind.InKeyword) { + return true; + } + + return false; } + else { + //// This is the case when we're parsing variable declarations in a variable statement. - if (tokenKind === SyntaxKind.InKeyword) { - return true; + // ERROR RECOVERY TWEAK: + // For better error recovery, if we see a => then we just stop immediately. We've got an + // arrow function here and it's going to be very unlikely that we'll resynchronize and get + // another variable declaration. + if (currentToken().kind === SyntaxKind.EqualsGreaterThanToken) { + return true; + } + + // We're done when we can eat a semicolon. + return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); } - - return false; - } - - function isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(): boolean { - //// This is the case when we're parsing variable declarations in a variable statement. - - // ERROR RECOVERY TWEAK: - // For better error recovery, if we see a => then we just stop immediately. We've got an - // arrow function here and it's going to be very unlikely that we'll resynchronize and get - // another variable declaration. - if (currentToken().kind() === SyntaxKind.EqualsGreaterThanToken) { - return true; - } - - // We're done when we can eat a semicolon. - return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); } function isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.OpenBraceToken || tokenKind === SyntaxKind.CloseBraceToken) { return true; } @@ -4114,7 +4438,7 @@ module TypeScript.Parser { } function isExpectedHeritageClause_TypeNameListTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.ExtendsKeyword || tokenKind === SyntaxKind.ImplementsKeyword) { return true; } @@ -4128,36 +4452,36 @@ module TypeScript.Parser { function isExpectedArgumentList_AssignmentExpressionsTerminator(): boolean { var token0 = currentToken(); - var tokenKind = token0.kind(); + var tokenKind = token0.kind; return tokenKind === SyntaxKind.CloseParenToken || tokenKind === SyntaxKind.SemicolonToken; } function isExpectedClassDeclaration_ClassElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedSwitchStatement_SwitchClausesTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedSwitchClause_StatementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken || + return currentToken().kind === SyntaxKind.CloseBraceToken || isSwitchClause(); } function isExpectedBlock_StatementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedTryBlock_StatementsTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; return tokenKind === SyntaxKind.CatchKeyword || tokenKind === SyntaxKind.FinallyKeyword; } function isExpectedCatchBlock_StatementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.FinallyKeyword; + return currentToken().kind === SyntaxKind.FinallyKeyword; } function isExpectedListItem(currentListType: ListParsingState, inErrorRecovery: boolean): any { @@ -4172,21 +4496,21 @@ module TypeScript.Parser { // used so we can abort out of the try block if we see a 'catch' or 'finally' // keyword. There are no additional list items that they add, so we just // return 'false' here. - case ListParsingState.TryBlock_Statements: return false; - case ListParsingState.CatchBlock_Statements: return false; - case ListParsingState.EnumDeclaration_EnumElements: return isEnumElement(inErrorRecovery); - case ListParsingState.ObjectType_TypeMembers: return isTypeMember(inErrorRecovery); - case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return isHeritageClause(); - case ListParsingState.HeritageClause_TypeNameList: return isHeritageClauseTypeName(); - case ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn: return isVariableDeclarator(); - case ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn: return isVariableDeclarator(); - case ListParsingState.ArgumentList_AssignmentExpressions: return isExpectedArgumentList_AssignmentExpression(); - case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return isPropertyAssignment(inErrorRecovery); - case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return isAssignmentOrOmittedExpression(); - case ListParsingState.ParameterList_Parameters: return isParameter(); - case ListParsingState.IndexSignature_Parameters: return isParameter(); - case ListParsingState.TypeArgumentList_Types: return isType(); - case ListParsingState.TypeParameterList_TypeParameters: return isTypeParameter(); + case ListParsingState.TryBlock_Statements: return false; + case ListParsingState.CatchBlock_Statements: return false; + case ListParsingState.EnumDeclaration_EnumElements: return isEnumElement(inErrorRecovery); + case ListParsingState.ObjectType_TypeMembers: return isTypeMember(inErrorRecovery); + case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return isHeritageClause(); + case ListParsingState.HeritageClause_TypeNameList: return isHeritageClauseTypeName(); + case ListParsingState.VariableDeclaration_VariableDeclarators: return isVariableDeclarator(); + case ListParsingState.ArgumentList_AssignmentExpressions: return isExpectedArgumentList_AssignmentExpression(); + case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return isPropertyAssignment(inErrorRecovery); + case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return isAssignmentOrOmittedExpression(); + case ListParsingState.ParameterList_Parameters: return isParameter(); + case ListParsingState.IndexSignature_Parameters: return isParameter(); + case ListParsingState.TypeArgumentList_Types: return isType(); + case ListParsingState.TypeParameterList_TypeParameters: return isTypeParameter(); + case ListParsingState.TupleType_Types: return isType(); default: throw Errors.invalidOperation(); } } @@ -4200,7 +4524,7 @@ module TypeScript.Parser { // If we're on a comma then the user has written something like "Foo(a,," or "Foo(,". // Instead of skipping the comma, create an empty expression to go before the comma // so that the tree is more well formed and doesn't have skipped tokens. - if (_currentToken.kind() === SyntaxKind.CommaToken) { + if (_currentToken.kind === SyntaxKind.CommaToken) { return true; } @@ -4209,53 +4533,53 @@ module TypeScript.Parser { function tryParseExpectedListItemWorker(currentListType: ListParsingState, inErrorRecovery: boolean): ISyntaxNodeOrToken { switch (currentListType) { - case ListParsingState.SourceUnit_ModuleElements: return tryParseModuleElement(inErrorRecovery); - case ListParsingState.ClassDeclaration_ClassElements: return tryParseClassElement(inErrorRecovery); - case ListParsingState.ModuleDeclaration_ModuleElements: return tryParseModuleElement(inErrorRecovery); - case ListParsingState.SwitchStatement_SwitchClauses: return tryParseSwitchClause(); - case ListParsingState.SwitchClause_Statements: return tryParseStatement(inErrorRecovery); - case ListParsingState.Block_Statements: return tryParseStatement(inErrorRecovery); - case ListParsingState.TryBlock_Statements: return tryParseStatement(inErrorRecovery); - case ListParsingState.CatchBlock_Statements: return tryParseStatement(inErrorRecovery); - case ListParsingState.EnumDeclaration_EnumElements: return tryParseEnumElement(inErrorRecovery); - case ListParsingState.ObjectType_TypeMembers: return tryParseTypeMember(inErrorRecovery); - case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return tryParseHeritageClause(); - case ListParsingState.HeritageClause_TypeNameList: return tryParseHeritageClauseTypeName(); - case ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn: return tryParseVariableDeclarator(/*allowIn:*/ true, /*allowIdentifierName:*/ false); - case ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn: return tryParseVariableDeclarator(/*allowIn:*/ false, /*allowIdentifierName:*/ false); - case ListParsingState.ArgumentList_AssignmentExpressions: return tryParseArgumentListExpression(); - case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return tryParsePropertyAssignment(inErrorRecovery); - case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return tryParseAssignmentOrOmittedExpression(); - case ListParsingState.ParameterList_Parameters: return tryParseParameter(); - case ListParsingState.IndexSignature_Parameters: return tryParseParameter(); - case ListParsingState.TypeArgumentList_Types: return tryParseType(); - case ListParsingState.TypeParameterList_TypeParameters: return tryParseTypeParameter(); + case ListParsingState.SourceUnit_ModuleElements: return tryParseModuleElement(inErrorRecovery); + case ListParsingState.ClassDeclaration_ClassElements: return tryParseClassElement(inErrorRecovery); + case ListParsingState.ModuleDeclaration_ModuleElements: return tryParseModuleElement(inErrorRecovery); + case ListParsingState.SwitchStatement_SwitchClauses: return tryParseSwitchClause(); + case ListParsingState.SwitchClause_Statements: return tryParseStatement(inErrorRecovery); + case ListParsingState.Block_Statements: return tryParseStatement(inErrorRecovery); + case ListParsingState.TryBlock_Statements: return tryParseStatement(inErrorRecovery); + case ListParsingState.CatchBlock_Statements: return tryParseStatement(inErrorRecovery); + case ListParsingState.EnumDeclaration_EnumElements: return tryParseEnumElement(inErrorRecovery); + case ListParsingState.ObjectType_TypeMembers: return tryParseTypeMember(inErrorRecovery); + case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return tryParseHeritageClause(); + case ListParsingState.HeritageClause_TypeNameList: return tryParseHeritageClauseTypeName(); + case ListParsingState.VariableDeclaration_VariableDeclarators: return tryParseVariableDeclarator(); + case ListParsingState.ArgumentList_AssignmentExpressions: return tryParseArgumentListExpression(); + case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return tryParsePropertyAssignment(inErrorRecovery); + case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return tryParseAssignmentOrOmittedExpression(); + case ListParsingState.ParameterList_Parameters: return tryParseParameter(); + case ListParsingState.IndexSignature_Parameters: return tryParseParameter(); + case ListParsingState.TypeArgumentList_Types: return tryParseType(); + case ListParsingState.TypeParameterList_TypeParameters: return tryParseTypeParameter(); + case ListParsingState.TupleType_Types: return tryParseType(); default: throw Errors.invalidOperation(); } } function getExpectedListElementType(currentListType: ListParsingState): string { switch (currentListType) { - case ListParsingState.SourceUnit_ModuleElements: return getLocalizedText(DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return '{'; - case ListParsingState.ClassDeclaration_ClassElements: return getLocalizedText(DiagnosticCode.constructor_function_accessor_or_variable, null); - case ListParsingState.ModuleDeclaration_ModuleElements: return getLocalizedText(DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case ListParsingState.SwitchStatement_SwitchClauses: return getLocalizedText(DiagnosticCode.case_or_default_clause, null); - case ListParsingState.SwitchClause_Statements: return getLocalizedText(DiagnosticCode.statement, null); - case ListParsingState.Block_Statements: return getLocalizedText(DiagnosticCode.statement, null); - case ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn: return getLocalizedText(DiagnosticCode.identifier, null); - case ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn: return getLocalizedText(DiagnosticCode.identifier, null); - case ListParsingState.EnumDeclaration_EnumElements: return getLocalizedText(DiagnosticCode.identifier, null); - case ListParsingState.ObjectType_TypeMembers: return getLocalizedText(DiagnosticCode.call_construct_index_property_or_function_signature, null); - case ListParsingState.ArgumentList_AssignmentExpressions: return getLocalizedText(DiagnosticCode.expression, null); - case ListParsingState.HeritageClause_TypeNameList: return getLocalizedText(DiagnosticCode.type_name, null); - case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return getLocalizedText(DiagnosticCode.property_or_accessor, null); - case ListParsingState.ParameterList_Parameters: return getLocalizedText(DiagnosticCode.parameter, null); - case ListParsingState.IndexSignature_Parameters: return getLocalizedText(DiagnosticCode.parameter, null); - case ListParsingState.TypeArgumentList_Types: return getLocalizedText(DiagnosticCode.type, null); - case ListParsingState.TypeParameterList_TypeParameters: return getLocalizedText(DiagnosticCode.type_parameter, null); - case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return getLocalizedText(DiagnosticCode.expression, null); - default: throw Errors.invalidOperation(); + case ListParsingState.SourceUnit_ModuleElements: return getLocalizedText(DiagnosticCode.module_class_interface_enum_import_or_statement, undefined); + case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return '{'; + case ListParsingState.ClassDeclaration_ClassElements: return getLocalizedText(DiagnosticCode.constructor_function_accessor_or_variable, undefined); + case ListParsingState.ModuleDeclaration_ModuleElements: return getLocalizedText(DiagnosticCode.module_class_interface_enum_import_or_statement, undefined); + case ListParsingState.SwitchStatement_SwitchClauses: return getLocalizedText(DiagnosticCode.case_or_default_clause, undefined); + case ListParsingState.SwitchClause_Statements: return getLocalizedText(DiagnosticCode.statement, undefined); + case ListParsingState.Block_Statements: return getLocalizedText(DiagnosticCode.statement, undefined); + case ListParsingState.VariableDeclaration_VariableDeclarators: return getLocalizedText(DiagnosticCode.identifier, undefined); + case ListParsingState.EnumDeclaration_EnumElements: return getLocalizedText(DiagnosticCode.identifier, undefined); + case ListParsingState.ObjectType_TypeMembers: return getLocalizedText(DiagnosticCode.call_construct_index_property_or_function_signature, undefined); + case ListParsingState.ArgumentList_AssignmentExpressions: return getLocalizedText(DiagnosticCode.expression, undefined); + case ListParsingState.HeritageClause_TypeNameList: return getLocalizedText(DiagnosticCode.type_name, undefined); + case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return getLocalizedText(DiagnosticCode.property_or_accessor, undefined); + case ListParsingState.ParameterList_Parameters: return getLocalizedText(DiagnosticCode.parameter, undefined); + case ListParsingState.IndexSignature_Parameters: return getLocalizedText(DiagnosticCode.parameter, undefined); + case ListParsingState.TypeArgumentList_Types: return getLocalizedText(DiagnosticCode.type, undefined); + case ListParsingState.TypeParameterList_TypeParameters: return getLocalizedText(DiagnosticCode.type_parameter, undefined); + case ListParsingState.TupleType_Types: return getLocalizedText(DiagnosticCode.type, undefined); + case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return getLocalizedText(DiagnosticCode.expression, undefined); + default: throw Errors.invalidOperation(); } } @@ -4355,32 +4679,35 @@ module TypeScript.Parser { // consume the token and add it to our list of 'skipped tokens'. We will then repeat the // above algorithm until we resynchronize at some point. enum ListParsingState { - SourceUnit_ModuleElements = 0, - ClassDeclaration_ClassElements = 1, - ModuleDeclaration_ModuleElements = 2, - SwitchStatement_SwitchClauses = 3, - SwitchClause_Statements = 4, - Block_Statements = 5, - TryBlock_Statements = 6, - CatchBlock_Statements = 7, - EnumDeclaration_EnumElements = 8, - ObjectType_TypeMembers = 9, - ClassOrInterfaceDeclaration_HeritageClauses = 10, - HeritageClause_TypeNameList = 11, - VariableDeclaration_VariableDeclarators_AllowIn = 12, - VariableDeclaration_VariableDeclarators_DisallowIn = 13, - ArgumentList_AssignmentExpressions = 14, - ObjectLiteralExpression_PropertyAssignments = 15, - ArrayLiteralExpression_AssignmentExpressions = 16, - ParameterList_Parameters = 17, - IndexSignature_Parameters = 18, - TypeArgumentList_Types = 19, - TypeParameterList_TypeParameters = 20, + SourceUnit_ModuleElements, + ClassDeclaration_ClassElements, + ModuleDeclaration_ModuleElements, + SwitchStatement_SwitchClauses, + SwitchClause_Statements, + Block_Statements, + TryBlock_Statements, + CatchBlock_Statements, + EnumDeclaration_EnumElements, + ObjectType_TypeMembers, + ClassOrInterfaceDeclaration_HeritageClauses, + HeritageClause_TypeNameList, + VariableDeclaration_VariableDeclarators, + ArgumentList_AssignmentExpressions, + ObjectLiteralExpression_PropertyAssignments, + ArrayLiteralExpression_AssignmentExpressions, + ParameterList_Parameters, + IndexSignature_Parameters, + TypeArgumentList_Types, + TypeParameterList_TypeParameters, + TupleType_Types, FirstListParsingState = SourceUnit_ModuleElements, - LastListParsingState = TypeParameterList_TypeParameters, + LastListParsingState = TupleType_Types, } + // We use this enum to set bits. So make sure we have enough bits available. + Debug.assert(ListParsingState.LastListParsingState <= 30); + // We keep the parser around as a singleton. This is because calling createParser is actually // expensive in V8 currently. We then clear it after a parse so that it doesn't keep state // alive unintentionally. diff --git a/src/services/syntax/prettyPrinter.ts b/src/services/syntax/prettyPrinter.ts index f19b9224f7e..c75136e89f9 100644 --- a/src/services/syntax/prettyPrinter.ts +++ b/src/services/syntax/prettyPrinter.ts @@ -16,11 +16,11 @@ module TypeScript.PrettyPrinter { } private newLineCountBetweenModuleElements(element1: IModuleElementSyntax, element2: IModuleElementSyntax): number { - if (element1 === null || element2 === null) { + if (!element1 || !element2) { return 0; } - if (lastToken(element1).kind() === SyntaxKind.CloseBraceToken) { + if (lastToken(element1).kind === SyntaxKind.CloseBraceToken) { return 2; } @@ -28,19 +28,19 @@ module TypeScript.PrettyPrinter { } private newLineCountBetweenClassElements(element1: IClassElementSyntax, element2: IClassElementSyntax): number { - if (element1 === null || element2 === null) { + if (!element1 || !element2) { return 0; } return 1; } - private newLineCountBetweenStatements(element1: IClassElementSyntax, element2: IClassElementSyntax): number { - if (element1 === null || element2 === null) { + private newLineCountBetweenStatements(element1: IStatementSyntax, element2: IStatementSyntax): number { + if (!element1 || !element2) { return 0; } - if (lastToken(element1).kind() === SyntaxKind.CloseBraceToken) { + if (lastToken(element1).kind === SyntaxKind.CloseBraceToken) { return 2; } @@ -48,7 +48,7 @@ module TypeScript.PrettyPrinter { } private newLineCountBetweenSwitchClauses(element1: ISwitchClauseSyntax, element2: ISwitchClauseSyntax): number { - if (element1 === null || element2 === null) { + if (!element1 || !element2) { return 0; } @@ -120,7 +120,7 @@ module TypeScript.PrettyPrinter { } private appendToken(token: ISyntaxToken): void { - if (token !== null && token.fullWidth() > 0) { + if (token && token.fullWidth() > 0) { this.appendIndentationIfAfterNewLine(); this.appendText(token.text()); } @@ -150,7 +150,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); } - visitNodeOrToken(this, childAt(list, i)); + visitNodeOrToken(this, list[i]); } else { this.appendToken(childAt(list, i)); @@ -165,7 +165,7 @@ module TypeScript.PrettyPrinter { this.ensureNewLine(); } - visitNodeOrToken(this, childAt(list, i)); + visitNodeOrToken(this, list[i]); } else { this.appendToken(childAt(list, i)); @@ -174,7 +174,7 @@ module TypeScript.PrettyPrinter { } private appendModuleElements(list: IModuleElementSyntax[]): void { - var lastModuleElement: IModuleElementSyntax = null; + var lastModuleElement: IModuleElementSyntax = undefined; for (var i = 0, n = list.length; i < n; i++) { var moduleElement = list[i]; var newLineCount = this.newLineCountBetweenModuleElements(lastModuleElement, moduleElement); @@ -236,7 +236,7 @@ module TypeScript.PrettyPrinter { this.indentation++; - var lastClassElement: IClassElementSyntax = null; + var lastClassElement: IClassElementSyntax = undefined; for (var i = 0, n = node.classElements.length; i < n; i++) { var classElement = node.classElements[i]; var newLineCount = this.newLineCountBetweenClassElements(lastClassElement, classElement); @@ -278,7 +278,7 @@ module TypeScript.PrettyPrinter { } for (var i = 0, n = childCount(node.typeMembers); i < n; i++) { - visitNodeOrToken(this, childAt(node.typeMembers, i)); + visitNodeOrToken(this, node.typeMembers[i]); if (appendNewLines) { this.ensureNewLine(); @@ -305,9 +305,6 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendElement(node.name); this.ensureSpace(); - this.appendToken(node.stringLiteral); - this.ensureSpace(); - this.appendToken(node.openBraceToken); this.ensureNewLine(); @@ -319,16 +316,22 @@ module TypeScript.PrettyPrinter { this.appendToken(node.closeBraceToken); } - private appendBlockOrSemicolon(block: BlockSyntax, semicolonToken: ISyntaxToken) { - if (block) { + private appendBody(body: BlockSyntax | ExpressionBody | ISyntaxToken) { + if (body.kind === SyntaxKind.Block || body.kind === SyntaxKind.ExpressionBody) { this.ensureSpace(); - visitNodeOrToken(this, block); + visitNodeOrToken(this, body); } else { - this.appendToken(semicolonToken); + this.appendToken(body); } } + public visitExpressionBody(node: ExpressionBody): void { + this.appendToken(node.equalsGreaterThanToken); + this.ensureSpace(); + visitNodeOrToken(this, node.expression); + } + public visitFunctionDeclaration(node: FunctionDeclarationSyntax): void { this.appendSpaceList(node.modifiers); this.ensureSpace(); @@ -336,7 +339,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.identifier); this.appendNode(node.callSignature); - this.appendBlockOrSemicolon(node.block, node.semicolonToken); + this.appendBody(node.body); } public visitVariableStatement(node: VariableStatementSyntax): void { @@ -353,7 +356,7 @@ module TypeScript.PrettyPrinter { } public visitVariableDeclarator(node: VariableDeclaratorSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendNode(node.equalsValueClause); } @@ -390,8 +393,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.equalsGreaterThanToken); this.ensureSpace(); - this.appendNode(node.block); - this.appendElement(node.expression); + visitNodeOrToken(this, node.body); } public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): void { @@ -399,8 +401,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.equalsGreaterThanToken); this.ensureSpace(); - this.appendNode(node.block); - this.appendElement(node.expression); + visitNodeOrToken(this, node.body); } public visitQualifiedName(node: QualifiedNameSyntax): void { @@ -421,6 +422,26 @@ module TypeScript.PrettyPrinter { this.appendToken(node.greaterThanToken); } + public visitTupleType(node: TupleTypeSyntax): void { + this.appendToken(node.openBracketToken); + this.appendSeparatorSpaceList(node.types); + this.appendToken(node.closeBracketToken); + } + + public visitParenthesizedType(node: ParenthesizedTypeSyntax): void { + this.appendToken(node.openParenToken); + this.appendElement(node.type); + this.appendToken(node.closeParenToken); + } + + public visitUnionType(node: UnionTypeSyntax): void { + this.appendElement(node.left); + this.ensureSpace(); + this.appendToken(node.barToken); + this.ensureSpace(); + this.appendElement(node.right); + } + public visitConstructorType(node: ConstructorTypeSyntax): void { this.appendToken(node.newKeyword); this.ensureSpace(); @@ -466,7 +487,7 @@ module TypeScript.PrettyPrinter { } private appendStatements(statements: IStatementSyntax[]): void { - var lastStatement: IStatementSyntax = null; + var lastStatement: IStatementSyntax = undefined; for (var i = 0, n = statements.length; i < n; i++) { var statement = statements[i]; @@ -532,7 +553,7 @@ module TypeScript.PrettyPrinter { public visitBinaryExpression(node: BinaryExpressionSyntax): void { visitNodeOrToken(this, node.left); - if (node.kind() !== SyntaxKind.CommaExpression) { + if (node.operatorToken.kind !== SyntaxKind.CommaToken) { this.ensureSpace(); } @@ -559,7 +580,7 @@ module TypeScript.PrettyPrinter { } public visitMethodSignature(node: MethodSignatureSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendToken(node.questionToken); visitNodeOrToken(this, node.callSignature); } @@ -572,7 +593,7 @@ module TypeScript.PrettyPrinter { } public visitPropertySignature(node: PropertySignatureSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendToken(node.questionToken); this.appendNode(node.typeAnnotation); } @@ -608,7 +629,7 @@ module TypeScript.PrettyPrinter { } private appendBlockOrStatement(node: IStatementSyntax): void { - if (node.kind() === SyntaxKind.Block) { + if (node.kind === SyntaxKind.Block) { this.ensureSpace(); visitNodeOrToken(this, node); } @@ -634,7 +655,7 @@ module TypeScript.PrettyPrinter { this.ensureNewLine(); this.appendToken(node.elseKeyword); - if (node.statement.kind() === SyntaxKind.IfStatement) { + if (node.statement.kind === SyntaxKind.IfStatement) { this.ensureSpace(); visitNodeOrToken(this, node.statement); } @@ -651,7 +672,7 @@ module TypeScript.PrettyPrinter { public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): void { this.appendToken(node.constructorKeyword); visitNodeOrToken(this, node.callSignature); - this.appendBlockOrSemicolon(node.block, node.semicolonToken); + this.appendBody(node.body); } public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): void { @@ -664,9 +685,9 @@ module TypeScript.PrettyPrinter { public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void { this.appendSpaceList(node.modifiers); this.ensureSpace(); - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); - this.appendBlockOrSemicolon(node.block, node.semicolonToken); + this.appendBody(node.body); } public visitGetAccessor(node: GetAccessorSyntax): void { @@ -674,10 +695,10 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.getKeyword); this.ensureSpace(); - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); this.ensureSpace(); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitSetAccessor(node: SetAccessorSyntax): void { @@ -685,10 +706,10 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.setKeyword); this.ensureSpace(); - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature) this.ensureSpace(); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): void { @@ -737,7 +758,7 @@ module TypeScript.PrettyPrinter { this.appendToken(node.openBraceToken); this.ensureNewLine(); - var lastSwitchClause: ISwitchClauseSyntax = null; + var lastSwitchClause: ISwitchClauseSyntax = undefined; for (var i = 0, n = node.switchClauses.length; i < n; i++) { var switchClause = node.switchClauses[i]; @@ -754,9 +775,9 @@ module TypeScript.PrettyPrinter { } private appendSwitchClauseStatements(node: ISwitchClauseSyntax): void { - if (childCount(node.statements) === 1 && childAt(node.statements, 0).kind() === SyntaxKind.Block) { + if (childCount(node.statements) === 1 && childAt(node.statements, 0).kind === SyntaxKind.Block) { this.ensureSpace(); - visitNodeOrToken(this, childAt(node.statements, 0)); + visitNodeOrToken(this, node.statements[0]); } else if (childCount(node.statements) > 0) { this.ensureNewLine(); @@ -805,8 +826,7 @@ module TypeScript.PrettyPrinter { this.appendToken(node.forKeyword); this.ensureSpace(); this.appendToken(node.openParenToken); - this.appendNode(node.variableDeclaration); - this.appendElement(node.initializer); + visitNodeOrToken(this, node.initializer); this.appendToken(node.firstSemicolonToken); if (node.condition) { @@ -829,12 +849,11 @@ module TypeScript.PrettyPrinter { this.appendToken(node.forKeyword); this.ensureSpace(); this.appendToken(node.openParenToken); - this.appendNode(node.variableDeclaration); this.appendElement(node.left); this.ensureSpace(); this.appendToken(node.inKeyword); this.ensureSpace(); - this.appendElement(node.expression); + this.appendElement(node.right); this.appendToken(node.closeParenToken); this.appendBlockOrStatement(node.statement); } @@ -875,7 +894,7 @@ module TypeScript.PrettyPrinter { } public visitEnumElement(node: EnumElementSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.ensureSpace(); this.appendNode(node.equalsValueClause); } @@ -906,18 +925,24 @@ module TypeScript.PrettyPrinter { this.appendToken(node.closeBraceToken); } + public visitComputedPropertyName(node: ComputedPropertyNameSyntax): void { + this.appendToken(node.openBracketToken); + visitNodeOrToken(this, node.expression); + this.appendToken(node.closeBracketToken); + } + public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendToken(node.colonToken); this.ensureSpace(); visitNodeOrToken(this, node.expression); } public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); this.ensureSpace(); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitFunctionExpression(node: FunctionExpressionSyntax): void { @@ -930,7 +955,7 @@ module TypeScript.PrettyPrinter { visitNodeOrToken(this, node.callSignature); this.ensureSpace(); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitEmptyStatement(node: EmptyStatementSyntax): void { @@ -999,9 +1024,33 @@ module TypeScript.PrettyPrinter { visitNodeOrToken(this, node.expression); } + public visitYieldExpression(node: YieldExpressionSyntax): void { + this.appendToken(node.yieldKeyword); + this.ensureSpace(); + visitNodeOrToken(this, node.expression); + } + public visitDebuggerStatement(node: DebuggerStatementSyntax): void { this.appendToken(node.debuggerKeyword); this.appendToken(node.semicolonToken); } + + public visitTemplateExpression(node: TemplateExpressionSyntax): void { + this.appendToken(node.templateStartToken); + this.ensureSpace(); + this.appendSpaceList(node.templateClauses); + } + + public visitTemplateClause(node: TemplateClauseSyntax): void { + visitNodeOrToken(this, node.expression); + this.ensureSpace(); + this.appendToken(node.templateMiddleOrEndToken); + } + + public visitTemplateAccessExpression(node: TemplateAccessExpressionSyntax): void { + visitNodeOrToken(this, node.expression); + this.ensureSpace(); + visitNodeOrToken(this, node.templateExpression); + } } } \ No newline at end of file diff --git a/src/services/syntax/references.ts b/src/services/syntax/references.ts index a4eb9efc595..5c1a6818ccc 100644 --- a/src/services/syntax/references.ts +++ b/src/services/syntax/references.ts @@ -17,9 +17,7 @@ /// /// /// -/// /// -/// // SyntaxDedenter depends on SyntaxRewriter // /// @@ -41,6 +39,7 @@ /// // Concrete nodes depend on the parser. +/// /// // SyntaxTree depends on PositionTrackingWalker diff --git a/src/services/syntax/scanner.ts b/src/services/syntax/scanner.ts index 45cc151e2d5..14c73f2c6b4 100644 --- a/src/services/syntax/scanner.ts +++ b/src/services/syntax/scanner.ts @@ -60,84 +60,47 @@ module TypeScript.Scanner { // This gives us 23bit for width (or 8MB of width which should be enough for any codebase). enum ScannerConstants { - LargeTokenFullStartShift = 4, - LargeTokenFullWidthShift = 7, - LargeTokenLeadingTriviaBitMask = 0x01, // 00000001 - LargeTokenLeadingCommentBitMask = 0x02, // 00000010 - LargeTokenTrailingTriviaBitMask = 0x04, // 00000100 - LargeTokenTrailingCommentBitMask = 0x08, // 00001000 - LargeTokenTriviaBitMask = 0x0F, // 00001111 + LargeTokenFullWidthShift = 3, - FixedWidthTokenFullStartShift = 7, - FixedWidthTokenMaxFullStart = 0x7FFFFF, // 23 ones. + WhitespaceTrivia = 0x01, // 00000001 + NewlineTrivia = 0x02, // 00000010 + CommentTrivia = 0x04, // 00000100 + TriviaMask = 0x07, // 00000111 - SmallTokenFullWidthShift = 7, - SmallTokenFullStartShift = 12, - SmallTokenMaxFullStart = 0x3FFFF, // 18 ones. - SmallTokenMaxFullWidth = 0x1F, // 5 ones - SmallTokenFullWidthMask = 0x1F, // 00011111 - - KindMask = 0x7F, // 01111111 - IsVariableWidthMask = 0x80, // 10000000 + KindMask = 0x7F, // 01111111 + IsVariableWidthMask = 0x80, // 10000000 } - // Make sure our math works for packing/unpacking large fullStarts. - Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(1 << 26, 3)) === (1 << 26)); - Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(3 << 25, 1)) === (3 << 25)); - Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(10 << 23, 2)) === (10 << 23)); - - function fixedWidthTokenPackData(fullStart: number, kind: SyntaxKind) { - return (fullStart << ScannerConstants.FixedWidthTokenFullStartShift) | kind; + function largeTokenPackData(fullWidth: number, leadingTriviaInfo: number) { + return (fullWidth << ScannerConstants.LargeTokenFullWidthShift) | leadingTriviaInfo; } - function fixedWidthTokenUnpackFullStart(packedData: number) { - return packedData >> ScannerConstants.FixedWidthTokenFullStartShift; + function largeTokenUnpackFullWidth(packedFullWidthAndInfo: number): number { + return packedFullWidthAndInfo >> ScannerConstants.LargeTokenFullWidthShift; } - function smallTokenPackData(fullStart: number, fullWidth: number, kind: SyntaxKind) { - return (fullStart << ScannerConstants.SmallTokenFullStartShift) | - (fullWidth << ScannerConstants.SmallTokenFullWidthShift) | - kind; - } - - function smallTokenUnpackFullWidth(packedData: number): SyntaxKind { - return (packedData >> ScannerConstants.SmallTokenFullWidthShift) & ScannerConstants.SmallTokenFullWidthMask; - } - - function smallTokenUnpackFullStart(packedData: number): number { - return packedData >> ScannerConstants.SmallTokenFullStartShift; - } - - function largeTokenPackFullStartAndInfo(fullStart: number, triviaInfo: number): number { - return (fullStart << ScannerConstants.LargeTokenFullStartShift) | triviaInfo; - } - - function largeTokenUnpackFullWidth(packedFullWidthAndKind: number) { - return packedFullWidthAndKind >> ScannerConstants.LargeTokenFullWidthShift; - } - - function largeTokenUnpackFullStart(packedFullStartAndInfo: number): number { - return packedFullStartAndInfo >> ScannerConstants.LargeTokenFullStartShift; + function largeTokenUnpackLeadingTriviaInfo(packedFullWidthAndInfo: number): number { + return packedFullWidthAndInfo & ScannerConstants.TriviaMask; } function largeTokenUnpackHasLeadingTrivia(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenLeadingTriviaBitMask) !== 0; + return largeTokenUnpackLeadingTriviaInfo(packed) !== 0; } - function largeTokenUnpackHasTrailingTrivia(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenTrailingTriviaBitMask) !== 0; + function hasComment(info: number) { + return (info & ScannerConstants.CommentTrivia) !== 0; + } + + function hasNewLine(info: number) { + return (info & ScannerConstants.NewlineTrivia) !== 0; + } + + function largeTokenUnpackHasLeadingNewLine(packed: number): boolean { + return hasNewLine(largeTokenUnpackLeadingTriviaInfo(packed)); } function largeTokenUnpackHasLeadingComment(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenLeadingCommentBitMask) !== 0; - } - - function largeTokenUnpackHasTrailingComment(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenTrailingCommentBitMask) !== 0; - } - - function largeTokenUnpackTriviaInfo(packed: number): number { - return packed & ScannerConstants.LargeTokenTriviaBitMask; + return hasComment(largeTokenUnpackLeadingTriviaInfo(packed)); } var isKeywordStartCharacter: number[] = ArrayUtilities.createArray(CharacterCodes.maxAsciiCharacter, 0); @@ -166,7 +129,7 @@ module TypeScript.Scanner { // These tokens are contextually created based on parsing decisions. We can't reuse // them in incremental scenarios as we may be in a context where the parser would not // create them. - switch (token.kind()) { + switch (token.kind) { // Created by the parser when it sees / or /= in a location where it needs an expression. case SyntaxKind.RegularExpressionLiteral: @@ -178,15 +141,20 @@ module TypeScript.Scanner { case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: return true; + // Created by the parser when it sees } while parsing a template expression. + case SyntaxKind.TemplateMiddleToken: + case SyntaxKind.TemplateEndToken: + return true; + default: return token.isKeywordConvertedToIdentifier(); } } - var lastTokenInfo = { leadingTriviaWidth: -1, width: -1 }; + var lastTokenInfo = { leadingTriviaWidth: -1 }; var lastTokenInfoTokenID: number = -1; - var triviaScanner = createScannerInternal(ts.ScriptTarget.ES5, SimpleText.fromString(""), () => { }); + var triviaScanner = createScannerInternal(ts.ScriptTarget.Latest, SimpleText.fromString(""), () => { }); interface IScannerToken extends ISyntaxToken { } @@ -207,15 +175,7 @@ module TypeScript.Scanner { return Syntax.emptyTriviaList; } - return triviaScanner.scanTrivia(token, text, /*isTrailing:*/ false); - } - - function trailingTrivia(token: IScannerToken, text: ISimpleText): ISyntaxTriviaList { - if (!token.hasTrailingTrivia()) { - return Syntax.emptyTriviaList; - } - - return triviaScanner.scanTrivia(token, text, /*isTrailing:*/ true); + return triviaScanner.scanTrivia(token, text); } function leadingTriviaWidth(token: IScannerToken, text: ISimpleText): number { @@ -227,15 +187,6 @@ module TypeScript.Scanner { return lastTokenInfo.leadingTriviaWidth; } - function trailingTriviaWidth(token: IScannerToken, text: ISimpleText): number { - if (!token.hasTrailingTrivia()) { - return 0; - } - - fillSizeInfo(token, text); - return token.fullWidth() - lastTokenInfo.leadingTriviaWidth - lastTokenInfo.width; - } - function tokenIsIncrementallyUnusable(token: IScannerToken): boolean { // No scanner tokens make their *containing node* incrementally unusable. // Note: several scanner tokens may themselves be unusable. i.e. if the parser asks @@ -246,50 +197,56 @@ module TypeScript.Scanner { } class FixedWidthTokenWithNoTrivia implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + public parent: ISyntaxElement; + public childCount: number; - constructor(private _packedData: number) { + constructor(private _fullStart: number, public kind: SyntaxKind) { } public setFullStart(fullStart: number): void { - this._packedData = fixedWidthTokenPackData(fullStart, this.kind()); + this._fullStart = fullStart; } + + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public isIncrementallyUnusable(): boolean { return false; } public isKeywordConvertedToIdentifier(): boolean { return false; } - public hasSkippedToken(): boolean { return false; } - public fullText(): string { return SyntaxFacts.getText(this.kind()); } + public fullText(): string { return SyntaxFacts.getText(this.kind); } public text(): string { return this.fullText(); } public leadingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } - public trailingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } public leadingTriviaWidth(): number { return 0; } - public trailingTriviaWidth(): number { return 0; } - public kind(): SyntaxKind { return this._packedData & ScannerConstants.KindMask; } - public fullWidth(): number { return this.fullText().length; } - public fullStart(): number { return fixedWidthTokenUnpackFullStart(this._packedData); } + public fullWidth(): number { return fixedWidthTokenLength(this.kind); } + public fullStart(): number { return this._fullStart; } public hasLeadingTrivia(): boolean { return false; } - public hasTrailingTrivia(): boolean { return false; } + public hasLeadingNewLine(): boolean { return false; } + public hasLeadingSkippedToken(): boolean { return false; } public hasLeadingComment(): boolean { return false; } - public hasTrailingComment(): boolean { return false; } - public clone(): ISyntaxToken { return new FixedWidthTokenWithNoTrivia(this._packedData); } + + public clone(): ISyntaxToken { return new FixedWidthTokenWithNoTrivia(this._fullStart, this.kind); } } + FixedWidthTokenWithNoTrivia.prototype.childCount = 0; class LargeScannerToken implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + public parent: ISyntaxElement; + public childCount: number; private cachedText: string; - constructor(private _packedFullStartAndInfo: number, private _packedFullWidthAndKind: number, cachedText: string) { + + constructor(private _fullStart: number, public kind: SyntaxKind, private _packedFullWidthAndInfo: number, cachedText: string) { if (cachedText !== undefined) { this.cachedText = cachedText; } } public setFullStart(fullStart: number): void { - this._packedFullStartAndInfo = largeTokenPackFullStartAndInfo(fullStart, - largeTokenUnpackTriviaInfo(this._packedFullStartAndInfo)); + this._fullStart = fullStart; } + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } + private syntaxTreeText(text: ISimpleText) { var result = text || syntaxTree(this).text; Debug.assert(result); @@ -298,7 +255,6 @@ module TypeScript.Scanner { public isIncrementallyUnusable(): boolean { return tokenIsIncrementallyUnusable(this); } public isKeywordConvertedToIdentifier(): boolean { return false; } - public hasSkippedToken(): boolean { return false; } public fullText(text?: ISimpleText): string { return fullText(this, this.syntaxTreeText(text)); @@ -306,42 +262,35 @@ module TypeScript.Scanner { public text(): string { var cachedText = this.cachedText; - return cachedText !== undefined ? cachedText : SyntaxFacts.getText(this.kind()); + return cachedText !== undefined ? cachedText : SyntaxFacts.getText(this.kind); } public leadingTrivia(text?: ISimpleText): ISyntaxTriviaList { return leadingTrivia(this, this.syntaxTreeText(text)); } - public trailingTrivia(text?: ISimpleText): ISyntaxTriviaList { return trailingTrivia(this, this.syntaxTreeText(text)); } + public leadingTriviaWidth(text?: ISimpleText): number { return leadingTriviaWidth(this, this.syntaxTreeText(text)); } - public leadingTriviaWidth(text?: ISimpleText): number { - return leadingTriviaWidth(this, this.syntaxTreeText(text)); - } + public fullWidth(): number { return largeTokenUnpackFullWidth(this._packedFullWidthAndInfo); } + public fullStart(): number { return this._fullStart; } - public trailingTriviaWidth(text?: ISimpleText): number { - return trailingTriviaWidth(this, this.syntaxTreeText(text)); - } + public hasLeadingTrivia(): boolean { return largeTokenUnpackHasLeadingTrivia(this._packedFullWidthAndInfo); } + public hasLeadingNewLine(): boolean { return largeTokenUnpackHasLeadingNewLine(this._packedFullWidthAndInfo); } + public hasLeadingComment(): boolean { return largeTokenUnpackHasLeadingComment(this._packedFullWidthAndInfo); } + public hasLeadingSkippedToken(): boolean { return false; } - public kind(): SyntaxKind { return this._packedFullWidthAndKind & ScannerConstants.KindMask; } - public fullWidth(): number { return largeTokenUnpackFullWidth(this._packedFullWidthAndKind); } - public fullStart(): number { return largeTokenUnpackFullStart(this._packedFullStartAndInfo); } - public hasLeadingTrivia(): boolean { return largeTokenUnpackHasLeadingTrivia(this._packedFullStartAndInfo); } - public hasTrailingTrivia(): boolean { return largeTokenUnpackHasTrailingTrivia(this._packedFullStartAndInfo); } - public hasLeadingComment(): boolean { return largeTokenUnpackHasLeadingComment(this._packedFullStartAndInfo); } - public hasTrailingComment(): boolean { return largeTokenUnpackHasTrailingComment(this._packedFullStartAndInfo); } - public clone(): ISyntaxToken { return new LargeScannerToken(this._packedFullStartAndInfo, this._packedFullWidthAndKind, this.cachedText); } + public clone(): ISyntaxToken { return new LargeScannerToken(this._fullStart, this.kind, this._packedFullWidthAndInfo, this.cachedText); } } + LargeScannerToken.prototype.childCount = 0; export interface DiagnosticCallback { - (position: number, width: number, key: string, arguments: any[]): void; + (position: number, width: number, key: string, arguments?: any[]): void; } interface TokenInfo { leadingTriviaWidth: number; - width: number; } interface IScannerInternal extends IScanner { fillTokenInfo(token: IScannerToken, text: ISimpleText, tokenInfo: TokenInfo): void; - scanTrivia(token: IScannerToken, text: ISimpleText, isTrailing: boolean): ISyntaxTriviaList; + scanTrivia(token: IScannerToken, text: ISimpleText): ISyntaxTriviaList; } export interface IScanner { @@ -368,12 +317,13 @@ module TypeScript.Scanner { } function reset(_text: ISimpleText, _start: number, _end: number) { - Debug.assert(_start <= _text.length(), "Token's start was not within the bounds of text: " + _start + " - [0, " + _text.length() + ")"); - Debug.assert(_end <= _text.length(), "Token's end was not within the bounds of text: " + _end + " - [0, " + _text.length() + ")"); + var textLength = _text.length(); + Debug.assert(_start <= textLength, "Token's start was not within the bounds of text."); + Debug.assert(_end <= textLength, "Token's end was not within the bounds of text:"); if (!str || text !== _text) { text = _text; - str = _text.substr(0, _text.length()); + str = _text.substr(0, textLength); } start = _start; @@ -383,15 +333,13 @@ module TypeScript.Scanner { function scan(allowContextualToken: boolean): ISyntaxToken { var fullStart = index; - var leadingTriviaInfo = scanTriviaInfo(/*isTrailing: */ false); + var leadingTriviaInfo = scanTriviaInfo(); var start = index; var kindAndIsVariableWidth = scanSyntaxKind(allowContextualToken); - var end = index; - var trailingTriviaInfo = scanTriviaInfo(/*isTrailing: */true); - - var fullWidth = index - fullStart; + var fullEnd = index; + var fullWidth = fullEnd - fullStart; // If we have no trivia, and we are a fixed width token kind, and our size isn't too // large, and we're a real fixed width token (and not something like "\u0076ar"). @@ -399,34 +347,21 @@ module TypeScript.Scanner { var isFixedWidth = kind >= SyntaxKind.FirstFixedWidth && kind <= SyntaxKind.LastFixedWidth && ((kindAndIsVariableWidth & ScannerConstants.IsVariableWidthMask) === 0); - if (isFixedWidth && - leadingTriviaInfo === 0 && trailingTriviaInfo === 0 && - fullStart <= ScannerConstants.FixedWidthTokenMaxFullStart && - (kindAndIsVariableWidth & ScannerConstants.IsVariableWidthMask) === 0) { - - return new FixedWidthTokenWithNoTrivia((fullStart << ScannerConstants.FixedWidthTokenFullStartShift) | kind); + if (isFixedWidth && leadingTriviaInfo === 0) { + return new FixedWidthTokenWithNoTrivia(fullStart, kind); } else { - // inline the packing logic for perf. - var packedFullStartAndTriviaInfo = (fullStart << ScannerConstants.LargeTokenFullStartShift) | - leadingTriviaInfo | (trailingTriviaInfo << 2); - - var packedFullWidthAndKind = (fullWidth << ScannerConstants.LargeTokenFullWidthShift) | kind; - var cachedText = isFixedWidth ? undefined : text.substr(start, end - start); - return new LargeScannerToken(packedFullStartAndTriviaInfo, packedFullWidthAndKind, cachedText); + var packedFullWidthAndInfo = largeTokenPackData(fullWidth, leadingTriviaInfo); + var cachedText = isFixedWidth ? undefined : text.substr(start, fullEnd - start); + return new LargeScannerToken(fullStart, kind, packedFullWidthAndInfo, cachedText); } } - function scanTrivia(parent: IScannerToken, text: ISimpleText, isTrailing: boolean): ISyntaxTriviaList { + function scanTrivia(parent: IScannerToken, text: ISimpleText): ISyntaxTriviaList { var tokenFullStart = parent.fullStart(); var tokenStart = tokenFullStart + leadingTriviaWidth(parent, text) - if (isTrailing) { - reset(text, tokenStart + parent.text().length, tokenFullStart + parent.fullWidth()); - } - else { - reset(text, tokenFullStart, tokenStart); - } + reset(text, tokenFullStart, tokenStart); // Debug.assert(length > 0); // Keep this exactly in sync with scanTriviaInfo @@ -483,15 +418,7 @@ module TypeScript.Scanner { case CharacterCodes.paragraphSeparator: case CharacterCodes.lineSeparator: trivia.push(scanLineTerminatorSequenceTrivia(ch)); - - // If we're consuming leading trivia, then we will continue consuming more - // trivia (including newlines) up to the first token we see. If we're - // consuming trailing trivia, then we break after the first newline we see. - if (!isTrailing) { - continue; - } - - break; + continue; default: throw Errors.invalidOperation(); @@ -508,7 +435,7 @@ module TypeScript.Scanner { // Returns 0 if there was no trivia, or 1 if there was trivia. Returned as an int instead // of a boolean because we'll need a numerical value later on to store in our tokens. - function scanTriviaInfo(isTrailing: boolean): number { + function scanTriviaInfo(): number { // Keep this exactly in sync with scanTrivia var result = 0; var _end = end; @@ -523,7 +450,7 @@ module TypeScript.Scanner { case CharacterCodes.formFeed: index++; // we have trivia - result |= 1; + result |= ScannerConstants.WhitespaceTrivia; continue; case CharacterCodes.carriageReturn: @@ -532,18 +459,12 @@ module TypeScript.Scanner { } // fall through. case CharacterCodes.lineFeed: + case CharacterCodes.paragraphSeparator: + case CharacterCodes.lineSeparator: index++; // we have trivia - result |= 1; - - // If we're consuming leading trivia, then we will continue consuming more - // trivia (including newlines) up to the first token we see. If we're - // consuming trailing trivia, then we break after the first newline we see. - if (isTrailing) { - return result; - } - + result |= ScannerConstants.NewlineTrivia; continue; case CharacterCodes.slash: @@ -551,14 +472,14 @@ module TypeScript.Scanner { var ch2 = str.charCodeAt(index + 1); if (ch2 === CharacterCodes.slash) { // we have a comment, and we have trivia - result |= 3; + result |= ScannerConstants.CommentTrivia; skipSingleLineCommentTrivia(); continue; } if (ch2 === CharacterCodes.asterisk) { // we have a comment, and we have trivia - result |= 3; + result |= ScannerConstants.CommentTrivia; skipMultiLineCommentTrivia(); continue; } @@ -568,8 +489,8 @@ module TypeScript.Scanner { return result; default: - if (ch > CharacterCodes.maxAsciiCharacter && slowScanTriviaInfo(ch)) { - result |= 1; + if (ch > CharacterCodes.maxAsciiCharacter && slowScanWhitespaceTriviaInfo(ch)) { + result |= ScannerConstants.WhitespaceTrivia; continue; } @@ -580,7 +501,7 @@ module TypeScript.Scanner { return result; } - function slowScanTriviaInfo(ch: number): boolean { + function slowScanWhitespaceTriviaInfo(ch: number): boolean { switch (ch) { case CharacterCodes.nonBreakingSpace: case CharacterCodes.enQuad: @@ -598,8 +519,6 @@ module TypeScript.Scanner { case CharacterCodes.narrowNoBreakSpace: case CharacterCodes.ideographicSpace: case CharacterCodes.byteOrderMark: - case CharacterCodes.paragraphSeparator: - case CharacterCodes.lineSeparator: index++; return true; @@ -694,26 +613,31 @@ module TypeScript.Scanner { return createTrivia(SyntaxKind.MultiLineCommentTrivia, absoluteStartIndex); } - function skipMultiLineCommentTrivia(): number { + function skipMultiLineCommentTrivia(): void { // The '2' is for the "/*" we consumed. + var _index = index + 2; + var _end = end; + index += 2; while (true) { - if (index === end) { - reportDiagnostic(end, 0, DiagnosticCode.AsteriskSlash_expected, null); - return; + if (_index === _end) { + reportDiagnostic(end, 0, DiagnosticCode._0_expected, ["*/"]); + break; } - if ((index + 1) < end && - str.charCodeAt(index) === CharacterCodes.asterisk && - str.charCodeAt(index + 1) === CharacterCodes.slash) { + if ((_index + 1) < _end && + str.charCodeAt(_index) === CharacterCodes.asterisk && + str.charCodeAt(_index + 1) === CharacterCodes.slash) { - index += 2; - return; + _index += 2; + break; } - index++; + _index++; } + + index = _index; } function scanLineTerminatorSequenceTrivia(ch: number): ISyntaxTrivia { @@ -742,10 +666,10 @@ module TypeScript.Scanner { index++; switch (character) { - case CharacterCodes.exclamation /*33*/: return scanExclamationToken(); + case CharacterCodes.exclamation/*33*/: return scanExclamationToken(); case CharacterCodes.doubleQuote/*34*/: return scanStringLiteral(character); - case CharacterCodes.percent /*37*/: return scanPercentToken(); - case CharacterCodes.ampersand /*38*/: return scanAmpersandToken(); + case CharacterCodes.percent/*37*/: return scanPercentToken(); + case CharacterCodes.ampersand/*38*/: return scanAmpersandToken(); case CharacterCodes.singleQuote/*39*/: return scanStringLiteral(character); case CharacterCodes.openParen/*40*/: return SyntaxKind.OpenParenToken; case CharacterCodes.closeParen/*41*/: return SyntaxKind.CloseParenToken; @@ -771,10 +695,11 @@ module TypeScript.Scanner { case CharacterCodes.openBracket/*91*/: return SyntaxKind.OpenBracketToken; case CharacterCodes.closeBracket/*93*/: return SyntaxKind.CloseBracketToken; case CharacterCodes.caret/*94*/: return scanCaretToken(); + case CharacterCodes.backtick/*96*/: return scanTemplateToken(character); case CharacterCodes.openBrace/*123*/: return SyntaxKind.OpenBraceToken; case CharacterCodes.bar/*124*/: return scanBarToken(); - case CharacterCodes.closeBrace/*125*/: return SyntaxKind.CloseBraceToken; + case CharacterCodes.closeBrace/*125*/: return scanCloseBraceToken(allowContextualToken, character); case CharacterCodes.tilde/*126*/: return SyntaxKind.TildeToken; } @@ -916,7 +841,7 @@ module TypeScript.Scanner { if (languageVersion >= ts.ScriptTarget.ES5) { reportDiagnostic( - start, index - start, DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, null); + start, index - start, DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, undefined); } } @@ -1073,6 +998,39 @@ module TypeScript.Scanner { } } + function scanCloseBraceToken(allowContextualToken: boolean, startChar: number): SyntaxKind { + return allowContextualToken ? scanTemplateToken(startChar) : SyntaxKind.CloseBraceToken; + } + + function scanTemplateToken(startChar: number): SyntaxKind { + var startedWithBacktick = startChar === CharacterCodes.backtick; + + while (true) { + if (index === end) { + // Hit the end of the file. + reportDiagnostic(end, 0, DiagnosticCode.Unterminated_template_literal); + break; + } + + var ch = str.charCodeAt(index); + index++; + + if (ch === CharacterCodes.backtick) { + break; + } + + if (ch === CharacterCodes.$ && + index < end && + str.charCodeAt(index) === CharacterCodes.openBrace) { + + index++; + return startedWithBacktick ? SyntaxKind.TemplateStartToken : SyntaxKind.TemplateMiddleToken; + } + } + + return startedWithBacktick ? SyntaxKind.NoSubstitutionTemplateToken : SyntaxKind.TemplateEndToken; + } + function scanAmpersandToken(): SyntaxKind { var character = str.charCodeAt(index); if (character === CharacterCodes.equals) { @@ -1186,10 +1144,7 @@ module TypeScript.Scanner { // term, and it sees one of these then it may restart us asking specifically if we could // scan out a regex. if (allowContextualToken) { - var result = tryScanRegularExpressionToken(); - if (result !== SyntaxKind.None) { - return result; - } + return scanRegularExpressionToken(); } if (str.charCodeAt(index) === CharacterCodes.equals) { @@ -1201,7 +1156,7 @@ module TypeScript.Scanner { } } - function tryScanRegularExpressionToken(): SyntaxKind { + function scanRegularExpressionToken(): SyntaxKind { var startIndex = index; var inEscape = false; @@ -1210,8 +1165,9 @@ module TypeScript.Scanner { var ch = str.charCodeAt(index); if (isNaN(ch) || isNewLineCharacter(ch)) { - index = startIndex; - return SyntaxKind.None; + // Hit the end of line, or end of the file. This is not a legal regex. + reportDiagnostic(index, 0, DiagnosticCode.Unterminated_regular_expression_literal); + break; } index++; @@ -1223,7 +1179,7 @@ module TypeScript.Scanner { switch (ch) { case CharacterCodes.backslash: // We're now in an escape. Consume the next character we see (unless it's - // a newline or null. + // a newline or undefined. inEscape = true; continue; @@ -1235,7 +1191,7 @@ module TypeScript.Scanner { continue; case CharacterCodes.closeBracket: - // If we ever hit a cloe bracket then we're now no longer in a character + // If we ever hit a close bracket then we're now no longer in a character // class. If we weren't in a character class to begin with, then this has // no effect. inCharacterClass = false; @@ -1261,7 +1217,7 @@ module TypeScript.Scanner { // TODO: The grammar says any identifier part is allowed here. Do we need to support // \u identifiers here? The existing typescript parser does not. - while (isIdentifierPartCharacter[str.charCodeAt(index)]) { + while (index < end && isIdentifierPartCharacter[str.charCodeAt(index)]) { index++; } @@ -1364,7 +1320,7 @@ module TypeScript.Scanner { break; } else if (isNaN(ch) || isNewLineCharacter(ch)) { - reportDiagnostic(Math.min(index, end), 1, DiagnosticCode.Missing_close_quote_character, null); + reportDiagnostic(index, 0, DiagnosticCode.Unterminated_string_literal); break; } else { @@ -1431,7 +1387,7 @@ module TypeScript.Scanner { var ch2 = str.charCodeAt(index); if (!CharacterInfo.isHexDigit(ch2)) { if (report) { - reportDiagnostic(start, index - start, DiagnosticCode.Unrecognized_escape_sequence, null) + reportDiagnostic(start, index - start, DiagnosticCode.Unrecognized_escape_sequence, undefined) } break; @@ -1449,14 +1405,10 @@ module TypeScript.Scanner { var fullEnd = fullStart + token.fullWidth(); reset(text, fullStart, fullEnd); - scanTriviaInfo(/*isTrailing: */ false); + scanTriviaInfo(); var start = index; - scanSyntaxKind(isContextualToken(token)); - var end = index; - tokenInfo.leadingTriviaWidth = start - fullStart; - tokenInfo.width = end - start; } reset(text, 0, text.length()); @@ -1478,16 +1430,6 @@ module TypeScript.Scanner { return !hadError && SyntaxFacts.isIdentifierNameOrAnyKeyword(token) && width(token) === text.length(); } - // A parser source that gets its data from an underlying scanner. - export interface IScannerParserSource extends Parser.IParserSource { - // The position that the scanner is currently at. - absolutePosition(): number; - - // Resets the source to this position. Any diagnostics produced after this point will be - // removed. - resetToPosition(absolutePosition: number): void; - } - interface IScannerRewindPoint extends Parser.IRewindPoint { // Information used by normal parser source. absolutePosition: number; @@ -1497,7 +1439,7 @@ module TypeScript.Scanner { // Parser source used in batch scenarios. Directly calls into an underlying text scanner and // supports none of the functionality to reuse nodes. Good for when you just want want to do // a single parse of a file. - export function createParserSource(fileName: string, text: ISimpleText, languageVersion: ts.ScriptTarget): IScannerParserSource { + export function createParserSource(fileName: string, text: ISimpleText, languageVersion: ts.ScriptTarget): Parser.IParserSource { // The absolute position we're at in the text we're reading from. var _absolutePosition: number = 0; @@ -1511,35 +1453,30 @@ module TypeScript.Scanner { var rewindPointPool: IScannerRewindPoint[] = []; var rewindPointPoolCount = 0; - var lastDiagnostic: Diagnostic = null; + var lastDiagnostic: Diagnostic = undefined; var reportDiagnostic = (position: number, fullWidth: number, diagnosticKey: string, args: any[]) => { lastDiagnostic = new Diagnostic(fileName, text.lineMap(), position, fullWidth, diagnosticKey, args); }; // The sliding window that we store tokens in. - var slidingWindow = new SlidingWindow(fetchNextItem, ArrayUtilities.createArray(/*defaultWindowSize:*/ 1024, null), null); + var slidingWindow = new SlidingWindow(fetchNextItem, ArrayUtilities.createArray(/*defaultWindowSize:*/ 1024, undefined), undefined); // The scanner we're pulling tokens from. var scanner = createScanner(languageVersion, text, reportDiagnostic); function release() { - slidingWindow = null; - scanner = null; + slidingWindow = undefined; + scanner = undefined; _tokenDiagnostics = []; rewindPointPool = []; - lastDiagnostic = null; - reportDiagnostic = null; + lastDiagnostic = undefined; + reportDiagnostic = undefined; } function currentNode(): ISyntaxNode { // The normal parser source never returns nodes. They're only returned by the // incremental parser source. - return null; - } - - function consumeNode(node: ISyntaxNode): void { - // Should never get called. - throw Errors.invalidOperation(); + return undefined; } function absolutePosition() { @@ -1557,7 +1494,7 @@ module TypeScript.Scanner { rewindPointPoolCount--; var result = rewindPointPool[rewindPointPoolCount]; - rewindPointPool[rewindPointPoolCount] = null; + rewindPointPool[rewindPointPoolCount] = undefined; return result; } @@ -1593,7 +1530,7 @@ module TypeScript.Scanner { // Debug.assert(spaceAvailable > 0); var token = scanner.scan(allowContextualToken); - if (lastDiagnostic === null) { + if (lastDiagnostic === undefined) { return token; } @@ -1601,7 +1538,7 @@ module TypeScript.Scanner { // it won't be reused in incremental scenarios. _tokenDiagnostics.push(lastDiagnostic); - lastDiagnostic = null; + lastDiagnostic = undefined; return Syntax.realizeToken(token, text); } @@ -1609,11 +1546,20 @@ module TypeScript.Scanner { return slidingWindow.peekItemN(n); } - function consumeToken(token: ISyntaxToken): void { - // Debug.assert(currentToken() === token); - _absolutePosition += token.fullWidth(); - - slidingWindow.moveToNextItem(); + function consumeNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void { + if (nodeOrToken === slidingWindow.currentItemWithoutFetching()) { + // We're consuming the token that was just fetched from us by the parser. We just + // need to move ourselves forward and ditch this token from the sliding window. + _absolutePosition += (nodeOrToken).fullWidth(); + slidingWindow.moveToNextItem(); + } + else { + // We're either consuming a node, or we're consuming a token that wasn't from our + // sliding window. Both cases happen in incremental scenarios when the incremental + // parser uses a node or token from an older tree. In that case, we simply want to + // point ourselves at the end of the element that the parser just consumed. + resetToPosition(fullEnd(nodeOrToken)); + } } function currentToken(): ISyntaxToken { @@ -1628,22 +1574,24 @@ module TypeScript.Scanner { var diagnostic = _tokenDiagnostics[tokenDiagnosticsLength - 1]; if (diagnostic.start() >= position) { tokenDiagnosticsLength--; + _tokenDiagnostics.pop(); } else { break; } } - - _tokenDiagnostics.length = tokenDiagnosticsLength; } function resetToPosition(absolutePosition: number): void { Debug.assert(absolutePosition <= text.length(), "Trying to set the position outside the bounds of the text!"); + var resetBackward = absolutePosition <= _absolutePosition; _absolutePosition = absolutePosition; - // First, remove any diagnostics that came after this position. - removeDiagnosticsOnOrAfterPosition(absolutePosition); + if (resetBackward) { + // First, remove any diagnostics that came after this position. + removeDiagnosticsOnOrAfterPosition(absolutePosition); + } // Now, tell our sliding window to throw away all tokens after this position as well. slidingWindow.disgardAllItemsFromCurrentIndexOnwards(); @@ -1655,7 +1603,7 @@ module TypeScript.Scanner { function currentContextualToken(): ISyntaxToken { // We better be on a / or > token right now. - // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken().kind())); + // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken().kind)); // First, we're going to rewind all our data to the point where this / or /= token started. // That's because if it does turn out to be a regular expression, then any tokens or token @@ -1675,7 +1623,7 @@ module TypeScript.Scanner { // We have better gotten some sort of regex token. Otherwise, something *very* wrong has // occurred. - // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(token.kind())); + // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(token.kind)); return token; } @@ -1688,15 +1636,18 @@ module TypeScript.Scanner { currentToken: currentToken, currentContextualToken: currentContextualToken, peekToken: peekToken, - consumeNode: consumeNode, - consumeToken: consumeToken, + consumeNodeOrToken: consumeNodeOrToken, getRewindPoint: getRewindPoint, rewind: rewind, releaseRewindPoint: releaseRewindPoint, tokenDiagnostics: tokenDiagnostics, release: release, absolutePosition: absolutePosition, - resetToPosition: resetToPosition, }; } + + var fixedWidthArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 8, 8, 7, 6, 2, 4, 5, 7, 3, 8, 2, 2, 10, 3, 4, 6, 6, 4, 5, 4, 3, 6, 3, 4, 5, 4, 5, 5, 4, 6, 7, 6, 5, 10, 9, 3, 7, 7, 9, 6, 6, 5, 3, 7, 11, 7, 3, 6, 7, 6, 3, 6, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 2, 2, 2, 1, 2]; + function fixedWidthTokenLength(kind: SyntaxKind) { + return fixedWidthArray[kind]; + } } \ No newline at end of file diff --git a/src/services/syntax/scannerUtilities.generated.ts b/src/services/syntax/scannerUtilities.generated.ts index fbf1b1cb952..97f0093a672 100644 --- a/src/services/syntax/scannerUtilities.generated.ts +++ b/src/services/syntax/scannerUtilities.generated.ts @@ -1,8 +1,8 @@ /// module TypeScript { - export class ScannerUtilities { - public static identifierKind(str: string, start: number, length: number): SyntaxKind { + export module ScannerUtilities { + export function identifierKind(str: string, start: number, length: number): SyntaxKind { switch (length) { case 2: // do, if, in switch(str.charCodeAt(start)) { diff --git a/src/services/syntax/slidingWindow.ts b/src/services/syntax/slidingWindow.ts index d90fa4892c9..39502be24f3 100644 --- a/src/services/syntax/slidingWindow.ts +++ b/src/services/syntax/slidingWindow.ts @@ -163,11 +163,19 @@ module TypeScript { return this.window[this.currentRelativeItemIndex]; } + public currentItemWithoutFetching(): any { + if (this.currentRelativeItemIndex >= this.windowCount) { + return undefined; + } + + return this.window[this.currentRelativeItemIndex]; + } + public peekItemN(n: number): any { // Assert disabled because it is actually expensive enugh to affect perf. // Debug.assert(n >= 0); while (this.currentRelativeItemIndex + n >= this.windowCount) { - if (!this.addMoreItemsToWindow(/*argument:*/ null)) { + if (!this.addMoreItemsToWindow(/*argument:*/ undefined)) { return this.defaultValue; } } diff --git a/src/services/syntax/syntax.ts b/src/services/syntax/syntax.ts index 2cc55ba0620..e67865ae6aa 100644 --- a/src/services/syntax/syntax.ts +++ b/src/services/syntax/syntax.ts @@ -3,24 +3,13 @@ module TypeScript.Syntax { export var _nextSyntaxID: number = 1; - export function childIndex(parent: ISyntaxElement, child: ISyntaxElement) { - for (var i = 0, n = childCount(parent); i < n; i++) { - var current = childAt(parent, i); - if (current === child) { - return i; - } - } - - throw Errors.invalidOperation(); - } - export function nodeHasSkippedOrMissingTokens(node: ISyntaxNode): boolean { for (var i = 0; i < childCount(node); i++) { var child = childAt(node, i); if (isToken(child)) { var token = child; // If a token is skipped, return true. Or if it is a missing token. The only empty token that is not missing is EOF - if (token.hasSkippedToken() || (width(token) === 0 && token.kind() !== SyntaxKind.EndOfFileToken)) { + if (token.hasLeadingSkippedToken() || (fullWidth(token) === 0 && token.kind !== SyntaxKind.EndOfFileToken)) { return true; } } @@ -30,7 +19,7 @@ module TypeScript.Syntax { } export function isUnterminatedStringLiteral(token: ISyntaxToken): boolean { - if (token && token.kind() === SyntaxKind.StringLiteral) { + if (token && token.kind === SyntaxKind.StringLiteral) { var text = token.text(); return text.length < 2 || text.charCodeAt(text.length - 1) !== text.charCodeAt(0); } @@ -39,7 +28,7 @@ module TypeScript.Syntax { } export function isUnterminatedMultilineCommentTrivia(trivia: ISyntaxTrivia): boolean { - if (trivia && trivia.kind() === SyntaxKind.MultiLineCommentTrivia) { + if (trivia && trivia.kind === SyntaxKind.MultiLineCommentTrivia) { var text = trivia.fullText(); return text.length < 4 || text.substring(text.length - 2) !== "*/"; } @@ -53,145 +42,43 @@ module TypeScript.Syntax { return true; } else if (position === end) { - return trivia.kind() === SyntaxKind.SingleLineCommentTrivia || isUnterminatedMultilineCommentTrivia(trivia); + return trivia.kind === SyntaxKind.SingleLineCommentTrivia || isUnterminatedMultilineCommentTrivia(trivia); } } return false; } - export function isEntirelyInsideComment(sourceUnit: SourceUnitSyntax, position: number): boolean { - var positionedToken = findToken(sourceUnit, position); - var fullStart = positionedToken.fullStart(); - var triviaList: ISyntaxTriviaList = null; - var lastTriviaBeforeToken: ISyntaxTrivia = null; - - if (positionedToken.kind() === SyntaxKind.EndOfFileToken) { - // Check if the trivia is leading on the EndOfFile token - if (positionedToken.hasLeadingTrivia()) { - triviaList = positionedToken.leadingTrivia(); - } - // Or trailing on the previous token - else { - positionedToken = previousToken(positionedToken); - if (positionedToken) { - if (positionedToken && positionedToken.hasTrailingTrivia()) { - triviaList = positionedToken.trailingTrivia(); - fullStart = end(positionedToken); - } - } - } - } - else { - if (position <= (fullStart + positionedToken.leadingTriviaWidth())) { - triviaList = positionedToken.leadingTrivia(); - } - else if (position >= (fullStart + width(positionedToken))) { - triviaList = positionedToken.trailingTrivia(); - fullStart = end(positionedToken); - } - } - - if (triviaList) { - // Try to find the trivia matching the position - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (position <= fullStart) { - // Moved passed the trivia we need - break; - } - else if (position <= fullStart + trivia.fullWidth() && trivia.isComment()) { - // Found the comment trivia we were looking for - lastTriviaBeforeToken = trivia; - break; - } - - fullStart += trivia.fullWidth(); - } - } - - return lastTriviaBeforeToken && isEntirelyInsideCommentTrivia(lastTriviaBeforeToken, fullStart, position); - } - - export function isEntirelyInStringOrRegularExpressionLiteral(sourceUnit: SourceUnitSyntax, position: number): boolean { - var positionedToken = findToken(sourceUnit, position); - - if (positionedToken) { - if (positionedToken.kind() === SyntaxKind.EndOfFileToken) { - // EndOfFile token, enusre it did not follow an unterminated string literal - positionedToken = previousToken(positionedToken); - return positionedToken && positionedToken.trailingTriviaWidth() === 0 && isUnterminatedStringLiteral(positionedToken); - } - else if (position > start(positionedToken)) { - // Ensure position falls enterily within the literal if it is terminated, or the line if it is not - return (position < end(positionedToken) && (positionedToken.kind() === TypeScript.SyntaxKind.StringLiteral || positionedToken.kind() === TypeScript.SyntaxKind.RegularExpressionLiteral)) || - (position <= end(positionedToken) && isUnterminatedStringLiteral(positionedToken)); - } - } - - return false; - } - - function findSkippedTokenOnLeftInTriviaList(positionedToken: ISyntaxToken, position: number, lookInLeadingTriviaList: boolean): ISyntaxToken { - var triviaList: TypeScript.ISyntaxTriviaList = null; - var fullEnd: number; - - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullEnd = positionedToken.fullStart() + triviaList.fullWidth(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullEnd = TypeScript.fullEnd(positionedToken); - } - - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - - if (trivia.isSkippedToken() && position >= fullEnd) { - return trivia.skippedToken(); - } - - fullEnd -= triviaWidth; - } - } - - return null; - } - - export function findSkippedTokenOnLeft(positionedToken: ISyntaxToken, position: number): ISyntaxToken { - var positionInLeadingTriviaList = (position < start(positionedToken)); - return findSkippedTokenOnLeftInTriviaList(positionedToken, position, /*lookInLeadingTriviaList*/ positionInLeadingTriviaList); - } - export function getAncestorOfKind(positionedToken: ISyntaxElement, kind: SyntaxKind): ISyntaxElement { while (positionedToken && positionedToken.parent) { - if (positionedToken.parent.kind() === kind) { + if (positionedToken.parent.kind === kind) { return positionedToken.parent; } positionedToken = positionedToken.parent; } - return null; + return undefined; } export function hasAncestorOfKind(positionedToken: ISyntaxElement, kind: SyntaxKind): boolean { - return getAncestorOfKind(positionedToken, kind) !== null; + return !!getAncestorOfKind(positionedToken, kind); } export function isIntegerLiteral(expression: IExpressionSyntax): boolean { if (expression) { - switch (expression.kind()) { - case SyntaxKind.PlusExpression: - case SyntaxKind.NegateExpression: - // Note: if there is a + or - sign, we can only allow a normal integer following - // (and not a hex integer). i.e. -0xA is a legal expression, but it is not a - // *literal*. - expression = (expression).operand; - return isToken(expression) && IntegerUtilities.isInteger((expression).text()); + switch (expression.kind) { + case SyntaxKind.PrefixUnaryExpression: + var prefixExpr = expression; + if (prefixExpr.operatorToken.kind == SyntaxKind.PlusToken || prefixExpr.operatorToken.kind === SyntaxKind.MinusToken) { + // Note: if there is a + or - sign, we can only allow a normal integer following + // (and not a hex integer). i.e. -0xA is a legal expression, but it is not a + // *literal*. + expression = prefixExpr.operand; + return isToken(expression) && IntegerUtilities.isInteger((expression).text()); + } + + return false; case SyntaxKind.NumericLiteral: // If it doesn't have a + or -, then either an integer literal or a hex literal @@ -207,25 +94,21 @@ module TypeScript.Syntax { export function containingNode(element: ISyntaxElement): ISyntaxNode { var current = element.parent; - while (current !== null && !isNode(current)) { + while (current && !isNode(current)) { current = current.parent; } return current; } - export function findTokenOnLeft(element: ISyntaxElement, position: number, includeSkippedTokens: boolean = false): ISyntaxToken { - var positionedToken = findToken(element, position, /*includeSkippedTokens*/ false); + export function findTokenOnLeft(sourceUnit: SourceUnitSyntax, position: number): ISyntaxToken { + var positionedToken = findToken(sourceUnit, position); var _start = start(positionedToken); // Position better fall within this token. // Debug.assert(position >= positionedToken.fullStart()); // Debug.assert(position < positionedToken.fullEnd() || positionedToken.token().tokenKind === SyntaxKind.EndOfFileToken); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - // if position is after the start of the token, then this token is the token on the left. if (position > _start) { return positionedToken; @@ -234,50 +117,24 @@ module TypeScript.Syntax { // we're in the trivia before the start of the token. Need to return the previous token. if (positionedToken.fullStart() === 0) { // Already on the first token. Nothing before us. - return null; + return undefined; } - return previousToken(positionedToken, includeSkippedTokens); + return previousToken(positionedToken); } - export function findCompleteTokenOnLeft(element: ISyntaxElement, position: number, includeSkippedTokens: boolean = false): ISyntaxToken { - var positionedToken = findToken(element, position, /*includeSkippedTokens*/ false); + export function findCompleteTokenOnLeft(sourceUnit: SourceUnitSyntax, position: number): ISyntaxToken { + var positionedToken = findToken(sourceUnit, position); // Position better fall within this token. // Debug.assert(position >= positionedToken.fullStart()); // Debug.assert(position < positionedToken.fullEnd() || positionedToken.token().tokenKind === SyntaxKind.EndOfFileToken); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - // if position is after the end of the token, then this token is the token on the left. - if (width(positionedToken) > 0 && position >= end(positionedToken)) { + if (width(positionedToken) > 0 && position >= fullEnd(positionedToken)) { return positionedToken; } - return previousToken(positionedToken, includeSkippedTokens); - } - - export function firstTokenInLineContainingPosition(syntaxTree: SyntaxTree, position: number): ISyntaxToken { - var current = findToken(syntaxTree.sourceUnit(), position); - while (true) { - if (isFirstTokenInLine(current, syntaxTree.lineMap())) { - break; - } - - current = previousToken(current); - } - - return current; - } - - function isFirstTokenInLine(token: ISyntaxToken, lineMap: LineMap): boolean { - var _previousToken = previousToken(token); - if (_previousToken === null) { - return true; - } - - return lineMap.getLineNumberFromPosition(end(_previousToken)) !== lineMap.getLineNumberFromPosition(start(token)); + return previousToken(positionedToken); } } \ No newline at end of file diff --git a/src/services/syntax/syntaxElement.ts b/src/services/syntax/syntaxElement.ts index 211e8b1dd86..e14ecf33b69 100644 --- a/src/services/syntax/syntaxElement.ts +++ b/src/services/syntax/syntaxElement.ts @@ -1,52 +1,12 @@ /// module TypeScript { - // True if there is only a single instance of this element (and thus can be reused in many - // places in a syntax tree). Examples of this include our empty lists. Because empty - // lists can be found all over the tree, we want to save on memory by using this single - // instance instead of creating new objects for each case. Note: because of this, shared - // nodes don't have positions or parents. - export function isShared(element: ISyntaxElement): boolean { - var kind = element.kind(); - return (kind === SyntaxKind.List || kind === SyntaxKind.SeparatedList) && (element).length === 0; - } - - export function childCount(element: ISyntaxElement): number { - var kind = element.kind(); - if (kind === SyntaxKind.List) { - return (element).length; - } - else if (kind === SyntaxKind.SeparatedList) { - return (element).length + (element).separators.length; - } - else if (kind >= SyntaxKind.FirstToken && kind <= SyntaxKind.LastToken) { - return 0; - } - else { - return nodeMetadata[kind].length; - } - } - - export function childAt(element: ISyntaxElement, index: number): ISyntaxElement { - var kind = element.kind(); - if (kind === SyntaxKind.List) { - return (element)[index]; - } - else if (kind === SyntaxKind.SeparatedList) { - return (index % 2 === 0) ? (element)[index / 2] : (element).separators[(index - 1) / 2]; - } - else { - // Debug.assert(isNode(element)); - return (element)[nodeMetadata[element.kind()][index]]; - } - } - export function syntaxTree(element: ISyntaxElement): SyntaxTree { if (element) { - Debug.assert(!isShared(element)); + // Debug.assert(!isShared(element)); while (element) { - if (element.kind() === SyntaxKind.SourceUnit) { + if (element.kind === SyntaxKind.SourceUnit) { return (element).syntaxTree; } @@ -54,40 +14,41 @@ module TypeScript { } } - return null; + return undefined; } - export function parsedInStrictMode(node: ISyntaxNode): boolean { - var info = node.data; + export function parserContextFlags(node: ISyntaxNode): ParserContextFlags { + var info = node.__data; if (info === undefined) { - return false; + return 0; } - return (info & SyntaxConstants.NodeParsedInStrictModeMask) !== 0; + return info & ParserContextFlags.Mask; } - export function previousToken(token: ISyntaxToken, includeSkippedTokens: boolean = false): ISyntaxToken { - if (includeSkippedTokens) { - var triviaList = token.leadingTrivia(); - if (triviaList && triviaList.hasSkippedToken()) { - var currentTriviaEndPosition = TypeScript.start(token); - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } + export function parsedInStrictModeContext(node: ISyntaxNode): boolean { + return (parserContextFlags(node) & ParserContextFlags.StrictMode) !== 0; + } - currentTriviaEndPosition -= trivia.fullWidth(); - } - } - } + export function parsedInDisallowInContext(node: ISyntaxNode): boolean { + return (parserContextFlags(node) & ParserContextFlags.DisallowIn) !== 0; + } + export function parsedInYieldContext(node: ISyntaxNode): boolean { + return (parserContextFlags(node) & ParserContextFlags.Yield) !== 0; + } + + export function parsedInGeneratorParameterContext(node: ISyntaxNode): boolean { + return (parserContextFlags(node) & ParserContextFlags.GeneratorParameter) !== 0; + } + + export function previousToken(token: ISyntaxToken): ISyntaxToken { var start = token.fullStart(); if (start === 0) { - return null; + return undefined; } - return findToken(syntaxTree(token).sourceUnit(), start - 1, includeSkippedTokens); + return findToken(syntaxTree(token).sourceUnit(), start - 1); } /** @@ -103,136 +64,98 @@ module TypeScript { * Note: findToken will always return a non-missing token with width greater than or equal to * 1 (except for EOF). Empty tokens synthesized by the parser are never returned. */ - export function findToken(element: ISyntaxElement, position: number, includeSkippedTokens: boolean = false): ISyntaxToken { - var endOfFileToken = tryGetEndOfFileAt(element, position); - if (endOfFileToken !== null) { - return endOfFileToken; - } - - if (position < 0 || position >= fullWidth(element)) { + export function findToken(sourceUnit: SourceUnitSyntax, position: number): ISyntaxToken { + if (position < 0) { throw Errors.argumentOutOfRange("position"); } - var positionedToken = findTokenWorker(element, position); - - if (includeSkippedTokens) { - return findSkippedTokenInPositionedToken(positionedToken, position) || positionedToken; + var token = findTokenInNodeOrToken(sourceUnit, 0, position); + if (token) { + Debug.assert(token.fullWidth() > 0); + return token; } - // Could not find a better match - return positionedToken; - } - - export function findSkippedTokenInPositionedToken(positionedToken: ISyntaxToken, position: number): ISyntaxToken { - var positionInLeadingTriviaList = (position < start(positionedToken)); - return findSkippedTokenInTriviaList(positionedToken, position, /*lookInLeadingTriviaList*/ positionInLeadingTriviaList); - } - - export function findSkippedTokenInLeadingTriviaList(positionedToken: ISyntaxToken, position: number): ISyntaxToken { - return findSkippedTokenInTriviaList(positionedToken, position, /*lookInLeadingTriviaList*/ true); - } - - export function findSkippedTokenInTrailingTriviaList(positionedToken: ISyntaxToken, position: number): ISyntaxToken { - return findSkippedTokenInTriviaList(positionedToken, position, /*lookInLeadingTriviaList*/ false); - } - - function findSkippedTokenInTriviaList(positionedToken: ISyntaxToken, position: number, lookInLeadingTriviaList: boolean): ISyntaxToken { - var triviaList: TypeScript.ISyntaxTriviaList = null; - var fullStart: number; - - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullStart = positionedToken.fullStart(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullStart = end(positionedToken); + if (position === fullWidth(sourceUnit)) { + return sourceUnit.endOfFileToken; } - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - - if (trivia.isSkippedToken() && position >= fullStart && position <= fullStart + triviaWidth) { - return trivia.skippedToken(); - } - - fullStart += triviaWidth; - } - } - - return null; - } - - function findTokenWorker(element: ISyntaxElement, position: number): ISyntaxToken { - // Debug.assert(position >= 0 && position < this.fullWidth()); - if (isToken(element)) { - Debug.assert(fullWidth(element) > 0); - return element; - } - - if (isShared(element)) { - // This should never have been called on this element. It has a 0 width, so the client - // should have skipped over this. - throw Errors.invalidOperation(); - } - - // Consider: we could use a binary search here to find the child more quickly. - for (var i = 0, n = childCount(element); i < n; i++) { - var child = childAt(element, i); - - if (child !== null) { - var childFullWidth = fullWidth(child); - if (childFullWidth > 0) { - var childFullStart = fullStart(child); - - if (position >= childFullStart) { - var childFullEnd = childFullStart + childFullWidth; - - if (position < childFullEnd) { - return findTokenWorker(child, position); - } - } - } - } + if (position > fullWidth(sourceUnit)) { + throw Errors.argumentOutOfRange("position"); } throw Errors.invalidOperation(); } + function findTokenWorker(element: ISyntaxElement, elementPosition: number, position: number): ISyntaxToken { + if (isList(element)) { + return findTokenInList(element, elementPosition, position); + } + else { + return findTokenInNodeOrToken(element, elementPosition, position); + } + } + + function findTokenInList(list: ISyntaxNodeOrToken[], elementPosition: number, position: number): ISyntaxToken { + for (var i = 0, n = list.length; i < n; i++) { + var child = list[i]; + + var childFullWidth = fullWidth(child); + var elementEndPosition = elementPosition + childFullWidth; + + if (position < elementEndPosition) { + return findTokenWorker(child, elementPosition, position); + } + + elementPosition = elementEndPosition; + } + + return undefined; + } + + + function findTokenInNodeOrToken(nodeOrToken: ISyntaxNodeOrToken, elementPosition: number, position: number): ISyntaxToken { + if (isToken(nodeOrToken)) { + return nodeOrToken; + } + + for (var i = 0, n = childCount(nodeOrToken); i < n; i++) { + var child = nodeOrToken.childAt(i); + + if (child) { + var childFullWidth = fullWidth(child); + var elementEndPosition = elementPosition + childFullWidth; + + if (position < elementEndPosition) { + return findTokenWorker(child, elementPosition, position); + } + + elementPosition = elementEndPosition; + } + } + + return undefined; + } + function tryGetEndOfFileAt(element: ISyntaxElement, position: number): ISyntaxToken { - if (element.kind() === SyntaxKind.SourceUnit && position === fullWidth(element)) { + if (element.kind === SyntaxKind.SourceUnit && position === fullWidth(element)) { var sourceUnit = element; return sourceUnit.endOfFileToken; } - return null; + return undefined; } - export function nextToken(token: ISyntaxToken, text?: ISimpleText, includeSkippedTokens: boolean = false): ISyntaxToken { - if (token.kind() === SyntaxKind.EndOfFileToken) { - return null; + export function nextToken(token: ISyntaxToken, text?: ISimpleText): ISyntaxToken { + if (token.kind === SyntaxKind.EndOfFileToken) { + return undefined; } - if (includeSkippedTokens) { - var triviaList = token.trailingTrivia(text); - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - } - } - } - - return findToken(syntaxTree(token).sourceUnit(), fullEnd(token), includeSkippedTokens); + return findToken(syntaxTree(token).sourceUnit(), fullEnd(token)); } export function isNode(element: ISyntaxElement): boolean { - if (element !== null) { - var kind = element.kind(); + if (element) { + var kind = element.kind; return kind >= SyntaxKind.FirstNode && kind <= SyntaxKind.LastNode; } @@ -244,25 +167,21 @@ module TypeScript { } export function isToken(element: ISyntaxElement): boolean { - if (element !== null) { - return isTokenKind(element.kind()); + if (element) { + return isTokenKind(element.kind); } return false; } export function isList(element: ISyntaxElement): boolean { - return element !== null && element.kind() === SyntaxKind.List; - } - - export function isSeparatedList(element: ISyntaxElement): boolean { - return element !== null && element.kind() === SyntaxKind.SeparatedList; + return element instanceof Array; } export function syntaxID(element: ISyntaxElement): number { - if (isShared(element)) { - throw Errors.invalidOperation("Should not use shared syntax element as a key."); - } + //if (isShared(element)) { + // throw Errors.invalidOperation("Should not use shared syntax element as a key."); + //} var obj = element; if (obj._syntaxID === undefined) { @@ -301,69 +220,37 @@ module TypeScript { return token ? token.leadingTriviaWidth(text) : 0; } - export function trailingTriviaWidth(element: ISyntaxElement, text?: ISimpleText): number { - var token = lastToken(element); - return token ? token.trailingTriviaWidth(text) : 0; - } - export function firstToken(element: ISyntaxElement): ISyntaxToken { if (element) { - var kind = element.kind(); + var kind = element.kind; if (isTokenKind(kind)) { - return fullWidth(element) > 0 || element.kind() === SyntaxKind.EndOfFileToken ? element : null; + return (element).fullWidth() > 0 || kind === SyntaxKind.EndOfFileToken ? element : undefined; } - if (kind === SyntaxKind.List) { - var array = element; - for (var i = 0, n = array.length; i < n; i++) { - var token = firstToken(array[i]); - if (token) { - return token; - } - } - } - else if (kind === SyntaxKind.SeparatedList) { - var array = element; - var separators = array.separators; - for (var i = 0, n = array.length + separators.length; i < n; i++) { - var token = firstToken(i % 2 === 0 ? array[i / 2] : separators[(i - 1) / 2]); - if (token) { - return token; - } - } - } - else { - var metadata = nodeMetadata[kind]; - for (var i = 0, n = metadata.length; i < n; i++) { - var child = (element)[metadata[i]]; - var token = firstToken(child); - if (token) { - return token; - } - } - - if (element.kind() === SyntaxKind.SourceUnit) { - return (element).endOfFileToken; + for (var i = 0, n = childCount(element); i < n; i++) { + var token = firstToken(childAt(element, i)); + if (token) { + return token; } } } - return null; + return undefined; } export function lastToken(element: ISyntaxElement): ISyntaxToken { if (isToken(element)) { - return fullWidth(element) > 0 || element.kind() === SyntaxKind.EndOfFileToken ? element : null; + return fullWidth(element) > 0 || element.kind === SyntaxKind.EndOfFileToken ? element : undefined; } - if (element.kind() === SyntaxKind.SourceUnit) { + if (element.kind === SyntaxKind.SourceUnit) { return (element).endOfFileToken; } for (var i = childCount(element) - 1; i >= 0; i--) { var child = childAt(element, i); - if (child !== null) { + if (child) { var token = lastToken(child); if (token) { return token; @@ -371,11 +258,11 @@ module TypeScript { } } - return null; + return undefined; } export function fullStart(element: ISyntaxElement): number { - Debug.assert(!isShared(element)); + // Debug.assert(!isShared(element)); var token = isToken(element) ? element : firstToken(element); return token ? token.fullStart() : -1; } @@ -385,12 +272,8 @@ module TypeScript { return (element).fullWidth(); } - if (isShared(element)) { - return 0; - } - var info = data(element); - return info >>> SyntaxConstants.NodeFullWidthShift; + return (info / SyntaxNodeConstants.FullWidthShift) | 0; } export function isIncrementallyUnusable(element: ISyntaxElement): boolean { @@ -398,54 +281,74 @@ module TypeScript { return (element).isIncrementallyUnusable(); } - if (isShared(element)) { - // All shared lists are reusable. - return false; - } - - return (data(element) & SyntaxConstants.NodeIncrementallyUnusableMask) !== 0; + return (data(element) & SyntaxNodeConstants.IncrementallyUnusableMask) !== 0; } function data(element: ISyntaxElement): number { - Debug.assert(isNode(element) || isList(element) || isSeparatedList(element)); + // Debug.assert(isNode(element) || isList(element)); // Lists and nodes all have a 'data' element. - var dataElement = <{ data: number }>element; + var dataElement = element; - var info = dataElement.data; + var info = dataElement.__data; if (info === undefined) { info = 0; } - if ((info & SyntaxConstants.NodeDataComputed) === 0) { + if ((info & SyntaxNodeConstants.DataComputed) === 0) { info |= computeData(element); - dataElement.data = info; + dataElement.__data = info; } return info; } - function computeData(element: ISyntaxElement): number { - var slotCount = childCount(element); + function combineData(fullWidth: number, isIncrementallyUnusable: boolean) { + return (fullWidth * SyntaxNodeConstants.FullWidthShift) + + (isIncrementallyUnusable ? SyntaxNodeConstants.IncrementallyUnusableMask : 0) + + SyntaxNodeConstants.DataComputed; + } + function listComputeData(list: ISyntaxNodeOrToken[]): number { var fullWidth = 0; + var isIncrementallyUnusable = false; + + for (var i = 0, n = list.length; i < n; i++) { + var child: ISyntaxElement = list[i]; + + fullWidth += TypeScript.fullWidth(child); + isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); + } + + return combineData(fullWidth, isIncrementallyUnusable); + } + + function computeData(element: ISyntaxElement): number { + if (isList(element)) { + return listComputeData(element); + } + else { + return nodeOrTokenComputeData(element); + } + } + + function nodeOrTokenComputeData(nodeOrToken: ISyntaxNodeOrToken) { + var fullWidth = 0; + var slotCount = nodeOrToken.childCount; // If we have no children (like an OmmittedExpressionSyntax), we're automatically not reusable. var isIncrementallyUnusable = slotCount === 0; for (var i = 0, n = slotCount; i < n; i++) { - var child = childAt(element, i); + var child = nodeOrToken.childAt(i); if (child) { fullWidth += TypeScript.fullWidth(child); - isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); } } - return (fullWidth << SyntaxConstants.NodeFullWidthShift) - | (isIncrementallyUnusable ? SyntaxConstants.NodeIncrementallyUnusableMask : 0) - | SyntaxConstants.NodeDataComputed; + return combineData(fullWidth, isIncrementallyUnusable); } export function start(element: ISyntaxElement, text?: ISimpleText): number { @@ -453,16 +356,11 @@ module TypeScript { return token ? token.fullStart() + token.leadingTriviaWidth(text) : -1; } - export function end(element: ISyntaxElement, text?: ISimpleText): number { - var token = isToken(element) ? element : lastToken(element); - return token ? fullEnd(token) - token.trailingTriviaWidth(text) : -1; - } - export function width(element: ISyntaxElement, text?: ISimpleText): number { if (isToken(element)) { return (element).text().length; } - return fullWidth(element) - leadingTriviaWidth(element, text) - trailingTriviaWidth(element, text); + return fullWidth(element) - leadingTriviaWidth(element, text); } export function fullEnd(element: ISyntaxElement): number { @@ -474,21 +372,22 @@ module TypeScript { return false; } - if (token1 === null || token2 === null) { + if (!token1 || !token2) { return true; } var lineMap = text.lineMap(); - return lineMap.getLineNumberFromPosition(end(token1, text)) !== lineMap.getLineNumberFromPosition(start(token2, text)); + return lineMap.getLineNumberFromPosition(fullEnd(token1)) !== lineMap.getLineNumberFromPosition(start(token2, text)); } export interface ISyntaxElement { - kind(): SyntaxKind; - parent?: ISyntaxElement; + kind: SyntaxKind; + parent: ISyntaxElement; } export interface ISyntaxNode extends ISyntaxNodeOrToken { - data: number; + __data: number; + __cachedTokens: ISyntaxToken[]; } export interface IModuleReferenceSyntax extends ISyntaxNode { @@ -496,6 +395,7 @@ module TypeScript { } export interface IModuleElementSyntax extends ISyntaxNode { + _moduleElementBrand: any; } export interface IStatementSyntax extends IModuleElementSyntax { @@ -503,15 +403,28 @@ module TypeScript { } export interface ITypeMemberSyntax extends ISyntaxNode { + _typeMemberBrand: any; } export interface IClassElementSyntax extends ISyntaxNode { + _classElementBrand: any; } export interface IMemberDeclarationSyntax extends IClassElementSyntax { + _memberDeclarationBrand: any; } - export interface IPropertyAssignmentSyntax extends IClassElementSyntax { + export interface IPropertyAssignmentSyntax extends ISyntaxNodeOrToken { + _propertyAssignmentBrand: any; + } + + export interface IAccessorSyntax extends IPropertyAssignmentSyntax, IMemberDeclarationSyntax { + _accessorBrand: any; + + modifiers: ISyntaxToken[]; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } export interface ISwitchClauseSyntax extends ISyntaxNode { @@ -553,5 +466,10 @@ module TypeScript { } export interface INameSyntax extends ITypeSyntax { + _nameBrand: any; + } + + export interface IPropertyNameSyntax extends ISyntaxNodeOrToken { + _propertyNameBrand: any; } } \ No newline at end of file diff --git a/src/services/syntax/syntaxFacts.ts b/src/services/syntax/syntaxFacts.ts index 3b8d877429c..6f8b0edccae 100644 --- a/src/services/syntax/syntaxFacts.ts +++ b/src/services/syntax/syntaxFacts.ts @@ -134,7 +134,7 @@ module TypeScript.SyntaxFacts { export function getText(kind: SyntaxKind): string { var result = kindToText[kind]; - return result !== undefined ? result : null; + return result;// !== undefined ? result : undefined; } export function isAnyKeyword(kind: SyntaxKind): boolean { @@ -146,114 +146,60 @@ module TypeScript.SyntaxFacts { } export function isPrefixUnaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { - return getPrefixUnaryExpressionFromOperatorToken(tokenKind) !== SyntaxKind.None; + switch (tokenKind) { + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + case SyntaxKind.ExclamationToken: + case SyntaxKind.PlusPlusToken: + case SyntaxKind.MinusMinusToken: + return true; + default: + return false; + } } export function isBinaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { - return getBinaryExpressionFromOperatorToken(tokenKind) !== SyntaxKind.None; - } - - export function getPrefixUnaryExpressionFromOperatorToken(tokenKind: SyntaxKind): SyntaxKind { switch (tokenKind) { - case SyntaxKind.PlusToken: return SyntaxKind.PlusExpression; - case SyntaxKind.MinusToken: return SyntaxKind.NegateExpression; - case SyntaxKind.TildeToken: return SyntaxKind.BitwiseNotExpression; - case SyntaxKind.ExclamationToken: return SyntaxKind.LogicalNotExpression; - case SyntaxKind.PlusPlusToken: return SyntaxKind.PreIncrementExpression; - case SyntaxKind.MinusMinusToken: return SyntaxKind.PreDecrementExpression; - default: return SyntaxKind.None; - } - } - - export function getPostfixUnaryExpressionFromOperatorToken(tokenKind: SyntaxKind): SyntaxKind { - switch (tokenKind) { - case SyntaxKind.PlusPlusToken: return SyntaxKind.PostIncrementExpression; - case SyntaxKind.MinusMinusToken: return SyntaxKind.PostDecrementExpression; - default: return SyntaxKind.None; - } - } - - export function getBinaryExpressionFromOperatorToken(tokenKind: SyntaxKind): SyntaxKind { - switch (tokenKind) { - case SyntaxKind.AsteriskToken: return SyntaxKind.MultiplyExpression; - case SyntaxKind.SlashToken: return SyntaxKind.DivideExpression; - case SyntaxKind.PercentToken: return SyntaxKind.ModuloExpression; - case SyntaxKind.PlusToken: return SyntaxKind.AddExpression; - case SyntaxKind.MinusToken: return SyntaxKind.SubtractExpression; - case SyntaxKind.LessThanLessThanToken: return SyntaxKind.LeftShiftExpression; - case SyntaxKind.GreaterThanGreaterThanToken: return SyntaxKind.SignedRightShiftExpression; - case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: return SyntaxKind.UnsignedRightShiftExpression; - case SyntaxKind.LessThanToken: return SyntaxKind.LessThanExpression; - case SyntaxKind.GreaterThanToken: return SyntaxKind.GreaterThanExpression; - case SyntaxKind.LessThanEqualsToken: return SyntaxKind.LessThanOrEqualExpression; - case SyntaxKind.GreaterThanEqualsToken: return SyntaxKind.GreaterThanOrEqualExpression; - case SyntaxKind.InstanceOfKeyword: return SyntaxKind.InstanceOfExpression; - case SyntaxKind.InKeyword: return SyntaxKind.InExpression; - case SyntaxKind.EqualsEqualsToken: return SyntaxKind.EqualsWithTypeConversionExpression; - case SyntaxKind.ExclamationEqualsToken: return SyntaxKind.NotEqualsWithTypeConversionExpression; - case SyntaxKind.EqualsEqualsEqualsToken: return SyntaxKind.EqualsExpression; - case SyntaxKind.ExclamationEqualsEqualsToken: return SyntaxKind.NotEqualsExpression; - case SyntaxKind.AmpersandToken: return SyntaxKind.BitwiseAndExpression; - case SyntaxKind.CaretToken: return SyntaxKind.BitwiseExclusiveOrExpression; - case SyntaxKind.BarToken: return SyntaxKind.BitwiseOrExpression; - case SyntaxKind.AmpersandAmpersandToken: return SyntaxKind.LogicalAndExpression; - case SyntaxKind.BarBarToken: return SyntaxKind.LogicalOrExpression; - case SyntaxKind.BarEqualsToken: return SyntaxKind.OrAssignmentExpression; - case SyntaxKind.AmpersandEqualsToken: return SyntaxKind.AndAssignmentExpression; - case SyntaxKind.CaretEqualsToken: return SyntaxKind.ExclusiveOrAssignmentExpression; - case SyntaxKind.LessThanLessThanEqualsToken: return SyntaxKind.LeftShiftAssignmentExpression; - case SyntaxKind.GreaterThanGreaterThanEqualsToken: return SyntaxKind.SignedRightShiftAssignmentExpression; - case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: return SyntaxKind.UnsignedRightShiftAssignmentExpression; - case SyntaxKind.PlusEqualsToken: return SyntaxKind.AddAssignmentExpression; - case SyntaxKind.MinusEqualsToken: return SyntaxKind.SubtractAssignmentExpression; - case SyntaxKind.AsteriskEqualsToken: return SyntaxKind.MultiplyAssignmentExpression; - case SyntaxKind.SlashEqualsToken: return SyntaxKind.DivideAssignmentExpression; - case SyntaxKind.PercentEqualsToken: return SyntaxKind.ModuloAssignmentExpression; - case SyntaxKind.EqualsToken: return SyntaxKind.AssignmentExpression; - case SyntaxKind.CommaToken: return SyntaxKind.CommaExpression; - default: return SyntaxKind.None; - } - } - - export function getOperatorTokenFromBinaryExpression(tokenKind: SyntaxKind): SyntaxKind { - switch (tokenKind) { - case SyntaxKind.MultiplyExpression: return SyntaxKind.AsteriskToken; - case SyntaxKind.DivideExpression: return SyntaxKind.SlashToken; - case SyntaxKind.ModuloExpression: return SyntaxKind.PercentToken; - case SyntaxKind.AddExpression: return SyntaxKind.PlusToken; - case SyntaxKind.SubtractExpression: return SyntaxKind.MinusToken; - case SyntaxKind.LeftShiftExpression: return SyntaxKind.LessThanLessThanToken; - case SyntaxKind.SignedRightShiftExpression: return SyntaxKind.GreaterThanGreaterThanToken; - case SyntaxKind.UnsignedRightShiftExpression: return SyntaxKind.GreaterThanGreaterThanGreaterThanToken; - case SyntaxKind.LessThanExpression: return SyntaxKind.LessThanToken; - case SyntaxKind.GreaterThanExpression: return SyntaxKind.GreaterThanToken; - case SyntaxKind.LessThanOrEqualExpression: return SyntaxKind.LessThanEqualsToken; - case SyntaxKind.GreaterThanOrEqualExpression: return SyntaxKind.GreaterThanEqualsToken; - case SyntaxKind.InstanceOfExpression: return SyntaxKind.InstanceOfKeyword; - case SyntaxKind.InExpression: return SyntaxKind.InKeyword; - case SyntaxKind.EqualsWithTypeConversionExpression: return SyntaxKind.EqualsEqualsToken; - case SyntaxKind.NotEqualsWithTypeConversionExpression: return SyntaxKind.ExclamationEqualsToken; - case SyntaxKind.EqualsExpression: return SyntaxKind.EqualsEqualsEqualsToken; - case SyntaxKind.NotEqualsExpression: return SyntaxKind.ExclamationEqualsEqualsToken; - case SyntaxKind.BitwiseAndExpression: return SyntaxKind.AmpersandToken; - case SyntaxKind.BitwiseExclusiveOrExpression: return SyntaxKind.CaretToken; - case SyntaxKind.BitwiseOrExpression: return SyntaxKind.BarToken; - case SyntaxKind.LogicalAndExpression: return SyntaxKind.AmpersandAmpersandToken; - case SyntaxKind.LogicalOrExpression: return SyntaxKind.BarBarToken; - case SyntaxKind.OrAssignmentExpression: return SyntaxKind.BarEqualsToken; - case SyntaxKind.AndAssignmentExpression: return SyntaxKind.AmpersandEqualsToken; - case SyntaxKind.ExclusiveOrAssignmentExpression: return SyntaxKind.CaretEqualsToken; - case SyntaxKind.LeftShiftAssignmentExpression: return SyntaxKind.LessThanLessThanEqualsToken; - case SyntaxKind.SignedRightShiftAssignmentExpression: return SyntaxKind.GreaterThanGreaterThanEqualsToken; - case SyntaxKind.UnsignedRightShiftAssignmentExpression: return SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken; - case SyntaxKind.AddAssignmentExpression: return SyntaxKind.PlusEqualsToken; - case SyntaxKind.SubtractAssignmentExpression: return SyntaxKind.MinusEqualsToken; - case SyntaxKind.MultiplyAssignmentExpression: return SyntaxKind.AsteriskEqualsToken; - case SyntaxKind.DivideAssignmentExpression: return SyntaxKind.SlashEqualsToken; - case SyntaxKind.ModuloAssignmentExpression: return SyntaxKind.PercentEqualsToken; - case SyntaxKind.AssignmentExpression: return SyntaxKind.EqualsToken; - case SyntaxKind.CommaExpression: return SyntaxKind.CommaToken; - default: return SyntaxKind.None; + 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.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; } } diff --git a/src/services/syntax/syntaxFacts2.ts b/src/services/syntax/syntaxFacts2.ts index ec59a583e05..7c73eb31513 100644 --- a/src/services/syntax/syntaxFacts2.ts +++ b/src/services/syntax/syntaxFacts2.ts @@ -2,16 +2,8 @@ module TypeScript.SyntaxFacts { export function isDirectivePrologueElement(node: ISyntaxNodeOrToken): boolean { - if (node.kind() === SyntaxKind.ExpressionStatement) { - var expressionStatement = node; - var expression = expressionStatement.expression; - - if (expression.kind() === SyntaxKind.StringLiteral) { - return true; - } - } - - return false; + return node.kind === SyntaxKind.ExpressionStatement && + (node).expression.kind === SyntaxKind.StringLiteral; } export function isUseStrictDirective(node: ISyntaxNodeOrToken): boolean { @@ -23,7 +15,18 @@ module TypeScript.SyntaxFacts { } export function isIdentifierNameOrAnyKeyword(token: ISyntaxToken): boolean { - var tokenKind = token.kind(); + var tokenKind = token.kind; return tokenKind === SyntaxKind.IdentifierName || SyntaxFacts.isAnyKeyword(tokenKind); } + + export function isAccessibilityModifier(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: + return true; + } + + return false; + } } \ No newline at end of file diff --git a/src/services/syntax/syntaxGenerator.ts b/src/services/syntax/syntaxGenerator.ts index 21f65bb79e3..514a3220ab6 100644 --- a/src/services/syntax/syntaxGenerator.ts +++ b/src/services/syntax/syntaxGenerator.ts @@ -1,11 +1,10 @@ -/// -/// +/// +/// +/// /// /// +// /// -// Adds argument checking to the generated nodes. Argument checking appears to slow things down -// parsing about 7%. If we want to get that perf back, we can always remove this. -var argumentChecks = false; var forPrettyPrinter = false; interface ITypeDefinition { @@ -13,7 +12,6 @@ interface ITypeDefinition { baseType: string; interfaces?: string[]; children: IMemberDefinition[]; - syntaxKinds?: string[]; isTypeScriptSpecific: boolean; } @@ -25,13 +23,11 @@ interface IMemberDefinition { isSeparatedList?: boolean; requiresAtLeastOneItem?: boolean; isOptional?: boolean; - tokenKinds?: string[]; isTypeScriptSpecific: boolean; elementType?: string; - excludeFromAST?: boolean; } -var interfaces: TypeScript.IIndexable = { +var interfaces: any = { IMemberDeclarationSyntax: 'IClassElementSyntax', IStatementSyntax: 'IModuleElementSyntax', INameSyntax: 'ITypeSyntax', @@ -59,9 +55,9 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IModuleReferenceSyntax'], children: [ - { name: 'requireKeyword', isToken: true, tokenKinds: ['RequireKeyword'], excludeFromAST: true }, + { name: 'requireKeyword', isToken: true, excludeFromAST: true }, { name: 'openParenToken', isToken: true, excludeFromAST: true }, - { name: 'stringLiteral', isToken: true, tokenKinds: ['StringLiteral'] }, + { name: 'stringLiteral', isToken: true }, { name: 'closeParenToken', isToken: true, excludeFromAST: true } ], isTypeScriptSpecific: true @@ -82,7 +78,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'importKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'equalsToken', isToken: true, excludeFromAST: true }, { name: 'moduleReference', type: 'IModuleReferenceSyntax' }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } @@ -96,7 +92,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'exportKeyword', isToken: true, excludeFromAST: true }, { name: 'equalsToken', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } ], isTypeScriptSpecific: true @@ -108,7 +104,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'classKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, { name: 'heritageClauses', isList: true, elementType: 'HeritageClauseSyntax' }, { name: 'openBraceToken', isToken: true, excludeFromAST: true }, @@ -124,7 +120,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'interfaceKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, { name: 'heritageClauses', isList: true, elementType: 'HeritageClauseSyntax' }, { name: 'body', type: 'ObjectTypeSyntax' } @@ -135,10 +131,9 @@ var definitions:ITypeDefinition[] = [ name: 'HeritageClauseSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'extendsOrImplementsKeyword', isToken: true, tokenKinds: ['ExtendsKeyword', 'ImplementsKeyword'] }, + { name: 'extendsOrImplementsKeyword', isToken: true }, { name: 'typeNames', isSeparatedList: true, requiresAtLeastOneItem: true, elementType: 'INameSyntax' } ], - syntaxKinds: ["ExtendsHeritageClause", "ImplementsHeritageClause"], isTypeScriptSpecific: true }, { @@ -148,8 +143,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'moduleKeyword', isToken: true, excludeFromAST: true }, - { name: 'name', type: 'INameSyntax', isOptional: true }, - { name: 'stringLiteral', isToken: true, isOptional: true, tokenKinds: ['StringLiteral'] }, + { name: 'name', type: 'INameSyntax' }, { name: 'openBraceToken', isToken: true, excludeFromAST: true }, { name: 'moduleElements', isList: true, elementType: 'IModuleElementSyntax' }, { name: 'closeBraceToken', isToken: true, excludeFromAST: true } @@ -163,10 +157,18 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, { name: 'functionKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'identifier', isToken: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax', isOptional: true }, - { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } + ] + }, + { + name: 'ExpressionBody', + baseType: 'ISyntaxNode', + children: [ + { name: 'equalsGreaterThanToken', isToken: true, }, + { name: 'expression', type: 'IExpressionSyntax' } ] }, { @@ -191,7 +193,7 @@ var definitions:ITypeDefinition[] = [ name: 'VariableDeclaratorSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true }, { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } ] @@ -209,10 +211,9 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IUnaryExpressionSyntax'], children: [ - { name: 'operatorToken', isToken: true, tokenKinds: ['PlusPlusToken', 'MinusMinusToken', 'PlusToken', 'MinusToken', 'TildeToken', 'ExclamationToken'] }, + { name: 'operatorToken', isToken: true }, { name: 'operand', type: 'IUnaryExpressionSyntax' } ], - syntaxKinds: ["PreIncrementExpression", "PreDecrementExpression", "PlusExpression", "NegateExpression", "BitwiseNotExpression", "LogicalNotExpression"], }, { name: 'ArrayLiteralExpressionSyntax', @@ -247,8 +248,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'parameter', type: 'ParameterSyntax' }, { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, - { name: 'block', type: 'BlockSyntax', isOptional: true }, - { name: 'expression', type: 'IExpressionSyntax', isOptional: true } + { name: 'body', type: 'BlockSyntax | IExpressionSyntax' } ], isTypeScriptSpecific: true }, @@ -259,8 +259,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, - { name: 'block', type: 'BlockSyntax', isOptional: true }, - { name: 'expression', type: 'IExpressionSyntax', isOptional: true } + { name: 'body', type: 'BlockSyntax | IExpressionSyntax' } ], isTypeScriptSpecific: true }, @@ -271,7 +270,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'left', type: 'INameSyntax' }, { name: 'dotToken', isToken: true, excludeFromAST: true }, - { name: 'right', isToken: true, tokenKinds:['IdentifierName'] } + { name: 'right', isToken: true } ], // Qualified names only show up in Types, which are TypeScript specific. Note that a dotted // expression (like A.B.Foo()) is a MemberAccessExpression, not a QualifiedName. @@ -354,6 +353,39 @@ var definitions:ITypeDefinition[] = [ ], isTypeScriptSpecific: true }, + { + name: 'TupleTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'openBracketToken', isToken: true, excludeFromAST: true }, + { name: 'types', isSeparatedList: true, elementType: 'ITypeSyntax' }, + { name: 'closeBracketToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'UnionTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'left', type: 'ITypeSyntax' }, + { name: 'barToken', isToken: true, excludeFromAST: true }, + { name: 'right', type: 'ITypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ParenthesizedTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, { name: 'TypeAnnotationSyntax', baseType: 'ISyntaxNode', @@ -368,7 +400,8 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IStatementSyntax'], children: [ - { name: 'openBraceToken', isToken: true }, + { name: 'equalsGreaterThanToken', isToken: true, isOptional: 'true' }, + { name: 'openBraceToken', isToken: true, }, { name: 'statements', isList: true, elementType: 'IStatementSyntax' }, { name: 'closeBraceToken', isToken: true, excludeFromAST: true } ] @@ -379,7 +412,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'dotDotDotToken', isToken: true, isOptional: true, isTypeScriptSpecific: true }, { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'questionToken', isToken: true, isOptional: true, isTypeScriptSpecific: true }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true }, { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true, isTypeScriptSpecific: true } @@ -392,7 +425,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, { name: 'dotToken', isToken: true, excludeFromAST: true }, - { name: 'name', isToken: true, tokenKinds: ['IdentifierName'] } + { name: 'name', isToken: true } ] }, { @@ -401,9 +434,8 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IPostfixExpressionSyntax'], children: [ { name: 'operand', type: 'ILeftHandSideExpressionSyntax' }, - { name: 'operatorToken', isToken: true, tokenKinds:['PlusPlusToken', 'MinusMinusToken'] } + { name: 'operatorToken', isToken: true } ], - syntaxKinds: ["PostIncrementExpression", "PostDecrementExpression"], }, { name: 'ElementAccessExpressionSyntax', @@ -412,10 +444,36 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, { name: 'openBracketToken', isToken: true, excludeFromAST: true }, - { name: 'argumentExpression', type: 'IExpressionSyntax' }, + { name: 'argumentExpression', type: 'IExpressionSyntax', isOptional: true }, { name: 'closeBracketToken', isToken: true, excludeFromAST: true } ] }, + { + name: 'TemplateAccessExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'], + children: [ + { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'templateExpression', type: 'IPrimaryExpressionSyntax' } + ] + }, + { + name: 'TemplateExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'templateStartToken', isToken: true, excludeFromAST: true }, + { name: 'templateClauses', isList: true, elementType: 'TemplateClauseSyntax' } + ] + }, + { + name: 'TemplateClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'templateMiddleOrEndToken', isToken: true, elementType: 'TemplateSpanSyntax' } + ] + }, { name: 'InvocationExpressionSyntax', baseType: 'ISyntaxNode', @@ -441,27 +499,9 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IExpressionSyntax'], children: [ { name: 'left', type: 'IExpressionSyntax' }, - { name: 'operatorToken', isToken: true, - tokenKinds:['AsteriskToken', 'SlashToken', 'PercentToken', 'PlusToken', 'MinusToken', 'LessThanLessThanToken', - 'GreaterThanGreaterThanToken', 'GreaterThanGreaterThanGreaterThanToken', 'LessThanToken', - 'GreaterThanToken', 'LessThanEqualsToken', 'GreaterThanEqualsToken', 'InstanceOfKeyword', - 'InKeyword', 'EqualsEqualsToken', 'ExclamationEqualsToken', 'EqualsEqualsEqualsToken', - 'ExclamationEqualsEqualsToken', 'AmpersandToken', 'CaretToken', 'BarToken', 'AmpersandAmpersandToken', - 'BarBarToken', 'BarEqualsToken', 'AmpersandEqualsToken', 'CaretEqualsToken', 'LessThanLessThanEqualsToken', - 'GreaterThanGreaterThanEqualsToken', 'GreaterThanGreaterThanGreaterThanEqualsToken', 'PlusEqualsToken', - 'MinusEqualsToken', 'AsteriskEqualsToken', 'SlashEqualsToken', 'PercentEqualsToken', 'EqualsToken', - 'CommaToken'] }, + { name: 'operatorToken', isToken: true }, { name: 'right', type: 'IExpressionSyntax' } ], - syntaxKinds: ["MultiplyExpression", "DivideExpression", "ModuloExpression", "AddExpression", "SubtractExpression", "LeftShiftExpression", - "SignedRightShiftExpression", "UnsignedRightShiftExpression", "LessThanExpression", - "GreaterThanExpression", "LessThanOrEqualExpression", "GreaterThanOrEqualExpression", "InstanceOfExpression", - "InExpression", "EqualsWithTypeConversionExpression", "NotEqualsWithTypeConversionExpression", "EqualsExpression", - "NotEqualsExpression", "BitwiseAndExpression", "BitwiseExclusiveOrExpression", "BitwiseOrExpression", "LogicalAndExpression", - "LogicalOrExpression", "OrAssignmentExpression", "AndAssignmentExpression", "ExclusiveOrAssignmentExpression", "LeftShiftAssignmentExpression", - "SignedRightShiftAssignmentExpression", "UnsignedRightShiftAssignmentExpression", "AddAssignmentExpression", - "SubtractAssignmentExpression", "MultiplyAssignmentExpression", "DivideAssignmentExpression", "ModuloAssignmentExpression", "AssignmentExpression", - "CommaExpression"] }, { name: 'ConditionalExpressionSyntax', @@ -490,7 +530,7 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['ITypeMemberSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'questionToken', isToken: true, isOptional: true, itTypeScriptSpecific: true }, { name: 'callSignature', type: 'CallSignatureSyntax' } ] @@ -512,7 +552,7 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['ITypeMemberSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'questionToken', isToken: true, isOptional: true }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true } ], @@ -551,7 +591,7 @@ var definitions:ITypeDefinition[] = [ name: 'TypeParameterSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'constraint', type: 'ConstraintSyntax', isOptional: true } ], isTypeScriptSpecific: true @@ -604,8 +644,7 @@ var definitions:ITypeDefinition[] = [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'constructorKeyword', isToken: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax', isOptional: true }, - { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, @@ -615,35 +654,35 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IMemberDeclarationSyntax'], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax', isOptional: true }, - { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, { name: 'GetAccessorSyntax', baseType: 'ISyntaxNode', - interfaces: ['IMemberDeclarationSyntax', 'IPropertyAssignmentSyntax' ], + interfaces: ['IAccessorSyntax' ], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, { name: 'getKeyword', isToken: true, excludeFromAST: true }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ] }, { name: 'SetAccessorSyntax', baseType: 'ISyntaxNode', - interfaces: ['IMemberDeclarationSyntax', 'IPropertyAssignmentSyntax'], + interfaces: ['IAccessorSyntax'], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, { name: 'setKeyword', isToken: true, excludeFromAST: true }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, @@ -675,7 +714,7 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IStatementSyntax'], children: [ { name: 'throwKeyword', isToken: true, excludeFromAST: true }, - { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'expression', type: 'IExpressionSyntax', isOptional: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } ] }, @@ -740,7 +779,7 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IStatementSyntax'], children: [ { name: 'breakKeyword', isToken: true }, - { name: 'identifier', isToken: true, isOptional: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true, isOptional: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } ] }, @@ -750,7 +789,7 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IStatementSyntax'], children: [ { name: 'continueKeyword', isToken: true }, - { name: 'identifier', isToken: true, isOptional: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true, isOptional: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } ] }, @@ -761,11 +800,10 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'forKeyword', isToken: true, excludeFromAST: true }, { name: 'openParenToken', isToken: true, excludeFromAST: true }, - { name: 'variableDeclaration', type: 'VariableDeclarationSyntax', isOptional: true }, - { name: 'initializer', type: 'IExpressionSyntax', isOptional: true }, - { name: 'firstSemicolonToken', isToken: true, tokenKinds: ['SemicolonToken'], excludeFromAST: true }, + { name: 'initializer', type: 'VariableDeclarationSyntax | IExpressionSyntax', isOptional: true }, + { name: 'firstSemicolonToken', isToken: true, excludeFromAST: true }, { name: 'condition', type: 'IExpressionSyntax', isOptional: true }, - { name: 'secondSemicolonToken', isToken: true, tokenKinds: ['SemicolonToken'], excludeFromAST: true }, + { name: 'secondSemicolonToken', isToken: true, excludeFromAST: true }, { name: 'incrementor', type: 'IExpressionSyntax', isOptional: true }, { name: 'closeParenToken', isToken: true, excludeFromAST: true }, { name: 'statement', type: 'IStatementSyntax' } @@ -778,10 +816,9 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'forKeyword', isToken: true, excludeFromAST: true }, { name: 'openParenToken', isToken: true, excludeFromAST: true }, - { name: 'variableDeclaration', type: 'VariableDeclarationSyntax', isOptional: true }, - { name: 'left', type: 'IExpressionSyntax', isOptional: true }, + { name: 'left', type: 'VariableDeclarationSyntax | IExpressionSyntax' }, { name: 'inKeyword', isToken: true, excludeFromAST: true }, - { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'right', type: 'IExpressionSyntax' }, { name: 'closeParenToken', isToken: true, excludeFromAST: true }, { name: 'statement', type: 'IStatementSyntax' } ] @@ -817,7 +854,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'enumKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'openBraceToken', isToken: true, excludeFromAST: true }, { name: 'enumElements', isSeparatedList: true, elementType: 'EnumElementSyntax' }, { name: 'closeBraceToken', isToken: true, excludeFromAST: true } @@ -828,7 +865,7 @@ var definitions:ITypeDefinition[] = [ name: 'EnumElementSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } ] }, @@ -854,12 +891,22 @@ var definitions:ITypeDefinition[] = [ { name: 'closeBraceToken', isToken: true, excludeFromAST: true } ] }, + { + name: 'ComputedPropertyNameSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPropertyNameSyntax'], + children: [ + { name: 'openBracketToken', isToken: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'closeBracketToken', isToken: true } + ] + }, { name: 'SimplePropertyAssignmentSyntax', baseType: 'ISyntaxNode', interfaces: ['IPropertyAssignmentSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'colonToken', isToken: true, excludeFromAST: true }, { name: 'expression', type: 'IExpressionSyntax' } ] @@ -869,9 +916,10 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IPropertyAssignmentSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ] }, { @@ -880,9 +928,10 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IPrimaryExpressionSyntax'], children: [ { name: 'functionKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, isOptional: true, tokenKinds: ['IdentifierName'] }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'identifier', isToken: true, isOptional: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' }] + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true }] }, { name: 'EmptyStatementSyntax', @@ -907,7 +956,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'catchKeyword', isToken: true, excludeFromAST: true }, { name: 'openParenToken', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecified: true }, { name: 'closeParenToken', isToken: true, excludeFromAST: true }, { name: 'block', type: 'BlockSyntax' }] @@ -924,7 +973,7 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IStatementSyntax'], children: [ - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'colonToken', isToken: true, excludeFromAST: true }, { name: 'statement', type: 'IStatementSyntax' }] }, @@ -965,6 +1014,15 @@ var definitions:ITypeDefinition[] = [ { name: 'voidKeyword', isToken: true, excludeFromAST: true }, { name: 'expression', type: 'IUnaryExpressionSyntax' }] }, + { + name: 'YieldExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IExpressionSyntax'], + children: [ + { name: 'yieldKeyword', isToken: true }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'expression', type: 'IExpressionSyntax', isOptional: true }] + }, { name: 'DebuggerStatementSyntax', baseType: 'ISyntaxNode', @@ -975,19 +1033,11 @@ var definitions:ITypeDefinition[] = [ }]; function firstKind(definition: ITypeDefinition): TypeScript.SyntaxKind { - var kindName = definition.syntaxKinds ? definition.syntaxKinds[0] : getNameWithoutSuffix(definition); - //TypeScript.Environment.standardOut.WriteLine(kindName); - var kind = (TypeScript.SyntaxKind)[kindName]; - //TypeScript.Environment.standardOut.WriteLine(kind); - - return kind; + var kindName = getNameWithoutSuffix(definition); + return (TypeScript.SyntaxKind)[kindName]; } -var sortedDefinitions = definitions.sort((d1, d2) => firstKind(d1) - firstKind(d2)); - -//function endsWith(string: string, value: string): boolean { -// return string.substring(string.length - value.length, string.length) === value; -//} +definitions.sort((d1, d2) => firstKind(d1) - firstKind(d2)); function getStringWithoutSuffix(definition: string) { if (TypeScript.StringUtilities.endsWith(definition, "Syntax")) { @@ -997,14 +1047,6 @@ function getStringWithoutSuffix(definition: string) { return definition; } -function getStringWithoutPrefix(definition: string) { - if (definition.charAt(0) == "I" && definition.charAt(1).toUpperCase() == definition.charAt(1)) { - return definition.substring(1); - } - - return definition; -} - function getNameWithoutSuffix(definition: ITypeDefinition) { return getStringWithoutSuffix(definition.name); } @@ -1014,7 +1056,7 @@ function getType(child: IMemberDefinition): string { return "ISyntaxToken"; } else if (child.isSeparatedList) { - return child.elementType + "[]"; + return "ISeparatedSyntaxList<" + child.elementType + ">"; } else if (child.isList) { return child.elementType + "[]"; @@ -1024,12 +1066,6 @@ function getType(child: IMemberDefinition): string { } } -var hasKind = false; - -function pascalCase(value: string): string { - return value.substr(0, 1).toUpperCase() + value.substr(1); -} - function camelCase(value: string): string { return value.substr(0, 1).toLowerCase() + value.substr(1); } @@ -1042,968 +1078,76 @@ function getSafeName(child: IMemberDefinition) { return child.name; } -function getPropertyAccess(child: IMemberDefinition, instance = "this"): string { - if (child.type === "SyntaxKind") { - return instance + "._kind"; - } - - return instance + "." + child.name; -} - -function generateProperties(definition: ITypeDefinition): string { - var result = ""; - - if (definition.name === "SourceUnitSyntax") { - result += " public syntaxTree: SyntaxTree = null;\r\n"; - } - - var newLine = false; - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - - if (getType(child) === "SyntaxKind") { - result += " private _" + child.name + ": " + getType(child) + ";\r\n"; - newLine = true; - } - else if (child.name === "arguments") { - result += " public " + child.name + ": " + getType(child) + ";\r\n"; - } - - hasKind = hasKind || (getType(child) === "SyntaxKind"); - } - - if (newLine) { - result += "\r\n"; - } - - return result; -} - -function generateNullChecks(definition: ITypeDefinition): string { - var result = ""; +function generateConstructorFunction(definition: ITypeDefinition) { + var result = " export var " + definition.name + ": " + getNameWithoutSuffix(definition) + "Constructor = function(data: number"; for (var i = 0; i < definition.children.length; i++) { var child = definition.children[i]; - - if (!child.isOptional && !child.isToken) { - result += " if (" + child.name + " === null) { throw Errors.argumentNull('" + child.name + "'); }\r\n"; - } - } - - return result; -} - -function generateIfKindCheck(child: IMemberDefinition, tokenKinds: string[], indent: string): string { - var result = ""; - - result += indent + " if ("; - - for (var j = 0; j < tokenKinds.length; j++) { - if (j > 0) { - result += " && "; - } - - var tokenKind = tokenKinds[j]; - if (tokenKind === "IdentifierName") { - result += "!SyntaxFacts.isIdentifierName(" + child.name + ".tokenKind)"; - } - else { - result += child.name + ".tokenKind !== SyntaxKind." + tokenKind; - } - } - - result += ") { throw Errors.argument('" + child.name + "'); }\r\n"; - return result; -} - -function generateSwitchCase(tokenKind: string, indent: string): string { - return indent + " case SyntaxKind." + tokenKind + ":\r\n"; -} - -function generateBreakStatement(indent: string): string { - return indent + " break;\r\n"; -} - -function generateSwitchCases(tokenKinds: string[], indent: string): string { - var result = ""; - for (var j = 0; j < tokenKinds.length; j++) { - var tokenKind = tokenKinds[j]; - - result += generateSwitchCase(tokenKind, indent); - } - - if (tokenKinds.length > 0) { - result += generateBreakStatement(indent); - } - - return result; -} - -function generateDefaultCase(child: IMemberDefinition, indent: string): string { - var result = ""; - - result += indent + " default:\r\n"; - result += indent + " throw Errors.argument('" + child.name + "');\r\n"; - - return result; -} - -function generateSwitchKindCheck(child: IMemberDefinition, tokenKinds: string[], indent: string): string { - if (tokenKinds.length === 0) { - return ""; - } - - var result = ""; - - var identifierName = TypeScript.ArrayUtilities.where(tokenKinds, v => v.indexOf("IdentifierName") >= 0); - var notIdentifierName = TypeScript.ArrayUtilities.where(tokenKinds, v => v.indexOf("IdentifierName") < 0); - - if (identifierName.length > 0) { - result += indent + " if (!SyntaxFacts.isIdentifierName(" + child.name + ".tokenKind)) {\r\n"; - if (notIdentifierName.length === 0) { - result += indent + " throw Errors.argument('" + child.name + "');\r\n"; - result += indent + " }\r\n"; - return result; - } - - indent += " "; - } - - if (notIdentifierName.length <= 2) { - result += generateIfKindCheck(child, notIdentifierName, indent); - } - else if (notIdentifierName.length > 2) { - result += indent + " switch (" + child.name + ".tokenKind) {\r\n"; - result += generateSwitchCases(notIdentifierName, indent); - result += generateDefaultCase(child, indent); - result += indent + " }\r\n"; - } - - if (identifierName.length > 0) { - result += indent + " }\r\n"; - } - - // result += indent + " }\r\n"; - return result; -} - -function tokenKinds(child: IMemberDefinition): string[] { - return child.tokenKinds - ? child.tokenKinds - : [pascalCase(child.name)]; -} - -function generateKindCheck(child: IMemberDefinition): string { - var indent = ""; - var result = ""; - - if (child.isOptional) { - indent = " "; - - result += " if (" + child.name + " !== null) {\r\n"; - } - - var kinds = tokenKinds(child); - - if (kinds.length <= 2) { - result += generateIfKindCheck(child, kinds, indent); - } - else { - result += generateSwitchKindCheck(child, kinds, indent); - } - - if (child.isOptional) { - result += " }\r\n"; - } - - return result; -} - -function generateKindChecks(definition: ITypeDefinition): string { - var result = ""; - - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - - if (child.isToken) { - result += generateKindCheck(child); - } - } - - return result; -} - -function generateArgumentChecks(definition: ITypeDefinition): string { - var result = ""; - - if (argumentChecks) { - result += generateNullChecks(definition); - result += generateKindChecks(definition); - - if (definition.children.length > 0) { - result += "\r\n"; - } - } - - return result; -} - -function generateConstructor(definition: ITypeDefinition): string { - var i: number; - var child: IMemberDefinition; - var base = baseType(definition); - - var result = ""; - result += " constructor(" - - var children = definition.children; - var kindChild: IMemberDefinition = null; - for (i = 0; i < children.length; i++) { - child = children[i]; - - if (getType(child) === "SyntaxKind") { - kindChild = child; - } - - if (getType(child) !== "SyntaxKind" && child.name !== "arguments") { - result += "public "; - } - - result += getSafeName(child) + ": " + getType(child); - result += ",\r\n "; - } - - result += "data: number) {\r\n"; - - if (kindChild) { - result += " super(kind, data); \r\n"; - } - else { - result += " super(SyntaxKind." + getNameWithoutSuffix(definition) + ", data); \r\n"; - } - - if (definition.children.length > 0) { - result += "\r\n"; - } - - result += generateArgumentChecks(definition); - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - if (child.type === "SyntaxKind" || child.name === "arguments") { - result += " " + getPropertyAccess(child) + " = " + getSafeName(child) + ";\r\n"; - } - } - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - if (child.type !== "SyntaxKind") { - if (child.isOptional) { - result += " " + getSafeName(child) + " && (" + getSafeName(child) + ".parent = this);\r\n"; - } - else if (child.isList || child.isSeparatedList) { - result += " !isShared(" + getSafeName(child) + ") && (" + getSafeName(child) + ".parent = this);\r\n"; - } - else { - result += " " + getSafeName(child) + ".parent = this;\r\n"; - } - } - } - - //result += " Syntax.setParentForChildren(this);\r\n"; - result += " }\r\n"; - - return result; -} - -function isOptional(child: IMemberDefinition) { - if (child.isOptional) { - return true; - } - - if (child.isList && !child.requiresAtLeastOneItem) { - return true; - } - - if (child.isSeparatedList && !child.requiresAtLeastOneItem) { - return true; - } - - return false; -} - -function generateFactory1Method(definition: ITypeDefinition): string { - return ""; - - var mandatoryChildren = TypeScript.ArrayUtilities.where( - definition.children, c => !isOptional(c)); - if (mandatoryChildren.length === definition.children.length) { - return ""; - } - - var result = "\r\n public static create(" - var i: number; - var child: IMemberDefinition; - - for (i = 0; i < mandatoryChildren.length; i++) { - child = mandatoryChildren[i]; - - result += child.name + ": " + getType(child); - - if (i < mandatoryChildren.length - 1) { - result += ",\r\n "; - } - } - - result += "): " + definition.name + " {\r\n"; - - result += " return new " + definition.name + "("; - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - if (!isOptional(child)) { - result += child.name; - } - else if (child.isList) { - result += "Syntax.emptyList<" + child.elementType + ">()"; - } - else if (child.isSeparatedList) { - result += "Syntax.emptySeparatedList<" + child.elementType + ">()"; - } - else { - result += "null"; - } - result += ", "; - } - - result += "/*data:*/ 0);\r\n"; - result += " }\r\n"; - - return result; -} - -function isKeywordOrPunctuation(kind: string): boolean { - if (TypeScript.StringUtilities.endsWith(kind, "Keyword")) { - return true; - } - - if (TypeScript.StringUtilities.endsWith(kind, "Token") && - kind !== "IdentifierName" && - kind !== "EndOfFileToken") { - return true; - } - - return false; -} - -function isDefaultConstructable(definition: ITypeDefinition): boolean { - if (definition === null) { - return false; - } - - for (var i = 0; i < definition.children.length; i++) { - if (isMandatory(definition.children[i])) { - // If any child is mandatory, then the type is not default constructable. - return false; - } - } - - // We can default construct this. - return true; -} - -function isMandatory(child: IMemberDefinition): boolean { - // If it's optional then it's not mandatory. - if (isOptional(child)) { - return false; - } - - // Kinds are always mandatory. As are non-optional lists. - if (child.type === "SyntaxKind" || child.isList || child.isSeparatedList) { - return true; - } - - // We have a non optional node or token. Tokens are mandatory if they're not keywords or - // punctuation. - if (child.isToken) { - var kinds = tokenKinds(child); - var isFixed = kinds.length === 1 && isKeywordOrPunctuation(kinds[0]); - - return !isFixed; - } - - // It's a node. It's mandatory if we can't default construct it. - return !isDefaultConstructable(memberDefinitionType(child)); -} - -function generateFactory2Method(definition: ITypeDefinition): string { - return ""; - - var mandatoryChildren: IMemberDefinition[] = TypeScript.ArrayUtilities.where(definition.children, isMandatory); - if (mandatoryChildren.length === definition.children.length) { - return ""; - } - - var i: number; - var child: IMemberDefinition; - var result = "\r\n public static create1(" - - for (i = 0; i < mandatoryChildren.length; i++) { - child = mandatoryChildren[i]; - - result += child.name + ": " + getType(child); - - if (i < mandatoryChildren.length - 1) { - result += ",\r\n "; - } - } - - result += "): " + definition.name + " {\r\n"; - result += " return new " + definition.name + "("; - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - if (isMandatory(child)) { - result += child.name; - } - else if (child.isList) { - result += "Syntax.emptyList<" + child.elementType + ">()"; - } - else if (child.isSeparatedList) { - result += "Syntax.emptySeparatedList<" + child.elementType + ">()"; - } - else if (isOptional(child)) { - result += "null"; - } - else if (child.isToken) { - result += "Syntax.token(SyntaxKind." + tokenKinds(child)[0] + ")"; - } - else { - result += child.type + ".create1()"; - } - - result += ", "; - } - - result += "/*data:*/ 0);\r\n"; - result += " }\r\n"; - - return result; -} - -function generateFactoryMethod(definition: ITypeDefinition): string { - return generateFactory1Method(definition) + generateFactory2Method(definition); -} - -function generateBrands(definition: ITypeDefinition, accessibility: boolean): string { - var properties = ""; - - var types: string[] = []; - if (definition.interfaces) { - var ifaces = definition.interfaces.slice(0); - var i: number; - for (i = 0; i < ifaces.length; i++) { - var current = ifaces[i]; - - while (current !== undefined) { - if (!TypeScript.ArrayUtilities.contains(ifaces, current)) { - ifaces.push(current); - } - - current = interfaces[current]; - } - } - - for (i = 0; i < ifaces.length; i++) { - var type = ifaces[i]; - type = getStringWithoutSuffix(type); - if (isInterface(type)) { - type = "_" + type.substr(1, 1).toLowerCase() + type.substr(2) + "Brand"; - } - - types.push(type); - } - } - - if (types.length > 0) { - properties += " "; - - for (var i = 0; i < types.length; i++) { - if (accessibility) { - properties += " public "; - } - - properties += types[i] + ": any;"; - } - - properties += "\r\n"; - } - - return properties; -} - -function generateKindMethod(definition: ITypeDefinition): string { - var result = ""; - - //if (!hasKind) { - // result += "\r\n"; - // result += " public get kind(): SyntaxKind {\r\n"; - // result += " return SyntaxKind." + getNameWithoutSuffix(definition) + ";\r\n"; - // result += " }\r\n"; - //} - - return result; -} - -function generateSlotMethods(definition: ITypeDefinition): string { - var result = ""; - return result; - - result += "\r\n"; - result += " public childCount(): number {\r\n"; - var slotCount = hasKind ? (definition.children.length - 1) : definition.children.length; - - result += " return " + slotCount + ";\r\n"; - result += " }\r\n\r\n"; - - result += " public childAt(slot: number): ISyntaxElement {\r\n"; - - if (slotCount === 0) { - result += " throw Errors.invalidOperation();\r\n"; - } - else { - result += " switch (slot) {\r\n"; - - var index = 0; - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - if (child.type === "SyntaxKind") { - continue; - } - - result += " case " + index + ": return this." + child.name + ";\r\n"; - index++; - } - - result += " default: throw Errors.invalidOperation();\r\n"; - result += " }\r\n"; - } - - result += " }\r\n"; - - return result; -} - -function generateFirstTokenMethod(definition: ITypeDefinition): string { - var result = ""; - - result += "\r\n"; - result += " public firstToken(): ISyntaxToken {\r\n"; - result += " var token = null;\r\n"; - - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - - if (getType(child) === "SyntaxKind") { - continue; - } - - if (child.name === "endOfFileToken") { - continue; - } - - result += " if ("; - - if (child.isOptional) { - result += getPropertyAccess(child) + " !== null && "; - } - - if (child.isToken) { - result += getPropertyAccess(child) + ".width() > 0"; - result += ") { return " + getPropertyAccess(child) + "; }\r\n"; - } - else { - result += "(token = " + getPropertyAccess(child) + ".firstToken()) !== null"; - result += ") { return token; }\r\n"; - } - } - - if (definition.name === "SourceUnitSyntax") { - result += " return this._endOfFileToken;\r\n"; - } - else { - result += " return null;\r\n"; - } - - result += " }\r\n"; - - result += " }\r\n"; - - return result; -} - -function generateLastTokenMethod(definition: ITypeDefinition): string { - var result = ""; - - result += "\r\n"; - result += " public lastToken(): ISyntaxToken {\r\n"; - - if (definition.name === "SourceUnitSyntax") { - result += " return this._endOfFileToken;\r\n"; - } - else { - result += " var token = null;\r\n"; - - for (var i = definition.children.length - 1; i >= 0; i--) { - var child = definition.children[i]; - - if (getType(child) === "SyntaxKind") { - continue; - } - - if (child.name === "endOfFileToken") { - continue; - } - - result += " if ("; - - if (child.isOptional) { - result += getPropertyAccess(child) + " !== null && "; - } - - if (child.isToken) { - result += getPropertyAccess(child) + ".width() > 0"; - result += ") { return " + getPropertyAccess(child) + "; }\r\n"; - } - else { - result += "(token = " + getPropertyAccess(child) + ".lastToken()) !== null"; - result += ") { return token; }\r\n"; - } - } - - result += " return null;\r\n"; - } - - result += " }\r\n"; - - return result; -} - -function baseType(definition: ITypeDefinition): ITypeDefinition { - return TypeScript.ArrayUtilities.firstOrDefault(definitions, d => d.name === definition.baseType); -} - -function memberDefinitionType(child: IMemberDefinition): ITypeDefinition { - // Debug.assert(child.type !== undefined); - return TypeScript.ArrayUtilities.firstOrDefault(definitions, d => d.name === child.type); -} - -function derivesFrom(def1: ITypeDefinition, def2: ITypeDefinition): boolean { - var current = def1; - while (current !== null) { - var base = baseType(current); - if (base === def2) { - return true; - } - - current = base; - } - - return false; -} - -function contains(definition: ITypeDefinition, child: IMemberDefinition) { - return TypeScript.ArrayUtilities.any(definition.children, - c => c.name === child.name && - c.isList === child.isList && - c.isSeparatedList === child.isSeparatedList && - c.isToken === child.isToken && - c.type === child.type); -} - -function generateAccessors(definition: ITypeDefinition): string { - var result = ""; - - //if (definition.name === "SourceUnitSyntax") { - // result += "\r\n"; - // result += " public syntaxTree(): SyntaxTree {\r\n"; - // result += " return this._syntaxTree;\r\n"; - // result += " }\r\n"; - //} - - //for (var i = 0; i < definition.children.length; i++) { - // var child = definition.children[i]; - - // if (child.type === "SyntaxKind") { - // result += "\r\n"; - // result += " public get " + child.name + "(): " + getType(child) + " {\r\n"; - // result += " return " + getPropertyAccess(child) + ";\r\n"; - // result += " }\r\n"; - // } - //} - - return result; -} - -function generateWithMethod(definition: ITypeDefinition, child: IMemberDefinition): string { - return ""; - - var result = ""; - result += "\r\n"; - result += " public with" + pascalCase(child.name) + "(" + getSafeName(child) + ": " + getType(child) + "): " + definition.name + " {\r\n"; - result += " return this.update(" - - for (var i = 0; i < definition.children.length; i++) { - if (i > 0) { - result += ", "; - } - - if (definition.children[i] === child) { - result += getSafeName(child); - } - else { - result += getPropertyAccess(definition.children[i]); - } - } - - result += ");\r\n"; - result += " }\r\n"; - - if (child.isList || child.isSeparatedList) { - if (TypeScript.StringUtilities.endsWith(child.name, "s")) { - var pascalName = pascalCase(child.name); - pascalName = pascalName.substring(0, pascalName.length - 1); - - var argName = getSafeName(child); - argName = argName.substring(0, argName.length - 1) - - result += "\r\n"; - result += " public with" + pascalName + "(" + argName + ": " + child.elementType + "): " + definition.name + " {\r\n"; - result += " return this.with" + pascalCase(child.name) + "(" - - if (child.isList) { - result += "Syntax.list<" + child.elementType + ">([" + argName + "])"; - } - else { - result += "Syntax.separatedList<" + child.elementType + ">([" + argName + "])"; - } - - result += ");\r\n"; - result += " }\r\n"; - } - } - - return result; -} - -function generateWithMethods(definition: ITypeDefinition): string { - var result = ""; - return ""; - - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - result += generateWithMethod(definition, child); - } - - return result; -} - -function generateTriviaMethods(definition: ITypeDefinition): string { - return ""; - - var result = "\r\n"; - result += " public withLeadingTrivia(trivia: ISyntaxTriviaList): " + definition.name + " {\r\n"; - result += " return <" + definition.name + ">super.withLeadingTrivia(trivia);\r\n"; - result += " }\r\n\r\n"; - result += " public withTrailingTrivia(trivia: ISyntaxTriviaList): " + definition.name + " {\r\n"; - result += " return <" + definition.name + ">super.withTrailingTrivia(trivia);\r\n"; - result += " }\r\n"; - - return result; -} - -function generateUpdateMethod(definition: ITypeDefinition): string { - // return ""; - - var result = ""; - - result += "\r\n"; - result += " public update("; - - var i: number; - var child: IMemberDefinition; - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - result += getSafeName(child) + ": " + getType(child); - - if (i < definition.children.length - 1) { - result += ",\r\n "; - } - } - - result += "): " + definition.name + " {\r\n"; - - if (definition.children.length === 0) { - result += " return this;\r\n"; - } - else { - result += " if ("; - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - if (i !== 0) { - result += " && "; - } - - result += getPropertyAccess(child) + " === " + getSafeName(child); - } - - result += ") {\r\n"; - result += " return this;\r\n"; - result += " }\r\n\r\n"; - - result += " return new " + definition.name + "("; - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - result += getSafeName(child); - result += ", "; - } - - result += "this.parsedInStrictMode() ? SyntaxConstants.NodeParsedInStrictModeMask : 0);\r\n"; - } - - result += " }\r\n"; - - return result; -} - -function generateNode(definition: ITypeDefinition, abstract: boolean): string { - var result = " export class " + definition.name + " extends SyntaxNode" - - if (definition.interfaces) { - result += " implements "; - result += definition.interfaces.join(", "); - } - - result += " {\r\n"; - - if (definition.name === "SourceUnitSyntax") { - result += " public syntaxTree: SyntaxTree = null;\r\n"; - } - - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - result += " public " + child.name + ": " + getType(child) + ";\r\n"; - } - - result += generateBrands(definition, /*accessibility:*/ true); - - result += " constructor(data: number"; - - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - result += ", " + getSafeName(child) + ": " + getType(child); + result += getSafeName(child); + result += ": " + getType(child); } result += ") {\r\n"; - result += " super(data);\r\n"; - if (definition.name === "SourceUnitSyntax") { - result += " this.parent = null,\r\n"; - } + result += " if (data) { this.__data = data; }\r\n"; + + if (definition.children.length) { + result += " "; - if (definition.children) { for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - if (child.excludeFromAST && abstract) { - continue; + if (i) { + result += ", "; } - result += " this." + child.name + " = " + getSafeName(child) + ",\r\n"; + var child = definition.children[i]; + result += "this." + child.name + " = " + getSafeName(child); } + + result += ";\r\n"; } if (definition.children.length > 0) { - var first = true; + result += " "; + for (var i = 0; i < definition.children.length; i++) { + if (i) { + result += ", "; + } + var child = definition.children[i]; - if (child.excludeFromAST && abstract) { - continue; - } - if (!first) { - result += ",\r\n"; - } - first = false; - - if (child.isList || child.isSeparatedList) { - result += " !isShared(" + getSafeName(child) + ") && (" + getSafeName(child) + ".parent = this)"; - } - else if (child.isOptional) { - result += " " + getSafeName(child) + " && (" + getSafeName(child) + ".parent = this)"; + if (child.isOptional) { + result += getSafeName(child) + " && (" + getSafeName(child) + ".parent = this)"; } else { - result += " " + getSafeName(child) + ".parent = this"; + result += getSafeName(child) + ".parent = this"; } } result += ";\r\n"; } - result += " }\r\n"; + result += " };\r\n"; + result += " " + definition.name + ".prototype.kind = SyntaxKind." + getNameWithoutSuffix(definition) + ";\r\n"; + result += " " + definition.name + ".prototype.childCount = " + definition.children.length + ";\r\n"; + result += " " + definition.name + ".prototype.childAt = function(index: number): ISyntaxElement {\r\n"; + if (definition.children.length) { + result += " switch (index) {\r\n"; - if (definition.name === "BinaryExpressionSyntax") { - result += " public kind(): SyntaxKind { return SyntaxFacts.getBinaryExpressionFromOperatorToken(this.operatorToken.kind()); }\r\n"; - } - else if (definition.name === "PrefixUnaryExpressionSyntax") { - result += " public kind(): SyntaxKind { return SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); }\r\n"; - } - else if (definition.name === "PostfixUnaryExpressionSyntax") { - result += " public kind(): SyntaxKind { return SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); }\r\n"; - } - else if (definition.name === "HeritageClauseSyntax") { - result += " public kind(): SyntaxKind { return this.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword ? SyntaxKind.ExtendsHeritageClause : SyntaxKind.ImplementsHeritageClause; }\r\n"; - } + for (var j = 0; j < definition.children.length; j++) { + result += " case " + j + ": return this." + definition.children[j].name + ";\r\n"; + } + + result += " }\r\n"; + } + else { + result += " throw Errors.invalidOperation();\r\n"; + } + result += " }\r\n"; - result += " }"; return result; } -function syntaxKindName(kind: TypeScript.SyntaxKind): string { - for (var name in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind[name] === kind) { - return name; - } - } - - throw new Error(); -} - -function getDefinitionForKind(kind: TypeScript.SyntaxKind): ITypeDefinition { - var kindName = syntaxKindName(kind); - - return TypeScript.ArrayUtilities.firstOrDefault(definitions, d => { - if (getNameWithoutSuffix(d) === kindName) { - return true; - } - - if (d.syntaxKinds) { - return TypeScript.ArrayUtilities.contains(d.syntaxKinds, kindName); - } - - return false; - }); -} - function generateSyntaxInterfaces(): string { var result = "///\r\n\r\n"; @@ -2019,48 +1163,6 @@ function generateSyntaxInterfaces(): string { result += generateSyntaxInterface(definition); } - result += "\r\n\r\n"; - - result += " export var nodeMetadata: string[][] = ["; - for (var i = 0; i <= TypeScript.SyntaxKind.LastNode; i++) { - if (i < TypeScript.SyntaxKind.FirstNode) { - result += "[],"; - continue; - } - - var kindName = syntaxKindName(i); - - var definition = getDefinitionForKind(i); - - var metadata = "["; - var children = definition.children.filter(m => m.type !== "SyntaxKind").map(m => '"' + m.name + '"'); - metadata += children.join(","); - metadata += "],"; - - result += metadata; - } - result += "];\r\n\r\n"; - - result += " export module Syntax {\r\n" - - result += " export interface ISyntaxFactory {\r\n"; - result += " isConcrete: boolean;\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - result += " " + definition.name + ": { new(data: number"; - - for (var j = 0; j < definition.children.length; j++) { - var child = definition.children[j]; - result += ", " + child.name + ": " + getType(child); - } - - result += "): " + definition.name + " };\r\n"; - } - - result += " }\r\n"; - result += " }\r\n"; - result += "}"; return result; } @@ -2084,53 +1186,40 @@ function generateSyntaxInterface(definition: ITypeDefinition): string { result += " " + child.name + ": " + getType(child) + ";\r\n"; } - result += " }"; + result += " }\r\n"; + result += " export interface " + getNameWithoutSuffix(definition) + "Constructor {"; + result += " new (data: number"; + + for (var i = 0; i < definition.children.length; i++) { + var child = definition.children[i]; + result += ", "; + result += getSafeName(child); + result += ": " + getType(child); + } + + result += "): " + definition.name; + result += " }\r\n"; return result; } - -function generateNodes(abstract: boolean): string { +function generateNodes(): string { var result = "///\r\n\r\n"; - result += "module TypeScript.Syntax."; - - var moduleName = abstract ? "Abstract" : "Concrete"; - result += moduleName; + result += "module TypeScript"; result += " {\r\n"; - result += " // Inject this module as the factory for producing syntax nodes in the parser.\r\n"; - result += " Parser.syntaxFactory = " + moduleName + ";\r\n"; - result += " export var isConcrete: boolean = " + !abstract + ";\r\n\r\n"; for (var i = 0; i < definitions.length; i++) { var definition = definitions[i]; - if (i > 0) { + if (i) { result += "\r\n"; } - result += generateNode(definition, abstract); + result += generateConstructorFunction(definition); } - result += "\r\n\r\n "; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - - if (definition.syntaxKinds) { - continue; - } - - if (i) { - result += ", " - } - - result += "(" + definition.name + ").prototype.__kind = SyntaxKind." + getNameWithoutSuffix(definition) - } - - result += ";\r\n"; - result += "}"; return result; } @@ -2139,194 +1228,30 @@ function isInterface(name: string) { return name.substr(0, 1) === "I" && name.substr(1, 1).toUpperCase() === name.substr(1, 1) } -function isNodeOrToken(child: IMemberDefinition) { - // IWhatever. - return child.type && isInterface(child.type); -} - -function generateRewriter(): string { - var result = "///\r\n\r\n"; - - result += "module TypeScript {\r\n" + -" export class SyntaxRewriter implements ISyntaxVisitor {\r\n" + -" public visitToken(token: ISyntaxToken): ISyntaxToken {\r\n" + -" return token;\r\n" + -" }\r\n" + -"\r\n" + -" public visitNode(node: ISyntaxNode): ISyntaxNode {\r\n" + -" return visitNodeOrToken(this, node);\r\n" + -" }\r\n" + -"\r\n" + -" public visitNodeOrToken(node: ISyntaxNodeOrToken): ISyntaxNodeOrToken {\r\n" + -" return isToken(node) ? this.visitToken(node) : this.visitNode(node);\r\n" + -" }\r\n" + -"\r\n" + -" public visitList(list: T[]): T[] {\r\n" + -" var newItems: T[] = null;\r\n" + -"\r\n" + -" for (var i = 0, n = list.length; i < n; i++) {\r\n" + -" var item = list[i];\r\n" + -" var newItem = this.visitNodeOrToken(item);\r\n" + -"\r\n" + -" if (item !== newItem && newItems === null) {\r\n" + -" newItems = [];\r\n" + -" for (var j = 0; j < i; j++) {\r\n" + -" newItems.push(list[j]);\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" if (newItems) {\r\n" + -" newItems.push(newItem);\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" // Debug.assert(newItems === null || newItems.length === childCount(list));\r\n" + -" return newItems === null ? list : Syntax.list(newItems);\r\n" + -" }\r\n" + -"\r\n" + -" public visitSeparatedList(list: T[]): T[] {\r\n" + -" var newItems: ISyntaxNodeOrToken[] = null;\r\n" + -"\r\n" + -" for (var i = 0, n = childCount(list); i < n; i++) {\r\n" + -" var item = childAt(list, i);\r\n" + -" var newItem = isToken(item) ? this.visitToken(item) : this.visitNode(item);\r\n" + -"\r\n" + -" if (item !== newItem && newItems === null) {\r\n" + -" newItems = [];\r\n" + -" for (var j = 0; j < i; j++) {\r\n" + -" newItems.push(childAt(list, j));\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" if (newItems) {\r\n" + -" newItems.push(newItem);\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" // Debug.assert(newItems === null || newItems.length === childCount(list));\r\n" + -" return newItems === null ? list : Syntax.separatedList(newItems);\r\n" + -" }\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - - result += "\r\n"; - result += " public visit" + getNameWithoutSuffix(definition) + "(node: " + definition.name + "): any {\r\n"; - - if (definition.children.length === 0) { - result += " return node;\r\n" - result += " }\r\n"; - continue; - } - - //if (definition.children.length === 1) { - // result += " return node.with" + pascalCase(definition.children[0].name) + "(\r\n"; - //} - //else { - result += " return node.update(\r\n"; - //} - - for (var j = 0; j < definition.children.length; j++) { - var child = definition.children[j]; - - result += " "; - if (child.isOptional) { - result += "node." + child.name + " === null ? null : "; - } - - if (child.isToken) { - result += "this.visitToken(node." + child.name + ")"; - } - else if (child.isList) { - result += "this.visitList(node." + child.name + ")"; - } - else if (child.isSeparatedList) { - result += "this.visitSeparatedList(node." + child.name + ")"; - } - else if (child.type === "SyntaxKind") { - result += "node.kind"; - } - else if (isNodeOrToken(child)) { - result += "<" + child.type + ">this.visitNodeOrToken(node." + child.name + ")"; - } - else { - result += "<" + child.type + ">this.visitNode(node." + child.name + ")"; - } - - if (j < definition.children.length - 1) { - result += ",\r\n"; - } - } - - result += ");\r\n"; - result += " }\r\n"; - } - - result += " }"; - result += "\r\n}"; - return result; -} - function generateWalker(): string { var result = ""; result += -"///\r\n"+ -"\r\n" + -"module TypeScript {\r\n" + -" export class SyntaxWalker implements ISyntaxVisitor {\r\n" + -" public visitToken(token: ISyntaxToken): void {\r\n" + -" }\r\n" + -"\r\n" + -" public visitNode(node: ISyntaxNode): void {\r\n" + -" visitNodeOrToken(this, node);\r\n" + -" }\r\n" + -"\r\n" + -" public visitNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void {\r\n" + -" if (isToken(nodeOrToken)) { \r\n" + -" this.visitToken(nodeOrToken);\r\n" + -" }\r\n" + -" else {\r\n" + -" this.visitNode(nodeOrToken);\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" private visitOptionalToken(token: ISyntaxToken): void {\r\n" + -" if (token === null) {\r\n" + -" return;\r\n" + -" }\r\n" + -"\r\n" + -" this.visitToken(token);\r\n" + -" }\r\n" + -"\r\n" + -" public visitOptionalNode(node: ISyntaxNode): void {\r\n" + -" if (node === null) {\r\n" + -" return;\r\n" + -" }\r\n" + -"\r\n" + -" this.visitNode(node);\r\n" + -" }\r\n" + -"\r\n" + -" public visitOptionalNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void {\r\n" + -" if (nodeOrToken === null) {\r\n" + -" return;\r\n" + -" }\r\n" + -"\r\n" + -" this.visitNodeOrToken(nodeOrToken);\r\n" + -" }\r\n" + -"\r\n" + -" public visitList(list: ISyntaxNodeOrToken[]): void {\r\n" + -" for (var i = 0, n = list.length; i < n; i++) {\r\n" + -" this.visitNodeOrToken(list[i]);\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" public visitSeparatedList(list: ISyntaxNodeOrToken[]): void {\r\n" + -" for (var i = 0, n = childCount(list); i < n; i++) {\r\n" + -" var item = childAt(list, i);\r\n" + -" this.visitNodeOrToken(item);\r\n" + -" }\r\n" + -" }\r\n"; + "///\r\n" + + "\r\n" + + "module TypeScript {\r\n" + + " export class SyntaxWalker implements ISyntaxVisitor {\r\n" + + " public visitToken(token: ISyntaxToken): void {\r\n" + + " }\r\n" + + "\r\n" + + " private visitOptionalToken(token: ISyntaxToken): void {\r\n" + + " if (token === undefined) {\r\n" + + " return;\r\n" + + " }\r\n" + + "\r\n" + + " this.visitToken(token);\r\n" + + " }\r\n" + + "\r\n" + + " public visitList(list: ISyntaxNodeOrToken[]): void {\r\n" + + " for (var i = 0, n = list.length; i < n; i++) {\r\n" + + " visitNodeOrToken(this, list[i]);\r\n" + + " }\r\n" + + " }\r\n"; for (var i = 0; i < definitions.length; i++) { var definition = definitions[i]; @@ -2345,27 +1270,19 @@ function generateWalker(): string { result += " this.visitToken(node." + child.name + ");\r\n"; } } - else if (child.isList) { + else if (child.isList || child.isSeparatedList) { result += " this.visitList(node." + child.name + ");\r\n"; } - else if (child.isSeparatedList) { - result += " this.visitSeparatedList(node." + child.name + ");\r\n"; - } - else if (isNodeOrToken(child)) { + else if (child.isToken) { if (child.isOptional) { - result += " this.visitOptionalNodeOrToken(node." + child.name + ");\r\n"; + result += " this.visitOptionalToken(node." + child.name + ");\r\n"; } else { - result += " this.visitNodeOrToken(node." + child.name + ");\r\n"; + result += " this.visitToken(node." + child.name + ");\r\n"; } } - else if (child.type !== "SyntaxKind") { - if (child.isOptional) { - result += " this.visitOptionalNode(node." + child.name + ");\r\n"; - } - else { - result += " this.visitNode(node." + child.name + ");\r\n"; - } + else { + result += " visitNodeOrToken(this, node." + child.name + ");\r\n"; } } @@ -2386,7 +1303,7 @@ function firstEnumName(e: any, value: number) { } function groupBy(array: T[], func: (v: T) => string): any { - var result: TypeScript.IIndexable = {}; + var result: any = {}; for (var i = 0, n = array.length; i < n; i++) { var v: any = array[i]; @@ -2429,7 +1346,6 @@ function generateKeywordCondition(keywords: { text: string; kind: TypeScript.Syn } else { result += " // " + TypeScript.ArrayUtilities.select(keywords, k => k.text).join(", ") + "\r\n" - // result += "\r\n"; index = currentCharacter === 0 ? "start" : ("start + " + currentCharacter); result += indent + "switch(str.charCodeAt(" + index + ")) {\r\n" @@ -2450,7 +1366,6 @@ function generateKeywordCondition(keywords: { text: string; kind: TypeScript.Syn } function min(array: T[], func: (v: T) => number): number { - // Debug.assert(array.length > 0); var min = func(array[0]); for (var i = 1; i < array.length; i++) { @@ -2464,7 +1379,6 @@ function min(array: T[], func: (v: T) => number): number { } function max(array: T[], func: (v: T) => number): number { - // Debug.assert(array.length > 0); var max = func(array[0]); for (var i = 1; i < array.length; i++) { @@ -2477,11 +1391,43 @@ function max(array: T[], func: (v: T) => number): number { return max; } +function generateUtilities(): string { + var result = ""; + result += " var fixedWidthArray = ["; + for (var i = 0; i <= TypeScript.SyntaxKind.LastFixedWidth; i++) { + if (i) { + result += ", "; + } + + if (i < TypeScript.SyntaxKind.FirstFixedWidth) { + result += "0"; + } + else { + result += TypeScript.SyntaxFacts.getText(i).length; + } + } + result += "];\r\n"; + + result += " function fixedWidthTokenLength(kind: SyntaxKind) {\r\n"; + result += " return fixedWidthArray[kind];\r\n"; + + //result += " switch (kind) {\r\n"; + + //for (var k = TypeScript.SyntaxKind.FirstFixedWidth; k <= TypeScript.SyntaxKind.LastFixedWidth; k++) { + // result += " case SyntaxKind." + syntaxKindName(k) + ": return " + TypeScript.SyntaxFacts.getText(k).length + ";\r\n"; + //} + //result += " default: throw new Error();\r\n"; + //result += " }\r\n"; + result += " }\r\n"; + + return result; +} + function generateScannerUtilities(): string { var result = "///\r\n" + "\r\n" + "module TypeScript {\r\n" + - " export class ScannerUtilities {\r\n"; + " export module ScannerUtilities {\r\n"; var i: number; var keywords: { text: string; kind: TypeScript.SyntaxKind; }[] = []; @@ -2492,7 +1438,7 @@ function generateScannerUtilities(): string { keywords.sort((a, b) => a.text.localeCompare(b.text)); - result += " public static identifierKind(str: string, start: number, length: number): SyntaxKind {\r\n"; + result += " export function identifierKind(str: string, start: number, length: number): SyntaxKind {\r\n"; var minTokenLength = min(keywords, k => k.text.length); var maxTokenLength = max(keywords, k => k.text.length); @@ -2517,6 +1463,16 @@ function generateScannerUtilities(): string { return result; } +function syntaxKindName(kind: TypeScript.SyntaxKind): string { + for (var name in TypeScript.SyntaxKind) { + if (TypeScript.SyntaxKind[name] === kind) { + return name; + } + } + + throw new Error(); +} + function generateVisitor(): string { var result = ""; @@ -2524,36 +1480,26 @@ function generateVisitor(): string { result += "module TypeScript {\r\n"; result += " export function visitNodeOrToken(visitor: ISyntaxVisitor, element: ISyntaxNodeOrToken): any {\r\n"; - result += " if (element === null) { return null; }\r\n"; - result += " if (isToken(element)) { return visitor.visitToken(element); }\r\n"; - result += " switch (element.kind()) {\r\n"; + result += " if (element === undefined) { return undefined; }\r\n"; + + result += " switch (element.kind) {\r\n"; for (var i = 0; i < definitions.length; i++) { var definition = definitions[i]; - if (definition.syntaxKinds) { - result += " "; - for (var j = 0; j < definition.syntaxKinds.length; j++) { - result += " case SyntaxKind." + definition.syntaxKinds[j] + ":" - } - result += "\r\n "; - } - else { - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": "; - } - + result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": "; result += "return visitor.visit" + getNameWithoutSuffix(definition) + "(<" + definition.name + ">element);\r\n"; } - result += " }\r\n\r\n"; - result += " throw Errors.invalidOperation();\r\n"; + result += " default: return visitor.visitToken(element);\r\n"; + result += " }\r\n"; result += " }\r\n\r\n"; result += " export interface ISyntaxVisitor {\r\n"; result += " visitToken(token: ISyntaxToken): any;\r\n"; - for (i = 0; i < definitions.length; i++) { - definition = definitions[i]; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; result += " visit" + getNameWithoutSuffix(definition) + "(node: " + definition.name + "): any;\r\n"; } @@ -2564,320 +1510,16 @@ function generateVisitor(): string { return result; } -function generateDefaultVisitor(): string { - var result = ""; - - result += "///\r\n\r\n"; - - result += "module TypeScript {\r\n"; - if (!forPrettyPrinter) { - result += " export class SyntaxVisitor implements ISyntaxVisitor {\r\n"; - result += " public defaultVisit(node: ISyntaxNodeOrToken): any {\r\n"; - result += " return null;\r\n"; - result += " }\r\n"; - result += "\r\n"; - result += " public visitToken(token: ISyntaxToken): any {\r\n"; - result += " return this.defaultVisit(token);\r\n"; - result += " }\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - - result += "\r\n public visit" + getNameWithoutSuffix(definition) + "(node: " + definition.name + "): any {\r\n"; - result += " return this.defaultVisit(node);\r\n"; - result += " }\r\n"; - } - - result += " }"; - } - - result += "\r\n}"; - - return result; -} - -function generateFactory(): string { - var result = "///\r\n"; - - result += "\r\nmodule TypeScript.Syntax {\r\n"; - result += " export interface IFactory {\r\n"; - - var i: number; - var j: number; - var definition: ITypeDefinition; - var child: IMemberDefinition; - - for (i = 0; i < definitions.length; i++) { - definition = definitions[i]; - result += " " + camelCase(getNameWithoutSuffix(definition)) + "("; - - for (j = 0; j < definition.children.length; j++) { - if (j > 0) { - result += ", "; - } - - child = definition.children[j]; - result += child.name + ": " + getType(child); - } - - result += "): " + definition.name + ";\r\n"; - } - - result += " }\r\n\r\n"; - - // TODO: stop exporting these once compiler bugs are fixed. - result += " export class NormalModeFactory implements IFactory {\r\n"; - - for (i = 0; i < definitions.length; i++) { - definition = definitions[i]; - result += " " + camelCase(getNameWithoutSuffix(definition)) + "("; - - for (j = 0; j < definition.children.length; j++) { - if (j > 0) { - result += ", "; - } - - child = definition.children[j]; - result += getSafeName(child) + ": " + getType(child); - } - - result += "): " + definition.name + " {\r\n"; - result += " return new " + definition.name + "("; - - for (j = 0; j < definition.children.length; j++) { - child = definition.children[j]; - result += getSafeName(child); - result += ", "; - } - - result += "/*data:*/ 0);\r\n"; - result += " }\r\n" - } - - result += " }\r\n\r\n"; - - // TODO: stop exporting these once compiler bugs are fixed. - result += " export class StrictModeFactory implements IFactory {\r\n"; - - for (i = 0; i < definitions.length; i++) { - definition = definitions[i]; - result += " " + camelCase(getNameWithoutSuffix(definition)) + "("; - - for (j = 0; j < definition.children.length; j++) { - if (j > 0) { - result += ", "; - } - - child = definition.children[j]; - result += getSafeName(child) + ": " + getType(child); - } - - result += "): " + definition.name + " {\r\n"; - result += " return new " + definition.name + "("; - - for (j = 0; j < definition.children.length; j++) { - child = definition.children[j]; - result += getSafeName(child); - result += ", "; - } - - result += "/*data:*/ SyntaxConstants.NodeParsedInStrictModeMask);\r\n"; - - result += " }\r\n" - } - - result += " }\r\n\r\n"; - - result += " export var normalModeFactory: IFactory = new NormalModeFactory();\r\n"; - result += " export var strictModeFactory: IFactory = new StrictModeFactory();\r\n"; - result += "}"; - - return result; -} - -function generateServicesUtilities(): string { - var result = ""; // "/// \r\n\r\n"; - - result += generateIsTypeScriptSpecific(); - - return result; -} - -function generateIsTypeScriptSpecific(): string { - var result = ""; - - result += "module TypeScript {\r\n"; - - result += " function isSeparatedListTypeScriptSpecific(list: ISyntaxNodeOrToken[]): boolean {\r\n" - result += " for (var i = 0, n = childCount(list); i < n; i++) {\r\n"; - result += " if (isTypeScriptSpecific(childAt(list, i))) {\r\n"; - result += " return true;\r\n"; - result += " }\r\n"; - result += " }\r\n\r\n"; - result += " return false;\r\n"; - result += " }\r\n\r\n"; - - result += " function isListTypeScriptSpecific(list: ISyntaxNodeOrToken[]): boolean {\r\n" - result += " for (var i = 0, n = list.length; i < n; i++) {\r\n"; - result += " if (isTypeScriptSpecific(list[i])) {\r\n"; - result += " return true;\r\n"; - result += " }\r\n"; - result += " }\r\n\r\n"; - result += " return false;\r\n"; - result += " }\r\n\r\n"; - - result += " export function isTypeScriptSpecific(element: ISyntaxElement): boolean {\r\n" - result += " if (element === null) { return false; }\r\n"; - result += " if (isToken(element)) { return false; }\r\n"; - result += " if (isList(element)) { return isListTypeScriptSpecific(element); }\r\n"; - result += " if (isSeparatedList(element)) { return isSeparatedListTypeScriptSpecific(element); }\r\n\r\n"; - result += " switch (element.kind()) {\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - if (!definition.isTypeScriptSpecific) { - continue; - } - - if (definition.syntaxKinds) { - for (var j = 0; j < definition.syntaxKinds.length; j++) { - result += " case SyntaxKind." + definition.syntaxKinds[j] + ":\r\n"; - } - } - else { - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ":\r\n"; - } - } - - result += " return true;\r\n"; - - var triviallyFalseDefinitions = definitions.filter(d => d.children.filter(c => c.type !== "SyntaxKind" && !c.isToken).length === 0); - for (var i = 0; i < triviallyFalseDefinitions.length; i++) { - var definition = triviallyFalseDefinitions[i]; - if (definition.isTypeScriptSpecific) { - continue; - } - - if (definition.syntaxKinds) { - for (var j = 0; j < definition.syntaxKinds.length; j++) { - result += " case SyntaxKind." + definition.syntaxKinds[j] + ":\r\n"; - } - } - else { - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ":\r\n"; - } - } - - result += " return false;\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - if (definition.isTypeScriptSpecific) { - continue; - } - - if (definition.children.filter(c => c.type !== "SyntaxKind" && !c.isToken).length === 0) { - continue; - } - - if (definition.syntaxKinds) { - result += " "; - for (var j = 0; j < definition.syntaxKinds.length; j++) { - result += " case SyntaxKind." + definition.syntaxKinds[j] + ":"; - } - } - else { - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ":"; - } - result += "\r\n"; - result += " return is" + getNameWithoutSuffix(definition) + "TypeScriptSpecific(<" + definition.name + ">element);\r\n"; - } - - result += " }\r\n"; - result += " }\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - if (definition.isTypeScriptSpecific) { - continue; - } - - var importantChildren = definition.children.filter(d => d.type !== "SyntaxKind" && !d.isToken); - if (importantChildren.length > 0) { - result += generateIsTypeScriptSpecificMethod(definition); - } - } - - result += "}"; - - return result; -} - -function generateIsTypeScriptSpecificMethod(definition: ITypeDefinition): string { - var result = "\r\n function is" + getNameWithoutSuffix(definition) + "TypeScriptSpecific(node: " + definition.name + "): boolean {\r\n"; - - result += " return "; - - var addedCheck = false; - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - - if (child.type === "SyntaxKind") { - continue; - } - - if (child.isToken) { - continue; - } - - if (addedCheck) { - result += " ||\r\n "; - } - - addedCheck = true; - - if (child.isTypeScriptSpecific) { - if (child.isList) { - result += getPropertyAccess(child, "node") + ".length > 0"; - } - else if (child.isSeparatedList) { - result += getPropertyAccess(child, "node") + ".childCount() > 0"; - } - else { - result += getPropertyAccess(child, "node") + " !== null"; - } - } - else { - result += "isTypeScriptSpecific(" + getPropertyAccess(child, "node") + ")"; - } - } - - if (!addedCheck) { - result += "false"; - } - - result += ";\r\n"; - result += " }\r\n"; - - return result; -} - -var syntaxNodesConcrete = generateNodes(/*abstract:*/ false); -var syntaxNodesAbstract = generateNodes(/*abstract:*/ true); +var syntaxNodesConcrete = generateNodes(); var syntaxInterfaces = generateSyntaxInterfaces(); -var rewriter = generateRewriter(); var walker = generateWalker(); var scannerUtilities = generateScannerUtilities(); var visitor = generateVisitor(); -var defaultVisitor = generateDefaultVisitor(); -var servicesUtilities = generateServicesUtilities(); +var utilities = generateUtilities(); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\syntaxNodes.concrete.generated.ts", syntaxNodesConcrete, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\syntaxNodes.abstract.generated.ts", syntaxNodesAbstract, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\syntaxNodes.interfaces.generated.ts", syntaxInterfaces, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\services\\syntaxRewriter.generated.ts", rewriter, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\syntaxWalker.generated.ts", walker, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\scannerUtilities.generated.ts", scannerUtilities, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\syntaxVisitor.generated.ts", visitor, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\defaultSyntaxVisitor.generated.ts", defaultVisitor, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\services\\syntaxUtilities.generated.ts", servicesUtilities, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxNodes.concrete.generated.ts", syntaxNodesConcrete, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxInterfaces.generated.ts", syntaxInterfaces, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxWalker.generated.ts", walker, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\scannerUtilities.generated.ts", scannerUtilities, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxVisitor.generated.ts", visitor, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\utilities.generated.ts", utilities, false); diff --git a/src/services/syntax/syntaxInterfaces.generated.ts b/src/services/syntax/syntaxInterfaces.generated.ts index b7f99f68b28..6ca28f1b819 100644 --- a/src/services/syntax/syntaxInterfaces.generated.ts +++ b/src/services/syntax/syntaxInterfaces.generated.ts @@ -1,499 +1,705 @@ /// module TypeScript { - export enum NodeFlags { - Export = 0x00000001, // Declarations - Ambient = 0x00000002, // Declarations - Optional = 0x00000004, // Parameter/Property/Method - Rest = 0x00000008, // Parameter - Public = 0x00000010, // Property/Method - Private = 0x00000020, // Property/Method - Static = 0x00000040, // Property/Method + export interface SourceUnitSyntax extends ISyntaxNode { + syntaxTree: SyntaxTree; + moduleElements: IModuleElementSyntax[]; + endOfFileToken: ISyntaxToken; } + export interface SourceUnitConstructor { new (data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken): SourceUnitSyntax } - interface SyntaxElement { - kind: SyntaxKind; + export interface QualifiedNameSyntax extends ISyntaxNode, INameSyntax { + left: INameSyntax; + dotToken: ISyntaxToken; + right: ISyntaxToken; } + export interface QualifiedNameConstructor { new (data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken): QualifiedNameSyntax } - interface SyntaxNode extends SyntaxElement { - flags: NodeFlags; + export interface ObjectTypeSyntax extends ISyntaxNode, ITypeSyntax { + openBraceToken: ISyntaxToken; + typeMembers: ISeparatedSyntaxList; + closeBraceToken: ISyntaxToken; } + export interface ObjectTypeConstructor { new (data: number, openBraceToken: ISyntaxToken, typeMembers: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectTypeSyntax } - function nodeStart(node: Node): number { + export interface FunctionTypeSyntax extends ISyntaxNode, ITypeSyntax { + typeParameterList: TypeParameterListSyntax; + parameterList: ParameterListSyntax; + equalsGreaterThanToken: ISyntaxToken; + type: ITypeSyntax; + } + export interface FunctionTypeConstructor { new (data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): FunctionTypeSyntax } + + export interface ArrayTypeSyntax extends ISyntaxNode, ITypeSyntax { + type: ITypeSyntax; + openBracketToken: ISyntaxToken; + closeBracketToken: ISyntaxToken; + } + export interface ArrayTypeConstructor { new (data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken): ArrayTypeSyntax } + + export interface ConstructorTypeSyntax extends ISyntaxNode, ITypeSyntax { + newKeyword: ISyntaxToken; + typeParameterList: TypeParameterListSyntax; + parameterList: ParameterListSyntax; + equalsGreaterThanToken: ISyntaxToken; + type: ITypeSyntax; + } + export interface ConstructorTypeConstructor { new (data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): ConstructorTypeSyntax } + + export interface GenericTypeSyntax extends ISyntaxNode, ITypeSyntax { + name: INameSyntax; + typeArgumentList: TypeArgumentListSyntax; + } + export interface GenericTypeConstructor { new (data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax): GenericTypeSyntax } + + export interface TypeQuerySyntax extends ISyntaxNode, ITypeSyntax { + typeOfKeyword: ISyntaxToken; + name: INameSyntax; + } + export interface TypeQueryConstructor { new (data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax): TypeQuerySyntax } + + export interface TupleTypeSyntax extends ISyntaxNode, ITypeSyntax { + openBracketToken: ISyntaxToken; + types: ISeparatedSyntaxList; + closeBracketToken: ISyntaxToken; + } + export interface TupleTypeConstructor { new (data: number, openBracketToken: ISyntaxToken, types: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken): TupleTypeSyntax } + + export interface UnionTypeSyntax extends ISyntaxNode, ITypeSyntax { + left: ITypeSyntax; + barToken: ISyntaxToken; + right: ITypeSyntax; + } + export interface UnionTypeConstructor { new (data: number, left: ITypeSyntax, barToken: ISyntaxToken, right: ITypeSyntax): UnionTypeSyntax } + + export interface ParenthesizedTypeSyntax extends ISyntaxNode, ITypeSyntax { + openParenToken: ISyntaxToken; + type: ITypeSyntax; + closeParenToken: ISyntaxToken; + } + export interface ParenthesizedTypeConstructor { new (data: number, openParenToken: ISyntaxToken, type: ITypeSyntax, closeParenToken: ISyntaxToken): ParenthesizedTypeSyntax } + + export interface InterfaceDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { + modifiers: ISyntaxToken[]; + interfaceKeyword: ISyntaxToken; + identifier: ISyntaxToken; + typeParameterList: TypeParameterListSyntax; + heritageClauses: HeritageClauseSyntax[]; + body: ObjectTypeSyntax; + } + export interface InterfaceDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax): InterfaceDeclarationSyntax } + + export interface FunctionDeclarationSyntax extends ISyntaxNode, IStatementSyntax { + modifiers: ISyntaxToken[]; + functionKeyword: ISyntaxToken; + asterixToken: ISyntaxToken; + identifier: ISyntaxToken; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; + } + export interface FunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): FunctionDeclarationSyntax } + + export interface ModuleDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { + modifiers: ISyntaxToken[]; + moduleKeyword: ISyntaxToken; + name: INameSyntax; + openBraceToken: ISyntaxToken; + moduleElements: IModuleElementSyntax[]; + closeBraceToken: ISyntaxToken; + } + export interface ModuleDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax } + + export interface ClassDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { + modifiers: ISyntaxToken[]; + classKeyword: ISyntaxToken; + identifier: ISyntaxToken; + typeParameterList: TypeParameterListSyntax; + heritageClauses: HeritageClauseSyntax[]; + openBraceToken: ISyntaxToken; + classElements: IClassElementSyntax[]; + closeBraceToken: ISyntaxToken; } + export interface ClassDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken): ClassDeclarationSyntax } + + export interface EnumDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { + modifiers: ISyntaxToken[]; + enumKeyword: ISyntaxToken; + identifier: ISyntaxToken; + openBraceToken: ISyntaxToken; + enumElements: ISeparatedSyntaxList; + closeBraceToken: ISyntaxToken; + } + export interface EnumDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): EnumDeclarationSyntax } + + export interface ImportDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { + modifiers: ISyntaxToken[]; + importKeyword: ISyntaxToken; + identifier: ISyntaxToken; + equalsToken: ISyntaxToken; + moduleReference: IModuleReferenceSyntax; + semicolonToken: ISyntaxToken; + } + export interface ImportDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken): ImportDeclarationSyntax } - function nodeWidth(node: Node): number { + export interface ExportAssignmentSyntax extends ISyntaxNode, IModuleElementSyntax { + exportKeyword: ISyntaxToken; + equalsToken: ISyntaxToken; + identifier: ISyntaxToken; + semicolonToken: ISyntaxToken; + } + export interface ExportAssignmentConstructor { new (data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ExportAssignmentSyntax } + + export interface MemberFunctionDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax { + modifiers: ISyntaxToken[]; + asterixToken: ISyntaxToken; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; + } + export interface MemberFunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): MemberFunctionDeclarationSyntax } + + export interface MemberVariableDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax { + modifiers: ISyntaxToken[]; + variableDeclarator: VariableDeclaratorSyntax; + semicolonToken: ISyntaxToken; + } + export interface MemberVariableDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax } + + export interface ConstructorDeclarationSyntax extends ISyntaxNode, IClassElementSyntax { + modifiers: ISyntaxToken[]; + constructorKeyword: ISyntaxToken; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; + } + export interface ConstructorDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): ConstructorDeclarationSyntax } + + export interface IndexMemberDeclarationSyntax extends ISyntaxNode, IClassElementSyntax { + modifiers: ISyntaxToken[]; + indexSignature: IndexSignatureSyntax; + semicolonToken: ISyntaxToken; + } + export interface IndexMemberDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax } + + export interface GetAccessorSyntax extends ISyntaxNode, IAccessorSyntax { + modifiers: ISyntaxToken[]; + getKeyword: ISyntaxToken; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; + } + export interface GetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): GetAccessorSyntax } + + export interface SetAccessorSyntax extends ISyntaxNode, IAccessorSyntax { + modifiers: ISyntaxToken[]; + setKeyword: ISyntaxToken; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } + export interface SetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): SetAccessorSyntax } + + export interface PropertySignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { + propertyName: IPropertyNameSyntax; + questionToken: ISyntaxToken; + typeAnnotation: TypeAnnotationSyntax; + } + export interface PropertySignatureConstructor { new (data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax } + + export interface CallSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { + typeParameterList: TypeParameterListSyntax; + parameterList: ParameterListSyntax; + typeAnnotation: TypeAnnotationSyntax; + } + export interface CallSignatureConstructor { new (data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax): CallSignatureSyntax } + + export interface ConstructSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { + newKeyword: ISyntaxToken; + callSignature: CallSignatureSyntax; + } + export interface ConstructSignatureConstructor { new (data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax): ConstructSignatureSyntax } + + export interface IndexSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { + openBracketToken: ISyntaxToken; + parameters: ISeparatedSyntaxList; + closeBracketToken: ISyntaxToken; + typeAnnotation: TypeAnnotationSyntax; + } + export interface IndexSignatureConstructor { new (data: number, openBracketToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): IndexSignatureSyntax } - interface SyntaxToken extends Name, PrimaryExpression { + export interface MethodSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { + propertyName: IPropertyNameSyntax; + questionToken: ISyntaxToken; + callSignature: CallSignatureSyntax; } + export interface MethodSignatureConstructor { new (data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax } - // The raw text of the token, as written in the original source. - function tokenText(token: SyntaxToken): string { + export interface BlockSyntax extends ISyntaxNode, IStatementSyntax { + equalsGreaterThanToken: ISyntaxToken; + openBraceToken: ISyntaxToken; + statements: IStatementSyntax[]; + closeBraceToken: ISyntaxToken; } + export interface BlockConstructor { new (data: number, equalsGreaterThanToken: ISyntaxToken, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken): BlockSyntax } - // The token's javascript value. i.e. 0.0 in the text would have the javascript number value: 0. - function tokenValue(token: SyntaxToken): any { + export interface IfStatementSyntax extends ISyntaxNode, IStatementSyntax { + ifKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + condition: IExpressionSyntax; + closeParenToken: ISyntaxToken; + statement: IStatementSyntax; + elseClause: ElseClauseSyntax; } + export interface IfStatementConstructor { new (data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax): IfStatementSyntax } - // The token's value in string form. i.e. \u0041 in the source text would result in a string with the text: A. - function tokenValueText(token: SyntaxToken): string { + export interface VariableStatementSyntax extends ISyntaxNode, IStatementSyntax { + modifiers: ISyntaxToken[]; + variableDeclaration: VariableDeclarationSyntax; + semicolonToken: ISyntaxToken; } + export interface VariableStatementConstructor { new (data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken): VariableStatementSyntax } - interface SyntaxList extends SyntaxElement { - length: number; - item(index: number): T; + export interface ExpressionStatementSyntax extends ISyntaxNode, IStatementSyntax { + expression: IExpressionSyntax; + semicolonToken: ISyntaxToken; } - - interface SourceUnit extends Node { - moduleElements: SyntaxList; - } - - interface QualifiedName extends Name { - left: Name; - right: SyntaxToken; - } - - interface ObjectType extends Type { - typeMembers: SyntaxList; - } - - interface FunctionType extends Type { - typeParameterList?: TypeParameterList; - parameterList: ParameterList; - type: Type; - } - - interface ArrayType extends Type { - type: Type; - } - - interface ConstructorType extends Type { - typeParameterList?: TypeParameterList; - parameterList: ParameterList; - type: Type; - } - - interface GenericType extends Type { - name: Name; - typeArgumentList: TypeArgumentList; - } - - interface TypeQuery extends Type { - name: Name; - } - - interface InterfaceDeclaration extends ModuleElement { - identifier: SyntaxToken; - typeParameterList?: TypeParameterList; - heritageClauses: SyntaxList; - body: ObjectType; - } - - interface FunctionDeclaration extends Statement { - identifier: SyntaxToken; - callSignature: CallSignature; - block?: Block; - } - - interface ModuleDeclaration extends ModuleElement { - name?: Name; - stringLiteral?: SyntaxToken; - moduleElements: SyntaxList; - } - - interface ClassDeclaration extends ModuleElement { - identifier: SyntaxToken; - typeParameterList?: TypeParameterList; - heritageClauses: SyntaxList; - classElements: SyntaxList; - } - - interface EnumDeclaration extends ModuleElement { - identifier: SyntaxToken; - enumElements: SyntaxList; - } - - interface ImportDeclaration extends ModuleElement { - identifier: SyntaxToken; - moduleReference: ModuleReference; - } - - interface ExportAssignment extends ModuleElement { - identifier: SyntaxToken; - } - - interface MemberFunctionDeclaration extends MemberDeclaration { - propertyName: SyntaxToken; - callSignature: CallSignature; - block?: Block; - } - - interface MemberVariableDeclaration extends MemberDeclaration { - variableDeclarator: VariableDeclarator; - } - - interface ConstructorDeclaration extends ClassElement { - callSignature: CallSignature; - block?: Block; - } - - interface IndexMemberDeclaration extends ClassElement { - indexSignature: IndexSignature; - } - - interface GetAccessor extends MemberDeclaration, PropertyAssignment { - propertyName: SyntaxToken; - callSignature: CallSignature; - block: Block; - } - - interface SetAccessor extends MemberDeclaration, PropertyAssignment { - propertyName: SyntaxToken; - callSignature: CallSignature; - block: Block; - } - - interface PropertySignature extends TypeMember { - propertyName: SyntaxToken; - typeAnnotation?: TypeAnnotation; - } - - interface CallSignature extends TypeMember { - typeParameterList?: TypeParameterList; - parameterList: ParameterList; - typeAnnotation?: TypeAnnotation; - } - - interface ConstructSignature extends TypeMember { - callSignature: CallSignature; - } - - interface IndexSignature extends TypeMember { - parameters: SyntaxList; - typeAnnotation?: TypeAnnotation; - } - - interface MethodSignature extends TypeMember { - propertyName: SyntaxToken; - callSignature: CallSignature; - } - - interface Block extends Statement { - statements: SyntaxList; - } - - interface IfStatement extends Statement { - condition: Expression; - statement: Statement; - elseClause?: ElseClause; - } - - interface VariableStatement extends Statement { - variableDeclaration: VariableDeclaration; - } - - interface ExpressionStatement extends Statement { - expression: Expression; - } - - interface ReturnStatement extends Statement { - expression?: Expression; - } - - interface SwitchStatement extends Statement { - expression: Expression; - switchClauses: SyntaxList; - } - - interface BreakStatement extends Statement { - identifier?: SyntaxToken; - } - - interface ContinueStatement extends Statement { - identifier?: SyntaxToken; - } - - interface ForStatement extends Statement { - variableDeclaration?: VariableDeclaration; - initializer?: Expression; - condition?: Expression; - incrementor?: Expression; - statement: Statement; - } - - interface ForInStatement extends Statement { - variableDeclaration?: VariableDeclaration; - left?: Expression; - expression: Expression; - statement: Statement; - } - - interface ThrowStatement extends Statement { - expression: Expression; - } - - interface WhileStatement extends Statement { - condition: Expression; - statement: Statement; - } - - interface TryStatement extends Statement { - block: Block; - catchClause?: CatchClause; - finallyClause?: FinallyClause; + export interface ExpressionStatementConstructor { new (data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ExpressionStatementSyntax } + + export interface ReturnStatementSyntax extends ISyntaxNode, IStatementSyntax { + returnKeyword: ISyntaxToken; + expression: IExpressionSyntax; + semicolonToken: ISyntaxToken; } + export interface ReturnStatementConstructor { new (data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ReturnStatementSyntax } - interface LabeledStatement extends Statement { - identifier: SyntaxToken; - statement: Statement; + export interface SwitchStatementSyntax extends ISyntaxNode, IStatementSyntax { + switchKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + expression: IExpressionSyntax; + closeParenToken: ISyntaxToken; + openBraceToken: ISyntaxToken; + switchClauses: ISwitchClauseSyntax[]; + closeBraceToken: ISyntaxToken; } + export interface SwitchStatementConstructor { new (data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken): SwitchStatementSyntax } - interface DoStatement extends Statement { - statement: Statement; - condition: Expression; + export interface BreakStatementSyntax extends ISyntaxNode, IStatementSyntax { + breakKeyword: ISyntaxToken; + identifier: ISyntaxToken; + semicolonToken: ISyntaxToken; } + export interface BreakStatementConstructor { new (data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): BreakStatementSyntax } - interface WithStatement extends Statement { - condition: Expression; - statement: Statement; + export interface ContinueStatementSyntax extends ISyntaxNode, IStatementSyntax { + continueKeyword: ISyntaxToken; + identifier: ISyntaxToken; + semicolonToken: ISyntaxToken; } + export interface ContinueStatementConstructor { new (data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ContinueStatementSyntax } - interface PrefixUnaryExpression extends UnaryExpression { - operand: UnaryExpression; + export interface ForStatementSyntax extends ISyntaxNode, IStatementSyntax { + forKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + initializer: VariableDeclarationSyntax | IExpressionSyntax; + firstSemicolonToken: ISyntaxToken; + condition: IExpressionSyntax; + secondSemicolonToken: ISyntaxToken; + incrementor: IExpressionSyntax; + closeParenToken: ISyntaxToken; + statement: IStatementSyntax; } + export interface ForStatementConstructor { new (data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, initializer: VariableDeclarationSyntax | IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForStatementSyntax } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; + export interface ForInStatementSyntax extends ISyntaxNode, IStatementSyntax { + forKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + left: VariableDeclarationSyntax | IExpressionSyntax; + inKeyword: ISyntaxToken; + right: IExpressionSyntax; + closeParenToken: ISyntaxToken; + statement: IStatementSyntax; } + export interface ForInStatementConstructor { new (data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, left: VariableDeclarationSyntax | IExpressionSyntax, inKeyword: ISyntaxToken, right: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForInStatementSyntax } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; + export interface EmptyStatementSyntax extends ISyntaxNode, IStatementSyntax { + semicolonToken: ISyntaxToken; } + export interface EmptyStatementConstructor { new (data: number, semicolonToken: ISyntaxToken): EmptyStatementSyntax } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; + export interface ThrowStatementSyntax extends ISyntaxNode, IStatementSyntax { + throwKeyword: ISyntaxToken; + expression: IExpressionSyntax; + semicolonToken: ISyntaxToken; } + export interface ThrowStatementConstructor { new (data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ThrowStatementSyntax } - interface ConditionalExpression extends Expression { - condition: Expression; - whenTrue: Expression; - whenFalse: Expression; + export interface WhileStatementSyntax extends ISyntaxNode, IStatementSyntax { + whileKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + condition: IExpressionSyntax; + closeParenToken: ISyntaxToken; + statement: IStatementSyntax; } + export interface WhileStatementConstructor { new (data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WhileStatementSyntax } - interface BinaryExpression extends Expression { - left: Expression; - right: Expression; + export interface TryStatementSyntax extends ISyntaxNode, IStatementSyntax { + tryKeyword: ISyntaxToken; + block: BlockSyntax; + catchClause: CatchClauseSyntax; + finallyClause: FinallyClauseSyntax; } + export interface TryStatementConstructor { new (data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax): TryStatementSyntax } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; + export interface LabeledStatementSyntax extends ISyntaxNode, IStatementSyntax { + identifier: ISyntaxToken; + colonToken: ISyntaxToken; + statement: IStatementSyntax; } + export interface LabeledStatementConstructor { new (data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax): LabeledStatementSyntax } - interface MemberAccessExpression extends MemberExpression, CallExpression { - expression: LeftHandSideExpression; - name: SyntaxToken; + export interface DoStatementSyntax extends ISyntaxNode, IStatementSyntax { + doKeyword: ISyntaxToken; + statement: IStatementSyntax; + whileKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + condition: IExpressionSyntax; + closeParenToken: ISyntaxToken; + semicolonToken: ISyntaxToken; } + export interface DoStatementConstructor { new (data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken): DoStatementSyntax } - interface InvocationExpression extends CallExpression { - expression: LeftHandSideExpression; - argumentList: ArgumentList; + export interface DebuggerStatementSyntax extends ISyntaxNode, IStatementSyntax { + debuggerKeyword: ISyntaxToken; + semicolonToken: ISyntaxToken; } + export interface DebuggerStatementConstructor { new (data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): DebuggerStatementSyntax } - interface ArrayLiteralExpression extends PrimaryExpression { - expressions: SyntaxList; + export interface WithStatementSyntax extends ISyntaxNode, IStatementSyntax { + withKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + condition: IExpressionSyntax; + closeParenToken: ISyntaxToken; + statement: IStatementSyntax; } + export interface WithStatementConstructor { new (data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WithStatementSyntax } - interface ObjectLiteralExpression extends PrimaryExpression { - propertyAssignments: SyntaxList; + export interface PrefixUnaryExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + operatorToken: ISyntaxToken; + operand: IUnaryExpressionSyntax; } + export interface PrefixUnaryExpressionConstructor { new (data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax): PrefixUnaryExpressionSyntax } - interface ObjectCreationExpression extends MemberExpression { - expression: MemberExpression; - argumentList?: ArgumentList; + export interface DeleteExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + deleteKeyword: ISyntaxToken; + expression: IUnaryExpressionSyntax; } + export interface DeleteExpressionConstructor { new (data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): DeleteExpressionSyntax } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; + export interface TypeOfExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + typeOfKeyword: ISyntaxToken; + expression: IUnaryExpressionSyntax; } + export interface TypeOfExpressionConstructor { new (data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): TypeOfExpressionSyntax } - interface ParenthesizedArrowFunctionExpression extends UnaryExpression { - callSignature: CallSignature; - block?: Block; - expression?: Expression; + export interface VoidExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + voidKeyword: ISyntaxToken; + expression: IUnaryExpressionSyntax; } + export interface VoidExpressionConstructor { new (data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): VoidExpressionSyntax } - interface SimpleArrowFunctionExpression extends UnaryExpression { - parameter: Parameter; - block?: Block; - expression?: Expression; + export interface ConditionalExpressionSyntax extends ISyntaxNode, IExpressionSyntax { + condition: IExpressionSyntax; + questionToken: ISyntaxToken; + whenTrue: IExpressionSyntax; + colonToken: ISyntaxToken; + whenFalse: IExpressionSyntax; } + export interface ConditionalExpressionConstructor { new (data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax): ConditionalExpressionSyntax } - interface CastExpression extends UnaryExpression { - type: Type; - expression: UnaryExpression; + export interface BinaryExpressionSyntax extends ISyntaxNode, IExpressionSyntax { + left: IExpressionSyntax; + operatorToken: ISyntaxToken; + right: IExpressionSyntax; } + export interface BinaryExpressionConstructor { new (data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax): BinaryExpressionSyntax } - interface ElementAccessExpression extends MemberExpression, CallExpression { - expression: LeftHandSideExpression; - argumentExpression: Expression; + export interface PostfixUnaryExpressionSyntax extends ISyntaxNode, IPostfixExpressionSyntax { + operand: ILeftHandSideExpressionSyntax; + operatorToken: ISyntaxToken; } + export interface PostfixUnaryExpressionConstructor { new (data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken): PostfixUnaryExpressionSyntax } - interface FunctionExpression extends PrimaryExpression { - identifier?: SyntaxToken; - callSignature: CallSignature; - block: Block; + export interface MemberAccessExpressionSyntax extends ISyntaxNode, IMemberExpressionSyntax, ICallExpressionSyntax { + expression: ILeftHandSideExpressionSyntax; + dotToken: ISyntaxToken; + name: ISyntaxToken; } + export interface MemberAccessExpressionConstructor { new (data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken): MemberAccessExpressionSyntax } - interface VariableDeclaration extends Node { - variableDeclarators: SyntaxList; + export interface InvocationExpressionSyntax extends ISyntaxNode, ICallExpressionSyntax { + expression: ILeftHandSideExpressionSyntax; + argumentList: ArgumentListSyntax; } + export interface InvocationExpressionConstructor { new (data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax): InvocationExpressionSyntax } - interface VariableDeclarator extends Node { - propertyName: SyntaxToken; - typeAnnotation?: TypeAnnotation; - equalsValueClause?: EqualsValueClause; + export interface ArrayLiteralExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + openBracketToken: ISyntaxToken; + expressions: ISeparatedSyntaxList; + closeBracketToken: ISyntaxToken; } + export interface ArrayLiteralExpressionConstructor { new (data: number, openBracketToken: ISyntaxToken, expressions: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax } - interface ArgumentList extends Node { - typeArgumentList?: TypeArgumentList; - arguments: SyntaxList; + export interface ObjectLiteralExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + openBraceToken: ISyntaxToken; + propertyAssignments: ISeparatedSyntaxList; + closeBraceToken: ISyntaxToken; } + export interface ObjectLiteralExpressionConstructor { new (data: number, openBraceToken: ISyntaxToken, propertyAssignments: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax } - interface ParameterList extends Node { - parameters: SyntaxList; + export interface ObjectCreationExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + newKeyword: ISyntaxToken; + expression: IMemberExpressionSyntax; + argumentList: ArgumentListSyntax; } + export interface ObjectCreationExpressionConstructor { new (data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): ObjectCreationExpressionSyntax } - interface TypeArgumentList extends Node { - typeArguments: SyntaxList; + export interface ParenthesizedExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + openParenToken: ISyntaxToken; + expression: IExpressionSyntax; + closeParenToken: ISyntaxToken; } + export interface ParenthesizedExpressionConstructor { new (data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken): ParenthesizedExpressionSyntax } - interface TypeParameterList extends Node { - typeParameters: SyntaxList; + export interface ParenthesizedArrowFunctionExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + callSignature: CallSignatureSyntax; + equalsGreaterThanToken: ISyntaxToken; + body: BlockSyntax | IExpressionSyntax; } + export interface ParenthesizedArrowFunctionExpressionConstructor { new (data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, body: BlockSyntax | IExpressionSyntax): ParenthesizedArrowFunctionExpressionSyntax } - interface HeritageClause extends Node { - typeNames: SyntaxList; + export interface SimpleArrowFunctionExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + parameter: ParameterSyntax; + equalsGreaterThanToken: ISyntaxToken; + body: BlockSyntax | IExpressionSyntax; } + export interface SimpleArrowFunctionExpressionConstructor { new (data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, body: BlockSyntax | IExpressionSyntax): SimpleArrowFunctionExpressionSyntax } - interface EqualsValueClause extends Node { - value: Expression; + export interface CastExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + lessThanToken: ISyntaxToken; + type: ITypeSyntax; + greaterThanToken: ISyntaxToken; + expression: IUnaryExpressionSyntax; } + export interface CastExpressionConstructor { new (data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax): CastExpressionSyntax } - interface CaseSwitchClause extends SwitchClause { - expression: Expression; - statements: SyntaxList; + export interface ElementAccessExpressionSyntax extends ISyntaxNode, IMemberExpressionSyntax, ICallExpressionSyntax { + expression: ILeftHandSideExpressionSyntax; + openBracketToken: ISyntaxToken; + argumentExpression: IExpressionSyntax; + closeBracketToken: ISyntaxToken; } + export interface ElementAccessExpressionConstructor { new (data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ElementAccessExpressionSyntax } - interface DefaultSwitchClause extends SwitchClause { - statements: SyntaxList; + export interface FunctionExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + functionKeyword: ISyntaxToken; + asterixToken: ISyntaxToken; + identifier: ISyntaxToken; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } + export interface FunctionExpressionConstructor { new (data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): FunctionExpressionSyntax } - interface ElseClause extends Node { - statement: Statement; + export interface OmittedExpressionSyntax extends ISyntaxNode, IExpressionSyntax { } + export interface OmittedExpressionConstructor { new (data: number): OmittedExpressionSyntax } - interface CatchClause extends Node { - identifier: SyntaxToken; - typeAnnotation?: TypeAnnotation; - block: Block; + export interface TemplateExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + templateStartToken: ISyntaxToken; + templateClauses: TemplateClauseSyntax[]; } + export interface TemplateExpressionConstructor { new (data: number, templateStartToken: ISyntaxToken, templateClauses: TemplateClauseSyntax[]): TemplateExpressionSyntax } - interface FinallyClause extends Node { - block: Block; + export interface TemplateAccessExpressionSyntax extends ISyntaxNode, IMemberExpressionSyntax, ICallExpressionSyntax { + expression: ILeftHandSideExpressionSyntax; + templateExpression: IPrimaryExpressionSyntax; } + export interface TemplateAccessExpressionConstructor { new (data: number, expression: ILeftHandSideExpressionSyntax, templateExpression: IPrimaryExpressionSyntax): TemplateAccessExpressionSyntax } - interface TypeParameter extends Node { - identifier: SyntaxToken; - constraint?: Constraint; + export interface YieldExpressionSyntax extends ISyntaxNode, IExpressionSyntax { + yieldKeyword: ISyntaxToken; + asterixToken: ISyntaxToken; + expression: IExpressionSyntax; } + export interface YieldExpressionConstructor { new (data: number, yieldKeyword: ISyntaxToken, asterixToken: ISyntaxToken, expression: IExpressionSyntax): YieldExpressionSyntax } - interface Constraint extends Node { - type: Type; + export interface VariableDeclarationSyntax extends ISyntaxNode { + varKeyword: ISyntaxToken; + variableDeclarators: ISeparatedSyntaxList; } + export interface VariableDeclarationConstructor { new (data: number, varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList): VariableDeclarationSyntax } - interface SimplePropertyAssignment extends PropertyAssignment { - propertyName: SyntaxToken; - expression: Expression; + export interface VariableDeclaratorSyntax extends ISyntaxNode { + propertyName: IPropertyNameSyntax; + typeAnnotation: TypeAnnotationSyntax; + equalsValueClause: EqualsValueClauseSyntax; } + export interface VariableDeclaratorConstructor { new (data: number, propertyName: IPropertyNameSyntax, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax } - interface FunctionPropertyAssignment extends PropertyAssignment { - propertyName: SyntaxToken; - callSignature: CallSignature; - block: Block; + export interface ArgumentListSyntax extends ISyntaxNode { + typeArgumentList: TypeArgumentListSyntax; + openParenToken: ISyntaxToken; + arguments: ISeparatedSyntaxList; + closeParenToken: ISyntaxToken; } + export interface ArgumentListConstructor { new (data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ArgumentListSyntax } - interface Parameter extends Node { - identifier: SyntaxToken; - typeAnnotation?: TypeAnnotation; - equalsValueClause?: EqualsValueClause; + export interface ParameterListSyntax extends ISyntaxNode { + openParenToken: ISyntaxToken; + parameters: ISeparatedSyntaxList; + closeParenToken: ISyntaxToken; } + export interface ParameterListConstructor { new (data: number, openParenToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ParameterListSyntax } - interface EnumElement extends Node { - propertyName: SyntaxToken; - equalsValueClause?: EqualsValueClause; + export interface TypeArgumentListSyntax extends ISyntaxNode { + lessThanToken: ISyntaxToken; + typeArguments: ISeparatedSyntaxList; + greaterThanToken: ISyntaxToken; } + export interface TypeArgumentListConstructor { new (data: number, lessThanToken: ISyntaxToken, typeArguments: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeArgumentListSyntax } - interface TypeAnnotation extends Node { - type: Type; + export interface TypeParameterListSyntax extends ISyntaxNode { + lessThanToken: ISyntaxToken; + typeParameters: ISeparatedSyntaxList; + greaterThanToken: ISyntaxToken; } + export interface TypeParameterListConstructor { new (data: number, lessThanToken: ISyntaxToken, typeParameters: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeParameterListSyntax } - interface ExternalModuleReference extends ModuleReference { - stringLiteral: SyntaxToken; + export interface HeritageClauseSyntax extends ISyntaxNode { + extendsOrImplementsKeyword: ISyntaxToken; + typeNames: ISeparatedSyntaxList; } + export interface HeritageClauseConstructor { new (data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: ISeparatedSyntaxList): HeritageClauseSyntax } - interface ModuleNameModuleReference extends ModuleReference { - moduleName: Name; + export interface EqualsValueClauseSyntax extends ISyntaxNode { + equalsToken: ISyntaxToken; + value: IExpressionSyntax; } + export interface EqualsValueClauseConstructor { new (data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax): EqualsValueClauseSyntax } - interface MemberDeclaration extends ClassElement { + export interface CaseSwitchClauseSyntax extends ISyntaxNode, ISwitchClauseSyntax { + caseKeyword: ISyntaxToken; + expression: IExpressionSyntax; + colonToken: ISyntaxToken; + statements: IStatementSyntax[]; } + export interface CaseSwitchClauseConstructor { new (data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]): CaseSwitchClauseSyntax } - interface Statement extends ModuleElement { + export interface DefaultSwitchClauseSyntax extends ISyntaxNode, ISwitchClauseSyntax { + defaultKeyword: ISyntaxToken; + colonToken: ISyntaxToken; + statements: IStatementSyntax[]; } + export interface DefaultSwitchClauseConstructor { new (data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]): DefaultSwitchClauseSyntax } - interface Name extends Type { + export interface ElseClauseSyntax extends ISyntaxNode { + elseKeyword: ISyntaxToken; + statement: IStatementSyntax; } + export interface ElseClauseConstructor { new (data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax): ElseClauseSyntax } - interface UnaryExpression extends Expression { + export interface CatchClauseSyntax extends ISyntaxNode { + catchKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + identifier: ISyntaxToken; + typeAnnotation: TypeAnnotationSyntax; + closeParenToken: ISyntaxToken; + block: BlockSyntax; } + export interface CatchClauseConstructor { new (data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax): CatchClauseSyntax } - interface PostfixExpression extends UnaryExpression { + export interface FinallyClauseSyntax extends ISyntaxNode { + finallyKeyword: ISyntaxToken; + block: BlockSyntax; } + export interface FinallyClauseConstructor { new (data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax): FinallyClauseSyntax } - interface LeftHandSideExpression extends PostfixExpression { + export interface TemplateClauseSyntax extends ISyntaxNode { + expression: IExpressionSyntax; + templateMiddleOrEndToken: ISyntaxToken; } + export interface TemplateClauseConstructor { new (data: number, expression: IExpressionSyntax, templateMiddleOrEndToken: ISyntaxToken): TemplateClauseSyntax } - interface MemberExpression extends LeftHandSideExpression { + export interface TypeParameterSyntax extends ISyntaxNode { + identifier: ISyntaxToken; + constraint: ConstraintSyntax; } + export interface TypeParameterConstructor { new (data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax): TypeParameterSyntax } - interface CallExpression extends LeftHandSideExpression { + export interface ConstraintSyntax extends ISyntaxNode { + extendsKeyword: ISyntaxToken; + typeOrExpression: ISyntaxNodeOrToken; } + export interface ConstraintConstructor { new (data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken): ConstraintSyntax } - interface PrimaryExpression extends MemberExpression { + export interface SimplePropertyAssignmentSyntax extends ISyntaxNode, IPropertyAssignmentSyntax { + propertyName: IPropertyNameSyntax; + colonToken: ISyntaxToken; + expression: IExpressionSyntax; } + export interface SimplePropertyAssignmentConstructor { new (data: number, propertyName: IPropertyNameSyntax, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax } - interface ModuleElement extends SyntaxElement { + export interface FunctionPropertyAssignmentSyntax extends ISyntaxNode, IPropertyAssignmentSyntax { + asterixToken: ISyntaxToken; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } + export interface FunctionPropertyAssignmentConstructor { new (data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): FunctionPropertyAssignmentSyntax } - interface ModuleReference extends Node { + export interface ParameterSyntax extends ISyntaxNode { + dotDotDotToken: ISyntaxToken; + modifiers: ISyntaxToken[]; + identifier: ISyntaxToken; + questionToken: ISyntaxToken; + typeAnnotation: TypeAnnotationSyntax; + equalsValueClause: EqualsValueClauseSyntax; } + export interface ParameterConstructor { new (data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): ParameterSyntax } - interface ClassElement extends Node { + export interface EnumElementSyntax extends ISyntaxNode { + propertyName: IPropertyNameSyntax; + equalsValueClause: EqualsValueClauseSyntax; } + export interface EnumElementConstructor { new (data: number, propertyName: IPropertyNameSyntax, equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax } - interface TypeMember extends Node { + export interface TypeAnnotationSyntax extends ISyntaxNode { + colonToken: ISyntaxToken; + type: ITypeSyntax; } + export interface TypeAnnotationConstructor { new (data: number, colonToken: ISyntaxToken, type: ITypeSyntax): TypeAnnotationSyntax } - interface PropertyAssignment extends Node { + export interface ExpressionBody extends ISyntaxNode { + equalsGreaterThanToken: ISyntaxToken; + expression: IExpressionSyntax; } + export interface ExpressionBodyConstructor { new (data: number, equalsGreaterThanToken: ISyntaxToken, expression: IExpressionSyntax): ExpressionBody } - interface SwitchClause extends Node { + export interface ComputedPropertyNameSyntax extends ISyntaxNode, IPropertyNameSyntax { + openBracketToken: ISyntaxToken; + expression: IExpressionSyntax; + closeBracketToken: ISyntaxToken; } + export interface ComputedPropertyNameConstructor { new (data: number, openBracketToken: ISyntaxToken, expression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ComputedPropertyNameSyntax } - interface Expression extends SyntaxElement { + export interface ExternalModuleReferenceSyntax extends ISyntaxNode, IModuleReferenceSyntax { + requireKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + stringLiteral: ISyntaxToken; + closeParenToken: ISyntaxToken; } + export interface ExternalModuleReferenceConstructor { new (data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken): ExternalModuleReferenceSyntax } - interface Type extends SyntaxElement { + export interface ModuleNameModuleReferenceSyntax extends ISyntaxNode, IModuleReferenceSyntax { + moduleName: INameSyntax; } + export interface ModuleNameModuleReferenceConstructor { new (data: number, moduleName: INameSyntax): ModuleNameModuleReferenceSyntax } } \ No newline at end of file diff --git a/src/services/syntax/syntaxKind.ts b/src/services/syntax/syntaxKind.ts index bcc6ab46eec..896a3239146 100644 --- a/src/services/syntax/syntaxKind.ts +++ b/src/services/syntax/syntaxKind.ts @@ -5,8 +5,6 @@ module TypeScript { // Variable width tokens, trivia and lists. None, List, - SeparatedList, - TriviaList, // Trivia WhitespaceTrivia, @@ -28,6 +26,12 @@ module TypeScript { NumericLiteral, StringLiteral, + // Template tokens + NoSubstitutionTemplateToken, + TemplateStartToken, + TemplateMiddleToken, + TemplateEndToken, + // All fixed width tokens follow. // Keywords @@ -158,6 +162,9 @@ module TypeScript { ConstructorType, GenericType, TypeQuery, + TupleType, + UnionType, + ParenthesizedType, // Module elements. InterfaceDeclaration, @@ -206,54 +213,13 @@ module TypeScript { WithStatement, // Expressions - PlusExpression, - NegateExpression, - BitwiseNotExpression, - LogicalNotExpression, - PreIncrementExpression, - PreDecrementExpression, + PrefixUnaryExpression, DeleteExpression, TypeOfExpression, VoidExpression, - CommaExpression, - AssignmentExpression, - AddAssignmentExpression, - SubtractAssignmentExpression, - MultiplyAssignmentExpression, - DivideAssignmentExpression, - ModuloAssignmentExpression, - AndAssignmentExpression, - ExclusiveOrAssignmentExpression, - OrAssignmentExpression, - LeftShiftAssignmentExpression, - SignedRightShiftAssignmentExpression, - UnsignedRightShiftAssignmentExpression, ConditionalExpression, - LogicalOrExpression, - LogicalAndExpression, - BitwiseOrExpression, - BitwiseExclusiveOrExpression, - BitwiseAndExpression, - EqualsWithTypeConversionExpression, - NotEqualsWithTypeConversionExpression, - EqualsExpression, - NotEqualsExpression, - LessThanExpression, - GreaterThanExpression, - LessThanOrEqualExpression, - GreaterThanOrEqualExpression, - InstanceOfExpression, - InExpression, - LeftShiftExpression, - SignedRightShiftExpression, - UnsignedRightShiftExpression, - MultiplyExpression, - DivideExpression, - ModuloExpression, - AddExpression, - SubtractExpression, - PostIncrementExpression, - PostDecrementExpression, + BinaryExpression, + PostfixUnaryExpression, MemberAccessExpression, InvocationExpression, ArrayLiteralExpression, @@ -266,6 +232,9 @@ module TypeScript { ElementAccessExpression, FunctionExpression, OmittedExpression, + TemplateExpression, + TemplateAccessExpression, + YieldExpression, // Variable declarations VariableDeclaration, @@ -278,14 +247,14 @@ module TypeScript { TypeParameterList, // Clauses - ExtendsHeritageClause, - ImplementsHeritageClause, + HeritageClause, EqualsValueClause, CaseSwitchClause, DefaultSwitchClause, ElseClause, CatchClause, FinallyClause, + TemplateClause, // Generics TypeParameter, @@ -293,14 +262,14 @@ module TypeScript { // Property Assignment SimplePropertyAssignment, - // GetAccessorPropertyAssignment, - // SetAccessorPropertyAssignment, FunctionPropertyAssignment, // Misc. Parameter, EnumElement, TypeAnnotation, + ExpressionBody, + ComputedPropertyName, ExternalModuleReference, ModuleNameModuleReference, diff --git a/src/services/syntax/syntaxList.ts b/src/services/syntax/syntaxList.ts index 52bc02ecdca..aa6d8112952 100644 --- a/src/services/syntax/syntaxList.ts +++ b/src/services/syntax/syntaxList.ts @@ -1,95 +1,69 @@ /// interface Array { - data: number; - separators?: TypeScript.ISyntaxToken[]; + __data: number; - kind(): TypeScript.SyntaxKind; + kind: TypeScript.SyntaxKind; parent: TypeScript.ISyntaxElement; +} - separatorCount(): number; - separatorAt(index: number): TypeScript.ISyntaxToken; +module TypeScript { + export interface ISeparatedSyntaxList extends Array { + //separatorCount(): number; + //separatorAt(index: number): TypeScript.ISyntaxToken; + + //nonSeparatorCount(): number; + //nonSeparatorAt(index: number): T; + } +} + +module TypeScript { + export function separatorCount(list: ISeparatedSyntaxList) { + return list === undefined ? 0 : list.length >> 1; + } + + export function nonSeparatorCount(list: ISeparatedSyntaxList) { + return list === undefined ? 0 : (list.length + 1) >> 1; + } + + export function separatorAt(list: ISeparatedSyntaxList, index: number): ISyntaxToken { + return list[(index << 1) + 1]; + } + + export function nonSeparatorAt(list: ISeparatedSyntaxList, index: number): T { + return list[index << 1]; + } } module TypeScript.Syntax { - var _emptyList: ISyntaxNodeOrToken[] = []; - - var _emptySeparatedList: ISyntaxNodeOrToken[] = []; - var _emptySeparators: ISyntaxToken[] = []; - - _emptySeparatedList.separators = _emptySeparators; - - function assertEmptyLists() { - // Debug.assert(_emptyList.length === 0); - // var separators = _emptySeparatedList.separators; - // Debug.assert(!separators || separators.length === 0); + function addArrayPrototypeValue(name: string, val: any) { + if (Object.defineProperty && (Array.prototype)[name] === undefined) { + Object.defineProperty(Array.prototype, name, { value: val, writable: false, enumerable: false }); + } + else { + (Array.prototype)[name] = val; + } } - Array.prototype.kind = function () { - return this.separators === undefined ? SyntaxKind.List : SyntaxKind.SeparatedList; - } - - Array.prototype.separatorCount = function (): number { - assertEmptyLists(); - // Debug.assert(this.kind === SyntaxKind.SeparatedList); - return this.separators.length; - } - - Array.prototype.separatorAt = function (index: number): ISyntaxToken { - assertEmptyLists(); - // Debug.assert(this.kind === SyntaxKind.SeparatedList); - // Debug.assert(index >= 0 && index < this.separators.length); - return this.separators[index]; - } - - export function emptyList(): T[] { - return _emptyList; - } - - export function emptySeparatedList(): T[] { - return _emptySeparatedList; - } + addArrayPrototypeValue("kind", SyntaxKind.List); export function list(nodes: T[]): T[] { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptyList(); - } - - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - - return nodes; - } - - export function separatedList(nodes: T[], separators: ISyntaxToken[]): T[] { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptySeparatedList(); - } - - // Debug.assert(separators.length === nodes.length || separators.length == (nodes.length - 1)); - - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - - for (var i = 0, n = separators.length; i < n; i++) { - separators[i].parent = nodes; - } - - - nodes.separators = separators.length === 0 ? _emptySeparators : separators; - - return nodes; - } - - export function nonSeparatorIndexOf(list: T[], ast: ISyntaxNodeOrToken): number { - for (var i = 0, n = list.length; i < n; i++) { - if (list[i] === ast) { - return i; + if (nodes !== undefined) { + for (var i = 0, n = nodes.length; i < n; i++) { + nodes[i].parent = nodes; } } - return -1; + return nodes; + } + + export function separatedList(nodesAndTokens: ISyntaxNodeOrToken[]): ISeparatedSyntaxList { + if (nodesAndTokens !== undefined) { + for (var i = 0, n = nodesAndTokens.length; i < n; i++) { + nodesAndTokens[i].parent = nodesAndTokens; + } + } + + return >nodesAndTokens; } } \ No newline at end of file diff --git a/src/services/syntax/syntaxNode.ts b/src/services/syntax/syntaxNode.ts deleted file mode 100644 index 464c59793aa..00000000000 --- a/src/services/syntax/syntaxNode.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -module TypeScript { - export class SyntaxNode implements ISyntaxNodeOrToken { - private __kind: SyntaxKind; - public data: number; - public parent: ISyntaxElement; - - constructor(data: number) { - if (data) { - this.data = data; - } - } - - public kind(): SyntaxKind { - return this.__kind; - } - } -} \ No newline at end of file diff --git a/src/services/syntax/syntaxNodeOrToken.ts b/src/services/syntax/syntaxNodeOrToken.ts index 695268d843f..932970169f6 100644 --- a/src/services/syntax/syntaxNodeOrToken.ts +++ b/src/services/syntax/syntaxNodeOrToken.ts @@ -2,5 +2,7 @@ module TypeScript { export interface ISyntaxNodeOrToken extends ISyntaxElement { + childCount: number; + childAt(index: number): ISyntaxElement; } } \ No newline at end of file diff --git a/src/services/syntax/syntaxNodes.abstract.generated.ts b/src/services/syntax/syntaxNodes.abstract.generated.ts deleted file mode 100644 index 031b0363ca4..00000000000 --- a/src/services/syntax/syntaxNodes.abstract.generated.ts +++ /dev/null @@ -1,1194 +0,0 @@ -/// - -module TypeScript.Syntax.Abstract { - // Inject this module as the factory for producing syntax nodes in the parser. - Parser.syntaxFactory = Abstract; - export var isConcrete: boolean = false; - - export class SourceUnitSyntax extends SyntaxNode { - public syntaxTree: SyntaxTree = null; - public moduleElements: IModuleElementSyntax[]; - public endOfFileToken: ISyntaxToken; - constructor(data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken) { - super(data); - this.parent = null, - this.moduleElements = moduleElements, - this.endOfFileToken = endOfFileToken, - !isShared(moduleElements) && (moduleElements.parent = this), - endOfFileToken.parent = this; - } - } - export class QualifiedNameSyntax extends SyntaxNode implements INameSyntax { - public left: INameSyntax; - public dotToken: ISyntaxToken; - public right: ISyntaxToken; - public _nameBrand: any; public _typeBrand: any; - constructor(data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken) { - super(data); - this.left = left, - this.right = right, - left.parent = this, - right.parent = this; - } - } - export class ObjectTypeSyntax extends SyntaxNode implements ITypeSyntax { - public openBraceToken: ISyntaxToken; - public typeMembers: ITypeMemberSyntax[]; - public closeBraceToken: ISyntaxToken; - public _typeBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, typeMembers: ITypeMemberSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.typeMembers = typeMembers, - !isShared(typeMembers) && (typeMembers.parent = this); - } - } - export class FunctionTypeSyntax extends SyntaxNode implements ITypeSyntax { - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public type: ITypeSyntax; - public _typeBrand: any; - constructor(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.type = type, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - type.parent = this; - } - } - export class ArrayTypeSyntax extends SyntaxNode implements ITypeSyntax { - public type: ITypeSyntax; - public openBracketToken: ISyntaxToken; - public closeBracketToken: ISyntaxToken; - public _typeBrand: any; - constructor(data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken) { - super(data); - this.type = type, - type.parent = this; - } - } - export class ConstructorTypeSyntax extends SyntaxNode implements ITypeSyntax { - public newKeyword: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public type: ITypeSyntax; - public _typeBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.type = type, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - type.parent = this; - } - } - export class GenericTypeSyntax extends SyntaxNode implements ITypeSyntax { - public name: INameSyntax; - public typeArgumentList: TypeArgumentListSyntax; - public _typeBrand: any; - constructor(data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax) { - super(data); - this.name = name, - this.typeArgumentList = typeArgumentList, - name.parent = this, - typeArgumentList.parent = this; - } - } - export class TypeQuerySyntax extends SyntaxNode implements ITypeSyntax { - public typeOfKeyword: ISyntaxToken; - public name: INameSyntax; - public _typeBrand: any; - constructor(data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax) { - super(data); - this.name = name, - name.parent = this; - } - } - export class InterfaceDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public interfaceKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public heritageClauses: HeritageClauseSyntax[]; - public body: ObjectTypeSyntax; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax) { - super(data); - this.modifiers = modifiers, - this.identifier = identifier, - this.typeParameterList = typeParameterList, - this.heritageClauses = heritageClauses, - this.body = body, - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - typeParameterList && (typeParameterList.parent = this), - !isShared(heritageClauses) && (heritageClauses.parent = this), - body.parent = this; - } - } - export class FunctionDeclarationSyntax extends SyntaxNode implements IStatementSyntax { - public modifiers: ISyntaxToken[]; - public functionKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.identifier = identifier, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - callSignature.parent = this, - block && (block.parent = this); - } - } - export class ModuleDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public moduleKeyword: ISyntaxToken; - public name: INameSyntax; - public stringLiteral: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public moduleElements: IModuleElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.name = name, - this.stringLiteral = stringLiteral, - this.moduleElements = moduleElements, - !isShared(modifiers) && (modifiers.parent = this), - name && (name.parent = this), - stringLiteral && (stringLiteral.parent = this), - !isShared(moduleElements) && (moduleElements.parent = this); - } - } - export class ClassDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public classKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public heritageClauses: HeritageClauseSyntax[]; - public openBraceToken: ISyntaxToken; - public classElements: IClassElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.identifier = identifier, - this.typeParameterList = typeParameterList, - this.heritageClauses = heritageClauses, - this.classElements = classElements, - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - typeParameterList && (typeParameterList.parent = this), - !isShared(heritageClauses) && (heritageClauses.parent = this), - !isShared(classElements) && (classElements.parent = this); - } - } - export class EnumDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public enumKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public enumElements: EnumElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: EnumElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.identifier = identifier, - this.enumElements = enumElements, - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - !isShared(enumElements) && (enumElements.parent = this); - } - } - export class ImportDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public importKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public equalsToken: ISyntaxToken; - public moduleReference: IModuleReferenceSyntax; - public semicolonToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.identifier = identifier, - this.moduleReference = moduleReference, - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - moduleReference.parent = this; - } - } - export class ExportAssignmentSyntax extends SyntaxNode implements IModuleElementSyntax { - public exportKeyword: ISyntaxToken; - public equalsToken: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.identifier = identifier, - identifier.parent = this; - } - } - export class MemberFunctionDeclarationSyntax extends SyntaxNode implements IMemberDeclarationSyntax { - public modifiers: ISyntaxToken[]; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _memberDeclarationBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - propertyName.parent = this, - callSignature.parent = this, - block && (block.parent = this); - } - } - export class MemberVariableDeclarationSyntax extends SyntaxNode implements IMemberDeclarationSyntax { - public modifiers: ISyntaxToken[]; - public variableDeclarator: VariableDeclaratorSyntax; - public semicolonToken: ISyntaxToken; - public _memberDeclarationBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.variableDeclarator = variableDeclarator, - !isShared(modifiers) && (modifiers.parent = this), - variableDeclarator.parent = this; - } - } - export class ConstructorDeclarationSyntax extends SyntaxNode implements IClassElementSyntax { - public modifiers: ISyntaxToken[]; - public constructorKeyword: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.constructorKeyword = constructorKeyword, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - constructorKeyword.parent = this, - callSignature.parent = this, - block && (block.parent = this); - } - } - export class IndexMemberDeclarationSyntax extends SyntaxNode implements IClassElementSyntax { - public modifiers: ISyntaxToken[]; - public indexSignature: IndexSignatureSyntax; - public semicolonToken: ISyntaxToken; - public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.indexSignature = indexSignature, - !isShared(modifiers) && (modifiers.parent = this), - indexSignature.parent = this; - } - } - export class GetAccessorSyntax extends SyntaxNode implements IMemberDeclarationSyntax, IPropertyAssignmentSyntax { - public modifiers: ISyntaxToken[]; - public getKeyword: ISyntaxToken; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _memberDeclarationBrand: any; public _propertyAssignmentBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.modifiers = modifiers, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class SetAccessorSyntax extends SyntaxNode implements IMemberDeclarationSyntax, IPropertyAssignmentSyntax { - public modifiers: ISyntaxToken[]; - public setKeyword: ISyntaxToken; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _memberDeclarationBrand: any; public _propertyAssignmentBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.modifiers = modifiers, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class PropertySignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public propertyName: ISyntaxToken; - public questionToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.propertyName = propertyName, - this.questionToken = questionToken, - this.typeAnnotation = typeAnnotation, - propertyName.parent = this, - questionToken && (questionToken.parent = this), - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class CallSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.typeAnnotation = typeAnnotation, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class ConstructSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public newKeyword: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public _typeMemberBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax) { - super(data); - this.callSignature = callSignature, - callSignature.parent = this; - } - } - export class IndexSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public openBracketToken: ISyntaxToken; - public parameters: ParameterSyntax[]; - public closeBracketToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, openBracketToken: ISyntaxToken, parameters: ParameterSyntax[], closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.openBracketToken = openBracketToken, - this.parameters = parameters, - this.closeBracketToken = closeBracketToken, - this.typeAnnotation = typeAnnotation, - openBracketToken.parent = this, - !isShared(parameters) && (parameters.parent = this), - closeBracketToken.parent = this, - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class MethodSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public propertyName: ISyntaxToken; - public questionToken: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public _typeMemberBrand: any; - constructor(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax) { - super(data); - this.propertyName = propertyName, - this.questionToken = questionToken, - this.callSignature = callSignature, - propertyName.parent = this, - questionToken && (questionToken.parent = this), - callSignature.parent = this; - } - } - export class BlockSyntax extends SyntaxNode implements IStatementSyntax { - public openBraceToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.openBraceToken = openBraceToken, - this.statements = statements, - openBraceToken.parent = this, - !isShared(statements) && (statements.parent = this); - } - } - export class IfStatementSyntax extends SyntaxNode implements IStatementSyntax { - public ifKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public elseClause: ElseClauseSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax) { - super(data); - this.condition = condition, - this.statement = statement, - this.elseClause = elseClause, - condition.parent = this, - statement.parent = this, - elseClause && (elseClause.parent = this); - } - } - export class VariableStatementSyntax extends SyntaxNode implements IStatementSyntax { - public modifiers: ISyntaxToken[]; - public variableDeclaration: VariableDeclarationSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.variableDeclaration = variableDeclaration, - !isShared(modifiers) && (modifiers.parent = this), - variableDeclaration.parent = this; - } - } - export class ExpressionStatementSyntax extends SyntaxNode implements IStatementSyntax { - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class ReturnStatementSyntax extends SyntaxNode implements IStatementSyntax { - public returnKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.returnKeyword = returnKeyword, - this.expression = expression, - returnKeyword.parent = this, - expression && (expression.parent = this); - } - } - export class SwitchStatementSyntax extends SyntaxNode implements IStatementSyntax { - public switchKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public switchClauses: ISwitchClauseSyntax[]; - public closeBraceToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.expression = expression, - this.switchClauses = switchClauses, - expression.parent = this, - !isShared(switchClauses) && (switchClauses.parent = this); - } - } - export class BreakStatementSyntax extends SyntaxNode implements IStatementSyntax { - public breakKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.breakKeyword = breakKeyword, - this.identifier = identifier, - breakKeyword.parent = this, - identifier && (identifier.parent = this); - } - } - export class ContinueStatementSyntax extends SyntaxNode implements IStatementSyntax { - public continueKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.continueKeyword = continueKeyword, - this.identifier = identifier, - continueKeyword.parent = this, - identifier && (identifier.parent = this); - } - } - export class ForStatementSyntax extends SyntaxNode implements IStatementSyntax { - public forKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public variableDeclaration: VariableDeclarationSyntax; - public initializer: IExpressionSyntax; - public firstSemicolonToken: ISyntaxToken; - public condition: IExpressionSyntax; - public secondSemicolonToken: ISyntaxToken; - public incrementor: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.variableDeclaration = variableDeclaration, - this.initializer = initializer, - this.condition = condition, - this.incrementor = incrementor, - this.statement = statement, - variableDeclaration && (variableDeclaration.parent = this), - initializer && (initializer.parent = this), - condition && (condition.parent = this), - incrementor && (incrementor.parent = this), - statement.parent = this; - } - } - export class ForInStatementSyntax extends SyntaxNode implements IStatementSyntax { - public forKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public variableDeclaration: VariableDeclarationSyntax; - public left: IExpressionSyntax; - public inKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.variableDeclaration = variableDeclaration, - this.left = left, - this.expression = expression, - this.statement = statement, - variableDeclaration && (variableDeclaration.parent = this), - left && (left.parent = this), - expression.parent = this, - statement.parent = this; - } - } - export class EmptyStatementSyntax extends SyntaxNode implements IStatementSyntax { - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, semicolonToken: ISyntaxToken) { - super(data); - this.semicolonToken = semicolonToken, - semicolonToken.parent = this; - } - } - export class ThrowStatementSyntax extends SyntaxNode implements IStatementSyntax { - public throwKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class WhileStatementSyntax extends SyntaxNode implements IStatementSyntax { - public whileKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.condition = condition, - this.statement = statement, - condition.parent = this, - statement.parent = this; - } - } - export class TryStatementSyntax extends SyntaxNode implements IStatementSyntax { - public tryKeyword: ISyntaxToken; - public block: BlockSyntax; - public catchClause: CatchClauseSyntax; - public finallyClause: FinallyClauseSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax) { - super(data); - this.block = block, - this.catchClause = catchClause, - this.finallyClause = finallyClause, - block.parent = this, - catchClause && (catchClause.parent = this), - finallyClause && (finallyClause.parent = this); - } - } - export class LabeledStatementSyntax extends SyntaxNode implements IStatementSyntax { - public identifier: ISyntaxToken; - public colonToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.identifier = identifier, - this.statement = statement, - identifier.parent = this, - statement.parent = this; - } - } - export class DoStatementSyntax extends SyntaxNode implements IStatementSyntax { - public doKeyword: ISyntaxToken; - public statement: IStatementSyntax; - public whileKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.statement = statement, - this.condition = condition, - statement.parent = this, - condition.parent = this; - } - } - export class DebuggerStatementSyntax extends SyntaxNode implements IStatementSyntax { - public debuggerKeyword: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.debuggerKeyword = debuggerKeyword, - debuggerKeyword.parent = this; - } - } - export class WithStatementSyntax extends SyntaxNode implements IStatementSyntax { - public withKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.condition = condition, - this.statement = statement, - condition.parent = this, - statement.parent = this; - } - } - export class PrefixUnaryExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public operatorToken: ISyntaxToken; - public operand: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax) { - super(data); - this.operatorToken = operatorToken, - this.operand = operand, - operatorToken.parent = this, - operand.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class DeleteExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public deleteKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class TypeOfExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public typeOfKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class VoidExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public voidKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class ConditionalExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public condition: IExpressionSyntax; - public questionToken: ISyntaxToken; - public whenTrue: IExpressionSyntax; - public colonToken: ISyntaxToken; - public whenFalse: IExpressionSyntax; - public _expressionBrand: any; - constructor(data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax) { - super(data); - this.condition = condition, - this.whenTrue = whenTrue, - this.whenFalse = whenFalse, - condition.parent = this, - whenTrue.parent = this, - whenFalse.parent = this; - } - } - export class BinaryExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public left: IExpressionSyntax; - public operatorToken: ISyntaxToken; - public right: IExpressionSyntax; - public _expressionBrand: any; - constructor(data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax) { - super(data); - this.left = left, - this.operatorToken = operatorToken, - this.right = right, - left.parent = this, - operatorToken.parent = this, - right.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getBinaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class PostfixUnaryExpressionSyntax extends SyntaxNode implements IPostfixExpressionSyntax { - public operand: ILeftHandSideExpressionSyntax; - public operatorToken: ISyntaxToken; - public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken) { - super(data); - this.operand = operand, - this.operatorToken = operatorToken, - operand.parent = this, - operatorToken.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class MemberAccessExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax, ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public dotToken: ISyntaxToken; - public name: ISyntaxToken; - public _memberExpressionBrand: any; public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken) { - super(data); - this.expression = expression, - this.name = name, - expression.parent = this, - name.parent = this; - } - } - export class InvocationExpressionSyntax extends SyntaxNode implements ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public argumentList: ArgumentListSyntax; - public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax) { - super(data); - this.expression = expression, - this.argumentList = argumentList, - expression.parent = this, - argumentList.parent = this; - } - } - export class ArrayLiteralExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openBracketToken: ISyntaxToken; - public expressions: IExpressionSyntax[]; - public closeBracketToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openBracketToken: ISyntaxToken, expressions: IExpressionSyntax[], closeBracketToken: ISyntaxToken) { - super(data); - this.expressions = expressions, - !isShared(expressions) && (expressions.parent = this); - } - } - export class ObjectLiteralExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openBraceToken: ISyntaxToken; - public propertyAssignments: IPropertyAssignmentSyntax[]; - public closeBraceToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, propertyAssignments: IPropertyAssignmentSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.propertyAssignments = propertyAssignments, - !isShared(propertyAssignments) && (propertyAssignments.parent = this); - } - } - export class ObjectCreationExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public newKeyword: ISyntaxToken; - public expression: IMemberExpressionSyntax; - public argumentList: ArgumentListSyntax; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax) { - super(data); - this.expression = expression, - this.argumentList = argumentList, - expression.parent = this, - argumentList && (argumentList.parent = this); - } - } - export class ParenthesizedExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openParenToken: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class ParenthesizedArrowFunctionExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public callSignature: CallSignatureSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public block: BlockSyntax; - public expression: IExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax) { - super(data); - this.callSignature = callSignature, - this.block = block, - this.expression = expression, - callSignature.parent = this, - block && (block.parent = this), - expression && (expression.parent = this); - } - } - export class SimpleArrowFunctionExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public parameter: ParameterSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public block: BlockSyntax; - public expression: IExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax) { - super(data); - this.parameter = parameter, - this.block = block, - this.expression = expression, - parameter.parent = this, - block && (block.parent = this), - expression && (expression.parent = this); - } - } - export class CastExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public lessThanToken: ISyntaxToken; - public type: ITypeSyntax; - public greaterThanToken: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.type = type, - this.expression = expression, - type.parent = this, - expression.parent = this; - } - } - export class ElementAccessExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax, ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public openBracketToken: ISyntaxToken; - public argumentExpression: IExpressionSyntax; - public closeBracketToken: ISyntaxToken; - public _memberExpressionBrand: any; public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { - super(data); - this.expression = expression, - this.argumentExpression = argumentExpression, - expression.parent = this, - argumentExpression.parent = this; - } - } - export class FunctionExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public functionKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.identifier = identifier, - this.callSignature = callSignature, - this.block = block, - identifier && (identifier.parent = this), - callSignature.parent = this, - block.parent = this; - } - } - export class OmittedExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public _expressionBrand: any; - constructor(data: number) { - super(data); - } - } - export class VariableDeclarationSyntax extends SyntaxNode { - public varKeyword: ISyntaxToken; - public variableDeclarators: VariableDeclaratorSyntax[]; - constructor(data: number, varKeyword: ISyntaxToken, variableDeclarators: VariableDeclaratorSyntax[]) { - super(data); - this.varKeyword = varKeyword, - this.variableDeclarators = variableDeclarators, - varKeyword.parent = this, - !isShared(variableDeclarators) && (variableDeclarators.parent = this); - } - } - export class VariableDeclaratorSyntax extends SyntaxNode { - public propertyName: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.propertyName = propertyName, - this.typeAnnotation = typeAnnotation, - this.equalsValueClause = equalsValueClause, - propertyName.parent = this, - typeAnnotation && (typeAnnotation.parent = this), - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class ArgumentListSyntax extends SyntaxNode { - public typeArgumentList: TypeArgumentListSyntax; - public openParenToken: ISyntaxToken; - public arguments: IExpressionSyntax[]; - public closeParenToken: ISyntaxToken; - constructor(data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: IExpressionSyntax[], closeParenToken: ISyntaxToken) { - super(data); - this.typeArgumentList = typeArgumentList, - this.arguments = _arguments, - typeArgumentList && (typeArgumentList.parent = this), - !isShared(_arguments) && (_arguments.parent = this); - } - } - export class ParameterListSyntax extends SyntaxNode { - public openParenToken: ISyntaxToken; - public parameters: ParameterSyntax[]; - public closeParenToken: ISyntaxToken; - constructor(data: number, openParenToken: ISyntaxToken, parameters: ParameterSyntax[], closeParenToken: ISyntaxToken) { - super(data); - this.parameters = parameters, - !isShared(parameters) && (parameters.parent = this); - } - } - export class TypeArgumentListSyntax extends SyntaxNode { - public lessThanToken: ISyntaxToken; - public typeArguments: ITypeSyntax[]; - public greaterThanToken: ISyntaxToken; - constructor(data: number, lessThanToken: ISyntaxToken, typeArguments: ITypeSyntax[], greaterThanToken: ISyntaxToken) { - super(data); - this.lessThanToken = lessThanToken, - this.typeArguments = typeArguments, - lessThanToken.parent = this, - !isShared(typeArguments) && (typeArguments.parent = this); - } - } - export class TypeParameterListSyntax extends SyntaxNode { - public lessThanToken: ISyntaxToken; - public typeParameters: TypeParameterSyntax[]; - public greaterThanToken: ISyntaxToken; - constructor(data: number, lessThanToken: ISyntaxToken, typeParameters: TypeParameterSyntax[], greaterThanToken: ISyntaxToken) { - super(data); - this.lessThanToken = lessThanToken, - this.typeParameters = typeParameters, - lessThanToken.parent = this, - !isShared(typeParameters) && (typeParameters.parent = this); - } - } - export class HeritageClauseSyntax extends SyntaxNode { - public extendsOrImplementsKeyword: ISyntaxToken; - public typeNames: INameSyntax[]; - constructor(data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: INameSyntax[]) { - super(data); - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, - this.typeNames = typeNames, - extendsOrImplementsKeyword.parent = this, - !isShared(typeNames) && (typeNames.parent = this); - } - public kind(): SyntaxKind { return this.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword ? SyntaxKind.ExtendsHeritageClause : SyntaxKind.ImplementsHeritageClause; } - } - export class EqualsValueClauseSyntax extends SyntaxNode { - public equalsToken: ISyntaxToken; - public value: IExpressionSyntax; - constructor(data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax) { - super(data); - this.value = value, - value.parent = this; - } - } - export class CaseSwitchClauseSyntax extends SyntaxNode implements ISwitchClauseSyntax { - public caseKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public colonToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public _switchClauseBrand: any; - constructor(data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { - super(data); - this.expression = expression, - this.statements = statements, - expression.parent = this, - !isShared(statements) && (statements.parent = this); - } - } - export class DefaultSwitchClauseSyntax extends SyntaxNode implements ISwitchClauseSyntax { - public defaultKeyword: ISyntaxToken; - public colonToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public _switchClauseBrand: any; - constructor(data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { - super(data); - this.statements = statements, - !isShared(statements) && (statements.parent = this); - } - } - export class ElseClauseSyntax extends SyntaxNode { - public elseKeyword: ISyntaxToken; - public statement: IStatementSyntax; - constructor(data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.statement = statement, - statement.parent = this; - } - } - export class CatchClauseSyntax extends SyntaxNode { - public catchKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public identifier: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public closeParenToken: ISyntaxToken; - public block: BlockSyntax; - constructor(data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax) { - super(data); - this.identifier = identifier, - this.typeAnnotation = typeAnnotation, - this.block = block, - identifier.parent = this, - typeAnnotation && (typeAnnotation.parent = this), - block.parent = this; - } - } - export class FinallyClauseSyntax extends SyntaxNode { - public finallyKeyword: ISyntaxToken; - public block: BlockSyntax; - constructor(data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax) { - super(data); - this.block = block, - block.parent = this; - } - } - export class TypeParameterSyntax extends SyntaxNode { - public identifier: ISyntaxToken; - public constraint: ConstraintSyntax; - constructor(data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax) { - super(data); - this.identifier = identifier, - this.constraint = constraint, - identifier.parent = this, - constraint && (constraint.parent = this); - } - } - export class ConstraintSyntax extends SyntaxNode { - public extendsKeyword: ISyntaxToken; - public typeOrExpression: ISyntaxNodeOrToken; - constructor(data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken) { - super(data); - this.typeOrExpression = typeOrExpression, - typeOrExpression.parent = this; - } - } - export class SimplePropertyAssignmentSyntax extends SyntaxNode implements IPropertyAssignmentSyntax { - public propertyName: ISyntaxToken; - public colonToken: ISyntaxToken; - public expression: IExpressionSyntax; - public _propertyAssignmentBrand: any; - constructor(data: number, propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax) { - super(data); - this.propertyName = propertyName, - this.expression = expression, - propertyName.parent = this, - expression.parent = this; - } - } - export class FunctionPropertyAssignmentSyntax extends SyntaxNode implements IPropertyAssignmentSyntax { - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _propertyAssignmentBrand: any; - constructor(data: number, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class ParameterSyntax extends SyntaxNode { - public dotDotDotToken: ISyntaxToken; - public modifiers: ISyntaxToken[]; - public identifier: ISyntaxToken; - public questionToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.dotDotDotToken = dotDotDotToken, - this.modifiers = modifiers, - this.identifier = identifier, - this.questionToken = questionToken, - this.typeAnnotation = typeAnnotation, - this.equalsValueClause = equalsValueClause, - dotDotDotToken && (dotDotDotToken.parent = this), - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - questionToken && (questionToken.parent = this), - typeAnnotation && (typeAnnotation.parent = this), - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class EnumElementSyntax extends SyntaxNode { - public propertyName: ISyntaxToken; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.propertyName = propertyName, - this.equalsValueClause = equalsValueClause, - propertyName.parent = this, - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class TypeAnnotationSyntax extends SyntaxNode { - public colonToken: ISyntaxToken; - public type: ITypeSyntax; - constructor(data: number, colonToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.type = type, - type.parent = this; - } - } - export class ExternalModuleReferenceSyntax extends SyntaxNode implements IModuleReferenceSyntax { - public requireKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public stringLiteral: ISyntaxToken; - public closeParenToken: ISyntaxToken; - public _moduleReferenceBrand: any; - constructor(data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken) { - super(data); - this.stringLiteral = stringLiteral, - stringLiteral.parent = this; - } - } - export class ModuleNameModuleReferenceSyntax extends SyntaxNode implements IModuleReferenceSyntax { - public moduleName: INameSyntax; - public _moduleReferenceBrand: any; - constructor(data: number, moduleName: INameSyntax) { - super(data); - this.moduleName = moduleName, - moduleName.parent = this; - } - } - - (SourceUnitSyntax).prototype.__kind = SyntaxKind.SourceUnit, (QualifiedNameSyntax).prototype.__kind = SyntaxKind.QualifiedName, (ObjectTypeSyntax).prototype.__kind = SyntaxKind.ObjectType, (FunctionTypeSyntax).prototype.__kind = SyntaxKind.FunctionType, (ArrayTypeSyntax).prototype.__kind = SyntaxKind.ArrayType, (ConstructorTypeSyntax).prototype.__kind = SyntaxKind.ConstructorType, (GenericTypeSyntax).prototype.__kind = SyntaxKind.GenericType, (TypeQuerySyntax).prototype.__kind = SyntaxKind.TypeQuery, (InterfaceDeclarationSyntax).prototype.__kind = SyntaxKind.InterfaceDeclaration, (FunctionDeclarationSyntax).prototype.__kind = SyntaxKind.FunctionDeclaration, (ModuleDeclarationSyntax).prototype.__kind = SyntaxKind.ModuleDeclaration, (ClassDeclarationSyntax).prototype.__kind = SyntaxKind.ClassDeclaration, (EnumDeclarationSyntax).prototype.__kind = SyntaxKind.EnumDeclaration, (ImportDeclarationSyntax).prototype.__kind = SyntaxKind.ImportDeclaration, (ExportAssignmentSyntax).prototype.__kind = SyntaxKind.ExportAssignment, (MemberFunctionDeclarationSyntax).prototype.__kind = SyntaxKind.MemberFunctionDeclaration, (MemberVariableDeclarationSyntax).prototype.__kind = SyntaxKind.MemberVariableDeclaration, (ConstructorDeclarationSyntax).prototype.__kind = SyntaxKind.ConstructorDeclaration, (IndexMemberDeclarationSyntax).prototype.__kind = SyntaxKind.IndexMemberDeclaration, (GetAccessorSyntax).prototype.__kind = SyntaxKind.GetAccessor, (SetAccessorSyntax).prototype.__kind = SyntaxKind.SetAccessor, (PropertySignatureSyntax).prototype.__kind = SyntaxKind.PropertySignature, (CallSignatureSyntax).prototype.__kind = SyntaxKind.CallSignature, (ConstructSignatureSyntax).prototype.__kind = SyntaxKind.ConstructSignature, (IndexSignatureSyntax).prototype.__kind = SyntaxKind.IndexSignature, (MethodSignatureSyntax).prototype.__kind = SyntaxKind.MethodSignature, (BlockSyntax).prototype.__kind = SyntaxKind.Block, (IfStatementSyntax).prototype.__kind = SyntaxKind.IfStatement, (VariableStatementSyntax).prototype.__kind = SyntaxKind.VariableStatement, (ExpressionStatementSyntax).prototype.__kind = SyntaxKind.ExpressionStatement, (ReturnStatementSyntax).prototype.__kind = SyntaxKind.ReturnStatement, (SwitchStatementSyntax).prototype.__kind = SyntaxKind.SwitchStatement, (BreakStatementSyntax).prototype.__kind = SyntaxKind.BreakStatement, (ContinueStatementSyntax).prototype.__kind = SyntaxKind.ContinueStatement, (ForStatementSyntax).prototype.__kind = SyntaxKind.ForStatement, (ForInStatementSyntax).prototype.__kind = SyntaxKind.ForInStatement, (EmptyStatementSyntax).prototype.__kind = SyntaxKind.EmptyStatement, (ThrowStatementSyntax).prototype.__kind = SyntaxKind.ThrowStatement, (WhileStatementSyntax).prototype.__kind = SyntaxKind.WhileStatement, (TryStatementSyntax).prototype.__kind = SyntaxKind.TryStatement, (LabeledStatementSyntax).prototype.__kind = SyntaxKind.LabeledStatement, (DoStatementSyntax).prototype.__kind = SyntaxKind.DoStatement, (DebuggerStatementSyntax).prototype.__kind = SyntaxKind.DebuggerStatement, (WithStatementSyntax).prototype.__kind = SyntaxKind.WithStatement, (DeleteExpressionSyntax).prototype.__kind = SyntaxKind.DeleteExpression, (TypeOfExpressionSyntax).prototype.__kind = SyntaxKind.TypeOfExpression, (VoidExpressionSyntax).prototype.__kind = SyntaxKind.VoidExpression, (ConditionalExpressionSyntax).prototype.__kind = SyntaxKind.ConditionalExpression, (MemberAccessExpressionSyntax).prototype.__kind = SyntaxKind.MemberAccessExpression, (InvocationExpressionSyntax).prototype.__kind = SyntaxKind.InvocationExpression, (ArrayLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ArrayLiteralExpression, (ObjectLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ObjectLiteralExpression, (ObjectCreationExpressionSyntax).prototype.__kind = SyntaxKind.ObjectCreationExpression, (ParenthesizedExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedExpression, (ParenthesizedArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedArrowFunctionExpression, (SimpleArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.SimpleArrowFunctionExpression, (CastExpressionSyntax).prototype.__kind = SyntaxKind.CastExpression, (ElementAccessExpressionSyntax).prototype.__kind = SyntaxKind.ElementAccessExpression, (FunctionExpressionSyntax).prototype.__kind = SyntaxKind.FunctionExpression, (OmittedExpressionSyntax).prototype.__kind = SyntaxKind.OmittedExpression, (VariableDeclarationSyntax).prototype.__kind = SyntaxKind.VariableDeclaration, (VariableDeclaratorSyntax).prototype.__kind = SyntaxKind.VariableDeclarator, (ArgumentListSyntax).prototype.__kind = SyntaxKind.ArgumentList, (ParameterListSyntax).prototype.__kind = SyntaxKind.ParameterList, (TypeArgumentListSyntax).prototype.__kind = SyntaxKind.TypeArgumentList, (TypeParameterListSyntax).prototype.__kind = SyntaxKind.TypeParameterList, (EqualsValueClauseSyntax).prototype.__kind = SyntaxKind.EqualsValueClause, (CaseSwitchClauseSyntax).prototype.__kind = SyntaxKind.CaseSwitchClause, (DefaultSwitchClauseSyntax).prototype.__kind = SyntaxKind.DefaultSwitchClause, (ElseClauseSyntax).prototype.__kind = SyntaxKind.ElseClause, (CatchClauseSyntax).prototype.__kind = SyntaxKind.CatchClause, (FinallyClauseSyntax).prototype.__kind = SyntaxKind.FinallyClause, (TypeParameterSyntax).prototype.__kind = SyntaxKind.TypeParameter, (ConstraintSyntax).prototype.__kind = SyntaxKind.Constraint, (SimplePropertyAssignmentSyntax).prototype.__kind = SyntaxKind.SimplePropertyAssignment, (FunctionPropertyAssignmentSyntax).prototype.__kind = SyntaxKind.FunctionPropertyAssignment, (ParameterSyntax).prototype.__kind = SyntaxKind.Parameter, (EnumElementSyntax).prototype.__kind = SyntaxKind.EnumElement, (TypeAnnotationSyntax).prototype.__kind = SyntaxKind.TypeAnnotation, (ExternalModuleReferenceSyntax).prototype.__kind = SyntaxKind.ExternalModuleReference, (ModuleNameModuleReferenceSyntax).prototype.__kind = SyntaxKind.ModuleNameModuleReference; -} \ No newline at end of file diff --git a/src/services/syntax/syntaxNodes.concrete.generated.ts b/src/services/syntax/syntaxNodes.concrete.generated.ts index cc493aa53a6..7e35716659d 100644 --- a/src/services/syntax/syntaxNodes.concrete.generated.ts +++ b/src/services/syntax/syntaxNodes.concrete.generated.ts @@ -1,1424 +1,1917 @@ /// -module TypeScript.Syntax.Concrete { - // Inject this module as the factory for producing syntax nodes in the parser. - Parser.syntaxFactory = Concrete; - export var isConcrete: boolean = true; - - export class SourceUnitSyntax extends SyntaxNode { - public syntaxTree: SyntaxTree = null; - public moduleElements: IModuleElementSyntax[]; - public endOfFileToken: ISyntaxToken; - constructor(data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken) { - super(data); - this.parent = null, - this.moduleElements = moduleElements, - this.endOfFileToken = endOfFileToken, - !isShared(moduleElements) && (moduleElements.parent = this), - endOfFileToken.parent = this; - } - } - export class QualifiedNameSyntax extends SyntaxNode implements INameSyntax { - public left: INameSyntax; - public dotToken: ISyntaxToken; - public right: ISyntaxToken; - public _nameBrand: any; public _typeBrand: any; - constructor(data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken) { - super(data); - this.left = left, - this.dotToken = dotToken, - this.right = right, - left.parent = this, - dotToken.parent = this, - right.parent = this; - } - } - export class ObjectTypeSyntax extends SyntaxNode implements ITypeSyntax { - public openBraceToken: ISyntaxToken; - public typeMembers: ITypeMemberSyntax[]; - public closeBraceToken: ISyntaxToken; - public _typeBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, typeMembers: ITypeMemberSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.openBraceToken = openBraceToken, - this.typeMembers = typeMembers, - this.closeBraceToken = closeBraceToken, - openBraceToken.parent = this, - !isShared(typeMembers) && (typeMembers.parent = this), - closeBraceToken.parent = this; - } - } - export class FunctionTypeSyntax extends SyntaxNode implements ITypeSyntax { - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public type: ITypeSyntax; - public _typeBrand: any; - constructor(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.equalsGreaterThanToken = equalsGreaterThanToken, - this.type = type, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - equalsGreaterThanToken.parent = this, - type.parent = this; - } - } - export class ArrayTypeSyntax extends SyntaxNode implements ITypeSyntax { - public type: ITypeSyntax; - public openBracketToken: ISyntaxToken; - public closeBracketToken: ISyntaxToken; - public _typeBrand: any; - constructor(data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken) { - super(data); - this.type = type, - this.openBracketToken = openBracketToken, - this.closeBracketToken = closeBracketToken, - type.parent = this, - openBracketToken.parent = this, - closeBracketToken.parent = this; - } - } - export class ConstructorTypeSyntax extends SyntaxNode implements ITypeSyntax { - public newKeyword: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public type: ITypeSyntax; - public _typeBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.newKeyword = newKeyword, - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.equalsGreaterThanToken = equalsGreaterThanToken, - this.type = type, - newKeyword.parent = this, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - equalsGreaterThanToken.parent = this, - type.parent = this; - } - } - export class GenericTypeSyntax extends SyntaxNode implements ITypeSyntax { - public name: INameSyntax; - public typeArgumentList: TypeArgumentListSyntax; - public _typeBrand: any; - constructor(data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax) { - super(data); - this.name = name, - this.typeArgumentList = typeArgumentList, - name.parent = this, - typeArgumentList.parent = this; - } - } - export class TypeQuerySyntax extends SyntaxNode implements ITypeSyntax { - public typeOfKeyword: ISyntaxToken; - public name: INameSyntax; - public _typeBrand: any; - constructor(data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax) { - super(data); - this.typeOfKeyword = typeOfKeyword, - this.name = name, - typeOfKeyword.parent = this, - name.parent = this; - } - } - export class InterfaceDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public interfaceKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public heritageClauses: HeritageClauseSyntax[]; - public body: ObjectTypeSyntax; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax) { - super(data); - this.modifiers = modifiers, - this.interfaceKeyword = interfaceKeyword, - this.identifier = identifier, - this.typeParameterList = typeParameterList, - this.heritageClauses = heritageClauses, - this.body = body, - !isShared(modifiers) && (modifiers.parent = this), - interfaceKeyword.parent = this, - identifier.parent = this, - typeParameterList && (typeParameterList.parent = this), - !isShared(heritageClauses) && (heritageClauses.parent = this), - body.parent = this; - } - } - export class FunctionDeclarationSyntax extends SyntaxNode implements IStatementSyntax { - public modifiers: ISyntaxToken[]; - public functionKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.functionKeyword = functionKeyword, - this.identifier = identifier, - this.callSignature = callSignature, - this.block = block, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - functionKeyword.parent = this, - identifier.parent = this, - callSignature.parent = this, - block && (block.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class ModuleDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public moduleKeyword: ISyntaxToken; - public name: INameSyntax; - public stringLiteral: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public moduleElements: IModuleElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.moduleKeyword = moduleKeyword, - this.name = name, - this.stringLiteral = stringLiteral, - this.openBraceToken = openBraceToken, - this.moduleElements = moduleElements, - this.closeBraceToken = closeBraceToken, - !isShared(modifiers) && (modifiers.parent = this), - moduleKeyword.parent = this, - name && (name.parent = this), - stringLiteral && (stringLiteral.parent = this), - openBraceToken.parent = this, - !isShared(moduleElements) && (moduleElements.parent = this), - closeBraceToken.parent = this; - } - } - export class ClassDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public classKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public heritageClauses: HeritageClauseSyntax[]; - public openBraceToken: ISyntaxToken; - public classElements: IClassElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.classKeyword = classKeyword, - this.identifier = identifier, - this.typeParameterList = typeParameterList, - this.heritageClauses = heritageClauses, - this.openBraceToken = openBraceToken, - this.classElements = classElements, - this.closeBraceToken = closeBraceToken, - !isShared(modifiers) && (modifiers.parent = this), - classKeyword.parent = this, - identifier.parent = this, - typeParameterList && (typeParameterList.parent = this), - !isShared(heritageClauses) && (heritageClauses.parent = this), - openBraceToken.parent = this, - !isShared(classElements) && (classElements.parent = this), - closeBraceToken.parent = this; - } - } - export class EnumDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public enumKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public enumElements: EnumElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: EnumElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.enumKeyword = enumKeyword, - this.identifier = identifier, - this.openBraceToken = openBraceToken, - this.enumElements = enumElements, - this.closeBraceToken = closeBraceToken, - !isShared(modifiers) && (modifiers.parent = this), - enumKeyword.parent = this, - identifier.parent = this, - openBraceToken.parent = this, - !isShared(enumElements) && (enumElements.parent = this), - closeBraceToken.parent = this; - } - } - export class ImportDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public importKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public equalsToken: ISyntaxToken; - public moduleReference: IModuleReferenceSyntax; - public semicolonToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.importKeyword = importKeyword, - this.identifier = identifier, - this.equalsToken = equalsToken, - this.moduleReference = moduleReference, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - importKeyword.parent = this, - identifier.parent = this, - equalsToken.parent = this, - moduleReference.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class ExportAssignmentSyntax extends SyntaxNode implements IModuleElementSyntax { - public exportKeyword: ISyntaxToken; - public equalsToken: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.exportKeyword = exportKeyword, - this.equalsToken = equalsToken, - this.identifier = identifier, - this.semicolonToken = semicolonToken, - exportKeyword.parent = this, - equalsToken.parent = this, - identifier.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class MemberFunctionDeclarationSyntax extends SyntaxNode implements IMemberDeclarationSyntax { - public modifiers: ISyntaxToken[]; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _memberDeclarationBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - propertyName.parent = this, - callSignature.parent = this, - block && (block.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class MemberVariableDeclarationSyntax extends SyntaxNode implements IMemberDeclarationSyntax { - public modifiers: ISyntaxToken[]; - public variableDeclarator: VariableDeclaratorSyntax; - public semicolonToken: ISyntaxToken; - public _memberDeclarationBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.variableDeclarator = variableDeclarator, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - variableDeclarator.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class ConstructorDeclarationSyntax extends SyntaxNode implements IClassElementSyntax { - public modifiers: ISyntaxToken[]; - public constructorKeyword: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.constructorKeyword = constructorKeyword, - this.callSignature = callSignature, - this.block = block, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - constructorKeyword.parent = this, - callSignature.parent = this, - block && (block.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class IndexMemberDeclarationSyntax extends SyntaxNode implements IClassElementSyntax { - public modifiers: ISyntaxToken[]; - public indexSignature: IndexSignatureSyntax; - public semicolonToken: ISyntaxToken; - public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.indexSignature = indexSignature, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - indexSignature.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class GetAccessorSyntax extends SyntaxNode implements IMemberDeclarationSyntax, IPropertyAssignmentSyntax { - public modifiers: ISyntaxToken[]; - public getKeyword: ISyntaxToken; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _memberDeclarationBrand: any; public _propertyAssignmentBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.modifiers = modifiers, - this.getKeyword = getKeyword, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - getKeyword.parent = this, - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class SetAccessorSyntax extends SyntaxNode implements IMemberDeclarationSyntax, IPropertyAssignmentSyntax { - public modifiers: ISyntaxToken[]; - public setKeyword: ISyntaxToken; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _memberDeclarationBrand: any; public _propertyAssignmentBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.modifiers = modifiers, - this.setKeyword = setKeyword, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - setKeyword.parent = this, - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class PropertySignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public propertyName: ISyntaxToken; - public questionToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.propertyName = propertyName, - this.questionToken = questionToken, - this.typeAnnotation = typeAnnotation, - propertyName.parent = this, - questionToken && (questionToken.parent = this), - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class CallSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.typeAnnotation = typeAnnotation, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class ConstructSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public newKeyword: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public _typeMemberBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax) { - super(data); - this.newKeyword = newKeyword, - this.callSignature = callSignature, - newKeyword.parent = this, - callSignature.parent = this; - } - } - export class IndexSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public openBracketToken: ISyntaxToken; - public parameters: ParameterSyntax[]; - public closeBracketToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, openBracketToken: ISyntaxToken, parameters: ParameterSyntax[], closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.openBracketToken = openBracketToken, - this.parameters = parameters, - this.closeBracketToken = closeBracketToken, - this.typeAnnotation = typeAnnotation, - openBracketToken.parent = this, - !isShared(parameters) && (parameters.parent = this), - closeBracketToken.parent = this, - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class MethodSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public propertyName: ISyntaxToken; - public questionToken: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public _typeMemberBrand: any; - constructor(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax) { - super(data); - this.propertyName = propertyName, - this.questionToken = questionToken, - this.callSignature = callSignature, - propertyName.parent = this, - questionToken && (questionToken.parent = this), - callSignature.parent = this; - } - } - export class BlockSyntax extends SyntaxNode implements IStatementSyntax { - public openBraceToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.openBraceToken = openBraceToken, - this.statements = statements, - this.closeBraceToken = closeBraceToken, - openBraceToken.parent = this, - !isShared(statements) && (statements.parent = this), - closeBraceToken.parent = this; - } - } - export class IfStatementSyntax extends SyntaxNode implements IStatementSyntax { - public ifKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public elseClause: ElseClauseSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax) { - super(data); - this.ifKeyword = ifKeyword, - this.openParenToken = openParenToken, - this.condition = condition, - this.closeParenToken = closeParenToken, - this.statement = statement, - this.elseClause = elseClause, - ifKeyword.parent = this, - openParenToken.parent = this, - condition.parent = this, - closeParenToken.parent = this, - statement.parent = this, - elseClause && (elseClause.parent = this); - } - } - export class VariableStatementSyntax extends SyntaxNode implements IStatementSyntax { - public modifiers: ISyntaxToken[]; - public variableDeclaration: VariableDeclarationSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.variableDeclaration = variableDeclaration, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - variableDeclaration.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class ExpressionStatementSyntax extends SyntaxNode implements IStatementSyntax { - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.expression = expression, - this.semicolonToken = semicolonToken, - expression.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class ReturnStatementSyntax extends SyntaxNode implements IStatementSyntax { - public returnKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.returnKeyword = returnKeyword, - this.expression = expression, - this.semicolonToken = semicolonToken, - returnKeyword.parent = this, - expression && (expression.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class SwitchStatementSyntax extends SyntaxNode implements IStatementSyntax { - public switchKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public switchClauses: ISwitchClauseSyntax[]; - public closeBraceToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.switchKeyword = switchKeyword, - this.openParenToken = openParenToken, - this.expression = expression, - this.closeParenToken = closeParenToken, - this.openBraceToken = openBraceToken, - this.switchClauses = switchClauses, - this.closeBraceToken = closeBraceToken, - switchKeyword.parent = this, - openParenToken.parent = this, - expression.parent = this, - closeParenToken.parent = this, - openBraceToken.parent = this, - !isShared(switchClauses) && (switchClauses.parent = this), - closeBraceToken.parent = this; - } - } - export class BreakStatementSyntax extends SyntaxNode implements IStatementSyntax { - public breakKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.breakKeyword = breakKeyword, - this.identifier = identifier, - this.semicolonToken = semicolonToken, - breakKeyword.parent = this, - identifier && (identifier.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class ContinueStatementSyntax extends SyntaxNode implements IStatementSyntax { - public continueKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.continueKeyword = continueKeyword, - this.identifier = identifier, - this.semicolonToken = semicolonToken, - continueKeyword.parent = this, - identifier && (identifier.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class ForStatementSyntax extends SyntaxNode implements IStatementSyntax { - public forKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public variableDeclaration: VariableDeclarationSyntax; - public initializer: IExpressionSyntax; - public firstSemicolonToken: ISyntaxToken; - public condition: IExpressionSyntax; - public secondSemicolonToken: ISyntaxToken; - public incrementor: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.forKeyword = forKeyword, - this.openParenToken = openParenToken, - this.variableDeclaration = variableDeclaration, - this.initializer = initializer, - this.firstSemicolonToken = firstSemicolonToken, - this.condition = condition, - this.secondSemicolonToken = secondSemicolonToken, - this.incrementor = incrementor, - this.closeParenToken = closeParenToken, - this.statement = statement, - forKeyword.parent = this, - openParenToken.parent = this, - variableDeclaration && (variableDeclaration.parent = this), - initializer && (initializer.parent = this), - firstSemicolonToken.parent = this, - condition && (condition.parent = this), - secondSemicolonToken.parent = this, - incrementor && (incrementor.parent = this), - closeParenToken.parent = this, - statement.parent = this; - } - } - export class ForInStatementSyntax extends SyntaxNode implements IStatementSyntax { - public forKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public variableDeclaration: VariableDeclarationSyntax; - public left: IExpressionSyntax; - public inKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.forKeyword = forKeyword, - this.openParenToken = openParenToken, - this.variableDeclaration = variableDeclaration, - this.left = left, - this.inKeyword = inKeyword, - this.expression = expression, - this.closeParenToken = closeParenToken, - this.statement = statement, - forKeyword.parent = this, - openParenToken.parent = this, - variableDeclaration && (variableDeclaration.parent = this), - left && (left.parent = this), - inKeyword.parent = this, - expression.parent = this, - closeParenToken.parent = this, - statement.parent = this; - } - } - export class EmptyStatementSyntax extends SyntaxNode implements IStatementSyntax { - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, semicolonToken: ISyntaxToken) { - super(data); - this.semicolonToken = semicolonToken, - semicolonToken.parent = this; - } - } - export class ThrowStatementSyntax extends SyntaxNode implements IStatementSyntax { - public throwKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.throwKeyword = throwKeyword, - this.expression = expression, - this.semicolonToken = semicolonToken, - throwKeyword.parent = this, - expression.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class WhileStatementSyntax extends SyntaxNode implements IStatementSyntax { - public whileKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.whileKeyword = whileKeyword, - this.openParenToken = openParenToken, - this.condition = condition, - this.closeParenToken = closeParenToken, - this.statement = statement, - whileKeyword.parent = this, - openParenToken.parent = this, - condition.parent = this, - closeParenToken.parent = this, - statement.parent = this; - } - } - export class TryStatementSyntax extends SyntaxNode implements IStatementSyntax { - public tryKeyword: ISyntaxToken; - public block: BlockSyntax; - public catchClause: CatchClauseSyntax; - public finallyClause: FinallyClauseSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax) { - super(data); - this.tryKeyword = tryKeyword, - this.block = block, - this.catchClause = catchClause, - this.finallyClause = finallyClause, - tryKeyword.parent = this, - block.parent = this, - catchClause && (catchClause.parent = this), - finallyClause && (finallyClause.parent = this); - } - } - export class LabeledStatementSyntax extends SyntaxNode implements IStatementSyntax { - public identifier: ISyntaxToken; - public colonToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.identifier = identifier, - this.colonToken = colonToken, - this.statement = statement, - identifier.parent = this, - colonToken.parent = this, - statement.parent = this; - } - } - export class DoStatementSyntax extends SyntaxNode implements IStatementSyntax { - public doKeyword: ISyntaxToken; - public statement: IStatementSyntax; - public whileKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.doKeyword = doKeyword, - this.statement = statement, - this.whileKeyword = whileKeyword, - this.openParenToken = openParenToken, - this.condition = condition, - this.closeParenToken = closeParenToken, - this.semicolonToken = semicolonToken, - doKeyword.parent = this, - statement.parent = this, - whileKeyword.parent = this, - openParenToken.parent = this, - condition.parent = this, - closeParenToken.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class DebuggerStatementSyntax extends SyntaxNode implements IStatementSyntax { - public debuggerKeyword: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.debuggerKeyword = debuggerKeyword, - this.semicolonToken = semicolonToken, - debuggerKeyword.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class WithStatementSyntax extends SyntaxNode implements IStatementSyntax { - public withKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.withKeyword = withKeyword, - this.openParenToken = openParenToken, - this.condition = condition, - this.closeParenToken = closeParenToken, - this.statement = statement, - withKeyword.parent = this, - openParenToken.parent = this, - condition.parent = this, - closeParenToken.parent = this, - statement.parent = this; - } - } - export class PrefixUnaryExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public operatorToken: ISyntaxToken; - public operand: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax) { - super(data); - this.operatorToken = operatorToken, - this.operand = operand, - operatorToken.parent = this, - operand.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class DeleteExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public deleteKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.deleteKeyword = deleteKeyword, - this.expression = expression, - deleteKeyword.parent = this, - expression.parent = this; - } - } - export class TypeOfExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public typeOfKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.typeOfKeyword = typeOfKeyword, - this.expression = expression, - typeOfKeyword.parent = this, - expression.parent = this; - } - } - export class VoidExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public voidKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.voidKeyword = voidKeyword, - this.expression = expression, - voidKeyword.parent = this, - expression.parent = this; - } - } - export class ConditionalExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public condition: IExpressionSyntax; - public questionToken: ISyntaxToken; - public whenTrue: IExpressionSyntax; - public colonToken: ISyntaxToken; - public whenFalse: IExpressionSyntax; - public _expressionBrand: any; - constructor(data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax) { - super(data); - this.condition = condition, - this.questionToken = questionToken, - this.whenTrue = whenTrue, - this.colonToken = colonToken, - this.whenFalse = whenFalse, - condition.parent = this, - questionToken.parent = this, - whenTrue.parent = this, - colonToken.parent = this, - whenFalse.parent = this; - } - } - export class BinaryExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public left: IExpressionSyntax; - public operatorToken: ISyntaxToken; - public right: IExpressionSyntax; - public _expressionBrand: any; - constructor(data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax) { - super(data); - this.left = left, - this.operatorToken = operatorToken, - this.right = right, - left.parent = this, - operatorToken.parent = this, - right.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getBinaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class PostfixUnaryExpressionSyntax extends SyntaxNode implements IPostfixExpressionSyntax { - public operand: ILeftHandSideExpressionSyntax; - public operatorToken: ISyntaxToken; - public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken) { - super(data); - this.operand = operand, - this.operatorToken = operatorToken, - operand.parent = this, - operatorToken.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class MemberAccessExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax, ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public dotToken: ISyntaxToken; - public name: ISyntaxToken; - public _memberExpressionBrand: any; public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken) { - super(data); - this.expression = expression, - this.dotToken = dotToken, - this.name = name, - expression.parent = this, - dotToken.parent = this, - name.parent = this; - } - } - export class InvocationExpressionSyntax extends SyntaxNode implements ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public argumentList: ArgumentListSyntax; - public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax) { - super(data); - this.expression = expression, - this.argumentList = argumentList, - expression.parent = this, - argumentList.parent = this; - } - } - export class ArrayLiteralExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openBracketToken: ISyntaxToken; - public expressions: IExpressionSyntax[]; - public closeBracketToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openBracketToken: ISyntaxToken, expressions: IExpressionSyntax[], closeBracketToken: ISyntaxToken) { - super(data); - this.openBracketToken = openBracketToken, - this.expressions = expressions, - this.closeBracketToken = closeBracketToken, - openBracketToken.parent = this, - !isShared(expressions) && (expressions.parent = this), - closeBracketToken.parent = this; - } - } - export class ObjectLiteralExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openBraceToken: ISyntaxToken; - public propertyAssignments: IPropertyAssignmentSyntax[]; - public closeBraceToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, propertyAssignments: IPropertyAssignmentSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.openBraceToken = openBraceToken, - this.propertyAssignments = propertyAssignments, - this.closeBraceToken = closeBraceToken, - openBraceToken.parent = this, - !isShared(propertyAssignments) && (propertyAssignments.parent = this), - closeBraceToken.parent = this; - } - } - export class ObjectCreationExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public newKeyword: ISyntaxToken; - public expression: IMemberExpressionSyntax; - public argumentList: ArgumentListSyntax; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax) { - super(data); - this.newKeyword = newKeyword, - this.expression = expression, - this.argumentList = argumentList, - newKeyword.parent = this, - expression.parent = this, - argumentList && (argumentList.parent = this); - } - } - export class ParenthesizedExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openParenToken: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken) { - super(data); - this.openParenToken = openParenToken, - this.expression = expression, - this.closeParenToken = closeParenToken, - openParenToken.parent = this, - expression.parent = this, - closeParenToken.parent = this; - } - } - export class ParenthesizedArrowFunctionExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public callSignature: CallSignatureSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public block: BlockSyntax; - public expression: IExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax) { - super(data); - this.callSignature = callSignature, - this.equalsGreaterThanToken = equalsGreaterThanToken, - this.block = block, - this.expression = expression, - callSignature.parent = this, - equalsGreaterThanToken.parent = this, - block && (block.parent = this), - expression && (expression.parent = this); - } - } - export class SimpleArrowFunctionExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public parameter: ParameterSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public block: BlockSyntax; - public expression: IExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax) { - super(data); - this.parameter = parameter, - this.equalsGreaterThanToken = equalsGreaterThanToken, - this.block = block, - this.expression = expression, - parameter.parent = this, - equalsGreaterThanToken.parent = this, - block && (block.parent = this), - expression && (expression.parent = this); - } - } - export class CastExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public lessThanToken: ISyntaxToken; - public type: ITypeSyntax; - public greaterThanToken: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.lessThanToken = lessThanToken, - this.type = type, - this.greaterThanToken = greaterThanToken, - this.expression = expression, - lessThanToken.parent = this, - type.parent = this, - greaterThanToken.parent = this, - expression.parent = this; - } - } - export class ElementAccessExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax, ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public openBracketToken: ISyntaxToken; - public argumentExpression: IExpressionSyntax; - public closeBracketToken: ISyntaxToken; - public _memberExpressionBrand: any; public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { - super(data); - this.expression = expression, - this.openBracketToken = openBracketToken, - this.argumentExpression = argumentExpression, - this.closeBracketToken = closeBracketToken, - expression.parent = this, - openBracketToken.parent = this, - argumentExpression.parent = this, - closeBracketToken.parent = this; - } - } - export class FunctionExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public functionKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.functionKeyword = functionKeyword, - this.identifier = identifier, - this.callSignature = callSignature, - this.block = block, - functionKeyword.parent = this, - identifier && (identifier.parent = this), - callSignature.parent = this, - block.parent = this; - } - } - export class OmittedExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public _expressionBrand: any; - constructor(data: number) { - super(data); - } - } - export class VariableDeclarationSyntax extends SyntaxNode { - public varKeyword: ISyntaxToken; - public variableDeclarators: VariableDeclaratorSyntax[]; - constructor(data: number, varKeyword: ISyntaxToken, variableDeclarators: VariableDeclaratorSyntax[]) { - super(data); - this.varKeyword = varKeyword, - this.variableDeclarators = variableDeclarators, - varKeyword.parent = this, - !isShared(variableDeclarators) && (variableDeclarators.parent = this); - } - } - export class VariableDeclaratorSyntax extends SyntaxNode { - public propertyName: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.propertyName = propertyName, - this.typeAnnotation = typeAnnotation, - this.equalsValueClause = equalsValueClause, - propertyName.parent = this, - typeAnnotation && (typeAnnotation.parent = this), - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class ArgumentListSyntax extends SyntaxNode { - public typeArgumentList: TypeArgumentListSyntax; - public openParenToken: ISyntaxToken; - public arguments: IExpressionSyntax[]; - public closeParenToken: ISyntaxToken; - constructor(data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: IExpressionSyntax[], closeParenToken: ISyntaxToken) { - super(data); - this.typeArgumentList = typeArgumentList, - this.openParenToken = openParenToken, - this.arguments = _arguments, - this.closeParenToken = closeParenToken, - typeArgumentList && (typeArgumentList.parent = this), - openParenToken.parent = this, - !isShared(_arguments) && (_arguments.parent = this), - closeParenToken.parent = this; - } - } - export class ParameterListSyntax extends SyntaxNode { - public openParenToken: ISyntaxToken; - public parameters: ParameterSyntax[]; - public closeParenToken: ISyntaxToken; - constructor(data: number, openParenToken: ISyntaxToken, parameters: ParameterSyntax[], closeParenToken: ISyntaxToken) { - super(data); - this.openParenToken = openParenToken, - this.parameters = parameters, - this.closeParenToken = closeParenToken, - openParenToken.parent = this, - !isShared(parameters) && (parameters.parent = this), - closeParenToken.parent = this; - } - } - export class TypeArgumentListSyntax extends SyntaxNode { - public lessThanToken: ISyntaxToken; - public typeArguments: ITypeSyntax[]; - public greaterThanToken: ISyntaxToken; - constructor(data: number, lessThanToken: ISyntaxToken, typeArguments: ITypeSyntax[], greaterThanToken: ISyntaxToken) { - super(data); - this.lessThanToken = lessThanToken, - this.typeArguments = typeArguments, - this.greaterThanToken = greaterThanToken, - lessThanToken.parent = this, - !isShared(typeArguments) && (typeArguments.parent = this), - greaterThanToken.parent = this; - } - } - export class TypeParameterListSyntax extends SyntaxNode { - public lessThanToken: ISyntaxToken; - public typeParameters: TypeParameterSyntax[]; - public greaterThanToken: ISyntaxToken; - constructor(data: number, lessThanToken: ISyntaxToken, typeParameters: TypeParameterSyntax[], greaterThanToken: ISyntaxToken) { - super(data); - this.lessThanToken = lessThanToken, - this.typeParameters = typeParameters, - this.greaterThanToken = greaterThanToken, - lessThanToken.parent = this, - !isShared(typeParameters) && (typeParameters.parent = this), - greaterThanToken.parent = this; - } - } - export class HeritageClauseSyntax extends SyntaxNode { - public extendsOrImplementsKeyword: ISyntaxToken; - public typeNames: INameSyntax[]; - constructor(data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: INameSyntax[]) { - super(data); - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, - this.typeNames = typeNames, - extendsOrImplementsKeyword.parent = this, - !isShared(typeNames) && (typeNames.parent = this); - } - public kind(): SyntaxKind { return this.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword ? SyntaxKind.ExtendsHeritageClause : SyntaxKind.ImplementsHeritageClause; } - } - export class EqualsValueClauseSyntax extends SyntaxNode { - public equalsToken: ISyntaxToken; - public value: IExpressionSyntax; - constructor(data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax) { - super(data); - this.equalsToken = equalsToken, - this.value = value, - equalsToken.parent = this, - value.parent = this; - } - } - export class CaseSwitchClauseSyntax extends SyntaxNode implements ISwitchClauseSyntax { - public caseKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public colonToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public _switchClauseBrand: any; - constructor(data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { - super(data); - this.caseKeyword = caseKeyword, - this.expression = expression, - this.colonToken = colonToken, - this.statements = statements, - caseKeyword.parent = this, - expression.parent = this, - colonToken.parent = this, - !isShared(statements) && (statements.parent = this); - } - } - export class DefaultSwitchClauseSyntax extends SyntaxNode implements ISwitchClauseSyntax { - public defaultKeyword: ISyntaxToken; - public colonToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public _switchClauseBrand: any; - constructor(data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { - super(data); - this.defaultKeyword = defaultKeyword, - this.colonToken = colonToken, - this.statements = statements, - defaultKeyword.parent = this, - colonToken.parent = this, - !isShared(statements) && (statements.parent = this); - } - } - export class ElseClauseSyntax extends SyntaxNode { - public elseKeyword: ISyntaxToken; - public statement: IStatementSyntax; - constructor(data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.elseKeyword = elseKeyword, - this.statement = statement, - elseKeyword.parent = this, - statement.parent = this; - } - } - export class CatchClauseSyntax extends SyntaxNode { - public catchKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public identifier: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public closeParenToken: ISyntaxToken; - public block: BlockSyntax; - constructor(data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax) { - super(data); - this.catchKeyword = catchKeyword, - this.openParenToken = openParenToken, - this.identifier = identifier, - this.typeAnnotation = typeAnnotation, - this.closeParenToken = closeParenToken, - this.block = block, - catchKeyword.parent = this, - openParenToken.parent = this, - identifier.parent = this, - typeAnnotation && (typeAnnotation.parent = this), - closeParenToken.parent = this, - block.parent = this; - } - } - export class FinallyClauseSyntax extends SyntaxNode { - public finallyKeyword: ISyntaxToken; - public block: BlockSyntax; - constructor(data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax) { - super(data); - this.finallyKeyword = finallyKeyword, - this.block = block, - finallyKeyword.parent = this, - block.parent = this; - } - } - export class TypeParameterSyntax extends SyntaxNode { - public identifier: ISyntaxToken; - public constraint: ConstraintSyntax; - constructor(data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax) { - super(data); - this.identifier = identifier, - this.constraint = constraint, - identifier.parent = this, - constraint && (constraint.parent = this); - } - } - export class ConstraintSyntax extends SyntaxNode { - public extendsKeyword: ISyntaxToken; - public typeOrExpression: ISyntaxNodeOrToken; - constructor(data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken) { - super(data); - this.extendsKeyword = extendsKeyword, - this.typeOrExpression = typeOrExpression, - extendsKeyword.parent = this, - typeOrExpression.parent = this; - } - } - export class SimplePropertyAssignmentSyntax extends SyntaxNode implements IPropertyAssignmentSyntax { - public propertyName: ISyntaxToken; - public colonToken: ISyntaxToken; - public expression: IExpressionSyntax; - public _propertyAssignmentBrand: any; - constructor(data: number, propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax) { - super(data); - this.propertyName = propertyName, - this.colonToken = colonToken, - this.expression = expression, - propertyName.parent = this, - colonToken.parent = this, - expression.parent = this; - } - } - export class FunctionPropertyAssignmentSyntax extends SyntaxNode implements IPropertyAssignmentSyntax { - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _propertyAssignmentBrand: any; - constructor(data: number, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class ParameterSyntax extends SyntaxNode { - public dotDotDotToken: ISyntaxToken; - public modifiers: ISyntaxToken[]; - public identifier: ISyntaxToken; - public questionToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.dotDotDotToken = dotDotDotToken, - this.modifiers = modifiers, - this.identifier = identifier, - this.questionToken = questionToken, - this.typeAnnotation = typeAnnotation, - this.equalsValueClause = equalsValueClause, - dotDotDotToken && (dotDotDotToken.parent = this), - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - questionToken && (questionToken.parent = this), - typeAnnotation && (typeAnnotation.parent = this), - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class EnumElementSyntax extends SyntaxNode { - public propertyName: ISyntaxToken; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.propertyName = propertyName, - this.equalsValueClause = equalsValueClause, - propertyName.parent = this, - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class TypeAnnotationSyntax extends SyntaxNode { - public colonToken: ISyntaxToken; - public type: ITypeSyntax; - constructor(data: number, colonToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.colonToken = colonToken, - this.type = type, - colonToken.parent = this, - type.parent = this; - } - } - export class ExternalModuleReferenceSyntax extends SyntaxNode implements IModuleReferenceSyntax { - public requireKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public stringLiteral: ISyntaxToken; - public closeParenToken: ISyntaxToken; - public _moduleReferenceBrand: any; - constructor(data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken) { - super(data); - this.requireKeyword = requireKeyword, - this.openParenToken = openParenToken, - this.stringLiteral = stringLiteral, - this.closeParenToken = closeParenToken, - requireKeyword.parent = this, - openParenToken.parent = this, - stringLiteral.parent = this, - closeParenToken.parent = this; - } - } - export class ModuleNameModuleReferenceSyntax extends SyntaxNode implements IModuleReferenceSyntax { - public moduleName: INameSyntax; - public _moduleReferenceBrand: any; - constructor(data: number, moduleName: INameSyntax) { - super(data); - this.moduleName = moduleName, - moduleName.parent = this; +module TypeScript { + export var SourceUnitSyntax: SourceUnitConstructor = function(data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.moduleElements = moduleElements, + this.endOfFileToken = endOfFileToken, + moduleElements.parent = this, + endOfFileToken.parent = this; + }; + SourceUnitSyntax.prototype.kind = SyntaxKind.SourceUnit; + SourceUnitSyntax.prototype.childCount = 2; + SourceUnitSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.moduleElements; + case 1: return this.endOfFileToken; } } - (SourceUnitSyntax).prototype.__kind = SyntaxKind.SourceUnit, (QualifiedNameSyntax).prototype.__kind = SyntaxKind.QualifiedName, (ObjectTypeSyntax).prototype.__kind = SyntaxKind.ObjectType, (FunctionTypeSyntax).prototype.__kind = SyntaxKind.FunctionType, (ArrayTypeSyntax).prototype.__kind = SyntaxKind.ArrayType, (ConstructorTypeSyntax).prototype.__kind = SyntaxKind.ConstructorType, (GenericTypeSyntax).prototype.__kind = SyntaxKind.GenericType, (TypeQuerySyntax).prototype.__kind = SyntaxKind.TypeQuery, (InterfaceDeclarationSyntax).prototype.__kind = SyntaxKind.InterfaceDeclaration, (FunctionDeclarationSyntax).prototype.__kind = SyntaxKind.FunctionDeclaration, (ModuleDeclarationSyntax).prototype.__kind = SyntaxKind.ModuleDeclaration, (ClassDeclarationSyntax).prototype.__kind = SyntaxKind.ClassDeclaration, (EnumDeclarationSyntax).prototype.__kind = SyntaxKind.EnumDeclaration, (ImportDeclarationSyntax).prototype.__kind = SyntaxKind.ImportDeclaration, (ExportAssignmentSyntax).prototype.__kind = SyntaxKind.ExportAssignment, (MemberFunctionDeclarationSyntax).prototype.__kind = SyntaxKind.MemberFunctionDeclaration, (MemberVariableDeclarationSyntax).prototype.__kind = SyntaxKind.MemberVariableDeclaration, (ConstructorDeclarationSyntax).prototype.__kind = SyntaxKind.ConstructorDeclaration, (IndexMemberDeclarationSyntax).prototype.__kind = SyntaxKind.IndexMemberDeclaration, (GetAccessorSyntax).prototype.__kind = SyntaxKind.GetAccessor, (SetAccessorSyntax).prototype.__kind = SyntaxKind.SetAccessor, (PropertySignatureSyntax).prototype.__kind = SyntaxKind.PropertySignature, (CallSignatureSyntax).prototype.__kind = SyntaxKind.CallSignature, (ConstructSignatureSyntax).prototype.__kind = SyntaxKind.ConstructSignature, (IndexSignatureSyntax).prototype.__kind = SyntaxKind.IndexSignature, (MethodSignatureSyntax).prototype.__kind = SyntaxKind.MethodSignature, (BlockSyntax).prototype.__kind = SyntaxKind.Block, (IfStatementSyntax).prototype.__kind = SyntaxKind.IfStatement, (VariableStatementSyntax).prototype.__kind = SyntaxKind.VariableStatement, (ExpressionStatementSyntax).prototype.__kind = SyntaxKind.ExpressionStatement, (ReturnStatementSyntax).prototype.__kind = SyntaxKind.ReturnStatement, (SwitchStatementSyntax).prototype.__kind = SyntaxKind.SwitchStatement, (BreakStatementSyntax).prototype.__kind = SyntaxKind.BreakStatement, (ContinueStatementSyntax).prototype.__kind = SyntaxKind.ContinueStatement, (ForStatementSyntax).prototype.__kind = SyntaxKind.ForStatement, (ForInStatementSyntax).prototype.__kind = SyntaxKind.ForInStatement, (EmptyStatementSyntax).prototype.__kind = SyntaxKind.EmptyStatement, (ThrowStatementSyntax).prototype.__kind = SyntaxKind.ThrowStatement, (WhileStatementSyntax).prototype.__kind = SyntaxKind.WhileStatement, (TryStatementSyntax).prototype.__kind = SyntaxKind.TryStatement, (LabeledStatementSyntax).prototype.__kind = SyntaxKind.LabeledStatement, (DoStatementSyntax).prototype.__kind = SyntaxKind.DoStatement, (DebuggerStatementSyntax).prototype.__kind = SyntaxKind.DebuggerStatement, (WithStatementSyntax).prototype.__kind = SyntaxKind.WithStatement, (DeleteExpressionSyntax).prototype.__kind = SyntaxKind.DeleteExpression, (TypeOfExpressionSyntax).prototype.__kind = SyntaxKind.TypeOfExpression, (VoidExpressionSyntax).prototype.__kind = SyntaxKind.VoidExpression, (ConditionalExpressionSyntax).prototype.__kind = SyntaxKind.ConditionalExpression, (MemberAccessExpressionSyntax).prototype.__kind = SyntaxKind.MemberAccessExpression, (InvocationExpressionSyntax).prototype.__kind = SyntaxKind.InvocationExpression, (ArrayLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ArrayLiteralExpression, (ObjectLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ObjectLiteralExpression, (ObjectCreationExpressionSyntax).prototype.__kind = SyntaxKind.ObjectCreationExpression, (ParenthesizedExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedExpression, (ParenthesizedArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedArrowFunctionExpression, (SimpleArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.SimpleArrowFunctionExpression, (CastExpressionSyntax).prototype.__kind = SyntaxKind.CastExpression, (ElementAccessExpressionSyntax).prototype.__kind = SyntaxKind.ElementAccessExpression, (FunctionExpressionSyntax).prototype.__kind = SyntaxKind.FunctionExpression, (OmittedExpressionSyntax).prototype.__kind = SyntaxKind.OmittedExpression, (VariableDeclarationSyntax).prototype.__kind = SyntaxKind.VariableDeclaration, (VariableDeclaratorSyntax).prototype.__kind = SyntaxKind.VariableDeclarator, (ArgumentListSyntax).prototype.__kind = SyntaxKind.ArgumentList, (ParameterListSyntax).prototype.__kind = SyntaxKind.ParameterList, (TypeArgumentListSyntax).prototype.__kind = SyntaxKind.TypeArgumentList, (TypeParameterListSyntax).prototype.__kind = SyntaxKind.TypeParameterList, (EqualsValueClauseSyntax).prototype.__kind = SyntaxKind.EqualsValueClause, (CaseSwitchClauseSyntax).prototype.__kind = SyntaxKind.CaseSwitchClause, (DefaultSwitchClauseSyntax).prototype.__kind = SyntaxKind.DefaultSwitchClause, (ElseClauseSyntax).prototype.__kind = SyntaxKind.ElseClause, (CatchClauseSyntax).prototype.__kind = SyntaxKind.CatchClause, (FinallyClauseSyntax).prototype.__kind = SyntaxKind.FinallyClause, (TypeParameterSyntax).prototype.__kind = SyntaxKind.TypeParameter, (ConstraintSyntax).prototype.__kind = SyntaxKind.Constraint, (SimplePropertyAssignmentSyntax).prototype.__kind = SyntaxKind.SimplePropertyAssignment, (FunctionPropertyAssignmentSyntax).prototype.__kind = SyntaxKind.FunctionPropertyAssignment, (ParameterSyntax).prototype.__kind = SyntaxKind.Parameter, (EnumElementSyntax).prototype.__kind = SyntaxKind.EnumElement, (TypeAnnotationSyntax).prototype.__kind = SyntaxKind.TypeAnnotation, (ExternalModuleReferenceSyntax).prototype.__kind = SyntaxKind.ExternalModuleReference, (ModuleNameModuleReferenceSyntax).prototype.__kind = SyntaxKind.ModuleNameModuleReference; + export var QualifiedNameSyntax: QualifiedNameConstructor = function(data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken) { + if (data) { this.__data = data; } + this.left = left, + this.dotToken = dotToken, + this.right = right, + left.parent = this, + dotToken.parent = this, + right.parent = this; + }; + QualifiedNameSyntax.prototype.kind = SyntaxKind.QualifiedName; + QualifiedNameSyntax.prototype.childCount = 3; + QualifiedNameSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.left; + case 1: return this.dotToken; + case 2: return this.right; + } + } + + export var ObjectTypeSyntax: ObjectTypeConstructor = function(data: number, openBraceToken: ISyntaxToken, typeMembers: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBraceToken = openBraceToken, + this.typeMembers = typeMembers, + this.closeBraceToken = closeBraceToken, + openBraceToken.parent = this, + typeMembers.parent = this, + closeBraceToken.parent = this; + }; + ObjectTypeSyntax.prototype.kind = SyntaxKind.ObjectType; + ObjectTypeSyntax.prototype.childCount = 3; + ObjectTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBraceToken; + case 1: return this.typeMembers; + case 2: return this.closeBraceToken; + } + } + + export var FunctionTypeSyntax: FunctionTypeConstructor = function(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { + if (data) { this.__data = data; } + this.typeParameterList = typeParameterList, + this.parameterList = parameterList, + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.type = type, + typeParameterList && (typeParameterList.parent = this), + parameterList.parent = this, + equalsGreaterThanToken.parent = this, + type.parent = this; + }; + FunctionTypeSyntax.prototype.kind = SyntaxKind.FunctionType; + FunctionTypeSyntax.prototype.childCount = 4; + FunctionTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeParameterList; + case 1: return this.parameterList; + case 2: return this.equalsGreaterThanToken; + case 3: return this.type; + } + } + + export var ArrayTypeSyntax: ArrayTypeConstructor = function(data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.type = type, + this.openBracketToken = openBracketToken, + this.closeBracketToken = closeBracketToken, + type.parent = this, + openBracketToken.parent = this, + closeBracketToken.parent = this; + }; + ArrayTypeSyntax.prototype.kind = SyntaxKind.ArrayType; + ArrayTypeSyntax.prototype.childCount = 3; + ArrayTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.type; + case 1: return this.openBracketToken; + case 2: return this.closeBracketToken; + } + } + + export var ConstructorTypeSyntax: ConstructorTypeConstructor = function(data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { + if (data) { this.__data = data; } + this.newKeyword = newKeyword, + this.typeParameterList = typeParameterList, + this.parameterList = parameterList, + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.type = type, + newKeyword.parent = this, + typeParameterList && (typeParameterList.parent = this), + parameterList.parent = this, + equalsGreaterThanToken.parent = this, + type.parent = this; + }; + ConstructorTypeSyntax.prototype.kind = SyntaxKind.ConstructorType; + ConstructorTypeSyntax.prototype.childCount = 5; + ConstructorTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.newKeyword; + case 1: return this.typeParameterList; + case 2: return this.parameterList; + case 3: return this.equalsGreaterThanToken; + case 4: return this.type; + } + } + + export var GenericTypeSyntax: GenericTypeConstructor = function(data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax) { + if (data) { this.__data = data; } + this.name = name, + this.typeArgumentList = typeArgumentList, + name.parent = this, + typeArgumentList.parent = this; + }; + GenericTypeSyntax.prototype.kind = SyntaxKind.GenericType; + GenericTypeSyntax.prototype.childCount = 2; + GenericTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.name; + case 1: return this.typeArgumentList; + } + } + + export var TypeQuerySyntax: TypeQueryConstructor = function(data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax) { + if (data) { this.__data = data; } + this.typeOfKeyword = typeOfKeyword, + this.name = name, + typeOfKeyword.parent = this, + name.parent = this; + }; + TypeQuerySyntax.prototype.kind = SyntaxKind.TypeQuery; + TypeQuerySyntax.prototype.childCount = 2; + TypeQuerySyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeOfKeyword; + case 1: return this.name; + } + } + + export var TupleTypeSyntax: TupleTypeConstructor = function(data: number, openBracketToken: ISyntaxToken, types: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBracketToken = openBracketToken, + this.types = types, + this.closeBracketToken = closeBracketToken, + openBracketToken.parent = this, + types.parent = this, + closeBracketToken.parent = this; + }; + TupleTypeSyntax.prototype.kind = SyntaxKind.TupleType; + TupleTypeSyntax.prototype.childCount = 3; + TupleTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.types; + case 2: return this.closeBracketToken; + } + } + + export var UnionTypeSyntax: UnionTypeConstructor = function(data: number, left: ITypeSyntax, barToken: ISyntaxToken, right: ITypeSyntax) { + if (data) { this.__data = data; } + this.left = left, + this.barToken = barToken, + this.right = right, + left.parent = this, + barToken.parent = this, + right.parent = this; + }; + UnionTypeSyntax.prototype.kind = SyntaxKind.UnionType; + UnionTypeSyntax.prototype.childCount = 3; + UnionTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.left; + case 1: return this.barToken; + case 2: return this.right; + } + } + + export var ParenthesizedTypeSyntax: ParenthesizedTypeConstructor = function(data: number, openParenToken: ISyntaxToken, type: ITypeSyntax, closeParenToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openParenToken = openParenToken, + this.type = type, + this.closeParenToken = closeParenToken, + openParenToken.parent = this, + type.parent = this, + closeParenToken.parent = this; + }; + ParenthesizedTypeSyntax.prototype.kind = SyntaxKind.ParenthesizedType; + ParenthesizedTypeSyntax.prototype.childCount = 3; + ParenthesizedTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openParenToken; + case 1: return this.type; + case 2: return this.closeParenToken; + } + } + + export var InterfaceDeclarationSyntax: InterfaceDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.interfaceKeyword = interfaceKeyword, + this.identifier = identifier, + this.typeParameterList = typeParameterList, + this.heritageClauses = heritageClauses, + this.body = body, + modifiers.parent = this, + interfaceKeyword.parent = this, + identifier.parent = this, + typeParameterList && (typeParameterList.parent = this), + heritageClauses.parent = this, + body.parent = this; + }; + InterfaceDeclarationSyntax.prototype.kind = SyntaxKind.InterfaceDeclaration; + InterfaceDeclarationSyntax.prototype.childCount = 6; + InterfaceDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.interfaceKeyword; + case 2: return this.identifier; + case 3: return this.typeParameterList; + case 4: return this.heritageClauses; + case 5: return this.body; + } + } + + export var FunctionDeclarationSyntax: FunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.functionKeyword = functionKeyword, + this.asterixToken = asterixToken, + this.identifier = identifier, + this.callSignature = callSignature, + this.body = body, + modifiers.parent = this, + functionKeyword.parent = this, + asterixToken && (asterixToken.parent = this), + identifier.parent = this, + callSignature.parent = this, + body && (body.parent = this); + }; + FunctionDeclarationSyntax.prototype.kind = SyntaxKind.FunctionDeclaration; + FunctionDeclarationSyntax.prototype.childCount = 6; + FunctionDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.functionKeyword; + case 2: return this.asterixToken; + case 3: return this.identifier; + case 4: return this.callSignature; + case 5: return this.body; + } + } + + export var ModuleDeclarationSyntax: ModuleDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.moduleKeyword = moduleKeyword, + this.name = name, + this.openBraceToken = openBraceToken, + this.moduleElements = moduleElements, + this.closeBraceToken = closeBraceToken, + modifiers.parent = this, + moduleKeyword.parent = this, + name.parent = this, + openBraceToken.parent = this, + moduleElements.parent = this, + closeBraceToken.parent = this; + }; + ModuleDeclarationSyntax.prototype.kind = SyntaxKind.ModuleDeclaration; + ModuleDeclarationSyntax.prototype.childCount = 6; + ModuleDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.moduleKeyword; + case 2: return this.name; + case 3: return this.openBraceToken; + case 4: return this.moduleElements; + case 5: return this.closeBraceToken; + } + } + + export var ClassDeclarationSyntax: ClassDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.classKeyword = classKeyword, + this.identifier = identifier, + this.typeParameterList = typeParameterList, + this.heritageClauses = heritageClauses, + this.openBraceToken = openBraceToken, + this.classElements = classElements, + this.closeBraceToken = closeBraceToken, + modifiers.parent = this, + classKeyword.parent = this, + identifier.parent = this, + typeParameterList && (typeParameterList.parent = this), + heritageClauses.parent = this, + openBraceToken.parent = this, + classElements.parent = this, + closeBraceToken.parent = this; + }; + ClassDeclarationSyntax.prototype.kind = SyntaxKind.ClassDeclaration; + ClassDeclarationSyntax.prototype.childCount = 8; + ClassDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.classKeyword; + case 2: return this.identifier; + case 3: return this.typeParameterList; + case 4: return this.heritageClauses; + case 5: return this.openBraceToken; + case 6: return this.classElements; + case 7: return this.closeBraceToken; + } + } + + export var EnumDeclarationSyntax: EnumDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.enumKeyword = enumKeyword, + this.identifier = identifier, + this.openBraceToken = openBraceToken, + this.enumElements = enumElements, + this.closeBraceToken = closeBraceToken, + modifiers.parent = this, + enumKeyword.parent = this, + identifier.parent = this, + openBraceToken.parent = this, + enumElements.parent = this, + closeBraceToken.parent = this; + }; + EnumDeclarationSyntax.prototype.kind = SyntaxKind.EnumDeclaration; + EnumDeclarationSyntax.prototype.childCount = 6; + EnumDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.enumKeyword; + case 2: return this.identifier; + case 3: return this.openBraceToken; + case 4: return this.enumElements; + case 5: return this.closeBraceToken; + } + } + + export var ImportDeclarationSyntax: ImportDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.importKeyword = importKeyword, + this.identifier = identifier, + this.equalsToken = equalsToken, + this.moduleReference = moduleReference, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + importKeyword.parent = this, + identifier.parent = this, + equalsToken.parent = this, + moduleReference.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + ImportDeclarationSyntax.prototype.kind = SyntaxKind.ImportDeclaration; + ImportDeclarationSyntax.prototype.childCount = 6; + ImportDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.importKeyword; + case 2: return this.identifier; + case 3: return this.equalsToken; + case 4: return this.moduleReference; + case 5: return this.semicolonToken; + } + } + + export var ExportAssignmentSyntax: ExportAssignmentConstructor = function(data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.exportKeyword = exportKeyword, + this.equalsToken = equalsToken, + this.identifier = identifier, + this.semicolonToken = semicolonToken, + exportKeyword.parent = this, + equalsToken.parent = this, + identifier.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + ExportAssignmentSyntax.prototype.kind = SyntaxKind.ExportAssignment; + ExportAssignmentSyntax.prototype.childCount = 4; + ExportAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.exportKeyword; + case 1: return this.equalsToken; + case 2: return this.identifier; + case 3: return this.semicolonToken; + } + } + + export var MemberFunctionDeclarationSyntax: MemberFunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.asterixToken = asterixToken, + this.propertyName = propertyName, + this.callSignature = callSignature, + this.body = body, + modifiers.parent = this, + asterixToken && (asterixToken.parent = this), + propertyName.parent = this, + callSignature.parent = this, + body && (body.parent = this); + }; + MemberFunctionDeclarationSyntax.prototype.kind = SyntaxKind.MemberFunctionDeclaration; + MemberFunctionDeclarationSyntax.prototype.childCount = 5; + MemberFunctionDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.asterixToken; + case 2: return this.propertyName; + case 3: return this.callSignature; + case 4: return this.body; + } + } + + export var MemberVariableDeclarationSyntax: MemberVariableDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.variableDeclarator = variableDeclarator, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + variableDeclarator.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + MemberVariableDeclarationSyntax.prototype.kind = SyntaxKind.MemberVariableDeclaration; + MemberVariableDeclarationSyntax.prototype.childCount = 3; + MemberVariableDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.variableDeclarator; + case 2: return this.semicolonToken; + } + } + + export var ConstructorDeclarationSyntax: ConstructorDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.constructorKeyword = constructorKeyword, + this.callSignature = callSignature, + this.body = body, + modifiers.parent = this, + constructorKeyword.parent = this, + callSignature.parent = this, + body && (body.parent = this); + }; + ConstructorDeclarationSyntax.prototype.kind = SyntaxKind.ConstructorDeclaration; + ConstructorDeclarationSyntax.prototype.childCount = 4; + ConstructorDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.constructorKeyword; + case 2: return this.callSignature; + case 3: return this.body; + } + } + + export var IndexMemberDeclarationSyntax: IndexMemberDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.indexSignature = indexSignature, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + indexSignature.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + IndexMemberDeclarationSyntax.prototype.kind = SyntaxKind.IndexMemberDeclaration; + IndexMemberDeclarationSyntax.prototype.childCount = 3; + IndexMemberDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.indexSignature; + case 2: return this.semicolonToken; + } + } + + export var GetAccessorSyntax: GetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.getKeyword = getKeyword, + this.propertyName = propertyName, + this.callSignature = callSignature, + this.body = body, + modifiers.parent = this, + getKeyword.parent = this, + propertyName.parent = this, + callSignature.parent = this, + body && (body.parent = this); + }; + GetAccessorSyntax.prototype.kind = SyntaxKind.GetAccessor; + GetAccessorSyntax.prototype.childCount = 5; + GetAccessorSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.getKeyword; + case 2: return this.propertyName; + case 3: return this.callSignature; + case 4: return this.body; + } + } + + export var SetAccessorSyntax: SetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.setKeyword = setKeyword, + this.propertyName = propertyName, + this.callSignature = callSignature, + this.body = body, + modifiers.parent = this, + setKeyword.parent = this, + propertyName.parent = this, + callSignature.parent = this, + body && (body.parent = this); + }; + SetAccessorSyntax.prototype.kind = SyntaxKind.SetAccessor; + SetAccessorSyntax.prototype.childCount = 5; + SetAccessorSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.setKeyword; + case 2: return this.propertyName; + case 3: return this.callSignature; + case 4: return this.body; + } + } + + export var PropertySignatureSyntax: PropertySignatureConstructor = function(data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { + if (data) { this.__data = data; } + this.propertyName = propertyName, + this.questionToken = questionToken, + this.typeAnnotation = typeAnnotation, + propertyName.parent = this, + questionToken && (questionToken.parent = this), + typeAnnotation && (typeAnnotation.parent = this); + }; + PropertySignatureSyntax.prototype.kind = SyntaxKind.PropertySignature; + PropertySignatureSyntax.prototype.childCount = 3; + PropertySignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.questionToken; + case 2: return this.typeAnnotation; + } + } + + export var CallSignatureSyntax: CallSignatureConstructor = function(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax) { + if (data) { this.__data = data; } + this.typeParameterList = typeParameterList, + this.parameterList = parameterList, + this.typeAnnotation = typeAnnotation, + typeParameterList && (typeParameterList.parent = this), + parameterList.parent = this, + typeAnnotation && (typeAnnotation.parent = this); + }; + CallSignatureSyntax.prototype.kind = SyntaxKind.CallSignature; + CallSignatureSyntax.prototype.childCount = 3; + CallSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeParameterList; + case 1: return this.parameterList; + case 2: return this.typeAnnotation; + } + } + + export var ConstructSignatureSyntax: ConstructSignatureConstructor = function(data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax) { + if (data) { this.__data = data; } + this.newKeyword = newKeyword, + this.callSignature = callSignature, + newKeyword.parent = this, + callSignature.parent = this; + }; + ConstructSignatureSyntax.prototype.kind = SyntaxKind.ConstructSignature; + ConstructSignatureSyntax.prototype.childCount = 2; + ConstructSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.newKeyword; + case 1: return this.callSignature; + } + } + + export var IndexSignatureSyntax: IndexSignatureConstructor = function(data: number, openBracketToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { + if (data) { this.__data = data; } + this.openBracketToken = openBracketToken, + this.parameters = parameters, + this.closeBracketToken = closeBracketToken, + this.typeAnnotation = typeAnnotation, + openBracketToken.parent = this, + parameters.parent = this, + closeBracketToken.parent = this, + typeAnnotation && (typeAnnotation.parent = this); + }; + IndexSignatureSyntax.prototype.kind = SyntaxKind.IndexSignature; + IndexSignatureSyntax.prototype.childCount = 4; + IndexSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.parameters; + case 2: return this.closeBracketToken; + case 3: return this.typeAnnotation; + } + } + + export var MethodSignatureSyntax: MethodSignatureConstructor = function(data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax) { + if (data) { this.__data = data; } + this.propertyName = propertyName, + this.questionToken = questionToken, + this.callSignature = callSignature, + propertyName.parent = this, + questionToken && (questionToken.parent = this), + callSignature.parent = this; + }; + MethodSignatureSyntax.prototype.kind = SyntaxKind.MethodSignature; + MethodSignatureSyntax.prototype.childCount = 3; + MethodSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.questionToken; + case 2: return this.callSignature; + } + } + + export var BlockSyntax: BlockConstructor = function(data: number, equalsGreaterThanToken: ISyntaxToken, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.openBraceToken = openBraceToken, + this.statements = statements, + this.closeBraceToken = closeBraceToken, + equalsGreaterThanToken && (equalsGreaterThanToken.parent = this), + openBraceToken.parent = this, + statements.parent = this, + closeBraceToken.parent = this; + }; + BlockSyntax.prototype.kind = SyntaxKind.Block; + BlockSyntax.prototype.childCount = 4; + BlockSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.equalsGreaterThanToken; + case 1: return this.openBraceToken; + case 2: return this.statements; + case 3: return this.closeBraceToken; + } + } + + export var IfStatementSyntax: IfStatementConstructor = function(data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax) { + if (data) { this.__data = data; } + this.ifKeyword = ifKeyword, + this.openParenToken = openParenToken, + this.condition = condition, + this.closeParenToken = closeParenToken, + this.statement = statement, + this.elseClause = elseClause, + ifKeyword.parent = this, + openParenToken.parent = this, + condition.parent = this, + closeParenToken.parent = this, + statement.parent = this, + elseClause && (elseClause.parent = this); + }; + IfStatementSyntax.prototype.kind = SyntaxKind.IfStatement; + IfStatementSyntax.prototype.childCount = 6; + IfStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.ifKeyword; + case 1: return this.openParenToken; + case 2: return this.condition; + case 3: return this.closeParenToken; + case 4: return this.statement; + case 5: return this.elseClause; + } + } + + export var VariableStatementSyntax: VariableStatementConstructor = function(data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.variableDeclaration = variableDeclaration, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + variableDeclaration.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + VariableStatementSyntax.prototype.kind = SyntaxKind.VariableStatement; + VariableStatementSyntax.prototype.childCount = 3; + VariableStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.variableDeclaration; + case 2: return this.semicolonToken; + } + } + + export var ExpressionStatementSyntax: ExpressionStatementConstructor = function(data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.expression = expression, + this.semicolonToken = semicolonToken, + expression.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + ExpressionStatementSyntax.prototype.kind = SyntaxKind.ExpressionStatement; + ExpressionStatementSyntax.prototype.childCount = 2; + ExpressionStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.semicolonToken; + } + } + + export var ReturnStatementSyntax: ReturnStatementConstructor = function(data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.returnKeyword = returnKeyword, + this.expression = expression, + this.semicolonToken = semicolonToken, + returnKeyword.parent = this, + expression && (expression.parent = this), + semicolonToken && (semicolonToken.parent = this); + }; + ReturnStatementSyntax.prototype.kind = SyntaxKind.ReturnStatement; + ReturnStatementSyntax.prototype.childCount = 3; + ReturnStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.returnKeyword; + case 1: return this.expression; + case 2: return this.semicolonToken; + } + } + + export var SwitchStatementSyntax: SwitchStatementConstructor = function(data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.switchKeyword = switchKeyword, + this.openParenToken = openParenToken, + this.expression = expression, + this.closeParenToken = closeParenToken, + this.openBraceToken = openBraceToken, + this.switchClauses = switchClauses, + this.closeBraceToken = closeBraceToken, + switchKeyword.parent = this, + openParenToken.parent = this, + expression.parent = this, + closeParenToken.parent = this, + openBraceToken.parent = this, + switchClauses.parent = this, + closeBraceToken.parent = this; + }; + SwitchStatementSyntax.prototype.kind = SyntaxKind.SwitchStatement; + SwitchStatementSyntax.prototype.childCount = 7; + SwitchStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.switchKeyword; + case 1: return this.openParenToken; + case 2: return this.expression; + case 3: return this.closeParenToken; + case 4: return this.openBraceToken; + case 5: return this.switchClauses; + case 6: return this.closeBraceToken; + } + } + + export var BreakStatementSyntax: BreakStatementConstructor = function(data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.breakKeyword = breakKeyword, + this.identifier = identifier, + this.semicolonToken = semicolonToken, + breakKeyword.parent = this, + identifier && (identifier.parent = this), + semicolonToken && (semicolonToken.parent = this); + }; + BreakStatementSyntax.prototype.kind = SyntaxKind.BreakStatement; + BreakStatementSyntax.prototype.childCount = 3; + BreakStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.breakKeyword; + case 1: return this.identifier; + case 2: return this.semicolonToken; + } + } + + export var ContinueStatementSyntax: ContinueStatementConstructor = function(data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.continueKeyword = continueKeyword, + this.identifier = identifier, + this.semicolonToken = semicolonToken, + continueKeyword.parent = this, + identifier && (identifier.parent = this), + semicolonToken && (semicolonToken.parent = this); + }; + ContinueStatementSyntax.prototype.kind = SyntaxKind.ContinueStatement; + ContinueStatementSyntax.prototype.childCount = 3; + ContinueStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.continueKeyword; + case 1: return this.identifier; + case 2: return this.semicolonToken; + } + } + + export var ForStatementSyntax: ForStatementConstructor = function(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, initializer: VariableDeclarationSyntax | IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.forKeyword = forKeyword, + this.openParenToken = openParenToken, + this.initializer = initializer, + this.firstSemicolonToken = firstSemicolonToken, + this.condition = condition, + this.secondSemicolonToken = secondSemicolonToken, + this.incrementor = incrementor, + this.closeParenToken = closeParenToken, + this.statement = statement, + forKeyword.parent = this, + openParenToken.parent = this, + initializer && (initializer.parent = this), + firstSemicolonToken.parent = this, + condition && (condition.parent = this), + secondSemicolonToken.parent = this, + incrementor && (incrementor.parent = this), + closeParenToken.parent = this, + statement.parent = this; + }; + ForStatementSyntax.prototype.kind = SyntaxKind.ForStatement; + ForStatementSyntax.prototype.childCount = 9; + ForStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.forKeyword; + case 1: return this.openParenToken; + case 2: return this.initializer; + case 3: return this.firstSemicolonToken; + case 4: return this.condition; + case 5: return this.secondSemicolonToken; + case 6: return this.incrementor; + case 7: return this.closeParenToken; + case 8: return this.statement; + } + } + + export var ForInStatementSyntax: ForInStatementConstructor = function(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, left: VariableDeclarationSyntax | IExpressionSyntax, inKeyword: ISyntaxToken, right: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.forKeyword = forKeyword, + this.openParenToken = openParenToken, + this.left = left, + this.inKeyword = inKeyword, + this.right = right, + this.closeParenToken = closeParenToken, + this.statement = statement, + forKeyword.parent = this, + openParenToken.parent = this, + left.parent = this, + inKeyword.parent = this, + right.parent = this, + closeParenToken.parent = this, + statement.parent = this; + }; + ForInStatementSyntax.prototype.kind = SyntaxKind.ForInStatement; + ForInStatementSyntax.prototype.childCount = 7; + ForInStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.forKeyword; + case 1: return this.openParenToken; + case 2: return this.left; + case 3: return this.inKeyword; + case 4: return this.right; + case 5: return this.closeParenToken; + case 6: return this.statement; + } + } + + export var EmptyStatementSyntax: EmptyStatementConstructor = function(data: number, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.semicolonToken = semicolonToken, + semicolonToken.parent = this; + }; + EmptyStatementSyntax.prototype.kind = SyntaxKind.EmptyStatement; + EmptyStatementSyntax.prototype.childCount = 1; + EmptyStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.semicolonToken; + } + } + + export var ThrowStatementSyntax: ThrowStatementConstructor = function(data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.throwKeyword = throwKeyword, + this.expression = expression, + this.semicolonToken = semicolonToken, + throwKeyword.parent = this, + expression && (expression.parent = this), + semicolonToken && (semicolonToken.parent = this); + }; + ThrowStatementSyntax.prototype.kind = SyntaxKind.ThrowStatement; + ThrowStatementSyntax.prototype.childCount = 3; + ThrowStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.throwKeyword; + case 1: return this.expression; + case 2: return this.semicolonToken; + } + } + + export var WhileStatementSyntax: WhileStatementConstructor = function(data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.whileKeyword = whileKeyword, + this.openParenToken = openParenToken, + this.condition = condition, + this.closeParenToken = closeParenToken, + this.statement = statement, + whileKeyword.parent = this, + openParenToken.parent = this, + condition.parent = this, + closeParenToken.parent = this, + statement.parent = this; + }; + WhileStatementSyntax.prototype.kind = SyntaxKind.WhileStatement; + WhileStatementSyntax.prototype.childCount = 5; + WhileStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.whileKeyword; + case 1: return this.openParenToken; + case 2: return this.condition; + case 3: return this.closeParenToken; + case 4: return this.statement; + } + } + + export var TryStatementSyntax: TryStatementConstructor = function(data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax) { + if (data) { this.__data = data; } + this.tryKeyword = tryKeyword, + this.block = block, + this.catchClause = catchClause, + this.finallyClause = finallyClause, + tryKeyword.parent = this, + block.parent = this, + catchClause && (catchClause.parent = this), + finallyClause && (finallyClause.parent = this); + }; + TryStatementSyntax.prototype.kind = SyntaxKind.TryStatement; + TryStatementSyntax.prototype.childCount = 4; + TryStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.tryKeyword; + case 1: return this.block; + case 2: return this.catchClause; + case 3: return this.finallyClause; + } + } + + export var LabeledStatementSyntax: LabeledStatementConstructor = function(data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.identifier = identifier, + this.colonToken = colonToken, + this.statement = statement, + identifier.parent = this, + colonToken.parent = this, + statement.parent = this; + }; + LabeledStatementSyntax.prototype.kind = SyntaxKind.LabeledStatement; + LabeledStatementSyntax.prototype.childCount = 3; + LabeledStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.identifier; + case 1: return this.colonToken; + case 2: return this.statement; + } + } + + export var DoStatementSyntax: DoStatementConstructor = function(data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.doKeyword = doKeyword, + this.statement = statement, + this.whileKeyword = whileKeyword, + this.openParenToken = openParenToken, + this.condition = condition, + this.closeParenToken = closeParenToken, + this.semicolonToken = semicolonToken, + doKeyword.parent = this, + statement.parent = this, + whileKeyword.parent = this, + openParenToken.parent = this, + condition.parent = this, + closeParenToken.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + DoStatementSyntax.prototype.kind = SyntaxKind.DoStatement; + DoStatementSyntax.prototype.childCount = 7; + DoStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.doKeyword; + case 1: return this.statement; + case 2: return this.whileKeyword; + case 3: return this.openParenToken; + case 4: return this.condition; + case 5: return this.closeParenToken; + case 6: return this.semicolonToken; + } + } + + export var DebuggerStatementSyntax: DebuggerStatementConstructor = function(data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.debuggerKeyword = debuggerKeyword, + this.semicolonToken = semicolonToken, + debuggerKeyword.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + DebuggerStatementSyntax.prototype.kind = SyntaxKind.DebuggerStatement; + DebuggerStatementSyntax.prototype.childCount = 2; + DebuggerStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.debuggerKeyword; + case 1: return this.semicolonToken; + } + } + + export var WithStatementSyntax: WithStatementConstructor = function(data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.withKeyword = withKeyword, + this.openParenToken = openParenToken, + this.condition = condition, + this.closeParenToken = closeParenToken, + this.statement = statement, + withKeyword.parent = this, + openParenToken.parent = this, + condition.parent = this, + closeParenToken.parent = this, + statement.parent = this; + }; + WithStatementSyntax.prototype.kind = SyntaxKind.WithStatement; + WithStatementSyntax.prototype.childCount = 5; + WithStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.withKeyword; + case 1: return this.openParenToken; + case 2: return this.condition; + case 3: return this.closeParenToken; + case 4: return this.statement; + } + } + + export var PrefixUnaryExpressionSyntax: PrefixUnaryExpressionConstructor = function(data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax) { + if (data) { this.__data = data; } + this.operatorToken = operatorToken, + this.operand = operand, + operatorToken.parent = this, + operand.parent = this; + }; + PrefixUnaryExpressionSyntax.prototype.kind = SyntaxKind.PrefixUnaryExpression; + PrefixUnaryExpressionSyntax.prototype.childCount = 2; + PrefixUnaryExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.operatorToken; + case 1: return this.operand; + } + } + + export var DeleteExpressionSyntax: DeleteExpressionConstructor = function(data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { + if (data) { this.__data = data; } + this.deleteKeyword = deleteKeyword, + this.expression = expression, + deleteKeyword.parent = this, + expression.parent = this; + }; + DeleteExpressionSyntax.prototype.kind = SyntaxKind.DeleteExpression; + DeleteExpressionSyntax.prototype.childCount = 2; + DeleteExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.deleteKeyword; + case 1: return this.expression; + } + } + + export var TypeOfExpressionSyntax: TypeOfExpressionConstructor = function(data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { + if (data) { this.__data = data; } + this.typeOfKeyword = typeOfKeyword, + this.expression = expression, + typeOfKeyword.parent = this, + expression.parent = this; + }; + TypeOfExpressionSyntax.prototype.kind = SyntaxKind.TypeOfExpression; + TypeOfExpressionSyntax.prototype.childCount = 2; + TypeOfExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeOfKeyword; + case 1: return this.expression; + } + } + + export var VoidExpressionSyntax: VoidExpressionConstructor = function(data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { + if (data) { this.__data = data; } + this.voidKeyword = voidKeyword, + this.expression = expression, + voidKeyword.parent = this, + expression.parent = this; + }; + VoidExpressionSyntax.prototype.kind = SyntaxKind.VoidExpression; + VoidExpressionSyntax.prototype.childCount = 2; + VoidExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.voidKeyword; + case 1: return this.expression; + } + } + + export var ConditionalExpressionSyntax: ConditionalExpressionConstructor = function(data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax) { + if (data) { this.__data = data; } + this.condition = condition, + this.questionToken = questionToken, + this.whenTrue = whenTrue, + this.colonToken = colonToken, + this.whenFalse = whenFalse, + condition.parent = this, + questionToken.parent = this, + whenTrue.parent = this, + colonToken.parent = this, + whenFalse.parent = this; + }; + ConditionalExpressionSyntax.prototype.kind = SyntaxKind.ConditionalExpression; + ConditionalExpressionSyntax.prototype.childCount = 5; + ConditionalExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.condition; + case 1: return this.questionToken; + case 2: return this.whenTrue; + case 3: return this.colonToken; + case 4: return this.whenFalse; + } + } + + export var BinaryExpressionSyntax: BinaryExpressionConstructor = function(data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax) { + if (data) { this.__data = data; } + this.left = left, + this.operatorToken = operatorToken, + this.right = right, + left.parent = this, + operatorToken.parent = this, + right.parent = this; + }; + BinaryExpressionSyntax.prototype.kind = SyntaxKind.BinaryExpression; + BinaryExpressionSyntax.prototype.childCount = 3; + BinaryExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.left; + case 1: return this.operatorToken; + case 2: return this.right; + } + } + + export var PostfixUnaryExpressionSyntax: PostfixUnaryExpressionConstructor = function(data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.operand = operand, + this.operatorToken = operatorToken, + operand.parent = this, + operatorToken.parent = this; + }; + PostfixUnaryExpressionSyntax.prototype.kind = SyntaxKind.PostfixUnaryExpression; + PostfixUnaryExpressionSyntax.prototype.childCount = 2; + PostfixUnaryExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.operand; + case 1: return this.operatorToken; + } + } + + export var MemberAccessExpressionSyntax: MemberAccessExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken) { + if (data) { this.__data = data; } + this.expression = expression, + this.dotToken = dotToken, + this.name = name, + expression.parent = this, + dotToken.parent = this, + name.parent = this; + }; + MemberAccessExpressionSyntax.prototype.kind = SyntaxKind.MemberAccessExpression; + MemberAccessExpressionSyntax.prototype.childCount = 3; + MemberAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.dotToken; + case 2: return this.name; + } + } + + export var InvocationExpressionSyntax: InvocationExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax) { + if (data) { this.__data = data; } + this.expression = expression, + this.argumentList = argumentList, + expression.parent = this, + argumentList.parent = this; + }; + InvocationExpressionSyntax.prototype.kind = SyntaxKind.InvocationExpression; + InvocationExpressionSyntax.prototype.childCount = 2; + InvocationExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.argumentList; + } + } + + export var ArrayLiteralExpressionSyntax: ArrayLiteralExpressionConstructor = function(data: number, openBracketToken: ISyntaxToken, expressions: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBracketToken = openBracketToken, + this.expressions = expressions, + this.closeBracketToken = closeBracketToken, + openBracketToken.parent = this, + expressions.parent = this, + closeBracketToken.parent = this; + }; + ArrayLiteralExpressionSyntax.prototype.kind = SyntaxKind.ArrayLiteralExpression; + ArrayLiteralExpressionSyntax.prototype.childCount = 3; + ArrayLiteralExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.expressions; + case 2: return this.closeBracketToken; + } + } + + export var ObjectLiteralExpressionSyntax: ObjectLiteralExpressionConstructor = function(data: number, openBraceToken: ISyntaxToken, propertyAssignments: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBraceToken = openBraceToken, + this.propertyAssignments = propertyAssignments, + this.closeBraceToken = closeBraceToken, + openBraceToken.parent = this, + propertyAssignments.parent = this, + closeBraceToken.parent = this; + }; + ObjectLiteralExpressionSyntax.prototype.kind = SyntaxKind.ObjectLiteralExpression; + ObjectLiteralExpressionSyntax.prototype.childCount = 3; + ObjectLiteralExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBraceToken; + case 1: return this.propertyAssignments; + case 2: return this.closeBraceToken; + } + } + + export var ObjectCreationExpressionSyntax: ObjectCreationExpressionConstructor = function(data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax) { + if (data) { this.__data = data; } + this.newKeyword = newKeyword, + this.expression = expression, + this.argumentList = argumentList, + newKeyword.parent = this, + expression.parent = this, + argumentList && (argumentList.parent = this); + }; + ObjectCreationExpressionSyntax.prototype.kind = SyntaxKind.ObjectCreationExpression; + ObjectCreationExpressionSyntax.prototype.childCount = 3; + ObjectCreationExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.newKeyword; + case 1: return this.expression; + case 2: return this.argumentList; + } + } + + export var ParenthesizedExpressionSyntax: ParenthesizedExpressionConstructor = function(data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openParenToken = openParenToken, + this.expression = expression, + this.closeParenToken = closeParenToken, + openParenToken.parent = this, + expression.parent = this, + closeParenToken.parent = this; + }; + ParenthesizedExpressionSyntax.prototype.kind = SyntaxKind.ParenthesizedExpression; + ParenthesizedExpressionSyntax.prototype.childCount = 3; + ParenthesizedExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openParenToken; + case 1: return this.expression; + case 2: return this.closeParenToken; + } + } + + export var ParenthesizedArrowFunctionExpressionSyntax: ParenthesizedArrowFunctionExpressionConstructor = function(data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, body: BlockSyntax | IExpressionSyntax) { + if (data) { this.__data = data; } + this.callSignature = callSignature, + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.body = body, + callSignature.parent = this, + equalsGreaterThanToken.parent = this, + body.parent = this; + }; + ParenthesizedArrowFunctionExpressionSyntax.prototype.kind = SyntaxKind.ParenthesizedArrowFunctionExpression; + ParenthesizedArrowFunctionExpressionSyntax.prototype.childCount = 3; + ParenthesizedArrowFunctionExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.callSignature; + case 1: return this.equalsGreaterThanToken; + case 2: return this.body; + } + } + + export var SimpleArrowFunctionExpressionSyntax: SimpleArrowFunctionExpressionConstructor = function(data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, body: BlockSyntax | IExpressionSyntax) { + if (data) { this.__data = data; } + this.parameter = parameter, + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.body = body, + parameter.parent = this, + equalsGreaterThanToken.parent = this, + body.parent = this; + }; + SimpleArrowFunctionExpressionSyntax.prototype.kind = SyntaxKind.SimpleArrowFunctionExpression; + SimpleArrowFunctionExpressionSyntax.prototype.childCount = 3; + SimpleArrowFunctionExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.parameter; + case 1: return this.equalsGreaterThanToken; + case 2: return this.body; + } + } + + export var CastExpressionSyntax: CastExpressionConstructor = function(data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax) { + if (data) { this.__data = data; } + this.lessThanToken = lessThanToken, + this.type = type, + this.greaterThanToken = greaterThanToken, + this.expression = expression, + lessThanToken.parent = this, + type.parent = this, + greaterThanToken.parent = this, + expression.parent = this; + }; + CastExpressionSyntax.prototype.kind = SyntaxKind.CastExpression; + CastExpressionSyntax.prototype.childCount = 4; + CastExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.lessThanToken; + case 1: return this.type; + case 2: return this.greaterThanToken; + case 3: return this.expression; + } + } + + export var ElementAccessExpressionSyntax: ElementAccessExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.expression = expression, + this.openBracketToken = openBracketToken, + this.argumentExpression = argumentExpression, + this.closeBracketToken = closeBracketToken, + expression.parent = this, + openBracketToken.parent = this, + argumentExpression && (argumentExpression.parent = this), + closeBracketToken.parent = this; + }; + ElementAccessExpressionSyntax.prototype.kind = SyntaxKind.ElementAccessExpression; + ElementAccessExpressionSyntax.prototype.childCount = 4; + ElementAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.openBracketToken; + case 2: return this.argumentExpression; + case 3: return this.closeBracketToken; + } + } + + export var FunctionExpressionSyntax: FunctionExpressionConstructor = function(data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { + if (data) { this.__data = data; } + this.functionKeyword = functionKeyword, + this.asterixToken = asterixToken, + this.identifier = identifier, + this.callSignature = callSignature, + this.body = body, + functionKeyword.parent = this, + asterixToken && (asterixToken.parent = this), + identifier && (identifier.parent = this), + callSignature.parent = this, + body && (body.parent = this); + }; + FunctionExpressionSyntax.prototype.kind = SyntaxKind.FunctionExpression; + FunctionExpressionSyntax.prototype.childCount = 5; + FunctionExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.functionKeyword; + case 1: return this.asterixToken; + case 2: return this.identifier; + case 3: return this.callSignature; + case 4: return this.body; + } + } + + export var OmittedExpressionSyntax: OmittedExpressionConstructor = function(data: number) { + if (data) { this.__data = data; } + }; + OmittedExpressionSyntax.prototype.kind = SyntaxKind.OmittedExpression; + OmittedExpressionSyntax.prototype.childCount = 0; + OmittedExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + throw Errors.invalidOperation(); + } + + export var TemplateExpressionSyntax: TemplateExpressionConstructor = function(data: number, templateStartToken: ISyntaxToken, templateClauses: TemplateClauseSyntax[]) { + if (data) { this.__data = data; } + this.templateStartToken = templateStartToken, + this.templateClauses = templateClauses, + templateStartToken.parent = this, + templateClauses.parent = this; + }; + TemplateExpressionSyntax.prototype.kind = SyntaxKind.TemplateExpression; + TemplateExpressionSyntax.prototype.childCount = 2; + TemplateExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.templateStartToken; + case 1: return this.templateClauses; + } + } + + export var TemplateAccessExpressionSyntax: TemplateAccessExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, templateExpression: IPrimaryExpressionSyntax) { + if (data) { this.__data = data; } + this.expression = expression, + this.templateExpression = templateExpression, + expression.parent = this, + templateExpression.parent = this; + }; + TemplateAccessExpressionSyntax.prototype.kind = SyntaxKind.TemplateAccessExpression; + TemplateAccessExpressionSyntax.prototype.childCount = 2; + TemplateAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.templateExpression; + } + } + + export var YieldExpressionSyntax: YieldExpressionConstructor = function(data: number, yieldKeyword: ISyntaxToken, asterixToken: ISyntaxToken, expression: IExpressionSyntax) { + if (data) { this.__data = data; } + this.yieldKeyword = yieldKeyword, + this.asterixToken = asterixToken, + this.expression = expression, + yieldKeyword.parent = this, + asterixToken && (asterixToken.parent = this), + expression && (expression.parent = this); + }; + YieldExpressionSyntax.prototype.kind = SyntaxKind.YieldExpression; + YieldExpressionSyntax.prototype.childCount = 3; + YieldExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.yieldKeyword; + case 1: return this.asterixToken; + case 2: return this.expression; + } + } + + export var VariableDeclarationSyntax: VariableDeclarationConstructor = function(data: number, varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList) { + if (data) { this.__data = data; } + this.varKeyword = varKeyword, + this.variableDeclarators = variableDeclarators, + varKeyword.parent = this, + variableDeclarators.parent = this; + }; + VariableDeclarationSyntax.prototype.kind = SyntaxKind.VariableDeclaration; + VariableDeclarationSyntax.prototype.childCount = 2; + VariableDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.varKeyword; + case 1: return this.variableDeclarators; + } + } + + export var VariableDeclaratorSyntax: VariableDeclaratorConstructor = function(data: number, propertyName: IPropertyNameSyntax, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { + if (data) { this.__data = data; } + this.propertyName = propertyName, + this.typeAnnotation = typeAnnotation, + this.equalsValueClause = equalsValueClause, + propertyName.parent = this, + typeAnnotation && (typeAnnotation.parent = this), + equalsValueClause && (equalsValueClause.parent = this); + }; + VariableDeclaratorSyntax.prototype.kind = SyntaxKind.VariableDeclarator; + VariableDeclaratorSyntax.prototype.childCount = 3; + VariableDeclaratorSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.typeAnnotation; + case 2: return this.equalsValueClause; + } + } + + export var ArgumentListSyntax: ArgumentListConstructor = function(data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: ISeparatedSyntaxList, closeParenToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.typeArgumentList = typeArgumentList, + this.openParenToken = openParenToken, + this.arguments = _arguments, + this.closeParenToken = closeParenToken, + typeArgumentList && (typeArgumentList.parent = this), + openParenToken.parent = this, + _arguments.parent = this, + closeParenToken.parent = this; + }; + ArgumentListSyntax.prototype.kind = SyntaxKind.ArgumentList; + ArgumentListSyntax.prototype.childCount = 4; + ArgumentListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeArgumentList; + case 1: return this.openParenToken; + case 2: return this.arguments; + case 3: return this.closeParenToken; + } + } + + export var ParameterListSyntax: ParameterListConstructor = function(data: number, openParenToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeParenToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openParenToken = openParenToken, + this.parameters = parameters, + this.closeParenToken = closeParenToken, + openParenToken.parent = this, + parameters.parent = this, + closeParenToken.parent = this; + }; + ParameterListSyntax.prototype.kind = SyntaxKind.ParameterList; + ParameterListSyntax.prototype.childCount = 3; + ParameterListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openParenToken; + case 1: return this.parameters; + case 2: return this.closeParenToken; + } + } + + export var TypeArgumentListSyntax: TypeArgumentListConstructor = function(data: number, lessThanToken: ISyntaxToken, typeArguments: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.lessThanToken = lessThanToken, + this.typeArguments = typeArguments, + this.greaterThanToken = greaterThanToken, + lessThanToken.parent = this, + typeArguments.parent = this, + greaterThanToken.parent = this; + }; + TypeArgumentListSyntax.prototype.kind = SyntaxKind.TypeArgumentList; + TypeArgumentListSyntax.prototype.childCount = 3; + TypeArgumentListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.lessThanToken; + case 1: return this.typeArguments; + case 2: return this.greaterThanToken; + } + } + + export var TypeParameterListSyntax: TypeParameterListConstructor = function(data: number, lessThanToken: ISyntaxToken, typeParameters: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.lessThanToken = lessThanToken, + this.typeParameters = typeParameters, + this.greaterThanToken = greaterThanToken, + lessThanToken.parent = this, + typeParameters.parent = this, + greaterThanToken.parent = this; + }; + TypeParameterListSyntax.prototype.kind = SyntaxKind.TypeParameterList; + TypeParameterListSyntax.prototype.childCount = 3; + TypeParameterListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.lessThanToken; + case 1: return this.typeParameters; + case 2: return this.greaterThanToken; + } + } + + export var HeritageClauseSyntax: HeritageClauseConstructor = function(data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: ISeparatedSyntaxList) { + if (data) { this.__data = data; } + this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, + this.typeNames = typeNames, + extendsOrImplementsKeyword.parent = this, + typeNames.parent = this; + }; + HeritageClauseSyntax.prototype.kind = SyntaxKind.HeritageClause; + HeritageClauseSyntax.prototype.childCount = 2; + HeritageClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.extendsOrImplementsKeyword; + case 1: return this.typeNames; + } + } + + export var EqualsValueClauseSyntax: EqualsValueClauseConstructor = function(data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax) { + if (data) { this.__data = data; } + this.equalsToken = equalsToken, + this.value = value, + equalsToken.parent = this, + value.parent = this; + }; + EqualsValueClauseSyntax.prototype.kind = SyntaxKind.EqualsValueClause; + EqualsValueClauseSyntax.prototype.childCount = 2; + EqualsValueClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.equalsToken; + case 1: return this.value; + } + } + + export var CaseSwitchClauseSyntax: CaseSwitchClauseConstructor = function(data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { + if (data) { this.__data = data; } + this.caseKeyword = caseKeyword, + this.expression = expression, + this.colonToken = colonToken, + this.statements = statements, + caseKeyword.parent = this, + expression.parent = this, + colonToken.parent = this, + statements.parent = this; + }; + CaseSwitchClauseSyntax.prototype.kind = SyntaxKind.CaseSwitchClause; + CaseSwitchClauseSyntax.prototype.childCount = 4; + CaseSwitchClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.caseKeyword; + case 1: return this.expression; + case 2: return this.colonToken; + case 3: return this.statements; + } + } + + export var DefaultSwitchClauseSyntax: DefaultSwitchClauseConstructor = function(data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { + if (data) { this.__data = data; } + this.defaultKeyword = defaultKeyword, + this.colonToken = colonToken, + this.statements = statements, + defaultKeyword.parent = this, + colonToken.parent = this, + statements.parent = this; + }; + DefaultSwitchClauseSyntax.prototype.kind = SyntaxKind.DefaultSwitchClause; + DefaultSwitchClauseSyntax.prototype.childCount = 3; + DefaultSwitchClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.defaultKeyword; + case 1: return this.colonToken; + case 2: return this.statements; + } + } + + export var ElseClauseSyntax: ElseClauseConstructor = function(data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.elseKeyword = elseKeyword, + this.statement = statement, + elseKeyword.parent = this, + statement.parent = this; + }; + ElseClauseSyntax.prototype.kind = SyntaxKind.ElseClause; + ElseClauseSyntax.prototype.childCount = 2; + ElseClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.elseKeyword; + case 1: return this.statement; + } + } + + export var CatchClauseSyntax: CatchClauseConstructor = function(data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax) { + if (data) { this.__data = data; } + this.catchKeyword = catchKeyword, + this.openParenToken = openParenToken, + this.identifier = identifier, + this.typeAnnotation = typeAnnotation, + this.closeParenToken = closeParenToken, + this.block = block, + catchKeyword.parent = this, + openParenToken.parent = this, + identifier.parent = this, + typeAnnotation && (typeAnnotation.parent = this), + closeParenToken.parent = this, + block.parent = this; + }; + CatchClauseSyntax.prototype.kind = SyntaxKind.CatchClause; + CatchClauseSyntax.prototype.childCount = 6; + CatchClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.catchKeyword; + case 1: return this.openParenToken; + case 2: return this.identifier; + case 3: return this.typeAnnotation; + case 4: return this.closeParenToken; + case 5: return this.block; + } + } + + export var FinallyClauseSyntax: FinallyClauseConstructor = function(data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax) { + if (data) { this.__data = data; } + this.finallyKeyword = finallyKeyword, + this.block = block, + finallyKeyword.parent = this, + block.parent = this; + }; + FinallyClauseSyntax.prototype.kind = SyntaxKind.FinallyClause; + FinallyClauseSyntax.prototype.childCount = 2; + FinallyClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.finallyKeyword; + case 1: return this.block; + } + } + + export var TemplateClauseSyntax: TemplateClauseConstructor = function(data: number, expression: IExpressionSyntax, templateMiddleOrEndToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.expression = expression, + this.templateMiddleOrEndToken = templateMiddleOrEndToken, + expression.parent = this, + templateMiddleOrEndToken.parent = this; + }; + TemplateClauseSyntax.prototype.kind = SyntaxKind.TemplateClause; + TemplateClauseSyntax.prototype.childCount = 2; + TemplateClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.templateMiddleOrEndToken; + } + } + + export var TypeParameterSyntax: TypeParameterConstructor = function(data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax) { + if (data) { this.__data = data; } + this.identifier = identifier, + this.constraint = constraint, + identifier.parent = this, + constraint && (constraint.parent = this); + }; + TypeParameterSyntax.prototype.kind = SyntaxKind.TypeParameter; + TypeParameterSyntax.prototype.childCount = 2; + TypeParameterSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.identifier; + case 1: return this.constraint; + } + } + + export var ConstraintSyntax: ConstraintConstructor = function(data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken) { + if (data) { this.__data = data; } + this.extendsKeyword = extendsKeyword, + this.typeOrExpression = typeOrExpression, + extendsKeyword.parent = this, + typeOrExpression.parent = this; + }; + ConstraintSyntax.prototype.kind = SyntaxKind.Constraint; + ConstraintSyntax.prototype.childCount = 2; + ConstraintSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.extendsKeyword; + case 1: return this.typeOrExpression; + } + } + + export var SimplePropertyAssignmentSyntax: SimplePropertyAssignmentConstructor = function(data: number, propertyName: IPropertyNameSyntax, colonToken: ISyntaxToken, expression: IExpressionSyntax) { + if (data) { this.__data = data; } + this.propertyName = propertyName, + this.colonToken = colonToken, + this.expression = expression, + propertyName.parent = this, + colonToken.parent = this, + expression.parent = this; + }; + SimplePropertyAssignmentSyntax.prototype.kind = SyntaxKind.SimplePropertyAssignment; + SimplePropertyAssignmentSyntax.prototype.childCount = 3; + SimplePropertyAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.colonToken; + case 2: return this.expression; + } + } + + export var FunctionPropertyAssignmentSyntax: FunctionPropertyAssignmentConstructor = function(data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { + if (data) { this.__data = data; } + this.asterixToken = asterixToken, + this.propertyName = propertyName, + this.callSignature = callSignature, + this.body = body, + asterixToken && (asterixToken.parent = this), + propertyName.parent = this, + callSignature.parent = this, + body && (body.parent = this); + }; + FunctionPropertyAssignmentSyntax.prototype.kind = SyntaxKind.FunctionPropertyAssignment; + FunctionPropertyAssignmentSyntax.prototype.childCount = 4; + FunctionPropertyAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.asterixToken; + case 1: return this.propertyName; + case 2: return this.callSignature; + case 3: return this.body; + } + } + + export var ParameterSyntax: ParameterConstructor = function(data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { + if (data) { this.__data = data; } + this.dotDotDotToken = dotDotDotToken, + this.modifiers = modifiers, + this.identifier = identifier, + this.questionToken = questionToken, + this.typeAnnotation = typeAnnotation, + this.equalsValueClause = equalsValueClause, + dotDotDotToken && (dotDotDotToken.parent = this), + modifiers.parent = this, + identifier.parent = this, + questionToken && (questionToken.parent = this), + typeAnnotation && (typeAnnotation.parent = this), + equalsValueClause && (equalsValueClause.parent = this); + }; + ParameterSyntax.prototype.kind = SyntaxKind.Parameter; + ParameterSyntax.prototype.childCount = 6; + ParameterSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.dotDotDotToken; + case 1: return this.modifiers; + case 2: return this.identifier; + case 3: return this.questionToken; + case 4: return this.typeAnnotation; + case 5: return this.equalsValueClause; + } + } + + export var EnumElementSyntax: EnumElementConstructor = function(data: number, propertyName: IPropertyNameSyntax, equalsValueClause: EqualsValueClauseSyntax) { + if (data) { this.__data = data; } + this.propertyName = propertyName, + this.equalsValueClause = equalsValueClause, + propertyName.parent = this, + equalsValueClause && (equalsValueClause.parent = this); + }; + EnumElementSyntax.prototype.kind = SyntaxKind.EnumElement; + EnumElementSyntax.prototype.childCount = 2; + EnumElementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.equalsValueClause; + } + } + + export var TypeAnnotationSyntax: TypeAnnotationConstructor = function(data: number, colonToken: ISyntaxToken, type: ITypeSyntax) { + if (data) { this.__data = data; } + this.colonToken = colonToken, + this.type = type, + colonToken.parent = this, + type.parent = this; + }; + TypeAnnotationSyntax.prototype.kind = SyntaxKind.TypeAnnotation; + TypeAnnotationSyntax.prototype.childCount = 2; + TypeAnnotationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.colonToken; + case 1: return this.type; + } + } + + export var ExpressionBody: ExpressionBodyConstructor = function(data: number, equalsGreaterThanToken: ISyntaxToken, expression: IExpressionSyntax) { + if (data) { this.__data = data; } + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.expression = expression, + equalsGreaterThanToken.parent = this, + expression.parent = this; + }; + ExpressionBody.prototype.kind = SyntaxKind.ExpressionBody; + ExpressionBody.prototype.childCount = 2; + ExpressionBody.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.equalsGreaterThanToken; + case 1: return this.expression; + } + } + + export var ComputedPropertyNameSyntax: ComputedPropertyNameConstructor = function(data: number, openBracketToken: ISyntaxToken, expression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBracketToken = openBracketToken, + this.expression = expression, + this.closeBracketToken = closeBracketToken, + openBracketToken.parent = this, + expression.parent = this, + closeBracketToken.parent = this; + }; + ComputedPropertyNameSyntax.prototype.kind = SyntaxKind.ComputedPropertyName; + ComputedPropertyNameSyntax.prototype.childCount = 3; + ComputedPropertyNameSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.expression; + case 2: return this.closeBracketToken; + } + } + + export var ExternalModuleReferenceSyntax: ExternalModuleReferenceConstructor = function(data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.requireKeyword = requireKeyword, + this.openParenToken = openParenToken, + this.stringLiteral = stringLiteral, + this.closeParenToken = closeParenToken, + requireKeyword.parent = this, + openParenToken.parent = this, + stringLiteral.parent = this, + closeParenToken.parent = this; + }; + ExternalModuleReferenceSyntax.prototype.kind = SyntaxKind.ExternalModuleReference; + ExternalModuleReferenceSyntax.prototype.childCount = 4; + ExternalModuleReferenceSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.requireKeyword; + case 1: return this.openParenToken; + case 2: return this.stringLiteral; + case 3: return this.closeParenToken; + } + } + + export var ModuleNameModuleReferenceSyntax: ModuleNameModuleReferenceConstructor = function(data: number, moduleName: INameSyntax) { + if (data) { this.__data = data; } + this.moduleName = moduleName, + moduleName.parent = this; + }; + ModuleNameModuleReferenceSyntax.prototype.kind = SyntaxKind.ModuleNameModuleReference; + ModuleNameModuleReferenceSyntax.prototype.childCount = 1; + ModuleNameModuleReferenceSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.moduleName; + } + } } \ No newline at end of file diff --git a/src/services/syntax/syntaxNodes.interfaces.generated.ts b/src/services/syntax/syntaxNodes.interfaces.generated.ts index 0ecc9cbf9c6..23fe6c40f56 100644 --- a/src/services/syntax/syntaxNodes.interfaces.generated.ts +++ b/src/services/syntax/syntaxNodes.interfaces.generated.ts @@ -13,7 +13,7 @@ module TypeScript { } export interface ObjectTypeSyntax extends ISyntaxNode, ITypeSyntax { openBraceToken: ISyntaxToken; - typeMembers: ITypeMemberSyntax[]; + typeMembers: ISeparatedSyntaxList; closeBraceToken: ISyntaxToken; } export interface FunctionTypeSyntax extends ISyntaxNode, ITypeSyntax { @@ -42,6 +42,21 @@ module TypeScript { typeOfKeyword: ISyntaxToken; name: INameSyntax; } + export interface TupleTypeSyntax extends ISyntaxNode, ITypeSyntax { + openBracketToken: ISyntaxToken; + types: ISeparatedSyntaxList; + closeBracketToken: ISyntaxToken; + } + export interface UnionTypeSyntax extends ISyntaxNode, ITypeSyntax { + left: ITypeSyntax; + barToken: ISyntaxToken; + right: ITypeSyntax; + } + export interface ParenthesizedTypeSyntax extends ISyntaxNode, ITypeSyntax { + openParenToken: ISyntaxToken; + type: ITypeSyntax; + closeParenToken: ISyntaxToken; + } export interface InterfaceDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { modifiers: ISyntaxToken[]; interfaceKeyword: ISyntaxToken; @@ -82,7 +97,7 @@ module TypeScript { enumKeyword: ISyntaxToken; identifier: ISyntaxToken; openBraceToken: ISyntaxToken; - enumElements: EnumElementSyntax[]; + enumElements: ISeparatedSyntaxList; closeBraceToken: ISyntaxToken; } export interface ImportDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { @@ -153,7 +168,7 @@ module TypeScript { } export interface IndexSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { openBracketToken: ISyntaxToken; - parameters: ParameterSyntax[]; + parameters: ISeparatedSyntaxList; closeBracketToken: ISyntaxToken; typeAnnotation: TypeAnnotationSyntax; } @@ -319,12 +334,12 @@ module TypeScript { } export interface ArrayLiteralExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { openBracketToken: ISyntaxToken; - expressions: IExpressionSyntax[]; + expressions: ISeparatedSyntaxList; closeBracketToken: ISyntaxToken; } export interface ObjectLiteralExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { openBraceToken: ISyntaxToken; - propertyAssignments: IPropertyAssignmentSyntax[]; + propertyAssignments: ISeparatedSyntaxList; closeBraceToken: ISyntaxToken; } export interface ObjectCreationExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { @@ -371,7 +386,7 @@ module TypeScript { } export interface VariableDeclarationSyntax extends ISyntaxNode { varKeyword: ISyntaxToken; - variableDeclarators: VariableDeclaratorSyntax[]; + variableDeclarators: ISeparatedSyntaxList; } export interface VariableDeclaratorSyntax extends ISyntaxNode { propertyName: ISyntaxToken; @@ -381,27 +396,27 @@ module TypeScript { export interface ArgumentListSyntax extends ISyntaxNode { typeArgumentList: TypeArgumentListSyntax; openParenToken: ISyntaxToken; - arguments: IExpressionSyntax[]; + arguments: ISeparatedSyntaxList; closeParenToken: ISyntaxToken; } export interface ParameterListSyntax extends ISyntaxNode { openParenToken: ISyntaxToken; - parameters: ParameterSyntax[]; + parameters: ISeparatedSyntaxList; closeParenToken: ISyntaxToken; } export interface TypeArgumentListSyntax extends ISyntaxNode { lessThanToken: ISyntaxToken; - typeArguments: ITypeSyntax[]; + typeArguments: ISeparatedSyntaxList; greaterThanToken: ISyntaxToken; } export interface TypeParameterListSyntax extends ISyntaxNode { lessThanToken: ISyntaxToken; - typeParameters: TypeParameterSyntax[]; + typeParameters: ISeparatedSyntaxList; greaterThanToken: ISyntaxToken; } export interface HeritageClauseSyntax extends ISyntaxNode { extendsOrImplementsKeyword: ISyntaxToken; - typeNames: INameSyntax[]; + typeNames: ISeparatedSyntaxList; } export interface EqualsValueClauseSyntax extends ISyntaxNode { equalsToken: ISyntaxToken; @@ -477,97 +492,4 @@ module TypeScript { export interface ModuleNameModuleReferenceSyntax extends ISyntaxNode, IModuleReferenceSyntax { moduleName: INameSyntax; } - - export var nodeMetadata: string[][] = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],["moduleElements","endOfFileToken"],["left","dotToken","right"],["openBraceToken","typeMembers","closeBraceToken"],["typeParameterList","parameterList","equalsGreaterThanToken","type"],["type","openBracketToken","closeBracketToken"],["newKeyword","typeParameterList","parameterList","equalsGreaterThanToken","type"],["name","typeArgumentList"],["typeOfKeyword","name"],["modifiers","interfaceKeyword","identifier","typeParameterList","heritageClauses","body"],["modifiers","functionKeyword","identifier","callSignature","block","semicolonToken"],["modifiers","moduleKeyword","name","stringLiteral","openBraceToken","moduleElements","closeBraceToken"],["modifiers","classKeyword","identifier","typeParameterList","heritageClauses","openBraceToken","classElements","closeBraceToken"],["modifiers","enumKeyword","identifier","openBraceToken","enumElements","closeBraceToken"],["modifiers","importKeyword","identifier","equalsToken","moduleReference","semicolonToken"],["exportKeyword","equalsToken","identifier","semicolonToken"],["modifiers","propertyName","callSignature","block","semicolonToken"],["modifiers","variableDeclarator","semicolonToken"],["modifiers","constructorKeyword","callSignature","block","semicolonToken"],["modifiers","indexSignature","semicolonToken"],["modifiers","getKeyword","propertyName","callSignature","block"],["modifiers","setKeyword","propertyName","callSignature","block"],["propertyName","questionToken","typeAnnotation"],["typeParameterList","parameterList","typeAnnotation"],["newKeyword","callSignature"],["openBracketToken","parameters","closeBracketToken","typeAnnotation"],["propertyName","questionToken","callSignature"],["openBraceToken","statements","closeBraceToken"],["ifKeyword","openParenToken","condition","closeParenToken","statement","elseClause"],["modifiers","variableDeclaration","semicolonToken"],["expression","semicolonToken"],["returnKeyword","expression","semicolonToken"],["switchKeyword","openParenToken","expression","closeParenToken","openBraceToken","switchClauses","closeBraceToken"],["breakKeyword","identifier","semicolonToken"],["continueKeyword","identifier","semicolonToken"],["forKeyword","openParenToken","variableDeclaration","initializer","firstSemicolonToken","condition","secondSemicolonToken","incrementor","closeParenToken","statement"],["forKeyword","openParenToken","variableDeclaration","left","inKeyword","expression","closeParenToken","statement"],["semicolonToken"],["throwKeyword","expression","semicolonToken"],["whileKeyword","openParenToken","condition","closeParenToken","statement"],["tryKeyword","block","catchClause","finallyClause"],["identifier","colonToken","statement"],["doKeyword","statement","whileKeyword","openParenToken","condition","closeParenToken","semicolonToken"],["debuggerKeyword","semicolonToken"],["withKeyword","openParenToken","condition","closeParenToken","statement"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["deleteKeyword","expression"],["typeOfKeyword","expression"],["voidKeyword","expression"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["condition","questionToken","whenTrue","colonToken","whenFalse"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["operand","operatorToken"],["operand","operatorToken"],["expression","dotToken","name"],["expression","argumentList"],["openBracketToken","expressions","closeBracketToken"],["openBraceToken","propertyAssignments","closeBraceToken"],["newKeyword","expression","argumentList"],["openParenToken","expression","closeParenToken"],["callSignature","equalsGreaterThanToken","block","expression"],["parameter","equalsGreaterThanToken","block","expression"],["lessThanToken","type","greaterThanToken","expression"],["expression","openBracketToken","argumentExpression","closeBracketToken"],["functionKeyword","identifier","callSignature","block"],[],["varKeyword","variableDeclarators"],["propertyName","typeAnnotation","equalsValueClause"],["typeArgumentList","openParenToken","arguments","closeParenToken"],["openParenToken","parameters","closeParenToken"],["lessThanToken","typeArguments","greaterThanToken"],["lessThanToken","typeParameters","greaterThanToken"],["extendsOrImplementsKeyword","typeNames"],["extendsOrImplementsKeyword","typeNames"],["equalsToken","value"],["caseKeyword","expression","colonToken","statements"],["defaultKeyword","colonToken","statements"],["elseKeyword","statement"],["catchKeyword","openParenToken","identifier","typeAnnotation","closeParenToken","block"],["finallyKeyword","block"],["identifier","constraint"],["extendsKeyword","typeOrExpression"],["propertyName","colonToken","expression"],["propertyName","callSignature","block"],["dotDotDotToken","modifiers","identifier","questionToken","typeAnnotation","equalsValueClause"],["propertyName","equalsValueClause"],["colonToken","type"],["requireKeyword","openParenToken","stringLiteral","closeParenToken"],["moduleName"],]; - - export module Syntax { - export interface ISyntaxFactory { - isConcrete: boolean; - SourceUnitSyntax: { new(data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken): SourceUnitSyntax }; - QualifiedNameSyntax: { new(data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken): QualifiedNameSyntax }; - ObjectTypeSyntax: { new(data: number, openBraceToken: ISyntaxToken, typeMembers: ITypeMemberSyntax[], closeBraceToken: ISyntaxToken): ObjectTypeSyntax }; - FunctionTypeSyntax: { new(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): FunctionTypeSyntax }; - ArrayTypeSyntax: { new(data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken): ArrayTypeSyntax }; - ConstructorTypeSyntax: { new(data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): ConstructorTypeSyntax }; - GenericTypeSyntax: { new(data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax): GenericTypeSyntax }; - TypeQuerySyntax: { new(data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax): TypeQuerySyntax }; - InterfaceDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax): InterfaceDeclarationSyntax }; - FunctionDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): FunctionDeclarationSyntax }; - ModuleDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax }; - ClassDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken): ClassDeclarationSyntax }; - EnumDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: EnumElementSyntax[], closeBraceToken: ISyntaxToken): EnumDeclarationSyntax }; - ImportDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken): ImportDeclarationSyntax }; - ExportAssignmentSyntax: { new(data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ExportAssignmentSyntax }; - MemberFunctionDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): MemberFunctionDeclarationSyntax }; - MemberVariableDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax }; - ConstructorDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): ConstructorDeclarationSyntax }; - IndexMemberDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax }; - GetAccessorSyntax: { new(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): GetAccessorSyntax }; - SetAccessorSyntax: { new(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): SetAccessorSyntax }; - PropertySignatureSyntax: { new(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax }; - CallSignatureSyntax: { new(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax): CallSignatureSyntax }; - ConstructSignatureSyntax: { new(data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax): ConstructSignatureSyntax }; - IndexSignatureSyntax: { new(data: number, openBracketToken: ISyntaxToken, parameters: ParameterSyntax[], closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): IndexSignatureSyntax }; - MethodSignatureSyntax: { new(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax }; - BlockSyntax: { new(data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken): BlockSyntax }; - IfStatementSyntax: { new(data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax): IfStatementSyntax }; - VariableStatementSyntax: { new(data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken): VariableStatementSyntax }; - ExpressionStatementSyntax: { new(data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ExpressionStatementSyntax }; - ReturnStatementSyntax: { new(data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ReturnStatementSyntax }; - SwitchStatementSyntax: { new(data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken): SwitchStatementSyntax }; - BreakStatementSyntax: { new(data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): BreakStatementSyntax }; - ContinueStatementSyntax: { new(data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ContinueStatementSyntax }; - ForStatementSyntax: { new(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForStatementSyntax }; - ForInStatementSyntax: { new(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForInStatementSyntax }; - EmptyStatementSyntax: { new(data: number, semicolonToken: ISyntaxToken): EmptyStatementSyntax }; - ThrowStatementSyntax: { new(data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ThrowStatementSyntax }; - WhileStatementSyntax: { new(data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WhileStatementSyntax }; - TryStatementSyntax: { new(data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax): TryStatementSyntax }; - LabeledStatementSyntax: { new(data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax): LabeledStatementSyntax }; - DoStatementSyntax: { new(data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken): DoStatementSyntax }; - DebuggerStatementSyntax: { new(data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): DebuggerStatementSyntax }; - WithStatementSyntax: { new(data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WithStatementSyntax }; - PrefixUnaryExpressionSyntax: { new(data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax): PrefixUnaryExpressionSyntax }; - DeleteExpressionSyntax: { new(data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): DeleteExpressionSyntax }; - TypeOfExpressionSyntax: { new(data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): TypeOfExpressionSyntax }; - VoidExpressionSyntax: { new(data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): VoidExpressionSyntax }; - ConditionalExpressionSyntax: { new(data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax): ConditionalExpressionSyntax }; - BinaryExpressionSyntax: { new(data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax): BinaryExpressionSyntax }; - PostfixUnaryExpressionSyntax: { new(data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken): PostfixUnaryExpressionSyntax }; - MemberAccessExpressionSyntax: { new(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken): MemberAccessExpressionSyntax }; - InvocationExpressionSyntax: { new(data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax): InvocationExpressionSyntax }; - ArrayLiteralExpressionSyntax: { new(data: number, openBracketToken: ISyntaxToken, expressions: IExpressionSyntax[], closeBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax }; - ObjectLiteralExpressionSyntax: { new(data: number, openBraceToken: ISyntaxToken, propertyAssignments: IPropertyAssignmentSyntax[], closeBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax }; - ObjectCreationExpressionSyntax: { new(data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): ObjectCreationExpressionSyntax }; - ParenthesizedExpressionSyntax: { new(data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken): ParenthesizedExpressionSyntax }; - ParenthesizedArrowFunctionExpressionSyntax: { new(data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): ParenthesizedArrowFunctionExpressionSyntax }; - SimpleArrowFunctionExpressionSyntax: { new(data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): SimpleArrowFunctionExpressionSyntax }; - CastExpressionSyntax: { new(data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax): CastExpressionSyntax }; - ElementAccessExpressionSyntax: { new(data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ElementAccessExpressionSyntax }; - FunctionExpressionSyntax: { new(data: number, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionExpressionSyntax }; - OmittedExpressionSyntax: { new(data: number): OmittedExpressionSyntax }; - VariableDeclarationSyntax: { new(data: number, varKeyword: ISyntaxToken, variableDeclarators: VariableDeclaratorSyntax[]): VariableDeclarationSyntax }; - VariableDeclaratorSyntax: { new(data: number, propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax }; - ArgumentListSyntax: { new(data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, arguments: IExpressionSyntax[], closeParenToken: ISyntaxToken): ArgumentListSyntax }; - ParameterListSyntax: { new(data: number, openParenToken: ISyntaxToken, parameters: ParameterSyntax[], closeParenToken: ISyntaxToken): ParameterListSyntax }; - TypeArgumentListSyntax: { new(data: number, lessThanToken: ISyntaxToken, typeArguments: ITypeSyntax[], greaterThanToken: ISyntaxToken): TypeArgumentListSyntax }; - TypeParameterListSyntax: { new(data: number, lessThanToken: ISyntaxToken, typeParameters: TypeParameterSyntax[], greaterThanToken: ISyntaxToken): TypeParameterListSyntax }; - HeritageClauseSyntax: { new(data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: INameSyntax[]): HeritageClauseSyntax }; - EqualsValueClauseSyntax: { new(data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax): EqualsValueClauseSyntax }; - CaseSwitchClauseSyntax: { new(data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]): CaseSwitchClauseSyntax }; - DefaultSwitchClauseSyntax: { new(data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]): DefaultSwitchClauseSyntax }; - ElseClauseSyntax: { new(data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax): ElseClauseSyntax }; - CatchClauseSyntax: { new(data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax): CatchClauseSyntax }; - FinallyClauseSyntax: { new(data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax): FinallyClauseSyntax }; - TypeParameterSyntax: { new(data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax): TypeParameterSyntax }; - ConstraintSyntax: { new(data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken): ConstraintSyntax }; - SimplePropertyAssignmentSyntax: { new(data: number, propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax }; - FunctionPropertyAssignmentSyntax: { new(data: number, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionPropertyAssignmentSyntax }; - ParameterSyntax: { new(data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): ParameterSyntax }; - EnumElementSyntax: { new(data: number, propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax }; - TypeAnnotationSyntax: { new(data: number, colonToken: ISyntaxToken, type: ITypeSyntax): TypeAnnotationSyntax }; - ExternalModuleReferenceSyntax: { new(data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken): ExternalModuleReferenceSyntax }; - ModuleNameModuleReferenceSyntax: { new(data: number, moduleName: INameSyntax): ModuleNameModuleReferenceSyntax }; - } - } } \ No newline at end of file diff --git a/src/services/syntax/syntaxToken.ts b/src/services/syntax/syntaxToken.ts index 4f3906e1fe9..9ddbc3a800c 100644 --- a/src/services/syntax/syntaxToken.ts +++ b/src/services/syntax/syntaxToken.ts @@ -1,7 +1,7 @@ /// module TypeScript { - export interface ISyntaxToken extends ISyntaxNodeOrToken, INameSyntax, IPrimaryExpressionSyntax { + export interface ISyntaxToken extends ISyntaxNodeOrToken, INameSyntax, IPrimaryExpressionSyntax, IPropertyAssignmentSyntax, IPropertyNameSyntax { // Adjusts the full start of this token. Should only be called by the parser. setFullStart(fullStart: number): void; @@ -16,17 +16,12 @@ module TypeScript { fullText(text?: ISimpleText): string; hasLeadingTrivia(): boolean; - hasTrailingTrivia(): boolean; + hasLeadingNewLine(): boolean; hasLeadingComment(): boolean; - hasTrailingComment(): boolean; - - hasSkippedToken(): boolean; + hasLeadingSkippedToken(): boolean; leadingTrivia(text?: ISimpleText): ISyntaxTriviaList; - trailingTrivia(text?: ISimpleText): ISyntaxTriviaList; - leadingTriviaWidth(text?: ISimpleText): number; - trailingTriviaWidth(text?: ISimpleText): number; // True if this was a keyword that the parser converted to an identifier. i.e. if you have // x.public @@ -71,10 +66,10 @@ module TypeScript { module TypeScript { export function tokenValue(token: ISyntaxToken): any { if (token.fullWidth() === 0) { - return null; + return undefined; } - var kind = token.kind(); + var kind = token.kind; var text = token.text(); if (kind === SyntaxKind.IdentifierName) { @@ -87,7 +82,7 @@ module TypeScript { case SyntaxKind.FalseKeyword: return false; case SyntaxKind.NullKeyword: - return null; + return undefined; } if (SyntaxFacts.isAnyKeyword(kind) || SyntaxFacts.isAnyPunctuation(kind)) { @@ -98,21 +93,29 @@ module TypeScript { return IntegerUtilities.isHexInteger(text) ? parseInt(text, /*radix:*/ 16) : parseFloat(text); } else if (kind === SyntaxKind.StringLiteral) { - if (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) { - // Properly terminated. Remove the quotes, and massage any escape characters we see. - return massageEscapes(text.substr(1, text.length - 2)); - } - else { - // Not property terminated. Remove the first quote and massage any escape characters we see. - return massageEscapes(text.substr(1)); - - } + return (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) + ? massageEscapes(text.substr(1, text.length - "''".length)) + : massageEscapes(text.substr(1)); + } + else if (kind === SyntaxKind.NoSubstitutionTemplateToken || kind === SyntaxKind.TemplateEndToken) { + // Both of these template types may be missing their closing backtick (if they were at + // the end of the file). Check to make sure it is there before grabbing the portion + // we're examining. + return (text.length > 1 && text.charCodeAt(text.length - 1) === CharacterCodes.backtick) + ? massageTemplate(text.substr(1, text.length - "``".length)) + : massageTemplate(text.substr(1)); + } + else if (kind === SyntaxKind.TemplateStartToken || kind === SyntaxKind.TemplateMiddleToken) { + // Both these tokens must have been properly ended. i.e. if it didn't end with a ${ + // then we would not have parsed a start or middle token out at all. So we don't + // need to check for an incomplete token. + return massageTemplate(text.substr(1, text.length - "`${".length)); } else if (kind === SyntaxKind.RegularExpressionLiteral) { return regularExpressionValue(text); } else if (kind === SyntaxKind.EndOfFileToken || kind === SyntaxKind.ErrorToken) { - return null; + return undefined; } else { throw Errors.invalidOperation(); @@ -121,7 +124,19 @@ module TypeScript { export function tokenValueText(token: ISyntaxToken): string { var value = tokenValue(token); - return value === null ? "" : massageDisallowedIdentifiers(value.toString()); + return value === undefined ? "" : massageDisallowedIdentifiers(value.toString()); + } + + function massageTemplate(text: string): string { + // First, convert all carriage-return newlines into line-feed newlines. This is due to: + // + // The TRV of LineTerminatorSequence :: is the code unit value 0x000A. + // ... + // The TRV of LineTerminatorSequence :: is the sequence consisting of the code unit value 0x000A. + text = text.replace("\r\n", "\n").replace("\r", "\n"); + + // Now remove any escape characters that may be in the string. + return massageEscapes(text); } export function massageEscapes(text: string): string { @@ -136,7 +151,7 @@ module TypeScript { return new RegExp(body, flags); } catch (e) { - return null; + return undefined; } } @@ -235,13 +250,13 @@ module TypeScript { characterArray.push(ch); if (i && !(i % 1024)) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); + result = result.concat(String.fromCharCode.apply(undefined, characterArray)); characterArray.length = 0; } } if (characterArray.length) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); + result = result.concat(String.fromCharCode.apply(undefined, characterArray)); } return result; @@ -264,7 +279,7 @@ module TypeScript { module TypeScript.Syntax { export function realizeToken(token: ISyntaxToken, text: ISimpleText): ISyntaxToken { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), token.trailingTrivia(text)); + return new RealizedToken(token.fullStart(), token.kind, token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text()); } export function convertKeywordToIdentifier(token: ISyntaxToken): ISyntaxToken { @@ -272,33 +287,30 @@ module TypeScript.Syntax { } export function withLeadingTrivia(token: ISyntaxToken, leadingTrivia: ISyntaxTriviaList, text: ISimpleText): ISyntaxToken { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text(), token.trailingTrivia(text)); + return new RealizedToken(token.fullStart(), token.kind, token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text()); } - export function withTrailingTrivia(token: ISyntaxToken, trailingTrivia: ISyntaxTriviaList, text: ISimpleText): ISyntaxToken { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), trailingTrivia); - } - - export function emptyToken(kind: SyntaxKind): ISyntaxToken { - return new EmptyToken(kind); + export function emptyToken(kind: SyntaxKind, fullStart: number): ISyntaxToken { + return new EmptyToken(kind, fullStart); } class EmptyToken implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; - constructor(private _kind: SyntaxKind) { + public parent: ISyntaxElement; + public childCount: number; + + constructor(public kind: SyntaxKind, private _fullStart: number) { } public setFullStart(fullStart: number): void { - // An empty token is always at the -1 position. + this._fullStart = fullStart; } - public kind(): SyntaxKind { - return this._kind; - } + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public clone(): ISyntaxToken { - return new EmptyToken(this.kind()); + return new EmptyToken(this.kind, this._fullStart); } // Empty tokens are never incrementally reusable. @@ -309,135 +321,56 @@ module TypeScript.Syntax { } public fullWidth() { return 0; } - - private position(): number { - // It's hard for us to tell the position of an empty token at the eact time we create - // it. For example, we may have: - // - // a / finally - // - // There will be a missing token detected after the forward slash, so it would be - // tempting to set its position as the full-end of hte slash token. However, - // immediately after that, the 'finally' token will be skipped and will be attached - // as skipped text to the forward slash. This means the 'full-end' of the forward - // slash will change, and thus the empty token will now appear to be embedded inside - // another token. This violates are rule that all tokens must only touch at the end, - // and makes enforcing invariants much harder. - // - // To address this we create the empty token with no known position, and then we - // determine what it's position should be based on where it lies in the tree. - // Specifically, we find the previous non-zero-width syntax element, and we consider - // the full-start of this token to be at the full-end of that element. - - var previousElement = this.previousNonZeroWidthElement(); - return previousElement === null ? 0 : fullStart(previousElement) + fullWidth(previousElement); - } - - private previousNonZeroWidthElement(): ISyntaxElement { - var current: ISyntaxElement = this; - while (true) { - var parent = current.parent; - if (parent === null) { - Debug.assert(current.kind() === SyntaxKind.SourceUnit, "We had a node without a parent that was not the root node!"); - - // We walked all the way to the top, and never found a previous element. This - // can happen with code like: - // - // / b; - // - // We will have an empty identifier token as the first token in the tree. In - // this case, return null so that the position of the empty token will be - // considered to be 0. - return null; - } - - // Ok. We have a parent. First, find out which slot we're at in the parent. - for (var i = 0, n = childCount(parent); i < n; i++) { - if (childAt(parent, i) === current) { - break; - } - } - - Debug.assert(i !== n, "Could not find current element in parent's child list!"); - - // Walk backward from this element, looking for a non-zero-width sibling. - for (var j = i - 1; j >= 0; j--) { - var sibling = childAt(parent, j); - if (sibling && fullWidth(sibling) > 0) { - return sibling; - } - } - - // We couldn't find a non-zero-width sibling. We were either the first element, or - // all preceding elements are empty. So, move up to our parent so we we can find - // its preceding sibling. - current = current.parent; - } - } - - public fullStart(): number { - return this.position(); - } + public fullStart(): number { return this._fullStart; } public text() { return ""; } public fullText(): string { return ""; } public hasLeadingTrivia() { return false; } - public hasTrailingTrivia() { return false; } + public hasLeadingNewLine() { return false; } public hasLeadingComment() { return false; } - public hasTrailingComment() { return false; } - public hasSkippedToken() { return false; } + public hasLeadingSkippedToken() { return false; } public leadingTriviaWidth() { return 0; } - public trailingTriviaWidth() { return 0; } - public leadingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } - public trailingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } } + EmptyToken.prototype.childCount = 0; class RealizedToken implements ISyntaxToken { + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + private _fullStart: number; - private _kind: SyntaxKind; private _isKeywordConvertedToIdentifier: boolean; private _leadingTrivia: ISyntaxTriviaList; private _text: string; - private _trailingTrivia: ISyntaxTriviaList; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; + public parent: ISyntaxElement; + public childCount: number; constructor(fullStart: number, - kind: SyntaxKind, - isKeywordConvertedToIdentifier: boolean, - leadingTrivia: ISyntaxTriviaList, - text: string, - trailingTrivia: ISyntaxTriviaList) { + public kind: SyntaxKind, + isKeywordConvertedToIdentifier: boolean, + leadingTrivia: ISyntaxTriviaList, + text: string) { this._fullStart = fullStart; - this._kind = kind; this._isKeywordConvertedToIdentifier = isKeywordConvertedToIdentifier; this._text = text; this._leadingTrivia = leadingTrivia.clone(); - this._trailingTrivia = trailingTrivia.clone(); if (!this._leadingTrivia.isShared()) { this._leadingTrivia.parent = this; } - - if (!this._trailingTrivia.isShared()) { - this._trailingTrivia.parent = this; - } } public setFullStart(fullStart: number): void { this._fullStart = fullStart; } - public kind(): SyntaxKind { - return this._kind; - } + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public clone(): ISyntaxToken { - return new RealizedToken(this._fullStart, this.kind(), this._isKeywordConvertedToIdentifier, this._leadingTrivia, this._text, this._trailingTrivia); + return new RealizedToken(this._fullStart, this.kind, this._isKeywordConvertedToIdentifier, this._leadingTrivia, this._text); } // Realized tokens are created from the parser. They are *never* incrementally reusable. @@ -448,39 +381,37 @@ module TypeScript.Syntax { } public fullStart(): number { return this._fullStart; } - public fullWidth(): number { return this._leadingTrivia.fullWidth() + this._text.length + this._trailingTrivia.fullWidth(); } + public fullWidth(): number { return this._leadingTrivia.fullWidth() + this._text.length; } public text(): string { return this._text; } - public fullText(): string { return this._leadingTrivia.fullText() + this.text() + this._trailingTrivia.fullText(); } + public fullText(): string { return this._leadingTrivia.fullText() + this.text(); } public hasLeadingTrivia(): boolean { return this._leadingTrivia.count() > 0; } - public hasTrailingTrivia(): boolean { return this._trailingTrivia.count() > 0; } + public hasLeadingNewLine(): boolean { return this._leadingTrivia.hasNewLine(); } public hasLeadingComment(): boolean { return this._leadingTrivia.hasComment(); } - public hasTrailingComment(): boolean { return this._trailingTrivia.hasComment(); } - - public leadingTriviaWidth(): number { return this._leadingTrivia.fullWidth(); } - public trailingTriviaWidth(): number { return this._trailingTrivia.fullWidth(); } - - public hasSkippedToken(): boolean { return this._leadingTrivia.hasSkippedToken() || this._trailingTrivia.hasSkippedToken(); } + public hasLeadingSkippedToken(): boolean { return this._leadingTrivia.hasSkippedToken(); } public leadingTrivia(): ISyntaxTriviaList { return this._leadingTrivia; } - public trailingTrivia(): ISyntaxTriviaList { return this._trailingTrivia; } + public leadingTriviaWidth(): number { return this._leadingTrivia.fullWidth(); } } + RealizedToken.prototype.childCount = 0; class ConvertedKeywordToken implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + + public parent: ISyntaxElement; + public kind: SyntaxKind; + public childCount: number; constructor(private underlyingToken: ISyntaxToken) { } - public kind() { - return SyntaxKind.IdentifierName; - } - public setFullStart(fullStart: number): void { this.underlyingToken.setFullStart(fullStart); } + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } + public fullStart(): number { return this.underlyingToken.fullStart(); } @@ -503,25 +434,10 @@ module TypeScript.Syntax { return this.underlyingToken.fullText(this.syntaxTreeText(text)); } - public hasLeadingTrivia(): boolean { - return this.underlyingToken.hasLeadingTrivia(); - } - - public hasTrailingTrivia(): boolean { - return this.underlyingToken.hasTrailingTrivia(); - } - - public hasLeadingComment(): boolean { - return this.underlyingToken.hasLeadingComment(); - } - - public hasTrailingComment(): boolean { - return this.underlyingToken.hasTrailingComment(); - } - - public hasSkippedToken(): boolean { - return this.underlyingToken.hasSkippedToken(); - } + public hasLeadingTrivia(): boolean { return this.underlyingToken.hasLeadingTrivia(); } + public hasLeadingNewLine(): boolean { return this.underlyingToken.hasLeadingNewLine(); } + public hasLeadingComment(): boolean { return this.underlyingToken.hasLeadingComment(); } + public hasLeadingSkippedToken(): boolean { return this.underlyingToken.hasLeadingSkippedToken(); } public leadingTrivia(text?: ISimpleText): ISyntaxTriviaList { var result = this.underlyingToken.leadingTrivia(this.syntaxTreeText(text)); @@ -529,20 +445,10 @@ module TypeScript.Syntax { return result; } - public trailingTrivia(text?: ISimpleText): ISyntaxTriviaList { - var result = this.underlyingToken.trailingTrivia(this.syntaxTreeText(text)); - result.parent = this; - return result; - } - public leadingTriviaWidth(text?: ISimpleText): number { return this.underlyingToken.leadingTriviaWidth(this.syntaxTreeText(text)); } - public trailingTriviaWidth(text?: ISimpleText): number { - return this.underlyingToken.trailingTriviaWidth(this.syntaxTreeText(text)); - } - public isKeywordConvertedToIdentifier(): boolean { return true; } @@ -559,4 +465,6 @@ module TypeScript.Syntax { return new ConvertedKeywordToken(this.underlyingToken); } } + ConvertedKeywordToken.prototype.kind = SyntaxKind.IdentifierName; + ConvertedKeywordToken.prototype.childCount = 0; } \ No newline at end of file diff --git a/src/services/syntax/syntaxTree.ts b/src/services/syntax/syntaxTree.ts index de4c4cf7add..cf20d2b1c75 100644 --- a/src/services/syntax/syntaxTree.ts +++ b/src/services/syntax/syntaxTree.ts @@ -4,11 +4,10 @@ module TypeScript { export var syntaxDiagnosticsTime: number = 0; export class SyntaxTree { - private _isConcrete: boolean; private _sourceUnit: SourceUnitSyntax; private _isDeclaration: boolean; private _parserDiagnostics: Diagnostic[]; - private _allDiagnostics: Diagnostic[] = null; + private _allDiagnostics: Diagnostic[] = undefined; private _fileName: string; private _lineMap: LineMap; private _languageVersion: ts.ScriptTarget; @@ -17,14 +16,12 @@ module TypeScript { private _amdDependencies: string[]; private _isExternalModule: boolean; - constructor(isConcrete: boolean, - sourceUnit: SourceUnitSyntax, + constructor(sourceUnit: SourceUnitSyntax, isDeclaration: boolean, diagnostics: Diagnostic[], fileName: string, public text: ISimpleText, languageVersion: ts.ScriptTarget) { - this._isConcrete = isConcrete; this._sourceUnit = sourceUnit; this._isDeclaration = isDeclaration; this._parserDiagnostics = diagnostics; @@ -35,10 +32,6 @@ module TypeScript { sourceUnit.syntaxTree = this; } - public isConcrete(): boolean { - return this._isConcrete; - } - public sourceUnit(): SourceUnitSyntax { return this._sourceUnit; } @@ -60,7 +53,7 @@ module TypeScript { } public diagnostics(): Diagnostic[] { - if (this._allDiagnostics === null) { + if (!this._allDiagnostics) { var start = new Date().getTime(); this._allDiagnostics = this.computeDiagnostics(); syntaxDiagnosticsTime += new Date().getTime() - start; @@ -84,11 +77,10 @@ module TypeScript { private cacheSyntaxTreeInfo(): void { // If we're not keeping around the syntax tree, store the diagnostics and line // map so they don't have to be recomputed. - var sourceUnit = this.sourceUnit(); var firstToken = firstSyntaxTreeToken(this); var leadingTrivia = firstToken.leadingTrivia(this.text); - this._isExternalModule = externalModuleIndicatorSpanWorker(this, firstToken) !== null; + this._isExternalModule = !!externalModuleIndicatorSpanWorker(this, firstToken); var amdDependencies: string[] = []; for (var i = 0, n = leadingTrivia.count(); i < n; i++) { @@ -107,7 +99,7 @@ module TypeScript { private getAmdDependency(comment: string): string { var amdDependencyRegEx = /^\/\/\/\s* 0) { return false; } @@ -288,7 +284,7 @@ module TypeScript { public visitHeritageClause(node: HeritageClauseSyntax): void { if (this.checkForTrailingComma(node.typeNames) || - this.checkForAtLeastOneElement(node, node.typeNames, node.extendsOrImplementsKeyword, SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind()))) { + this.checkForAtLeastOneElement(node.typeNames, node.extendsOrImplementsKeyword, SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind))) { return; } @@ -304,7 +300,7 @@ module TypeScript { } public visitVariableDeclaration(node: VariableDeclarationSyntax): void { - if (this.checkForAtLeastOneElement(node, node.variableDeclarators, node.varKeyword, getLocalizedText(DiagnosticCode.variable_declaration, null)) || + if (this.checkForAtLeastOneElement(node.variableDeclarators, node.varKeyword, getLocalizedText(DiagnosticCode.variable_declaration, undefined)) || this.checkForTrailingComma(node.variableDeclarators)) { return; } @@ -314,16 +310,25 @@ module TypeScript { public visitTypeArgumentList(node: TypeArgumentListSyntax): void { if (this.checkForTrailingComma(node.typeArguments) || - this.checkForAtLeastOneElement(node, node.typeArguments, node.lessThanToken, getLocalizedText(DiagnosticCode.type_argument, null))) { + this.checkForAtLeastOneElement(node.typeArguments, node.lessThanToken, getLocalizedText(DiagnosticCode.type_argument, undefined))) { return; } super.visitTypeArgumentList(node); } + public visitTupleType(node: TupleTypeSyntax): void { + if (this.checkForTrailingComma(node.types) || + this.checkForAtLeastOneElement(node.types, node.openBracketToken, getLocalizedText(DiagnosticCode.type, undefined))) { + return + } + + super.visitTupleType(node); + } + public visitTypeParameterList(node: TypeParameterListSyntax): void { if (this.checkForTrailingComma(node.typeParameters) || - this.checkForAtLeastOneElement(node, node.typeParameters, node.lessThanToken, getLocalizedText(DiagnosticCode.type_parameter, null))) { + this.checkForAtLeastOneElement(node.typeParameters, node.lessThanToken, getLocalizedText(DiagnosticCode.type_parameter, undefined))) { return; } @@ -336,7 +341,7 @@ module TypeScript { return true; } - var parameter = node.parameters[0]; + var parameter = nonSeparatorAt(node.parameters, 0); if (parameter.dotDotDotToken) { this.pushDiagnostic(parameter, DiagnosticCode.Index_signatures_cannot_have_rest_parameters); @@ -358,8 +363,8 @@ module TypeScript { this.pushDiagnostic(parameter, DiagnosticCode.Index_signature_parameter_must_have_a_type_annotation); return true; } - else if (parameter.typeAnnotation.type.kind() !== SyntaxKind.StringKeyword && - parameter.typeAnnotation.type.kind() !== SyntaxKind.NumberKeyword) { + else if (parameter.typeAnnotation.type.kind !== SyntaxKind.StringKeyword && + parameter.typeAnnotation.type.kind !== SyntaxKind.NumberKeyword) { this.pushDiagnostic(parameter, DiagnosticCode.Index_signature_parameter_type_must_be_string_or_number); return true; } @@ -388,7 +393,7 @@ module TypeScript { Debug.assert(i <= 2); var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword) { + if (heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ExtendsKeyword) { if (seenExtendsClause) { this.pushDiagnostic(heritageClause, DiagnosticCode.extends_clause_already_seen); return true; @@ -399,7 +404,7 @@ module TypeScript { return true; } - if (heritageClause.typeNames.length > 1) { + if (nonSeparatorCount(heritageClause.typeNames) > 1) { this.pushDiagnostic(heritageClause, DiagnosticCode.Classes_can_only_extend_a_single_class); return true; } @@ -407,7 +412,7 @@ module TypeScript { seenExtendsClause = true; } else { - Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ImplementsKeyword); + Debug.assert(heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ImplementsKeyword); if (seenImplementsClause) { this.pushDiagnostic(heritageClause, DiagnosticCode.implements_clause_already_seen); return true; @@ -467,7 +472,7 @@ module TypeScript { Debug.assert(i <= 1); var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword) { + if (heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ExtendsKeyword) { if (seenExtendsClause) { this.pushDiagnostic(heritageClause, DiagnosticCode.extends_clause_already_seen); return true; @@ -476,7 +481,7 @@ module TypeScript { seenExtendsClause = true; } else { - Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ImplementsKeyword); + Debug.assert(heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ImplementsKeyword); this.pushDiagnostic(heritageClause, DiagnosticCode.Interface_declaration_cannot_have_implements_clause); return true; } @@ -488,7 +493,7 @@ module TypeScript { private checkInterfaceModifiers(modifiers: ISyntaxToken[]): boolean { for (var i = 0, n = modifiers.length; i < n; i++) { var modifier = modifiers[i]; - if (modifier.kind() === SyntaxKind.DeclareKeyword) { + if (modifier.kind === SyntaxKind.DeclareKeyword) { this.pushDiagnostic(modifier, DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_interface_declaration); return true; @@ -515,9 +520,7 @@ module TypeScript { for (var i = 0, n = list.length; i < n; i++) { var modifier = list[i]; - if (modifier.kind() === SyntaxKind.PublicKeyword || - modifier.kind() === SyntaxKind.PrivateKeyword) { - + if (SyntaxFacts.isAccessibilityModifier(modifier.kind)) { if (seenAccessibilityModifier) { this.pushDiagnostic(modifier, DiagnosticCode.Accessibility_modifier_already_seen); return true; @@ -531,7 +534,7 @@ module TypeScript { seenAccessibilityModifier = true; } - else if (modifier.kind() === SyntaxKind.StaticKeyword) { + else if (modifier.kind === SyntaxKind.StaticKeyword) { if (seenStaticModifier) { this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_already_seen, [modifier.text()]); return true; @@ -556,8 +559,27 @@ module TypeScript { super.visitMemberVariableDeclaration(node); } + public visitMethodSignature(node: MethodSignatureSyntax): void { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForDisallowedComputedPropertyName(node.propertyName)) { + return; + } + + super.visitMethodSignature(node); + } + + public visitPropertySignature(node: PropertySignatureSyntax): void { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForDisallowedComputedPropertyName(node.propertyName)) { + return; + } + + super.visitPropertySignature(node); + } + public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void { - if (this.checkClassElementModifiers(node.modifiers)) { + if (this.checkClassElementModifiers(node.modifiers) || + this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } @@ -583,14 +605,14 @@ module TypeScript { private checkIndexMemberModifiers(node: IndexMemberDeclarationSyntax): boolean { if (node.modifiers.length > 0) { - this.pushDiagnostic(childAt(node.modifiers, 0), DiagnosticCode.Modifiers_cannot_appear_here); + this.pushDiagnostic(node.modifiers[0], DiagnosticCode.Modifiers_cannot_appear_here); return true; } return false; } - private checkEcmaScriptVersionIsAtLeast(parent: ISyntaxElement, reportToken: ISyntaxToken, languageVersion: ts.ScriptTarget, diagnosticKey: string): boolean { + private checkEcmaScriptVersionIsAtLeast(reportToken: ISyntaxToken, languageVersion: ts.ScriptTarget, diagnosticKey: string): boolean { if (this.syntaxTree.languageVersion() < languageVersion) { this.pushDiagnostic(reportToken, diagnosticKey); return true; @@ -608,17 +630,32 @@ module TypeScript { public visitGetAccessor(node: GetAccessorSyntax): void { if (this.checkForAccessorDeclarationInAmbientContext(node) || - this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, ts.ScriptTarget.ES5, DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || - this.checkForDisallowedModifiers(node, node.modifiers) || + this.checkEcmaScriptVersionIsAtLeast(node.getKeyword, ts.ScriptTarget.ES5, DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || + this.checkForDisallowedModifiers(node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || - this.checkGetAccessorParameter(node)) { + this.checkGetAccessorParameter(node) || + this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForSemicolonInsteadOfBlock(node, node.body)) { return; } super.visitGetAccessor(node); } + private checkForSemicolonInsteadOfBlock(parent: ISyntaxNode, node: BlockSyntax | ExpressionBody | ISyntaxToken): boolean { + if (node === undefined) { + this.pushDiagnosticAt(fullEnd(parent), 0, DiagnosticCode._0_expected, ["{"]); + return true; + } + else if (node.kind === SyntaxKind.SemicolonToken) { + this.pushDiagnostic(node, DiagnosticCode._0_expected, ["{"]); + return true; + } + + return false; + } + private checkForDisallowedSetAccessorTypeAnnotation(accessor: SetAccessorSyntax): boolean { if (accessor.callSignature.typeAnnotation) { this.pushDiagnostic(accessor.callSignature.typeAnnotation, DiagnosticCode.Type_annotation_cannot_appear_on_a_set_accessor); @@ -629,7 +666,7 @@ module TypeScript { } private checkForDisallowedAccessorTypeParameters(callSignature: CallSignatureSyntax): boolean { - if (callSignature.typeParameterList !== null) { + if (callSignature.typeParameterList) { this.pushDiagnostic(callSignature.typeParameterList, DiagnosticCode.Type_parameters_cannot_appear_on_an_accessor); return true; } @@ -648,12 +685,12 @@ module TypeScript { private checkSetAccessorParameter(node: SetAccessorSyntax): boolean { var parameters = node.callSignature.parameterList.parameters; - if (childCount(parameters) !== 1) { + if (nonSeparatorCount(parameters) !== 1) { this.pushDiagnostic(node.propertyName, DiagnosticCode.set_accessor_must_have_exactly_one_parameter); return true; } - var parameter = parameters[0]; + var parameter = nonSeparatorAt(parameters, 0); if (parameter.questionToken) { this.pushDiagnostic(parameter, DiagnosticCode.set_accessor_parameter_cannot_be_optional); @@ -673,20 +710,57 @@ module TypeScript { return false; } + public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName)) { + return; + } + + super.visitSimplePropertyAssignment(node); + } + public visitSetAccessor(node: SetAccessorSyntax): void { if (this.checkForAccessorDeclarationInAmbientContext(node) || - this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, ts.ScriptTarget.ES5, DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || - this.checkForDisallowedModifiers(node, node.modifiers) || + this.checkEcmaScriptVersionIsAtLeast(node.setKeyword, ts.ScriptTarget.ES5, DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || + this.checkForDisallowedModifiers(node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkForDisallowedSetAccessorTypeAnnotation(node) || - this.checkSetAccessorParameter(node)) { + this.checkSetAccessorParameter(node) || + this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForSemicolonInsteadOfBlock(node, node.body)) { return; } super.visitSetAccessor(node); } + public visitElementAccessExpression(node: ElementAccessExpressionSyntax): void { + if (this.checkForMissingArgumentExpression(node)) { + return; + } + + super.visitElementAccessExpression(node); + } + + public checkForMissingArgumentExpression(node: ElementAccessExpressionSyntax): boolean { + if (node.argumentExpression === undefined) { + if (node.parent.kind === SyntaxKind.ObjectCreationExpression && (node.parent).expression === node) { + // Provide a specialized message for the very common case where someone writes: + // new Foo[] + var start = TypeScript.start(node.openBracketToken); + var end = TypeScript.fullEnd(node.closeBracketToken); + this.pushDiagnosticAt(start, end - start, DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + else { + this.pushDiagnostic(node.closeBracketToken, DiagnosticCode.Expression_expected); + } + + return true; + } + + return false; + } + public visitEnumDeclaration(node: EnumDeclarationSyntax): void { if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || @@ -704,28 +778,28 @@ module TypeScript { private checkEnumElements(node: EnumDeclarationSyntax): boolean { var previousValueWasComputed = false; - for (var i = 0, n = childCount(node.enumElements); i < n; i++) { - var child = childAt(node.enumElements, i); + for (var i = 0, n = nonSeparatorCount(node.enumElements); i < n; i++) { + var enumElement = nonSeparatorAt(node.enumElements, i); - if (i % 2 === 0) { - var enumElement = child; + if (!enumElement.equalsValueClause && previousValueWasComputed) { + this.pushDiagnostic(enumElement, DiagnosticCode.Enum_member_must_have_initializer); + return true; + } - if (!enumElement.equalsValueClause && previousValueWasComputed) { - this.pushDiagnostic(enumElement, DiagnosticCode.Enum_member_must_have_initializer); - return true; - } - - if (enumElement.equalsValueClause) { - var value = enumElement.equalsValueClause.value; - previousValueWasComputed = !Syntax.isIntegerLiteral(value); - } + if (enumElement.equalsValueClause) { + var value = enumElement.equalsValueClause.value; + previousValueWasComputed = !Syntax.isIntegerLiteral(value); } } - return false; } public visitEnumElement(node: EnumElementSyntax): void { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForDisallowedComputedPropertyName(node.propertyName)) { + return; + } + if (this.inAmbientDeclaration && node.equalsValueClause) { var expression = node.equalsValueClause.value; if (!Syntax.isIntegerLiteral(expression)) { @@ -738,8 +812,8 @@ module TypeScript { } public visitInvocationExpression(node: InvocationExpressionSyntax): void { - if (node.expression.kind() === SyntaxKind.SuperKeyword && - node.argumentList.typeArgumentList !== null) { + if (node.expression.kind === SyntaxKind.SuperKeyword && + node.argumentList.typeArgumentList) { this.pushDiagnostic(node, DiagnosticCode.super_invocation_cannot_have_type_arguments); } @@ -752,14 +826,13 @@ module TypeScript { for (var i = 0, n = modifiers.length; i < n; i++) { var modifier = modifiers[i]; - if (modifier.kind() === SyntaxKind.PublicKeyword || - modifier.kind() === SyntaxKind.PrivateKeyword || - modifier.kind() === SyntaxKind.StaticKeyword) { + if (SyntaxFacts.isAccessibilityModifier(modifier.kind) || + modifier.kind === SyntaxKind.StaticKeyword) { this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_cannot_appear_on_a_module_element, [modifier.text()]); return true; } - if (modifier.kind() === SyntaxKind.DeclareKeyword) { + if (modifier.kind === SyntaxKind.DeclareKeyword) { if (seenDeclareModifier) { this.pushDiagnostic(modifier, DiagnosticCode.Accessibility_modifier_already_seen); return; @@ -767,7 +840,7 @@ module TypeScript { seenDeclareModifier = true; } - else if (modifier.kind() === SyntaxKind.ExportKeyword) { + else if (modifier.kind === SyntaxKind.ExportKeyword) { if (seenExportModifier) { this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_already_seen, [modifier.text()]); return; @@ -787,12 +860,12 @@ module TypeScript { } private checkForDisallowedImportDeclaration(node: ModuleDeclarationSyntax): boolean { - if (!node.stringLiteral) { + if (node.name.kind !== SyntaxKind.StringLiteral) { for (var i = 0, n = node.moduleElements.length; i < n; i++) { var child = node.moduleElements[i]; - if (child.kind() === SyntaxKind.ImportDeclaration) { + if (child.kind === SyntaxKind.ImportDeclaration) { var importDeclaration = child; - if (importDeclaration.moduleReference.kind() === SyntaxKind.ExternalModuleReference) { + if (importDeclaration.moduleReference.kind === SyntaxKind.ExternalModuleReference) { this.pushDiagnostic(importDeclaration, DiagnosticCode.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } } @@ -822,21 +895,21 @@ module TypeScript { public visitModuleDeclaration(node: ModuleDeclarationSyntax): void { if (this.checkForDisallowedDeclareModifier(node.modifiers) || - this.checkForRequiredDeclareModifier(node, node.stringLiteral ? node.stringLiteral : firstToken(node.name), node.modifiers) || + this.checkForRequiredDeclareModifier(node, firstToken(node.name), node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedImportDeclaration(node)) { return; } - if (node.stringLiteral) { + if (node.name.kind === SyntaxKind.StringLiteral) { if (!this.inAmbientDeclaration && !SyntaxUtilities.containsToken(node.modifiers, SyntaxKind.DeclareKeyword)) { - this.pushDiagnostic(node.stringLiteral, DiagnosticCode.Only_ambient_modules_can_use_quoted_names); + this.pushDiagnostic(node.name, DiagnosticCode.Only_ambient_modules_can_use_quoted_names); return; } } - if (!node.stringLiteral && this.checkForDisallowedExportAssignment(node)) { + if (node.name.kind !== SyntaxKind.StringLiteral && this.checkForDisallowedExportAssignment(node)) { return; } @@ -850,7 +923,7 @@ module TypeScript { for (var i = 0, n = node.moduleElements.length; i < n; i++) { var child = node.moduleElements[i]; - if (child.kind() === SyntaxKind.ExportAssignment) { + if (child.kind === SyntaxKind.ExportAssignment) { this.pushDiagnostic(child, DiagnosticCode.Export_assignment_cannot_be_used_in_internal_modules); return true; } @@ -860,7 +933,8 @@ module TypeScript { } public visitBlock(node: BlockSyntax): void { - if (this.checkForBlockInAmbientContext(node)) { + if (this.checkForBlockInAmbientContext(node) || + this.checkForMalformedBlock(node)) { return; } @@ -870,11 +944,20 @@ module TypeScript { this.inBlock = savedInBlock; } + public checkForMalformedBlock(node: BlockSyntax): boolean { + if (node.equalsGreaterThanToken || node.openBraceToken === undefined) { + this.pushDiagnostic(firstToken(node), DiagnosticCode._0_expected, ["{"]); + return true; + } + + return false; + } + private checkForBlockInAmbientContext(node: BlockSyntax): boolean { if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { // Provide a specialized message for a block as a statement versus the block as a // function body. - if (node.parent.kind() === SyntaxKind.List) { + if (node.parent.kind === SyntaxKind.List) { this.pushDiagnostic(firstToken(node), DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); } else { @@ -896,6 +979,11 @@ module TypeScript { return false; } + public visitExpressionBody(node: ExpressionBody): void { + // These are always errors. So no need to ever recurse on them. + this.pushDiagnostic(node.equalsGreaterThanToken, DiagnosticCode._0_expected, ["{"]); + } + public visitBreakStatement(node: BreakStatementSyntax): void { if (this.checkForStatementInAmbientContxt(node) || this.checkBreakStatementTarget(node)) { @@ -955,7 +1043,7 @@ module TypeScript { private inSwitchStatement(ast: ISyntaxElement): boolean { while (ast) { - if (ast.kind() === SyntaxKind.SwitchStatement) { + if (ast.kind === SyntaxKind.SwitchStatement) { return true; } @@ -970,7 +1058,7 @@ module TypeScript { } private isIterationStatement(ast: ISyntaxElement): boolean { - switch (ast.kind()) { + switch (ast.kind) { case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.WhileStatement: @@ -1002,7 +1090,7 @@ module TypeScript { element = element.parent; while (element) { - if (element.kind() === SyntaxKind.LabeledStatement) { + if (element.kind === SyntaxKind.LabeledStatement) { var labeledStatement = element; if (breakable) { // Breakable labels can be placed on any construct @@ -1028,7 +1116,7 @@ module TypeScript { } private labelIsOnContinuableConstruct(statement: ISyntaxElement): boolean { - switch (statement.kind()) { + switch (statement.kind) { case SyntaxKind.LabeledStatement: // Labels work transitively. i.e. if you have: // foo: @@ -1131,7 +1219,7 @@ module TypeScript { } private checkForInLeftHandSideExpression(node: ForInStatementSyntax): boolean { - if (node.left && !SyntaxUtilities.isLeftHandSizeExpression(node.left)) { + if (node.left.kind !== SyntaxKind.VariableDeclaration && !SyntaxUtilities.isLeftHandSizeExpression(node.left)) { this.pushDiagnostic(node.left, DiagnosticCode.Invalid_left_hand_side_in_for_in_statement); return true; } @@ -1143,8 +1231,8 @@ module TypeScript { // The parser accepts a Variable Declaration in a ForInStatement, but the grammar only // allows a very restricted form. Specifically, there must be only a single Variable // Declarator in the Declaration. - if (node.variableDeclaration && node.variableDeclaration.variableDeclarators.length > 1) { - this.pushDiagnostic(node.variableDeclaration, DiagnosticCode.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + if (node.left.kind === SyntaxKind.VariableDeclaration && (node.left).variableDeclarators.length > 1) { + this.pushDiagnostic(node.left, DiagnosticCode.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); return true; } @@ -1237,13 +1325,23 @@ module TypeScript { } public visitThrowStatement(node: ThrowStatementSyntax): void { - if (this.checkForStatementInAmbientContxt(node)) { + if (this.checkForStatementInAmbientContxt(node) || + this.checkForMissingThrowStatementExpression(node)) { return; } super.visitThrowStatement(node); } + public checkForMissingThrowStatementExpression(node: ThrowStatementSyntax): boolean { + if (node.expression === undefined) { + this.pushDiagnosticAt(fullEnd(node.throwKeyword), 0, DiagnosticCode.Expression_expected); + return true; + } + + return false; + } + public visitTryStatement(node: TryStatementSyntax): void { if (this.checkForStatementInAmbientContxt(node)) { return; @@ -1270,7 +1368,7 @@ module TypeScript { } private checkForWithInStrictMode(node: WithStatementSyntax): boolean { - if (parsedInStrictMode(node)) { + if (parsedInStrictModeContext(node)) { this.pushDiagnostic(firstToken(node), DiagnosticCode.with_statements_are_not_allowed_in_strict_mode); return true; } @@ -1278,10 +1376,10 @@ module TypeScript { return false; } - private checkForDisallowedModifiers(parent: ISyntaxElement, modifiers: ISyntaxToken[]): boolean { + private checkForDisallowedModifiers(modifiers: ISyntaxToken[]): boolean { if (this.inBlock || this.inObjectLiteralExpression) { if (modifiers.length > 0) { - this.pushDiagnostic(childAt(modifiers, 0), DiagnosticCode.Modifiers_cannot_appear_here); + this.pushDiagnostic(modifiers[0], DiagnosticCode.Modifiers_cannot_appear_here); return true; } } @@ -1291,7 +1389,7 @@ module TypeScript { public visitFunctionDeclaration(node: FunctionDeclarationSyntax): void { if (this.checkForDisallowedDeclareModifier(node.modifiers) || - this.checkForDisallowedModifiers(node, node.modifiers) || + this.checkForDisallowedModifiers(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedEvalOrArguments(node, node.identifier)) { @@ -1306,16 +1404,26 @@ module TypeScript { } public visitFunctionExpression(node: FunctionExpressionSyntax): void { - if (this.checkForDisallowedEvalOrArguments(node, node.identifier)) { + if (this.checkForDisallowedEvalOrArguments(node, node.identifier) || + this.checkForSemicolonInsteadOfBlock(node, node.body)) { return; } super.visitFunctionExpression(node); } + public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForSemicolonInsteadOfBlock(node, node.body)) { + return; + } + + super.visitFunctionPropertyAssignment(node); + } + public visitVariableStatement(node: VariableStatementSyntax): void { if (this.checkForDisallowedDeclareModifier(node.modifiers) || - this.checkForDisallowedModifiers(node, node.modifiers) || + this.checkForDisallowedModifiers(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.variableDeclaration.varKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { @@ -1328,10 +1436,10 @@ module TypeScript { this.inAmbientDeclaration = savedInAmbientDeclaration; } - private checkListSeparators(parent: ISyntaxElement, list: T[], kind: SyntaxKind): boolean { - for (var i = 0, n = childCount(list); i < n; i++) { - var child = childAt(list, i); - if (i % 2 === 1 && child.kind() !== kind) { + private checkListSeparators(list: ISeparatedSyntaxList, kind: SyntaxKind): boolean { + for (var i = 0, n = separatorCount(list); i < n; i++) { + var child = separatorAt(list, i); + if (child.kind !== kind) { this.pushDiagnostic(child, DiagnosticCode._0_expected, [SyntaxFacts.getText(kind)]); } } @@ -1340,7 +1448,7 @@ module TypeScript { } public visitObjectType(node: ObjectTypeSyntax): void { - if (this.checkListSeparators(node, node.typeMembers, SyntaxKind.SemicolonToken)) { + if (this.checkListSeparators(node.typeMembers, SyntaxKind.SemicolonToken)) { return; } @@ -1377,16 +1485,36 @@ module TypeScript { public visitVariableDeclarator(node: VariableDeclaratorSyntax): void { if (this.checkVariableDeclaratorInitializer(node) || - this.checkVariableDeclaratorIdentifier(node)) { + this.checkVariableDeclaratorIdentifier(node) || + this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } super.visitVariableDeclarator(node); } + private checkForDisallowedTemplatePropertyName(propertyName: IPropertyNameSyntax): boolean { + if (propertyName.kind === SyntaxKind.NoSubstitutionTemplateToken) { + this.pushDiagnostic(propertyName, DiagnosticCode.Template_literal_cannot_be_used_as_an_element_name); + return true; + } + + return false; + } + + private checkForDisallowedComputedPropertyName(propertyName: IPropertyNameSyntax): boolean { + if (propertyName.kind === SyntaxKind.ComputedPropertyName) { + this.pushDiagnostic(propertyName, DiagnosticCode.Computed_property_names_cannot_be_used_here); + return true; + } + + return false; + } + private checkVariableDeclaratorIdentifier(node: VariableDeclaratorSyntax): boolean { - if (node.parent.kind() !== SyntaxKind.MemberVariableDeclaration) { - if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { + if (node.parent.kind !== SyntaxKind.MemberVariableDeclaration) { + Debug.assert(isToken(node.propertyName), "A normal variable declarator must always have a token for a name."); + if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { return true; } } @@ -1418,8 +1546,8 @@ module TypeScript { private checkConstructorModifiers(modifiers: ISyntaxToken[]): boolean { for (var i = 0, n = modifiers.length; i < n; i++) { var child = modifiers[i]; - if (child.kind() !== SyntaxKind.PublicKeyword) { - this.pushDiagnostic(child, DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [SyntaxFacts.getText(child.kind())]); + if (child.kind !== SyntaxKind.PublicKeyword) { + this.pushDiagnostic(child, DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [SyntaxFacts.getText(child.kind)]); return true; } } @@ -1454,7 +1582,7 @@ module TypeScript { } public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): void { - if (parsedInStrictMode(node) && this.isPreIncrementOrDecrementExpression(node) && this.isEvalOrArguments(node.operand)) { + if (parsedInStrictModeContext(node) && this.isPreIncrementOrDecrementExpression(node) && this.isEvalOrArguments(node.operand)) { this.pushDiagnostic(node.operatorToken, DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.operand)]); } @@ -1462,7 +1590,7 @@ module TypeScript { } public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): void { - if (parsedInStrictMode(node) && this.isEvalOrArguments(node.operand)) { + if (parsedInStrictModeContext(node) && this.isEvalOrArguments(node.operand)) { this.pushDiagnostic(node.operatorToken, DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.operand)]); } @@ -1479,7 +1607,7 @@ module TypeScript { private checkForDisallowedEvalOrArguments(node: ISyntaxNode, token: ISyntaxToken): boolean { if (token) { - if (parsedInStrictMode(node) && this.isEvalOrArguments(token)) { + if (parsedInStrictModeContext(node) && this.isEvalOrArguments(token)) { this.pushDiagnostic(token, DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(token)]); return true; } @@ -1489,9 +1617,9 @@ module TypeScript { } private isPreIncrementOrDecrementExpression(node: PrefixUnaryExpressionSyntax) { - switch (node.kind()) { - case SyntaxKind.PreDecrementExpression: - case SyntaxKind.PreIncrementExpression: + switch (node.operatorToken.kind) { + case SyntaxKind.MinusMinusToken: + case SyntaxKind.PlusPlusToken: return true; } @@ -1499,16 +1627,25 @@ module TypeScript { } public visitDeleteExpression(node: DeleteExpressionSyntax): void { - if (parsedInStrictMode(node) && node.expression.kind() === SyntaxKind.IdentifierName) { - this.pushDiagnostic(firstToken(node), DiagnosticCode.delete_cannot_be_called_on_an_identifier_in_strict_mode); + if (parsedInStrictModeContext(node) && node.expression.kind === SyntaxKind.IdentifierName) { + this.pushDiagnostic(node.deleteKeyword, DiagnosticCode.delete_cannot_be_called_on_an_identifier_in_strict_mode); return; } super.visitDeleteExpression(node); } + public visitYieldExpression(node: YieldExpressionSyntax): void { + if (!parsedInYieldContext(node)) { + this.pushDiagnostic(node.yieldKeyword, DiagnosticCode.yield_expression_must_be_contained_within_a_generator_declaration); + return; + } + + super.visitYieldExpression(node); + } + private checkIllegalAssignment(node: BinaryExpressionSyntax): boolean { - if (parsedInStrictMode(node) && SyntaxFacts.isAssignmentOperatorToken(node.operatorToken.kind()) && this.isEvalOrArguments(node.left)) { + if (parsedInStrictModeContext(node) && SyntaxFacts.isAssignmentOperatorToken(node.operatorToken.kind) && this.isEvalOrArguments(node.left)) { this.pushDiagnostic(node.operatorToken, DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.left)]); return true; } @@ -1517,18 +1654,18 @@ module TypeScript { } private getEvalOrArguments(expr: IExpressionSyntax): string { - if (expr.kind() === SyntaxKind.IdentifierName) { + if (expr.kind === SyntaxKind.IdentifierName) { var text = tokenValueText(expr); if (text === "eval" || text === "arguments") { return text; } } - return null; + return undefined; } private isEvalOrArguments(expr: IExpressionSyntax): boolean { - return this.getEvalOrArguments(expr) !== null; + return !!this.getEvalOrArguments(expr); } public visitConstraint(node: ConstraintSyntax): void { @@ -1540,7 +1677,7 @@ module TypeScript { } private checkConstraintType(node: ConstraintSyntax): boolean { - if (!SyntaxFacts.isType(node.typeOrExpression.kind())) { + if (!SyntaxFacts.isType(node.typeOrExpression.kind)) { this.pushDiagnostic(node.typeOrExpression, DiagnosticCode.Type_expected); return true; } @@ -1578,7 +1715,7 @@ module TypeScript { } } - return null; + return undefined; } function implicitImportSpanWorker(trivia: ISyntaxTrivia): TextSpan { @@ -1589,7 +1726,7 @@ module TypeScript { return new TextSpan(trivia.fullStart(), trivia.fullWidth()); } - return null; + return undefined; } function topLevelImportOrExportSpan(node: SourceUnitSyntax): TextSpan { @@ -1597,19 +1734,19 @@ module TypeScript { var moduleElement = node.moduleElements[i]; var _firstToken = firstToken(moduleElement); - if (_firstToken !== null && _firstToken.kind() === SyntaxKind.ExportKeyword) { + if (_firstToken && _firstToken.kind === SyntaxKind.ExportKeyword) { return new TextSpan(start(_firstToken), width(_firstToken)); } - if (moduleElement.kind() === SyntaxKind.ImportDeclaration) { + if (moduleElement.kind === SyntaxKind.ImportDeclaration) { var importDecl = moduleElement; - if (importDecl.moduleReference.kind() === SyntaxKind.ExternalModuleReference) { + if (importDecl.moduleReference.kind === SyntaxKind.ExternalModuleReference) { var literal = (importDecl.moduleReference).stringLiteral; return new TextSpan(start(literal), width(literal)); } } } - return null; + return undefined; } } \ No newline at end of file diff --git a/src/services/syntax/syntaxTrivia.ts b/src/services/syntax/syntaxTrivia.ts index 1c8d79cf6bf..02162e19fa6 100644 --- a/src/services/syntax/syntaxTrivia.ts +++ b/src/services/syntax/syntaxTrivia.ts @@ -2,8 +2,8 @@ module TypeScript { export interface ISyntaxTrivia { - parent?: ISyntaxTriviaList; - kind(): SyntaxKind; + parent: ISyntaxTriviaList; + kind: SyntaxKind; isWhitespace(): boolean; isComment(): boolean; @@ -25,11 +25,9 @@ module TypeScript { module TypeScript.Syntax { class AbstractTrivia implements ISyntaxTrivia { - constructor(private _kind: SyntaxKind) { - } + public parent: ISyntaxTriviaList; - public kind(): SyntaxKind { - return this._kind; + constructor(public kind: SyntaxKind) { } public clone(): ISyntaxTrivia { @@ -53,19 +51,19 @@ module TypeScript.Syntax { } public isWhitespace(): boolean { - return this.kind() === SyntaxKind.WhitespaceTrivia; + return this.kind === SyntaxKind.WhitespaceTrivia; } public isComment(): boolean { - return this.kind() === SyntaxKind.SingleLineCommentTrivia || this.kind() === SyntaxKind.MultiLineCommentTrivia; + return this.kind === SyntaxKind.SingleLineCommentTrivia || this.kind === SyntaxKind.MultiLineCommentTrivia; } public isNewLine(): boolean { - return this.kind() === SyntaxKind.NewLineTrivia; + return this.kind === SyntaxKind.NewLineTrivia; } public isSkippedToken(): boolean { - return this.kind() === SyntaxKind.SkippedTokenTrivia; + return this.kind === SyntaxKind.SkippedTokenTrivia; } } @@ -103,7 +101,7 @@ module TypeScript.Syntax { } public clone(): ISyntaxTrivia { - return new DeferredTrivia(this.kind(), this._text, this._fullStart, this._fullWidth); + return new DeferredTrivia(this.kind, this._text, this._fullStart, this._fullWidth); } public fullStart(): number { @@ -129,7 +127,6 @@ module TypeScript.Syntax { export function skippedTokenTrivia(token: ISyntaxToken, text: ISimpleText): ISyntaxTrivia { Debug.assert(!token.hasLeadingTrivia()); - Debug.assert(!token.hasTrailingTrivia()); Debug.assert(token.fullWidth() > 0); return new SkippedTokenTrivia(token, token.fullText(text)); } @@ -150,7 +147,6 @@ module TypeScript.Syntax { // When we run into a newline for the first time, create the string builder and copy // all the values up to this newline into it. - var isCarriageReturnLineFeed = false; switch (ch) { case CharacterCodes.carriageReturn: if (i < triviaText.length - 1 && triviaText.charCodeAt(i + 1) === CharacterCodes.lineFeed) { diff --git a/src/services/syntax/syntaxTriviaList.ts b/src/services/syntax/syntaxTriviaList.ts index 937b66b129f..6794a823340 100644 --- a/src/services/syntax/syntaxTriviaList.ts +++ b/src/services/syntax/syntaxTriviaList.ts @@ -28,10 +28,6 @@ module TypeScript { module TypeScript.Syntax { class EmptyTriviaList implements ISyntaxTriviaList { - public kind() { - return SyntaxKind.TriviaList; - } - public isShared(): boolean { return true; } @@ -80,7 +76,7 @@ module TypeScript.Syntax { export var emptyTriviaList: ISyntaxTriviaList = new EmptyTriviaList(); function isComment(trivia: ISyntaxTrivia): boolean { - return trivia.kind() === SyntaxKind.MultiLineCommentTrivia || trivia.kind() === SyntaxKind.SingleLineCommentTrivia; + return trivia.kind === SyntaxKind.MultiLineCommentTrivia || trivia.kind === SyntaxKind.SingleLineCommentTrivia; } class SingletonSyntaxTriviaList implements ISyntaxTriviaList { @@ -91,10 +87,6 @@ module TypeScript.Syntax { this.item.parent = this; } - public kind() { - return SyntaxKind.TriviaList; - } - public isShared(): boolean { return false; } @@ -128,11 +120,11 @@ module TypeScript.Syntax { } public hasNewLine(): boolean { - return this.item.kind() === SyntaxKind.NewLineTrivia; + return this.item.kind === SyntaxKind.NewLineTrivia; } public hasSkippedToken(): boolean { - return this.item.kind() === SyntaxKind.SkippedTokenTrivia; + return this.item.kind === SyntaxKind.SkippedTokenTrivia; } public toArray(): ISyntaxTrivia[] { @@ -155,10 +147,6 @@ module TypeScript.Syntax { }); } - public kind() { - return SyntaxKind.TriviaList; - } - public isShared(): boolean { return false; } @@ -205,7 +193,7 @@ module TypeScript.Syntax { public hasNewLine(): boolean { for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === SyntaxKind.NewLineTrivia) { + if (this.trivia[i].kind === SyntaxKind.NewLineTrivia) { return true; } } @@ -215,7 +203,7 @@ module TypeScript.Syntax { public hasSkippedToken(): boolean { for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === SyntaxKind.SkippedTokenTrivia) { + if (this.trivia[i].kind === SyntaxKind.SkippedTokenTrivia) { return true; } } @@ -233,7 +221,7 @@ module TypeScript.Syntax { } export function triviaList(trivia: ISyntaxTrivia[]): ISyntaxTriviaList { - if (trivia === undefined || trivia === null || trivia.length === 0) { + if (!trivia || trivia.length === 0) { return Syntax.emptyTriviaList; } diff --git a/src/services/syntax/syntaxUtilities.ts b/src/services/syntax/syntaxUtilities.ts index c5e122e927b..8c799edb4d9 100644 --- a/src/services/syntax/syntaxUtilities.ts +++ b/src/services/syntax/syntaxUtilities.ts @@ -1,9 +1,19 @@ /// module TypeScript { - export class SyntaxUtilities { - public static isAnyFunctionExpressionOrDeclaration(ast: ISyntaxElement): boolean { - switch (ast.kind()) { + export function childCount(element: ISyntaxElement): number { + if (isList(element)) { return (element).length; } + return (element).childCount; + } + + export function childAt(element: ISyntaxElement, index: number): ISyntaxElement { + if (isList(element)) { return (element)[index]; } + return (element).childAt(index); + } + + export module SyntaxUtilities { + export function isAnyFunctionExpressionOrDeclaration(ast: ISyntaxElement): boolean { + switch (ast.kind) { case SyntaxKind.SimpleArrowFunctionExpression: case SyntaxKind.ParenthesizedArrowFunctionExpression: case SyntaxKind.FunctionExpression: @@ -19,24 +29,25 @@ module TypeScript { return false; } - public static isLastTokenOnLine(token: ISyntaxToken, text: ISimpleText): boolean { + export function isLastTokenOnLine(token: ISyntaxToken, text: ISimpleText): boolean { var _nextToken = nextToken(token, text); - if (_nextToken === null) { + if (_nextToken === undefined) { return true; } var lineMap = text.lineMap(); - var tokenLine = lineMap.getLineNumberFromPosition(end(token, text)); + var tokenLine = lineMap.getLineNumberFromPosition(fullEnd(token)); var nextTokenLine = lineMap.getLineNumberFromPosition(start(_nextToken, text)); return tokenLine !== nextTokenLine; } - public static isLeftHandSizeExpression(element: ISyntaxElement) { + export function isLeftHandSizeExpression(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.MemberAccessExpression: case SyntaxKind.ElementAccessExpression: + case SyntaxKind.TemplateAccessExpression: case SyntaxKind.ObjectCreationExpression: case SyntaxKind.InvocationExpression: case SyntaxKind.ArrayLiteralExpression: @@ -59,89 +70,9 @@ module TypeScript { return false; } - public static isExpression(element: ISyntaxElement) { + export function isSwitchClause(element: ISyntaxElement) { if (element) { - switch (element.kind()) { - case SyntaxKind.IdentifierName: - case SyntaxKind.RegularExpressionLiteral: - case SyntaxKind.NumericLiteral: - case SyntaxKind.StringLiteral: - case SyntaxKind.FalseKeyword: - case SyntaxKind.NullKeyword: - case SyntaxKind.ThisKeyword: - case SyntaxKind.TrueKeyword: - case SyntaxKind.SuperKeyword: - - case SyntaxKind.PlusExpression: - case SyntaxKind.NegateExpression: - case SyntaxKind.BitwiseNotExpression: - case SyntaxKind.LogicalNotExpression: - case SyntaxKind.PreIncrementExpression: - case SyntaxKind.PreDecrementExpression: - case SyntaxKind.DeleteExpression: - case SyntaxKind.TypeOfExpression: - case SyntaxKind.VoidExpression: - case SyntaxKind.CommaExpression: - case SyntaxKind.AssignmentExpression: - case SyntaxKind.AddAssignmentExpression: - case SyntaxKind.SubtractAssignmentExpression: - case SyntaxKind.MultiplyAssignmentExpression: - case SyntaxKind.DivideAssignmentExpression: - case SyntaxKind.ModuloAssignmentExpression: - case SyntaxKind.AndAssignmentExpression: - case SyntaxKind.ExclusiveOrAssignmentExpression: - case SyntaxKind.OrAssignmentExpression: - case SyntaxKind.LeftShiftAssignmentExpression: - case SyntaxKind.SignedRightShiftAssignmentExpression: - case SyntaxKind.UnsignedRightShiftAssignmentExpression: - case SyntaxKind.ConditionalExpression: - case SyntaxKind.LogicalOrExpression: - case SyntaxKind.LogicalAndExpression: - case SyntaxKind.BitwiseOrExpression: - case SyntaxKind.BitwiseExclusiveOrExpression: - case SyntaxKind.BitwiseAndExpression: - case SyntaxKind.EqualsWithTypeConversionExpression: - case SyntaxKind.NotEqualsWithTypeConversionExpression: - case SyntaxKind.EqualsExpression: - case SyntaxKind.NotEqualsExpression: - case SyntaxKind.LessThanExpression: - case SyntaxKind.GreaterThanExpression: - case SyntaxKind.LessThanOrEqualExpression: - case SyntaxKind.GreaterThanOrEqualExpression: - case SyntaxKind.InstanceOfExpression: - case SyntaxKind.InExpression: - case SyntaxKind.LeftShiftExpression: - case SyntaxKind.SignedRightShiftExpression: - case SyntaxKind.UnsignedRightShiftExpression: - case SyntaxKind.MultiplyExpression: - case SyntaxKind.DivideExpression: - case SyntaxKind.ModuloExpression: - case SyntaxKind.AddExpression: - case SyntaxKind.SubtractExpression: - case SyntaxKind.PostIncrementExpression: - case SyntaxKind.PostDecrementExpression: - case SyntaxKind.MemberAccessExpression: - case SyntaxKind.InvocationExpression: - case SyntaxKind.ArrayLiteralExpression: - case SyntaxKind.ObjectLiteralExpression: - case SyntaxKind.ObjectCreationExpression: - case SyntaxKind.ParenthesizedExpression: - case SyntaxKind.ParenthesizedArrowFunctionExpression: - case SyntaxKind.SimpleArrowFunctionExpression: - case SyntaxKind.CastExpression: - case SyntaxKind.ElementAccessExpression: - case SyntaxKind.FunctionExpression: - case SyntaxKind.OmittedExpression: - return true; - } - } - - return false; - } - - public static isSwitchClause(element: ISyntaxElement) { - if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.CaseSwitchClause: case SyntaxKind.DefaultSwitchClause: return true; @@ -151,9 +82,9 @@ module TypeScript { return false; } - public static isTypeMember(element: ISyntaxElement) { + export function isTypeMember(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.ConstructSignature: case SyntaxKind.MethodSignature: case SyntaxKind.IndexSignature: @@ -166,9 +97,9 @@ module TypeScript { return false; } - public static isClassElement(element: ISyntaxElement) { + export function isClassElement(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.ConstructorDeclaration: case SyntaxKind.IndexMemberDeclaration: case SyntaxKind.MemberFunctionDeclaration: @@ -183,9 +114,9 @@ module TypeScript { return false; } - public static isModuleElement(element: ISyntaxElement) { + export function isModuleElement(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.ImportDeclaration: case SyntaxKind.ExportAssignment: case SyntaxKind.ClassDeclaration: @@ -220,9 +151,9 @@ module TypeScript { return false; } - public static isStatement(element: ISyntaxElement) { + export function isStatement(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.VariableStatement: case SyntaxKind.Block: @@ -249,11 +180,11 @@ module TypeScript { return false; } - public static isAngleBracket(positionedElement: ISyntaxElement): boolean { + export function isAngleBracket(positionedElement: ISyntaxElement): boolean { var element = positionedElement; var parent = positionedElement.parent; - if (parent !== null && (element.kind() === SyntaxKind.LessThanToken || element.kind() === SyntaxKind.GreaterThanToken)) { - switch (parent.kind()) { + if (parent && (element.kind === SyntaxKind.LessThanToken || element.kind === SyntaxKind.GreaterThanToken)) { + switch (parent.kind) { case SyntaxKind.TypeArgumentList: case SyntaxKind.TypeParameterList: case SyntaxKind.CastExpression: @@ -264,27 +195,27 @@ module TypeScript { return false; } - public static getToken(list: ISyntaxToken[], kind: SyntaxKind): ISyntaxToken { + export function getToken(list: ISyntaxToken[], kind: SyntaxKind): ISyntaxToken { for (var i = 0, n = list.length; i < n; i++) { var token = list[i]; - if (token.kind() === kind) { + if (token.kind === kind) { return token; } } - return null; + return undefined; } - public static containsToken(list: ISyntaxToken[], kind: SyntaxKind): boolean { - return SyntaxUtilities.getToken(list, kind) !== null; + export function containsToken(list: ISyntaxToken[], kind: SyntaxKind): boolean { + return !!SyntaxUtilities.getToken(list, kind); } - public static hasExportKeyword(moduleElement: IModuleElementSyntax): boolean { - return SyntaxUtilities.getExportKeyword(moduleElement) !== null; + export function hasExportKeyword(moduleElement: IModuleElementSyntax): boolean { + return !!SyntaxUtilities.getExportKeyword(moduleElement); } - public static getExportKeyword(moduleElement: IModuleElementSyntax): ISyntaxToken { - switch (moduleElement.kind()) { + export function getExportKeyword(moduleElement: IModuleElementSyntax): ISyntaxToken { + switch (moduleElement.kind) { case SyntaxKind.ModuleDeclaration: case SyntaxKind.ClassDeclaration: case SyntaxKind.FunctionDeclaration: @@ -294,17 +225,17 @@ module TypeScript { case SyntaxKind.ImportDeclaration: return SyntaxUtilities.getToken((moduleElement).modifiers, SyntaxKind.ExportKeyword); default: - return null; + return undefined; } } - public static isAmbientDeclarationSyntax(positionNode: ISyntaxNode): boolean { + export function isAmbientDeclarationSyntax(positionNode: ISyntaxNode): boolean { if (!positionNode) { return false; } var node = positionNode; - switch (node.kind()) { + switch (node.kind) { case SyntaxKind.ModuleDeclaration: case SyntaxKind.ClassDeclaration: case SyntaxKind.FunctionDeclaration: diff --git a/src/services/syntax/syntaxVisitor.generated.ts b/src/services/syntax/syntaxVisitor.generated.ts index 7081499105d..2fbc2ccd0b8 100644 --- a/src/services/syntax/syntaxVisitor.generated.ts +++ b/src/services/syntax/syntaxVisitor.generated.ts @@ -2,9 +2,8 @@ module TypeScript { export function visitNodeOrToken(visitor: ISyntaxVisitor, element: ISyntaxNodeOrToken): any { - if (element === null) { return null; } - if (isToken(element)) { return visitor.visitToken(element); } - switch (element.kind()) { + if (element === undefined) { return undefined; } + switch (element.kind) { case SyntaxKind.SourceUnit: return visitor.visitSourceUnit(element); case SyntaxKind.QualifiedName: return visitor.visitQualifiedName(element); case SyntaxKind.ObjectType: return visitor.visitObjectType(element); @@ -13,6 +12,9 @@ module TypeScript { case SyntaxKind.ConstructorType: return visitor.visitConstructorType(element); case SyntaxKind.GenericType: return visitor.visitGenericType(element); case SyntaxKind.TypeQuery: return visitor.visitTypeQuery(element); + case SyntaxKind.TupleType: return visitor.visitTupleType(element); + case SyntaxKind.UnionType: return visitor.visitUnionType(element); + case SyntaxKind.ParenthesizedType: return visitor.visitParenthesizedType(element); case SyntaxKind.InterfaceDeclaration: return visitor.visitInterfaceDeclaration(element); case SyntaxKind.FunctionDeclaration: return visitor.visitFunctionDeclaration(element); case SyntaxKind.ModuleDeclaration: return visitor.visitModuleDeclaration(element); @@ -49,16 +51,13 @@ module TypeScript { case SyntaxKind.DoStatement: return visitor.visitDoStatement(element); case SyntaxKind.DebuggerStatement: return visitor.visitDebuggerStatement(element); case SyntaxKind.WithStatement: return visitor.visitWithStatement(element); - case SyntaxKind.PreIncrementExpression: case SyntaxKind.PreDecrementExpression: case SyntaxKind.PlusExpression: case SyntaxKind.NegateExpression: case SyntaxKind.BitwiseNotExpression: case SyntaxKind.LogicalNotExpression: - return visitor.visitPrefixUnaryExpression(element); + case SyntaxKind.PrefixUnaryExpression: return visitor.visitPrefixUnaryExpression(element); case SyntaxKind.DeleteExpression: return visitor.visitDeleteExpression(element); case SyntaxKind.TypeOfExpression: return visitor.visitTypeOfExpression(element); case SyntaxKind.VoidExpression: return visitor.visitVoidExpression(element); case SyntaxKind.ConditionalExpression: return visitor.visitConditionalExpression(element); - case SyntaxKind.MultiplyExpression: case SyntaxKind.DivideExpression: case SyntaxKind.ModuloExpression: case SyntaxKind.AddExpression: case SyntaxKind.SubtractExpression: case SyntaxKind.LeftShiftExpression: case SyntaxKind.SignedRightShiftExpression: case SyntaxKind.UnsignedRightShiftExpression: case SyntaxKind.LessThanExpression: case SyntaxKind.GreaterThanExpression: case SyntaxKind.LessThanOrEqualExpression: case SyntaxKind.GreaterThanOrEqualExpression: case SyntaxKind.InstanceOfExpression: case SyntaxKind.InExpression: case SyntaxKind.EqualsWithTypeConversionExpression: case SyntaxKind.NotEqualsWithTypeConversionExpression: case SyntaxKind.EqualsExpression: case SyntaxKind.NotEqualsExpression: case SyntaxKind.BitwiseAndExpression: case SyntaxKind.BitwiseExclusiveOrExpression: case SyntaxKind.BitwiseOrExpression: case SyntaxKind.LogicalAndExpression: case SyntaxKind.LogicalOrExpression: case SyntaxKind.OrAssignmentExpression: case SyntaxKind.AndAssignmentExpression: case SyntaxKind.ExclusiveOrAssignmentExpression: case SyntaxKind.LeftShiftAssignmentExpression: case SyntaxKind.SignedRightShiftAssignmentExpression: case SyntaxKind.UnsignedRightShiftAssignmentExpression: case SyntaxKind.AddAssignmentExpression: case SyntaxKind.SubtractAssignmentExpression: case SyntaxKind.MultiplyAssignmentExpression: case SyntaxKind.DivideAssignmentExpression: case SyntaxKind.ModuloAssignmentExpression: case SyntaxKind.AssignmentExpression: case SyntaxKind.CommaExpression: - return visitor.visitBinaryExpression(element); - case SyntaxKind.PostIncrementExpression: case SyntaxKind.PostDecrementExpression: - return visitor.visitPostfixUnaryExpression(element); + case SyntaxKind.BinaryExpression: return visitor.visitBinaryExpression(element); + case SyntaxKind.PostfixUnaryExpression: return visitor.visitPostfixUnaryExpression(element); case SyntaxKind.MemberAccessExpression: return visitor.visitMemberAccessExpression(element); case SyntaxKind.InvocationExpression: return visitor.visitInvocationExpression(element); case SyntaxKind.ArrayLiteralExpression: return visitor.visitArrayLiteralExpression(element); @@ -71,20 +70,23 @@ module TypeScript { case SyntaxKind.ElementAccessExpression: return visitor.visitElementAccessExpression(element); case SyntaxKind.FunctionExpression: return visitor.visitFunctionExpression(element); case SyntaxKind.OmittedExpression: return visitor.visitOmittedExpression(element); + case SyntaxKind.TemplateExpression: return visitor.visitTemplateExpression(element); + case SyntaxKind.TemplateAccessExpression: return visitor.visitTemplateAccessExpression(element); + case SyntaxKind.YieldExpression: return visitor.visitYieldExpression(element); case SyntaxKind.VariableDeclaration: return visitor.visitVariableDeclaration(element); case SyntaxKind.VariableDeclarator: return visitor.visitVariableDeclarator(element); case SyntaxKind.ArgumentList: return visitor.visitArgumentList(element); case SyntaxKind.ParameterList: return visitor.visitParameterList(element); case SyntaxKind.TypeArgumentList: return visitor.visitTypeArgumentList(element); case SyntaxKind.TypeParameterList: return visitor.visitTypeParameterList(element); - case SyntaxKind.ExtendsHeritageClause: case SyntaxKind.ImplementsHeritageClause: - return visitor.visitHeritageClause(element); + case SyntaxKind.HeritageClause: return visitor.visitHeritageClause(element); case SyntaxKind.EqualsValueClause: return visitor.visitEqualsValueClause(element); case SyntaxKind.CaseSwitchClause: return visitor.visitCaseSwitchClause(element); case SyntaxKind.DefaultSwitchClause: return visitor.visitDefaultSwitchClause(element); case SyntaxKind.ElseClause: return visitor.visitElseClause(element); case SyntaxKind.CatchClause: return visitor.visitCatchClause(element); case SyntaxKind.FinallyClause: return visitor.visitFinallyClause(element); + case SyntaxKind.TemplateClause: return visitor.visitTemplateClause(element); case SyntaxKind.TypeParameter: return visitor.visitTypeParameter(element); case SyntaxKind.Constraint: return visitor.visitConstraint(element); case SyntaxKind.SimplePropertyAssignment: return visitor.visitSimplePropertyAssignment(element); @@ -92,11 +94,12 @@ module TypeScript { case SyntaxKind.Parameter: return visitor.visitParameter(element); case SyntaxKind.EnumElement: return visitor.visitEnumElement(element); case SyntaxKind.TypeAnnotation: return visitor.visitTypeAnnotation(element); + case SyntaxKind.ExpressionBody: return visitor.visitExpressionBody(element); + case SyntaxKind.ComputedPropertyName: return visitor.visitComputedPropertyName(element); case SyntaxKind.ExternalModuleReference: return visitor.visitExternalModuleReference(element); case SyntaxKind.ModuleNameModuleReference: return visitor.visitModuleNameModuleReference(element); + default: return visitor.visitToken(element); } - - throw Errors.invalidOperation(); } export interface ISyntaxVisitor { @@ -109,6 +112,9 @@ module TypeScript { visitConstructorType(node: ConstructorTypeSyntax): any; visitGenericType(node: GenericTypeSyntax): any; visitTypeQuery(node: TypeQuerySyntax): any; + visitTupleType(node: TupleTypeSyntax): any; + visitUnionType(node: UnionTypeSyntax): any; + visitParenthesizedType(node: ParenthesizedTypeSyntax): any; visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): any; visitFunctionDeclaration(node: FunctionDeclarationSyntax): any; visitModuleDeclaration(node: ModuleDeclarationSyntax): any; @@ -164,6 +170,9 @@ module TypeScript { visitElementAccessExpression(node: ElementAccessExpressionSyntax): any; visitFunctionExpression(node: FunctionExpressionSyntax): any; visitOmittedExpression(node: OmittedExpressionSyntax): any; + visitTemplateExpression(node: TemplateExpressionSyntax): any; + visitTemplateAccessExpression(node: TemplateAccessExpressionSyntax): any; + visitYieldExpression(node: YieldExpressionSyntax): any; visitVariableDeclaration(node: VariableDeclarationSyntax): any; visitVariableDeclarator(node: VariableDeclaratorSyntax): any; visitArgumentList(node: ArgumentListSyntax): any; @@ -177,6 +186,7 @@ module TypeScript { visitElseClause(node: ElseClauseSyntax): any; visitCatchClause(node: CatchClauseSyntax): any; visitFinallyClause(node: FinallyClauseSyntax): any; + visitTemplateClause(node: TemplateClauseSyntax): any; visitTypeParameter(node: TypeParameterSyntax): any; visitConstraint(node: ConstraintSyntax): any; visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): any; @@ -184,6 +194,8 @@ module TypeScript { visitParameter(node: ParameterSyntax): any; visitEnumElement(node: EnumElementSyntax): any; visitTypeAnnotation(node: TypeAnnotationSyntax): any; + visitExpressionBody(node: ExpressionBody): any; + visitComputedPropertyName(node: ComputedPropertyNameSyntax): any; visitExternalModuleReference(node: ExternalModuleReferenceSyntax): any; visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): any; } diff --git a/src/services/syntax/syntaxWalker.generated.ts b/src/services/syntax/syntaxWalker.generated.ts index 73f70f1834b..a9b03349102 100644 --- a/src/services/syntax/syntaxWalker.generated.ts +++ b/src/services/syntax/syntaxWalker.generated.ts @@ -5,53 +5,17 @@ module TypeScript { public visitToken(token: ISyntaxToken): void { } - public visitNode(node: ISyntaxNode): void { - visitNodeOrToken(this, node); - } - - public visitNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void { - if (isToken(nodeOrToken)) { - this.visitToken(nodeOrToken); - } - else { - this.visitNode(nodeOrToken); - } - } - private visitOptionalToken(token: ISyntaxToken): void { - if (token === null) { + if (token === undefined) { return; } this.visitToken(token); } - public visitOptionalNode(node: ISyntaxNode): void { - if (node === null) { - return; - } - - this.visitNode(node); - } - - public visitOptionalNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void { - if (nodeOrToken === null) { - return; - } - - this.visitNodeOrToken(nodeOrToken); - } - public visitList(list: ISyntaxNodeOrToken[]): void { for (var i = 0, n = list.length; i < n; i++) { - this.visitNodeOrToken(list[i]); - } - } - - public visitSeparatedList(list: ISyntaxNodeOrToken[]): void { - for (var i = 0, n = childCount(list); i < n; i++) { - var item = childAt(list, i); - this.visitNodeOrToken(item); + visitNodeOrToken(this, list[i]); } } @@ -61,71 +25,88 @@ module TypeScript { } public visitQualifiedName(node: QualifiedNameSyntax): void { - this.visitNodeOrToken(node.left); + visitNodeOrToken(this, node.left); this.visitToken(node.dotToken); this.visitToken(node.right); } public visitObjectType(node: ObjectTypeSyntax): void { this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.typeMembers); + this.visitList(node.typeMembers); this.visitToken(node.closeBraceToken); } public visitFunctionType(node: FunctionTypeSyntax): void { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); + visitNodeOrToken(this, node.typeParameterList); + visitNodeOrToken(this, node.parameterList); this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); + visitNodeOrToken(this, node.type); } public visitArrayType(node: ArrayTypeSyntax): void { - this.visitNodeOrToken(node.type); + visitNodeOrToken(this, node.type); this.visitToken(node.openBracketToken); this.visitToken(node.closeBracketToken); } public visitConstructorType(node: ConstructorTypeSyntax): void { this.visitToken(node.newKeyword); - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); + visitNodeOrToken(this, node.typeParameterList); + visitNodeOrToken(this, node.parameterList); this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); + visitNodeOrToken(this, node.type); } public visitGenericType(node: GenericTypeSyntax): void { - this.visitNodeOrToken(node.name); - this.visitNode(node.typeArgumentList); + visitNodeOrToken(this, node.name); + visitNodeOrToken(this, node.typeArgumentList); } public visitTypeQuery(node: TypeQuerySyntax): void { this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.name); + visitNodeOrToken(this, node.name); + } + + public visitTupleType(node: TupleTypeSyntax): void { + this.visitToken(node.openBracketToken); + this.visitList(node.types); + this.visitToken(node.closeBracketToken); + } + + public visitUnionType(node: UnionTypeSyntax): void { + visitNodeOrToken(this, node.left); + this.visitToken(node.barToken); + visitNodeOrToken(this, node.right); + } + + public visitParenthesizedType(node: ParenthesizedTypeSyntax): void { + this.visitToken(node.openParenToken); + visitNodeOrToken(this, node.type); + this.visitToken(node.closeParenToken); } public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): void { this.visitList(node.modifiers); this.visitToken(node.interfaceKeyword); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); + visitNodeOrToken(this, node.typeParameterList); this.visitList(node.heritageClauses); - this.visitNode(node.body); + visitNodeOrToken(this, node.body); } public visitFunctionDeclaration(node: FunctionDeclarationSyntax): void { this.visitList(node.modifiers); this.visitToken(node.functionKeyword); + this.visitOptionalToken(node.asterixToken); this.visitToken(node.identifier); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.body); } public visitModuleDeclaration(node: ModuleDeclarationSyntax): void { this.visitList(node.modifiers); this.visitToken(node.moduleKeyword); - this.visitOptionalNodeOrToken(node.name); - this.visitOptionalToken(node.stringLiteral); + visitNodeOrToken(this, node.name); this.visitToken(node.openBraceToken); this.visitList(node.moduleElements); this.visitToken(node.closeBraceToken); @@ -135,7 +116,7 @@ module TypeScript { this.visitList(node.modifiers); this.visitToken(node.classKeyword); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); + visitNodeOrToken(this, node.typeParameterList); this.visitList(node.heritageClauses); this.visitToken(node.openBraceToken); this.visitList(node.classElements); @@ -147,7 +128,7 @@ module TypeScript { this.visitToken(node.enumKeyword); this.visitToken(node.identifier); this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.enumElements); + this.visitList(node.enumElements); this.visitToken(node.closeBraceToken); } @@ -156,7 +137,7 @@ module TypeScript { this.visitToken(node.importKeyword); this.visitToken(node.identifier); this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.moduleReference); + visitNodeOrToken(this, node.moduleReference); this.visitOptionalToken(node.semicolonToken); } @@ -169,79 +150,79 @@ module TypeScript { public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void { this.visitList(node.modifiers); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); + this.visitOptionalToken(node.asterixToken); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.body); } public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): void { this.visitList(node.modifiers); - this.visitNode(node.variableDeclarator); + visitNodeOrToken(this, node.variableDeclarator); this.visitOptionalToken(node.semicolonToken); } public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): void { this.visitList(node.modifiers); this.visitToken(node.constructorKeyword); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.body); } public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): void { this.visitList(node.modifiers); - this.visitNode(node.indexSignature); + visitNodeOrToken(this, node.indexSignature); this.visitOptionalToken(node.semicolonToken); } public visitGetAccessor(node: GetAccessorSyntax): void { this.visitList(node.modifiers); this.visitToken(node.getKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.body); } public visitSetAccessor(node: SetAccessorSyntax): void { this.visitList(node.modifiers); this.visitToken(node.setKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.body); } public visitPropertySignature(node: PropertySignatureSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); + visitNodeOrToken(this, node.typeAnnotation); } public visitCallSignature(node: CallSignatureSyntax): void { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitOptionalNode(node.typeAnnotation); + visitNodeOrToken(this, node.typeParameterList); + visitNodeOrToken(this, node.parameterList); + visitNodeOrToken(this, node.typeAnnotation); } public visitConstructSignature(node: ConstructSignatureSyntax): void { this.visitToken(node.newKeyword); - this.visitNode(node.callSignature); + visitNodeOrToken(this, node.callSignature); } public visitIndexSignature(node: IndexSignatureSyntax): void { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.parameters); + this.visitList(node.parameters); this.visitToken(node.closeBracketToken); - this.visitOptionalNode(node.typeAnnotation); + visitNodeOrToken(this, node.typeAnnotation); } public visitMethodSignature(node: MethodSignatureSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.visitOptionalToken(node.questionToken); - this.visitNode(node.callSignature); + visitNodeOrToken(this, node.callSignature); } public visitBlock(node: BlockSyntax): void { + this.visitOptionalToken(node.equalsGreaterThanToken); this.visitToken(node.openBraceToken); this.visitList(node.statements); this.visitToken(node.closeBraceToken); @@ -250,33 +231,33 @@ module TypeScript { public visitIfStatement(node: IfStatementSyntax): void { this.visitToken(node.ifKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - this.visitOptionalNode(node.elseClause); + visitNodeOrToken(this, node.statement); + visitNodeOrToken(this, node.elseClause); } public visitVariableStatement(node: VariableStatementSyntax): void { this.visitList(node.modifiers); - this.visitNode(node.variableDeclaration); + visitNodeOrToken(this, node.variableDeclaration); this.visitOptionalToken(node.semicolonToken); } public visitExpressionStatement(node: ExpressionStatementSyntax): void { - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); } public visitReturnStatement(node: ReturnStatementSyntax): void { this.visitToken(node.returnKeyword); - this.visitOptionalNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); } public visitSwitchStatement(node: SwitchStatementSyntax): void { this.visitToken(node.switchKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitToken(node.closeParenToken); this.visitToken(node.openBraceToken); this.visitList(node.switchClauses); @@ -298,25 +279,23 @@ module TypeScript { public visitForStatement(node: ForStatementSyntax): void { this.visitToken(node.forKeyword); this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.initializer); + visitNodeOrToken(this, node.initializer); this.visitToken(node.firstSemicolonToken); - this.visitOptionalNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.secondSemicolonToken); - this.visitOptionalNodeOrToken(node.incrementor); + visitNodeOrToken(this, node.incrementor); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitForInStatement(node: ForInStatementSyntax): void { this.visitToken(node.forKeyword); this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.left); + visitNodeOrToken(this, node.left); this.visitToken(node.inKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.right); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitEmptyStatement(node: EmptyStatementSyntax): void { @@ -325,37 +304,37 @@ module TypeScript { public visitThrowStatement(node: ThrowStatementSyntax): void { this.visitToken(node.throwKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); } public visitWhileStatement(node: WhileStatementSyntax): void { this.visitToken(node.whileKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitTryStatement(node: TryStatementSyntax): void { this.visitToken(node.tryKeyword); - this.visitNode(node.block); - this.visitOptionalNode(node.catchClause); - this.visitOptionalNode(node.finallyClause); + visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.catchClause); + visitNodeOrToken(this, node.finallyClause); } public visitLabeledStatement(node: LabeledStatementSyntax): void { this.visitToken(node.identifier); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitDoStatement(node: DoStatementSyntax): void { this.visitToken(node.doKeyword); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); this.visitToken(node.whileKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); this.visitOptionalToken(node.semicolonToken); } @@ -368,172 +347,187 @@ module TypeScript { public visitWithStatement(node: WithStatementSyntax): void { this.visitToken(node.withKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): void { this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.operand); + visitNodeOrToken(this, node.operand); } public visitDeleteExpression(node: DeleteExpressionSyntax): void { this.visitToken(node.deleteKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); } public visitTypeOfExpression(node: TypeOfExpressionSyntax): void { this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); } public visitVoidExpression(node: VoidExpressionSyntax): void { this.visitToken(node.voidKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); } public visitConditionalExpression(node: ConditionalExpressionSyntax): void { - this.visitNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.questionToken); - this.visitNodeOrToken(node.whenTrue); + visitNodeOrToken(this, node.whenTrue); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.whenFalse); + visitNodeOrToken(this, node.whenFalse); } public visitBinaryExpression(node: BinaryExpressionSyntax): void { - this.visitNodeOrToken(node.left); + visitNodeOrToken(this, node.left); this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.right); + visitNodeOrToken(this, node.right); } public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): void { - this.visitNodeOrToken(node.operand); + visitNodeOrToken(this, node.operand); this.visitToken(node.operatorToken); } public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): void { - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitToken(node.dotToken); this.visitToken(node.name); } public visitInvocationExpression(node: InvocationExpressionSyntax): void { - this.visitNodeOrToken(node.expression); - this.visitNode(node.argumentList); + visitNodeOrToken(this, node.expression); + visitNodeOrToken(this, node.argumentList); } public visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): void { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.expressions); + this.visitList(node.expressions); this.visitToken(node.closeBracketToken); } public visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): void { this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.propertyAssignments); + this.visitList(node.propertyAssignments); this.visitToken(node.closeBraceToken); } public visitObjectCreationExpression(node: ObjectCreationExpressionSyntax): void { this.visitToken(node.newKeyword); - this.visitNodeOrToken(node.expression); - this.visitOptionalNode(node.argumentList); + visitNodeOrToken(this, node.expression); + visitNodeOrToken(this, node.argumentList); } public visitParenthesizedExpression(node: ParenthesizedExpressionSyntax): void { this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitToken(node.closeParenToken); } public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): void { - this.visitNode(node.callSignature); + visitNodeOrToken(this, node.callSignature); this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); + visitNodeOrToken(this, node.body); } public visitSimpleArrowFunctionExpression(node: SimpleArrowFunctionExpressionSyntax): void { - this.visitNode(node.parameter); + visitNodeOrToken(this, node.parameter); this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); + visitNodeOrToken(this, node.body); } public visitCastExpression(node: CastExpressionSyntax): void { this.visitToken(node.lessThanToken); - this.visitNodeOrToken(node.type); + visitNodeOrToken(this, node.type); this.visitToken(node.greaterThanToken); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); } public visitElementAccessExpression(node: ElementAccessExpressionSyntax): void { - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitToken(node.openBracketToken); - this.visitNodeOrToken(node.argumentExpression); + visitNodeOrToken(this, node.argumentExpression); this.visitToken(node.closeBracketToken); } public visitFunctionExpression(node: FunctionExpressionSyntax): void { this.visitToken(node.functionKeyword); + this.visitOptionalToken(node.asterixToken); this.visitOptionalToken(node.identifier); - this.visitNode(node.callSignature); - this.visitNode(node.block); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.body); } public visitOmittedExpression(node: OmittedExpressionSyntax): void { } + public visitTemplateExpression(node: TemplateExpressionSyntax): void { + this.visitToken(node.templateStartToken); + this.visitList(node.templateClauses); + } + + public visitTemplateAccessExpression(node: TemplateAccessExpressionSyntax): void { + visitNodeOrToken(this, node.expression); + visitNodeOrToken(this, node.templateExpression); + } + + public visitYieldExpression(node: YieldExpressionSyntax): void { + this.visitToken(node.yieldKeyword); + this.visitOptionalToken(node.asterixToken); + visitNodeOrToken(this, node.expression); + } + public visitVariableDeclaration(node: VariableDeclarationSyntax): void { this.visitToken(node.varKeyword); - this.visitSeparatedList(node.variableDeclarators); + this.visitList(node.variableDeclarators); } public visitVariableDeclarator(node: VariableDeclaratorSyntax): void { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.typeAnnotation); + visitNodeOrToken(this, node.equalsValueClause); } public visitArgumentList(node: ArgumentListSyntax): void { - this.visitOptionalNode(node.typeArgumentList); + visitNodeOrToken(this, node.typeArgumentList); this.visitToken(node.openParenToken); - this.visitSeparatedList(node.arguments); + this.visitList(node.arguments); this.visitToken(node.closeParenToken); } public visitParameterList(node: ParameterListSyntax): void { this.visitToken(node.openParenToken); - this.visitSeparatedList(node.parameters); + this.visitList(node.parameters); this.visitToken(node.closeParenToken); } public visitTypeArgumentList(node: TypeArgumentListSyntax): void { this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeArguments); + this.visitList(node.typeArguments); this.visitToken(node.greaterThanToken); } public visitTypeParameterList(node: TypeParameterListSyntax): void { this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeParameters); + this.visitList(node.typeParameters); this.visitToken(node.greaterThanToken); } public visitHeritageClause(node: HeritageClauseSyntax): void { this.visitToken(node.extendsOrImplementsKeyword); - this.visitSeparatedList(node.typeNames); + this.visitList(node.typeNames); } public visitEqualsValueClause(node: EqualsValueClauseSyntax): void { this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.value); + visitNodeOrToken(this, node.value); } public visitCaseSwitchClause(node: CaseSwitchClauseSyntax): void { this.visitToken(node.caseKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitToken(node.colonToken); this.visitList(node.statements); } @@ -546,43 +540,49 @@ module TypeScript { public visitElseClause(node: ElseClauseSyntax): void { this.visitToken(node.elseKeyword); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitCatchClause(node: CatchClauseSyntax): void { this.visitToken(node.catchKeyword); this.visitToken(node.openParenToken); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeAnnotation); + visitNodeOrToken(this, node.typeAnnotation); this.visitToken(node.closeParenToken); - this.visitNode(node.block); + visitNodeOrToken(this, node.block); } public visitFinallyClause(node: FinallyClauseSyntax): void { this.visitToken(node.finallyKeyword); - this.visitNode(node.block); + visitNodeOrToken(this, node.block); + } + + public visitTemplateClause(node: TemplateClauseSyntax): void { + visitNodeOrToken(this, node.expression); + this.visitToken(node.templateMiddleOrEndToken); } public visitTypeParameter(node: TypeParameterSyntax): void { this.visitToken(node.identifier); - this.visitOptionalNode(node.constraint); + visitNodeOrToken(this, node.constraint); } public visitConstraint(node: ConstraintSyntax): void { this.visitToken(node.extendsKeyword); - this.visitNodeOrToken(node.typeOrExpression); + visitNodeOrToken(this, node.typeOrExpression); } public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); } public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void { - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); + this.visitOptionalToken(node.asterixToken); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.body); } public visitParameter(node: ParameterSyntax): void { @@ -590,18 +590,29 @@ module TypeScript { this.visitList(node.modifiers); this.visitToken(node.identifier); this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); + visitNodeOrToken(this, node.typeAnnotation); + visitNodeOrToken(this, node.equalsValueClause); } public visitEnumElement(node: EnumElementSyntax): void { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.equalsValueClause); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.equalsValueClause); } public visitTypeAnnotation(node: TypeAnnotationSyntax): void { this.visitToken(node.colonToken); - this.visitNodeOrToken(node.type); + visitNodeOrToken(this, node.type); + } + + public visitExpressionBody(node: ExpressionBody): void { + this.visitToken(node.equalsGreaterThanToken); + visitNodeOrToken(this, node.expression); + } + + public visitComputedPropertyName(node: ComputedPropertyNameSyntax): void { + this.visitToken(node.openBracketToken); + visitNodeOrToken(this, node.expression); + this.visitToken(node.closeBracketToken); } public visitExternalModuleReference(node: ExternalModuleReferenceSyntax): void { @@ -612,7 +623,7 @@ module TypeScript { } public visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): void { - this.visitNodeOrToken(node.moduleName); + visitNodeOrToken(this, node.moduleName); } } } \ No newline at end of file diff --git a/src/services/syntax/testUtilities.ts b/src/services/syntax/testUtilities.ts index 2dd0055e068..8da87eb1358 100644 --- a/src/services/syntax/testUtilities.ts +++ b/src/services/syntax/testUtilities.ts @@ -1,18 +1,18 @@ module TypeScript { function assertParent(parent: ISyntaxElement, child: ISyntaxElement) { - if (child && !TypeScript.isShared(child)) { + if (child) { return Debug.assert(parent === child.parent); } } export function nodeStructuralEquals(node1: TypeScript.ISyntaxNode, node2: TypeScript.ISyntaxNode, checkParents: boolean, text1: ISimpleText, text2: ISimpleText): boolean { if (node1 === node2) { return true; } - if (node1 === null || node2 === null) { return false; } + if (!node1 || !node2) { return false; } - Debug.assert(node1.kind() === TypeScript.SyntaxKind.SourceUnit || node1.parent); - Debug.assert(node2.kind() === TypeScript.SyntaxKind.SourceUnit || node2.parent); + Debug.assert(node1.kind === TypeScript.SyntaxKind.SourceUnit || node1.parent); + Debug.assert(node2.kind === TypeScript.SyntaxKind.SourceUnit || node2.parent); - if (node1.kind() !== node2.kind()) { return false; } + if (node1.kind !== node2.kind) { return false; } if (childCount(node1) !== childCount(node2)) { return false; } for (var i = 0, n = childCount(node1); i < n; i++) { @@ -37,12 +37,12 @@ module TypeScript { return true; } - if (node1 === null || node2 === null) { + if (!node1 || !node2) { return false; } - Debug.assert(node1.kind() === TypeScript.SyntaxKind.SourceUnit || node1.parent); - Debug.assert(node2.kind() === TypeScript.SyntaxKind.SourceUnit || node2.parent); + Debug.assert(node1.kind === TypeScript.SyntaxKind.SourceUnit || node1.parent); + Debug.assert(node2.kind === TypeScript.SyntaxKind.SourceUnit || node2.parent); if (TypeScript.isToken(node1)) { return TypeScript.isToken(node2) ? tokenStructuralEquals(node1, node2, text1, text2) : false; @@ -56,23 +56,21 @@ module TypeScript { return true; } - if (token1 === null || token2 === null) { + if (!token1 || !token2) { return false; } Debug.assert(token1.parent); Debug.assert(token2.parent); - return token1.kind() === token2.kind() && + return token1.kind === token2.kind && TypeScript.width(token1) === TypeScript.width(token2) && token1.fullWidth() === token2.fullWidth() && token1.fullStart() === token2.fullStart() && TypeScript.fullEnd(token1) === TypeScript.fullEnd(token2) && TypeScript.start(token1, text1) === TypeScript.start(token2, text2) && - TypeScript.end(token1, text1) === TypeScript.end(token2, text2) && token1.text() === token2.text() && - triviaListStructuralEquals(token1.leadingTrivia(text1), token2.leadingTrivia(text2)) && - triviaListStructuralEquals(token1.trailingTrivia(text1), token2.trailingTrivia(text2)); + triviaListStructuralEquals(token1.leadingTrivia(text1), token2.leadingTrivia(text2)); } export function triviaListStructuralEquals(triviaList1: TypeScript.ISyntaxTriviaList, triviaList2: TypeScript.ISyntaxTriviaList): boolean { @@ -102,8 +100,8 @@ module TypeScript { } function listStructuralEquals(list1: T[], list2: T[], checkParents: boolean, text1: ISimpleText, text2: ISimpleText): boolean { - Debug.assert(TypeScript.isShared(list1) || list1.parent); - Debug.assert(TypeScript.isShared(list2) || list2.parent); + Debug.assert(list1.parent); + Debug.assert(list2.parent); if (childCount(list1) !== childCount(list2)) { return false; @@ -118,32 +116,7 @@ module TypeScript { assertParent(list2, child2); } - if (!nodeOrTokenStructuralEquals(child1, child2, checkParents, text1, text2)) { - return false; - } - } - - return true; - } - - function separatedListStructuralEquals(list1: T[], list2: T[], checkParents: boolean, text1: ISimpleText, text2: ISimpleText): boolean { - Debug.assert(TypeScript.isShared(list1) || list1.parent); - Debug.assert(TypeScript.isShared(list2) || list2.parent); - - if (childCount(list1) !== childCount(list2)) { - return false; - } - - for (var i = 0, n = childCount(list1); i < n; i++) { - var element1 = childAt(list1, i); - var element2 = childAt(list2, i); - - if (checkParents) { - assertParent(list1, element1); - assertParent(list2, element2); - } - - if (!nodeOrTokenStructuralEquals(element1, element2, checkParents, text1, text2)) { + if (!elementStructuralEquals(child1, child2, checkParents, text1, text2)) { return false; } } @@ -156,14 +129,14 @@ module TypeScript { return true; } - if (element1 === null || element2 === null) { + if (!element1 || !element2) { return false; } - Debug.assert(element1.kind() === SyntaxKind.SourceUnit || element1.parent); - Debug.assert(element2.kind() === SyntaxKind.SourceUnit || element2.parent); + Debug.assert(element1.kind === SyntaxKind.SourceUnit || element1.parent); + Debug.assert(element2.kind === SyntaxKind.SourceUnit || element2.parent); - if (element2.kind() !== element2.kind()) { + if (element2.kind !== element2.kind) { return false; } @@ -175,10 +148,6 @@ module TypeScript { return false; } - if (TypeScript.end(element1) !== TypeScript.end(element2)) { - return false; - } - if (TypeScript.fullEnd(element1) !== TypeScript.fullEnd(element2)) { return false; } @@ -192,9 +161,6 @@ module TypeScript { else if (TypeScript.isList(element1)) { return listStructuralEquals(element1, element2, checkParents, text1, text2); } - else if (TypeScript.isSeparatedList(element1)) { - return separatedListStructuralEquals(element1, element2, checkParents, text1, text2); - } throw TypeScript.Errors.invalidOperation(); } diff --git a/src/services/syntax/unicode.ts b/src/services/syntax/unicode.ts index df2f88b74c5..b1e94090de7 100644 --- a/src/services/syntax/unicode.ts +++ b/src/services/syntax/unicode.ts @@ -84,7 +84,7 @@ module TypeScript { if (languageVersion === ts.ScriptTarget.ES3) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierStart); } - else if (languageVersion === ts.ScriptTarget.ES5) { + else if (languageVersion >= ts.ScriptTarget.ES5) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierStart); } else { @@ -96,7 +96,7 @@ module TypeScript { if (languageVersion === ts.ScriptTarget.ES3) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierPart); } - else if (languageVersion === ts.ScriptTarget.ES5) { + else if (languageVersion >= ts.ScriptTarget.ES5) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierPart); } else { diff --git a/src/services/syntax/utilities.generated.ts b/src/services/syntax/utilities.generated.ts new file mode 100644 index 00000000000..a01618fae48 --- /dev/null +++ b/src/services/syntax/utilities.generated.ts @@ -0,0 +1,4 @@ + var fixedWidthArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 8, 8, 7, 6, 2, 4, 5, 7, 3, 8, 2, 2, 10, 3, 4, 6, 6, 4, 5, 4, 3, 6, 3, 4, 5, 4, 5, 5, 4, 6, 7, 6, 5, 10, 9, 3, 7, 7, 9, 6, 6, 5, 3, 7, 11, 7, 3, 6, 7, 6, 3, 6, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 2, 2, 2, 1, 2]; + function fixedWidthTokenLength(kind: SyntaxKind) { + return fixedWidthArray[kind]; + } diff --git a/src/services/text.ts b/src/services/text.ts new file mode 100644 index 00000000000..fd768785dea --- /dev/null +++ b/src/services/text.ts @@ -0,0 +1,296 @@ +module ts { + export class TextSpan { + private _start: number; + private _length: number; + + /** + * Creates a TextSpan instance beginning with the position Start and having the Length + * specified with length. + */ + constructor(start: number, length: number) { + Debug.assert(start >= 0, "start"); + Debug.assert(length >= 0, "length"); + + this._start = start; + this._length = length; + } + + public toJSON(key: any): any { + return { start: this._start, length: this._length }; + } + + public start(): number { + return this._start; + } + + public length(): number { + return this._length; + } + + public end(): number { + return this._start + this._length; + } + + public isEmpty(): boolean { + return this._length === 0; + } + + /** + * Determines whether the position lies within the span. Returns true if the position is greater than or equal to Start and strictly less + * than End, otherwise false. + * @param position The position to check. + */ + public containsPosition(position: number): boolean { + return position >= this._start && position < this.end(); + } + + /** + * Determines whether span falls completely within this span. Returns true if the specified span falls completely within this span, otherwise false. + * @param span The span to check. + */ + public containsTextSpan(span: TextSpan): boolean { + return span._start >= this._start && span.end() <= this.end(); + } + + /** + * Determines whether the given span overlaps this span. Two spans are considered to overlap + * if they have positions in common and neither is empty. Empty spans do not overlap with any + * other span. Returns true if the spans overlap, false otherwise. + * @param span The span to check. + */ + public overlapsWith(span: TextSpan): boolean { + var overlapStart = Math.max(this._start, span._start); + var overlapEnd = Math.min(this.end(), span.end()); + + return overlapStart < overlapEnd; + } + + /** + * Returns the overlap with the given span, or undefined if there is no overlap. + * @param span The span to check. + */ + public overlap(span: TextSpan): TextSpan { + var overlapStart = Math.max(this._start, span._start); + var overlapEnd = Math.min(this.end(), span.end()); + + if (overlapStart < overlapEnd) { + return TextSpan.fromBounds(overlapStart, overlapEnd); + } + + return undefined; + } + + /** + * Determines whether span intersects this span. Two spans are considered to + * intersect if they have positions in common or the end of one span + * coincides with the start of the other span. Returns true if the spans intersect, false otherwise. + * @param The span to check. + */ + public intersectsWithTextSpan(span: TextSpan): boolean { + return span._start <= this.end() && span.end() >= this._start; + } + + public intersectsWith(start: number, length: number): boolean { + var end = start + length; + return start <= this.end() && end >= this._start; + } + + /** + * Determines whether the given position intersects this span. + * A position is considered to intersect if it is between the start and + * end positions (inclusive) of this span. Returns true if the position intersects, false otherwise. + * @param position The position to check. + */ + public intersectsWithPosition(position: number): boolean { + return position <= this.end() && position >= this._start; + } + + /** + * Returns the intersection with the given span, or undefined if there is no intersection. + * @param span The span to check. + */ + public intersection(span: TextSpan): TextSpan { + var intersectStart = Math.max(this._start, span._start); + var intersectEnd = Math.min(this.end(), span.end()); + + if (intersectStart <= intersectEnd) { + return TextSpan.fromBounds(intersectStart, intersectEnd); + } + + return undefined; + } + + /** + * Creates a new TextSpan from the given start and end positions + * as opposed to a position and length. + */ + public static fromBounds(start: number, end: number): TextSpan { + Debug.assert(start >= 0); + Debug.assert(end - start >= 0); + return new TextSpan(start, end - start); + } + } + + export class TextChangeRange { + public static unchanged = new TextChangeRange(new TextSpan(0, 0), 0); + + private _span: TextSpan; + private _newLength: number; + + /** + * Initializes a new instance of TextChangeRange. + */ + constructor(span: TextSpan, newLength: number) { + Debug.assert(newLength >= 0, "newLength"); + + this._span = span; + this._newLength = newLength; + } + + /** + * The span of text before the edit which is being changed + */ + public span(): TextSpan { + return this._span; + } + + /** + * Width of the span after the edit. A 0 here would represent a delete + */ + public newLength(): number { + return this._newLength; + } + + public newSpan(): TextSpan { + return new TextSpan(this.span().start(), this.newLength()); + } + + public isUnchanged(): boolean { + return this.span().isEmpty() && this.newLength() === 0; + } + + /** + * Called to merge all the changes that occurred across several versions of a script snapshot + * into a single change. i.e. if a user keeps making successive edits to a script we will + * have a text change from V1 to V2, V2 to V3, ..., Vn. + * + * This function will then merge those changes into a single change range valid between V1 and + * Vn. + */ + public static collapseChangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange { + if (changes.length === 0) { + return TextChangeRange.unchanged; + } + + if (changes.length === 1) { + return changes[0]; + } + + // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd } + // as it makes things much easier to reason about. + var change0 = changes[0]; + + var oldStartN = change0.span().start(); + var oldEndN = change0.span().end(); + var newEndN = oldStartN + change0.newLength(); + + for (var i = 1; i < changes.length; i++) { + var nextChange = changes[i]; + + // Consider the following case: + // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting + // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }. + // i.e. the span starting at 30 with length 30 is increased to length 40. + // + // 0 10 20 30 40 50 60 70 80 90 100 + // ------------------------------------------------------------------------------------------------------- + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ------------------------------------------------------------------------------------------------------- + // | \ + // | \ + // T2 | \ + // | \ + // | \ + // ------------------------------------------------------------------------------------------------------- + // + // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial + // it's just the min of the old and new starts. i.e.: + // + // 0 10 20 30 40 50 60 70 80 90 100 + // ------------------------------------------------------------*------------------------------------------ + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ----------------------------------------$-------------------$------------------------------------------ + // . | \ + // . | \ + // T2 . | \ + // . | \ + // . | \ + // ----------------------------------------------------------------------*-------------------------------- + // + // (Note the dots represent the newly inferrred start. + // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the + // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see + // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that + // means: + // + // 0 10 20 30 40 50 60 70 80 90 100 + // --------------------------------------------------------------------------------*---------------------- + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ------------------------------------------------------------$------------------------------------------ + // . | \ + // . | \ + // T2 . | \ + // . | \ + // . | \ + // ----------------------------------------------------------------------*-------------------------------- + // + // In other words (in this case), we're recognizing that the second edit happened after where the first edit + // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started + // that's the same as if we started at char 80 instead of 60. + // + // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter + // than pusing the first edit forward to match the second, we'll push the second edit forward to match the + // first. + // + // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange + // semantics: { { start: 10, length: 70 }, newLength: 60 } + // + // The math then works out as follows. + // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the + // final result like so: + // + // { + // oldStart3: Min(oldStart1, oldStart2), + // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), + // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) + // } + + var oldStart1 = oldStartN; + var oldEnd1 = oldEndN; + var newEnd1 = newEndN; + + var oldStart2 = nextChange.span().start(); + var oldEnd2 = nextChange.span().end(); + var newEnd2 = oldStart2 + nextChange.newLength(); + + oldStartN = Math.min(oldStart1, oldStart2); + oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); + newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); + } + + return new TextChangeRange(TextSpan.fromBounds(oldStartN, oldEndN), /*newLength: */newEndN - oldStartN); + } + } +} \ No newline at end of file diff --git a/src/services/text/characterCodes.ts b/src/services/text/characterCodes.ts index 040e0c41c6b..91d500f1749 100644 --- a/src/services/text/characterCodes.ts +++ b/src/services/text/characterCodes.ts @@ -104,6 +104,7 @@ module TypeScript { asterisk = 42, // * at = 64, // @ backslash = 92, // \ + backtick = 96, // ` bar = 124, // | caret = 94, // ^ closeBrace = 125, // } diff --git a/src/services/text/scriptSnapshot.ts b/src/services/text/scriptSnapshot.ts index 1c7091d6cae..4e61d131cec 100644 --- a/src/services/text/scriptSnapshot.ts +++ b/src/services/text/scriptSnapshot.ts @@ -1,32 +1,38 @@ /// module TypeScript { - // Represents an immutable snapshot of a script at a specified time. Once acquired, the - // snapshot is observably immutable. i.e. the same calls with the same parameters will return - // the same values. + /** + * Represents an immutable snapshot of a script at a specified time.Once acquired, the + * snapshot is observably immutable. i.e. the same calls with the same parameters will return + * the same values. + */ export interface IScriptSnapshot { - // Get's a portion of the script snapshot specified by [start, end). + /** Gets a portion of the script snapshot specified by [start, end). */ getText(start: number, end: number): string; - // Get's the length of this script snapshot. + /** Gets the length of this script snapshot. */ getLength(): number; - // This call returns the array containing the start position of every line. - // i.e."[0, 10, 55]". TODO: consider making this optional. The language service could - // always determine this (albeit in a more expensive manner). + /** + * This call returns the array containing the start position of every line. + * i.e."[0, 10, 55]". TODO: consider making this optional. The language service could + * always determine this (albeit in a more expensive manner). + */ getLineStartPositions(): number[]; - // Gets the TextChangeRange that describe how the text changed between this text and - // an older version. This informatoin is used by the incremental parser to determine - // what sections of the script need to be reparsed. 'null' can be returned if the - // change range cannot be determined. However, in that case, incremental parsing will - // not happen and the entire document will be reparsed. + /** + * Gets the TextChangeRange that describe how the text changed between this text and + * an older version. This information is used by the incremental parser to determine + * what sections of the script need to be re-parsed. 'undefined' can be returned if the + * change range cannot be determined. However, in that case, incremental parsing will + * not happen and the entire document will be re - parsed. + */ getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; } export module ScriptSnapshot { class StringScriptSnapshot implements IScriptSnapshot { - private _lineStartPositions: number[] = null; + private _lineStartPositions: number[] = undefined; constructor(private text: string) { } diff --git a/src/services/text/textFactory.ts b/src/services/text/textFactory.ts index 21d215c291e..c32aa3adfaf 100644 --- a/src/services/text/textFactory.ts +++ b/src/services/text/textFactory.ts @@ -2,7 +2,7 @@ module TypeScript.SimpleText { class SimpleStringText implements ISimpleText { - private _lineMap: LineMap = null; + private _lineMap: LineMap = undefined; constructor(private value: string) { } @@ -12,7 +12,10 @@ module TypeScript.SimpleText { } public substr(start: number, length: number): string { - return this.value.substr(start, length); + var val = this.value; + return start === 0 && length == val.length + ? val + : val.substr(start, length); } public charCodeAt(index: number): number { @@ -30,7 +33,7 @@ module TypeScript.SimpleText { // Class which wraps a host IScriptSnapshot and exposes an ISimpleText for newer compiler code. class SimpleScriptSnapshotText implements ISimpleText { - private _lineMap: LineMap = null; + private _lineMap: LineMap = undefined; constructor(public scriptSnapshot: IScriptSnapshot) { } @@ -48,7 +51,7 @@ module TypeScript.SimpleText { } public lineMap(): LineMap { - if (this._lineMap === null) { + if (!this._lineMap) { this._lineMap = new LineMap(() => this.scriptSnapshot.getLineStartPositions(), this.length()); } diff --git a/src/services/text/textSpan.ts b/src/services/text/textSpan.ts index d719e244010..9ecef2b95fa 100644 --- a/src/services/text/textSpan.ts +++ b/src/services/text/textSpan.ts @@ -1,6 +1,7 @@ /// module TypeScript { + export interface ISpan { start(): number; end(): number; @@ -78,7 +79,7 @@ module TypeScript { } /** - * Returns the overlap with the given span, or null if there is no overlap. + * Returns the overlap with the given span, or undefined if there is no overlap. * @param span The span to check. */ public overlap(span: TextSpan): TextSpan { @@ -89,7 +90,7 @@ module TypeScript { return TextSpan.fromBounds(overlapStart, overlapEnd); } - return null; + return undefined; } /** @@ -118,7 +119,7 @@ module TypeScript { } /** - * Returns the intersection with the given span, or null if there is no intersection. + * Returns the intersection with the given span, or undefined if there is no intersection. * @param span The span to check. */ public intersection(span: TextSpan): TextSpan { @@ -129,7 +130,7 @@ module TypeScript { return TextSpan.fromBounds(intersectStart, intersectEnd); } - return null; + return undefined; } /** diff --git a/src/services/utilities.ts b/src/services/utilities.ts new file mode 100644 index 00000000000..75bea36bf3a --- /dev/null +++ b/src/services/utilities.ts @@ -0,0 +1,328 @@ +// These utilities are common to multiple language service features. +module ts { + export interface ListItemInfo { + listItemIndex: number; + list: Node; + } + + export function getEndLinePosition(line: number, sourceFile: SourceFile): number { + Debug.assert(line >= 1); + var lineStarts = sourceFile.getLineStarts(); + + // lines returned by SourceFile.getLineAndCharacterForPosition are 1-based + var lineIndex = line - 1; + if (lineIndex === lineStarts.length - 1) { + // last line - return EOF + return sourceFile.text.length - 1; + } + else { + // current line start + var start = lineStarts[lineIndex]; + // take the start position of the next line -1 = it should be some line break + var pos = lineStarts[lineIndex + 1] - 1; + Debug.assert(isLineBreak(sourceFile.text.charCodeAt(pos))); + // walk backwards skipping line breaks, stop the the beginning of current line. + // i.e: + // + // $ <- end of line for this position should match the start position + while (start <= pos && isLineBreak(sourceFile.text.charCodeAt(pos))) { + pos--; + } + return pos; + } + } + + export function getStartPositionOfLine(line: number, sourceFile: SourceFile): number { + Debug.assert(line >= 1); + return sourceFile.getLineStarts()[line - 1]; + } + + export function getStartLinePositionForPosition(position: number, sourceFile: SourceFile): number { + var lineStarts = sourceFile.getLineStarts(); + var line = sourceFile.getLineAndCharacterFromPosition(position).line; + return lineStarts[line - 1]; + } + + export function rangeContainsRange(r1: TextRange, r2: TextRange): boolean { + return startEndContainsRange(r1.pos, r1.end, r2); + } + + export function startEndContainsRange(start: number, end: number, range: TextRange): boolean { + return start <= range.pos && end >= range.end; + } + + export function rangeContainsStartEnd(range: TextRange, start: number, end: number): boolean { + return range.pos <= start && range.end >= end; + } + + export function rangeOverlapsWithStartEnd(r1: TextRange, start: number, end: number) { + return startEndOverlapsWithStartEnd(r1.pos, r1.end, start, end); + } + + export function startEndOverlapsWithStartEnd(start1: number, end1: number, start2: number, end2: number) { + var start = Math.max(start1, start2); + var end = Math.min(end1, end2); + return start < end; + } + + export function findListItemInfo(node: Node): ListItemInfo { + var list = findContainingList(node); + + // It is possible at this point for syntaxList to be undefined, either if + // node.parent had no list child, or if none of its list children contained + // the span of node. If this happens, return undefined. The caller should + // handle this case. + if (!list) { + return undefined; + } + + var children = list.getChildren(); + var listItemIndex = indexOf(children, node); + + return { + listItemIndex, + list + }; + } + + export function findChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFile): Node { + return forEach(n.getChildren(sourceFile), c => c.kind === kind && c); + } + + export function findContainingList(node: Node): Node { + // The node might be a list element (nonsynthetic) or a comma (synthetic). Either way, it will + // be parented by the container of the SyntaxList, not the SyntaxList itself. + // In order to find the list item index, we first need to locate SyntaxList itself and then search + // for the position of the relevant node (or comma). + var syntaxList = forEach(node.parent.getChildren(), c => { + // find syntax list that covers the span of the node + if (c.kind === SyntaxKind.SyntaxList && c.pos <= node.pos && c.end >= node.end) { + return c; + } + }); + + return syntaxList; + } + + /** + * Includes the start position of each child, but excludes the end. + */ + export function findListItemIndexContainingPosition(list: Node, position: number): number { + Debug.assert(list.kind === SyntaxKind.SyntaxList); + var children = list.getChildren(); + for (var i = 0; i < children.length; i++) { + if (children[i].pos <= position && children[i].end > position) { + return i; + } + } + + return -1; + } + + /* Gets the token whose text has range [start, end) and + * position >= start and (position < end or (position === end && token is keyword or identifier)) + */ + export function getTouchingWord(sourceFile: SourceFile, position: number): Node { + return getTouchingToken(sourceFile, position, n => isWord(n.kind)); + } + + /* Gets the token whose text has range [start, end) and position >= start + * and (position < end or (position === end && token is keyword or identifier or numeric\string litera)) + */ + export function getTouchingPropertyName(sourceFile: SourceFile, position: number): Node { + return getTouchingToken(sourceFile, position, n => isPropertyName(n.kind)); + } + + /** Returns the token if position is in [start, end) or if position === end and includeItemAtEndPosition(token) === true */ + export function getTouchingToken(sourceFile: SourceFile, position: number, includeItemAtEndPosition?: (n: Node) => boolean): Node { + return getTokenAtPositionWorker(sourceFile, position, /*allowPositionInLeadingTrivia*/ false, includeItemAtEndPosition); + } + + /** Returns a token if position is in [start-of-leading-trivia, end) */ + export function getTokenAtPosition(sourceFile: SourceFile, position: number): Node { + return getTokenAtPositionWorker(sourceFile, position, /*allowPositionInLeadingTrivia*/ true, /*includeItemAtEndPosition*/ undefined); + } + + /** Get the token whose text contains the position */ + function getTokenAtPositionWorker(sourceFile: SourceFile, position: number, allowPositionInLeadingTrivia: boolean, includeItemAtEndPosition: (n: Node) => boolean): Node { + var current: Node = sourceFile; + outer: while (true) { + if (isToken(current)) { + // exit early + return current; + } + + // find the child that contains 'position' + for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { + var child = current.getChildAt(i); + var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile); + if (start <= position) { + var end = child.getEnd(); + if (position < end || (position === end && child.kind === SyntaxKind.EndOfFileToken)) { + current = child; + continue outer; + } + else if (includeItemAtEndPosition && end === position) { + var previousToken = findPrecedingToken(position, sourceFile, child); + if (previousToken && includeItemAtEndPosition(previousToken)) { + return previousToken; + } + } + } + } + return current; + } + } + + /** + * The token on the left of the position is the token that strictly includes the position + * or sits to the left of the cursor if it is on a boundary. For example + * + * fo|o -> will return foo + * foo |bar -> will return foo + * + */ + export function findTokenOnLeftOfPosition(file: SourceFile, position: number): Node { + // Ideally, getTokenAtPosition should return a token. However, it is currently + // broken, so we do a check to make sure the result was indeed a token. + var tokenAtPosition = getTokenAtPosition(file, position); + if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { + return tokenAtPosition; + } + + return findPrecedingToken(position, file); + } + + export function findNextToken(previousToken: Node, parent: Node): Node { + return find(parent); + + function find(n: Node): Node { + if (isToken(n) && n.pos === previousToken.end) { + // this is token that starts at the end of previous token - return it + return n; + } + + var children = n.getChildren(); + for (var i = 0, len = children.length; i < len; ++i) { + var child = children[i]; + var shouldDiveInChildNode = + // previous token is enclosed somewhere in the child + (child.pos <= previousToken.pos && child.end > previousToken.end) || + // previous token ends exactly at the beginning of child + (child.pos === previousToken.end); + + if (shouldDiveInChildNode && nodeHasTokens(child)) { + return find(child); + } + } + + return undefined; + } + } + + export function findPrecedingToken(position: number, sourceFile: SourceFile, startNode?: Node): Node { + return find(startNode || sourceFile); + + function findRightmostToken(n: Node): Node { + if (isToken(n)) { + return n; + } + + var children = n.getChildren(); + var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); + return candidate && findRightmostToken(candidate); + + } + + function find(n: Node): Node { + if (isToken(n)) { + return n; + } + + var children = n.getChildren(); + for (var i = 0, len = children.length; i < len; ++i) { + var child = children[i]; + if (nodeHasTokens(child)) { + if (position <= child.end) { + if (child.getStart(sourceFile) >= position) { + // actual start of the node is past the position - previous token should be at the end of previous child + var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); + return candidate && findRightmostToken(candidate) + } + else { + // candidate should be in this node + return find(child); + } + } + } + } + + Debug.assert(startNode !== undefined || n.kind === SyntaxKind.SourceFile); + + // Here we know that none of child token nodes embrace the position, + // the only known case is when position is at the end of the file. + // Try to find the rightmost token in the file without filtering. + // Namely we are skipping the check: 'position < node.end' + if (children.length) { + var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); + return candidate && findRightmostToken(candidate); + } + } + + /// finds last node that is considered as candidate for search (isCandidate(node) === true) starting from 'exclusiveStartPosition' + function findRightmostChildNodeWithTokens(children: Node[], exclusiveStartPosition: number): Node { + for (var i = exclusiveStartPosition - 1; i >= 0; --i) { + if (nodeHasTokens(children[i])) { + return children[i]; + } + } + } + } + + function nodeHasTokens(n: Node): boolean { + if (n.kind === SyntaxKind.Unknown) { + return false; + } + + // If we have a token or node that has a non-zero width, it must have tokens. + // Note, that getWidth() does not take trivia into account. + return n.getWidth() !== 0; + } + + export function getTypeArgumentOrTypeParameterList(node: Node): NodeArray { + if (node.kind === SyntaxKind.TypeReference || node.kind === SyntaxKind.CallExpression) { + return (node).typeArguments; + } + + if (isAnyFunction(node) || node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.InterfaceDeclaration) { + return (node).typeParameters; + } + + return undefined; + } + + export function isToken(n: Node): boolean { + return n.kind >= SyntaxKind.FirstToken && n.kind <= SyntaxKind.LastToken; + } + + function isWord(kind: SyntaxKind): boolean { + return kind === SyntaxKind.Identifier || isKeyword(kind); + } + + function isPropertyName(kind: SyntaxKind): boolean { + return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral || isWord(kind); + } + + export function isComment(kind: SyntaxKind): boolean { + return kind === SyntaxKind.SingleLineCommentTrivia || kind === SyntaxKind.MultiLineCommentTrivia; + } + + export function isPunctuation(kind: SyntaxKind): boolean { + return SyntaxKind.FirstPunctuation <= kind && kind <= SyntaxKind.LastPunctuation; + } + + export function isInsideTemplateLiteral(node: LiteralExpression, position: number) { + return (node.getStart() < position && position < node.getEnd()) + || (isUnterminatedTemplateEnd(node) && position === node.getEnd()); + } +} \ No newline at end of file diff --git a/tests/baselines/reference/ArrowFunction1.errors.txt b/tests/baselines/reference/ArrowFunction1.errors.txt index ed868daec13..96f77039224 100644 --- a/tests/baselines/reference/ArrowFunction1.errors.txt +++ b/tests/baselines/reference/ArrowFunction1.errors.txt @@ -1,6 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction1.ts(1,13): error TS1110: Type expected. + + ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction1.ts (1 errors) ==== var v = (a: ) => { ~ -!!! Type expected. +!!! error TS1110: Type expected. }; \ No newline at end of file diff --git a/tests/baselines/reference/ArrowFunction2.errors.txt b/tests/baselines/reference/ArrowFunction2.errors.txt index eef47a30ba2..26e1f336cb6 100644 --- a/tests/baselines/reference/ArrowFunction2.errors.txt +++ b/tests/baselines/reference/ArrowFunction2.errors.txt @@ -1,8 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts(1,14): error TS1009: Trailing comma not allowed. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts(1,13): error TS2304: Cannot find name 'b'. + + ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts (2 errors) ==== var v = (a: b,) => { ~ -!!! Trailing comma not allowed. +!!! error TS1009: Trailing comma not allowed. ~ -!!! Cannot find name 'b'. +!!! error TS2304: Cannot find name 'b'. }; \ No newline at end of file diff --git a/tests/baselines/reference/ArrowFunction3.errors.txt b/tests/baselines/reference/ArrowFunction3.errors.txt index a286116ff29..be20d77c343 100644 --- a/tests/baselines/reference/ArrowFunction3.errors.txt +++ b/tests/baselines/reference/ArrowFunction3.errors.txt @@ -1,10 +1,15 @@ +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts(1,12): error TS1005: ',' expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts(1,14): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts(1,10): error TS2304: Cannot find name 'a'. + + ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts (3 errors) ==== var v = (a): => { ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Cannot find name 'a'. +!!! error TS2304: Cannot find name 'a'. }; \ No newline at end of file diff --git a/tests/baselines/reference/ArrowFunctionExpression1.errors.txt b/tests/baselines/reference/ArrowFunctionExpression1.errors.txt index 25c9af3d286..593b75d4ee2 100644 --- a/tests/baselines/reference/ArrowFunctionExpression1.errors.txt +++ b/tests/baselines/reference/ArrowFunctionExpression1.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/ArrowFunctionExpression1.ts(1,10): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/ArrowFunctionExpression1.ts (1 errors) ==== var v = (public x: string) => { }; ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. \ No newline at end of file +!!! error TS2369: A parameter property is only allowed in a constructor implementation. \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt index f7d6aafc017..aa97ca3caa5 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt @@ -1,3 +1,10 @@ +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(10,19): error TS2304: Cannot find name 'T'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(20,12): error TS2304: Cannot find name 'T'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(22,23): error TS2304: Cannot find name 'T'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(35,26): error TS2304: Cannot find name 'T'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): error TS2304: Cannot find name 'T'. + + ==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts (5 errors) ==== // all expected to be errors @@ -10,7 +17,7 @@ module clodule1 { function f(x: T) { } ~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. } class clodule2{ @@ -22,11 +29,11 @@ module clodule2 { var x: T; ~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. class D{ ~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. id: string; value: U; } @@ -41,7 +48,7 @@ module clodule3 { export var y = { id: T }; ~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. } class clodule4{ @@ -54,7 +61,7 @@ class D { name: T; ~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. } } \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt index dad412363f7..d200258fdb1 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt @@ -1,16 +1,22 @@ -==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (1 errors) ==== +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(5,12): error TS2300: Duplicate identifier 'fn'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(10,21): error TS2300: Duplicate identifier 'fn'. + + +==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (2 errors) ==== class clodule { id: string; value: T; static fn(id: U) { } + ~~ +!!! error TS2300: Duplicate identifier 'fn'. } module clodule { // error: duplicate identifier expected export function fn(x: T, y: T): T { ~~ -!!! Duplicate identifier 'fn'. +!!! error TS2300: Duplicate identifier 'fn'. return x; } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt index c45ffab4156..474613e283f 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt @@ -1,16 +1,22 @@ -==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (1 errors) ==== +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(5,12): error TS2300: Duplicate identifier 'fn'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(10,21): error TS2300: Duplicate identifier 'fn'. + + +==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (2 errors) ==== class clodule { id: string; value: T; static fn(id: string) { } + ~~ +!!! error TS2300: Duplicate identifier 'fn'. } module clodule { // error: duplicate identifier expected export function fn(x: T, y: T): T { ~~ -!!! Duplicate identifier 'fn'. +!!! error TS2300: Duplicate identifier 'fn'. return x; } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt index c38333f9732..3feee7069d0 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(11,16): error TS2341: Property 'sfn' is private and only accessible within class 'clodule'. + + ==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (1 errors) ==== class clodule { id: string; @@ -11,7 +14,7 @@ export function fn(x: T, y: T): number { return clodule.sfn('a'); ~~~~~~~~~~~ -!!! Property 'clodule.sfn' is inaccessible. +!!! error TS2341: Property 'sfn' is private and only accessible within class 'clodule'. } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt index eb2ef95f795..a59953e7fb2 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt @@ -1,14 +1,22 @@ -==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts (2 errors) ==== +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(4,12): error TS2300: Duplicate identifier 'Origin'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(8,21): error TS2300: Duplicate identifier 'Origin'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(16,16): error TS2300: Duplicate identifier 'Origin'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(20,25): error TS2300: Duplicate identifier 'Origin'. + + +==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts (4 errors) ==== class Point { constructor(public x: number, public y: number) { } static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246 + ~~~~~~ +!!! error TS2300: Duplicate identifier 'Origin'. } module Point { export function Origin() { return null; } //expected duplicate identifier error ~~~~~~ -!!! Duplicate identifier 'Origin'. +!!! error TS2300: Duplicate identifier 'Origin'. } @@ -17,11 +25,13 @@ constructor(public x: number, public y: number) { } static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246 + ~~~~~~ +!!! error TS2300: Duplicate identifier 'Origin'. } export module Point { export function Origin() { return ""; }//expected duplicate identifier error ~~~~~~ -!!! Duplicate identifier 'Origin'. +!!! error TS2300: Duplicate identifier 'Origin'. } } \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt index ad395751ebf..88ad9f358be 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt @@ -1,14 +1,22 @@ -==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts (2 errors) ==== +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(4,12): error TS2300: Duplicate identifier 'Origin'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(8,16): error TS2300: Duplicate identifier 'Origin'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(16,16): error TS2300: Duplicate identifier 'Origin'. +tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(20,20): error TS2300: Duplicate identifier 'Origin'. + + +==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts (4 errors) ==== class Point { constructor(public x: number, public y: number) { } static Origin: Point = { x: 0, y: 0 }; + ~~~~~~ +!!! error TS2300: Duplicate identifier 'Origin'. } module Point { export var Origin = ""; //expected duplicate identifier error ~~~~~~ -!!! Duplicate identifier 'Origin'. +!!! error TS2300: Duplicate identifier 'Origin'. } @@ -17,11 +25,13 @@ constructor(public x: number, public y: number) { } static Origin: Point = { x: 0, y: 0 }; + ~~~~~~ +!!! error TS2300: Duplicate identifier 'Origin'. } export module Point { export var Origin = ""; //expected duplicate identifier error ~~~~~~ -!!! Duplicate identifier 'Origin'. +!!! error TS2300: Duplicate identifier 'Origin'. } } \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt index d47fc51f4e8..4c707dfd861 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged + + ==== tests/cases/conformance/internalModules/DeclarationMerging/class.ts (0 errors) ==== module X.Y { export class Point { @@ -14,7 +17,7 @@ module X.Y { export module Point { ~~~~~ -!!! A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged export var Origin = new Point(0, 0); } } diff --git a/tests/baselines/reference/ClassDeclaration10.errors.txt b/tests/baselines/reference/ClassDeclaration10.errors.txt index be26c1d5b47..4d195961f81 100644 --- a/tests/baselines/reference/ClassDeclaration10.errors.txt +++ b/tests/baselines/reference/ClassDeclaration10.errors.txt @@ -1,9 +1,13 @@ +tests/cases/compiler/ClassDeclaration10.ts(2,4): error TS2390: Constructor implementation is missing. +tests/cases/compiler/ClassDeclaration10.ts(3,4): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/ClassDeclaration10.ts (2 errors) ==== class C { constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation is missing. +!!! error TS2390: Constructor implementation is missing. foo(); ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration11.errors.txt b/tests/baselines/reference/ClassDeclaration11.errors.txt index b92a04cec6c..518e62803ea 100644 --- a/tests/baselines/reference/ClassDeclaration11.errors.txt +++ b/tests/baselines/reference/ClassDeclaration11.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/ClassDeclaration11.ts(2,4): error TS2390: Constructor implementation is missing. + + ==== tests/cases/compiler/ClassDeclaration11.ts (1 errors) ==== class C { constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation is missing. +!!! error TS2390: Constructor implementation is missing. foo() { } } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration13.errors.txt b/tests/baselines/reference/ClassDeclaration13.errors.txt index 406d41c20de..7b001022d9d 100644 --- a/tests/baselines/reference/ClassDeclaration13.errors.txt +++ b/tests/baselines/reference/ClassDeclaration13.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/ClassDeclaration13.ts(3,4): error TS2389: Function implementation name must be 'foo'. + + ==== tests/cases/compiler/ClassDeclaration13.ts (1 errors) ==== class C { foo(); bar() { } ~~~ -!!! Function implementation name must be 'foo'. +!!! error TS2389: Function implementation name must be 'foo'. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration14.errors.txt b/tests/baselines/reference/ClassDeclaration14.errors.txt index cf181a7eb8b..af87daef997 100644 --- a/tests/baselines/reference/ClassDeclaration14.errors.txt +++ b/tests/baselines/reference/ClassDeclaration14.errors.txt @@ -1,9 +1,13 @@ +tests/cases/compiler/ClassDeclaration14.ts(2,4): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/ClassDeclaration14.ts(3,4): error TS2390: Constructor implementation is missing. + + ==== tests/cases/compiler/ClassDeclaration14.ts (2 errors) ==== class C { foo(); ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation is missing. +!!! error TS2390: Constructor implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration15.errors.txt b/tests/baselines/reference/ClassDeclaration15.errors.txt index 08c33f18758..27cd8f9aa4d 100644 --- a/tests/baselines/reference/ClassDeclaration15.errors.txt +++ b/tests/baselines/reference/ClassDeclaration15.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/ClassDeclaration15.ts(2,4): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/ClassDeclaration15.ts (1 errors) ==== class C { foo(); ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. constructor() { } } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration21.errors.txt b/tests/baselines/reference/ClassDeclaration21.errors.txt index 8b49f1df543..36dc01d75d0 100644 --- a/tests/baselines/reference/ClassDeclaration21.errors.txt +++ b/tests/baselines/reference/ClassDeclaration21.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/ClassDeclaration21.ts(3,5): error TS2389: Function implementation name must be '0'. + + ==== tests/cases/compiler/ClassDeclaration21.ts (1 errors) ==== class C { 0(); 1() { } ~ -!!! Function implementation name must be '0'. +!!! error TS2389: Function implementation name must be '0'. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration22.errors.txt b/tests/baselines/reference/ClassDeclaration22.errors.txt index 34832185e12..a297ae82596 100644 --- a/tests/baselines/reference/ClassDeclaration22.errors.txt +++ b/tests/baselines/reference/ClassDeclaration22.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/ClassDeclaration22.ts(3,5): error TS2389: Function implementation name must be '"foo"'. + + ==== tests/cases/compiler/ClassDeclaration22.ts (1 errors) ==== class C { "foo"(); "bar"() { } ~~~~~ -!!! Function implementation name must be '"foo"'. +!!! error TS2389: Function implementation name must be '"foo"'. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration24.errors.txt b/tests/baselines/reference/ClassDeclaration24.errors.txt index a64ad658991..62d26eb792a 100644 --- a/tests/baselines/reference/ClassDeclaration24.errors.txt +++ b/tests/baselines/reference/ClassDeclaration24.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/ClassDeclaration24.ts(1,7): error TS2414: Class name cannot be 'any' + + ==== tests/cases/compiler/ClassDeclaration24.ts (1 errors) ==== class any { ~~~ -!!! Class name cannot be 'any' +!!! error TS2414: Class name cannot be 'any' } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration25.errors.txt b/tests/baselines/reference/ClassDeclaration25.errors.txt index 3a73349506e..964974481d6 100644 --- a/tests/baselines/reference/ClassDeclaration25.errors.txt +++ b/tests/baselines/reference/ClassDeclaration25.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/ClassDeclaration25.ts(6,5): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/ClassDeclaration25.ts(7,5): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/ClassDeclaration25.ts (2 errors) ==== interface IList { data(): T; @@ -6,9 +10,9 @@ class List implements IList { data(): U; ~~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. next(): string; ~~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration8.errors.txt b/tests/baselines/reference/ClassDeclaration8.errors.txt index ebf1cadd764..3894c91bdc8 100644 --- a/tests/baselines/reference/ClassDeclaration8.errors.txt +++ b/tests/baselines/reference/ClassDeclaration8.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/ClassDeclaration8.ts(2,3): error TS2390: Constructor implementation is missing. + + ==== tests/cases/compiler/ClassDeclaration8.ts (1 errors) ==== class C { constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation is missing. +!!! error TS2390: Constructor implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration9.errors.txt b/tests/baselines/reference/ClassDeclaration9.errors.txt index 03813d14683..7f13d41001a 100644 --- a/tests/baselines/reference/ClassDeclaration9.errors.txt +++ b/tests/baselines/reference/ClassDeclaration9.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/ClassDeclaration9.ts(2,4): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/ClassDeclaration9.ts (1 errors) ==== class C { foo(); ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName10_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName10_es6.errors.txt new file mode 100644 index 00000000000..ba7154a9298 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName10_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName10_es6.ts(2,8): error TS1005: ';' expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName10_es6.ts (1 errors) ==== + class C { + [e] = 1 + ~ +!!! error TS1005: ';' expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName11_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName11_es6.errors.txt new file mode 100644 index 00000000000..3f96913c1d5 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName11_es6.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts(2,7): error TS1005: ';' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts(2,8): error TS1109: Expression expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts (3 errors) ==== + class C { + [e](); + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName12_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName12_es6.errors.txt new file mode 100644 index 00000000000..fefff058fe1 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName12_es6.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts(2,7): error TS1005: ';' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts(2,10): error TS1005: '=>' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts (3 errors) ==== + class C { + [e]() { } + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: '=>' expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName13_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName13_es6.errors.txt new file mode 100644 index 00000000000..3f8c10fc643 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName13_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName13_es6.ts(1,11): error TS1022: An index signature parameter must have a type annotation. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName13_es6.ts (1 errors) ==== + var v: { [e]: number }; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName14_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName14_es6.errors.txt new file mode 100644 index 00000000000..7d6052b4179 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName14_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName14_es6.ts(1,13): error TS1005: ';' expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName14_es6.ts (1 errors) ==== + var v: { [e](): number }; + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName15_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName15_es6.errors.txt new file mode 100644 index 00000000000..689df40f985 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName15_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName15_es6.ts(1,32): error TS1022: An index signature parameter must have a type annotation. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName15_es6.ts (1 errors) ==== + var v: { [e: number]: string; [e]: number }; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName16_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName16_es6.errors.txt new file mode 100644 index 00000000000..c3de61ddf07 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName16_es6.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(2,3): error TS1132: Enum member expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(3,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(2,3): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(2,4): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts (4 errors) ==== + enum E { + [e] = 1 + ~ +!!! error TS1132: Enum member expected. + ~~~ +!!! error TS2364: Invalid left-hand side of assignment expression. + ~ +!!! error TS2304: Cannot find name 'e'. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName17_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName17_es6.errors.txt new file mode 100644 index 00000000000..4b8caf1e62d --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName17_es6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,15): error TS1003: Identifier expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,22): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,26): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,16): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts (4 errors) ==== + var v = { set [e](v) { } } + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName18_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName18_es6.errors.txt new file mode 100644 index 00000000000..8e409750b5c --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName18_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName18_es6.ts(1,13): error TS1005: ';' expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName18_es6.ts (1 errors) ==== + var v: { [e]?(): number }; + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName19_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName19_es6.errors.txt new file mode 100644 index 00000000000..1833deef789 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName19_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName19_es6.ts(1,13): error TS1005: ';' expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName19_es6.ts (1 errors) ==== + var v: { [e]? }; + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName1_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName1_es6.errors.txt new file mode 100644 index 00000000000..260ff20dc36 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName1_es6.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts(1,11): error TS1136: Property assignment expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts(1,15): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts(1,12): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts (3 errors) ==== + var v = { [e] }; + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName2_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName2_es6.errors.txt new file mode 100644 index 00000000000..f0a06ef84bc --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName2_es6.errors.txt @@ -0,0 +1,19 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,11): error TS1136: Property assignment expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,14): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,16): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,18): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,12): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts (5 errors) ==== + var v = { [e]: 1 }; + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName3_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName3_es6.errors.txt new file mode 100644 index 00000000000..3f1e5d707a8 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName3_es6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,11): error TS1136: Property assignment expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,17): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,21): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,12): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts (4 errors) ==== + var v = { [e]() { } }; + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName4_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName4_es6.errors.txt new file mode 100644 index 00000000000..a1f22f611f9 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName4_es6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,15): error TS1003: Identifier expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,21): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,25): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,16): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts (4 errors) ==== + var v = { get [e]() { } }; + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName5_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName5_es6.errors.txt new file mode 100644 index 00000000000..2ce2faaee62 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName5_es6.errors.txt @@ -0,0 +1,19 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,18): error TS1005: ':' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,28): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,32): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,18): error TS2304: Cannot find name 'get'. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,23): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts (5 errors) ==== + var v = { public get [e]() { } }; + ~~~ +!!! error TS1005: ':' expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~ +!!! error TS2304: Cannot find name 'get'. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName6_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName6_es6.errors.txt new file mode 100644 index 00000000000..ca6bce48295 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName6_es6.errors.txt @@ -0,0 +1,28 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,11): error TS1136: Property assignment expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,14): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,16): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,26): error TS1005: ';' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,30): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,12): error TS2304: Cannot find name 'e'. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,20): error TS2304: Cannot find name 'e'. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,24): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts (8 errors) ==== + var v = { [e]: 1, [e + e]: 2 }; + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. + ~ +!!! error TS2304: Cannot find name 'e'. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName7_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName7_es6.errors.txt new file mode 100644 index 00000000000..00be8f610e0 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName7_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName7_es6.ts(2,5): error TS1022: An index signature parameter must have a type annotation. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName7_es6.ts (1 errors) ==== + class C { + [e] + ~ +!!! error TS1022: An index signature parameter must have a type annotation. + } \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName8_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName8_es6.errors.txt new file mode 100644 index 00000000000..58386bbe177 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName8_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName8_es6.ts(2,12): error TS1022: An index signature parameter must have a type annotation. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName8_es6.ts (1 errors) ==== + class C { + public [e] + ~ +!!! error TS1022: An index signature parameter must have a type annotation. + } \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName9_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName9_es6.errors.txt new file mode 100644 index 00000000000..0872f69aebe --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName9_es6.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts(2,5): error TS1022: An index signature parameter must have a type annotation. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts(2,9): error TS2304: Cannot find name 'Type'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts (2 errors) ==== + class C { + [e]: Type + ~ +!!! error TS1022: An index signature parameter must have a type annotation. + ~~~~ +!!! error TS2304: Cannot find name 'Type'. + } \ No newline at end of file diff --git a/tests/baselines/reference/ExportAssignment7.errors.txt b/tests/baselines/reference/ExportAssignment7.errors.txt index ff05fb7eda0..6ba0f480e7f 100644 --- a/tests/baselines/reference/ExportAssignment7.errors.txt +++ b/tests/baselines/reference/ExportAssignment7.errors.txt @@ -1,11 +1,16 @@ +tests/cases/compiler/ExportAssignment7.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/ExportAssignment7.ts(4,1): error TS2304: Cannot find name 'B'. +tests/cases/compiler/ExportAssignment7.ts(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + ==== tests/cases/compiler/ExportAssignment7.ts (3 errors) ==== export class C { ~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. } export = B; ~~~~~~~~~~~ -!!! Cannot find name 'B'. +!!! error TS2304: Cannot find name 'B'. ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. \ No newline at end of file +!!! 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/ExportAssignment8.errors.txt b/tests/baselines/reference/ExportAssignment8.errors.txt index 2f1d1f5b960..4dc35a9f0b7 100644 --- a/tests/baselines/reference/ExportAssignment8.errors.txt +++ b/tests/baselines/reference/ExportAssignment8.errors.txt @@ -1,11 +1,16 @@ +tests/cases/compiler/ExportAssignment8.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/ExportAssignment8.ts(1,1): error TS2304: Cannot find name 'B'. +tests/cases/compiler/ExportAssignment8.ts(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + ==== tests/cases/compiler/ExportAssignment8.ts (3 errors) ==== export = B; ~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ~~~~~~~~~~~ -!!! Cannot find name 'B'. +!!! error TS2304: Cannot find name 'B'. ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. export class C { } \ No newline at end of file diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt index b56c3a9fe93..81798538bb7 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(8,27): error TS1005: ';' expected. +tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(8,43): error TS1005: ';' expected. +tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(9,30): error TS1005: ';' expected. + + ==== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts (3 errors) ==== module A { @@ -8,11 +13,11 @@ export var UnitSquare : { top: { left: Point, right: Point }, ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. bottom: { left: Point, right: Point } ~ -!!! ';' expected. +!!! error TS1005: ';' expected. } = null; } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt index 1a9ea82a006..df266681812 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. +tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. + + ==== tests/cases/conformance/internalModules/DeclarationMerging/function.ts (0 errors) ==== module A { export function Point() { @@ -9,7 +14,7 @@ module A { export module Point { ~~~~~ -!!! A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged export var Origin = { x: 0, y: 0 }; } } @@ -18,7 +23,7 @@ var fn: () => { x: number; y: number }; var fn = A.Point; ~~ -!!! Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. var cl: { x: number; y: number; } var cl = A.Point(); @@ -40,7 +45,7 @@ var fn: () => { x: number; y: number }; var fn = B.Point; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected ~~ -!!! Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. var cl: { x: number; y: number; } var cl = B.Point(); diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.js b/tests/baselines/reference/FunctionDeclaration10_es6.js new file mode 100644 index 00000000000..51694533964 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration10_es6.js @@ -0,0 +1,8 @@ +//// [FunctionDeclaration10_es6.ts] +function * foo(a = yield => yield) { +} + +//// [FunctionDeclaration10_es6.js] +function foo(a) { + if (a === void 0) { a = function (yield) { return yield; }; } +} diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.types b/tests/baselines/reference/FunctionDeclaration10_es6.types new file mode 100644 index 00000000000..973de97fab1 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration10_es6.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts === +function * foo(a = yield => yield) { +>foo : (a?: (yield: any) => any) => void +>a : (yield: any) => any +>yield => yield : (yield: any) => any +>yield : any +>yield : any +} diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.js b/tests/baselines/reference/FunctionDeclaration11_es6.js new file mode 100644 index 00000000000..ba497b3e529 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration11_es6.js @@ -0,0 +1,7 @@ +//// [FunctionDeclaration11_es6.ts] +function * yield() { +} + +//// [FunctionDeclaration11_es6.js] +function yield() { +} diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.types b/tests/baselines/reference/FunctionDeclaration11_es6.types new file mode 100644 index 00000000000..f57a385c359 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration11_es6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts === +function * yield() { +>yield : () => void +} diff --git a/tests/baselines/reference/FunctionDeclaration12_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration12_es6.errors.txt new file mode 100644 index 00000000000..358ec5ea041 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration12_es6.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts(1,20): error TS1005: '(' expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts(1,25): error TS1005: '=' expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts(1,28): error TS1005: '=>' expected. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts (3 errors) ==== + var v = function * yield() { } + ~~~~~ +!!! error TS1005: '(' expected. + ~ +!!! error TS1005: '=' expected. + ~ +!!! error TS1005: '=>' expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt new file mode 100644 index 00000000000..1f921475fd3 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(3,11): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (1 errors) ==== + function * foo() { + // Legal to use 'yield' in a type context. + var v: yield; + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.js b/tests/baselines/reference/FunctionDeclaration13_es6.js new file mode 100644 index 00000000000..4c82b037569 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration13_es6.js @@ -0,0 +1,12 @@ +//// [FunctionDeclaration13_es6.ts] +function * foo() { + // Legal to use 'yield' in a type context. + var v: yield; +} + + +//// [FunctionDeclaration13_es6.js] +function foo() { + // Legal to use 'yield' in a type context. + var v; +} diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.js b/tests/baselines/reference/FunctionDeclaration1_es6.js new file mode 100644 index 00000000000..262c7ea02fb --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration1_es6.js @@ -0,0 +1,7 @@ +//// [FunctionDeclaration1_es6.ts] +function * foo() { +} + +//// [FunctionDeclaration1_es6.js] +function foo() { +} diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.types b/tests/baselines/reference/FunctionDeclaration1_es6.types new file mode 100644 index 00000000000..69b26e5dd10 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration1_es6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts === +function * foo() { +>foo : () => void +} diff --git a/tests/baselines/reference/FunctionDeclaration2_es6.js b/tests/baselines/reference/FunctionDeclaration2_es6.js new file mode 100644 index 00000000000..dc73cad330f --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration2_es6.js @@ -0,0 +1,7 @@ +//// [FunctionDeclaration2_es6.ts] +function f(yield) { +} + +//// [FunctionDeclaration2_es6.js] +function f(yield) { +} diff --git a/tests/baselines/reference/FunctionDeclaration2_es6.types b/tests/baselines/reference/FunctionDeclaration2_es6.types new file mode 100644 index 00000000000..f23d9cf6840 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration2_es6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts === +function f(yield) { +>f : (yield: any) => void +>yield : any +} diff --git a/tests/baselines/reference/FunctionDeclaration3.errors.txt b/tests/baselines/reference/FunctionDeclaration3.errors.txt index 40a51283449..648d2a7ff79 100644 --- a/tests/baselines/reference/FunctionDeclaration3.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration3.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/FunctionDeclaration3.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/FunctionDeclaration3.ts (1 errors) ==== function foo(); ~~~ -!!! Function implementation is missing or not immediately following the declaration. \ No newline at end of file +!!! error TS2391: Function implementation is missing or not immediately following the declaration. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration3_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration3_es6.errors.txt new file mode 100644 index 00000000000..409baef3a50 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration3_es6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration3_es6.ts(1,20): error TS2372: Parameter 'yield' cannot be referenced in its initializer. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration3_es6.ts (1 errors) ==== + function f(yield = yield) { + ~~~~~ +!!! error TS2372: Parameter 'yield' cannot be referenced in its initializer. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration3_es6.js b/tests/baselines/reference/FunctionDeclaration3_es6.js new file mode 100644 index 00000000000..e1df936dd21 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration3_es6.js @@ -0,0 +1,8 @@ +//// [FunctionDeclaration3_es6.ts] +function f(yield = yield) { +} + +//// [FunctionDeclaration3_es6.js] +function f(yield) { + if (yield === void 0) { yield = yield; } +} diff --git a/tests/baselines/reference/FunctionDeclaration4.errors.txt b/tests/baselines/reference/FunctionDeclaration4.errors.txt index da15ad0efa4..a744ac9bfd5 100644 --- a/tests/baselines/reference/FunctionDeclaration4.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration4.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/FunctionDeclaration4.ts(2,10): error TS2389: Function implementation name must be 'foo'. + + ==== tests/cases/compiler/FunctionDeclaration4.ts (1 errors) ==== function foo(); function bar() { } ~~~ -!!! Function implementation name must be 'foo'. \ No newline at end of file +!!! error TS2389: Function implementation name must be 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration4_es6.js b/tests/baselines/reference/FunctionDeclaration4_es6.js new file mode 100644 index 00000000000..da6c695fcb9 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration4_es6.js @@ -0,0 +1,7 @@ +//// [FunctionDeclaration4_es6.ts] +function yield() { +} + +//// [FunctionDeclaration4_es6.js] +function yield() { +} diff --git a/tests/baselines/reference/FunctionDeclaration4_es6.types b/tests/baselines/reference/FunctionDeclaration4_es6.types new file mode 100644 index 00000000000..e4f102a8f70 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration4_es6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts === +function yield() { +>yield : () => void +} diff --git a/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt new file mode 100644 index 00000000000..9a8be921795 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt @@ -0,0 +1,17 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,14): error TS1138: Parameter declaration expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,19): error TS1005: ';' expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,14): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts (4 errors) ==== + function*foo(yield) { + ~~~~~ +!!! error TS1138: Parameter declaration expected. + ~ +!!! error TS1005: ';' expected. + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6.errors.txt b/tests/baselines/reference/FunctionDeclaration6.errors.txt index c7e039cac13..89f9aff9ca7 100644 --- a/tests/baselines/reference/FunctionDeclaration6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration6.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/FunctionDeclaration6.ts(3,14): error TS2389: Function implementation name must be 'foo'. + + ==== tests/cases/compiler/FunctionDeclaration6.ts (1 errors) ==== { function foo(); function bar() { } ~~~ -!!! Function implementation name must be 'foo'. +!!! error TS2389: Function implementation name must be 'foo'. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt new file mode 100644 index 00000000000..7d5eb768be6 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,18): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (1 errors) ==== + function*foo(a = yield) { + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.js b/tests/baselines/reference/FunctionDeclaration6_es6.js new file mode 100644 index 00000000000..07b3ff52212 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration6_es6.js @@ -0,0 +1,8 @@ +//// [FunctionDeclaration6_es6.ts] +function*foo(a = yield) { +} + +//// [FunctionDeclaration6_es6.js] +function foo(a) { + if (a === void 0) { a = yield; } +} diff --git a/tests/baselines/reference/FunctionDeclaration7.errors.txt b/tests/baselines/reference/FunctionDeclaration7.errors.txt index fcc48feb2d8..8f8230fe73e 100644 --- a/tests/baselines/reference/FunctionDeclaration7.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration7.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/FunctionDeclaration7.ts(2,13): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/FunctionDeclaration7.ts (1 errors) ==== module M { function foo(); ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt new file mode 100644 index 00000000000..95ad904bdd9 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,20): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (1 errors) ==== + function*bar() { + // 'yield' here is an identifier, and not a yield expression. + function*foo(a = yield) { + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.js b/tests/baselines/reference/FunctionDeclaration7_es6.js new file mode 100644 index 00000000000..661e1668e0f --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration7_es6.js @@ -0,0 +1,14 @@ +//// [FunctionDeclaration7_es6.ts] +function*bar() { + // 'yield' here is an identifier, and not a yield expression. + function*foo(a = yield) { + } +} + +//// [FunctionDeclaration7_es6.js] +function bar() { + // 'yield' here is an identifier, and not a yield expression. + function foo(a) { + if (a === void 0) { a = yield; } + } +} diff --git a/tests/baselines/reference/FunctionDeclaration8_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration8_es6.errors.txt new file mode 100644 index 00000000000..a30b8d80310 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration8_es6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,11): error TS1136: Property assignment expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,18): error TS1005: ',' expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,24): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,12): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts (4 errors) ==== + var v = { [yield]: foo } + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt new file mode 100644 index 00000000000..b4cf83a7b6c --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(2,13): error TS1136: Property assignment expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(2,20): error TS1005: ',' expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (3 errors) ==== + function * foo() { + var v = { [yield]: foo } + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionExpression1_es6.js b/tests/baselines/reference/FunctionExpression1_es6.js new file mode 100644 index 00000000000..7c8d82f4ca8 --- /dev/null +++ b/tests/baselines/reference/FunctionExpression1_es6.js @@ -0,0 +1,6 @@ +//// [FunctionExpression1_es6.ts] +var v = function * () { } + +//// [FunctionExpression1_es6.js] +var v = function () { +}; diff --git a/tests/baselines/reference/FunctionExpression1_es6.types b/tests/baselines/reference/FunctionExpression1_es6.types new file mode 100644 index 00000000000..c857d53baba --- /dev/null +++ b/tests/baselines/reference/FunctionExpression1_es6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts === +var v = function * () { } +>v : () => void +>function * () { } : () => void + diff --git a/tests/baselines/reference/FunctionExpression2_es6.js b/tests/baselines/reference/FunctionExpression2_es6.js new file mode 100644 index 00000000000..0a2468bcb8c --- /dev/null +++ b/tests/baselines/reference/FunctionExpression2_es6.js @@ -0,0 +1,6 @@ +//// [FunctionExpression2_es6.ts] +var v = function * foo() { } + +//// [FunctionExpression2_es6.js] +var v = function foo() { +}; diff --git a/tests/baselines/reference/FunctionExpression2_es6.types b/tests/baselines/reference/FunctionExpression2_es6.types new file mode 100644 index 00000000000..7bd9f090435 --- /dev/null +++ b/tests/baselines/reference/FunctionExpression2_es6.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts === +var v = function * foo() { } +>v : () => void +>function * foo() { } : () => void +>foo : () => void + diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.js b/tests/baselines/reference/FunctionPropertyAssignments1_es6.js new file mode 100644 index 00000000000..a451dcfb363 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments1_es6.js @@ -0,0 +1,6 @@ +//// [FunctionPropertyAssignments1_es6.ts] +var v = { *foo() { } } + +//// [FunctionPropertyAssignments1_es6.js] +var v = { foo: function () { +} }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.types b/tests/baselines/reference/FunctionPropertyAssignments1_es6.types new file mode 100644 index 00000000000..2dfbf5cb657 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments1_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts === +var v = { *foo() { } } +>v : { foo: () => void; } +>{ *foo() { } } : { foo: () => void; } +>foo : () => void +>*foo() { } : () => void + diff --git a/tests/baselines/reference/FunctionPropertyAssignments2_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments2_es6.errors.txt new file mode 100644 index 00000000000..f0287f12696 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments2_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts(1,12): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts (1 errors) ==== + var v = { *() { } } + ~ +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments3_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments3_es6.errors.txt new file mode 100644 index 00000000000..b5873e80796 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments3_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts(1,12): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts (1 errors) ==== + var v = { *{ } } + ~ +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments4_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments4_es6.errors.txt new file mode 100644 index 00000000000..285341f04dc --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments4_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments4_es6.ts(1,13): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments4_es6.ts (1 errors) ==== + var v = { * } + ~ +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt new file mode 100644 index 00000000000..961dabaa996 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,12): error TS1003: Identifier expected. +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,22): error TS1005: ',' expected. +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,26): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,13): error TS2304: Cannot find name 'foo'. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (4 errors) ==== + var v = { *[foo()]() { } } + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~ +!!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments6_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments6_es6.errors.txt new file mode 100644 index 00000000000..a4e8450bd73 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments6_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts(1,12): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts (1 errors) ==== + var v = { *() { } } + ~ +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/InterfaceDeclaration8.errors.txt b/tests/baselines/reference/InterfaceDeclaration8.errors.txt index eba4ccd7023..e916947d2bd 100644 --- a/tests/baselines/reference/InterfaceDeclaration8.errors.txt +++ b/tests/baselines/reference/InterfaceDeclaration8.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/InterfaceDeclaration8.ts(1,11): error TS2427: Interface name cannot be 'string' + + ==== tests/cases/compiler/InterfaceDeclaration8.ts (1 errors) ==== interface string { ~~~~~~ -!!! Interface name cannot be 'string' +!!! error TS2427: Interface name cannot be 'string' } \ No newline at end of file diff --git a/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt b/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt index c32511eba0d..9fd7043faa6 100644 --- a/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt +++ b/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts(5,9): error TS2304: Cannot find name 'M'. +tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts(7,15): error TS2304: Cannot find name 'M'. + + ==== tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts (2 errors) ==== module M { export interface Point { x: number; y: number } @@ -5,9 +9,9 @@ var m = M; // Error, not instantiated can not be used as var ~ -!!! Cannot find name 'M'. +!!! error TS2304: Cannot find name 'M'. var x: typeof M; // Error only a namespace ~ -!!! Cannot find name 'M'. +!!! error TS2304: Cannot find name 'M'. \ No newline at end of file diff --git a/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt b/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt index c96547e0aa7..6ed8a2d29cd 100644 --- a/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt +++ b/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/MemberAccessorDeclaration15.ts(2,8): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/MemberAccessorDeclaration15.ts(2,12): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/MemberAccessorDeclaration15.ts (2 errors) ==== class C { set Foo(public a: number) { } ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.js b/tests/baselines/reference/MemberFunctionDeclaration1_es6.js new file mode 100644 index 00000000000..86e7c9d418a --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration1_es6.js @@ -0,0 +1,13 @@ +//// [MemberFunctionDeclaration1_es6.ts] +class C { + *foo() { } +} + +//// [MemberFunctionDeclaration1_es6.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.types b/tests/baselines/reference/MemberFunctionDeclaration1_es6.types new file mode 100644 index 00000000000..265d3fdb291 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration1_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts === +class C { +>C : C + + *foo() { } +>foo : () => void +} diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.js b/tests/baselines/reference/MemberFunctionDeclaration2_es6.js new file mode 100644 index 00000000000..efd60844dc7 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration2_es6.js @@ -0,0 +1,13 @@ +//// [MemberFunctionDeclaration2_es6.ts] +class C { + public * foo() { } +} + +//// [MemberFunctionDeclaration2_es6.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.types b/tests/baselines/reference/MemberFunctionDeclaration2_es6.types new file mode 100644 index 00000000000..e1e3f9d17e5 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration2_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts === +class C { +>C : C + + public * foo() { } +>foo : () => void +} diff --git a/tests/baselines/reference/MemberFunctionDeclaration3_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration3_es6.errors.txt new file mode 100644 index 00000000000..b3a2de4eec6 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration3_es6.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,5): error TS1003: Identifier expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,10): error TS1005: ';' expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,13): error TS1005: '=>' expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts (4 errors) ==== + class C { + *[foo]() { } + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: '=>' expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration4_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration4_es6.errors.txt new file mode 100644 index 00000000000..988527ccfd7 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration4_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration4_es6.ts(2,5): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration4_es6.ts (1 errors) ==== + class C { + *() { } + ~ +!!! error TS1003: Identifier expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration5_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration5_es6.errors.txt new file mode 100644 index 00000000000..e27d6198104 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration5_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration5_es6.ts(3,1): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration5_es6.ts (1 errors) ==== + class C { + * + } + ~ +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt new file mode 100644 index 00000000000..b79a61c8866 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts(3,1): error TS1005: '(' expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts(2,5): error TS2391: Function implementation is missing or not immediately following the declaration. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts (2 errors) ==== + class C { + *foo + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + } + ~ +!!! error TS1005: '(' expected. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.js b/tests/baselines/reference/MemberFunctionDeclaration7_es6.js new file mode 100644 index 00000000000..211713c6e14 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration7_es6.js @@ -0,0 +1,13 @@ +//// [MemberFunctionDeclaration7_es6.ts] +class C { + *foo() { } +} + +//// [MemberFunctionDeclaration7_es6.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.types b/tests/baselines/reference/MemberFunctionDeclaration7_es6.types new file mode 100644 index 00000000000..e4c864b9422 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration7_es6.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts === +class C { +>C : C + + *foo() { } +>foo : () => void +>T : T +} diff --git a/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt new file mode 100644 index 00000000000..1b216b72c89 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt @@ -0,0 +1,34 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,12): error TS1127: Invalid character. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,14): error TS1129: Statement expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,19): error TS1005: '(' expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(5,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(6,3): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(7,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,9): error TS2304: Cannot find name 'a'. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,16): error TS2391: Function implementation is missing or not immediately following the declaration. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts (8 errors) ==== + class C { + foo() { + // Make sure we don't think of *bar as the start of a generator method. + if (a) # * bar; + +!!! error TS1127: Invalid character. + ~ +!!! error TS1129: Statement expected. + ~ +!!! error TS1005: '(' expected. + ~ +!!! error TS2304: Cannot find name 'a'. + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + return bar; + ~~~~~~ +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + } + ~ +!!! error TS1128: Declaration or statement expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt index f8e4561e9a7..15a0e5b4334 100644 --- a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt @@ -1,8 +1,12 @@ +tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(1,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged + + ==== tests/cases/conformance/internalModules/DeclarationMerging/module.ts (1 errors) ==== module X.Y { export module Point { ~~~~~ -!!! A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged export var Origin = new Point(0, 0); } } @@ -23,7 +27,7 @@ ==== tests/cases/conformance/internalModules/DeclarationMerging/simple.ts (1 errors) ==== module A { ~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged export var Instance = new A(); } diff --git a/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt index 707e0dec513..7c521c8be95 100644 --- a/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt @@ -1,8 +1,12 @@ +tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged +tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(3,19): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged + + ==== tests/cases/conformance/internalModules/DeclarationMerging/module.ts (1 errors) ==== module A { export module Point { ~~~~~ -!!! A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged export var Origin = { x: 0, y: 0 }; } } @@ -20,7 +24,7 @@ export module Point { ~~~~~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged export var Origin = { x: 0, y: 0 }; } diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt index d87dbe1a163..8f9bfe03ecd 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedClasses.ts(30,16): error TS2339: Property 'A2' does not exist on type 'typeof A'. +tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedClasses.ts(31,17): error TS2339: Property 'A2' does not exist on type 'typeof A'. + + ==== tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedClasses.ts (2 errors) ==== module A { export class A { @@ -30,9 +34,9 @@ // errors expected, these are not exported var a2 = new A.A2(); ~~ -!!! Property 'A2' does not exist on type 'typeof A'. +!!! error TS2339: Property 'A2' does not exist on type 'typeof A'. var ag2 = new A.A2(); ~~ -!!! Property 'A2' does not exist on type 'typeof A'. +!!! error TS2339: Property 'A2' does not exist on type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt index 59cbd67c916..3484d426d2f 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedEnums.ts(10,11): error TS2339: Property 'Day' does not exist on type 'typeof A'. + + ==== tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedEnums.ts (1 errors) ==== module A { export enum Color { Red, Blue } @@ -10,5 +13,5 @@ // error not exported var b = A.Day.Monday; ~~~ -!!! Property 'Day' does not exist on type 'typeof A'. +!!! error TS2339: Property 'Day' does not exist on type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt index dc3b4833463..96528577cbc 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedFunctions.ts(28,13): error TS2339: Property 'fn2' does not exist on type 'typeof A'. +tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedFunctions.ts(29,14): error TS2339: Property 'fng2' does not exist on type 'typeof A'. + + ==== tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedFunctions.ts (2 errors) ==== module A { @@ -28,7 +32,7 @@ // these should be errors since the functions are not exported var fn2 = A.fn2; ~~~ -!!! Property 'fn2' does not exist on type 'typeof A'. +!!! error TS2339: Property 'fn2' does not exist on type 'typeof A'. var fng2 = A.fng2; ~~~~ -!!! Property 'fng2' does not exist on type 'typeof A'. \ No newline at end of file +!!! error TS2339: Property 'fng2' does not exist on type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt index 07233c96782..b6454411858 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedImportAlias.ts(37,21): error TS2339: Property 'Lines' does not exist on type 'typeof Geometry'. + + ==== tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedImportAlias.ts (1 errors) ==== module A { export interface Point { @@ -37,6 +40,6 @@ // not expected to work since non are exported var line = Geometry.Lines.Line; ~~~~~ -!!! Property 'Lines' does not exist on type 'typeof Geometry'. +!!! error TS2339: Property 'Lines' does not exist on type 'typeof Geometry'. \ No newline at end of file diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt index 737ec677339..fa4c9e57c08 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedVariables.ts(11,11): error TS2339: Property 'y' does not exist on type 'typeof A'. + + ==== tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedVariables.ts (1 errors) ==== module A { export var x = 'hello world' @@ -11,5 +14,5 @@ // Error, since y is not exported var y = A.y; ~ -!!! Property 'y' does not exist on type 'typeof A'. +!!! error TS2339: Property 'y' does not exist on type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList13.errors.txt b/tests/baselines/reference/ParameterList13.errors.txt index 63f41b0e230..13bffe4328f 100644 --- a/tests/baselines/reference/ParameterList13.errors.txt +++ b/tests/baselines/reference/ParameterList13.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/ParameterList13.ts(2,10): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/ParameterList13.ts (1 errors) ==== interface I { new (public x); ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList4.errors.txt b/tests/baselines/reference/ParameterList4.errors.txt index e669cbfec68..1d1b0092674 100644 --- a/tests/baselines/reference/ParameterList4.errors.txt +++ b/tests/baselines/reference/ParameterList4.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/ParameterList4.ts(1,12): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/ParameterList4.ts (1 errors) ==== function F(public A) { ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList5.errors.txt b/tests/baselines/reference/ParameterList5.errors.txt index 412fb71eb14..02b86633b95 100644 --- a/tests/baselines/reference/ParameterList5.errors.txt +++ b/tests/baselines/reference/ParameterList5.errors.txt @@ -1,9 +1,14 @@ +tests/cases/compiler/ParameterList5.ts(1,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/ParameterList5.ts(1,16): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/ParameterList5.ts(1,29): error TS2304: Cannot find name 'C'. + + ==== tests/cases/compiler/ParameterList5.ts (3 errors) ==== function A(): (public B) => C { ~~~~~~~~~~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~ -!!! Cannot find name 'C'. +!!! error TS2304: Cannot find name 'C'. } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList6.errors.txt b/tests/baselines/reference/ParameterList6.errors.txt index c7037a3bb9a..b938b7cb52f 100644 --- a/tests/baselines/reference/ParameterList6.errors.txt +++ b/tests/baselines/reference/ParameterList6.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/ParameterList6.ts(2,19): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/ParameterList6.ts (1 errors) ==== class C { constructor(C: (public A) => any) { ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList7.errors.txt b/tests/baselines/reference/ParameterList7.errors.txt index 6179eff50c7..a2b28391a67 100644 --- a/tests/baselines/reference/ParameterList7.errors.txt +++ b/tests/baselines/reference/ParameterList7.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/ParameterList7.ts(2,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/ParameterList7.ts(3,14): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/ParameterList7.ts (2 errors) ==== class C1 { constructor(public p1:string); // ERROR ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. constructor(private p2:number); // ERROR ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. constructor(public p3:any) {} // OK } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList8.errors.txt b/tests/baselines/reference/ParameterList8.errors.txt index 950dfaaffa4..f49a1359992 100644 --- a/tests/baselines/reference/ParameterList8.errors.txt +++ b/tests/baselines/reference/ParameterList8.errors.txt @@ -1,12 +1,17 @@ +tests/cases/compiler/ParameterList8.ts(2,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/ParameterList8.ts(3,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/ParameterList8.ts(4,14): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/ParameterList8.ts (3 errors) ==== declare class C2 { constructor(public p1:string); // ERROR ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. constructor(private p2:number); // ERROR ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. constructor(public p3:any); // ERROR ~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/Protected1.errors.txt b/tests/baselines/reference/Protected1.errors.txt new file mode 100644 index 00000000000..561e4cfd001 --- /dev/null +++ b/tests/baselines/reference/Protected1.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Protected/Protected1.ts(1,1): error TS1044: 'protected' modifier cannot appear on a module element. + + +==== tests/cases/conformance/parser/ecmascript5/Protected/Protected1.ts (1 errors) ==== + protected class C { + ~~~~~~~~~ +!!! error TS1044: 'protected' modifier cannot appear on a module element. + } \ No newline at end of file diff --git a/tests/baselines/reference/Protected2.errors.txt b/tests/baselines/reference/Protected2.errors.txt new file mode 100644 index 00000000000..0f6de4d49ed --- /dev/null +++ b/tests/baselines/reference/Protected2.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/Protected/Protected2.ts(1,1): error TS1044: 'protected' modifier cannot appear on a module element. + + +==== tests/cases/conformance/parser/ecmascript5/Protected/Protected2.ts (1 errors) ==== + protected module M { + ~~~~~~~~~ +!!! error TS1044: 'protected' modifier cannot appear on a module element. + } \ No newline at end of file diff --git a/tests/baselines/reference/Protected3.errors.txt b/tests/baselines/reference/Protected3.errors.txt new file mode 100644 index 00000000000..688422a1e0f --- /dev/null +++ b/tests/baselines/reference/Protected3.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/Protected/Protected3.ts(2,3): error TS1089: 'protected' modifier cannot appear on a constructor declaration. + + +==== tests/cases/conformance/parser/ecmascript5/Protected/Protected3.ts (1 errors) ==== + class C { + protected constructor() { } + ~~~~~~~~~ +!!! error TS1089: 'protected' modifier cannot appear on a constructor declaration. + } \ No newline at end of file diff --git a/tests/baselines/reference/Protected4.errors.txt b/tests/baselines/reference/Protected4.errors.txt new file mode 100644 index 00000000000..fa4f410ab6b --- /dev/null +++ b/tests/baselines/reference/Protected4.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/Protected/Protected4.ts(2,13): error TS1028: Accessibility modifier already seen. + + +==== tests/cases/conformance/parser/ecmascript5/Protected/Protected4.ts (1 errors) ==== + class C { + protected public m() { } + ~~~~~~ +!!! error TS1028: Accessibility modifier already seen. + } \ No newline at end of file diff --git a/tests/baselines/reference/Protected5.js b/tests/baselines/reference/Protected5.js new file mode 100644 index 00000000000..8834cc488cb --- /dev/null +++ b/tests/baselines/reference/Protected5.js @@ -0,0 +1,13 @@ +//// [Protected5.ts] +class C { + protected static m() { } +} + +//// [Protected5.js] +var C = (function () { + function C() { + } + C.m = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/Protected5.types b/tests/baselines/reference/Protected5.types new file mode 100644 index 00000000000..7ef0be949a7 --- /dev/null +++ b/tests/baselines/reference/Protected5.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/Protected/Protected5.ts === +class C { +>C : C + + protected static m() { } +>m : () => void +} diff --git a/tests/baselines/reference/Protected6.errors.txt b/tests/baselines/reference/Protected6.errors.txt new file mode 100644 index 00000000000..3b3804b0fb1 --- /dev/null +++ b/tests/baselines/reference/Protected6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/Protected/Protected6.ts(2,10): error TS1029: 'protected' modifier must precede 'static' modifier. + + +==== tests/cases/conformance/parser/ecmascript5/Protected/Protected6.ts (1 errors) ==== + class C { + static protected m() { } + ~~~~~~~~~ +!!! error TS1029: 'protected' modifier must precede 'static' modifier. + } \ No newline at end of file diff --git a/tests/baselines/reference/Protected7.errors.txt b/tests/baselines/reference/Protected7.errors.txt new file mode 100644 index 00000000000..e95f39eb1b2 --- /dev/null +++ b/tests/baselines/reference/Protected7.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/Protected/Protected7.ts(2,13): error TS1028: Accessibility modifier already seen. + + +==== tests/cases/conformance/parser/ecmascript5/Protected/Protected7.ts (1 errors) ==== + class C { + protected private m() { } + ~~~~~~~ +!!! error TS1028: Accessibility modifier already seen. + } \ No newline at end of file diff --git a/tests/baselines/reference/Protected8.js b/tests/baselines/reference/Protected8.js new file mode 100644 index 00000000000..4a24f98dc5f --- /dev/null +++ b/tests/baselines/reference/Protected8.js @@ -0,0 +1,7 @@ +//// [Protected8.ts] +interface I { + protected + p +} + +//// [Protected8.js] diff --git a/tests/baselines/reference/Protected8.types b/tests/baselines/reference/Protected8.types new file mode 100644 index 00000000000..f29be486eec --- /dev/null +++ b/tests/baselines/reference/Protected8.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/Protected/Protected8.ts === +interface I { +>I : I + + protected +>protected : any + + p +>p : any +} diff --git a/tests/baselines/reference/Protected9.js b/tests/baselines/reference/Protected9.js new file mode 100644 index 00000000000..f747f18e8e8 --- /dev/null +++ b/tests/baselines/reference/Protected9.js @@ -0,0 +1,12 @@ +//// [Protected9.ts] +class C { + constructor(protected p) { } +} + +//// [Protected9.js] +var C = (function () { + function C(p) { + this.p = p; + } + return C; +})(); diff --git a/tests/baselines/reference/Protected9.types b/tests/baselines/reference/Protected9.types new file mode 100644 index 00000000000..d4b6e2fff82 --- /dev/null +++ b/tests/baselines/reference/Protected9.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/Protected/Protected9.ts === +class C { +>C : C + + constructor(protected p) { } +>p : any +} diff --git a/tests/baselines/reference/TemplateExpression1.errors.txt b/tests/baselines/reference/TemplateExpression1.errors.txt new file mode 100644 index 00000000000..bf57f5ef24e --- /dev/null +++ b/tests/baselines/reference/TemplateExpression1.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/templates/TemplateExpression1.ts(1,19): error TS1158: Invalid template literal; expected '}' +tests/cases/conformance/es6/templates/TemplateExpression1.ts(1,17): error TS2304: Cannot find name 'a'. + + +==== tests/cases/conformance/es6/templates/TemplateExpression1.ts (2 errors) ==== + var v = `foo ${ a + +!!! error TS1158: Invalid template literal; expected '}' + ~ +!!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/TupleType1.js b/tests/baselines/reference/TupleType1.js new file mode 100644 index 00000000000..96a1db46548 --- /dev/null +++ b/tests/baselines/reference/TupleType1.js @@ -0,0 +1,5 @@ +//// [TupleType1.ts] +var v: [number] + +//// [TupleType1.js] +var v; diff --git a/tests/baselines/reference/TupleType1.types b/tests/baselines/reference/TupleType1.types new file mode 100644 index 00000000000..39fa32d5dca --- /dev/null +++ b/tests/baselines/reference/TupleType1.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType1.ts === +var v: [number] +>v : [number] + diff --git a/tests/baselines/reference/TupleType2.js b/tests/baselines/reference/TupleType2.js new file mode 100644 index 00000000000..e74db6f031a --- /dev/null +++ b/tests/baselines/reference/TupleType2.js @@ -0,0 +1,5 @@ +//// [TupleType2.ts] +var v: [number, string] + +//// [TupleType2.js] +var v; diff --git a/tests/baselines/reference/TupleType2.types b/tests/baselines/reference/TupleType2.types new file mode 100644 index 00000000000..0f35f60786c --- /dev/null +++ b/tests/baselines/reference/TupleType2.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType2.ts === +var v: [number, string] +>v : [number, string] + diff --git a/tests/baselines/reference/TupleType3.errors.txt b/tests/baselines/reference/TupleType3.errors.txt new file mode 100644 index 00000000000..a7f5b117325 --- /dev/null +++ b/tests/baselines/reference/TupleType3.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType3.ts(1,8): error TS1122: A tuple type element list cannot be empty. + + +==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType3.ts (1 errors) ==== + var v: [] + ~~ +!!! error TS1122: A tuple type element list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/TupleType4.errors.txt b/tests/baselines/reference/TupleType4.errors.txt new file mode 100644 index 00000000000..987f40b7aed --- /dev/null +++ b/tests/baselines/reference/TupleType4.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType4.ts(1,9): error TS1005: ']' expected. + + +==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType4.ts (1 errors) ==== + var v: [ + +!!! error TS1005: ']' expected. \ No newline at end of file diff --git a/tests/baselines/reference/TupleType5.errors.txt b/tests/baselines/reference/TupleType5.errors.txt new file mode 100644 index 00000000000..1a6ca7f99b3 --- /dev/null +++ b/tests/baselines/reference/TupleType5.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType5.ts(1,15): error TS1009: Trailing comma not allowed. + + +==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType5.ts (1 errors) ==== + var v: [number,] + ~ +!!! error TS1009: Trailing comma not allowed. \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt index 2540e2a071f..39e5278041d 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt @@ -1,6 +1,14 @@ -==== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts (2 errors) ==== +tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(2,18): error TS2300: Duplicate identifier 'Point'. +tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(10,18): error TS2300: Duplicate identifier 'Point'. +tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(17,18): error TS2300: Duplicate identifier 'Line'. +tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error TS2300: Duplicate identifier 'Line'. + + +==== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts (4 errors) ==== module A { export class Point { + ~~~~~ +!!! error TS2300: Duplicate identifier 'Point'. x: number; y: number; } @@ -10,7 +18,7 @@ // expected error export class Point { ~~~~~ -!!! Duplicate identifier 'Point'. +!!! error TS2300: Duplicate identifier 'Point'. origin: number; angle: number; } @@ -18,6 +26,8 @@ module X.Y.Z { export class Line { + ~~~~ +!!! error TS2300: Duplicate identifier 'Line'. length: number; } } @@ -28,7 +38,7 @@ // expected error export class Line { ~~~~ -!!! Duplicate identifier 'Line'. +!!! error TS2300: Duplicate identifier 'Line'. name: string; } } diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt index 659efa3ecda..8a4962c23c7 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt @@ -1,7 +1,13 @@ +tests/cases/conformance/internalModules/DeclarationMerging/part1.ts(1,15): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(3,24): error TS2304: Cannot find name 'Point'. +tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(7,36): error TS2304: Cannot find name 'Point'. +tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(7,54): error TS2304: Cannot find name 'Point'. + + ==== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts (1 errors) ==== export module A { ~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. export interface Point { x: number; y: number; @@ -21,15 +27,15 @@ // collision with 'Origin' var in other part of merged module export var Origin: Point = { x: 0, y: 0 }; ~~~~~ -!!! Cannot find name 'Point'. +!!! error TS2304: Cannot find name 'Point'. export module Utils { export class Plane { constructor(public tl: Point, public br: Point) { } ~~~~~ -!!! Cannot find name 'Point'. +!!! error TS2304: Cannot find name 'Point'. ~~~~~ -!!! Cannot find name 'Point'. +!!! error TS2304: Cannot find name 'Point'. } } } diff --git a/tests/baselines/reference/TypeArgumentList1.errors.txt b/tests/baselines/reference/TypeArgumentList1.errors.txt index 6c1a300f5a5..4337f520c6d 100644 --- a/tests/baselines/reference/TypeArgumentList1.errors.txt +++ b/tests/baselines/reference/TypeArgumentList1.errors.txt @@ -1,12 +1,19 @@ +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts(1,9): error TS1127: Invalid character. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts(1,1): error TS2304: Cannot find name 'Foo'. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts(1,5): error TS2304: Cannot find name 'A'. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts(1,7): error TS2304: Cannot find name 'B'. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts(1,11): error TS2304: Cannot find name 'C'. + + ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts (5 errors) ==== Foo(4, 5, 6); -!!! Invalid character. +!!! error TS1127: Invalid character. ~~~ -!!! Cannot find name 'Foo'. +!!! error TS2304: Cannot find name 'Foo'. ~ -!!! Cannot find name 'A'. +!!! error TS2304: Cannot find name 'A'. ~ -!!! Cannot find name 'B'. +!!! error TS2304: Cannot find name 'B'. ~ -!!! Cannot find name 'C'. \ No newline at end of file +!!! error TS2304: Cannot find name 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression10_es6.js b/tests/baselines/reference/YieldExpression10_es6.js new file mode 100644 index 00000000000..f111e6e1bdf --- /dev/null +++ b/tests/baselines/reference/YieldExpression10_es6.js @@ -0,0 +1,11 @@ +//// [YieldExpression10_es6.ts] +var v = { * foo() { + yield(foo); + } +} + + +//// [YieldExpression10_es6.js] +var v = { foo: function () { + ; +} }; diff --git a/tests/baselines/reference/YieldExpression10_es6.types b/tests/baselines/reference/YieldExpression10_es6.types new file mode 100644 index 00000000000..e0d3f84c6c8 --- /dev/null +++ b/tests/baselines/reference/YieldExpression10_es6.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts === +var v = { * foo() { +>v : { foo: () => void; } +>{ * foo() { yield(foo); }} : { foo: () => void; } +>foo : () => void +>* foo() { yield(foo); } : () => void + + yield(foo); + } +} + diff --git a/tests/baselines/reference/YieldExpression11_es6.js b/tests/baselines/reference/YieldExpression11_es6.js new file mode 100644 index 00000000000..306cef3051e --- /dev/null +++ b/tests/baselines/reference/YieldExpression11_es6.js @@ -0,0 +1,16 @@ +//// [YieldExpression11_es6.ts] +class C { + *foo() { + yield(foo); + } +} + +//// [YieldExpression11_es6.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + ; + }; + return C; +})(); diff --git a/tests/baselines/reference/YieldExpression11_es6.types b/tests/baselines/reference/YieldExpression11_es6.types new file mode 100644 index 00000000000..cdb70b3af0d --- /dev/null +++ b/tests/baselines/reference/YieldExpression11_es6.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts === +class C { +>C : C + + *foo() { +>foo : () => void + + yield(foo); + } +} diff --git a/tests/baselines/reference/YieldExpression12_es6.errors.txt b/tests/baselines/reference/YieldExpression12_es6.errors.txt new file mode 100644 index 00000000000..10843421a3f --- /dev/null +++ b/tests/baselines/reference/YieldExpression12_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts(3,6): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts (1 errors) ==== + class C { + constructor() { + yield foo + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression13_es6.js b/tests/baselines/reference/YieldExpression13_es6.js new file mode 100644 index 00000000000..328fc80dbdd --- /dev/null +++ b/tests/baselines/reference/YieldExpression13_es6.js @@ -0,0 +1,7 @@ +//// [YieldExpression13_es6.ts] +function* foo() { yield } + +//// [YieldExpression13_es6.js] +function foo() { + ; +} diff --git a/tests/baselines/reference/YieldExpression13_es6.types b/tests/baselines/reference/YieldExpression13_es6.types new file mode 100644 index 00000000000..23a9fe6299a --- /dev/null +++ b/tests/baselines/reference/YieldExpression13_es6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts === +function* foo() { yield } +>foo : () => void + diff --git a/tests/baselines/reference/YieldExpression14_es6.errors.txt b/tests/baselines/reference/YieldExpression14_es6.errors.txt new file mode 100644 index 00000000000..baeaf3ba30e --- /dev/null +++ b/tests/baselines/reference/YieldExpression14_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts(3,6): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts (1 errors) ==== + class C { + foo() { + yield foo + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression15_es6.errors.txt b/tests/baselines/reference/YieldExpression15_es6.errors.txt new file mode 100644 index 00000000000..5e548799f5d --- /dev/null +++ b/tests/baselines/reference/YieldExpression15_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression15_es6.ts(2,6): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression15_es6.ts (1 errors) ==== + var v = () => { + yield foo + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression16_es6.errors.txt b/tests/baselines/reference/YieldExpression16_es6.errors.txt new file mode 100644 index 00000000000..e5a9b93eece --- /dev/null +++ b/tests/baselines/reference/YieldExpression16_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(3,5): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (1 errors) ==== + function* foo() { + function bar() { + yield foo; + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression17_es6.errors.txt b/tests/baselines/reference/YieldExpression17_es6.errors.txt new file mode 100644 index 00000000000..38969a9c6fb --- /dev/null +++ b/tests/baselines/reference/YieldExpression17_es6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts (2 errors) ==== + var v = { get foo() { yield foo; } } + ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression18_es6.errors.txt b/tests/baselines/reference/YieldExpression18_es6.errors.txt new file mode 100644 index 00000000000..3a67acdebcd --- /dev/null +++ b/tests/baselines/reference/YieldExpression18_es6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,1): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts (1 errors) ==== + "use strict"; + yield(foo); + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression19_es6.js b/tests/baselines/reference/YieldExpression19_es6.js new file mode 100644 index 00000000000..91643e09b0e --- /dev/null +++ b/tests/baselines/reference/YieldExpression19_es6.js @@ -0,0 +1,17 @@ +//// [YieldExpression19_es6.ts] +function*foo() { + function bar() { + function* quux() { + yield(foo); + } + } +} + +//// [YieldExpression19_es6.js] +function foo() { + function bar() { + function quux() { + ; + } + } +} diff --git a/tests/baselines/reference/YieldExpression19_es6.types b/tests/baselines/reference/YieldExpression19_es6.types new file mode 100644 index 00000000000..a8af884c98f --- /dev/null +++ b/tests/baselines/reference/YieldExpression19_es6.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts === +function*foo() { +>foo : () => void + + function bar() { +>bar : () => void + + function* quux() { +>quux : () => void + + yield(foo); + } + } +} diff --git a/tests/baselines/reference/YieldExpression1_es6.errors.txt b/tests/baselines/reference/YieldExpression1_es6.errors.txt new file mode 100644 index 00000000000..f8a13fe5409 --- /dev/null +++ b/tests/baselines/reference/YieldExpression1_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression1_es6.ts(1,1): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression1_es6.ts (1 errors) ==== + yield; + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression1_es6.js b/tests/baselines/reference/YieldExpression1_es6.js new file mode 100644 index 00000000000..cb5c097df2c --- /dev/null +++ b/tests/baselines/reference/YieldExpression1_es6.js @@ -0,0 +1,5 @@ +//// [YieldExpression1_es6.ts] +yield; + +//// [YieldExpression1_es6.js] +yield; diff --git a/tests/baselines/reference/YieldExpression2_es6.errors.txt b/tests/baselines/reference/YieldExpression2_es6.errors.txt new file mode 100644 index 00000000000..553dab51fc2 --- /dev/null +++ b/tests/baselines/reference/YieldExpression2_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts(1,1): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts (1 errors) ==== + yield foo; + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression3_es6.js b/tests/baselines/reference/YieldExpression3_es6.js new file mode 100644 index 00000000000..cc3716587ea --- /dev/null +++ b/tests/baselines/reference/YieldExpression3_es6.js @@ -0,0 +1,11 @@ +//// [YieldExpression3_es6.ts] +function* foo() { + yield + yield +} + +//// [YieldExpression3_es6.js] +function foo() { + ; + ; +} diff --git a/tests/baselines/reference/YieldExpression3_es6.types b/tests/baselines/reference/YieldExpression3_es6.types new file mode 100644 index 00000000000..f9ad4faffdb --- /dev/null +++ b/tests/baselines/reference/YieldExpression3_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts === +function* foo() { +>foo : () => void + + yield + yield +} diff --git a/tests/baselines/reference/YieldExpression4_es6.js b/tests/baselines/reference/YieldExpression4_es6.js new file mode 100644 index 00000000000..84b11a03a2c --- /dev/null +++ b/tests/baselines/reference/YieldExpression4_es6.js @@ -0,0 +1,11 @@ +//// [YieldExpression4_es6.ts] +function* foo() { + yield; + yield; +} + +//// [YieldExpression4_es6.js] +function foo() { + ; + ; +} diff --git a/tests/baselines/reference/YieldExpression4_es6.types b/tests/baselines/reference/YieldExpression4_es6.types new file mode 100644 index 00000000000..083d145d06f --- /dev/null +++ b/tests/baselines/reference/YieldExpression4_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts === +function* foo() { +>foo : () => void + + yield; + yield; +} diff --git a/tests/baselines/reference/YieldExpression5_es6.errors.txt b/tests/baselines/reference/YieldExpression5_es6.errors.txt new file mode 100644 index 00000000000..3ce8f20c985 --- /dev/null +++ b/tests/baselines/reference/YieldExpression5_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression5_es6.ts(3,1): error TS1109: Expression expected. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression5_es6.ts (1 errors) ==== + function* foo() { + yield* + } + ~ +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression6_es6.js b/tests/baselines/reference/YieldExpression6_es6.js new file mode 100644 index 00000000000..5024e9bbd40 --- /dev/null +++ b/tests/baselines/reference/YieldExpression6_es6.js @@ -0,0 +1,9 @@ +//// [YieldExpression6_es6.ts] +function* foo() { + yield*foo +} + +//// [YieldExpression6_es6.js] +function foo() { + ; +} diff --git a/tests/baselines/reference/YieldExpression6_es6.types b/tests/baselines/reference/YieldExpression6_es6.types new file mode 100644 index 00000000000..fd410d2c959 --- /dev/null +++ b/tests/baselines/reference/YieldExpression6_es6.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts === +function* foo() { +>foo : () => void + + yield*foo +} diff --git a/tests/baselines/reference/YieldExpression7_es6.js b/tests/baselines/reference/YieldExpression7_es6.js new file mode 100644 index 00000000000..96ef5af107e --- /dev/null +++ b/tests/baselines/reference/YieldExpression7_es6.js @@ -0,0 +1,9 @@ +//// [YieldExpression7_es6.ts] +function* foo() { + yield foo +} + +//// [YieldExpression7_es6.js] +function foo() { + ; +} diff --git a/tests/baselines/reference/YieldExpression7_es6.types b/tests/baselines/reference/YieldExpression7_es6.types new file mode 100644 index 00000000000..17e1a3b2bfb --- /dev/null +++ b/tests/baselines/reference/YieldExpression7_es6.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts === +function* foo() { +>foo : () => void + + yield foo +} diff --git a/tests/baselines/reference/YieldExpression8_es6.errors.txt b/tests/baselines/reference/YieldExpression8_es6.errors.txt new file mode 100644 index 00000000000..f4dd30b1a19 --- /dev/null +++ b/tests/baselines/reference/YieldExpression8_es6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (1 errors) ==== + yield(foo); + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + function* foo() { + yield(foo); + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression8_es6.js b/tests/baselines/reference/YieldExpression8_es6.js new file mode 100644 index 00000000000..190c2cc3da5 --- /dev/null +++ b/tests/baselines/reference/YieldExpression8_es6.js @@ -0,0 +1,11 @@ +//// [YieldExpression8_es6.ts] +yield(foo); +function* foo() { + yield(foo); +} + +//// [YieldExpression8_es6.js] +yield(foo); +function foo() { + ; +} diff --git a/tests/baselines/reference/YieldExpression9_es6.js b/tests/baselines/reference/YieldExpression9_es6.js new file mode 100644 index 00000000000..978e0d455bd --- /dev/null +++ b/tests/baselines/reference/YieldExpression9_es6.js @@ -0,0 +1,9 @@ +//// [YieldExpression9_es6.ts] +var v = function*() { + yield(foo); +} + +//// [YieldExpression9_es6.js] +var v = function () { + ; +}; diff --git a/tests/baselines/reference/YieldExpression9_es6.types b/tests/baselines/reference/YieldExpression9_es6.types new file mode 100644 index 00000000000..a570d2f09a0 --- /dev/null +++ b/tests/baselines/reference/YieldExpression9_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts === +var v = function*() { +>v : () => void +>function*() { yield(foo);} : () => void + + yield(foo); +} diff --git a/tests/baselines/reference/accessibilityModifiers.errors.txt b/tests/baselines/reference/accessibilityModifiers.errors.txt new file mode 100644 index 00000000000..1bf92139761 --- /dev/null +++ b/tests/baselines/reference/accessibilityModifiers.errors.txt @@ -0,0 +1,96 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(22,12): error TS1029: 'private' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(23,12): error TS1029: 'private' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(24,12): error TS1029: 'private' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(25,12): error TS1029: 'private' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(27,12): error TS1029: 'protected' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(28,12): error TS1029: 'protected' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(29,12): error TS1029: 'protected' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(30,12): error TS1029: 'protected' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(32,12): error TS1029: 'public' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(33,12): error TS1029: 'public' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(34,12): error TS1029: 'public' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(35,12): error TS1029: 'public' modifier must precede 'static' modifier. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(40,13): error TS1028: Accessibility modifier already seen. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(41,12): error TS1028: Accessibility modifier already seen. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(42,13): error TS1028: Accessibility modifier already seen. +tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(43,12): error TS1028: Accessibility modifier already seen. + + +==== tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts (16 errors) ==== + + // No errors + class C { + private static privateProperty; + private static privateMethod() { } + private static get privateGetter() { return 0; } + private static set privateSetter(a: number) { } + + protected static protectedProperty; + protected static protectedMethod() { } + protected static get protectedGetter() { return 0; } + protected static set protectedSetter(a: number) { } + + public static publicProperty; + public static publicMethod() { } + public static get publicGetter() { return 0; } + public static set publicSetter(a: number) { } + } + + // Errors, accessibility modifiers must precede static + class D { + static private privateProperty; + ~~~~~~~ +!!! error TS1029: 'private' modifier must precede 'static' modifier. + static private privateMethod() { } + ~~~~~~~ +!!! error TS1029: 'private' modifier must precede 'static' modifier. + static private get privateGetter() { return 0; } + ~~~~~~~ +!!! error TS1029: 'private' modifier must precede 'static' modifier. + static private set privateSetter(a: number) { } + ~~~~~~~ +!!! error TS1029: 'private' modifier must precede 'static' modifier. + + static protected protectedProperty; + ~~~~~~~~~ +!!! error TS1029: 'protected' modifier must precede 'static' modifier. + static protected protectedMethod() { } + ~~~~~~~~~ +!!! error TS1029: 'protected' modifier must precede 'static' modifier. + static protected get protectedGetter() { return 0; } + ~~~~~~~~~ +!!! error TS1029: 'protected' modifier must precede 'static' modifier. + static protected set protectedSetter(a: number) { } + ~~~~~~~~~ +!!! error TS1029: 'protected' modifier must precede 'static' modifier. + + static public publicProperty; + ~~~~~~ +!!! error TS1029: 'public' modifier must precede 'static' modifier. + static public publicMethod() { } + ~~~~~~ +!!! error TS1029: 'public' modifier must precede 'static' modifier. + static public get publicGetter() { return 0; } + ~~~~~~ +!!! error TS1029: 'public' modifier must precede 'static' modifier. + static public set publicSetter(a: number) { } + ~~~~~~ +!!! error TS1029: 'public' modifier must precede 'static' modifier. + } + + // Errors, multiple accessibility modifier + class E { + private public protected property; + ~~~~~~ +!!! error TS1028: Accessibility modifier already seen. + public protected method() { } + ~~~~~~~~~ +!!! error TS1028: Accessibility modifier already seen. + private protected get getter() { return 0; } + ~~~~~~~~~ +!!! error TS1028: Accessibility modifier already seen. + public public set setter(a: number) { } + ~~~~~~ +!!! error TS1028: Accessibility modifier already seen. + } + \ No newline at end of file diff --git a/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt b/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt index df4fe1ecf9e..401a0107d89 100644 --- a/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt +++ b/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt @@ -1,14 +1,20 @@ +tests/cases/compiler/accessorParameterAccessibilityModifier.ts(3,9): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/accessorParameterAccessibilityModifier.ts(4,16): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/accessorParameterAccessibilityModifier.ts(3,11): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/accessorParameterAccessibilityModifier.ts(4,18): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/accessorParameterAccessibilityModifier.ts (4 errors) ==== class C { set X(public v) { } ~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. static set X(public v2) { } ~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithES3.errors.txt b/tests/baselines/reference/accessorWithES3.errors.txt index a16d23d28c2..0b4510a12ca 100644 --- a/tests/baselines/reference/accessorWithES3.errors.txt +++ b/tests/baselines/reference/accessorWithES3.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(16,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(20,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts (4 errors) ==== // error to use accessors in ES3 mode @@ -5,7 +11,7 @@ class C { get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 1; } } @@ -13,18 +19,18 @@ class D { set x(v) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } var x = { get a() { return 1 } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } var y = { set b(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithInitializer.errors.txt b/tests/baselines/reference/accessorWithInitializer.errors.txt index 127bfdc8d82..338d9559e4c 100644 --- a/tests/baselines/reference/accessorWithInitializer.errors.txt +++ b/tests/baselines/reference/accessorWithInitializer.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/accessorWithInitializer.ts(3,9): error TS1052: A 'set' accessor parameter cannot have an initializer. +tests/cases/compiler/accessorWithInitializer.ts(4,16): error TS1052: A 'set' accessor parameter cannot have an initializer. + + ==== tests/cases/compiler/accessorWithInitializer.ts (2 errors) ==== class C { set X(v = 0) { } ~ -!!! A 'set' accessor parameter cannot have an initializer. +!!! error TS1052: A 'set' accessor parameter cannot have an initializer. static set X(v2 = 0) { } ~ -!!! A 'set' accessor parameter cannot have an initializer. +!!! error TS1052: A 'set' accessor parameter cannot have an initializer. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.errors.txt b/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.errors.txt new file mode 100644 index 00000000000..6c12df93dd1 --- /dev/null +++ b/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.errors.txt @@ -0,0 +1,59 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(3,9): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(6,17): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(11,19): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(14,17): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(19,19): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(21,9): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(27,26): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(29,16): error TS2379: Getter and setter accessors do not agree in visibility. + + +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts (8 errors) ==== + + class C { + get x() { + ~ +!!! error TS2379: Getter and setter accessors do not agree in visibility. + return 1; + } + private set x(v) { + ~ +!!! error TS2379: Getter and setter accessors do not agree in visibility. + } + } + + class D { + protected get x() { + ~ +!!! error TS2379: Getter and setter accessors do not agree in visibility. + return 1; + } + private set x(v) { + ~ +!!! error TS2379: Getter and setter accessors do not agree in visibility. + } + } + + class E { + protected set x(v) { + ~ +!!! error TS2379: Getter and setter accessors do not agree in visibility. + } + get x() { + ~ +!!! error TS2379: Getter and setter accessors do not agree in visibility. + return 1; + } + } + + class F { + protected static set x(v) { + ~ +!!! error TS2379: Getter and setter accessors do not agree in visibility. + } + static get x() { + ~ +!!! error TS2379: Getter and setter accessors do not agree in visibility. + return 1; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.js b/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.js new file mode 100644 index 00000000000..548d679776e --- /dev/null +++ b/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.js @@ -0,0 +1,91 @@ +//// [accessorWithMismatchedAccessibilityModifiers.ts] + +class C { + get x() { + return 1; + } + private set x(v) { + } +} + +class D { + protected get x() { + return 1; + } + private set x(v) { + } +} + +class E { + protected set x(v) { + } + get x() { + return 1; + } +} + +class F { + protected static set x(v) { + } + static get x() { + return 1; + } +} + +//// [accessorWithMismatchedAccessibilityModifiers.js] +var C = (function () { + function C() { + } + Object.defineProperty(C.prototype, "x", { + get: function () { + return 1; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return C; +})(); +var D = (function () { + function D() { + } + Object.defineProperty(D.prototype, "x", { + get: function () { + return 1; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return D; +})(); +var E = (function () { + function E() { + } + Object.defineProperty(E.prototype, "x", { + get: function () { + return 1; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return E; +})(); +var F = (function () { + function F() { + } + Object.defineProperty(F, "x", { + get: function () { + return 1; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return F; +})(); diff --git a/tests/baselines/reference/accessorWithRestParam.errors.txt b/tests/baselines/reference/accessorWithRestParam.errors.txt index 10f4633805f..6162d5a8238 100644 --- a/tests/baselines/reference/accessorWithRestParam.errors.txt +++ b/tests/baselines/reference/accessorWithRestParam.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/accessorWithRestParam.ts(3,9): error TS1053: A 'set' accessor cannot have rest parameter. +tests/cases/compiler/accessorWithRestParam.ts(4,16): error TS1053: A 'set' accessor cannot have rest parameter. + + ==== tests/cases/compiler/accessorWithRestParam.ts (2 errors) ==== class C { set X(...v) { } ~ -!!! A 'set' accessor cannot have rest parameter. +!!! error TS1053: A 'set' accessor cannot have rest parameter. static set X(...v2) { } ~ -!!! A 'set' accessor cannot have rest parameter. +!!! error TS1053: A 'set' accessor cannot have rest parameter. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorsAreNotContextuallyTyped.errors.txt b/tests/baselines/reference/accessorsAreNotContextuallyTyped.errors.txt index b108ea940a3..725ad30bd61 100644 --- a/tests/baselines/reference/accessorsAreNotContextuallyTyped.errors.txt +++ b/tests/baselines/reference/accessorsAreNotContextuallyTyped.errors.txt @@ -1,15 +1,19 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorsAreNotContextuallyTyped.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorsAreNotContextuallyTyped.ts(7,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorsAreNotContextuallyTyped.ts (2 errors) ==== // accessors are not contextually typed class C { set x(v: (a: string) => string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return (x: string) => ""; } } diff --git a/tests/baselines/reference/accessorsEmit.errors.txt b/tests/baselines/reference/accessorsEmit.errors.txt index 54bfafec648..4d620f8cd8b 100644 --- a/tests/baselines/reference/accessorsEmit.errors.txt +++ b/tests/baselines/reference/accessorsEmit.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/accessorsEmit.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessorsEmit.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/accessorsEmit.ts (2 errors) ==== class Result { } class Test { get Property(): Result { ~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x = 1; return null; } @@ -13,7 +17,7 @@ class Test2 { get Property() { ~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x = 1; return null; } diff --git a/tests/baselines/reference/accessorsInAmbientContext.errors.txt b/tests/baselines/reference/accessorsInAmbientContext.errors.txt index fe7dfb361f9..ada59f21f65 100644 --- a/tests/baselines/reference/accessorsInAmbientContext.errors.txt +++ b/tests/baselines/reference/accessorsInAmbientContext.errors.txt @@ -1,35 +1,45 @@ +tests/cases/compiler/accessorsInAmbientContext.ts(4,13): error TS1086: An accessor cannot be declared in an ambient context. +tests/cases/compiler/accessorsInAmbientContext.ts(5,13): error TS1086: An accessor cannot be declared in an ambient context. +tests/cases/compiler/accessorsInAmbientContext.ts(7,20): error TS1086: An accessor cannot be declared in an ambient context. +tests/cases/compiler/accessorsInAmbientContext.ts(8,20): error TS1086: An accessor cannot be declared in an ambient context. +tests/cases/compiler/accessorsInAmbientContext.ts(13,9): error TS1086: An accessor cannot be declared in an ambient context. +tests/cases/compiler/accessorsInAmbientContext.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context. +tests/cases/compiler/accessorsInAmbientContext.ts(16,16): error TS1086: An accessor cannot be declared in an ambient context. +tests/cases/compiler/accessorsInAmbientContext.ts(17,16): error TS1086: An accessor cannot be declared in an ambient context. + + ==== tests/cases/compiler/accessorsInAmbientContext.ts (8 errors) ==== declare module M { class C { get X() { return 1; } ~ -!!! An accessor cannot be declared in an ambient context. +!!! error TS1086: An accessor cannot be declared in an ambient context. set X(v) { } ~ -!!! An accessor cannot be declared in an ambient context. +!!! error TS1086: An accessor cannot be declared in an ambient context. static get Y() { return 1; } ~ -!!! An accessor cannot be declared in an ambient context. +!!! error TS1086: An accessor cannot be declared in an ambient context. static set Y(v) { } ~ -!!! An accessor cannot be declared in an ambient context. +!!! error TS1086: An accessor cannot be declared in an ambient context. } } declare class C { get X() { return 1; } ~ -!!! An accessor cannot be declared in an ambient context. +!!! error TS1086: An accessor cannot be declared in an ambient context. set X(v) { } ~ -!!! An accessor cannot be declared in an ambient context. +!!! error TS1086: An accessor cannot be declared in an ambient context. static get Y() { return 1; } ~ -!!! An accessor cannot be declared in an ambient context. +!!! error TS1086: An accessor cannot be declared in an ambient context. static set Y(v) { } ~ -!!! An accessor cannot be declared in an ambient context. +!!! error TS1086: An accessor cannot be declared in an ambient context. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt b/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt index 3233ba9b5ee..f7d7b146ee3 100644 --- a/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt +++ b/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt @@ -1,11 +1,15 @@ +tests/cases/compiler/accessorsNotAllowedInES3.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessorsNotAllowedInES3.ts(5,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/accessorsNotAllowedInES3.ts (2 errors) ==== class C { get x(): number { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } var y = { get foo() { return 3; } }; ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. \ No newline at end of file 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 be2d5d10ef3..22fdeb099bc 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,38 +1,52 @@ +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(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(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(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(12,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(5,54): error TS2322: Type 'string' is not assignable to type 'number'. +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(11,51): error TS2322: Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts (12 errors) ==== class LanguageSpec_section_4_5_error_cases { public set AnnotatedSetter_SetterFirst(a: number) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get AnnotatedSetter_SetterFirst() { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. public get AnnotatedSetter_SetterLast() { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. public set AnnotatedSetter_SetterLast(a: number) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get AnnotatedGetter_GetterFirst(): string { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set AnnotatedGetter_GetterFirst(aStr) { aStr = 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. public set AnnotatedGetter_GetterLast(aStr) { aStr = 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. public get AnnotatedGetter_GetterLast(): string { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/accessors_spec_section-4.5_inference.errors.txt b/tests/baselines/reference/accessors_spec_section-4.5_inference.errors.txt index 6f30cec38e4..9e7db776ff5 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_inference.errors.txt +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.errors.txt @@ -1,3 +1,17 @@ +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(10,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(13,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(14,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(16,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(17,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(19,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(20,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(22,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/accessors_spec_section-4.5_inference.ts(23,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/accessors_spec_section-4.5_inference.ts (12 errors) ==== class A { } class B extends A { } @@ -6,44 +20,44 @@ public set InferredGetterFromSetterAnnotation(a: A) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get InferredGetterFromSetterAnnotation() { return new B(); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get InferredGetterFromSetterAnnotation_GetterFirst() { return new B(); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set InferredGetterFromSetterAnnotation_GetterFirst(a: A) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get InferredFromGetter() { return new B(); } ~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set InferredFromGetter(a) { } ~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set InferredFromGetter_SetterFirst(a) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get InferredFromGetter_SetterFirst() { return new B(); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set InferredSetterFromGetterAnnotation(a) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get InferredSetterFromGetterAnnotation() : A { return new B(); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get InferredSetterFromGetterAnnotation_GetterFirst() : A { return new B(); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set InferredSetterFromGetterAnnotation_GetterFirst(a) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt index 36b45612631..4b6255688f8 100644 --- a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. + Types of property 'f' are incompatible. + Type '(key: string) => string' is not assignable to type '() => string'. + + ==== tests/cases/compiler/addMoreOverloadsToBaseSignature.ts (1 errors) ==== interface Foo { f(): string; @@ -5,9 +10,9 @@ interface Bar extends Foo { ~~~ -!!! Interface 'Bar' incorrectly extends interface 'Foo': -!!! Types of property 'f' are incompatible: -!!! Type '(key: string) => string' is not assignable to type '() => string'. +!!! error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. +!!! error TS2430: Types of property 'f' are incompatible. +!!! error TS2430: Type '(key: string) => string' is not assignable to type '() => string'. f(key: string): string; } \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt index 607a76b1034..bd71b64b501 100644 --- a/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt @@ -1,3 +1,24 @@ +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(17,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'Object'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(22,10): error TS2365: Operator '+' cannot be applied to types 'number' and 'Object'. +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(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 (19 errors) ==== function foo() { } class C { @@ -15,65 +36,65 @@ // boolean + every type except any and string var r1 = a + a; ~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. var r2 = a + b; ~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. var r3 = a + c; ~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'Object'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'Object'. // number + every type except any and string var r4 = b + a; ~~~~~ -!!! Operator '+' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. var r5 = b + b; // number + number is valid var r6 = b + c; ~~~~~ -!!! Operator '+' cannot be applied to types 'number' and 'Object'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'Object'. // object + every type except any and string var r7 = c + a; ~~~~~ -!!! Operator '+' cannot be applied to types 'Object' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'boolean'. var r8 = c + b; ~~~~~ -!!! Operator '+' cannot be applied to types 'Object' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'number'. var r9 = c + c; ~~~~~ -!!! Operator '+' cannot be applied to types 'Object' and 'Object'. +!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. // other cases var r10 = a + true; ~~~~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. var r11 = true + false; ~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. var r12 = true + 123; ~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. var r13 = {} + {}; ~~~~~~~ -!!! Operator '+' cannot be applied to types '{}' and '{}'. +!!! error TS2365: Operator '+' cannot be applied to types '{}' and '{}'. var r14 = b + d; ~~~~~ -!!! Operator '+' cannot be applied to types 'number' and 'Number'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'Number'. var r15 = b + foo; ~~~~~~~ -!!! Operator '+' cannot be applied to types 'number' and '() => void'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and '() => void'. var r16 = b + foo(); ~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'number' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'void'. var r17 = b + C; ~~~~~ -!!! Operator '+' cannot be applied to types 'number' and 'typeof C'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'typeof C'. var r18 = E.a + new C(); ~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'E' and 'C'. +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'C'. var r19 = E.a + C.foo(); ~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'void'. var r20 = E.a + M; ~~~~~~~ -!!! 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' 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 230210c2586..566fb241bf8 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt +++ b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt @@ -1,3 +1,16 @@ +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(11,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(12,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(13,10): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(14,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +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(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'. + + ==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts (11 errors) ==== // If one operand is the null or undefined value, it is treated as having the type of the other operand. @@ -11,36 +24,36 @@ // null + boolean/Object var r1 = null + a; ~~~~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. var r2 = null + b; ~~~~~~~~ -!!! Operator '+' cannot be applied to types 'Object' and 'Object'. +!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. var r3 = null + c; ~~~~~~~~ -!!! Operator '+' cannot be applied to types 'void' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. var r4 = a + null; ~~~~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. var r5 = b + null; ~~~~~~~~ -!!! Operator '+' cannot be applied to types 'Object' and 'Object'. +!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. var r6 = null + c; ~~~~~~~~ -!!! Operator '+' cannot be applied to types 'void' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. // other cases var r7 = null + d; ~~~~~~~~ -!!! Operator '+' cannot be applied to types 'Number' and 'Number'. +!!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. var r8 = null + true; ~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. var r9 = null + { a: '' }; ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. +!!! error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. var r10 = null + foo(); ~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'void' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. var r11 = null + (() => { }); ~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types '() => void' and '() => void'. \ No newline at end of file +!!! error TS2365: Operator '+' cannot be applied to types '() => void' and '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js index f34ac61d86d..1ba54d47f1c 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js @@ -50,12 +50,12 @@ var r3 = null + b; var r4 = null + 1; var r5 = null + c; var r6 = null + 0 /* a */; -var r7 = null + E['a']; +var r7 = null + 0 /* 'a' */; var r8 = b + null; var r9 = 1 + null; var r10 = c + null; var r11 = 0 /* a */ + null; -var r12 = E['a'] + null; +var r12 = 0 /* 'a' */ + null; // null + string var r13 = null + d; var r14 = null + ''; diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.js b/tests/baselines/reference/additionOperatorWithNumberAndEnum.js index 63e038265d6..05bca7a4c0c 100644 --- a/tests/baselines/reference/additionOperatorWithNumberAndEnum.js +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.js @@ -29,4 +29,4 @@ var r4 = b + b; var r5 = 0 + a; var r6 = 0 /* a */ + 0; var r7 = 0 /* a */ + 1 /* b */; -var r8 = E['a'] + E['b']; +var r8 = 0 /* 'a' */ + 1 /* 'b' */; diff --git a/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt index fad515948be..9e7e4c01ad2 100644 --- a/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt +++ b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt @@ -1,14 +1,20 @@ +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(2,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(3,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(4,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts(5,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. + + ==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts (4 errors) ==== // bug 819721 var r1 = null + null; ~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var r2 = null + undefined; ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var r3 = undefined + null; ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var r4 = undefined + undefined; ~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. \ No newline at end of file +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt b/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt index 5b084477241..ff7120c145d 100644 --- a/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt +++ b/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt @@ -1,3 +1,21 @@ +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(15,14): error TS2365: Operator '+' cannot be applied to types 'T' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(16,14): error TS2365: Operator '+' cannot be applied to types 'T' and 'number'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(18,14): error TS2365: Operator '+' cannot be applied to types 'T' and 'Object'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(19,14): error TS2365: Operator '+' cannot be applied to types 'T' and 'E'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(20,14): error TS2365: Operator '+' cannot be applied to types 'T' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(24,14): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'T'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(25,15): error TS2365: Operator '+' cannot be applied to types 'number' and 'T'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(27,15): error TS2365: Operator '+' cannot be applied to types 'Object' and 'T'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(28,15): error TS2365: Operator '+' cannot be applied to types 'E' and 'T'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(29,15): error TS2365: Operator '+' cannot be applied to types 'void' and 'T'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(32,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(33,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(34,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(35,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(36,15): error TS2365: Operator '+' cannot be applied to types 'T' and '() => void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts(37,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'undefined[]'. + + ==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts (16 errors) ==== // type parameter type is not a valid operand of addition operator enum E { a, b } @@ -15,57 +33,57 @@ var r1: any = t + a; // ok, one operand is any var r2 = t + b; ~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'boolean'. var r3 = t + c; ~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'number'. var r4 = t + d; // ok, one operand is string var r5 = t + e; ~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'Object'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'Object'. var r6 = t + g; ~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'E'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'E'. var r7 = t + f; ~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'void'. // type parameter as right operand var r8 = a + t; // ok, one operand is any var r9 = b + t; ~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'T'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'T'. var r10 = c + t; ~~~~~ -!!! Operator '+' cannot be applied to types 'number' and 'T'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'T'. var r11 = d + t; // ok, one operand is string var r12 = e + t; ~~~~~ -!!! Operator '+' cannot be applied to types 'Object' and 'T'. +!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'T'. var r13 = g + t; ~~~~~ -!!! Operator '+' cannot be applied to types 'E' and 'T'. +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'T'. var r14 = f + t; ~~~~~ -!!! Operator '+' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '+' cannot be applied to types 'void' and 'T'. // other cases var r15 = t + null; ~~~~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'T'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. var r16 = t + undefined; ~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'T'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. var r17 = t + t; ~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'T'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. var r18 = t + u; ~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'U'. var r19 = t + (() => { }); ~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'T' and '() => void'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and '() => void'. var r20 = t + []; ~~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'undefined[]'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'undefined[]'. } \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt index 95b1f4055a7..36233e9e9fe 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt @@ -1,3 +1,16 @@ +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(11,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(12,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(13,10): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(14,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +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(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'. + + ==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts (11 errors) ==== // If one operand is the null or undefined value, it is treated as having the type of the other operand. @@ -11,36 +24,36 @@ // undefined + boolean/Object var r1 = undefined + a; ~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. var r2 = undefined + b; ~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'Object' and 'Object'. +!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. var r3 = undefined + c; ~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'void' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. var r4 = a + undefined; ~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. var r5 = b + undefined; ~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'Object' and 'Object'. +!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. var r6 = undefined + c; ~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'void' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. // other cases var r7 = undefined + d; ~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'Number' and 'Number'. +!!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. var r8 = undefined + true; ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. var r9 = undefined + { a: '' }; ~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. +!!! error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. var r10 = undefined + foo(); ~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'void' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. var r11 = undefined + (() => { }); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types '() => void' and '() => void'. \ No newline at end of file +!!! error TS2365: Operator '+' cannot be applied to types '() => void' and '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js index a6a1b2ef555..cb89d242a18 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js @@ -50,12 +50,12 @@ var r3 = undefined + b; var r4 = undefined + 1; var r5 = undefined + c; var r6 = undefined + 0 /* a */; -var r7 = undefined + E['a']; +var r7 = undefined + 0 /* 'a' */; var r8 = b + undefined; var r9 = 1 + undefined; var r10 = c + undefined; var r11 = 0 /* a */ + undefined; -var r12 = E['a'] + undefined; +var r12 = 0 /* 'a' */ + undefined; // undefined + string var r13 = undefined + d; var r14 = undefined + ''; diff --git a/tests/baselines/reference/aliasAssignments.errors.txt b/tests/baselines/reference/aliasAssignments.errors.txt index d75b8d51451..90a3672780f 100644 --- a/tests/baselines/reference/aliasAssignments.errors.txt +++ b/tests/baselines/reference/aliasAssignments.errors.txt @@ -1,14 +1,19 @@ +tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. + Property 'someClass' is missing in type 'Number'. +tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. + + ==== tests/cases/compiler/aliasAssignments_1.ts (2 errors) ==== import moduleA = require("aliasAssignments_moduleA"); var x = moduleA; x = 1; // Should be error ~ -!!! Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"': -!!! Property 'someClass' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. +!!! error TS2322: Property 'someClass' is missing in type 'Number'. var y = 1; y = moduleA; // should be error ~ -!!! Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. ==== tests/cases/compiler/aliasAssignments_moduleA.ts (0 errors) ==== export class someClass { diff --git a/tests/baselines/reference/aliasBug.errors.txt b/tests/baselines/reference/aliasBug.errors.txt index 1e7434c19b6..92b63e41b68 100644 --- a/tests/baselines/reference/aliasBug.errors.txt +++ b/tests/baselines/reference/aliasBug.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/aliasBug.ts(17,10): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'. + + ==== tests/cases/compiler/aliasBug.ts (1 errors) ==== module foo { @@ -17,7 +20,7 @@ var p2: foo.Provide; var p3:booz.bar; ~~~~~~~~ -!!! Module 'foo.bar.baz' has no exported member 'bar'. +!!! error TS2305: Module '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 4407771ce56..20e68c5f800 100644 --- a/tests/baselines/reference/aliasErrors.errors.txt +++ b/tests/baselines/reference/aliasErrors.errors.txt @@ -1,3 +1,12 @@ +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(11,1): error TS2304: Cannot find name 'no'. +tests/cases/compiler/aliasErrors.ts(12,1): error TS2304: Cannot find name 'no'. +tests/cases/compiler/aliasErrors.ts(16,1): error TS2304: Cannot find name 'undefined'. +tests/cases/compiler/aliasErrors.ts(26,10): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'. + + ==== tests/cases/compiler/aliasErrors.ts (7 errors) ==== module foo { export class Provide { @@ -11,22 +20,22 @@ import m = no; ~~~~~~~~~~~~~~ -!!! Cannot find name 'no'. +!!! error TS2304: Cannot find name 'no'. import m2 = no.mod; ~~~~~~~~~~~~~~~~~~~ -!!! Cannot find name 'no'. +!!! error TS2304: Cannot find name 'no'. import n = 5; ~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. import o = "s"; ~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. import q = null; ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. import r = undefined; ~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot find name 'undefined'. +!!! error TS2304: Cannot find name 'undefined'. var p = new provide.Provide(); @@ -38,7 +47,7 @@ var p2: foo.Provide; var p3:booz.bar; ~~~~~~~~ -!!! Module 'foo.bar.baz' has no exported member 'bar'. +!!! error TS2305: Module 'foo.bar.baz' has no exported member 'bar'. var p22 = new provide.Provide(); } diff --git a/tests/baselines/reference/aliasInaccessibleModule.errors.txt b/tests/baselines/reference/aliasInaccessibleModule.errors.txt index 839ea965b02..3a9c64e50ab 100644 --- a/tests/baselines/reference/aliasInaccessibleModule.errors.txt +++ b/tests/baselines/reference/aliasInaccessibleModule.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/aliasInaccessibleModule.ts(4,23): error TS4000: Import declaration 'X' is using private name 'N'. + + ==== tests/cases/compiler/aliasInaccessibleModule.ts (1 errors) ==== module M { module N { } export import X = N; - ~~~~~~~~~~~~~~~~~~~~ -!!! Import declaration 'X' is using private name 'N'. + ~ +!!! error TS4000: Import declaration 'X' is using private name 'N'. } \ No newline at end of file diff --git a/tests/baselines/reference/aliasInaccessibleModule2.errors.txt b/tests/baselines/reference/aliasInaccessibleModule2.errors.txt index 149410acb10..03a37147aba 100644 --- a/tests/baselines/reference/aliasInaccessibleModule2.errors.txt +++ b/tests/baselines/reference/aliasInaccessibleModule2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/aliasInaccessibleModule2.ts(7,16): error TS4000: Import declaration 'R' is using private name 'N'. + + ==== tests/cases/compiler/aliasInaccessibleModule2.ts (1 errors) ==== module M { module N { @@ -6,7 +9,7 @@ } import R = N; - ~~~~~~~~~~~~~ -!!! Import declaration 'R' is using private name 'N'. + ~ +!!! error TS4000: Import declaration 'R' is using private name 'N'. export import X = R; } \ No newline at end of file diff --git a/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt b/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt index 8736a2e7ae7..009d405c0f5 100644 --- a/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt +++ b/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/aliasOnMergedModuleInterface_1.ts(5,16): error TS2304: Cannot find name 'foo'. + + ==== tests/cases/compiler/aliasOnMergedModuleInterface_1.ts (1 errors) ==== /// import foo = require("foo") @@ -5,7 +8,7 @@ z.bar("hello"); // This should be ok var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be error ~~~ -!!! Cannot find name 'foo'. +!!! error TS2304: Cannot find name 'foo'. ==== tests/cases/compiler/aliasOnMergedModuleInterface_0.ts (0 errors) ==== declare module "foo" diff --git a/tests/baselines/reference/aliasUsageInArray.types b/tests/baselines/reference/aliasUsageInArray.types index df657233f90..2e792d39603 100644 --- a/tests/baselines/reference/aliasUsageInArray.types +++ b/tests/baselines/reference/aliasUsageInArray.types @@ -17,7 +17,7 @@ interface IHasVisualizationModel { var xs: IHasVisualizationModel[] = [moduleA]; >xs : IHasVisualizationModel[] >IHasVisualizationModel : IHasVisualizationModel ->[moduleA] : IHasVisualizationModel[] +>[moduleA] : typeof moduleA[] >moduleA : typeof moduleA var xs2: typeof moduleA[] = [moduleA]; diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.js b/tests/baselines/reference/aliasUsageInIndexerOfClass.js index dfbb1982ca9..7b2907681e0 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.js +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.js @@ -50,6 +50,7 @@ var VisualizationModel = (function (_super) { })(Backbone.Model); exports.VisualizationModel = VisualizationModel; //// [aliasUsageInIndexerOfClass_main.js] +var moduleA = require("aliasUsageInIndexerOfClass_moduleA"); var N = (function () { function N() { this.x = moduleA; diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types b/tests/baselines/reference/aliasUsageInOrExpression.types index fdcf0be4479..c937187f049 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.types +++ b/tests/baselines/reference/aliasUsageInOrExpression.types @@ -53,7 +53,7 @@ var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x >f : { x: IHasVisualizationModel; } >x : IHasVisualizationModel >IHasVisualizationModel : IHasVisualizationModel -><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: IHasVisualizationModel; } +><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: typeof moduleA; } ><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } >x : IHasVisualizationModel >IHasVisualizationModel : IHasVisualizationModel diff --git a/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.errors.txt b/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.errors.txt index 3185336f8f7..a2532be9344 100644 --- a/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.errors.txt +++ b/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/aliasWithInterfaceExportAssignmentUsedInVarInitializer_1.ts(2,9): error TS2304: Cannot find name 'b'. + + ==== tests/cases/compiler/aliasWithInterfaceExportAssignmentUsedInVarInitializer_1.ts (1 errors) ==== import moduleA = require("aliasWithInterfaceExportAssignmentUsedInVarInitializer_0"); var d = b.q3; ~ -!!! Cannot find name 'b'. +!!! error TS2304: Cannot find name 'b'. ==== tests/cases/compiler/aliasWithInterfaceExportAssignmentUsedInVarInitializer_0.ts (0 errors) ==== interface c { q3: number; diff --git a/tests/baselines/reference/ambientClassOverloadForFunction.errors.txt b/tests/baselines/reference/ambientClassOverloadForFunction.errors.txt index ed00c2a4a16..16df32bb2c5 100644 --- a/tests/baselines/reference/ambientClassOverloadForFunction.errors.txt +++ b/tests/baselines/reference/ambientClassOverloadForFunction.errors.txt @@ -1,6 +1,12 @@ -==== tests/cases/compiler/ambientClassOverloadForFunction.ts (1 errors) ==== +tests/cases/compiler/ambientClassOverloadForFunction.ts(1,15): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/ambientClassOverloadForFunction.ts(2,10): error TS2300: Duplicate identifier 'foo'. + + +==== tests/cases/compiler/ambientClassOverloadForFunction.ts (2 errors) ==== declare class foo{}; + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. function foo() { return null; } ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/ambientDeclarationsExternal.errors.txt b/tests/baselines/reference/ambientDeclarationsExternal.errors.txt index 94b3c770d60..124bf928699 100644 --- a/tests/baselines/reference/ambientDeclarationsExternal.errors.txt +++ b/tests/baselines/reference/ambientDeclarationsExternal.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/ambient/consumer.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/conformance/ambient/consumer.ts (1 errors) ==== /// import imp1 = require('equ'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. // Ambient external module members are always exported with or without export keyword when module lacks export assignment diff --git a/tests/baselines/reference/ambientEnum1.errors.txt b/tests/baselines/reference/ambientEnum1.errors.txt new file mode 100644 index 00000000000..b4bb534f5dd --- /dev/null +++ b/tests/baselines/reference/ambientEnum1.errors.txt @@ -0,0 +1,17 @@ +tests/cases/compiler/ambientEnum1.ts(2,9): error TS1066: Ambient enum elements can only have integer literal initializers. +tests/cases/compiler/ambientEnum1.ts(7,9): error TS1066: Ambient enum elements can only have integer literal initializers. + + +==== tests/cases/compiler/ambientEnum1.ts (2 errors) ==== + declare enum E1 { + y = 4.23 + ~ +!!! error TS1066: Ambient enum elements can only have integer literal initializers. + } + + // Ambient enum with computer member + declare enum E2 { + x = 'foo'.length + ~ +!!! error TS1066: Ambient enum elements can only have integer literal initializers. + } \ No newline at end of file diff --git a/tests/baselines/reference/ambientEnumElementInitializer3.errors.txt b/tests/baselines/reference/ambientEnumElementInitializer3.errors.txt index 159204675e9..56058210c16 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer3.errors.txt +++ b/tests/baselines/reference/ambientEnumElementInitializer3.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/ambientEnumElementInitializer3.ts(2,2): error TS1066: Ambient enum elements can only have integer literal initializers. + + ==== tests/cases/compiler/ambientEnumElementInitializer3.ts (1 errors) ==== declare enum E { e = 3.3 // Decimal ~ -!!! Ambient enum elements can only have integer literal initializers. +!!! error TS1066: Ambient enum elements can only have integer literal initializers. } \ No newline at end of file diff --git a/tests/baselines/reference/ambientErrors.errors.txt b/tests/baselines/reference/ambientErrors.errors.txt index 146f9322100..6fe7a25dfe9 100644 --- a/tests/baselines/reference/ambientErrors.errors.txt +++ b/tests/baselines/reference/ambientErrors.errors.txt @@ -1,14 +1,32 @@ +tests/cases/conformance/ambient/ambientErrors.ts(2,15): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/ambient/ambientErrors.ts(20,24): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/conformance/ambient/ambientErrors.ts(24,5): error TS1066: Ambient enum elements can only have integer literal initializers. +tests/cases/conformance/ambient/ambientErrors.ts(29,5): error TS1066: Ambient enum elements can only have integer literal initializers. +tests/cases/conformance/ambient/ambientErrors.ts(34,11): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/ambient/ambientErrors.ts(35,19): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/conformance/ambient/ambientErrors.ts(37,20): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/ambient/ambientErrors.ts(38,13): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/conformance/ambient/ambientErrors.ts(6,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/conformance/ambient/ambientErrors.ts(17,22): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/ambient/ambientErrors.ts(47,20): error TS2435: Ambient external modules cannot be nested in other modules. +tests/cases/conformance/ambient/ambientErrors.ts(51,16): error TS2436: Ambient external module declaration cannot specify relative module name. +tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a module with other exported elements. + + ==== tests/cases/conformance/ambient/ambientErrors.ts (16 errors) ==== // Ambient variable with an initializer declare var x = 4; ~ -!!! Initializers are not allowed in ambient contexts. +!!! error TS1039: Initializers are not allowed in ambient contexts. // Ambient functions with invalid overloads declare function fn(x: number): string; declare function fn(x: 'foo'): number; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. // Ambient functions with duplicate signatures declare function fn1(x: number): string; @@ -21,51 +39,51 @@ // Ambient function with default parameter values declare function fn3(x = 3); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. // Ambient function with function body declare function fn4() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. // Ambient enum with non - integer literal constant member declare enum E1 { y = 4.23 ~ -!!! Ambient enum elements can only have integer literal initializers. +!!! error TS1066: Ambient enum elements can only have integer literal initializers. } // Ambient enum with computer member declare enum E2 { x = 'foo'.length ~ -!!! Ambient enum elements can only have integer literal initializers. +!!! error TS1066: Ambient enum elements can only have integer literal initializers. } // Ambient module with initializers for values, bodies for functions / classes declare module M1 { var x = 3; ~ -!!! Initializers are not allowed in ambient contexts. +!!! error TS1039: Initializers are not allowed in ambient contexts. function fn() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. class C { static x = 3; - ~ -!!! Initializers are not allowed in ambient contexts. + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. y = 4; - ~ -!!! Initializers are not allowed in ambient contexts. + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. constructor() { } ~ -!!! A constructor implementation cannot be declared in an ambient context. +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. fn() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. static sfn() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. } } @@ -73,13 +91,13 @@ module M2 { declare module 'nope' { } ~~~~~~ -!!! Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient external modules cannot be nested in other modules. } // Ambient external module with a string literal name that isn't a top level external module name declare module '../foo' { } ~~~~~~~~ -!!! Ambient external module declaration cannot specify relative module name. +!!! error TS2436: Ambient external module declaration cannot specify relative module name. // Ambient external module with export assignment and other exported members declare module 'bar' { @@ -87,6 +105,6 @@ export var q; export = n; ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. +!!! 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/ambientErrors1.errors.txt b/tests/baselines/reference/ambientErrors1.errors.txt new file mode 100644 index 00000000000..db7a155cc3f --- /dev/null +++ b/tests/baselines/reference/ambientErrors1.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/ambientErrors1.ts(1,15): error TS1039: Initializers are not allowed in ambient contexts. + + +==== tests/cases/compiler/ambientErrors1.ts (1 errors) ==== + declare var x = 4; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt index d5fd7ed2296..fb988131df0 100644 --- a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2435: Ambient external modules cannot be nested in other modules. +tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): error TS2307: Cannot find external module 'ext'. + + ==== tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts (2 errors) ==== class D { } @@ -5,12 +9,12 @@ declare module "ext" { ~~~~~ -!!! Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient external modules cannot be nested in other modules. export class C { } } // Cannot resolve this ext module reference import ext = require("ext"); ~~~~~ -!!! Cannot find external module 'ext'. +!!! error TS2307: Cannot find external module 'ext'. var x = ext; \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt index ca8ceb6d3ec..e23f96803ba 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt @@ -1,6 +1,9 @@ +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,27): error TS2435: Ambient external modules cannot be nested in other modules. + + ==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts (1 errors) ==== module M { export declare module "M" { } ~~~ -!!! Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient external modules cannot be nested in other modules. } \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt index 44731cf6250..92f01832926 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt @@ -1,4 +1,7 @@ +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2435: Ambient external modules cannot be nested in other modules. + + ==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts (1 errors) ==== export declare module "M" { } ~~~ -!!! Ambient external modules cannot be nested in other modules. \ No newline at end of file +!!! error TS2435: Ambient external modules cannot be nested in other modules. \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt index 2f4779ebfac..4ebae64b0b8 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts(2,5): error TS2439: Import declaration in an ambient external module declaration cannot reference external module through relative external module name. +tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts(2,25): error TS2307: Cannot find external module './SubModule'. + + ==== tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts (2 errors) ==== declare module "OuterModule" { import m2 = require("./SubModule"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Import declaration in an ambient external module declaration cannot reference external module through relative external module name. +!!! error TS2439: Import declaration in an ambient external module declaration cannot reference external module through relative external module name. ~~~~~~~~~~~~~ -!!! Cannot find external module './SubModule'. +!!! error TS2307: Cannot find external module './SubModule'. class SubModule { public static StaticVar: number; public InstanceVar: number; diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt index fba44282cc3..7f6c0ff5b14 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts(1,16): error TS2436: Ambient external module declaration cannot specify relative module name. +tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts(5,16): error TS2436: Ambient external module declaration cannot specify relative module name. + + ==== tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts (2 errors) ==== declare module "./relativeModule" { ~~~~~~~~~~~~~~~~~~ -!!! Ambient external module declaration cannot specify relative module name. +!!! error TS2436: Ambient external module declaration cannot specify relative module name. var x: string; } declare module ".\\relativeModule" { ~~~~~~~~~~~~~~~~~~~ -!!! Ambient external module declaration cannot specify relative module name. +!!! error TS2436: Ambient external module declaration cannot specify relative module name. var x: string; } \ No newline at end of file diff --git a/tests/baselines/reference/ambientGetters.errors.txt b/tests/baselines/reference/ambientGetters.errors.txt index a01c146d977..a56020c41fb 100644 --- a/tests/baselines/reference/ambientGetters.errors.txt +++ b/tests/baselines/reference/ambientGetters.errors.txt @@ -1,13 +1,17 @@ +tests/cases/compiler/ambientGetters.ts(3,9): error TS1086: An accessor cannot be declared in an ambient context. +tests/cases/compiler/ambientGetters.ts(7,9): error TS1086: An accessor cannot be declared in an ambient context. + + ==== tests/cases/compiler/ambientGetters.ts (2 errors) ==== declare class A { get length() : number; ~~~~~~ -!!! An accessor cannot be declared in an ambient context. +!!! error TS1086: An accessor cannot be declared in an ambient context. } declare class B { get length() { return 0; } ~~~~~~ -!!! An accessor cannot be declared in an ambient context. +!!! error TS1086: An accessor cannot be declared in an ambient context. } \ No newline at end of file diff --git a/tests/baselines/reference/ambientStatement1.errors.txt b/tests/baselines/reference/ambientStatement1.errors.txt new file mode 100644 index 00000000000..be7c7bb750c --- /dev/null +++ b/tests/baselines/reference/ambientStatement1.errors.txt @@ -0,0 +1,14 @@ +tests/cases/compiler/ambientStatement1.ts(2,6): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientStatement1.ts(4,20): error TS1039: Initializers are not allowed in ambient contexts. + + +==== tests/cases/compiler/ambientStatement1.ts (2 errors) ==== + declare module M1 { + while(true); + ~~~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. + + export var v1 = () => false; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + } \ No newline at end of file diff --git a/tests/baselines/reference/ambientWithStatements.errors.txt b/tests/baselines/reference/ambientWithStatements.errors.txt index 9f0927d0765..4eef608bbec 100644 --- a/tests/baselines/reference/ambientWithStatements.errors.txt +++ b/tests/baselines/reference/ambientWithStatements.errors.txt @@ -1,38 +1,55 @@ +tests/cases/compiler/ambientWithStatements.ts(2,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(3,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(4,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(5,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(7,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(8,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(9,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(10,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(11,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(12,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(18,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(19,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(25,5): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientWithStatements.ts(7,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/compiler/ambientWithStatements.ts(25,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. + + ==== tests/cases/compiler/ambientWithStatements.ts (15 errors) ==== declare module M { break; ~~~~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. continue; ~~~~~~~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. debugger; ~~~~~~~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. do { } while (true); ~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. var x; for (x in null) { } ~~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. ~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. if (true) { } else { } ~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. 1; ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. L: var y; ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. return; ~~~~~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. switch (x) { ~~~~~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. case 1: break; default: @@ -40,10 +57,10 @@ } throw "nooo"; ~~~~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. try { ~~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. } catch (e) { } @@ -51,8 +68,8 @@ } with (x) { ~~~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. ~ -!!! All symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. } } \ No newline at end of file diff --git a/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt b/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt index 5547ccb63f7..d97cdc95ac8 100644 --- a/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt +++ b/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt @@ -1,16 +1,23 @@ +tests/cases/compiler/ambiguousGenericAssertion1.ts(4,10): error TS1109: Expression expected. +tests/cases/compiler/ambiguousGenericAssertion1.ts(4,16): error TS1005: ')' expected. +tests/cases/compiler/ambiguousGenericAssertion1.ts(4,19): error TS1005: ',' expected. +tests/cases/compiler/ambiguousGenericAssertion1.ts(4,21): error TS1005: ';' expected. +tests/cases/compiler/ambiguousGenericAssertion1.ts(4,15): error TS2304: Cannot find name 'x'. + + ==== tests/cases/compiler/ambiguousGenericAssertion1.ts (5 errors) ==== function f(x: T): T { return null; } var r = (x: T) => x; var r2 = < (x: T) => T>f; // valid var r3 = <(x: T) => T>f; // ambiguous, appears to the parser as a << operation ~~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~ -!!! ')' expected. +!!! error TS1005: ')' expected. ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. \ No newline at end of file diff --git a/tests/baselines/reference/ambiguousOverload.errors.txt b/tests/baselines/reference/ambiguousOverload.errors.txt index 90e973ffba4..936e6e71220 100644 --- a/tests/baselines/reference/ambiguousOverload.errors.txt +++ b/tests/baselines/reference/ambiguousOverload.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/ambiguousOverload.ts(5,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2322: Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/ambiguousOverload.ts (2 errors) ==== function foof(bar: string, y): number; function foof(bar: string, x): string; @@ -5,7 +9,7 @@ var x: number = foof("s", null); var y: string = foof("s", null); ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. function foof2(bar: string, x): string; function foof2(bar: string, y): number; @@ -13,4 +17,4 @@ var x2: string = foof2("s", null); var y2: number = foof2("s", null); ~~ -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/amdDependencyComment1.errors.txt b/tests/baselines/reference/amdDependencyComment1.errors.txt index 97ce60ff1b8..8e436a56547 100644 --- a/tests/baselines/reference/amdDependencyComment1.errors.txt +++ b/tests/baselines/reference/amdDependencyComment1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/amdDependencyComment1.ts(3,21): error TS2307: Cannot find external module 'm2'. + + ==== tests/cases/compiler/amdDependencyComment1.ts (1 errors) ==== /// import m1 = require("m2") ~~~~ -!!! Cannot find external module 'm2'. +!!! error TS2307: Cannot find external module 'm2'. m1.f(); \ No newline at end of file diff --git a/tests/baselines/reference/amdDependencyComment2.errors.txt b/tests/baselines/reference/amdDependencyComment2.errors.txt index edab2e9c955..bddd4e334e6 100644 --- a/tests/baselines/reference/amdDependencyComment2.errors.txt +++ b/tests/baselines/reference/amdDependencyComment2.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/amdDependencyComment2.ts(3,21): error TS2307: Cannot find external module 'm2'. + + ==== tests/cases/compiler/amdDependencyComment2.ts (1 errors) ==== /// import m1 = require("m2") ~~~~ -!!! Cannot find external module 'm2'. +!!! error TS2307: Cannot find external module 'm2'. m1.f(); \ No newline at end of file diff --git a/tests/baselines/reference/amdModuleName1.js b/tests/baselines/reference/amdModuleName1.js new file mode 100644 index 00000000000..e3505a007e3 --- /dev/null +++ b/tests/baselines/reference/amdModuleName1.js @@ -0,0 +1,22 @@ +//// [amdModuleName1.ts] +/// +class Foo { + x: number; + constructor() { + this.x = 5; + } +} +export = Foo; + + +//// [amdModuleName1.js] +define("NamedModule", ["require", "exports"], function (require, exports) { + /// + var Foo = (function () { + function Foo() { + this.x = 5; + } + return Foo; + })(); + return Foo; +}); diff --git a/tests/baselines/reference/amdModuleName1.types b/tests/baselines/reference/amdModuleName1.types new file mode 100644 index 00000000000..02ad9472354 --- /dev/null +++ b/tests/baselines/reference/amdModuleName1.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/amdModuleName1.ts === +/// +class Foo { +>Foo : Foo + + x: number; +>x : number + + constructor() { + this.x = 5; +>this.x = 5 : number +>this.x : number +>this : Foo +>x : number + } +} +export = Foo; +>Foo : Foo + diff --git a/tests/baselines/reference/amdModuleName2.errors.txt b/tests/baselines/reference/amdModuleName2.errors.txt new file mode 100644 index 00000000000..cf7fb82ae10 --- /dev/null +++ b/tests/baselines/reference/amdModuleName2.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/amdModuleName2.ts(2,1): error TS2458: An AMD module cannot have multiple name assignments. + + +==== tests/cases/compiler/amdModuleName2.ts (1 errors) ==== + /// + /// + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2458: An AMD module cannot have multiple name assignments. + class Foo { + x: number; + constructor() { + this.x = 5; + } + } + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/anonymousModules.errors.txt b/tests/baselines/reference/anonymousModules.errors.txt index b50f7591968..43b3d544a8b 100644 --- a/tests/baselines/reference/anonymousModules.errors.txt +++ b/tests/baselines/reference/anonymousModules.errors.txt @@ -1,40 +1,55 @@ +tests/cases/compiler/anonymousModules.ts(1,8): error TS1005: ';' expected. +tests/cases/compiler/anonymousModules.ts(2,2): error TS1129: Statement expected. +tests/cases/compiler/anonymousModules.ts(2,2): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/anonymousModules.ts(4,9): error TS1005: ';' expected. +tests/cases/compiler/anonymousModules.ts(5,3): error TS1129: Statement expected. +tests/cases/compiler/anonymousModules.ts(6,2): error TS1128: Declaration or statement expected. +tests/cases/compiler/anonymousModules.ts(10,9): error TS1005: ';' expected. +tests/cases/compiler/anonymousModules.ts(13,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/anonymousModules.ts(1,1): error TS2304: Cannot find name 'module'. +tests/cases/compiler/anonymousModules.ts(4,2): error TS2304: Cannot find name 'module'. +tests/cases/compiler/anonymousModules.ts(5,14): error TS2395: Individual declarations in merged declaration bar must be all exported or all local. +tests/cases/compiler/anonymousModules.ts(8,6): error TS2395: Individual declarations in merged declaration bar must be all exported or all local. +tests/cases/compiler/anonymousModules.ts(10,2): error TS2304: Cannot find name 'module'. + + ==== tests/cases/compiler/anonymousModules.ts (13 errors) ==== module { ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~ -!!! Cannot find name 'module'. +!!! error TS2304: Cannot find name 'module'. export var foo = 1; ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. ~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. module { ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~ -!!! Cannot find name 'module'. +!!! error TS2304: Cannot find name 'module'. export var bar = 1; ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. ~~~ -!!! Individual declarations in merged declaration bar must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration bar must be all exported or all local. } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. var bar = 2; ~~~ -!!! Individual declarations in merged declaration bar must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration bar must be all exported or all local. module { ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~ -!!! Cannot find name 'module'. +!!! error TS2304: Cannot find name 'module'. var x = bar; } } ~ -!!! Declaration or statement expected. \ No newline at end of file +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/anyAsConstructor.errors.txt b/tests/baselines/reference/anyAsConstructor.errors.txt index ffd31da4045..147d7957906 100644 --- a/tests/baselines/reference/anyAsConstructor.errors.txt +++ b/tests/baselines/reference/anyAsConstructor.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/types/any/anyAsConstructor.ts(10,9): error TS2347: Untyped function calls may not accept type arguments. + + ==== tests/cases/conformance/types/any/anyAsConstructor.ts (1 errors) ==== // any is considered an untyped function call // can be called except with type arguments which is an error @@ -10,4 +13,4 @@ // grammar allows this for constructors var d = new x(x); // no error ~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. \ No newline at end of file +!!! error TS2347: Untyped function calls may not accept type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt b/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt index 7fbe17d0e18..9dbee62e079 100644 --- a/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt +++ b/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/types/any/anyAsGenericFunctionCall.ts(5,9): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/types/any/anyAsGenericFunctionCall.ts(6,9): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/types/any/anyAsGenericFunctionCall.ts(9,9): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/types/any/anyAsGenericFunctionCall.ts(10,9): error TS2347: Untyped function calls may not accept type arguments. + + ==== tests/cases/conformance/types/any/anyAsGenericFunctionCall.ts (4 errors) ==== // any is considered an untyped function call // can be called except with type arguments which is an error @@ -5,15 +11,15 @@ var x: any; var a = x(); ~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. var b = x('hello'); ~~~~~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. class C { foo: string; } var c = x(x); ~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. var d = x(x); ~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. \ No newline at end of file +!!! error TS2347: Untyped function calls may not accept type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/anyAssignableToEveryType2.errors.txt b/tests/baselines/reference/anyAssignableToEveryType2.errors.txt index 927fe3c6274..e5f9a07476e 100644 --- a/tests/baselines/reference/anyAssignableToEveryType2.errors.txt +++ b/tests/baselines/reference/anyAssignableToEveryType2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType2.ts(114,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType2.ts (1 errors) ==== // any is not a subtype of any other types, but is assignable, all the below should work @@ -114,7 +117,7 @@ interface I18 { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: any; } diff --git a/tests/baselines/reference/anyDeclare.errors.txt b/tests/baselines/reference/anyDeclare.errors.txt index 0bb771b6d91..8eda3672f24 100644 --- a/tests/baselines/reference/anyDeclare.errors.txt +++ b/tests/baselines/reference/anyDeclare.errors.txt @@ -1,9 +1,15 @@ -==== tests/cases/compiler/anyDeclare.ts (1 errors) ==== +tests/cases/compiler/anyDeclare.ts(3,9): error TS2300: Duplicate identifier 'myFn'. +tests/cases/compiler/anyDeclare.ts(4,14): error TS2300: Duplicate identifier 'myFn'. + + +==== tests/cases/compiler/anyDeclare.ts (2 errors) ==== declare var x: any; module myMod { var myFn; + ~~~~ +!!! error TS2300: Duplicate identifier 'myFn'. function myFn() { } ~~~~ -!!! Duplicate identifier 'myFn'. +!!! error TS2300: Duplicate identifier 'myFn'. } \ No newline at end of file diff --git a/tests/baselines/reference/anyIdenticalToItself.errors.txt b/tests/baselines/reference/anyIdenticalToItself.errors.txt index 36c31825cb9..ea8583a6a75 100644 --- a/tests/baselines/reference/anyIdenticalToItself.errors.txt +++ b/tests/baselines/reference/anyIdenticalToItself.errors.txt @@ -1,19 +1,24 @@ +tests/cases/compiler/anyIdenticalToItself.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/anyIdenticalToItself.ts(10,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/anyIdenticalToItself.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. + + ==== tests/cases/compiler/anyIdenticalToItself.ts (3 errors) ==== function foo(x: any); ~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function foo(x: any); function foo(x: any, y: number) { } class C { get X(): any { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var y: any; return y; } set X(v: any) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } \ No newline at end of file diff --git a/tests/baselines/reference/apparentTypeSubtyping.errors.txt b/tests/baselines/reference/apparentTypeSubtyping.errors.txt index f5725bd07ff..e1a53ef6a73 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.errors.txt +++ b/tests/baselines/reference/apparentTypeSubtyping.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtyping.ts(9,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Types of property 'x' are incompatible. + Type 'String' is not assignable to type 'string'. + + ==== tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtyping.ts (1 errors) ==== // subtype checks use the apparent type of the target type // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: @@ -9,9 +14,9 @@ // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) class Derived extends Base { // error ~~~~~~~ -!!! Class 'Derived' incorrectly extends base class 'Base': -!!! Types of property 'x' are incompatible: -!!! Type 'String' is not assignable to type 'string'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'String' is not assignable to type 'string'. x: String; } diff --git a/tests/baselines/reference/apparentTypeSupertype.errors.txt b/tests/baselines/reference/apparentTypeSupertype.errors.txt index a2442d71222..7d653f34bf9 100644 --- a/tests/baselines/reference/apparentTypeSupertype.errors.txt +++ b/tests/baselines/reference/apparentTypeSupertype.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts(9,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Types of property 'x' are incompatible. + Type 'U' is not assignable to type 'string'. + + ==== tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts (1 errors) ==== // subtype checks use the apparent type of the target type // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: @@ -9,8 +14,8 @@ // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) class Derived extends Base { // error ~~~~~~~ -!!! Class 'Derived' incorrectly extends base class 'Base': -!!! Types of property 'x' are incompatible: -!!! Type 'U' is not assignable to type 'string'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'string'. x: U; } \ No newline at end of file diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt index b894b6193eb..812bbe15da4 100644 --- a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments'. + Property 'length' is missing in type 'Number'. + + ==== tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts (1 errors) ==== var arguments = 10; function foo(a) { arguments = 10; /// This shouldnt be of type number and result in error. ~~~~~~~~~ -!!! Type 'number' is not assignable to type 'IArguments': -!!! Property 'length' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'IArguments'. +!!! error TS2322: Property 'length' is missing in type 'Number'. } \ No newline at end of file diff --git a/tests/baselines/reference/arithAssignTyping.errors.txt b/tests/baselines/reference/arithAssignTyping.errors.txt index cdeaf948293..c4cd84639a6 100644 --- a/tests/baselines/reference/arithAssignTyping.errors.txt +++ b/tests/baselines/reference/arithAssignTyping.errors.txt @@ -1,39 +1,53 @@ +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(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. +tests/cases/compiler/arithAssignTyping.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/compiler/arithAssignTyping.ts(9,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(10,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(11,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(12,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(13,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(14,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 (12 errors) ==== class f { } f += ''; // error ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. f += 1; // error ~~~~~~ -!!! Operator '+=' cannot be applied to types 'typeof f' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'typeof f' and 'number'. f -= 1; // error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. f *= 1; // error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. f /= 1; // error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. f %= 1; // error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. f &= 1; // error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. f |= 1; // error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. f <<= 1; // error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. f >>= 1; // error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. f >>>= 1; // error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. f ^= 1; // error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! error TS2362: The left-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/arithmeticOnInvalidTypes.errors.txt b/tests/baselines/reference/arithmeticOnInvalidTypes.errors.txt index caa8c959d6f..2c042af6f86 100644 --- a/tests/baselines/reference/arithmeticOnInvalidTypes.errors.txt +++ b/tests/baselines/reference/arithmeticOnInvalidTypes.errors.txt @@ -1,21 +1,30 @@ +tests/cases/compiler/arithmeticOnInvalidTypes.ts(3,9): error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. +tests/cases/compiler/arithmeticOnInvalidTypes.ts(4,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/arithmeticOnInvalidTypes.ts(4,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/arithmeticOnInvalidTypes.ts(5,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/arithmeticOnInvalidTypes.ts(5,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/arithmeticOnInvalidTypes.ts(6,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/arithmeticOnInvalidTypes.ts(6,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + ==== tests/cases/compiler/arithmeticOnInvalidTypes.ts (7 errors) ==== var x: Number; var y: Number; var z = x + y; ~~~~~ -!!! Operator '+' cannot be applied to types 'Number' and 'Number'. +!!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. var z2 = x - y; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var z3 = x * y; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var z4 = x / y; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! 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/arithmeticOnInvalidTypes2.errors.txt b/tests/baselines/reference/arithmeticOnInvalidTypes2.errors.txt index 5cb6824846d..d5b74e5abc7 100644 --- a/tests/baselines/reference/arithmeticOnInvalidTypes2.errors.txt +++ b/tests/baselines/reference/arithmeticOnInvalidTypes2.errors.txt @@ -1,22 +1,31 @@ +tests/cases/compiler/arithmeticOnInvalidTypes2.ts(2,14): error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. +tests/cases/compiler/arithmeticOnInvalidTypes2.ts(3,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/arithmeticOnInvalidTypes2.ts(3,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/arithmeticOnInvalidTypes2.ts(4,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/arithmeticOnInvalidTypes2.ts(4,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/arithmeticOnInvalidTypes2.ts(5,14): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/arithmeticOnInvalidTypes2.ts(5,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + ==== tests/cases/compiler/arithmeticOnInvalidTypes2.ts (7 errors) ==== var obj = function f(a: T, b: T) { var z1 = a + b; ~~~~~ -!!! Operator '+' cannot be applied to types 'T' and 'T'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. var z2 = a - b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var z3 = a * b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var z4 = a / b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. return a; }; \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.errors.txt index 359d6c8095a..0d376912b8d 100644 --- a/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.errors.txt @@ -1,4 +1,563 @@ -==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts (560 errors) ==== +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(15,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(17,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(18,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(19,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(21,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(22,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(22,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(23,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(24,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(24,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(25,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(25,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(26,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(26,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(29,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(31,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(32,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(33,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(35,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(36,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(36,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(37,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(38,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(38,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(39,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(39,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(40,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(40,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(42,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(43,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(43,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(44,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(45,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(45,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(46,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(46,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(47,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(47,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(49,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(50,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(50,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(51,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(52,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(52,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(53,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(53,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(54,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(54,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(57,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(59,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(60,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(61,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(64,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(66,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(67,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(68,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(72,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(74,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(75,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(76,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(78,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(79,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(79,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(80,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(81,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(81,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(82,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(82,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(83,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(83,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(86,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(88,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(89,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(90,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(92,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(93,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(93,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(94,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(95,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(95,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(96,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(96,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(97,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(97,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(99,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(100,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(100,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(101,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(102,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(102,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(103,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(103,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(104,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(104,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(106,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(107,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(107,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(108,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(109,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(109,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(110,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(110,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(111,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(111,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(114,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(116,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(117,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(118,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(121,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(123,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(124,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(125,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(129,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(131,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(132,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(133,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(135,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(136,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(136,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(137,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(138,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(138,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(139,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(139,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(140,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(140,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(143,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(145,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(146,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(147,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(149,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(150,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(150,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(151,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(152,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(152,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(153,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(153,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(154,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(154,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(156,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(157,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(157,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(158,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(159,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(159,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(160,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(160,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(161,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(161,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(163,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(164,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(164,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(165,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(166,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(166,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(167,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(167,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(168,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(168,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(171,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(173,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(174,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(175,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(178,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(180,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(181,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(182,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(186,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(188,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(189,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(190,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(192,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(193,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(193,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(194,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(195,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(195,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(196,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(196,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(197,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(197,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(200,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(202,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(203,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(204,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(206,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(207,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(207,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(208,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(209,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(209,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(210,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(210,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(211,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(211,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(213,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(214,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(214,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(215,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(216,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(216,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(217,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(217,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(218,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(218,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(220,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(221,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(221,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(222,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(223,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(223,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(224,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(224,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(225,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(225,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(228,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(230,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(231,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(232,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(235,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(237,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(238,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(239,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(243,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(245,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(246,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(247,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(249,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(250,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(250,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(251,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(252,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(252,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(253,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(253,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(254,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(254,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(257,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(259,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(260,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(261,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(263,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(264,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(264,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(265,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(266,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(266,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(267,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(267,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(268,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(268,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(270,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(271,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(271,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(272,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(273,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(273,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(274,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(274,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(275,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(275,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(277,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(278,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(278,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(279,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(280,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(280,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(281,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(281,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(282,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(282,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(285,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(287,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(288,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(289,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(292,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(294,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(295,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(296,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(300,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(302,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(303,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(304,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(306,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(307,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(307,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(308,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(309,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(309,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(310,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(310,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(311,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(311,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(314,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(316,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(317,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(318,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(320,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(321,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(321,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(322,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(323,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(323,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(324,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(324,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(325,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(325,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(327,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(328,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(328,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(329,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(330,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(330,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(331,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(331,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(332,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(332,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(334,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(335,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(335,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(336,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(337,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(337,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(338,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(338,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(339,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(339,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(342,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(344,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(345,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(346,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(349,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(351,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(352,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(353,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(357,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(359,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(360,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(361,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(363,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(364,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(364,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(365,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(366,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(366,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(367,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(367,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(368,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(368,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(371,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(373,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(374,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(375,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(377,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(378,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(378,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(379,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(380,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(380,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(381,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(381,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(382,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(382,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(384,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(385,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(385,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(386,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(387,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(387,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(388,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(388,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(389,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(389,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(391,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(392,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(392,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(393,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(394,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(394,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(395,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(395,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(396,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(396,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(399,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(401,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(402,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(403,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(406,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(408,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(409,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(410,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(414,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(416,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(417,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(418,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(420,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(421,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(422,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(423,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(423,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(424,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(424,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(425,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(425,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(428,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(430,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(431,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(432,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(434,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(435,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(435,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(436,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(437,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(437,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(438,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(438,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(439,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(439,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(441,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(442,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(442,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(443,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(444,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(444,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(445,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(445,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(446,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(446,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(448,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(449,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(449,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(450,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(451,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(451,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(452,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(452,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(453,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(453,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(456,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(458,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(459,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(460,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(463,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(465,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(466,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(467,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(471,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(473,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(474,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(475,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(477,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(478,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(479,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(480,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(480,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(481,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(481,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(482,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(482,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(485,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(487,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(488,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(489,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(491,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(492,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(492,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(493,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(494,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(494,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(495,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(495,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(496,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(496,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(498,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(499,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(499,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(500,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(501,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(501,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(502,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(502,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(503,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(503,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(505,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(506,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(506,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(507,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(508,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(508,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(509,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(509,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(510,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(510,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(513,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(515,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(516,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(517,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(520,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(522,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(523,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(524,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(528,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(530,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(531,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(532,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(534,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(535,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(536,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(537,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(537,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(538,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(538,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(539,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(539,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(542,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(544,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(545,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(546,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(548,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(549,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(549,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(550,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(551,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(551,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(552,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(552,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(553,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(553,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(555,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(556,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(556,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(557,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(558,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(558,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(559,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(559,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(560,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(560,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(562,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(563,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(563,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(564,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(565,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(565,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(566,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(566,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(567,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(567,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(570,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(572,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(573,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(574,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(577,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(579,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(580,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(581,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts (557 errors) ==== // these operators require their operands to be of type Any, the Number primitive type, or // an enum type enum E { a, b, c } @@ -15,1688 +574,1682 @@ var r1a1 = a * a; //ok var r1a2 = a * b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a3 = a * c; //ok var r1a4 = a * d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a5 = a * e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a6 = a * f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b1 = b * a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b2 = b * b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b3 = b * c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b4 = b * d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b5 = b * e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b6 = b * f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c1 = c * a; //ok var r1c2 = c * b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c3 = c * c; //ok var r1c4 = c * d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c5 = c * e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c6 = c * f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d1 = d * a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d2 = d * b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d3 = d * c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d4 = d * d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d5 = d * e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d6 = d * f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e1 = e * a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e2 = e * b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e3 = e * c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e4 = e * d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e5 = e * e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e6 = e * f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f1 = f * a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f2 = f * b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f3 = f * c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f4 = f * d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f5 = f * e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f6 = f * f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1g1 = E.a * a; //ok var r1g2 = E.a * b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1g3 = E.a * c; //ok var r1g4 = E.a * d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1g5 = E.a * e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1g6 = E.a * f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1h1 = a * E.b; //ok var r1h2 = b * E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1h3 = c * E.b; //ok var r1h4 = d * E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1h5 = e * E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1h6 = f * E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator / var r2a1 = a / a; //ok var r2a2 = a / b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a3 = a / c; //ok var r2a4 = a / d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a5 = a / e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a6 = a / f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b1 = b / a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b2 = b / b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b3 = b / c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b4 = b / d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b5 = b / e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b6 = b / f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c1 = c / a; //ok var r2c2 = c / b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c3 = c / c; //ok var r2c4 = c / d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c5 = c / e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c6 = c / f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d1 = d / a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d2 = d / b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d3 = d / c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d4 = d / d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d5 = d / e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d6 = d / f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e1 = e / a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e2 = e / b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e3 = e / c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e4 = e / d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e5 = e / e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e6 = e / f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2f1 = f / a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2f2 = f / b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2f3 = f / c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2f4 = f / d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2f5 = f / e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2f6 = f / f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2g1 = E.a / a; //ok var r2g2 = E.a / b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2g3 = E.a / c; //ok var r2g4 = E.a / d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2g5 = E.a / e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2g6 = E.a / f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2h1 = a / E.b; //ok var r2h2 = b / E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2h3 = c / E.b; //ok var r2h4 = d / E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2h5 = e / E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2h6 = f / E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator % var r3a1 = a % a; //ok var r3a2 = a % b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3a3 = a % c; //ok var r3a4 = a % d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3a5 = a % e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3a6 = a % f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b1 = b % a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b2 = b % b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b3 = b % c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b4 = b % d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b5 = b % e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b6 = b % f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3c1 = c % a; //ok var r3c2 = c % b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3c3 = c % c; //ok var r3c4 = c % d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3c5 = c % e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3c6 = c % f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d1 = d % a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d2 = d % b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d3 = d % c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d4 = d % d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d5 = d % e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d6 = d % f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3e1 = e % a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3e2 = e % b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3e3 = e % c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3e4 = e % d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3e5 = e % e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3e6 = e % f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3f1 = f % a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3f2 = f % b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3f3 = f % c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3f4 = f % d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3f5 = f % e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3f6 = f % f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3g1 = E.a % a; //ok var r3g2 = E.a % b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3g3 = E.a % c; //ok var r3g4 = E.a % d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3g5 = E.a % e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3g6 = E.a % f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3h1 = a % E.b; //ok var r3h2 = b % E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3h3 = c % E.b; //ok var r3h4 = d % E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3h5 = e % E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3h6 = f % E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator - var r4a1 = a - a; //ok var r4a2 = a - b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4a3 = a - c; //ok var r4a4 = a - d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4a5 = a - e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4a6 = a - f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b1 = b - a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b2 = b - b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b3 = b - c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b4 = b - d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b5 = b - e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b6 = b - f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4c1 = c - a; //ok var r4c2 = c - b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4c3 = c - c; //ok var r4c4 = c - d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4c5 = c - e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4c6 = c - f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d1 = d - a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d2 = d - b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d3 = d - c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d4 = d - d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d5 = d - e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d6 = d - f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4e1 = e - a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4e2 = e - b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4e3 = e - c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4e4 = e - d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4e5 = e - e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4e6 = e - f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4f1 = f - a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4f2 = f - b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4f3 = f - c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4f4 = f - d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4f5 = f - e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4f6 = f - f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4g1 = E.a - a; //ok var r4g2 = E.a - b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4g3 = E.a - c; //ok var r4g4 = E.a - d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4g5 = E.a - e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4g6 = E.a - f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4h1 = a - E.b; //ok var r4h2 = b - E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4h3 = c - E.b; //ok var r4h4 = d - E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4h5 = e - E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4h6 = f - E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator << var r5a1 = a << a; //ok var r5a2 = a << b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5a3 = a << c; //ok var r5a4 = a << d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5a5 = a << e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5a6 = a << f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b1 = b << a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b2 = b << b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b3 = b << c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b4 = b << d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b5 = b << e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b6 = b << f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5c1 = c << a; //ok var r5c2 = c << b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5c3 = c << c; //ok var r5c4 = c << d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5c5 = c << e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5c6 = c << f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d1 = d << a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d2 = d << b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d3 = d << c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d4 = d << d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d5 = d << e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d6 = d << f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5e1 = e << a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5e2 = e << b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5e3 = e << c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5e4 = e << d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5e5 = e << e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5e6 = e << f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5f1 = f << a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5f2 = f << b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5f3 = f << c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5f4 = f << d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5f5 = f << e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5f6 = f << f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5g1 = E.a << a; //ok var r5g2 = E.a << b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5g3 = E.a << c; //ok var r5g4 = E.a << d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5g5 = E.a << e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5g6 = E.a << f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5h1 = a << E.b; //ok var r5h2 = b << E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5h3 = c << E.b; //ok var r5h4 = d << E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5h5 = e << E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5h6 = f << E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator >> var r6a1 = a >> a; //ok var r6a2 = a >> b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6a3 = a >> c; //ok var r6a4 = a >> d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6a5 = a >> e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6a6 = a >> f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b1 = b >> a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b2 = b >> b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b3 = b >> c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b4 = b >> d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b5 = b >> e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b6 = b >> f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6c1 = c >> a; //ok var r6c2 = c >> b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6c3 = c >> c; //ok var r6c4 = c >> d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6c5 = c >> e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6c6 = c >> f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d1 = d >> a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d2 = d >> b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d3 = d >> c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d4 = d >> d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d5 = d >> e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d6 = d >> f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6e1 = e >> a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6e2 = e >> b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6e3 = e >> c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6e4 = e >> d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6e5 = e >> e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6e6 = e >> f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6f1 = f >> a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6f2 = f >> b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6f3 = f >> c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6f4 = f >> d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6f5 = f >> e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6f6 = f >> f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6g1 = E.a >> a; //ok var r6g2 = E.a >> b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6g3 = E.a >> c; //ok var r6g4 = E.a >> d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6g5 = E.a >> e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6g6 = E.a >> f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6h1 = a >> E.b; //ok var r6h2 = b >> E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6h3 = c >> E.b; //ok var r6h4 = d >> E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6h5 = e >> E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6h6 = f >> E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator >>> var r7a1 = a >>> a; //ok var r7a2 = a >>> b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7a3 = a >>> c; //ok var r7a4 = a >>> d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7a5 = a >>> e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7a6 = a >>> f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b1 = b >>> a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b2 = b >>> b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b3 = b >>> c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b4 = b >>> d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b5 = b >>> e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b6 = b >>> f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7c1 = c >>> a; //ok var r7c2 = c >>> b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7c3 = c >>> c; //ok var r7c4 = c >>> d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7c5 = c >>> e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7c6 = c >>> f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d1 = d >>> a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d2 = d >>> b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d3 = d >>> c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d4 = d >>> d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d5 = d >>> e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d6 = d >>> f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7e1 = e >>> a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7e2 = e >>> b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7e3 = e >>> c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7e4 = e >>> d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7e5 = e >>> e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7e6 = e >>> f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7f1 = f >>> a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7f2 = f >>> b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7f3 = f >>> c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7f4 = f >>> d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7f5 = f >>> e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7f6 = f >>> f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7g1 = E.a >>> a; //ok var r7g2 = E.a >>> b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7g3 = E.a >>> c; //ok var r7g4 = E.a >>> d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7g5 = E.a >>> e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7g6 = E.a >>> f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7h1 = a >>> E.b; //ok var r7h2 = b >>> E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7h3 = c >>> E.b; //ok var r7h4 = d >>> E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7h5 = e >>> E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7h6 = f >>> E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator & var r8a1 = a & a; //ok var r8a2 = a & b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8a3 = a & c; //ok var r8a4 = a & d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8a5 = a & e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8a6 = a & f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8b1 = b & a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8b2 = b & b; - ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~ +!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. var r8b3 = b & c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8b4 = b & d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8b5 = b & e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8b6 = b & f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8c1 = c & a; //ok var r8c2 = c & b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8c3 = c & c; //ok var r8c4 = c & d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8c5 = c & e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8c6 = c & f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8d1 = d & a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8d2 = d & b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8d3 = d & c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8d4 = d & d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8d5 = d & e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8d6 = d & f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8e1 = e & a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8e2 = e & b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8e3 = e & c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8e4 = e & d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8e5 = e & e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8e6 = e & f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8f1 = f & a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8f2 = f & b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8f3 = f & c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8f4 = f & d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8f5 = f & e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8f6 = f & f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8g1 = E.a & a; //ok var r8g2 = E.a & b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8g3 = E.a & c; //ok var r8g4 = E.a & d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8g5 = E.a & e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8g6 = E.a & f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8h1 = a & E.b; //ok var r8h2 = b & E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8h3 = c & E.b; //ok var r8h4 = d & E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8h5 = e & E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8h6 = f & E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator ^ var r9a1 = a ^ a; //ok var r9a2 = a ^ b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9a3 = a ^ c; //ok var r9a4 = a ^ d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9a5 = a ^ e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9a6 = a ^ f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9b1 = b ^ a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9b2 = b ^ b; - ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~ +!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. var r9b3 = b ^ c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9b4 = b ^ d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9b5 = b ^ e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9b6 = b ^ f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9c1 = c ^ a; //ok var r9c2 = c ^ b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9c3 = c ^ c; //ok var r9c4 = c ^ d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9c5 = c ^ e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9c6 = c ^ f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9d1 = d ^ a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9d2 = d ^ b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9d3 = d ^ c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9d4 = d ^ d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9d5 = d ^ e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9d6 = d ^ f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9e1 = e ^ a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9e2 = e ^ b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9e3 = e ^ c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9e4 = e ^ d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9e5 = e ^ e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9e6 = e ^ f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9f1 = f ^ a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9f2 = f ^ b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9f3 = f ^ c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9f4 = f ^ d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9f5 = f ^ e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9f6 = f ^ f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9g1 = E.a ^ a; //ok var r9g2 = E.a ^ b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9g3 = E.a ^ c; //ok var r9g4 = E.a ^ d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9g5 = E.a ^ e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9g6 = E.a ^ f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9h1 = a ^ E.b; //ok var r9h2 = b ^ E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9h3 = c ^ E.b; //ok var r9h4 = d ^ E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9h5 = e ^ E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9h6 = f ^ E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator | var r10a1 = a | a; //ok var r10a2 = a | b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10a3 = a | c; //ok var r10a4 = a | d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10a5 = a | e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10a6 = a | f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10b1 = b | a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10b2 = b | b; - ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~ +!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. var r10b3 = b | c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10b4 = b | d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10b5 = b | e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10b6 = b | f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10c1 = c | a; //ok var r10c2 = c | b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10c3 = c | c; //ok var r10c4 = c | d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10c5 = c | e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10c6 = c | f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10d1 = d | a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10d2 = d | b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10d3 = d | c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10d4 = d | d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10d5 = d | e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10d6 = d | f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10e1 = e | a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10e2 = e | b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10e3 = e | c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10e4 = e | d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10e5 = e | e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10e6 = e | f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10f1 = f | a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10f2 = f | b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10f3 = f | c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10f4 = f | d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10f5 = f | e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10f6 = f | f; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10g1 = E.a | a; //ok var r10g2 = E.a | b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10g3 = E.a | c; //ok var r10g4 = E.a | d; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10g5 = E.a | e; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10g6 = E.a | f; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10h1 = a | E.b; //ok var r10h2 = b | E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10h3 = c | E.b; //ok var r10h4 = d | E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10h5 = e | E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10h6 = f | E.b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! error TS2362: The left-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/arithmeticOperatorWithNullValueAndInvalidOperands.errors.txt b/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.errors.txt index 43c223bcd48..c043cda8e68 100644 --- a/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.errors.txt +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.errors.txt @@ -1,4 +1,234 @@ -==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts (240 errors) ==== +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(9,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(9,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(10,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(10,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(11,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(11,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(13,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(13,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(14,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(14,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(15,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(15,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(17,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(17,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(18,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(18,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(19,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(19,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(21,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(21,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(22,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(22,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(23,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(23,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(26,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(26,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(27,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(27,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(28,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(28,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(30,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(30,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(31,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(31,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(32,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(32,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(34,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(34,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(35,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(35,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(36,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(36,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(38,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(38,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(39,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(39,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(40,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(40,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(43,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(43,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(44,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(44,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(45,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(45,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(47,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(47,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(48,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(48,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(49,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(49,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(51,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(51,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(52,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(52,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(53,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(53,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(55,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(55,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(56,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(56,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(57,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(57,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(60,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(60,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(61,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(61,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(62,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(62,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(64,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(64,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(65,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(65,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(66,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(66,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(68,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(68,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(69,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(69,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(70,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(70,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(72,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(72,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(73,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(73,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(74,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(74,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(77,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(77,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(78,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(78,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(79,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(79,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(81,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(81,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(82,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(82,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(83,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(83,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(85,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(85,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(86,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(86,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(87,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(87,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(89,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(89,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(90,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(90,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(91,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(91,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(94,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(94,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(95,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(95,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(96,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(96,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(98,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(98,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(99,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(99,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(100,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(100,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(102,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(102,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(103,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(103,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(104,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(104,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(106,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(106,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(107,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(107,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(108,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(108,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(111,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(111,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(112,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(112,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(113,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(113,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(115,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(115,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(116,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(116,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(117,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(117,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(119,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(119,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(120,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(120,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(121,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(121,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(123,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(123,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(124,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(124,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(125,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(125,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(128,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(129,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(129,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(130,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(130,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(132,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(133,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(133,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(134,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(134,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(136,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(137,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(137,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(138,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(138,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(140,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(141,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(141,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(142,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(142,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(145,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(146,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(146,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(147,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(147,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(149,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(150,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(150,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(151,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(151,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(153,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(154,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(154,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(155,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(155,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(157,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(158,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(158,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(159,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(159,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(162,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(163,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(163,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(164,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(164,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(166,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(167,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(167,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(168,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(168,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(170,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(171,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(171,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(172,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(172,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(174,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(175,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(175,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(176,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(176,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts (228 errors) ==== // If one operand is the null or undefined value, it is treated as having the type of the // other operand. @@ -9,649 +239,625 @@ // operator * var r1a1 = null * a; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a2 = null * b; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a3 = null * c; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b1 = a * null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b2 = b * null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b3 = c * null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c1 = null * true; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c2 = null * ''; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c3 = null * {}; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d1 = true * null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d2 = '' * null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d3 = {} * null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator / var r2a1 = null / a; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a2 = null / b; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a3 = null / c; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b1 = a / null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b2 = b / null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b3 = c / null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c1 = null / true; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c2 = null / ''; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c3 = null / {}; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d1 = true / null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d2 = '' / null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d3 = {} / null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator % var r3a1 = null % a; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3a2 = null % b; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3a3 = null % c; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b1 = a % null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b2 = b % null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b3 = c % null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3c1 = null % true; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3c2 = null % ''; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3c3 = null % {}; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d1 = true % null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d2 = '' % null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d3 = {} % null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator - var r4a1 = null - a; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4a2 = null - b; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4a3 = null - c; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b1 = a - null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b2 = b - null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b3 = c - null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4c1 = null - true; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4c2 = null - ''; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4c3 = null - {}; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d1 = true - null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d2 = '' - null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d3 = {} - null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator << var r5a1 = null << a; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5a2 = null << b; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5a3 = null << c; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b1 = a << null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b2 = b << null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b3 = c << null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5c1 = null << true; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5c2 = null << ''; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5c3 = null << {}; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d1 = true << null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d2 = '' << null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d3 = {} << null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator >> var r6a1 = null >> a; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6a2 = null >> b; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6a3 = null >> c; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b1 = a >> null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b2 = b >> null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b3 = c >> null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6c1 = null >> true; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6c2 = null >> ''; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6c3 = null >> {}; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d1 = true >> null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d2 = '' >> null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d3 = {} >> null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator >>> var r7a1 = null >>> a; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7a2 = null >>> b; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7a3 = null >>> c; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b1 = a >>> null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b2 = b >>> null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b3 = c >>> null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7c1 = null >>> true; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7c2 = null >>> ''; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7c3 = null >>> {}; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d1 = true >>> null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d2 = '' >>> null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d3 = {} >>> null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator & var r8a1 = null & a; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~ +!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. var r8a2 = null & b; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8a3 = null & c; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8b1 = a & null; - ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~ +!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. var r8b2 = b & null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8b3 = c & null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8c1 = null & true; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~ +!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. var r8c2 = null & ''; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8c3 = null & {}; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8d1 = true & null; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~ +!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. var r8d2 = '' & null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8d3 = {} & null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator ^ var r9a1 = null ^ a; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~ +!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. var r9a2 = null ^ b; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9a3 = null ^ c; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9b1 = a ^ null; - ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~ +!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. var r9b2 = b ^ null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9b3 = c ^ null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9c1 = null ^ true; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~ +!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. var r9c2 = null ^ ''; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9c3 = null ^ {}; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9d1 = true ^ null; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~ +!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. var r9d2 = '' ^ null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9d3 = {} ^ null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator | var r10a1 = null | a; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~ +!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. var r10a2 = null | b; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10a3 = null | c; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10b1 = a | null; - ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~ +!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. var r10b2 = b | null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10b3 = c | null; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10c1 = null | true; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~ +!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. var r10c2 = null | ''; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10c3 = null | {}; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10d1 = true | null; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~ +!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. var r10d2 = '' | null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10d3 = {} | null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! 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/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.errors.txt b/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.errors.txt index dd63c076c71..d00eee1d4dd 100644 --- a/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.errors.txt +++ b/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.errors.txt @@ -1,220 +1,302 @@ +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(2,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(2,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(3,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(3,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(4,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(4,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(5,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(5,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(8,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(8,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(9,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(9,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(10,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(10,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(11,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(11,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(14,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(14,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(15,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(15,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(16,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(16,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(17,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(17,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(20,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(20,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(21,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(21,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(22,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(22,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(23,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(23,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(26,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(26,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(27,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(27,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(28,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(28,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(29,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(29,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(32,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(32,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(33,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(33,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(34,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(34,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(35,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(35,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(38,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(38,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(39,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(39,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(40,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(40,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(41,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(41,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(44,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(44,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(45,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(45,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(46,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(46,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(47,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(47,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(50,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(50,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(51,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(51,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(52,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(52,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(53,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(53,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(56,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(56,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(57,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(57,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(58,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(58,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(59,11): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts(59,23): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + ==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts (80 errors) ==== // operator * var ra1 = null * null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var ra2 = null * undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var ra3 = undefined * null; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var ra4 = undefined * undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator / var rb1 = null / null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rb2 = null / undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rb3 = undefined / null; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rb4 = undefined / undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator % var rc1 = null % null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rc2 = null % undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rc3 = undefined % null; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rc4 = undefined % undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator - var rd1 = null - null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rd2 = null - undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rd3 = undefined - null; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rd4 = undefined - undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator << var re1 = null << null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var re2 = null << undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var re3 = undefined << null; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var re4 = undefined << undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator >> var rf1 = null >> null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rf2 = null >> undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rf3 = undefined >> null; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rf4 = undefined >> undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator >>> var rg1 = null >>> null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rg2 = null >>> undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rg3 = undefined >>> null; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rg4 = undefined >>> undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator & var rh1 = null & null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rh2 = null & undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rh3 = undefined & null; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rh4 = undefined & undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator ^ var ri1 = null ^ null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var ri2 = null ^ undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var ri3 = undefined ^ null; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var ri4 = undefined ^ undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator | var rj1 = null | null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rj2 = null | undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rj3 = undefined | null; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var rj4 = undefined | undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! 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/arithmeticOperatorWithTypeParameter.errors.txt b/tests/baselines/reference/arithmeticOperatorWithTypeParameter.errors.txt index afc7a7ee392..a1de1f0c795 100644 --- a/tests/baselines/reference/arithmeticOperatorWithTypeParameter.errors.txt +++ b/tests/baselines/reference/arithmeticOperatorWithTypeParameter.errors.txt @@ -1,3 +1,185 @@ +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(9,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(10,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(11,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(12,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(13,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(14,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(15,22): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(16,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(17,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(18,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(20,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(21,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(22,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(23,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(24,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(25,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(26,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(27,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(28,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(29,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(31,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(31,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(32,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(32,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(33,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(33,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(34,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(34,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(35,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(35,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(36,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(36,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(37,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(37,22): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(38,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(38,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(39,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(39,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(40,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(40,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(42,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(42,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(43,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(43,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(44,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(44,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(45,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(45,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(46,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(46,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(47,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(47,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(48,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(48,22): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(49,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(49,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(50,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(50,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(51,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(51,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(53,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(54,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(55,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(56,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(57,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(58,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(59,22): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(60,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(61,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(62,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(64,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(65,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(66,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(67,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(68,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(69,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(70,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(71,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(72,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(73,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(75,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(75,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(76,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(76,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(77,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(77,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(78,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(78,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(79,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(79,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(80,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(80,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(81,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(81,22): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(82,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(82,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(83,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(83,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(84,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(84,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(86,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(86,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(87,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(87,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(88,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(88,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(89,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(89,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(90,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(90,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(91,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(91,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(92,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(92,22): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(93,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(93,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(94,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(94,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(95,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(95,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(97,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(97,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(98,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(98,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(99,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(99,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(100,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(100,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(101,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(101,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(102,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(102,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(103,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(103,22): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(104,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(104,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(105,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(105,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(106,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(106,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(108,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(108,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(109,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(109,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(110,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(110,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(111,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(111,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(112,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(112,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(113,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(113,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(114,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(114,22): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(115,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(115,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(116,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(116,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(117,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(117,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(119,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(119,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(120,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(120,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(121,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(121,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(122,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(122,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(123,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(123,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(124,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(124,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(125,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(125,22): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(126,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(126,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(127,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(127,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(128,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts(128,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + ==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts (180 errors) ==== // type parameter type is not valid for arithmetic operand function foo(t: T) { @@ -9,482 +191,482 @@ var r1a1 = a * t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a2 = a / t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a3 = a % t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a4 = a - t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a5 = a << t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a6 = a >> t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a7 = a >>> t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a8 = a & t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a9 = a ^ t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a10 = a | t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a1 = t * a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a2 = t / a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a3 = t % a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a4 = t - a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a5 = t << a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a6 = t >> a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a7 = t >>> a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a8 = t & a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a9 = t ^ a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a10 = t | a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b1 = b * t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b2 = b / t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b3 = b % t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b4 = b - t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b5 = b << t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b6 = b >> t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b7 = b >>> t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b8 = b & t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b9 = b ^ t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b10 = b | t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b1 = t * b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b2 = t / b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b3 = t % b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b4 = t - b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b5 = t << b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b6 = t >> b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b7 = t >>> b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b8 = t & b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b9 = t ^ b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b10 = t | b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c1 = c * t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c2 = c / t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c3 = c % t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c4 = c - t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c5 = c << t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c6 = c >> t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c7 = c >>> t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c8 = c & t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c9 = c ^ t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c10 = c | t; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c1 = t * c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c2 = t / c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c3 = t % c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c4 = t - c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c5 = t << c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c6 = t >> c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c7 = t >>> c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c8 = t & c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c9 = t ^ c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c10 = t | c; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d1 = d * t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d2 = d / t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d3 = d % t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d4 = d - t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d5 = d << t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d6 = d >> t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d7 = d >>> t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d8 = d & t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d9 = d ^ t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d10 = d | t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d1 = t * d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d2 = t / d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d3 = t % d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d4 = t - d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d5 = t << d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d6 = t >> d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d7 = t >>> d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d8 = t & d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d9 = t ^ d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d10 = t | d; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e1 = e * t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e2 = e / t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e3 = e % t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e4 = e - t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e5 = e << t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e6 = e >> t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e7 = e >>> t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e8 = e & t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e9 = e ^ t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1e10 = e | t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e1 = t * e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e2 = t / e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e3 = t % e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e4 = t - e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e5 = t << e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e6 = t >> e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e7 = t >>> e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e8 = t & e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e9 = t ^ e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2e10 = t | e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f1 = t * t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f2 = t / t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f3 = t % t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f4 = t - t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f5 = t << t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f6 = t >> t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f7 = t >>> t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f8 = t & t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f9 = t ^ t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1f10 = t | t; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! 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/arithmeticOperatorWithUndefinedValueAndInvalidOperands.errors.txt b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.errors.txt index 9552e5400d4..9ee53c2f15c 100644 --- a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.errors.txt +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.errors.txt @@ -1,4 +1,234 @@ -==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts (240 errors) ==== +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(9,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(9,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(10,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(10,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(11,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(11,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(13,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(13,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(14,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(14,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(15,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(15,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(17,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(17,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(18,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(18,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(19,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(19,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(21,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(21,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(22,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(22,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(23,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(23,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(26,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(26,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(27,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(27,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(28,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(28,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(30,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(30,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(31,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(31,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(32,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(32,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(34,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(34,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(35,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(35,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(36,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(36,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(38,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(38,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(39,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(39,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(40,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(40,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(43,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(43,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(44,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(44,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(45,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(45,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(47,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(47,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(48,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(48,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(49,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(49,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(51,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(51,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(52,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(52,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(53,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(53,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(55,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(55,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(56,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(56,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(57,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(57,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(60,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(60,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(61,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(61,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(62,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(62,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(64,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(64,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(65,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(65,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(66,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(66,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(68,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(68,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(69,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(69,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(70,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(70,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(72,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(72,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(73,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(73,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(74,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(74,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(77,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(77,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(78,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(78,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(79,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(79,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(81,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(81,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(82,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(82,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(83,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(83,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(85,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(85,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(86,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(86,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(87,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(87,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(89,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(89,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(90,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(90,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(91,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(91,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(94,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(94,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(95,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(95,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(96,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(96,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(98,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(98,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(99,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(99,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(100,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(100,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(102,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(102,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(103,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(103,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(104,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(104,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(106,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(106,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(107,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(107,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(108,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(108,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(111,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(111,26): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(112,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(112,26): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(113,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(113,26): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(115,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(115,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(116,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(116,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(117,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(117,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(119,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(119,26): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(120,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(120,26): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(121,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(121,26): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(123,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(123,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(124,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(124,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(125,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(125,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(128,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(129,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(129,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(130,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(130,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(132,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(133,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(133,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(134,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(134,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(136,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(137,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(137,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(138,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(138,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(140,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(141,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(141,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(142,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(142,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(145,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(146,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(146,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(147,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(147,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(149,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(150,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(150,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(151,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(151,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(153,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(154,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(154,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(155,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(155,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(157,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(158,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(158,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(159,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(159,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(162,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(163,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(163,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(164,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(164,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(166,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(167,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(167,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(168,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(168,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(170,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(171,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(171,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(172,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(172,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(174,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(175,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(175,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(176,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(176,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts (228 errors) ==== // If one operand is the undefined or undefined value, it is treated as having the type of the // other operand. @@ -9,649 +239,625 @@ // operator * var r1a1 = undefined * a; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a2 = undefined * b; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1a3 = undefined * c; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b1 = a * undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b2 = b * undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1b3 = c * undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c1 = undefined * true; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c2 = undefined * ''; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1c3 = undefined * {}; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d1 = true * undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d2 = '' * undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r1d3 = {} * undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator / var r2a1 = undefined / a; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a2 = undefined / b; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2a3 = undefined / c; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b1 = a / undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b2 = b / undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2b3 = c / undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c1 = undefined / true; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c2 = undefined / ''; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2c3 = undefined / {}; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d1 = true / undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d2 = '' / undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r2d3 = {} / undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator % var r3a1 = undefined % a; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3a2 = undefined % b; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3a3 = undefined % c; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b1 = a % undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b2 = b % undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3b3 = c % undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3c1 = undefined % true; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3c2 = undefined % ''; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3c3 = undefined % {}; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d1 = true % undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d2 = '' % undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r3d3 = {} % undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator - var r4a1 = undefined - a; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4a2 = undefined - b; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4a3 = undefined - c; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b1 = a - undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b2 = b - undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4b3 = c - undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4c1 = undefined - true; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4c2 = undefined - ''; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4c3 = undefined - {}; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d1 = true - undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d2 = '' - undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r4d3 = {} - undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator << var r5a1 = undefined << a; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5a2 = undefined << b; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5a3 = undefined << c; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b1 = a << undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b2 = b << undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5b3 = c << undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5c1 = undefined << true; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5c2 = undefined << ''; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5c3 = undefined << {}; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d1 = true << undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d2 = '' << undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r5d3 = {} << undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator >> var r6a1 = undefined >> a; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6a2 = undefined >> b; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6a3 = undefined >> c; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b1 = a >> undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b2 = b >> undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6b3 = c >> undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6c1 = undefined >> true; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6c2 = undefined >> ''; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6c3 = undefined >> {}; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d1 = true >> undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d2 = '' >> undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r6d3 = {} >> undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator >>> var r7a1 = undefined >>> a; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7a2 = undefined >>> b; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7a3 = undefined >>> c; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b1 = a >>> undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b2 = b >>> undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7b3 = c >>> undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7c1 = undefined >>> true; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7c2 = undefined >>> ''; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7c3 = undefined >>> {}; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d1 = true >>> undefined; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d2 = '' >>> undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r7d3 = {} >>> undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator & var r8a1 = undefined & a; - ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~ +!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. var r8a2 = undefined & b; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8a3 = undefined & c; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8b1 = a & undefined; - ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~ +!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. var r8b2 = b & undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8b3 = c & undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8c1 = undefined & true; - ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~~~~ +!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. var r8c2 = undefined & ''; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8c3 = undefined & {}; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8d1 = true & undefined; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~~~~ +!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead. var r8d2 = '' & undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r8d3 = {} & undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator ^ var r9a1 = undefined ^ a; - ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~ +!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. var r9a2 = undefined ^ b; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9a3 = undefined ^ c; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9b1 = a ^ undefined; - ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~ +!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. var r9b2 = b ^ undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9b3 = c ^ undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9c1 = undefined ^ true; - ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~~~~ +!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. var r9c2 = undefined ^ ''; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9c3 = undefined ^ {}; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9d1 = true ^ undefined; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~~~~ +!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. var r9d2 = '' ^ undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r9d3 = {} ^ undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // operator | var r10a1 = undefined | a; - ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~ +!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. var r10a2 = undefined | b; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10a3 = undefined | c; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10b1 = a | undefined; - ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~ +!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. var r10b2 = b | undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10b3 = c | undefined; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10c1 = undefined | true; - ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~~~~ +!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. var r10c2 = undefined | ''; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10c3 = undefined | {}; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10d1 = true | undefined; - ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. - ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~~~~~~~~ +!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead. var r10d2 = '' | undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var r10d3 = {} | undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! 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/arrayAssignmentTest1.errors.txt b/tests/baselines/reference/arrayAssignmentTest1.errors.txt index e14bacb3cb4..d3a7fafed05 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest1.errors.txt @@ -1,3 +1,49 @@ +tests/cases/compiler/arrayAssignmentTest1.ts(46,5): error TS2322: Type 'undefined[]' is not assignable to type 'I1'. + Property 'IM1' is missing in type 'undefined[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(47,5): error TS2322: Type 'undefined[]' is not assignable to type 'C1'. + Property 'IM1' is missing in type 'undefined[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(48,5): error TS2322: Type 'undefined[]' is not assignable to type 'C2'. + Property 'C2M1' is missing in type 'undefined[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(49,5): error TS2322: Type 'undefined[]' is not assignable to type 'C3'. + Property 'CM3M1' is missing in type 'undefined[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(60,1): error TS2322: Type 'C3[]' is not assignable to type 'I1[]'. + Type 'C3' is not assignable to type 'I1'. + Property 'IM1' is missing in type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(64,1): error TS2322: Type 'I1[]' is not assignable to type 'C1[]'. + Type 'I1' is not assignable to type 'C1'. + Property 'C1M1' is missing in type 'I1'. +tests/cases/compiler/arrayAssignmentTest1.ts(65,1): error TS2322: Type 'C3[]' is not assignable to type 'C1[]'. + Type 'C3' is not assignable to type 'C1'. + Property 'IM1' is missing in type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(68,1): error TS2322: Type 'C1[]' is not assignable to type 'C2[]'. + Type 'C1' is not assignable to type 'C2'. + Property 'C2M1' is missing in type 'C1'. +tests/cases/compiler/arrayAssignmentTest1.ts(69,1): error TS2322: Type 'I1[]' is not assignable to type 'C2[]'. + Type 'I1' is not assignable to type 'C2'. + Property 'C2M1' is missing in type 'I1'. +tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2322: Type 'C3[]' is not assignable to type 'C2[]'. + Type 'C3' is not assignable to type 'C2'. + Property 'C2M1' is missing in type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. + Type 'C2' is not assignable to type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. + Type 'C1' is not assignable to type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. + Type 'I1' is not assignable to type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2322: Type '() => C1' is not assignable to type 'any[]'. + Property 'push' is missing in type '() => C1'. +tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. + Property 'length' is missing in type '{ one: number; }'. +tests/cases/compiler/arrayAssignmentTest1.ts(82,1): error TS2322: Type 'C1' is not assignable to type 'any[]'. + Property 'length' is missing in type 'C1'. +tests/cases/compiler/arrayAssignmentTest1.ts(83,1): error TS2322: Type 'C2' is not assignable to type 'any[]'. + Property 'length' is missing in type 'C2'. +tests/cases/compiler/arrayAssignmentTest1.ts(84,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. + Property 'length' is missing in type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is not assignable to type 'any[]'. + Property 'length' is missing in type 'I1'. + + ==== tests/cases/compiler/arrayAssignmentTest1.ts (19 errors) ==== interface I1 { IM1():void[]; @@ -46,20 +92,20 @@ var i1_error: I1 = []; // should be an error - is ~~~~~~~~ -!!! Type 'undefined[]' is not assignable to type 'I1': -!!! Property 'IM1' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type 'I1'. +!!! error TS2322: Property 'IM1' is missing in type 'undefined[]'. var c1_error: C1 = []; // should be an error - is ~~~~~~~~ -!!! Type 'undefined[]' is not assignable to type 'C1': -!!! Property 'IM1' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type 'C1'. +!!! error TS2322: Property 'IM1' is missing in type 'undefined[]'. var c2_error: C2 = []; // should be an error - is ~~~~~~~~ -!!! Type 'undefined[]' is not assignable to type 'C2': -!!! Property 'C2M1' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type 'C2'. +!!! error TS2322: Property 'C2M1' is missing in type 'undefined[]'. var c3_error: C3 = []; // should be an error - is ~~~~~~~~ -!!! Type 'undefined[]' is not assignable to type 'C3': -!!! Property 'CM3M1' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'undefined[]'. arr_any = arr_i1; // should be ok - is @@ -72,81 +118,78 @@ arr_i1 = arr_c2; // should be ok - subtype relationship - is arr_i1 = arr_c3; // should be an error - is ~~~~~~ -!!! Type 'C3[]' is not assignable to type 'I1[]': -!!! Type 'C3' is not assignable to type 'I1': -!!! Property 'IM1' is missing in type 'C3'. +!!! error TS2322: Type 'C3[]' is not assignable to type 'I1[]'. +!!! error TS2322: Type 'C3' is not assignable to type 'I1'. +!!! error TS2322: Property 'IM1' is missing in type 'C3'. arr_c1 = arr_c1; // should be ok - subtype relationship - is arr_c1 = arr_c2; // should be ok - subtype relationship - is arr_c1 = arr_i1; // should be an error - is ~~~~~~ -!!! Type 'I1[]' is not assignable to type 'C1[]': -!!! Type 'I1' is not assignable to type 'C1': -!!! Property 'C1M1' is missing in type 'I1'. +!!! error TS2322: Type 'I1[]' is not assignable to type 'C1[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C1'. +!!! error TS2322: Property 'C1M1' is missing in type 'I1'. arr_c1 = arr_c3; // should be an error - is ~~~~~~ -!!! Type 'C3[]' is not assignable to type 'C1[]': -!!! Type 'C3' is not assignable to type 'C1': -!!! Property 'IM1' is missing in type 'C3'. +!!! error TS2322: Type 'C3[]' is not assignable to type 'C1[]'. +!!! error TS2322: Type 'C3' is not assignable to type 'C1'. +!!! error TS2322: Property 'IM1' is missing in type 'C3'. arr_c2 = arr_c2; // should be ok - subtype relationship - is arr_c2 = arr_c1; // should be an error - subtype relationship - is ~~~~~~ -!!! Type 'C1[]' is not assignable to type 'C2[]': -!!! Type 'C1' is not assignable to type 'C2': -!!! Property 'C2M1' is missing in type 'C1'. +!!! error TS2322: Type 'C1[]' is not assignable to type 'C2[]'. +!!! error TS2322: Type 'C1' is not assignable to type 'C2'. +!!! error TS2322: Property 'C2M1' is missing in type 'C1'. arr_c2 = arr_i1; // should be an error - subtype relationship - is ~~~~~~ -!!! Type 'I1[]' is not assignable to type 'C2[]': -!!! Type 'I1' is not assignable to type 'C2': -!!! Property 'C2M1' is missing in type 'I1'. +!!! error TS2322: Type 'I1[]' is not assignable to type 'C2[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C2'. +!!! error TS2322: Property 'C2M1' is missing in type 'I1'. arr_c2 = arr_c3; // should be an error - is ~~~~~~ -!!! Type 'C3[]' is not assignable to type 'C2[]': -!!! Type 'C3' is not assignable to type 'C2': -!!! Property 'C2M1' is missing in type 'C3'. +!!! error TS2322: Type 'C3[]' is not assignable to type 'C2[]'. +!!! error TS2322: Type 'C3' is not assignable to type 'C2'. +!!! error TS2322: Property 'C2M1' is missing in type 'C3'. // "clean up bug" occurs at this point // if you move these three expressions to another file, they raise an error // something to do with state from the above propagating forward? arr_c3 = arr_c2_2; // should be an error - is ~~~~~~ -!!! Type 'C2[]' is not assignable to type 'C3[]': -!!! Type 'C2' is not assignable to type 'C3': -!!! Property 'CM3M1' is missing in type 'C2'. +!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C2' is not assignable to type 'C3'. arr_c3 = arr_c1_2; // should be an error - is ~~~~~~ -!!! Type 'C1[]' is not assignable to type 'C3[]': -!!! Type 'C1' is not assignable to type 'C3': -!!! Property 'CM3M1' is missing in type 'C1'. +!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C1' is not assignable to type 'C3'. arr_c3 = arr_i1_2; // should be an error - is ~~~~~~ -!!! Type 'I1[]' is not assignable to type 'C3[]': -!!! Type 'I1' is not assignable to type 'C3': -!!! Property 'CM3M1' is missing in type 'I1'. +!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C3'. arr_any = f1; // should be an error - is ~~~~~~~ -!!! Type '() => C1' is not assignable to type 'any[]': -!!! Property 'push' is missing in type '() => C1'. +!!! error TS2322: Type '() => C1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'push' is missing in type '() => C1'. arr_any = o1; // should be an error - is ~~~~~~~ -!!! Type '{ one: number; }' is not assignable to type 'any[]': -!!! Property 'length' is missing in type '{ one: number; }'. +!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type '{ one: number; }'. arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is ~~~~~~~ -!!! Type 'C1' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'C1'. +!!! error TS2322: Type 'C1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C1'. arr_any = c2; // should be an error - is ~~~~~~~ -!!! Type 'C2' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'C2'. +!!! error TS2322: Type 'C2' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C2'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! Type 'C3' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C3'. arr_any = i1; // should be an error - is ~~~~~~~ -!!! Type 'I1' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'I1'. \ No newline at end of file +!!! error TS2322: Type 'I1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'I1'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest2.errors.txt b/tests/baselines/reference/arrayAssignmentTest2.errors.txt index 5ecebfe392a..a2cc6b3b954 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest2.errors.txt @@ -1,3 +1,28 @@ +tests/cases/compiler/arrayAssignmentTest2.ts(47,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. + Type 'C2' is not assignable to type 'C3'. + Property 'CM3M1' is missing in type 'C2'. +tests/cases/compiler/arrayAssignmentTest2.ts(48,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. + Type 'C1' is not assignable to type 'C3'. + Property 'CM3M1' is missing in type 'C1'. +tests/cases/compiler/arrayAssignmentTest2.ts(49,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. + Type 'I1' is not assignable to type 'C3'. + Property 'CM3M1' is missing in type 'I1'. +tests/cases/compiler/arrayAssignmentTest2.ts(51,1): error TS2322: Type '() => C1' is not assignable to type 'any[]'. + Property 'push' is missing in type '() => C1'. +tests/cases/compiler/arrayAssignmentTest2.ts(52,1): error TS2322: Type '() => any' is not assignable to type 'any[]'. + Property 'push' is missing in type '() => any'. +tests/cases/compiler/arrayAssignmentTest2.ts(53,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. + Property 'length' is missing in type '{ one: number; }'. +tests/cases/compiler/arrayAssignmentTest2.ts(55,1): error TS2322: Type 'C1' is not assignable to type 'any[]'. + Property 'length' is missing in type 'C1'. +tests/cases/compiler/arrayAssignmentTest2.ts(56,1): error TS2322: Type 'C2' is not assignable to type 'any[]'. + Property 'length' is missing in type 'C2'. +tests/cases/compiler/arrayAssignmentTest2.ts(57,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. + Property 'length' is missing in type 'C3'. +tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2322: Type 'I1' is not assignable to type 'any[]'. + Property 'length' is missing in type 'I1'. + + ==== tests/cases/compiler/arrayAssignmentTest2.ts (10 errors) ==== interface I1 { IM1():void[]; @@ -47,47 +72,47 @@ // "clean up error" occurs at this point arr_c3 = arr_c2_2; // should be an error - is ~~~~~~ -!!! Type 'C2[]' is not assignable to type 'C3[]': -!!! Type 'C2' is not assignable to type 'C3': -!!! Property 'CM3M1' is missing in type 'C2'. +!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C2' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'C2'. arr_c3 = arr_c1_2; // should be an error - is ~~~~~~ -!!! Type 'C1[]' is not assignable to type 'C3[]': -!!! Type 'C1' is not assignable to type 'C3': -!!! Property 'CM3M1' is missing in type 'C1'. +!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C1' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'C1'. arr_c3 = arr_i1_2; // should be an error - is ~~~~~~ -!!! Type 'I1[]' is not assignable to type 'C3[]': -!!! Type 'I1' is not assignable to type 'C3': -!!! Property 'CM3M1' is missing in type 'I1'. +!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'I1'. arr_any = f1; // should be an error - is ~~~~~~~ -!!! Type '() => C1' is not assignable to type 'any[]': -!!! Property 'push' is missing in type '() => C1'. +!!! error TS2322: Type '() => C1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'push' is missing in type '() => C1'. arr_any = function () { return null;} // should be an error - is ~~~~~~~ -!!! Type '() => any' is not assignable to type 'any[]': -!!! Property 'push' is missing in type '() => any'. +!!! error TS2322: Type '() => any' is not assignable to type 'any[]'. +!!! error TS2322: Property 'push' is missing in type '() => any'. arr_any = o1; // should be an error - is ~~~~~~~ -!!! Type '{ one: number; }' is not assignable to type 'any[]': -!!! Property 'length' is missing in type '{ one: number; }'. +!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type '{ one: number; }'. arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is ~~~~~~~ -!!! Type 'C1' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'C1'. +!!! error TS2322: Type 'C1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C1'. arr_any = c2; // should be an error - is ~~~~~~~ -!!! Type 'C2' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'C2'. +!!! error TS2322: Type 'C2' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C2'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! Type 'C3' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C3'. arr_any = i1; // should be an error - is ~~~~~~~ -!!! Type 'I1' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'I1'. +!!! error TS2322: Type 'I1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'I1'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest3.errors.txt b/tests/baselines/reference/arrayAssignmentTest3.errors.txt index 4214ae5ef82..1c88408eb52 100644 --- a/tests/baselines/reference/arrayAssignmentTest3.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest3.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/arrayAssignmentTest3.ts(12,25): error TS2345: Argument of type 'B' is not assignable to parameter of type 'B[]'. + + ==== tests/cases/compiler/arrayAssignmentTest3.ts (1 errors) ==== // The following gives no error // Michal saw no error if he used number instead of B, @@ -12,6 +15,6 @@ var xx = new a(null, 7, new B()); ~~~~~~~ -!!! Argument of type 'B' is not assignable to parameter of type 'B[]'. +!!! error TS2345: Argument of type 'B' is not assignable to parameter of type 'B[]'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest4.errors.txt b/tests/baselines/reference/arrayAssignmentTest4.errors.txt index 210e18dfe87..ecded3a3bfd 100644 --- a/tests/baselines/reference/arrayAssignmentTest4.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest4.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/arrayAssignmentTest4.ts(24,1): error TS2322: Type '() => any' is not assignable to type 'any[]'. + Property 'push' is missing in type '() => any'. +tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. + Property 'length' is missing in type 'C3'. + + ==== tests/cases/compiler/arrayAssignmentTest4.ts (2 errors) ==== @@ -24,10 +30,10 @@ arr_any = function () { return null;} // should be an error - is ~~~~~~~ -!!! Type '() => any' is not assignable to type 'any[]': -!!! Property 'push' is missing in type '() => any'. +!!! error TS2322: Type '() => any' is not assignable to type 'any[]'. +!!! error TS2322: Property 'push' is missing in type '() => any'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! Type 'C3' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C3'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest5.errors.txt b/tests/baselines/reference/arrayAssignmentTest5.errors.txt index 9c63282d89a..3a45cad9ad7 100644 --- a/tests/baselines/reference/arrayAssignmentTest5.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest5.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'. + Type 'IToken' is not assignable to type 'IStateToken'. + Property 'state' is missing in type 'IToken'. + + ==== tests/cases/compiler/arrayAssignmentTest5.ts (1 errors) ==== module Test { interface IState { @@ -23,9 +28,9 @@ var lineTokens:ILineTokens= this.tokenize(line, state, true); var tokens:IStateToken[]= lineTokens.tokens; ~~~~~~ -!!! Type 'IToken[]' is not assignable to type 'IStateToken[]': -!!! Type 'IToken' is not assignable to type 'IStateToken': -!!! Property 'state' is missing in type 'IToken'. +!!! error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'. +!!! error TS2322: Type 'IToken' is not assignable to type 'IStateToken'. +!!! error TS2322: Property 'state' is missing in type 'IToken'. if (tokens.length === 0) { return this.onEnter(line, tokens, offset); // <== this should produce an error since onEnter can not be called with (string, IStateToken[], offset) } diff --git a/tests/baselines/reference/arrayBestCommonTypes.js b/tests/baselines/reference/arrayBestCommonTypes.js index 675d84119c0..f8e158e5b02 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.js +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -1,55 +1,109 @@ //// [arrayBestCommonTypes.ts] -interface iface { } -class base implements iface { } -class base2 implements iface { } -class derived extends base { } +module EmptyTypes { + interface iface { } + class base implements iface { } + class base2 implements iface { } + class derived extends base { } -class f { - public voidIfAny(x: boolean, y?: boolean): number; - public voidIfAny(x: string, y?: boolean): number; - public voidIfAny(x: number, y?: boolean): number; - public voidIfAny(x: any, y =false): any { return null; } - - public x() { - (this.voidIfAny([4, 2][0])); - (this.voidIfAny([4, 2, undefined][0])); - (this.voidIfAny([undefined, 2, 4][0])); - (this.voidIfAny([null, 2, 4][0])); - (this.voidIfAny([2, 4, null][0])); - (this.voidIfAny([undefined, 4, null][0])); + class f { + public voidIfAny(x: boolean, y?: boolean): number; + public voidIfAny(x: string, y?: boolean): number; + public voidIfAny(x: number, y?: boolean): number; + public voidIfAny(x: any, y = false): any { return null; } - (this.voidIfAny(['', "q"][0])); - (this.voidIfAny(['', "q", undefined][0])); - (this.voidIfAny([undefined, "q", ''][0])); - (this.voidIfAny([null, "q", ''][0])); - (this.voidIfAny(["q", '', null][0])); - (this.voidIfAny([undefined, '', null][0])); + public x() { + (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2, undefined][0])); + (this.voidIfAny([undefined, 2, 4][0])); + (this.voidIfAny([null, 2, 4][0])); + (this.voidIfAny([2, 4, null][0])); + (this.voidIfAny([undefined, 4, null][0])); - (this.voidIfAny([[3,4],[null]][0][0])); - - - var t1: { x: number; y: base; }[] = [ { x: 7, y: new derived() }, { x: 5, y: new base() } ]; - var t2: { x: boolean; y: base; }[] = [ { x: true, y: new derived() }, { x: false, y: new base() } ]; - var t3: { x: string; y: base; }[] = [ { x: undefined, y: new base() }, { x: '', y: new derived() } ]; + (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q", undefined][0])); + (this.voidIfAny([undefined, "q", ''][0])); + (this.voidIfAny([null, "q", ''][0])); + (this.voidIfAny(["q", '', null][0])); + (this.voidIfAny([undefined, '', null][0])); - var anyObj: any = null; - // Order matters here so test all the variants - var a1 = [ {x: 0, y: 'a'}, {x: 'a', y: 'a'}, {x: anyObj, y: 'a'} ]; - var a2 = [ {x: anyObj, y: 'a'}, {x: 0, y: 'a'}, {x: 'a', y: 'a'} ]; - var a3 = [ {x: 0, y: 'a'}, {x: anyObj, y: 'a'}, {x: 'a', y: 'a'} ]; - - var ifaceObj: iface = null; - var baseObj = new base(); - var base2Obj = new base2(); + (this.voidIfAny([[3, 4], [null]][0][0])); - var b1 = [ baseObj, base2Obj, ifaceObj ]; - var b2 = [ base2Obj, baseObj, ifaceObj ]; - var b3 = [ baseObj, ifaceObj, base2Obj ]; - var b4 = [ ifaceObj, baseObj, base2Obj ]; + + var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; + var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }]; + var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; + + var anyObj: any = null; + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; + + var ifaceObj: iface = null; + var baseObj = new base(); + var base2Obj = new base2(); + + var b1 = [baseObj, base2Obj, ifaceObj]; + var b2 = [base2Obj, baseObj, ifaceObj]; + var b3 = [baseObj, ifaceObj, base2Obj]; + var b4 = [ifaceObj, baseObj, base2Obj]; + } } } +module NonEmptyTypes { + interface iface { x: string; } + class base implements iface { x: string; y: string; } + class base2 implements iface { x: string; z: string; } + class derived extends base { a: string; } + + + class f { + public voidIfAny(x: boolean, y?: boolean): number; + public voidIfAny(x: string, y?: boolean): number; + public voidIfAny(x: number, y?: boolean): number; + public voidIfAny(x: any, y = false): any { return null; } + + public x() { + (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2, undefined][0])); + (this.voidIfAny([undefined, 2, 4][0])); + (this.voidIfAny([null, 2, 4][0])); + (this.voidIfAny([2, 4, null][0])); + (this.voidIfAny([undefined, 4, null][0])); + + (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q", undefined][0])); + (this.voidIfAny([undefined, "q", ''][0])); + (this.voidIfAny([null, "q", ''][0])); + (this.voidIfAny(["q", '', null][0])); + (this.voidIfAny([undefined, '', null][0])); + + (this.voidIfAny([[3, 4], [null]][0][0])); + + + var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; + var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }]; + var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; + + var anyObj: any = null; + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; + + var ifaceObj: iface = null; + var baseObj = new base(); + var base2Obj = new base2(); + + var b1 = [baseObj, base2Obj, ifaceObj]; + var b2 = [base2Obj, baseObj, ifaceObj]; + var b3 = [baseObj, ifaceObj, base2Obj]; + var b4 = [ifaceObj, baseObj, base2Obj]; + } + } +} @@ -60,59 +114,121 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -var base = (function () { - function base() { - } - return base; -})(); -var base2 = (function () { - function base2() { - } - return base2; -})(); -var derived = (function (_super) { - __extends(derived, _super); - function derived() { - _super.apply(this, arguments); - } - return derived; -})(base); -var f = (function () { - function f() { - } - f.prototype.voidIfAny = function (x, y) { - if (y === void 0) { y = false; } - return null; - }; - f.prototype.x = function () { - (this.voidIfAny([4, 2][0])); - (this.voidIfAny([4, 2, undefined][0])); - (this.voidIfAny([undefined, 2, 4][0])); - (this.voidIfAny([null, 2, 4][0])); - (this.voidIfAny([2, 4, null][0])); - (this.voidIfAny([undefined, 4, null][0])); - (this.voidIfAny(['', "q"][0])); - (this.voidIfAny(['', "q", undefined][0])); - (this.voidIfAny([undefined, "q", ''][0])); - (this.voidIfAny([null, "q", ''][0])); - (this.voidIfAny(["q", '', null][0])); - (this.voidIfAny([undefined, '', null][0])); - (this.voidIfAny([[3, 4], [null]][0][0])); - var t1 = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; - var t2 = [{ x: true, y: new derived() }, { x: false, y: new base() }]; - var t3 = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; - var anyObj = null; - // Order matters here so test all the variants - var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; - var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; - var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; - var ifaceObj = null; - var baseObj = new base(); - var base2Obj = new base2(); - var b1 = [baseObj, base2Obj, ifaceObj]; - var b2 = [base2Obj, baseObj, ifaceObj]; - var b3 = [baseObj, ifaceObj, base2Obj]; - var b4 = [ifaceObj, baseObj, base2Obj]; - }; - return f; -})(); +var EmptyTypes; +(function (EmptyTypes) { + var base = (function () { + function base() { + } + return base; + })(); + var base2 = (function () { + function base2() { + } + return base2; + })(); + var derived = (function (_super) { + __extends(derived, _super); + function derived() { + _super.apply(this, arguments); + } + return derived; + })(base); + var f = (function () { + function f() { + } + f.prototype.voidIfAny = function (x, y) { + if (y === void 0) { y = false; } + return null; + }; + f.prototype.x = function () { + (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2, undefined][0])); + (this.voidIfAny([undefined, 2, 4][0])); + (this.voidIfAny([null, 2, 4][0])); + (this.voidIfAny([2, 4, null][0])); + (this.voidIfAny([undefined, 4, null][0])); + (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q", undefined][0])); + (this.voidIfAny([undefined, "q", ''][0])); + (this.voidIfAny([null, "q", ''][0])); + (this.voidIfAny(["q", '', null][0])); + (this.voidIfAny([undefined, '', null][0])); + (this.voidIfAny([[3, 4], [null]][0][0])); + var t1 = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; + var t2 = [{ x: true, y: new derived() }, { x: false, y: new base() }]; + var t3 = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; + var anyObj = null; + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; + var ifaceObj = null; + var baseObj = new base(); + var base2Obj = new base2(); + var b1 = [baseObj, base2Obj, ifaceObj]; + var b2 = [base2Obj, baseObj, ifaceObj]; + var b3 = [baseObj, ifaceObj, base2Obj]; + var b4 = [ifaceObj, baseObj, base2Obj]; + }; + return f; + })(); +})(EmptyTypes || (EmptyTypes = {})); +var NonEmptyTypes; +(function (NonEmptyTypes) { + var base = (function () { + function base() { + } + return base; + })(); + var base2 = (function () { + function base2() { + } + return base2; + })(); + var derived = (function (_super) { + __extends(derived, _super); + function derived() { + _super.apply(this, arguments); + } + return derived; + })(base); + var f = (function () { + function f() { + } + f.prototype.voidIfAny = function (x, y) { + if (y === void 0) { y = false; } + return null; + }; + f.prototype.x = function () { + (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2, undefined][0])); + (this.voidIfAny([undefined, 2, 4][0])); + (this.voidIfAny([null, 2, 4][0])); + (this.voidIfAny([2, 4, null][0])); + (this.voidIfAny([undefined, 4, null][0])); + (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q", undefined][0])); + (this.voidIfAny([undefined, "q", ''][0])); + (this.voidIfAny([null, "q", ''][0])); + (this.voidIfAny(["q", '', null][0])); + (this.voidIfAny([undefined, '', null][0])); + (this.voidIfAny([[3, 4], [null]][0][0])); + var t1 = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; + var t2 = [{ x: true, y: new derived() }, { x: false, y: new base() }]; + var t3 = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; + var anyObj = null; + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; + var ifaceObj = null; + var baseObj = new base(); + var base2Obj = new base2(); + var b1 = [baseObj, base2Obj, ifaceObj]; + var b2 = [base2Obj, baseObj, ifaceObj]; + var b3 = [baseObj, ifaceObj, base2Obj]; + var b4 = [ifaceObj, baseObj, base2Obj]; + }; + return f; + })(); +})(NonEmptyTypes || (NonEmptyTypes = {})); diff --git a/tests/baselines/reference/arrayBestCommonTypes.types b/tests/baselines/reference/arrayBestCommonTypes.types index 40f74350fe5..5e34380673d 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.types +++ b/tests/baselines/reference/arrayBestCommonTypes.types @@ -1,47 +1,50 @@ === tests/cases/compiler/arrayBestCommonTypes.ts === -interface iface { } +module EmptyTypes { +>EmptyTypes : typeof EmptyTypes + + interface iface { } >iface : iface -class base implements iface { } + class base implements iface { } >base : base >iface : iface -class base2 implements iface { } + class base2 implements iface { } >base2 : base2 >iface : iface -class derived extends base { } + class derived extends base { } >derived : derived >base : base -class f { + class f { >f : f - public voidIfAny(x: boolean, y?: boolean): number; + public voidIfAny(x: boolean, y?: boolean): number; >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : boolean >y : boolean - public voidIfAny(x: string, y?: boolean): number; + public voidIfAny(x: string, y?: boolean): number; >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : string >y : boolean - public voidIfAny(x: number, y?: boolean): number; + public voidIfAny(x: number, y?: boolean): number; >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : number >y : boolean - public voidIfAny(x: any, y =false): any { return null; } + public voidIfAny(x: any, y = false): any { return null; } >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : any >y : boolean - - public x() { + + public x() { >x : () => void - (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2][0])); >(this.voidIfAny([4, 2][0])) : number >(this.voidIfAny([4, 2][0])) : number >this.voidIfAny([4, 2][0]) : number @@ -51,7 +54,7 @@ class f { >[4, 2][0] : number >[4, 2] : number[] - (this.voidIfAny([4, 2, undefined][0])); + (this.voidIfAny([4, 2, undefined][0])); >(this.voidIfAny([4, 2, undefined][0])) : number >(this.voidIfAny([4, 2, undefined][0])) : number >this.voidIfAny([4, 2, undefined][0]) : number @@ -62,7 +65,7 @@ class f { >[4, 2, undefined] : number[] >undefined : undefined - (this.voidIfAny([undefined, 2, 4][0])); + (this.voidIfAny([undefined, 2, 4][0])); >(this.voidIfAny([undefined, 2, 4][0])) : number >(this.voidIfAny([undefined, 2, 4][0])) : number >this.voidIfAny([undefined, 2, 4][0]) : number @@ -73,7 +76,7 @@ class f { >[undefined, 2, 4] : number[] >undefined : undefined - (this.voidIfAny([null, 2, 4][0])); + (this.voidIfAny([null, 2, 4][0])); >(this.voidIfAny([null, 2, 4][0])) : number >(this.voidIfAny([null, 2, 4][0])) : number >this.voidIfAny([null, 2, 4][0]) : number @@ -83,7 +86,7 @@ class f { >[null, 2, 4][0] : number >[null, 2, 4] : number[] - (this.voidIfAny([2, 4, null][0])); + (this.voidIfAny([2, 4, null][0])); >(this.voidIfAny([2, 4, null][0])) : number >(this.voidIfAny([2, 4, null][0])) : number >this.voidIfAny([2, 4, null][0]) : number @@ -93,7 +96,7 @@ class f { >[2, 4, null][0] : number >[2, 4, null] : number[] - (this.voidIfAny([undefined, 4, null][0])); + (this.voidIfAny([undefined, 4, null][0])); >(this.voidIfAny([undefined, 4, null][0])) : number >(this.voidIfAny([undefined, 4, null][0])) : number >this.voidIfAny([undefined, 4, null][0]) : number @@ -104,7 +107,7 @@ class f { >[undefined, 4, null] : number[] >undefined : undefined - (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q"][0])); >(this.voidIfAny(['', "q"][0])) : number >(this.voidIfAny(['', "q"][0])) : number >this.voidIfAny(['', "q"][0]) : number @@ -114,7 +117,7 @@ class f { >['', "q"][0] : string >['', "q"] : string[] - (this.voidIfAny(['', "q", undefined][0])); + (this.voidIfAny(['', "q", undefined][0])); >(this.voidIfAny(['', "q", undefined][0])) : number >(this.voidIfAny(['', "q", undefined][0])) : number >this.voidIfAny(['', "q", undefined][0]) : number @@ -125,7 +128,7 @@ class f { >['', "q", undefined] : string[] >undefined : undefined - (this.voidIfAny([undefined, "q", ''][0])); + (this.voidIfAny([undefined, "q", ''][0])); >(this.voidIfAny([undefined, "q", ''][0])) : number >(this.voidIfAny([undefined, "q", ''][0])) : number >this.voidIfAny([undefined, "q", ''][0]) : number @@ -136,7 +139,7 @@ class f { >[undefined, "q", ''] : string[] >undefined : undefined - (this.voidIfAny([null, "q", ''][0])); + (this.voidIfAny([null, "q", ''][0])); >(this.voidIfAny([null, "q", ''][0])) : number >(this.voidIfAny([null, "q", ''][0])) : number >this.voidIfAny([null, "q", ''][0]) : number @@ -146,7 +149,7 @@ class f { >[null, "q", ''][0] : string >[null, "q", ''] : string[] - (this.voidIfAny(["q", '', null][0])); + (this.voidIfAny(["q", '', null][0])); >(this.voidIfAny(["q", '', null][0])) : number >(this.voidIfAny(["q", '', null][0])) : number >this.voidIfAny(["q", '', null][0]) : number @@ -156,7 +159,7 @@ class f { >["q", '', null][0] : string >["q", '', null] : string[] - (this.voidIfAny([undefined, '', null][0])); + (this.voidIfAny([undefined, '', null][0])); >(this.voidIfAny([undefined, '', null][0])) : number >(this.voidIfAny([undefined, '', null][0])) : number >this.voidIfAny([undefined, '', null][0]) : number @@ -167,26 +170,26 @@ class f { >[undefined, '', null] : string[] >undefined : undefined - (this.voidIfAny([[3,4],[null]][0][0])); ->(this.voidIfAny([[3,4],[null]][0][0])) : number ->(this.voidIfAny([[3,4],[null]][0][0])) : number ->this.voidIfAny([[3,4],[null]][0][0]) : number + (this.voidIfAny([[3, 4], [null]][0][0])); +>(this.voidIfAny([[3, 4], [null]][0][0])) : number +>(this.voidIfAny([[3, 4], [null]][0][0])) : number +>this.voidIfAny([[3, 4], [null]][0][0]) : number >this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >this : f >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } ->[[3,4],[null]][0][0] : number ->[[3,4],[null]][0] : number[] ->[[3,4],[null]] : number[][] ->[3,4] : number[] +>[[3, 4], [null]][0][0] : number +>[[3, 4], [null]][0] : number[] +>[[3, 4], [null]] : number[][] +>[3, 4] : number[] >[null] : null[] - - - var t1: { x: number; y: base; }[] = [ { x: 7, y: new derived() }, { x: 5, y: new base() } ]; + + + var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; >t1 : { x: number; y: base; }[] >x : number >y : base >base : base ->[ { x: 7, y: new derived() }, { x: 5, y: new base() } ] : { x: number; y: base; }[] +>[{ 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 >y : derived @@ -198,12 +201,12 @@ class f { >new base() : base >base : typeof base - var t2: { x: boolean; y: base; }[] = [ { x: true, y: new derived() }, { x: false, y: new base() } ]; + var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }]; >t2 : { x: boolean; y: base; }[] >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: false, y: new base() }] : { x: boolean; y: derived; }[] >{ x: true, y: new derived() } : { x: boolean; y: derived; } >x : boolean >y : derived @@ -215,14 +218,14 @@ class f { >new base() : base >base : typeof base - var t3: { x: string; y: base; }[] = [ { x: undefined, y: new base() }, { x: '', y: new derived() } ]; + var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; >t3 : { x: string; y: base; }[] >x : string >y : base >base : base ->[ { x: undefined, y: new base() }, { x: '', y: new derived() } ] : { x: string; y: base; }[] +>[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : { x: string; y: derived; }[] >{ x: undefined, y: new base() } : { x: undefined; y: base; } ->x : any +>x : undefined >undefined : undefined >y : base >new base() : base @@ -233,95 +236,429 @@ class f { >new derived() : derived >derived : typeof derived - var anyObj: any = null; + var anyObj: any = null; >anyObj : any - // Order matters here so test all the variants - var a1 = [ {x: 0, y: 'a'}, {x: 'a', y: 'a'}, {x: anyObj, y: 'a'} ]; + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; >a1 : { x: any; y: string; }[] ->[ {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: 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 >y : string ->{x: 'a', y: 'a'} : { x: string; y: string; } +>{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string >y : string ->{x: anyObj, y: 'a'} : { x: any; y: string; } +>{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string - var a2 = [ {x: anyObj, y: 'a'}, {x: 0, y: 'a'}, {x: 'a', y: 'a'} ]; + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; >a2 : { x: any; y: string; }[] ->[ {x: anyObj, y: 'a'}, {x: 0, y: 'a'}, {x: 'a', y: 'a'} ] : { x: any; y: string; }[] ->{x: anyObj, y: 'a'} : { x: any; y: string; } +>[{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] +>{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string ->{x: 0, y: 'a'} : { x: number; y: string; } +>{ x: 0, y: 'a' } : { x: number; y: string; } >x : number >y : string ->{x: 'a', y: 'a'} : { x: string; y: string; } +>{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string >y : string - var a3 = [ {x: 0, y: 'a'}, {x: anyObj, y: 'a'}, {x: 'a', y: '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: 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 >y : string ->{x: anyObj, y: 'a'} : { x: any; y: string; } +>{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string ->{x: 'a', y: 'a'} : { x: string; y: string; } +>{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string >y : string - - var ifaceObj: iface = null; + + var ifaceObj: iface = null; >ifaceObj : iface >iface : iface - var baseObj = new base(); + var baseObj = new base(); >baseObj : base >new base() : base >base : typeof base - var base2Obj = new base2(); + var base2Obj = new base2(); >base2Obj : base2 >new base2() : base2 >base2 : typeof base2 - var b1 = [ baseObj, base2Obj, ifaceObj ]; ->b1 : base[] ->[ baseObj, base2Obj, ifaceObj ] : base[] + var b1 = [baseObj, base2Obj, ifaceObj]; +>b1 : iface[] +>[baseObj, base2Obj, ifaceObj] : iface[] >baseObj : base >base2Obj : base2 >ifaceObj : iface - var b2 = [ base2Obj, baseObj, ifaceObj ]; ->b2 : base2[] ->[ base2Obj, baseObj, ifaceObj ] : base2[] + var b2 = [base2Obj, baseObj, ifaceObj]; +>b2 : iface[] +>[base2Obj, baseObj, ifaceObj] : iface[] >base2Obj : base2 >baseObj : base >ifaceObj : iface - var b3 = [ baseObj, ifaceObj, base2Obj ]; ->b3 : base[] ->[ baseObj, ifaceObj, base2Obj ] : base[] + var b3 = [baseObj, ifaceObj, base2Obj]; +>b3 : iface[] +>[baseObj, ifaceObj, base2Obj] : iface[] >baseObj : base >ifaceObj : iface >base2Obj : base2 - var b4 = [ ifaceObj, baseObj, base2Obj ]; + var b4 = [ifaceObj, baseObj, base2Obj]; >b4 : iface[] ->[ ifaceObj, baseObj, base2Obj ] : iface[] +>[ifaceObj, baseObj, base2Obj] : iface[] >ifaceObj : iface >baseObj : base >base2Obj : base2 + } + } +} + +module NonEmptyTypes { +>NonEmptyTypes : typeof NonEmptyTypes + + interface iface { x: string; } +>iface : iface +>x : string + + class base implements iface { x: string; y: string; } +>base : base +>iface : iface +>x : string +>y : string + + class base2 implements iface { x: string; z: string; } +>base2 : base2 +>iface : iface +>x : string +>z : string + + class derived extends base { a: string; } +>derived : derived +>base : base +>a : string + + + class f { +>f : f + + public voidIfAny(x: boolean, y?: boolean): number; +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>x : boolean +>y : boolean + + public voidIfAny(x: string, y?: boolean): number; +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>x : string +>y : boolean + + public voidIfAny(x: number, y?: boolean): number; +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>x : number +>y : boolean + + public voidIfAny(x: any, y = false): any { return null; } +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>x : any +>y : boolean + + public x() { +>x : () => void + + (this.voidIfAny([4, 2][0])); +>(this.voidIfAny([4, 2][0])) : number +>(this.voidIfAny([4, 2][0])) : number +>this.voidIfAny([4, 2][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>[4, 2][0] : number +>[4, 2] : number[] + + (this.voidIfAny([4, 2, undefined][0])); +>(this.voidIfAny([4, 2, undefined][0])) : number +>(this.voidIfAny([4, 2, undefined][0])) : number +>this.voidIfAny([4, 2, undefined][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>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[] +>undefined : undefined + + (this.voidIfAny([undefined, 2, 4][0])); +>(this.voidIfAny([undefined, 2, 4][0])) : number +>(this.voidIfAny([undefined, 2, 4][0])) : number +>this.voidIfAny([undefined, 2, 4][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>[undefined, 2, 4][0] : number +>[undefined, 2, 4] : number[] +>undefined : undefined + + (this.voidIfAny([null, 2, 4][0])); +>(this.voidIfAny([null, 2, 4][0])) : number +>(this.voidIfAny([null, 2, 4][0])) : number +>this.voidIfAny([null, 2, 4][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>[null, 2, 4][0] : number +>[null, 2, 4] : number[] + + (this.voidIfAny([2, 4, null][0])); +>(this.voidIfAny([2, 4, null][0])) : number +>(this.voidIfAny([2, 4, null][0])) : number +>this.voidIfAny([2, 4, null][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>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[] + + (this.voidIfAny([undefined, 4, null][0])); +>(this.voidIfAny([undefined, 4, null][0])) : number +>(this.voidIfAny([undefined, 4, null][0])) : number +>this.voidIfAny([undefined, 4, null][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>[undefined, 4, null][0] : number +>[undefined, 4, null] : number[] +>undefined : undefined + + (this.voidIfAny(['', "q"][0])); +>(this.voidIfAny(['', "q"][0])) : number +>(this.voidIfAny(['', "q"][0])) : number +>this.voidIfAny(['', "q"][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>['', "q"][0] : string +>['', "q"] : string[] + + (this.voidIfAny(['', "q", undefined][0])); +>(this.voidIfAny(['', "q", undefined][0])) : number +>(this.voidIfAny(['', "q", undefined][0])) : number +>this.voidIfAny(['', "q", undefined][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>['', "q", undefined][0] : string +>['', "q", undefined] : string[] +>undefined : undefined + + (this.voidIfAny([undefined, "q", ''][0])); +>(this.voidIfAny([undefined, "q", ''][0])) : number +>(this.voidIfAny([undefined, "q", ''][0])) : number +>this.voidIfAny([undefined, "q", ''][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>[undefined, "q", ''][0] : string +>[undefined, "q", ''] : string[] +>undefined : undefined + + (this.voidIfAny([null, "q", ''][0])); +>(this.voidIfAny([null, "q", ''][0])) : number +>(this.voidIfAny([null, "q", ''][0])) : number +>this.voidIfAny([null, "q", ''][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>[null, "q", ''][0] : string +>[null, "q", ''] : string[] + + (this.voidIfAny(["q", '', null][0])); +>(this.voidIfAny(["q", '', null][0])) : number +>(this.voidIfAny(["q", '', null][0])) : number +>this.voidIfAny(["q", '', null][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>["q", '', null][0] : string +>["q", '', null] : string[] + + (this.voidIfAny([undefined, '', null][0])); +>(this.voidIfAny([undefined, '', null][0])) : number +>(this.voidIfAny([undefined, '', null][0])) : number +>this.voidIfAny([undefined, '', null][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>[undefined, '', null][0] : string +>[undefined, '', null] : string[] +>undefined : undefined + + (this.voidIfAny([[3, 4], [null]][0][0])); +>(this.voidIfAny([[3, 4], [null]][0][0])) : number +>(this.voidIfAny([[3, 4], [null]][0][0])) : number +>this.voidIfAny([[3, 4], [null]][0][0]) : number +>this.voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>this : f +>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } +>[[3, 4], [null]][0][0] : number +>[[3, 4], [null]][0] : number[] +>[[3, 4], [null]] : number[][] +>[3, 4] : number[] +>[null] : null[] + + + var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; +>t1 : { x: number; y: base; }[] +>x : number +>y : base +>base : base +>[{ 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 +>y : derived +>new derived() : derived +>derived : typeof derived +>{ x: 5, y: new base() } : { x: number; y: base; } +>x : number +>y : base +>new base() : base +>base : typeof base + + var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }]; +>t2 : { x: boolean; y: base; }[] +>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 : boolean +>y : derived +>new derived() : derived +>derived : typeof derived +>{ x: false, y: new base() } : { x: boolean; y: base; } +>x : boolean +>y : base +>new base() : base +>base : typeof base + + var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; +>t3 : { x: string; y: base; }[] +>x : string +>y : base +>base : base +>[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : ({ x: undefined; y: base; } | { x: string; y: derived; })[] +>{ x: undefined, y: new base() } : { x: undefined; y: base; } +>x : undefined +>undefined : undefined +>y : base +>new base() : base +>base : typeof base +>{ x: '', y: new derived() } : { x: string; y: derived; } +>x : string +>y : derived +>new derived() : derived +>derived : typeof derived + + var anyObj: any = null; +>anyObj : any + + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; +>a1 : { x: any; y: string; }[] +>[{ 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 +>y : string +>{ x: 'a', y: 'a' } : { x: string; y: string; } +>x : string +>y : string +>{ x: anyObj, y: 'a' } : { x: any; y: string; } +>x : any +>anyObj : any +>y : string + + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; +>a2 : { x: any; y: string; }[] +>[{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] +>{ x: anyObj, y: 'a' } : { x: any; y: string; } +>x : any +>anyObj : any +>y : string +>{ x: 0, y: 'a' } : { x: number; y: string; } +>x : number +>y : string +>{ x: 'a', y: 'a' } : { x: string; y: string; } +>x : string +>y : string + + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; +>a3 : { x: any; y: string; }[] +>[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] +>{ x: 0, y: 'a' } : { x: number; y: string; } +>x : number +>y : string +>{ x: anyObj, y: 'a' } : { x: any; y: string; } +>x : any +>anyObj : any +>y : string +>{ x: 'a', y: 'a' } : { x: string; y: string; } +>x : string +>y : string + + var ifaceObj: iface = null; +>ifaceObj : iface +>iface : iface + + var baseObj = new base(); +>baseObj : base +>new base() : base +>base : typeof base + + var base2Obj = new base2(); +>base2Obj : base2 +>new base2() : base2 +>base2 : typeof base2 + + var b1 = [baseObj, base2Obj, ifaceObj]; +>b1 : iface[] +>[baseObj, base2Obj, ifaceObj] : iface[] +>baseObj : base +>base2Obj : base2 +>ifaceObj : iface + + var b2 = [base2Obj, baseObj, ifaceObj]; +>b2 : iface[] +>[base2Obj, baseObj, ifaceObj] : iface[] +>base2Obj : base2 +>baseObj : base +>ifaceObj : iface + + var b3 = [baseObj, ifaceObj, base2Obj]; +>b3 : iface[] +>[baseObj, ifaceObj, base2Obj] : iface[] +>baseObj : base +>ifaceObj : iface +>base2Obj : base2 + + var b4 = [ifaceObj, baseObj, base2Obj]; +>b4 : iface[] +>[ifaceObj, baseObj, base2Obj] : iface[] +>ifaceObj : iface +>baseObj : base +>base2Obj : base2 + } } } - diff --git a/tests/baselines/reference/arrayCast.errors.txt b/tests/baselines/reference/arrayCast.errors.txt index 509ee2110b7..53be1c903a3 100644 --- a/tests/baselines/reference/arrayCast.errors.txt +++ b/tests/baselines/reference/arrayCast.errors.txt @@ -1,11 +1,14 @@ +tests/cases/compiler/arrayCast.ts(3,1): error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other. + Type '{ foo: string; }' is not assignable to type '{ id: number; }'. + + ==== tests/cases/compiler/arrayCast.ts (1 errors) ==== // Should fail. Even though the array is contextually typed with { id: number }[], it still // has type { foo: string }[], which is not assignable to { id: number }[]. <{ id: number; }[]>[{ foo: "s" }]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other: -!!! Type '{ foo: string; }' is not assignable to type '{ id: number; }': -!!! Property 'id' is missing in type '{ foo: string; }'. +!!! error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other. +!!! error TS2352: Type '{ foo: string; }' is not assignable to type '{ id: number; }'. // Should succeed, as the {} element causes the type of the array to be {}[] <{ id: number; }[]>[{ foo: "s" }, {}]; \ No newline at end of file diff --git a/tests/baselines/reference/arrayConcat2.types b/tests/baselines/reference/arrayConcat2.types index a4036560305..4cd02d31f9d 100644 --- a/tests/baselines/reference/arrayConcat2.types +++ b/tests/baselines/reference/arrayConcat2.types @@ -1,7 +1,7 @@ === tests/cases/compiler/arrayConcat2.ts === var a: string[] = []; >a : string[] ->[] : string[] +>[] : undefined[] a.concat("hello", 'world'); >a.concat("hello", 'world') : string[] diff --git a/tests/baselines/reference/arrayLiteral.types b/tests/baselines/reference/arrayLiteral.types index 1b356773dc7..9378a508228 100644 --- a/tests/baselines/reference/arrayLiteral.types +++ b/tests/baselines/reference/arrayLiteral.types @@ -25,7 +25,7 @@ var y = new Array(); var x2: number[] = []; >x2 : number[] ->[] : number[] +>[] : undefined[] var x2: number[] = new Array(1); >x2 : number[] diff --git a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt index 59137e1c4c1..75a69c09df8 100644 --- a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt +++ b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/arrayLiteralAndArrayConstructorEquivalence1.ts(3,14): error TS2314: Generic type 'Array' requires 1 type argument(s). + + ==== tests/cases/compiler/arrayLiteralAndArrayConstructorEquivalence1.ts (1 errors) ==== var myCars=new Array(); var myCars3 = new Array({}); var myCars4: Array; // error ~~~~~ -!!! Generic type 'Array' requires 1 type argument(s). +!!! error TS2314: Generic type 'Array' requires 1 type argument(s). var myCars5: Array[]; myCars = myCars3; diff --git a/tests/baselines/reference/arrayLiteralContextualType.errors.txt b/tests/baselines/reference/arrayLiteralContextualType.errors.txt deleted file mode 100644 index e653cfc303a..00000000000 --- a/tests/baselines/reference/arrayLiteralContextualType.errors.txt +++ /dev/null @@ -1,35 +0,0 @@ -==== tests/cases/compiler/arrayLiteralContextualType.ts (2 errors) ==== - interface IAnimal { - name: string; - } - - class Giraffe { - name = "Giraffe"; - neckLength = "3m"; - } - - class Elephant { - name = "Elephant"; - trunkDiameter = "20cm"; - } - - function foo(animals: IAnimal[]) { } - function bar(animals: { [n: number]: IAnimal }) { } - - foo([ - new Giraffe(), - new Elephant() - ]); // Legal because of the contextual type IAnimal provided by the parameter - bar([ - new Giraffe(), - new Elephant() - ]); // Legal because of the contextual type IAnimal provided by the parameter - - var arr = [new Giraffe(), new Elephant()]; - foo(arr); // Error because of no contextual type - ~~~ -!!! Argument of type '{}[]' is not assignable to parameter of type 'IAnimal[]'. -!!! Type '{}' is not assignable to type 'IAnimal'. - bar(arr); // Error because of no contextual type - ~~~ -!!! Argument of type '{}[]' is not assignable to parameter of type '{ [x: number]: IAnimal; }'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayLiteralContextualType.js b/tests/baselines/reference/arrayLiteralContextualType.js index a551a754204..65e4c135cba 100644 --- a/tests/baselines/reference/arrayLiteralContextualType.js +++ b/tests/baselines/reference/arrayLiteralContextualType.js @@ -26,8 +26,8 @@ bar([ ]); // Legal because of the contextual type IAnimal provided by the parameter var arr = [new Giraffe(), new Elephant()]; -foo(arr); // Error because of no contextual type -bar(arr); // Error because of no contextual type +foo(arr); // ok because arr is Array not {}[] +bar(arr); // ok because arr is Array not {}[] //// [arrayLiteralContextualType.js] var Giraffe = (function () { @@ -57,5 +57,5 @@ bar([ new Elephant() ]); // Legal because of the contextual type IAnimal provided by the parameter var arr = [new Giraffe(), new Elephant()]; -foo(arr); // Error because of no contextual type -bar(arr); // Error because of no contextual type +foo(arr); // ok because arr is Array not {}[] +bar(arr); // ok because arr is Array not {}[] diff --git a/tests/baselines/reference/arrayLiteralContextualType.types b/tests/baselines/reference/arrayLiteralContextualType.types new file mode 100644 index 00000000000..5797999b7df --- /dev/null +++ b/tests/baselines/reference/arrayLiteralContextualType.types @@ -0,0 +1,86 @@ +=== tests/cases/compiler/arrayLiteralContextualType.ts === +interface IAnimal { +>IAnimal : IAnimal + + name: string; +>name : string +} + +class Giraffe { +>Giraffe : Giraffe + + name = "Giraffe"; +>name : string + + neckLength = "3m"; +>neckLength : string +} + +class Elephant { +>Elephant : Elephant + + name = "Elephant"; +>name : string + + trunkDiameter = "20cm"; +>trunkDiameter : string +} + +function foo(animals: IAnimal[]) { } +>foo : (animals: IAnimal[]) => void +>animals : IAnimal[] +>IAnimal : IAnimal + +function bar(animals: { [n: number]: IAnimal }) { } +>bar : (animals: { [x: number]: IAnimal; }) => void +>animals : { [x: number]: IAnimal; } +>n : number +>IAnimal : IAnimal + +foo([ +>foo([ new Giraffe(), new Elephant()]) : void +>foo : (animals: IAnimal[]) => void +>[ new Giraffe(), new Elephant()] : (Giraffe | Elephant)[] + + new Giraffe(), +>new Giraffe() : Giraffe +>Giraffe : typeof Giraffe + + new Elephant() +>new Elephant() : Elephant +>Elephant : typeof Elephant + +]); // Legal because of the contextual type IAnimal provided by the parameter +bar([ +>bar([ new Giraffe(), new Elephant()]) : void +>bar : (animals: { [x: number]: IAnimal; }) => void +>[ new Giraffe(), new Elephant()] : (Giraffe | Elephant)[] + + new Giraffe(), +>new Giraffe() : Giraffe +>Giraffe : typeof Giraffe + + new Elephant() +>new Elephant() : Elephant +>Elephant : typeof Elephant + +]); // Legal because of the contextual type IAnimal provided by the parameter + +var arr = [new Giraffe(), new Elephant()]; +>arr : (Giraffe | Elephant)[] +>[new Giraffe(), new Elephant()] : (Giraffe | Elephant)[] +>new Giraffe() : Giraffe +>Giraffe : typeof Giraffe +>new Elephant() : Elephant +>Elephant : typeof Elephant + +foo(arr); // ok because arr is Array not {}[] +>foo(arr) : void +>foo : (animals: IAnimal[]) => void +>arr : (Giraffe | Elephant)[] + +bar(arr); // ok because arr is Array not {}[] +>bar(arr) : void +>bar : (animals: { [x: number]: IAnimal; }) => void +>arr : (Giraffe | Elephant)[] + diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types index c4889e223bb..4743504c33e 100644 --- a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types @@ -7,5 +7,5 @@ function panic(val: string[], ...opt: string[]) { } panic([], 'one', 'two'); >panic([], 'one', 'two') : void >panic : (val: string[], ...opt: string[]) => void ->[] : string[] +>[] : undefined[] diff --git a/tests/baselines/reference/arrayLiteralTypeInference.types b/tests/baselines/reference/arrayLiteralTypeInference.types index 5b4d9b7fff8..adcc28c7440 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.types +++ b/tests/baselines/reference/arrayLiteralTypeInference.types @@ -25,7 +25,7 @@ class ActionB extends Action { var x1: Action[] = [ >x1 : Action[] >Action : Action ->[ { id: 2, trueness: false }, { id: 3, name: "three" }] : Action[] +>[ { id: 2, trueness: false }, { id: 3, name: "three" }] : ({ id: number; trueness: boolean; } | { id: number; name: string; })[] { id: 2, trueness: false }, >{ id: 2, trueness: false } : { id: number; trueness: boolean; } @@ -42,7 +42,7 @@ var x1: Action[] = [ var x2: Action[] = [ >x2 : Action[] >Action : Action ->[ new ActionA(), new ActionB()] : Action[] +>[ new ActionA(), new ActionB()] : (ActionA | ActionB)[] new ActionA(), >new ActionA() : ActionA @@ -78,7 +78,7 @@ var z1: { id: number }[] = >id : number [ ->[ { id: 2, trueness: false }, { id: 3, name: "three" } ] : { id: number; }[] +>[ { id: 2, trueness: false }, { id: 3, name: "three" } ] : ({ id: number; trueness: boolean; } | { id: number; name: string; })[] { id: 2, trueness: false }, >{ id: 2, trueness: false } : { id: number; trueness: boolean; } @@ -97,7 +97,7 @@ var z2: { id: number }[] = >id : number [ ->[ new ActionA(), new ActionB() ] : { id: number; }[] +>[ new ActionA(), new ActionB() ] : (ActionA | ActionB)[] new ActionA(), >new ActionA() : ActionA @@ -114,7 +114,7 @@ var z3: { id: number }[] = >id : number [ ->[ new Action(), new ActionA(), new ActionB() ] : { id: number; }[] +>[ new Action(), new ActionA(), new ActionB() ] : Action[] new Action(), >new Action() : Action diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types index 7729b280160..bc21ec39073 100644 --- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types @@ -17,27 +17,27 @@ var c: { x: number; a?: number }; >a : number var as = [a, b]; // { x: number; y?: number };[] ->as : { x: number; y?: number; }[] ->[a, b] : { x: number; y?: number; }[] +>as : ({ x: number; y?: number; } | { x: number; z?: number; })[] +>[a, b] : ({ x: number; y?: number; } | { x: number; z?: number; })[] >a : { x: number; y?: number; } >b : { x: number; z?: number; } var bs = [b, a]; // { x: number; z?: number };[] ->bs : { x: number; z?: number; }[] ->[b, a] : { x: number; z?: number; }[] +>bs : ({ x: number; y?: number; } | { x: number; z?: number; })[] +>[b, a] : ({ x: number; y?: number; } | { x: number; z?: number; })[] >b : { x: number; z?: number; } >a : { x: number; y?: number; } var cs = [a, b, c]; // { x: number; y?: number };[] ->cs : { x: number; y?: number; }[] ->[a, b, c] : { x: number; y?: number; }[] +>cs : ({ x: number; y?: number; } | { x: number; z?: number; } | { x: number; a?: number; })[] +>[a, b, c] : ({ x: number; y?: number; } | { x: number; z?: number; } | { x: number; a?: number; })[] >a : { x: number; y?: number; } >b : { x: number; z?: number; } >c : { x: number; a?: number; } var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] ->ds : { (x: Object): number; }[] ->[(x: Object) => 1, (x: string) => 2] : { (x: Object): number; }[] +>ds : ((x: Object) => number)[] +>[(x: Object) => 1, (x: string) => 2] : ((x: Object) => number)[] >(x: Object) => 1 : (x: Object) => number >x : Object >Object : Object @@ -45,8 +45,8 @@ var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] >x : string var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] ->es : { (x: string): number; }[] ->[(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 >(x: Object) => 1 : (x: Object) => number @@ -54,8 +54,8 @@ var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] >Object : Object 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; }[] ->[(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))[] +>[(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2] : (((a: { x: number; y?: number; }) => number) | ((b: { x: number; z?: number; }) => number))[] >(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number; }) => number >a : { x: number; y?: number; } >x : number @@ -66,8 +66,8 @@ var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => >z : number var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[] ->gs : { (b: { x: number; z?: number; }): number; }[] ->[(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))[] +>[(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1] : (((b: { x: number; z?: number; }) => number) | ((a: { x: number; y?: number; }) => number))[] >(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number; }) => number >b : { x: number; z?: number; } >x : number diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index 800d2a12550..16e5ec7eee4 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -2,28 +2,21 @@ // Empty array literal with no contextual type has type Undefined[] var arr1= [[], [1], ['']]; -var arr1: {}[]; // Bug 825172: Error ({}[] does not match {}[]), but should be OK var arr2 = [[null], [1], ['']]; -var arr2: {}[]; // Bug 825172: Error ({}[] does not match {}[]), but should be OK // Array literal with elements of only EveryType E has type E[] var stringArrArr = [[''], [""]]; -var stringArrArr: string[][]; var stringArr = ['', ""]; -var stringArr: string[]; var numberArr = [0, 0.0, 0x00, 1e1]; -var numberArr: number[]; var boolArr = [false, true, false, true]; -var boolArr: boolean[]; class C { private p; } var classArr = [new C(), new C()]; -var classArr: C[]; // Should be OK var classTypeArray = [C, C, C]; var classTypeArray: Array; // Should OK, not be a parse error @@ -31,7 +24,6 @@ var classTypeArray: Array; // Should OK, not be a parse error // Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; -var context2: Array<{}>; // Should be OK // Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] class Base { private p; } @@ -53,31 +45,23 @@ var __extends = this.__extends || function (d, b) { d.prototype = new __(); }; var arr1 = [[], [1], ['']]; -var arr1; // Bug 825172: Error ({}[] does not match {}[]), but should be OK var arr2 = [[null], [1], ['']]; -var arr2; // Bug 825172: Error ({}[] does not match {}[]), but should be OK // Array literal with elements of only EveryType E has type E[] var stringArrArr = [[''], [""]]; -var stringArrArr; var stringArr = ['', ""]; -var stringArr; var numberArr = [0, 0.0, 0x00, 1e1]; -var numberArr; var boolArr = [false, true, false, true]; -var boolArr; var C = (function () { function C() { } return C; })(); var classArr = [new C(), new C()]; -var classArr; // Should be OK var classTypeArray = [C, C, C]; var classTypeArray; // Should OK, not be a parse error // Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] var context1 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; -var context2; // Should be OK // Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] var Base = (function () { function Base() { diff --git a/tests/baselines/reference/arrayLiterals.types b/tests/baselines/reference/arrayLiterals.types index 29dd1b19970..62475fa2b4a 100644 --- a/tests/baselines/reference/arrayLiterals.types +++ b/tests/baselines/reference/arrayLiterals.types @@ -2,25 +2,19 @@ // Empty array literal with no contextual type has type Undefined[] var arr1= [[], [1], ['']]; ->arr1 : {}[] ->[[], [1], ['']] : {}[] +>arr1 : (string[] | number[])[] +>[[], [1], ['']] : (string[] | number[])[] >[] : undefined[] >[1] : number[] >[''] : string[] -var arr1: {}[]; // Bug 825172: Error ({}[] does not match {}[]), but should be OK ->arr1 : {}[] - var arr2 = [[null], [1], ['']]; ->arr2 : {}[] ->[[null], [1], ['']] : {}[] +>arr2 : (string[] | number[])[] +>[[null], [1], ['']] : (string[] | number[])[] >[null] : null[] >[1] : number[] >[''] : string[] -var arr2: {}[]; // Bug 825172: Error ({}[] does not match {}[]), but should be OK ->arr2 : {}[] - // Array literal with elements of only EveryType E has type E[] var stringArrArr = [[''], [""]]; @@ -29,30 +23,18 @@ var stringArrArr = [[''], [""]]; >[''] : string[] >[""] : string[] -var stringArrArr: string[][]; ->stringArrArr : string[][] - var stringArr = ['', ""]; >stringArr : string[] >['', ""] : string[] -var stringArr: string[]; ->stringArr : string[] - var numberArr = [0, 0.0, 0x00, 1e1]; >numberArr : number[] >[0, 0.0, 0x00, 1e1] : number[] -var numberArr: number[]; ->numberArr : number[] - var boolArr = [false, true, false, true]; >boolArr : boolean[] >[false, true, false, true] : boolean[] -var boolArr: boolean[]; ->boolArr : boolean[] - class C { private p; } >C : C >p : any @@ -65,10 +47,6 @@ var classArr = [new C(), new C()]; >new C() : C >C : typeof C -var classArr: C[]; // Should be OK ->classArr : C[] ->C : C - var classTypeArray = [C, C, C]; >classTypeArray : typeof C[] >[C, C, C] : typeof C[] @@ -87,7 +65,7 @@ var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: ' >n : number >a : string >b : number ->[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : { a: string; b: number; }[] +>[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] >{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } >a : string >b : number @@ -98,8 +76,8 @@ var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: ' >c : number var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; ->context2 : {}[] ->[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : {}[] +>context2 : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] +>[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] >{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } >a : string >b : number @@ -109,10 +87,6 @@ var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; >b : number >c : number -var context2: Array<{}>; // Should be OK ->context2 : {}[] ->Array : T[] - // Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] class Base { private p; } >Base : Base @@ -131,7 +105,7 @@ class Derived2 extends Base { private n }; var context3: Base[] = [new Derived1(), new Derived2()]; >context3 : Base[] >Base : Base ->[new Derived1(), new Derived2()] : Base[] +>[new Derived1(), new Derived2()] : (Derived1 | Derived2)[] >new Derived1() : Derived1 >Derived1 : typeof Derived1 >new Derived2() : Derived2 @@ -141,7 +115,7 @@ var context3: Base[] = [new Derived1(), new Derived2()]; var context4: Base[] = [new Derived1(), new Derived1()]; >context4 : Base[] >Base : Base ->[new Derived1(), new Derived1()] : Base[] +>[new Derived1(), new Derived1()] : Derived1[] >new Derived1() : Derived1 >Derived1 : typeof Derived1 >new Derived1() : Derived1 diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types index becff7617b7..1496e99adca 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types @@ -61,8 +61,8 @@ var xs = [list, myList]; // {}[] >myList : MyList var ys = [list, list2]; // {}[] ->ys : {}[] ->[list, list2] : {}[] +>ys : (List | List)[] +>[list, list2] : (List | List)[] >list : List >list2 : List diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.types b/tests/baselines/reference/arrayOfFunctionTypes3.types index b224ff881e3..3ef5334382c 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.types +++ b/tests/baselines/reference/arrayOfFunctionTypes3.types @@ -2,8 +2,8 @@ // valid uses of arrays of function types var x = [() => 1, () => { }]; ->x : { (): void; }[] ->[() => 1, () => { }] : { (): void; }[] +>x : (() => void)[] +>[() => 1, () => { }] : (() => void)[] >() => 1 : () => number >() => { } : () => void @@ -11,7 +11,7 @@ var r2 = x[0](); >r2 : void >x[0]() : void >x[0] : () => void ->x : { (): void; }[] +>x : (() => void)[] class C { >C : C diff --git a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt index 6cffd03f44b..f662bf20af3 100644 --- a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt +++ b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts(2,17): error TS2314: Generic type 'Array' requires 1 type argument(s). + + ==== tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts (1 errors) ==== class X { public f(a: Array) { } ~~~~~ -!!! Generic type 'Array' requires 1 type argument(s). +!!! error TS2314: Generic type 'Array' requires 1 type argument(s). } \ No newline at end of file diff --git a/tests/baselines/reference/arraySigChecking.errors.txt b/tests/baselines/reference/arraySigChecking.errors.txt index 3cb48f7a4e9..b70b659773c 100644 --- a/tests/baselines/reference/arraySigChecking.errors.txt +++ b/tests/baselines/reference/arraySigChecking.errors.txt @@ -1,3 +1,12 @@ +tests/cases/compiler/arraySigChecking.ts(11,17): error TS1023: An index signature parameter type must be 'string' or 'number'. +tests/cases/compiler/arraySigChecking.ts(18,5): error TS2322: Type 'void[]' is not assignable to type 'string[]'. + Type 'void' is not assignable to type 'string'. +tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'. + Type 'number[]' is not assignable to type 'number[][]'. + Type 'number' is not assignable to type 'number[]'. + Property 'length' is missing in type 'Number'. + + ==== tests/cases/compiler/arraySigChecking.ts (3 errors) ==== declare module M { interface iBar { t: any; } @@ -11,7 +20,7 @@ var foo: { [index: any]; }; // expect an error here ~~~~~ -!!! An index signature parameter type must be 'string' or 'number'. +!!! error TS1023: An index signature parameter type must be 'string' or 'number'. } interface myInt { @@ -20,17 +29,17 @@ var myVar: myInt; var strArray: string[] = [myVar.voidFn()]; ~~~~~~~~ -!!! Type 'void[]' is not assignable to type 'string[]': -!!! Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'void[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. var myArray: number[][][]; myArray = [[1, 2]]; ~~~~~~~ -!!! Type 'number[][]' is not assignable to type 'number[][][]': -!!! Type 'number[]' is not assignable to type 'number[][]': -!!! Type 'number' is not assignable to type 'number[]': -!!! Property 'length' is missing in type 'Number'. +!!! error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'. +!!! error TS2322: Type 'number[]' is not assignable to type 'number[][]'. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. function isEmpty(l: { length: number }) { return l.length === 0; diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes.errors.txt b/tests/baselines/reference/arrayTypeOfFunctionTypes.errors.txt index 58b4345bc02..b040c9eb1c9 100644 --- a/tests/baselines/reference/arrayTypeOfFunctionTypes.errors.txt +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfFunctionTypes.ts(11,11): error TS2350: Only a void function can be called with the 'new' keyword. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfFunctionTypes.ts(16,11): error TS2350: Only a void function can be called with the 'new' keyword. + + ==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfFunctionTypes.ts (2 errors) ==== // valid uses of arrays of function types @@ -11,11 +15,11 @@ var r4 = r3(); var r4b = new r3(); // error ~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. +!!! error TS2350: Only a void function can be called with the 'new' keyword. var x3: Array<() => string>; var r5 = x2[1]; var r6 = r5(); var r6b = new r5(); // error ~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. \ No newline at end of file +!!! error TS2350: Only a void function can be called with the 'new' keyword. \ No newline at end of file diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes2.errors.txt b/tests/baselines/reference/arrayTypeOfFunctionTypes2.errors.txt index fc8cd992cfa..7be76cb9c1b 100644 --- a/tests/baselines/reference/arrayTypeOfFunctionTypes2.errors.txt +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfFunctionTypes2.ts(16,11): error TS2348: Value of type 'new () => string' is not callable. Did you mean to include 'new'? + + ==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfFunctionTypes2.ts (1 errors) ==== // valid uses of arrays of function types @@ -16,4 +19,4 @@ var r6 = new r5(); var r6b = r5(); ~~~~ -!!! Value of type 'new () => string' is not callable. Did you mean to include 'new'? \ No newline at end of file +!!! error TS2348: Value of type 'new () => string' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt index cb877f5e57b..0dcff3de422 100644 --- a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt +++ b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt @@ -1,3 +1,12 @@ +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,22): error TS1005: '=' expected. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,22): error TS1005: '=' expected. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1109: Expression expected. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. + Property 'isArray' is missing in type 'Number'. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. + + ==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts (6 errors) ==== // array type cannot use typeof. @@ -6,16 +15,16 @@ var xs2: typeof Array; var xs3: typeof Array; ~ -!!! '=' expected. +!!! error TS1005: '=' expected. ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~ -!!! Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': -!!! Property 'isArray' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. +!!! error TS2322: Property 'isArray' is missing in type 'Number'. var xs4: typeof Array; ~ -!!! '=' expected. +!!! error TS1005: '=' expected. ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~ -!!! Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt index 9a1e3cdb618..5ffe9d1ec34 100644 --- a/tests/baselines/reference/arrowFunctionContexts.errors.txt +++ b/tests/baselines/reference/arrowFunctionContexts.errors.txt @@ -1,11 +1,23 @@ +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,7): error TS2304: Cannot find name 'window'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(19,1): error TS2304: Cannot find name 'window'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(31,9): error TS2322: Type '() => number' is not assignable to type 'E'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(32,16): error TS2332: 'this' cannot be referenced in current location. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,11): error TS2304: Cannot find name 'window'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(60,5): error TS2304: Cannot find name 'window'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,13): error TS2322: Type '() => number' is not assignable to type 'E'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): error TS2332: 'this' cannot be referenced in current location. + + ==== tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts (10 errors) ==== // Arrow function used in with statement with (window) { ~~~~~~ -!!! Cannot find name 'window'. +!!! error TS2304: Cannot find name 'window'. ~~~~~~ -!!! All symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. var p = () => this; } @@ -23,7 +35,7 @@ // Arrow function as function argument window.setTimeout(() => null, 100); ~~~~~~ -!!! Cannot find name 'window'. +!!! error TS2304: Cannot find name 'window'. // Arrow function as value in array literal @@ -37,10 +49,10 @@ enum E { x = () => 4, // Error expected ~~~~~~~ -!!! Type '() => number' is not assignable to type 'E'. +!!! error TS2322: Type '() => number' is not assignable to type 'E'. y = (() => this).length // error, can't use this in enum ~~~~ -!!! 'this' cannot be referenced in current location. +!!! error TS2332: 'this' cannot be referenced in current location. } // Arrow function as module variable initializer @@ -54,9 +66,9 @@ // Arrow function used in with statement with (window) { ~~~~~~ -!!! Cannot find name 'window'. +!!! error TS2304: Cannot find name 'window'. ~~~~~~ -!!! All symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. var p = () => this; } @@ -74,7 +86,7 @@ // Arrow function as function argument window.setTimeout(() => null, 100); ~~~~~~ -!!! Cannot find name 'window'. +!!! error TS2304: Cannot find name 'window'. // Arrow function as value in array literal @@ -88,10 +100,10 @@ enum E { x = () => 4, // Error expected ~~~~~~~ -!!! Type '() => number' is not assignable to type 'E'. +!!! error TS2322: Type '() => number' is not assignable to type 'E'. y = (() => this).length ~~~~ -!!! 'this' cannot be referenced in current location. +!!! error TS2332: 'this' cannot be referenced in current location. } // Arrow function as module variable initializer diff --git a/tests/baselines/reference/arrowFunctionInConstructorArgument1.errors.txt b/tests/baselines/reference/arrowFunctionInConstructorArgument1.errors.txt index e5f33b3e1eb..0fc1315078e 100644 --- a/tests/baselines/reference/arrowFunctionInConstructorArgument1.errors.txt +++ b/tests/baselines/reference/arrowFunctionInConstructorArgument1.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/arrowFunctionInConstructorArgument1.ts(4,30): error TS2304: Cannot find name 'asdf'. + + ==== tests/cases/compiler/arrowFunctionInConstructorArgument1.ts (1 errors) ==== class C { constructor(x: () => void) { } } var c = new C(() => { return asdf; } ) // should error ~~~~ -!!! Cannot find name 'asdf'. +!!! error TS2304: Cannot find name 'asdf'. \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.errors.txt b/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.errors.txt index a0cf2c00518..cdc67fc09af 100644 --- a/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.errors.txt +++ b/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/arrowFunctionMissingCurlyWithSemicolon.ts(2,15): error TS1109: Expression expected. + + ==== tests/cases/compiler/arrowFunctionMissingCurlyWithSemicolon.ts (1 errors) ==== // Should error at semicolon. var f = () => ; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. var b = 1 * 2 * 3 * 4; var square = (x: number) => x * x; \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt b/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt index 69b94cd7d46..128e22d119e 100644 --- a/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt +++ b/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt @@ -1,105 +1,131 @@ +tests/cases/compiler/arrowFunctionsMissingTokens.ts(3,16): error TS1005: '=>' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(5,22): error TS1005: '=>' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(7,17): error TS1005: '=>' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(9,36): error TS1005: '=>' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(11,42): error TS1005: '=>' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(16,23): error TS1005: '{' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(18,29): error TS1005: '{' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(20,24): error TS1005: '{' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(22,43): error TS1005: '{' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(24,49): error TS1005: '{' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(26,23): error TS1005: '{' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(30,23): error TS1109: Expression expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(32,29): error TS1109: Expression expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(34,24): error TS1109: Expression expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(36,43): error TS1109: Expression expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(38,49): error TS1109: Expression expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(40,23): error TS1109: Expression expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(41,5): error TS1128: Declaration or statement expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(42,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(45,14): error TS1109: Expression expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(47,21): error TS1005: '=>' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(51,35): error TS1005: '=>' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(53,41): error TS1005: '=>' expected. +tests/cases/compiler/arrowFunctionsMissingTokens.ts(49,14): error TS2304: Cannot find name 'x'. + + ==== tests/cases/compiler/arrowFunctionsMissingTokens.ts (24 errors) ==== module missingArrowsWithCurly { var a = () { }; ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. var b = (): void { } ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. var c = (x) { }; ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. var d = (x: number, y: string) { }; ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. var e = (x: number, y: string): void { }; ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. } module missingCurliesWithArrow { module withStatement { var a = () => var k = 10;}; ~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. var b = (): void => var k = 10;} ~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. var c = (x) => var k = 10;}; ~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. var d = (x: number, y: string) => var k = 10;}; ~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. var e = (x: number, y: string): void => var k = 10;}; ~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. var f = () => var k = 10;} ~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. } module withoutStatement { var a = () => }; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. var b = (): void => } ~ -!!! Expression expected. +!!! error TS1109: Expression expected. var c = (x) => }; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. var d = (x: number, y: string) => }; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. var e = (x: number, y: string): void => }; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. var f = () => } ~ -!!! Expression expected. +!!! error TS1109: Expression expected. } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. module ce_nEst_pas_une_arrow_function { var a = (); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. var b = (): void; ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. var c = (x); ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. var d = (x: number, y: string); ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. var e = (x: number, y: string): void; ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. } module okay { diff --git a/tests/baselines/reference/asiReturn.errors.txt b/tests/baselines/reference/asiReturn.errors.txt index 7b7b44655c2..1cc3ec8a3c1 100644 --- a/tests/baselines/reference/asiReturn.errors.txt +++ b/tests/baselines/reference/asiReturn.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/asiReturn.ts(2,1): error TS1108: A 'return' statement can only be used within a function body. + + ==== tests/cases/compiler/asiReturn.ts (1 errors) ==== // This should be an error for using a return outside a function, but ASI should work properly return ~~~~~~ -!!! A 'return' statement can only be used within a function body. \ No newline at end of file +!!! error TS1108: A 'return' statement can only be used within a function body. \ No newline at end of file diff --git a/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt b/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt index 007b23dc474..f9019661fb5 100644 --- a/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt +++ b/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/assertInWrapSomeTypeParameter.ts(2,26): error TS1005: '>' expected. +tests/cases/compiler/assertInWrapSomeTypeParameter.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/assertInWrapSomeTypeParameter.ts (2 errors) ==== class C> { ~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo>(x: U) { ~ -!!! '>' expected. +!!! error TS1005: '>' expected. return null; } } \ No newline at end of file diff --git a/tests/baselines/reference/assignAnyToEveryType.errors.txt b/tests/baselines/reference/assignAnyToEveryType.errors.txt index a6eadd12038..9aae6efc37e 100644 --- a/tests/baselines/reference/assignAnyToEveryType.errors.txt +++ b/tests/baselines/reference/assignAnyToEveryType.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/types/any/assignAnyToEveryType.ts(41,1): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/conformance/types/any/assignAnyToEveryType.ts (1 errors) ==== // all of these are valid @@ -41,7 +44,7 @@ M = x; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. function k(a: T) { a = x; diff --git a/tests/baselines/reference/assignFromBooleanInterface.errors.txt b/tests/baselines/reference/assignFromBooleanInterface.errors.txt index 679399d4533..4b06603a9bf 100644 --- a/tests/baselines/reference/assignFromBooleanInterface.errors.txt +++ b/tests/baselines/reference/assignFromBooleanInterface.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts(3,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'. + + ==== tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts (1 errors) ==== var x = true; var a: Boolean; x = a; ~ -!!! Type 'Boolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'Boolean' is not assignable to type 'boolean'. a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromBooleanInterface2.errors.txt b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt index fc1350681f4..66d55e00d86 100644 --- a/tests/baselines/reference/assignFromBooleanInterface2.errors.txt +++ b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(19,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(20,1): error TS2322: Type 'NotBoolean' is not assignable to type 'boolean'. + + ==== tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts (2 errors) ==== interface Boolean { doStuff(): string; @@ -19,9 +23,9 @@ x = a; // expected error ~ -!!! Type 'Boolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'Boolean' is not assignable to type 'boolean'. x = b; // expected error ~ -!!! Type 'NotBoolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'NotBoolean' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignFromNumberInterface.errors.txt b/tests/baselines/reference/assignFromNumberInterface.errors.txt index 845b8cb5b7f..0c8c4a5f5ac 100644 --- a/tests/baselines/reference/assignFromNumberInterface.errors.txt +++ b/tests/baselines/reference/assignFromNumberInterface.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts(3,1): error TS2322: Type 'Number' is not assignable to type 'number'. + + ==== tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts (1 errors) ==== var x = 1; var a: Number; x = a; ~ -!!! Type 'Number' is not assignable to type 'number'. +!!! error TS2322: Type 'Number' is not assignable to type 'number'. a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromNumberInterface2.errors.txt b/tests/baselines/reference/assignFromNumberInterface2.errors.txt index 331232f6cea..fa53d8facdf 100644 --- a/tests/baselines/reference/assignFromNumberInterface2.errors.txt +++ b/tests/baselines/reference/assignFromNumberInterface2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(23,1): error TS2322: Type 'Number' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(24,1): error TS2322: Type 'NotNumber' is not assignable to type 'number'. + + ==== tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts (2 errors) ==== interface Number { doStuff(): string; @@ -23,9 +27,9 @@ x = a; // expected error ~ -!!! Type 'Number' is not assignable to type 'number'. +!!! error TS2322: Type 'Number' is not assignable to type 'number'. x = b; // expected error ~ -!!! Type 'NotNumber' is not assignable to type 'number'. +!!! error TS2322: Type 'NotNumber' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignFromStringInterface.errors.txt b/tests/baselines/reference/assignFromStringInterface.errors.txt index ba8c5fd583c..6ec8afad120 100644 --- a/tests/baselines/reference/assignFromStringInterface.errors.txt +++ b/tests/baselines/reference/assignFromStringInterface.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts(3,1): error TS2322: Type 'String' is not assignable to type 'string'. + + ==== tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts (1 errors) ==== var x = ''; var a: String; x = a; ~ -!!! Type 'String' is not assignable to type 'string'. +!!! error TS2322: Type 'String' is not assignable to type 'string'. a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromStringInterface2.errors.txt b/tests/baselines/reference/assignFromStringInterface2.errors.txt index 6a8f5e5f6f0..2e3e518f75b 100644 --- a/tests/baselines/reference/assignFromStringInterface2.errors.txt +++ b/tests/baselines/reference/assignFromStringInterface2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(46,1): error TS2322: Type 'String' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(47,1): error TS2322: Type 'NotString' is not assignable to type 'string'. + + ==== tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts (2 errors) ==== interface String { doStuff(): string; @@ -46,9 +50,9 @@ x = a; // expected error ~ -!!! Type 'String' is not assignable to type 'string'. +!!! error TS2322: Type 'String' is not assignable to type 'string'. x = b; // expected error ~ -!!! Type 'NotString' is not assignable to type 'string'. +!!! error TS2322: Type 'NotString' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt index 78c710a7d50..580c6fa3c45 100644 --- a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt +++ b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts(7,4): error TS2345: Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. + Property 'x' is missing in type '(a: any, b: any) => boolean'. +tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts(8,4): error TS2345: Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. + Property 'x' is missing in type '(a: any, b: any) => boolean'. + + ==== tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts (2 errors) ==== interface IResultCallback extends Function { x: number; @@ -7,10 +13,10 @@ fn((a, b) => true); ~~~~~~~~~~~~~~ -!!! Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. -!!! Property 'x' is missing in type '(a: any, b: any) => boolean'. +!!! error TS2345: Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. +!!! error TS2345: Property 'x' is missing in type '(a: any, b: any) => boolean'. fn(function (a, b) { return true; }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. -!!! Property 'x' is missing in type '(a: any, b: any) => boolean'. +!!! error TS2345: Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. +!!! error TS2345: Property 'x' is missing in type '(a: any, b: any) => boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignToEnum.errors.txt b/tests/baselines/reference/assignToEnum.errors.txt index bc37cc5496d..4846a96dbb7 100644 --- a/tests/baselines/reference/assignToEnum.errors.txt +++ b/tests/baselines/reference/assignToEnum.errors.txt @@ -1,16 +1,22 @@ +tests/cases/compiler/assignToEnum.ts(2,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/compiler/assignToEnum.ts(3,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/compiler/assignToEnum.ts(4,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/compiler/assignToEnum.ts(5,1): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/compiler/assignToEnum.ts (4 errors) ==== enum A { foo, bar } A = undefined; // invalid LHS ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. A = A.bar; // invalid LHS ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. A.foo = 1; // invalid LHS ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. A.foo = A.bar; // invalid LHS ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/assignToExistingClass.errors.txt b/tests/baselines/reference/assignToExistingClass.errors.txt index 49feb0a76a0..6a377df5b0c 100644 --- a/tests/baselines/reference/assignToExistingClass.errors.txt +++ b/tests/baselines/reference/assignToExistingClass.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/assignToExistingClass.ts(8,13): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/compiler/assignToExistingClass.ts (1 errors) ==== module Test { class Mocked { @@ -8,7 +11,7 @@ willThrowError() { Mocked = Mocked || function () { // => Error: Invalid left-hand side of assignment expression. ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. return { myProp: "test" }; }; } diff --git a/tests/baselines/reference/assignToFn.errors.txt b/tests/baselines/reference/assignToFn.errors.txt index 10af5946425..7f2c7855a35 100644 --- a/tests/baselines/reference/assignToFn.errors.txt +++ b/tests/baselines/reference/assignToFn.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. + + ==== tests/cases/compiler/assignToFn.ts (1 errors) ==== module M { interface I { @@ -8,6 +11,6 @@ x.f="hello"; ~~~ -!!! Type 'string' is not assignable to type '(n: number) => boolean'. +!!! error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/assignToInvalidLHS.errors.txt b/tests/baselines/reference/assignToInvalidLHS.errors.txt index dd183cf6391..a39756d15f7 100644 --- a/tests/baselines/reference/assignToInvalidLHS.errors.txt +++ b/tests/baselines/reference/assignToInvalidLHS.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/assignToInvalidLHS.ts(4,9): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/compiler/assignToInvalidLHS.ts (1 errors) ==== declare var y:any; // Below is actually valid JavaScript (see http://es5.github.com/#x8.7 ), even though will always fail at runtime with 'invalid left-hand side' var x = new y = 5; ~~~~~ -!!! Invalid left-hand side of assignment expression. \ No newline at end of file +!!! error TS2364: Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/assignToModule.errors.txt b/tests/baselines/reference/assignToModule.errors.txt index ba284a32fa6..26121d72a05 100644 --- a/tests/baselines/reference/assignToModule.errors.txt +++ b/tests/baselines/reference/assignToModule.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/assignToModule.ts(2,1): error TS2304: Cannot find name 'A'. + + ==== tests/cases/compiler/assignToModule.ts (1 errors) ==== module A {} A = undefined; // invalid LHS ~ -!!! Cannot find name 'A'. \ No newline at end of file +!!! error TS2304: Cannot find name 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt index 540bb044f6a..57ce797f5b2 100644 --- a/tests/baselines/reference/assignmentCompat1.errors.txt +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -1,12 +1,18 @@ +tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'. + Property 'one' is missing in type '{ [x: string]: any; }'. +tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'. + Index signature is missing in type '{ one: number; }'. + + ==== tests/cases/compiler/assignmentCompat1.ts (2 errors) ==== var x = {one: 1}; var y: {[index:string]: any}; x = y; ~ -!!! Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }': -!!! Property 'one' is missing in type '{ [x: string]: any; }'. +!!! error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'. +!!! error TS2322: Property 'one' is missing in type '{ [x: string]: any; }'. y = x; ~ -!!! Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }': -!!! Index signature is missing in type '{ one: number; }'. \ No newline at end of file +!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'. +!!! error TS2322: Index signature is missing in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt new file mode 100644 index 00000000000..03dcee9baf3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt @@ -0,0 +1,38 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => number'. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]'. + Property '0' is missing in type '{}[]'. + + +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts (2 errors) ==== + var numStrTuple: [number, string]; + var numNumTuple: [number, number]; + var numEmptyObjTuple: [number, {}]; + var emptyObjTuple: [{}]; + + var numArray: number[]; + var emptyObjArray: {}[]; + + // no error + numArray = numNumTuple; + emptyObjArray = emptyObjTuple; + emptyObjArray = numStrTuple; + emptyObjArray = numNumTuple; + emptyObjArray = numEmptyObjTuple; + + // error + numArray = numStrTuple; + ~~~~~~~~ +!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + emptyObjTuple = emptyObjArray; + ~~~~~~~~~~~~~ +!!! error TS2322: Type '{}[]' is not assignable to type '[{}]'. +!!! error TS2322: Property '0' is missing in type '{}[]'. + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.js b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.js new file mode 100644 index 00000000000..fd3ac1d46f1 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.js @@ -0,0 +1,37 @@ +//// [assignmentCompatBetweenTupleAndArray.ts] +var numStrTuple: [number, string]; +var numNumTuple: [number, number]; +var numEmptyObjTuple: [number, {}]; +var emptyObjTuple: [{}]; + +var numArray: number[]; +var emptyObjArray: {}[]; + +// no error +numArray = numNumTuple; +emptyObjArray = emptyObjTuple; +emptyObjArray = numStrTuple; +emptyObjArray = numNumTuple; +emptyObjArray = numEmptyObjTuple; + +// error +numArray = numStrTuple; +emptyObjTuple = emptyObjArray; + + +//// [assignmentCompatBetweenTupleAndArray.js] +var numStrTuple; +var numNumTuple; +var numEmptyObjTuple; +var emptyObjTuple; +var numArray; +var emptyObjArray; +// no error +numArray = numNumTuple; +emptyObjArray = emptyObjTuple; +emptyObjArray = numStrTuple; +emptyObjArray = numNumTuple; +emptyObjArray = numEmptyObjTuple; +// error +numArray = numStrTuple; +emptyObjTuple = emptyObjArray; diff --git a/tests/baselines/reference/assignmentCompatBug2.errors.txt b/tests/baselines/reference/assignmentCompatBug2.errors.txt index ddbc1706930..15bf1111391 100644 --- a/tests/baselines/reference/assignmentCompatBug2.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug2.errors.txt @@ -1,13 +1,25 @@ +tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. + Property 'b' is missing in type '{ a: number; }'. +tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. + Property 'b' is missing in type '{ a: number; }'. +tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. + Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. +tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. + Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. +tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. + Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. + + ==== tests/cases/compiler/assignmentCompatBug2.ts (5 errors) ==== var b2: { b: number;} = { a: 0 }; // error ~~ -!!! Type '{ a: number; }' is not assignable to type '{ b: number; }': -!!! Property 'b' is missing in type '{ a: number; }'. +!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. +!!! error TS2322: Property 'b' is missing in type '{ a: number; }'. b2 = { a: 0 }; // error ~~ -!!! Type '{ a: number; }' is not assignable to type '{ b: number; }': -!!! Property 'b' is missing in type '{ a: number; }'. +!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. +!!! error TS2322: Property 'b' is missing in type '{ a: number; }'. b2 = {b: 0, a: 0 }; @@ -21,16 +33,16 @@ b3 = { ~~ -!!! Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': -!!! Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. +!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, }; // error b3 = { ~~ -!!! Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': -!!! Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. +!!! error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. f: (n) => { return 0; }, m: 0, }; // error @@ -45,8 +57,8 @@ b3 = { ~~ -!!! Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': -!!! Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. +!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, diff --git a/tests/baselines/reference/assignmentCompatBug3.errors.txt b/tests/baselines/reference/assignmentCompatBug3.errors.txt index f2cb650567e..fe7ff5bbddc 100644 --- a/tests/baselines/reference/assignmentCompatBug3.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug3.errors.txt @@ -1,12 +1,17 @@ +tests/cases/compiler/assignmentCompatBug3.ts(3,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/assignmentCompatBug3.ts(4,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/assignmentCompatBug3.ts(14,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/assignmentCompatBug3.ts (3 errors) ==== function makePoint(x: number, y: number) { return { get x() { return x;}, // shouldn't be "void" ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. get y() { return y;}, // shouldn't be "void" ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. //x: "yo", //y: "boo", dist: function () { @@ -18,7 +23,7 @@ class C { get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 0; } } diff --git a/tests/baselines/reference/assignmentCompatBug5.errors.txt b/tests/baselines/reference/assignmentCompatBug5.errors.txt index cd8f24cee3f..a015cc3bbcf 100644 --- a/tests/baselines/reference/assignmentCompatBug5.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug5.errors.txt @@ -1,22 +1,30 @@ +tests/cases/compiler/assignmentCompatBug5.ts(2,6): error TS2345: Argument of type '{ b: number; }' is not assignable to parameter of type '{ a: number; }'. + Property 'a' is missing in type '{ b: number; }'. +tests/cases/compiler/assignmentCompatBug5.ts(5,6): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'number[]'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/assignmentCompatBug5.ts(8,6): error TS2345: Argument of type '(s: string) => void' is not assignable to parameter of type '(n: number) => number'. +tests/cases/compiler/assignmentCompatBug5.ts(9,6): error TS2345: Argument of type '(n: number) => void' is not assignable to parameter of type '(n: number) => number'. + + ==== tests/cases/compiler/assignmentCompatBug5.ts (4 errors) ==== function foo1(x: { a: number; }) { } foo1({ b: 5 }); ~~~~~~~~ -!!! Argument of type '{ b: number; }' is not assignable to parameter of type '{ a: number; }'. -!!! Property 'a' is missing in type '{ b: number; }'. +!!! error TS2345: Argument of type '{ b: number; }' is not assignable to parameter of type '{ a: number; }'. +!!! error TS2345: Property 'a' is missing in type '{ b: number; }'. function foo2(x: number[]) { } foo2(["s", "t"]); ~~~~~~~~~~ -!!! Argument of type 'string[]' is not assignable to parameter of type 'number[]'. -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: Type 'string' is not assignable to type 'number'. function foo3(x: (n: number) =>number) { }; foo3((s:string) => { }); ~~~~~~~~~~~~~~~~~ -!!! Argument of type '(s: string) => void' is not assignable to parameter of type '(n: number) => number'. +!!! error TS2345: Argument of type '(s: string) => void' is not assignable to parameter of type '(n: number) => number'. foo3((n) => { return; }); ~~~~~~~~~~~~~~~~~~ -!!! Argument of type '(n: number) => void' is not assignable to parameter of type '(n: number) => number'. +!!! error TS2345: Argument of type '(n: number) => void' is not assignable to parameter of type '(n: number) => number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt index fda1cca3d8e..2316320f480 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt @@ -1,15 +1,23 @@ +tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(4,5): error TS2345: Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. + Types of property 'name' are incompatible. + Type 'boolean' is not assignable to type 'string'. +tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'. + Property 'id' is missing in type '{ name: string; }'. + + ==== tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts (3 errors) ==== function foo(x: { id: number; name?: string; }): void; ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. foo({ id: 1234 }); // Ok foo({ id: 1234, name: "hello" }); // Ok foo({ id: 1234, name: false }); // Error, name of wrong type ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. -!!! Types of property 'name' are incompatible: -!!! Type 'boolean' is not assignable to type 'string'. +!!! error TS2345: Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. +!!! error TS2345: Types of property 'name' are incompatible. +!!! error TS2345: Type 'boolean' is not assignable to type 'string'. foo({ name: "hello" }); // Error, id required but missing ~~~~~~~~~~~~~~~~~ -!!! Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'. -!!! Property 'id' is missing in type '{ name: string; }'. \ No newline at end of file +!!! error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'. +!!! error TS2345: Property 'id' is missing in type '{ name: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt index 7d84f69b3d2..f972c9a925e 100644 --- a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt +++ b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/assignmentCompatInterfaceWithStringIndexSignature.ts(15,5): error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'IHandlerMap'. + + ==== tests/cases/compiler/assignmentCompatInterfaceWithStringIndexSignature.ts (1 errors) ==== interface IHandler { (e): boolean; @@ -15,5 +18,5 @@ Biz(new Foo()); ~~~~~~~~~ -!!! Argument of type 'Foo' is not assignable to parameter of type 'IHandlerMap'. +!!! error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'IHandlerMap'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt index ab314d0a95f..6a221ef144e 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt @@ -1,3 +1,29 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2322: Type 'S2' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2322: Type 'S2' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts (8 errors) ==== // void returning call signatures can be assigned a non-void returning call signature that otherwise matches @@ -35,42 +61,42 @@ // these are errors t = s2; ~ -!!! Type 'S2' is not assignable to type 'T': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = a3; ~ -!!! Type '(x: string) => void' is not assignable to type 'T': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = (x: string) => 1; ~ -!!! Type '(x: string) => number' is not assignable to type 'T': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = function (x: string) { return ''; } ~ -!!! Type '(x: string) => string' is not assignable to type 'T': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = s2; ~ -!!! Type 'S2' is not assignable to type '(x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'S2' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = a3; ~ -!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x: string) => 1; ~ -!!! Type '(x: string) => number' is not assignable to type '(x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = function (x: string) { return ''; } ~ -!!! Type '(x: string) => string' is not assignable to type '(x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt index 2fa4e383e9f..e67f0a930c2 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt @@ -1,3 +1,41 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(31,1): error TS2322: Type '() => number' is not assignable to type 'T'. + Property 'f' is missing in type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(32,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T'. + Property 'f' is missing in type '(x: number) => string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(33,1): error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }'. + Property 'f' is missing in type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(34,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. + Property 'f' is missing in type '(x: number) => string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2322: Type 'S2' is not assignable to type 'T'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. + Property 'f' is missing in type '(x: string) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. + Property 'f' is missing in type '(x: string) => string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. + Property 'f' is missing in type '(x: string) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. + Property 'f' is missing in type '(x: string) => string'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts (12 errors) ==== // void returning call signatures can be assigned a non-void returning call signature that otherwise matches @@ -31,20 +69,20 @@ // errors t = () => 1; ~ -!!! Type '() => number' is not assignable to type 'T': -!!! Property 'f' is missing in type '() => number'. +!!! error TS2322: Type '() => number' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '() => number'. t = function (x: number) { return ''; } ~ -!!! Type '(x: number) => string' is not assignable to type 'T': -!!! Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. a = () => 1; ~ -!!! Type '() => number' is not assignable to type '{ f(x: number): void; }': -!!! Property 'f' is missing in type '() => number'. +!!! error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Property 'f' is missing in type '() => number'. a = function (x: number) { return ''; } ~ -!!! Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }': -!!! Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. interface S2 { f(x: string): void; @@ -54,46 +92,46 @@ // these are errors t = s2; ~ -!!! Type 'S2' is not assignable to type 'T': -!!! Types of property 'f' are incompatible: -!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = a3; ~ -!!! Type '{ f(x: string): void; }' is not assignable to type 'T': -!!! Types of property 'f' are incompatible: -!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = (x: string) => 1; ~ -!!! Type '(x: string) => number' is not assignable to type 'T': -!!! Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. t = function (x: string) { return ''; } ~ -!!! Type '(x: string) => string' is not assignable to type 'T': -!!! Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. a = s2; ~ -!!! Type 'S2' is not assignable to type '{ f(x: number): void; }': -!!! Types of property 'f' are incompatible: -!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = a3; ~ -!!! Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }': -!!! Types of property 'f' are incompatible: -!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x: string) => 1; ~ -!!! Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }': -!!! Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. a = function (x: string) { return ''; } ~ -!!! Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }': -!!! Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt index 973dfe92ca2..e00d1eea042 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -1,3 +1,15 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts (2 errors) ==== // These are mostly permitted with the current loose rules. All ok unless otherwise noted. @@ -52,22 +64,18 @@ var b8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; a8 = b8; // error, { foo: number } and Base are incompatible ~~ -!!! Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! Types of parameters 'arg2' and 'arg2' are incompatible: -!!! Type '{ foo: number; }' is not assignable to type 'Base': -!!! Types of property 'foo' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error, { foo: number } and Base are incompatible ~~ -!!! Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': -!!! Types of parameters 'arg2' and 'arg2' are incompatible: -!!! Type 'Base' is not assignable to type '{ foo: number; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. var b10: (...x: T[]) => T; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt index 125def7dc62..f89bbfa5798 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,3 +1,12 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts (7 errors) ==== // call signatures in derived types must have the same or fewer optional parameters as the base type @@ -16,19 +25,19 @@ a = (x?: number) => 1; // ok, same number of required params a = (x: number) => 1; // error, too many required params ~ -!!! Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. a = b.a; // ok a = b.a2; // ok a = b.a3; // error ~ -!!! Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. a = b.a4; // error ~ -!!! Type '(x: number, y?: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. a = b.a5; // ok a = b.a6; // error ~ -!!! Type '(x: number, y: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. var a2: (x?: number) => number; a2 = () => 1; // ok, same number of required params @@ -41,7 +50,7 @@ a2 = b.a5; // ok a2 = b.a6; // error ~~ -!!! Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. var a3: (x: number) => number; a3 = () => 1; // ok, fewer required params @@ -49,7 +58,7 @@ a3 = (x: number) => 1; // ok, same number of required params a3 = (x: number, y: number) => 1; // error, too many required params ~~ -!!! Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. a3 = b.a; // ok a3 = b.a2; // ok a3 = b.a3; // ok @@ -57,7 +66,7 @@ a3 = b.a5; // ok a3 = b.a6; // error ~~ -!!! Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. var a4: (x: number, y?: number) => number; a4 = () => 1; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt index 7bee15e16b7..8eec8503e70 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt @@ -1,3 +1,32 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. + Types of parameters 'args' and 'args' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. + Types of parameters 'x' and 'args' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. + Types of parameters 'args' and 'z' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'z' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'args' and 'z' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts (9 errors) ==== // call signatures in derived types must have the same or fewer optional parameters as the target for assignment @@ -13,17 +42,17 @@ a = (...args: number[]) => 1; // ok, same number of required params a = (...args: string[]) => 1; // error, type mismatch ~ -!!! Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number': -!!! Types of parameters 'args' and 'args' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2322: Types of parameters 'args' and 'args' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x?: number) => 1; // ok, same number of required params a = (x?: number, y?: number, z?: number) => 1; // ok, same number of required params a = (x: number) => 1; // ok, rest param corresponds to infinite number of params a = (x?: string) => 1; // error, incompatible type ~ -!!! Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number': -!!! Types of parameters 'x' and 'args' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2322: Types of parameters 'x' and 'args' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a2: (x: number, ...z: number[]) => number; @@ -34,9 +63,9 @@ a2 = (x: number, ...args: number[]) => 1; // ok, same number of required params a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error ~~ -!!! Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number': -!!! Types of parameters 'args' and 'z' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params a2 = (x: number, y?: number) => 1; // ok, same number of required params @@ -47,36 +76,36 @@ a3 = (x: number, y: string) => 1; // ok, all present params match a3 = (x: number, y?: number, z?: number) => 1; // error ~~ -!!! Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a3 = (x: number, ...z: number[]) => 1; // error ~~ -!!! Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! Types of parameters 'z' and 'y' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'z' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a3 = (x: string, y?: string, z?: string) => 1; // error ~~ -!!! Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a4: (x?: number, y?: string, ...z: number[]) => number; a4 = () => 1; // ok, fewer required params a4 = (x?: number, y?: number) => 1; // error, type mismatch ~~ -!!! Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a4 = (x: number) => 1; // ok, all present params match a4 = (x: number, y?: number) => 1; // error, second param has type mismatch ~~ -!!! Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch ~~ -!!! Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! Types of parameters 'args' and 'z' are incompatible: -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt index 46c7804b144..9c0c0d6a8fd 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(28,1): error TS2322: Type 'S2' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(29,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(30,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(31,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(32,1): error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(33,1): error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(34,1): error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(35,1): error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts (8 errors) ==== // void returning call signatures can be assigned a non-void returning call signature that otherwise matches @@ -28,26 +38,26 @@ // these are errors t = s2; ~ -!!! Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Type 'S2' is not assignable to type 'T'. t = a3; ~ -!!! Type '(x: string) => void' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'. t = (x: string) => 1; ~ -!!! Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. t = function (x: string) { return ''; } ~ -!!! Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. a = s2; ~ -!!! Type 'S2' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'. a = a3; ~ -!!! Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = (x: string) => 1; ~ -!!! Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. a = function (x: string) { return ''; } ~ -!!! Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt index 703bf50d294..5e8fc6dd3a4 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt @@ -1,3 +1,33 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(23,1): error TS2322: Type '() => number' is not assignable to type 'T'. + Property 'f' is missing in type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(24,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T'. + Property 'f' is missing in type '(x: number) => string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(25,1): error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. + Property 'f' is missing in type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(26,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. + Property 'f' is missing in type '(x: number) => string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2322: Type 'S2' is not assignable to type 'T'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. + Property 'f' is missing in type '(x: string) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. + Property 'f' is missing in type '(x: string) => string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. + Property 'f' is missing in type '(x: string) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. + Property 'f' is missing in type '(x: string) => string'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts (12 errors) ==== // void returning call signatures can be assigned a non-void returning call signature that otherwise matches @@ -23,20 +53,20 @@ // errors t = () => 1; ~ -!!! Type '() => number' is not assignable to type 'T': -!!! Property 'f' is missing in type '() => number'. +!!! error TS2322: Type '() => number' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '() => number'. t = function (x: number) { return ''; } ~ -!!! Type '(x: number) => string' is not assignable to type 'T': -!!! Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. a = () => 1; ~ -!!! Type '() => number' is not assignable to type '{ f: new (x: number) => void; }': -!!! Property 'f' is missing in type '() => number'. +!!! error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Property 'f' is missing in type '() => number'. a = function (x: number) { return ''; } ~ -!!! Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }': -!!! Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. interface S2 { f(x: string): void; @@ -46,38 +76,38 @@ // these are errors t = s2; ~ -!!! Type 'S2' is not assignable to type 'T': -!!! Types of property 'f' are incompatible: -!!! Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. t = a3; ~ -!!! Type '{ f(x: string): void; }' is not assignable to type 'T': -!!! Types of property 'f' are incompatible: -!!! Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. t = (x: string) => 1; ~ -!!! Type '(x: string) => number' is not assignable to type 'T': -!!! Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. t = function (x: string) { return ''; } ~ -!!! Type '(x: string) => string' is not assignable to type 'T': -!!! Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. a = s2; ~ -!!! Type 'S2' is not assignable to type '{ f: new (x: number) => void; }': -!!! Types of property 'f' are incompatible: -!!! Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = a3; ~ -!!! Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }': -!!! Types of property 'f' are incompatible: -!!! Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = (x: string) => 1; ~ -!!! Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }': -!!! Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. a = function (x: string) { return ''; } ~ -!!! Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }': -!!! Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt index c5055b16e89..804e31600e1 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -1,3 +1,27 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. + Types of parameters 'x' and 'x' are incompatible. + Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. + Types of parameters 'x' and 'x' are incompatible. + Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. + Types of parameters 'x' and 'x' are incompatible. + Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. + Types of parameters 'x' and 'x' are incompatible. + Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts (6 errors) ==== // checking assignment compatibility relations for function types. @@ -52,22 +76,18 @@ var b8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; a8 = b8; // error, type mismatch ~~ -!!! Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! Types of parameters 'arg2' and 'arg2' are incompatible: -!!! Type '{ foo: number; }' is not assignable to type 'Base': -!!! Types of property 'foo' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error ~~ -!!! Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': -!!! Types of parameters 'arg2' and 'arg2' are incompatible: -!!! Type 'Base' is not assignable to type '{ foo: number; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. var b10: new (...x: T[]) => T; @@ -93,26 +113,26 @@ var b16: new (x: (a: T) => T) => T[]; a16 = b16; // error ~~~ -!!! Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. +!!! error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. b16 = a16; // error ~~~ -!!! Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. var b17: new (x: (a: T) => T) => any[]; a17 = b17; // error ~~~ -!!! Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. +!!! error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. b17 = a17; // error ~~~ -!!! Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. } module WithGenericSignaturesInBaseType { diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt index 69098417e53..df56af3ee98 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,3 +1,10 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts (5 errors) ==== // call signatures in derived types must have the same or fewer optional parameters as the base type @@ -16,14 +23,14 @@ a = b.a2; // ok a = b.a3; // error ~ -!!! Type 'new (x: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. a = b.a4; // error ~ -!!! Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. a = b.a5; // ok a = b.a6; // error ~ -!!! Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. var a2: new (x?: number) => number; a2 = b.a; // ok @@ -33,7 +40,7 @@ a2 = b.a5; // ok a2 = b.a6; // error ~~ -!!! Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. var a3: new (x: number) => number; a3 = b.a; // ok @@ -43,7 +50,7 @@ a3 = b.a5; // ok a3 = b.a6; // error ~~ -!!! Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. var a4: new (x: number, y?: number) => number; a4 = b.a; // ok diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.errors.txt index d5fb8f331fb..bc82b0fa69c 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures4.ts(7,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures4.ts(8,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures4.ts (2 errors) ==== // some complex cases of assignment compat of generic signatures. @@ -7,10 +11,10 @@ var x: >(z: T) => void ~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var y: >>(z: T) => void ~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. // These both do not make sense as we would eventually be comparing I2 to I2>, and they are self referencing anyway x = y diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt index 5807bbb1663..a18da8fd8f7 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,3 +1,11 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(66,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (6 errors) ==== // call signatures in derived types must have the same or fewer optional parameters as the target for assignment @@ -14,7 +22,7 @@ this.a = (x?: T) => null; // ok, same T of required params this.a = (x: T) => null; // error, too many required params ~~~~~~ -!!! Type '(x: T) => any' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -25,7 +33,7 @@ this.a3 = (x: T) => null; // ok, same T of required params this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ -!!! Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +!!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params @@ -69,10 +77,10 @@ b.a = t.a2; b.a = t.a3; ~~~ -!!! Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. b.a = t.a4; ~~~ -!!! Type '(x: T, y?: T) => T' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. b.a = t.a5; b.a2 = t.a; @@ -115,7 +123,7 @@ this.a = (x?: T) => null; // ok, same T of required params this.a = (x: T) => null; // error, too many required params ~~~~~~ -!!! Type '(x: T) => any' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -126,7 +134,7 @@ this.a3 = (x: T) => null; // ok, same T of required params this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ -!!! Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +!!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt index 0974c579daf..0a9b50ff0b8 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt @@ -1,3 +1,25 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. + Property 'bar' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. + Property 'baz' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Derived' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Derived2' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts (6 errors) ==== // Derived type indexer must be subtype of base type indexer @@ -14,19 +36,19 @@ a = b; b = a; // error ~ -!!! Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: number]: Derived2; } a = b2; b2 = a; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { class A { @@ -42,28 +64,26 @@ var b: { [x: number]: Derived; } a = b; // error ~ -!!! Type '{ [x: number]: Derived; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'Derived' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. b = a; // error ~ -!!! Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! Index signatures are incompatible: -!!! Type 'T' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b2: { [x: number]: Derived2; } a = b2; // error ~ -!!! Type '{ [x: number]: Derived2; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'Derived2' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b2 = a; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'T' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. var b3: { [x: number]: T; } a = b3; // ok diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt index 35a0cf283a5..b15f2f7905d 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt @@ -1,3 +1,25 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. + Property 'bar' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. + Property 'baz' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Derived' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Derived2' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts (6 errors) ==== // Derived type indexer must be subtype of base type indexer @@ -14,19 +36,19 @@ a = b; b = a; // error ~ -!!! Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: number]: Derived2; } a = b2; b2 = a; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { interface A { @@ -42,28 +64,26 @@ var b: { [x: number]: Derived; } a = b; // error ~ -!!! Type '{ [x: number]: Derived; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'Derived' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. b = a; // error ~ -!!! Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! Index signatures are incompatible: -!!! Type 'T' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b2: { [x: number]: Derived2; } a = b2; // error ~ -!!! Type '{ [x: number]: Derived2; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'Derived2' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b2 = a; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'T' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. var b3: { [x: number]: T; } a = b3; // ok diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt index dfc46323757..61f9e082a48 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt @@ -1,3 +1,16 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(14,1): error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. + Property 'bar' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(23,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. + Property 'baz' is missing in type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(33,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Derived' is not assignable to type 'T'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts (3 errors) ==== // Derived type indexer must be subtype of base type indexer @@ -14,10 +27,10 @@ a = b; // error ~ -!!! Type '{ [x: number]: Base; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. b = a; // ok class B2 extends A { @@ -28,10 +41,10 @@ a = b2; // ok b2 = a; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'Derived' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Derived'. module Generics { class A { @@ -43,9 +56,9 @@ var b: { [x: number]: Derived; }; a = b; // error ~ -!!! Type '{ [x: number]: Derived; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'Derived' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. b = a; // ok var b2: { [x: number]: T; }; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt index 7b0e088f851..0fdae0b7cfa 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt @@ -1,3 +1,59 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(24,5): error TS2322: Type 'T' is not assignable to type 'S'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. + Property 'bar' is missing in type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(25,5): error TS2322: Type 'S' is not assignable to type 'T'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. + Property 'baz' is missing in type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(29,5): error TS2322: Type 'T2' is not assignable to type 'S2'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(30,5): error TS2322: Type 'S2' is not assignable to type 'T2'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(31,5): error TS2322: Type 'T' is not assignable to type 'S2'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(32,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(35,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(36,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(41,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(42,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(43,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(44,5): error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(45,5): error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(70,5): error TS2322: Type 'S' is not assignable to type 'T'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. + Property 'baz' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(75,5): error TS2322: Type 'S2' is not assignable to type 'T2'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(81,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts (17 errors) ==== // members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M @@ -24,91 +80,80 @@ s = t; // error ~ -!!! Type 'T' is not assignable to type 'S': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived2' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'T' is not assignable to type 'S'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Derived2'. t = s; // error ~ -!!! Type 'S' is not assignable to type 'T': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Type 'S' is not assignable to type 'T'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Derived'. s = s2; // ok s = a2; // ok s2 = t2; // error ~~ -!!! Type 'T2' is not assignable to type 'S2': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived2' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'T2' is not assignable to type 'S2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. t2 = s2; // error ~~ -!!! Type 'S2' is not assignable to type 'T2': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Type 'S2' is not assignable to type 'T2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. s2 = t; // error ~~ -!!! Type 'T' is not assignable to type 'S2': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived2' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'T' is not assignable to type 'S2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. s2 = b; // error ~~ -!!! Type '{ foo: Derived2; }' is not assignable to type 'S2': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived2' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. s2 = a2; // ok a = b; // error ~ -!!! Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived2' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. b = a; // error ~ -!!! Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. a = s; // ok a = s2; // ok a = a2; // ok a2 = b2; // error ~~ -!!! Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived2' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. b2 = a2; // error ~~ -!!! Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. a2 = b; // error ~~ -!!! Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived2' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. a2 = t2; // error ~~ -!!! Type 'T2' is not assignable to type '{ foo: Derived; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived2' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. a2 = t; // error ~~ -!!! Type 'T' is not assignable to type '{ foo: Derived; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'Derived2' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. } module WithBase { @@ -135,20 +180,19 @@ s = t; // ok t = s; // error ~ -!!! Type 'S' is not assignable to type 'T': -!!! Types of property 'foo' are incompatible: -!!! Type 'Base' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'S' is not assignable to type 'T'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Base'. s = s2; // ok s = a2; // ok s2 = t2; // ok t2 = s2; // error ~~ -!!! Type 'S2' is not assignable to type 'T2': -!!! Types of property 'foo' are incompatible: -!!! Type 'Base' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'S2' is not assignable to type 'T2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. s2 = t; // ok s2 = b; // ok s2 = a2; // ok @@ -156,10 +200,9 @@ a = b; // ok b = a; // error ~ -!!! Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'Base' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. a = s; // ok a = s2; // ok a = a2; // ok @@ -167,10 +210,9 @@ a2 = b2; // ok b2 = a2; // error ~~ -!!! Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': -!!! Types of property 'foo' are incompatible: -!!! Type 'Base' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. a2 = b; // ok a2 = t2; // ok a2 = t; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt index d3e92899a84..f9f7e48c685 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(13,1): error TS2322: Type 'I' is not assignable to type 'C'. + Property 'foo' is missing in type 'I'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(14,1): error TS2322: Type 'C' is not assignable to type 'I'. + Property 'fooo' is missing in type 'C'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts (2 errors) ==== class C { foo: string; @@ -13,9 +19,9 @@ c = i; // error ~ -!!! Type 'I' is not assignable to type 'C': -!!! Property 'foo' is missing in type 'I'. +!!! error TS2322: Type 'I' is not assignable to type 'C'. +!!! error TS2322: Property 'foo' is missing in type 'I'. i = c; // error ~ -!!! Type 'C' is not assignable to type 'I': -!!! Property 'fooo' is missing in type 'C'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'I'. +!!! error TS2322: Property 'fooo' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt index 75ba383671c..c1093ab0ffe 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt @@ -1,3 +1,53 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. + Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base'. + Property 'foo' is private in type 'E' but not in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2322: Type 'E' is not assignable to type 'I'. + Property 'foo' is private in type 'E' but not in type 'I'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2322: Type 'E' is not assignable to type 'D'. + Property 'foo' is private in type 'E' but not in type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. + Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2322: Type 'Base' is not assignable to type 'E'. + Property 'foo' is private in type 'E' but not in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I' is not assignable to type 'E'. + Property 'foo' is private in type 'E' but not in type 'I'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E'. + Property 'foo' is private in type 'E' but not in type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'. + Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }'. + Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. + Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'. + Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2322: Type 'D' is not assignable to type 'Base'. + Property 'foo' is private in type 'Base' but not in type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2322: Type 'E' is not assignable to type 'Base'. + Types have separate declarations of a private property 'foo'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'I'. + Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I'. + Property 'foo' is private in type 'I' but not in type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I'. + Types have separate declarations of a private property 'foo'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'D'. + Property 'foo' is private in type 'Base' but not in type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2322: Type 'I' is not assignable to type 'D'. + Property 'foo' is private in type 'I' but not in type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2322: Type 'E' is not assignable to type 'D'. + Property 'foo' is private in type 'E' but not in type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. + Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2322: Type 'Base' is not assignable to type 'E'. + Types have separate declarations of a private property 'foo'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2322: Type 'I' is not assignable to type 'E'. + Types have separate declarations of a private property 'foo'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' is not assignable to type 'E'. + Property 'foo' is private in type 'E' but not in type 'D'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts (24 errors) ==== // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M @@ -31,49 +81,49 @@ a = d; a = e; // error ~ -!!! Type 'E' is not assignable to type '{ foo: string; }': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. b = a; b = i; b = d; b = e; // error ~ -!!! Type 'E' is not assignable to type 'Base': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'E' is not assignable to type 'Base'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'. i = a; i = b; i = d; i = e; // error ~ -!!! Type 'E' is not assignable to type 'I': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'E' is not assignable to type 'I'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'. d = a; d = b; d = i; d = e; // error ~ -!!! Type 'E' is not assignable to type 'D': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'E' is not assignable to type 'D'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = a; // errror ~ -!!! Type '{ foo: string; }' is not assignable to type 'E': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. e = b; // errror ~ -!!! Type 'Base' is not assignable to type 'E': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'Base' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'. e = i; // errror ~ -!!! Type 'I' is not assignable to type 'E': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'I' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'. e = d; // errror ~ -!!! Type 'D' is not assignable to type 'E': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'D' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = e; } @@ -105,78 +155,78 @@ a = b; // error ~ -!!! Type 'Base' is not assignable to type '{ foo: string; }': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'. +!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. a = i; // error ~ -!!! Type 'I' is not assignable to type '{ foo: string; }': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'I' is not assignable to type '{ foo: string; }'. +!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. a = d; a = e; // error ~ -!!! Type 'E' is not assignable to type '{ foo: string; }': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. b = a; // error ~ -!!! Type '{ foo: string; }' is not assignable to type 'Base': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'. +!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. b = i; b = d; // error ~ -!!! Type 'D' is not assignable to type 'Base': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'D' is not assignable to type 'Base'. +!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'. b = e; // error ~ -!!! Type 'E' is not assignable to type 'Base': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'E' is not assignable to type 'Base'. +!!! error TS2322: Types have separate declarations of a private property 'foo'. b = b; i = a; // error ~ -!!! Type '{ foo: string; }' is not assignable to type 'I': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'I'. +!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. i = b; i = d; // error ~ -!!! Type 'D' is not assignable to type 'I': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'D' is not assignable to type 'I'. +!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'. i = e; // error ~ -!!! Type 'E' is not assignable to type 'I': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'E' is not assignable to type 'I'. +!!! error TS2322: Types have separate declarations of a private property 'foo'. i = i; d = a; d = b; // error ~ -!!! Type 'Base' is not assignable to type 'D': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'Base' is not assignable to type 'D'. +!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'. d = i; // error ~ -!!! Type 'I' is not assignable to type 'D': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'I' is not assignable to type 'D'. +!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'. d = e; // error ~ -!!! Type 'E' is not assignable to type 'D': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'E' is not assignable to type 'D'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = a; // errror ~ -!!! Type '{ foo: string; }' is not assignable to type 'E': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. e = b; // errror ~ -!!! Type 'Base' is not assignable to type 'E': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'Base' is not assignable to type 'E'. +!!! error TS2322: Types have separate declarations of a private property 'foo'. e = i; // errror ~ -!!! Type 'I' is not assignable to type 'E': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'I' is not assignable to type 'E'. +!!! error TS2322: Types have separate declarations of a private property 'foo'. e = d; // errror ~ -!!! Type 'D' is not assignable to type 'E': -!!! Private property 'foo' cannot be reimplemented. +!!! error TS2322: Type 'D' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = e; } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt index 1e2b287f942..b378086ca5e 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt @@ -1,3 +1,17 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2322: Type 'D' is not assignable to type 'C'. + Property 'opt' is optional in type 'D' but required in type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2322: Type 'E' is not assignable to type 'C'. + Property 'opt' is optional in type 'E' but required in type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(78,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. + Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(79,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. + Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(83,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. + Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. + Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts (6 errors) ==== // Derived member is not optional but base member is, should be ok @@ -73,34 +87,34 @@ c = d; // error ~ -!!! Type 'D' is not assignable to type 'C': -!!! Required property 'opt' cannot be reimplemented with optional property in 'D'. +!!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Property 'opt' is optional in type 'D' but required in type 'C'. c = e; // error ~ -!!! Type 'E' is not assignable to type 'C': -!!! Required property 'opt' cannot be reimplemented with optional property in 'E'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Property 'opt' is optional in type 'E' but required in type 'C'. c = f; // ok c = a; // ok a = d; // error ~ -!!! Type 'D' is not assignable to type '{ opt: Base; }': -!!! Required property 'opt' cannot be reimplemented with optional property in 'D'. +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. a = e; // error ~ -!!! Type 'E' is not assignable to type '{ opt: Base; }': -!!! Required property 'opt' cannot be reimplemented with optional property in 'E'. +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. a = f; // ok a = c; // ok b = d; // error ~ -!!! Type 'D' is not assignable to type '{ opt: Base; }': -!!! Required property 'opt' cannot be reimplemented with optional property in 'D'. +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. b = e; // error ~ -!!! Type 'E' is not assignable to type '{ opt: Base; }': -!!! Required property 'opt' cannot be reimplemented with optional property in 'E'. +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. b = f; // ok b = a; // ok b = c; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt index 4d4344a8af2..de2751beaca 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt @@ -1,3 +1,23 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2322: Type 'D' is not assignable to type 'C'. + Property 'opt' is missing in type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2322: Type 'E' is not assignable to type 'C'. + Property 'opt' is missing in type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2322: Type 'F' is not assignable to type 'C'. + Property 'opt' is missing in type 'F'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(79,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. + Property 'opt' is missing in type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(80,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. + Property 'opt' is missing in type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(81,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. + Property 'opt' is missing in type 'F'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(84,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. + Property 'opt' is missing in type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. + Property 'opt' is missing in type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. + Property 'opt' is missing in type 'F'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts (9 errors) ==== // M is optional and S contains no property with the same name as M // N is optional and T contains no property with the same name as N @@ -74,44 +94,44 @@ c = d; // error ~ -!!! Type 'D' is not assignable to type 'C': -!!! Property 'opt' is missing in type 'D'. +!!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Property 'opt' is missing in type 'D'. c = e; // error ~ -!!! Type 'E' is not assignable to type 'C': -!!! Property 'opt' is missing in type 'E'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Property 'opt' is missing in type 'E'. c = f; // error ~ -!!! Type 'F' is not assignable to type 'C': -!!! Property 'opt' is missing in type 'F'. +!!! error TS2322: Type 'F' is not assignable to type 'C'. +!!! error TS2322: Property 'opt' is missing in type 'F'. c = a; // ok a = d; // error ~ -!!! Type 'D' is not assignable to type '{ opt: Base; }': -!!! Property 'opt' is missing in type 'D'. +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'D'. a = e; // error ~ -!!! Type 'E' is not assignable to type '{ opt: Base; }': -!!! Property 'opt' is missing in type 'E'. +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'E'. a = f; // error ~ -!!! Type 'F' is not assignable to type '{ opt: Base; }': -!!! Property 'opt' is missing in type 'F'. +!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'F'. a = c; // ok b = d; // error ~ -!!! Type 'D' is not assignable to type '{ opt: Base; }': -!!! Property 'opt' is missing in type 'D'. +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'D'. b = e; // error ~ -!!! Type 'E' is not assignable to type '{ opt: Base; }': -!!! Property 'opt' is missing in type 'E'. +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'E'. b = f; // error ~ -!!! Type 'F' is not assignable to type '{ opt: Base; }': -!!! Property 'opt' is missing in type 'F'. +!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'F'. b = a; // ok b = c; // ok } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt index 954fbfe88e4..d86c73f5cf8 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt @@ -1,3 +1,63 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2322: Type 'T' is not assignable to type 'S'. + Property ''1'' is missing in type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2322: Type 'S' is not assignable to type 'T'. + Property ''1.'' is missing in type 'S'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. + Property ''1'' is missing in type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(26,5): error TS2322: Type 'T2' is not assignable to type 'S2'. + Property ''1'' is missing in type 'T2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(27,5): error TS2322: Type 'S2' is not assignable to type 'T2'. + Property ''1.0'' is missing in type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(28,5): error TS2322: Type 'T' is not assignable to type 'S2'. + Property ''1'' is missing in type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(29,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. + Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(30,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. + Property ''1'' is missing in type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(32,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. + Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(33,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. + Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(34,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. + Property ''1.'' is missing in type 'S'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(35,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. + Property ''1.'' is missing in type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. + Property ''1.'' is missing in type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. + Property ''1.0'' is missing in type '{ '1': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. + Property ''1'' is missing in type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. + Property ''1.0'' is missing in type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. + Property ''1'' is missing in type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. + Property ''1'' is missing in type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. + Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(74,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. + Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(75,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. + Property ''1.'' is missing in type 'S'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(76,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. + Property ''1.'' is missing in type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(77,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. + Property ''1.'' is missing in type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(78,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. + Property ''1.'' is missing in type '{ 1.: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(80,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. + Property ''1.0'' is missing in type '{ 1.: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(81,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. + Property '1.' is missing in type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(82,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. + Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }'. + Property ''1.0'' is missing in type 'T2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. + Property ''1.0'' is missing in type 'T'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts (29 errors) ==== // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M // string named numeric properties work correctly, errors below unless otherwise noted @@ -21,74 +81,74 @@ s = t; ~ -!!! Type 'T' is not assignable to type 'S': -!!! Property ''1'' is missing in type 'T'. +!!! error TS2322: Type 'T' is not assignable to type 'S'. +!!! error TS2322: Property ''1'' is missing in type 'T'. t = s; ~ -!!! Type 'S' is not assignable to type 'T': -!!! Property ''1.'' is missing in type 'S'. +!!! error TS2322: Type 'S' is not assignable to type 'T'. +!!! error TS2322: Property ''1.'' is missing in type 'S'. s = s2; // ok s = a2; ~ -!!! Type '{ '1.0': string; }' is not assignable to type 'S': -!!! Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. s2 = t2; ~~ -!!! Type 'T2' is not assignable to type 'S2': -!!! Property ''1'' is missing in type 'T2'. +!!! error TS2322: Type 'T2' is not assignable to type 'S2'. +!!! error TS2322: Property ''1'' is missing in type 'T2'. t2 = s2; ~~ -!!! Type 'S2' is not assignable to type 'T2': -!!! Property ''1.0'' is missing in type 'S2'. +!!! error TS2322: Type 'S2' is not assignable to type 'T2'. +!!! error TS2322: Property ''1.0'' is missing in type 'S2'. s2 = t; ~~ -!!! Type 'T' is not assignable to type 'S2': -!!! Property ''1'' is missing in type 'T'. +!!! error TS2322: Type 'T' is not assignable to type 'S2'. +!!! error TS2322: Property ''1'' is missing in type 'T'. s2 = b; ~~ -!!! Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2': -!!! Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. +!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. s2 = a2; ~~ -!!! Type '{ '1.0': string; }' is not assignable to type 'S2': -!!! Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. a = b; ~ -!!! Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': -!!! Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. +!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. b = a; ~ -!!! Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }': -!!! Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. +!!! error TS2322: Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. a = s; ~ -!!! Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': -!!! Property ''1.'' is missing in type 'S'. +!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type 'S'. a = s2; ~ -!!! Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': -!!! Property ''1.'' is missing in type 'S2'. +!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type 'S2'. a = a2; ~ -!!! Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': -!!! Property ''1.'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'. a2 = b2; ~~ -!!! Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }': -!!! Property ''1.0'' is missing in type '{ '1': string; }'. +!!! error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type '{ '1': string; }'. b2 = a2; ~~ -!!! Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }': -!!! Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. a2 = b; // ok a2 = t2; // ok a2 = t; ~~ -!!! Type 'T' is not assignable to type '{ '1.0': string; }': -!!! Property ''1.0'' is missing in type 'T'. +!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type 'T'. } module NumbersAndStrings { @@ -113,8 +173,8 @@ s = s2; // ok s = a2; // error ~ -!!! Type '{ '1.0': string; }' is not assignable to type 'S': -!!! Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. s2 = t2; // ok t2 = s2; // ok @@ -122,52 +182,52 @@ s2 = b; // ok s2 = a2; // error ~~ -!!! Type '{ '1.0': string; }' is not assignable to type 'S2': -!!! Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. a = b; // error ~ -!!! Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': -!!! Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. +!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. b = a; // error ~ -!!! Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }': -!!! Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. +!!! error TS2322: Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. a = s; // error ~ -!!! Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': -!!! Property ''1.'' is missing in type 'S'. +!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type 'S'. a = s2; // error ~ -!!! Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': -!!! Property ''1.'' is missing in type 'S2'. +!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type 'S2'. a = a2; // error ~ -!!! Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': -!!! Property ''1.'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'. a = b2; // error ~ -!!! Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }': -!!! Property ''1.'' is missing in type '{ 1.: string; }'. +!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type '{ 1.: string; }'. a2 = b2; // error ~~ -!!! Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }': -!!! Property ''1.0'' is missing in type '{ 1.: string; }'. +!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type '{ 1.: string; }'. b2 = a2; // error ~~ -!!! Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }': -!!! Property '1.' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. +!!! error TS2322: Property '1.' is missing in type '{ '1.0': string; }'. a2 = b; // error ~~ -!!! Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }': -!!! Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. +!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. a2 = t2; // error ~~ -!!! Type 'T2' is not assignable to type '{ '1.0': string; }': -!!! Property ''1.0'' is missing in type 'T2'. +!!! error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type 'T2'. a2 = t; // error ~~ -!!! Type 'T' is not assignable to type '{ '1.0': string; }': -!!! Property ''1.0'' is missing in type 'T'. +!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt index 350ff22c18d..3bea0c46716 100644 --- a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt @@ -1,3 +1,15 @@ +tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. + Types of parameters 'x' and 's1' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/assignmentCompatWithOverloads.ts (4 errors) ==== function f1(x: string): number { return null; } @@ -17,19 +29,19 @@ g = f2; // Error ~ -!!! Type '(x: string) => string' is not assignable to type '(s1: string) => number': -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. g = f3; // Error ~ -!!! Type '(x: number) => number' is not assignable to type '(s1: string) => number': -!!! Types of parameters 'x' and 's1' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. +!!! error TS2322: Types of parameters 'x' and 's1' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. g = f4; // Error ~ -!!! Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number': -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. class C { constructor(x: string); @@ -40,6 +52,6 @@ d = C; // Error ~ -!!! Type 'typeof C' is not assignable to type 'new (x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt index b9e63626e11..f002c70e90b 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt @@ -1,3 +1,31 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. + Property 'bar' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. + Property 'baz' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Derived' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Derived2' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts (8 errors) ==== // index signatures must be compatible in assignments @@ -15,19 +43,19 @@ a = b; // ok b = a; // error ~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: string]: Derived2; } a = b2; // ok b2 = a; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { class A { @@ -43,10 +71,9 @@ a1 = b1; // ok b1 = a1; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. class B2 extends A { [x: string]: Derived2; // ok @@ -56,37 +83,34 @@ a1 = b2; // ok b2 = a1; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. function foo() { var b3: { [x: string]: Derived; }; var a3: A; a3 = b3; // error ~~ -!!! Type '{ [x: string]: Derived; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'Derived' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. b3 = a3; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! Index signatures are incompatible: -!!! Type 'T' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b4: { [x: string]: Derived2; }; a3 = b4; // error ~~ -!!! Type '{ [x: string]: Derived2; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'Derived2' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b4 = a3; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'T' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt index e2ab94c037e..c322364280e 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt @@ -1,3 +1,31 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. + Property 'bar' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. + Property 'baz' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Derived' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Derived2' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts (8 errors) ==== // index signatures must be compatible in assignments @@ -15,19 +43,19 @@ a = b; // ok b = a; // error ~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: string]: Derived2; } a = b2; // ok b2 = a; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { interface A { @@ -43,10 +71,9 @@ a1 = b1; // ok b1 = a1; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. interface B2 extends A { [x: string]: Derived2; // ok @@ -56,37 +83,34 @@ a1 = b2; // ok b2 = a1; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'Base' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. function foo() { var b3: { [x: string]: Derived; }; var a3: A; a3 = b3; // error ~~ -!!! Type '{ [x: string]: Derived; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'Derived' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. b3 = a3; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! Index signatures are incompatible: -!!! Type 'T' is not assignable to type 'Derived': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b4: { [x: string]: Derived2; }; a3 = b4; // error ~~ -!!! Type '{ [x: string]: Derived2; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'Derived2' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b4 = a3; // error ~~ -!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! Index signatures are incompatible: -!!! Type 'T' is not assignable to type 'Derived2': -!!! Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt index f4f6dd269f8..a31b2ef3025 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt @@ -1,3 +1,12 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(7,8): error TS2304: Cannot find name 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(20,9): error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'string' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: string; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'string'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts (3 errors) ==== // Derived type indexer must be subtype of base type indexer @@ -7,7 +16,7 @@ var a: A; ~ -!!! Cannot find name 'A'. +!!! error TS2304: Cannot find name 'A'. var b1: { [x: string]: string; } a = b1; // error b1 = a; // error @@ -22,13 +31,13 @@ var b: { [x: string]: string; } a = b; // error ~ -!!! Type '{ [x: string]: string; }' is not assignable to type 'A': -!!! Index signatures are incompatible: -!!! Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'T'. b = a; // error ~ -!!! Type 'A' is not assignable to type '{ [x: string]: string; }': -!!! Index signatures are incompatible: -!!! Type 'T' is not assignable to type 'string'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability10.errors.txt b/tests/baselines/reference/assignmentCompatability10.errors.txt index 25f76e83c07..883bf1c277c 100644 --- a/tests/baselines/reference/assignmentCompatability10.errors.txt +++ b/tests/baselines/reference/assignmentCompatability10.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional'. + Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithPublicAndOptional'. + + ==== tests/cases/compiler/assignmentCompatability10.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,5 +13,5 @@ } __test2__.__val__x4 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional': -!!! Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional'. +!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability11.errors.txt b/tests/baselines/reference/assignmentCompatability11.errors.txt index d56d0c3adce..21d49c6d3ae 100644 --- a/tests/baselines/reference/assignmentCompatability11.errors.txt +++ b/tests/baselines/reference/assignmentCompatability11.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/assignmentCompatability11.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,6 +14,6 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': -!!! Types of property 'two' are incompatible: -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability12.errors.txt b/tests/baselines/reference/assignmentCompatability12.errors.txt index af8b57365b4..07b65bdc463 100644 --- a/tests/baselines/reference/assignmentCompatability12.errors.txt +++ b/tests/baselines/reference/assignmentCompatability12.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/assignmentCompatability12.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,6 +14,6 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability13.errors.txt b/tests/baselines/reference/assignmentCompatability13.errors.txt index 5cdfab0b13c..ea7e62c422f 100644 --- a/tests/baselines/reference/assignmentCompatability13.errors.txt +++ b/tests/baselines/reference/assignmentCompatability13.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. + Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. + + ==== tests/cases/compiler/assignmentCompatability13.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,5 +13,5 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': -!!! Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. +!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability14.errors.txt b/tests/baselines/reference/assignmentCompatability14.errors.txt index 96b23b20dd5..2ba77622f33 100644 --- a/tests/baselines/reference/assignmentCompatability14.errors.txt +++ b/tests/baselines/reference/assignmentCompatability14.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'boolean'. + + ==== tests/cases/compiler/assignmentCompatability14.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,6 +14,6 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability15.errors.txt b/tests/baselines/reference/assignmentCompatability15.errors.txt index 962b87624ba..c56719d0895 100644 --- a/tests/baselines/reference/assignmentCompatability15.errors.txt +++ b/tests/baselines/reference/assignmentCompatability15.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'boolean'. + + ==== tests/cases/compiler/assignmentCompatability15.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,6 +14,6 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }': -!!! Types of property 'two' are incompatible: -!!! Type 'string' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability16.errors.txt b/tests/baselines/reference/assignmentCompatability16.errors.txt index 0e8b5b045a6..266d72b3232 100644 --- a/tests/baselines/reference/assignmentCompatability16.errors.txt +++ b/tests/baselines/reference/assignmentCompatability16.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'any[]'. + Property 'length' is missing in type 'Number'. + + ==== tests/cases/compiler/assignmentCompatability16.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability17.errors.txt b/tests/baselines/reference/assignmentCompatability17.errors.txt index ddf7bddabf8..b37f39d082f 100644 --- a/tests/baselines/reference/assignmentCompatability17.errors.txt +++ b/tests/baselines/reference/assignmentCompatability17.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'any[]'. + Property 'push' is missing in type 'String'. + + ==== tests/cases/compiler/assignmentCompatability17.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }': -!!! Types of property 'two' are incompatible: -!!! Type 'string' is not assignable to type 'any[]': -!!! Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'any[]'. +!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability18.errors.txt b/tests/baselines/reference/assignmentCompatability18.errors.txt index 26f5fa6ede1..2be4a037575 100644 --- a/tests/baselines/reference/assignmentCompatability18.errors.txt +++ b/tests/baselines/reference/assignmentCompatability18.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'number[]'. + Property 'length' is missing in type 'Number'. + + ==== tests/cases/compiler/assignmentCompatability18.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'number[]': -!!! Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability19.errors.txt b/tests/baselines/reference/assignmentCompatability19.errors.txt index cdfcf84aae9..ae97af6aa7e 100644 --- a/tests/baselines/reference/assignmentCompatability19.errors.txt +++ b/tests/baselines/reference/assignmentCompatability19.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'number[]'. + Property 'push' is missing in type 'String'. + + ==== tests/cases/compiler/assignmentCompatability19.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }': -!!! Types of property 'two' are incompatible: -!!! Type 'string' is not assignable to type 'number[]': -!!! Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number[]'. +!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability20.errors.txt b/tests/baselines/reference/assignmentCompatability20.errors.txt index 0a198da5523..750310ac5cc 100644 --- a/tests/baselines/reference/assignmentCompatability20.errors.txt +++ b/tests/baselines/reference/assignmentCompatability20.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'string[]'. + Property 'length' is missing in type 'Number'. + + ==== tests/cases/compiler/assignmentCompatability20.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'string[]': -!!! Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability21.errors.txt b/tests/baselines/reference/assignmentCompatability21.errors.txt index e8785413e05..8da52fe42c6 100644 --- a/tests/baselines/reference/assignmentCompatability21.errors.txt +++ b/tests/baselines/reference/assignmentCompatability21.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'string[]'. + Property 'push' is missing in type 'String'. + + ==== tests/cases/compiler/assignmentCompatability21.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }': -!!! Types of property 'two' are incompatible: -!!! Type 'string' is not assignable to type 'string[]': -!!! Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'string[]'. +!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability22.errors.txt b/tests/baselines/reference/assignmentCompatability22.errors.txt index 6497d477102..f0799a92f5c 100644 --- a/tests/baselines/reference/assignmentCompatability22.errors.txt +++ b/tests/baselines/reference/assignmentCompatability22.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'boolean[]'. + Property 'length' is missing in type 'Number'. + + ==== tests/cases/compiler/assignmentCompatability22.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'boolean[]': -!!! Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability23.errors.txt b/tests/baselines/reference/assignmentCompatability23.errors.txt index 88f13a2ffc2..a005eaa02d1 100644 --- a/tests/baselines/reference/assignmentCompatability23.errors.txt +++ b/tests/baselines/reference/assignmentCompatability23.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'boolean[]'. + Property 'push' is missing in type 'String'. + + ==== tests/cases/compiler/assignmentCompatability23.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }': -!!! Types of property 'two' are incompatible: -!!! Type 'string' is not assignable to type 'boolean[]': -!!! Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'boolean[]'. +!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability24.errors.txt b/tests/baselines/reference/assignmentCompatability24.errors.txt index 70a6717b9b7..0f4a535d413 100644 --- a/tests/baselines/reference/assignmentCompatability24.errors.txt +++ b/tests/baselines/reference/assignmentCompatability24.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. + + ==== tests/cases/compiler/assignmentCompatability24.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,4 +12,4 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability25.errors.txt b/tests/baselines/reference/assignmentCompatability25.errors.txt index bc3de672ea2..7f7e7f73ee0 100644 --- a/tests/baselines/reference/assignmentCompatability25.errors.txt +++ b/tests/baselines/reference/assignmentCompatability25.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/assignmentCompatability25.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,6 +14,6 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': -!!! Types of property 'two' are incompatible: -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability26.errors.txt b/tests/baselines/reference/assignmentCompatability26.errors.txt index 771ae72eb41..a005850e49c 100644 --- a/tests/baselines/reference/assignmentCompatability26.errors.txt +++ b/tests/baselines/reference/assignmentCompatability26.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/assignmentCompatability26.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,6 +14,6 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability27.errors.txt b/tests/baselines/reference/assignmentCompatability27.errors.txt index 26948fe97ea..180a51b3cf0 100644 --- a/tests/baselines/reference/assignmentCompatability27.errors.txt +++ b/tests/baselines/reference/assignmentCompatability27.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. + Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. + + ==== tests/cases/compiler/assignmentCompatability27.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,5 +13,5 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': -!!! Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. +!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability28.errors.txt b/tests/baselines/reference/assignmentCompatability28.errors.txt index 2b50a9b3596..2360d0b1e9d 100644 --- a/tests/baselines/reference/assignmentCompatability28.errors.txt +++ b/tests/baselines/reference/assignmentCompatability28.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'boolean'. + + ==== tests/cases/compiler/assignmentCompatability28.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,6 +14,6 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability29.errors.txt b/tests/baselines/reference/assignmentCompatability29.errors.txt index 937d5112007..194ae4ab675 100644 --- a/tests/baselines/reference/assignmentCompatability29.errors.txt +++ b/tests/baselines/reference/assignmentCompatability29.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'any[]'. + Property 'length' is missing in type 'Number'. + + ==== tests/cases/compiler/assignmentCompatability29.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'any[]': -!!! Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability30.errors.txt b/tests/baselines/reference/assignmentCompatability30.errors.txt index 08a8b313d30..b025705517c 100644 --- a/tests/baselines/reference/assignmentCompatability30.errors.txt +++ b/tests/baselines/reference/assignmentCompatability30.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'number[]'. + Property 'length' is missing in type 'Number'. + + ==== tests/cases/compiler/assignmentCompatability30.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'number[]': -!!! Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability31.errors.txt b/tests/baselines/reference/assignmentCompatability31.errors.txt index c620198e2ac..8e19905eba7 100644 --- a/tests/baselines/reference/assignmentCompatability31.errors.txt +++ b/tests/baselines/reference/assignmentCompatability31.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'string[]'. + Property 'length' is missing in type 'Number'. + + ==== tests/cases/compiler/assignmentCompatability31.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'string[]': -!!! Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability32.errors.txt b/tests/baselines/reference/assignmentCompatability32.errors.txt index a20461b25bd..6d6321f5e50 100644 --- a/tests/baselines/reference/assignmentCompatability32.errors.txt +++ b/tests/baselines/reference/assignmentCompatability32.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'boolean[]'. + Property 'length' is missing in type 'Number'. + + ==== tests/cases/compiler/assignmentCompatability32.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,7 +15,7 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'boolean[]': -!!! Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability33.errors.txt b/tests/baselines/reference/assignmentCompatability33.errors.txt index 3f9f4716f81..e2352625280 100644 --- a/tests/baselines/reference/assignmentCompatability33.errors.txt +++ b/tests/baselines/reference/assignmentCompatability33.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. + + ==== tests/cases/compiler/assignmentCompatability33.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,4 +12,4 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability34.errors.txt b/tests/baselines/reference/assignmentCompatability34.errors.txt index 1ae98d98d37..2dd9cba6470 100644 --- a/tests/baselines/reference/assignmentCompatability34.errors.txt +++ b/tests/baselines/reference/assignmentCompatability34.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. + + ==== tests/cases/compiler/assignmentCompatability34.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,4 +12,4 @@ } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability35.errors.txt b/tests/baselines/reference/assignmentCompatability35.errors.txt index ac6c09a8bec..faad78c10fc 100644 --- a/tests/baselines/reference/assignmentCompatability35.errors.txt +++ b/tests/baselines/reference/assignmentCompatability35.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }'. + Index signature is missing in type 'interfaceWithPublicAndOptional'. + + ==== tests/cases/compiler/assignmentCompatability35.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,5 +13,5 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }': -!!! Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }'. +!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability36.errors.txt b/tests/baselines/reference/assignmentCompatability36.errors.txt index acf5aa5344e..d8c43a3f363 100644 --- a/tests/baselines/reference/assignmentCompatability36.errors.txt +++ b/tests/baselines/reference/assignmentCompatability36.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }'. + Index signature is missing in type 'interfaceWithPublicAndOptional'. + + ==== tests/cases/compiler/assignmentCompatability36.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,5 +13,5 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }': -!!! Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }'. +!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability37.errors.txt b/tests/baselines/reference/assignmentCompatability37.errors.txt index f097e9664d3..452b72fe8ff 100644 --- a/tests/baselines/reference/assignmentCompatability37.errors.txt +++ b/tests/baselines/reference/assignmentCompatability37.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. + + ==== tests/cases/compiler/assignmentCompatability37.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,4 +12,4 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability38.errors.txt b/tests/baselines/reference/assignmentCompatability38.errors.txt index 9efa19b0338..5f7918374c1 100644 --- a/tests/baselines/reference/assignmentCompatability38.errors.txt +++ b/tests/baselines/reference/assignmentCompatability38.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. + + ==== tests/cases/compiler/assignmentCompatability38.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,4 +12,4 @@ } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability39.errors.txt b/tests/baselines/reference/assignmentCompatability39.errors.txt index f924512d461..6389a9ad87f 100644 --- a/tests/baselines/reference/assignmentCompatability39.errors.txt +++ b/tests/baselines/reference/assignmentCompatability39.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. + Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. + + ==== tests/cases/compiler/assignmentCompatability39.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,5 +13,5 @@ } __test2__.__val__x2 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic': -!!! Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. +!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability40.errors.txt b/tests/baselines/reference/assignmentCompatability40.errors.txt index db1948d7cb0..d60f7dcdeb6 100644 --- a/tests/baselines/reference/assignmentCompatability40.errors.txt +++ b/tests/baselines/reference/assignmentCompatability40.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. + Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. + + ==== tests/cases/compiler/assignmentCompatability40.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,5 +13,5 @@ } __test2__.__val__x5 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate': -!!! Private property 'one' cannot be reimplemented. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. +!!! error TS2322: Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability41.errors.txt b/tests/baselines/reference/assignmentCompatability41.errors.txt index e21dc1c8cd3..ad0b7b7cfe3 100644 --- a/tests/baselines/reference/assignmentCompatability41.errors.txt +++ b/tests/baselines/reference/assignmentCompatability41.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. + Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. + + ==== tests/cases/compiler/assignmentCompatability41.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,5 +13,5 @@ } __test2__.__val__x6 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate': -!!! Private property 'one' cannot be reimplemented. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. +!!! error TS2322: Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability42.errors.txt b/tests/baselines/reference/assignmentCompatability42.errors.txt index 2258a85139e..e86b261e682 100644 --- a/tests/baselines/reference/assignmentCompatability42.errors.txt +++ b/tests/baselines/reference/assignmentCompatability42.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. + Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. + + ==== tests/cases/compiler/assignmentCompatability42.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,5 +13,5 @@ } __test2__.__val__x7 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate': -!!! Private property 'two' cannot be reimplemented. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. +!!! error TS2322: Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability43.errors.txt b/tests/baselines/reference/assignmentCompatability43.errors.txt index 1ab4e3dcef8..a1f596ef7e2 100644 --- a/tests/baselines/reference/assignmentCompatability43.errors.txt +++ b/tests/baselines/reference/assignmentCompatability43.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. + Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. + + ==== tests/cases/compiler/assignmentCompatability43.ts (1 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; @@ -9,5 +13,5 @@ } __test2__.__val__obj2 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo': -!!! Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. +!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. \ No newline at end of file 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 fdb719715eb..e5db4f9ab96 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,3 +1,18 @@ +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,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(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'. + Property 'apply' is missing in type 'Number'. +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(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(25,4): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Applicable'. + Property 'apply' is missing in type '{}'. + + ==== tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts (8 errors) ==== // 3.8.4 Assignment Compatibility @@ -10,20 +25,20 @@ // Should fail x = ''; ~ -!!! Type 'string' is not assignable to type 'Applicable': -!!! Property 'apply' is missing in type 'String'. +!!! error TS2322: Type 'string' is not assignable to type 'Applicable'. +!!! error TS2322: Property 'apply' is missing in type 'String'. x = ['']; ~ -!!! Type 'string[]' is not assignable to type 'Applicable': -!!! Property 'apply' is missing in type 'string[]'. +!!! error TS2322: Type 'string[]' is not assignable to type 'Applicable'. +!!! error TS2322: Property 'apply' is missing in type 'string[]'. x = 4; ~ -!!! Type 'number' is not assignable to type 'Applicable': -!!! Property 'apply' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'Applicable'. +!!! error TS2322: Property 'apply' is missing in type 'Number'. x = {}; ~ -!!! Type '{}' is not assignable to type 'Applicable': -!!! Property 'apply' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'Applicable'. +!!! error TS2322: Property 'apply' is missing in type '{}'. // Should work function f() { }; @@ -34,17 +49,17 @@ // Should Fail fn(''); ~~ -!!! Argument of type 'string' is not assignable to parameter of type 'Applicable'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'. fn(['']); ~~~~ -!!! Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. +!!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. fn(4); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'Applicable'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Applicable'. fn({}); ~~ -!!! Argument of type '{}' is not assignable to parameter of type 'Applicable'. -!!! Property 'apply' is missing in type '{}'. +!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'Applicable'. +!!! error TS2345: Property 'apply' is missing in type '{}'. // Should work 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 91c3cee4293..f3ff6f1b792 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,3 +1,18 @@ +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,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(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'. + Property 'call' is missing in type 'Number'. +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(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(25,4): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Callable'. + Property 'call' is missing in type '{}'. + + ==== tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts (8 errors) ==== // 3.8.4 Assignment Compatibility @@ -10,20 +25,20 @@ // Should fail x = ''; ~ -!!! Type 'string' is not assignable to type 'Callable': -!!! Property 'call' is missing in type 'String'. +!!! error TS2322: Type 'string' is not assignable to type 'Callable'. +!!! error TS2322: Property 'call' is missing in type 'String'. x = ['']; ~ -!!! Type 'string[]' is not assignable to type 'Callable': -!!! Property 'call' is missing in type 'string[]'. +!!! error TS2322: Type 'string[]' is not assignable to type 'Callable'. +!!! error TS2322: Property 'call' is missing in type 'string[]'. x = 4; ~ -!!! Type 'number' is not assignable to type 'Callable': -!!! Property 'call' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'Callable'. +!!! error TS2322: Property 'call' is missing in type 'Number'. x = {}; ~ -!!! Type '{}' is not assignable to type 'Callable': -!!! Property 'call' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'Callable'. +!!! error TS2322: Property 'call' is missing in type '{}'. // Should work function f() { }; @@ -34,17 +49,17 @@ // Should Fail fn(''); ~~ -!!! Argument of type 'string' is not assignable to parameter of type 'Callable'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'. fn(['']); ~~~~ -!!! Argument of type 'string[]' is not assignable to parameter of type 'Callable'. +!!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'. fn(4); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'Callable'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Callable'. fn({}); ~~ -!!! Argument of type '{}' is not assignable to parameter of type 'Callable'. -!!! Property 'call' is missing in type '{}'. +!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'Callable'. +!!! error TS2345: Property 'call' is missing in type '{}'. // Should work diff --git a/tests/baselines/reference/assignmentLHSIsValue.errors.txt b/tests/baselines/reference/assignmentLHSIsValue.errors.txt index 90e6a7e3dc2..2f65b368532 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/assignmentLHSIsValue.errors.txt @@ -1,3 +1,45 @@ +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(35,9): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(42,36): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(44,19): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(46,27): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(50,20): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(51,11): error TS1005: ';' expected. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(6,21): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(7,13): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(8,21): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(11,18): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(13,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(17,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(19,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(22,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(24,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(27,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(28,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(29,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(30,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(31,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(32,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(38,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(42,30): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(44,13): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(46,21): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(54,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(57,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(58,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(59,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(60,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(61,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(62,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(63,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(64,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(65,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(66,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(67,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(68,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(69,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(70,1): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts (40 errors) ==== // expected error for all the LHS of assignments var value; @@ -6,146 +48,146 @@ class C { constructor() { this = value; } ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. foo() { this = value; } ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. static sfoo() { this = value; } ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } function foo() { this = value; } ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. this = value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. // identifiers: module, class, enum, function module M { export var a; } M = value; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. C = value; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. enum E { } E = value; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. foo = value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. // literals null = value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. true = value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. false = value; ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. 0 = value; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. '' = value; ~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. /d+/ = value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. // object literals { a: 0} = value; ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. // array literals ['', ''] = value; ~~~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. // super class Derived extends C { constructor() { super(); super = value; } ~ -!!! 'super' must be followed by an argument list or member access. +!!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. foo() { super = value } ~ -!!! 'super' must be followed by an argument list or member access. +!!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. static sfoo() { super = value; } ~ -!!! 'super' must be followed by an argument list or member access. +!!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } // function expression function bar() { } = value; ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. () => { } = value; ~ -!!! ';' expected. +!!! error TS1005: ';' expected. // function calls foo() = value; ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. // parentheses, the containted expression is value (this) = value; ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (M) = value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (C) = value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (E) = value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (foo) = value; ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (null) = value; ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (true) = value; ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (0) = value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. ('') = value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (/d+/) = value; ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. ({}) = value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. ([]) = value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (function baz() { }) = value; ~~~~~~~~~~~~~~~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (foo()) = value; ~~~~~~~ -!!! Invalid left-hand side of assignment expression. \ No newline at end of file +!!! error TS2364: Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentStricterConstraints.errors.txt b/tests/baselines/reference/assignmentStricterConstraints.errors.txt index 37b4de1bfa5..bf3751dda74 100644 --- a/tests/baselines/reference/assignmentStricterConstraints.errors.txt +++ b/tests/baselines/reference/assignmentStricterConstraints.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/assignmentStricterConstraints.ts(1,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/assignmentStricterConstraints.ts(2,5): error TS2322: Type 'S' is not assignable to type 'T'. + + ==== tests/cases/compiler/assignmentStricterConstraints.ts (2 errors) ==== var f = function (x: T, y: S): void { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y ~ -!!! Type 'S' is not assignable to type 'T'. +!!! error TS2322: Type 'S' is not assignable to type 'T'. } var g = function (x: T, y: S): void { } diff --git a/tests/baselines/reference/assignmentToFunction.errors.txt b/tests/baselines/reference/assignmentToFunction.errors.txt index 0e5d9351f29..b9a2f1f2675 100644 --- a/tests/baselines/reference/assignmentToFunction.errors.txt +++ b/tests/baselines/reference/assignmentToFunction.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/assignmentToFunction.ts(2,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/compiler/assignmentToFunction.ts(8,9): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/compiler/assignmentToFunction.ts (2 errors) ==== function fn() { } fn = () => 3; ~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. module foo { function xyz() { @@ -10,6 +14,6 @@ } bar = null; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToObject.errors.txt b/tests/baselines/reference/assignmentToObject.errors.txt index 13f7725ff38..aa1222bd799 100644 --- a/tests/baselines/reference/assignmentToObject.errors.txt +++ b/tests/baselines/reference/assignmentToObject.errors.txt @@ -1,9 +1,14 @@ +tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type 'number' is not assignable to type '() => string'. + + ==== tests/cases/compiler/assignmentToObject.ts (1 errors) ==== var a = { toString: 5 }; var b: {} = a; // ok var c: Object = a; // should be error ~ -!!! Type '{ toString: number; }' is not assignable to type 'Object': -!!! Types of property 'toString' are incompatible: -!!! Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type '() => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt index fb5aeac1bca..2e85ee101f5 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt +++ b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt @@ -1,9 +1,19 @@ +tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type 'number' is not assignable to type '() => string'. +tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function'. + Property 'apply' is missing in type '{}'. +tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function'. + Types of property 'apply' are incompatible. + Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. + + ==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ==== var errObj: Object = { toString: 0 }; // Error, incompatible toString ~~~~~~ -!!! Type '{ toString: number; }' is not assignable to type 'Object': -!!! Types of property 'toString' are incompatible: -!!! Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type '() => string'. var goodObj: Object = { toString(x?) { return ""; @@ -12,8 +22,8 @@ var errFun: Function = {}; // Error for no call signature ~~~~~~ -!!! Type '{}' is not assignable to type 'Function': -!!! Property 'apply' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'Function'. +!!! error TS2322: Property 'apply' is missing in type '{}'. function foo() { } module foo { @@ -36,6 +46,6 @@ var badFundule: Function = bad; // error ~~~~~~~~~~ -!!! Type 'typeof bad' is not assignable to type 'Function': -!!! Types of property 'apply' are incompatible: -!!! Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. \ No newline at end of file +!!! error TS2322: Type 'typeof bad' is not assignable to type 'Function'. +!!! error TS2322: Types of property 'apply' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt index 3d56ed9d18b..0b1b1e04de8 100644 --- a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,1): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/compiler/assignmentToParenthesizedExpression1.ts (1 errors) ==== var x; (1, x)=0; ~~~~~~ -!!! Invalid left-hand side of assignment expression. \ No newline at end of file +!!! error TS2364: Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt index 95e9d44ee4d..a50ffdf72d7 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt @@ -1,13 +1,45 @@ +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(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. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. + Types of property 'x' are incompatible. + 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(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. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(70,1): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts (24 errors) ==== var x: number; x = 3; // OK (x) = 3; // OK x = ''; // Error ~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (x) = ''; // Error ~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. module M { export var y: number; @@ -17,20 +49,20 @@ (M.y) = 3; // OK M.y = ''; // Error ~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M).y = ''; // Error ~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M.y) = ''; // Error ~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. M = { y: 3 }; // Error ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (M) = { y: 3 }; // Error ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. module M2 { export module M3 { @@ -39,7 +71,7 @@ M3 = { x: 3 }; // Error ~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } M2.M3 = { x: 3 }; // OK (M2).M3 = { x: 3 }; // OK @@ -47,60 +79,60 @@ M2.M3 = { x: '' }; // Error ~~~~~ -!!! Type '{ x: string; }' is not assignable to type 'typeof M3': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M2).M3 = { x: '' }; // Error ~~~~~~~ -!!! Type '{ x: string; }' is not assignable to type 'typeof M3': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M2.M3) = { x: '' }; // Error ~~~~~~~ -!!! Type '{ x: string; }' is not assignable to type 'typeof M3': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. function fn() { } fn = () => 3; // Bug 823548: Should be error (fn is not a reference) ~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (fn) = () => 3; // Should be error ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. function fn2(x: number, y: { t: number }) { x = 3; (x) = 3; // OK x = ''; // Error ~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (x) = ''; // Error ~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y).t = 3; // OK (y.t) = 3; // OK (y).t = ''; // Error ~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y.t) = ''; // Error ~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. y['t'] = 3; // OK (y)['t'] = 3; // OK (y['t']) = 3; // OK y['t'] = ''; // Error ~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y)['t'] = ''; // Error ~~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y['t']) = ''; // Error ~~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. } enum E { @@ -108,10 +140,10 @@ } E = undefined; // Error ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (E) = undefined; // Error ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. class C { @@ -119,8 +151,8 @@ C = undefined; // Error ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (C) = undefined; // Error ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToReferenceTypes.errors.txt b/tests/baselines/reference/assignmentToReferenceTypes.errors.txt index b67b5b075e4..56d6adc4149 100644 --- a/tests/baselines/reference/assignmentToReferenceTypes.errors.txt +++ b/tests/baselines/reference/assignmentToReferenceTypes.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/assignmentToReferenceTypes.ts(5,1): error TS2304: Cannot find name 'M'. +tests/cases/compiler/assignmentToReferenceTypes.ts(9,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/compiler/assignmentToReferenceTypes.ts(13,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/compiler/assignmentToReferenceTypes.ts(16,1): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/compiler/assignmentToReferenceTypes.ts (4 errors) ==== // Should all be allowed @@ -5,24 +11,24 @@ } M = null; ~ -!!! Cannot find name 'M'. +!!! error TS2304: Cannot find name 'M'. class C { } C = null; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. enum E { } E = null; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. function f() { } f = null; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. var x = 1; x = null; diff --git a/tests/baselines/reference/assignments.errors.txt b/tests/baselines/reference/assignments.errors.txt index 5671c58d5b2..9f89863f31f 100644 --- a/tests/baselines/reference/assignments.errors.txt +++ b/tests/baselines/reference/assignments.errors.txt @@ -1,3 +1,11 @@ +tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(11,1): error TS2304: Cannot find name 'M'. +tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(14,1): error TS2364: Invalid left-hand side of assignment expression. +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 TS2364: Invalid left-hand side of assignment expression. +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 (6 errors) ==== // In this file: // Assign to a module @@ -11,25 +19,25 @@ module M { } M = null; // Error ~ -!!! Cannot find name 'M'. +!!! error TS2304: Cannot find name 'M'. class C { } C = null; // Error ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. enum E { A } E = null; // Error ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. E.A = null; // OK per spec, Error per implementation (509581) ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. function fn() { } fn = null; // Should be error ~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. var v; v = null; // OK @@ -41,4 +49,4 @@ interface I { } I = null; // Error ~ -!!! Cannot find name 'I'. \ No newline at end of file +!!! error TS2304: Cannot find name 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt b/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt index 96306db9e3d..bc83e3e4dfa 100644 --- a/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt +++ b/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/augmentedClassWithPrototypePropertyOnModule.ts(3,9): error TS2300: Duplicate identifier 'prototype'. + + ==== tests/cases/compiler/augmentedClassWithPrototypePropertyOnModule.ts (1 errors) ==== declare module m { var f; var prototype; // This should be error since prototype would be static property on class m ~~~~~~~~~ -!!! Duplicate identifier 'prototype'. +!!! error TS2300: Duplicate identifier 'prototype'. } declare class m { } \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt index 4222ab54b15..a951a2b1a66 100644 --- a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }'. + Index signature is missing in type '{}'. +tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'. + Index signature is missing in type '() => void'. + + ==== tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts (2 errors) ==== interface Foo { a } interface Bar { b } @@ -15,14 +21,14 @@ var v1: { ~~ -!!! Type '{}' is not assignable to type '{ [x: number]: Foo; }': -!!! Index signature is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }'. +!!! error TS2322: Index signature is missing in type '{}'. [n: number]: Foo } = o; // Should be allowed var v2: { ~~ -!!! Type '() => void' is not assignable to type '{ [x: number]: Bar; }': -!!! Index signature is missing in type '() => void'. +!!! error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'. +!!! error TS2322: Index signature is missing in type '() => void'. [n: number]: Bar } = f; // Should be allowed \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesClass.errors.txt b/tests/baselines/reference/augmentedTypesClass.errors.txt index ee05d113767..2ff6889e22f 100644 --- a/tests/baselines/reference/augmentedTypesClass.errors.txt +++ b/tests/baselines/reference/augmentedTypesClass.errors.txt @@ -1,12 +1,22 @@ -==== tests/cases/compiler/augmentedTypesClass.ts (2 errors) ==== +tests/cases/compiler/augmentedTypesClass.ts(2,7): error TS2300: Duplicate identifier 'c1'. +tests/cases/compiler/augmentedTypesClass.ts(3,5): error TS2300: Duplicate identifier 'c1'. +tests/cases/compiler/augmentedTypesClass.ts(6,7): error TS2300: Duplicate identifier 'c4'. +tests/cases/compiler/augmentedTypesClass.ts(7,6): error TS2300: Duplicate identifier 'c4'. + + +==== tests/cases/compiler/augmentedTypesClass.ts (4 errors) ==== //// class then var class c1 { public foo() { } } + ~~ +!!! error TS2300: Duplicate identifier 'c1'. var c1 = 1; // error ~~ -!!! Duplicate identifier 'c1'. +!!! error TS2300: Duplicate identifier 'c1'. //// class then enum class c4 { public foo() { } } + ~~ +!!! error TS2300: Duplicate identifier 'c4'. enum c4 { One } // error ~~ -!!! Duplicate identifier 'c4'. \ No newline at end of file +!!! error TS2300: Duplicate identifier 'c4'. \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesClass2.errors.txt b/tests/baselines/reference/augmentedTypesClass2.errors.txt index 7216ac604c7..5881e49dae9 100644 --- a/tests/baselines/reference/augmentedTypesClass2.errors.txt +++ b/tests/baselines/reference/augmentedTypesClass2.errors.txt @@ -1,8 +1,16 @@ -==== tests/cases/compiler/augmentedTypesClass2.ts (2 errors) ==== +tests/cases/compiler/augmentedTypesClass2.ts(4,7): error TS2300: Duplicate identifier 'c11'. +tests/cases/compiler/augmentedTypesClass2.ts(10,11): error TS2300: Duplicate identifier 'c11'. +tests/cases/compiler/augmentedTypesClass2.ts(16,7): error TS2300: Duplicate identifier 'c33'. +tests/cases/compiler/augmentedTypesClass2.ts(21,6): error TS2300: Duplicate identifier 'c33'. + + +==== tests/cases/compiler/augmentedTypesClass2.ts (4 errors) ==== // Checking class with other things in type space not value space // class then interface - class c11 { + class c11 { // error + ~~~ +!!! error TS2300: Duplicate identifier 'c11'. foo() { return 1; } @@ -10,20 +18,22 @@ interface c11 { // error ~~~ -!!! Duplicate identifier 'c11'. +!!! error TS2300: Duplicate identifier 'c11'. bar(): void; } // class then class - covered // class then enum class c33 { + ~~~ +!!! error TS2300: Duplicate identifier 'c33'. foo() { return 1; } } enum c33 { One }; ~~~ -!!! Duplicate identifier 'c33'. +!!! error TS2300: Duplicate identifier 'c33'. // class then import class c44 { diff --git a/tests/baselines/reference/augmentedTypesClass2.js b/tests/baselines/reference/augmentedTypesClass2.js index b4df1672b69..f75c08a5920 100644 --- a/tests/baselines/reference/augmentedTypesClass2.js +++ b/tests/baselines/reference/augmentedTypesClass2.js @@ -2,7 +2,7 @@ // Checking class with other things in type space not value space // class then interface -class c11 { +class c11 { // error foo() { return 1; } diff --git a/tests/baselines/reference/augmentedTypesClass2a.errors.txt b/tests/baselines/reference/augmentedTypesClass2a.errors.txt index 16edf2fb577..b17ab32d408 100644 --- a/tests/baselines/reference/augmentedTypesClass2a.errors.txt +++ b/tests/baselines/reference/augmentedTypesClass2a.errors.txt @@ -1,9 +1,16 @@ -==== tests/cases/compiler/augmentedTypesClass2a.ts (2 errors) ==== +tests/cases/compiler/augmentedTypesClass2a.ts(2,7): error TS2300: Duplicate identifier 'c2'. +tests/cases/compiler/augmentedTypesClass2a.ts(3,10): error TS2300: Duplicate identifier 'c2'. +tests/cases/compiler/augmentedTypesClass2a.ts(4,5): error TS2300: Duplicate identifier 'c2'. + + +==== tests/cases/compiler/augmentedTypesClass2a.ts (3 errors) ==== //// class then function - class c2 { public foo() { } } + class c2 { public foo() { } } // error + ~~ +!!! error TS2300: Duplicate identifier 'c2'. function c2() { } // error ~~ -!!! Duplicate identifier 'c2'. +!!! error TS2300: Duplicate identifier 'c2'. var c2 = () => { } ~~ -!!! Duplicate identifier 'c2'. \ No newline at end of file +!!! error TS2300: Duplicate identifier 'c2'. \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesClass2a.js b/tests/baselines/reference/augmentedTypesClass2a.js index cca45c2c0b3..fe31f0964c2 100644 --- a/tests/baselines/reference/augmentedTypesClass2a.js +++ b/tests/baselines/reference/augmentedTypesClass2a.js @@ -1,6 +1,6 @@ //// [augmentedTypesClass2a.ts] //// class then function -class c2 { public foo() { } } +class c2 { public foo() { } } // error function c2() { } // error var c2 = () => { } @@ -12,7 +12,7 @@ var c2 = (function () { c2.prototype.foo = function () { }; return c2; -})(); +})(); // error function c2() { } // error var c2 = function () { diff --git a/tests/baselines/reference/augmentedTypesClass4.errors.txt b/tests/baselines/reference/augmentedTypesClass4.errors.txt index f909cd9c266..6df027ca511 100644 --- a/tests/baselines/reference/augmentedTypesClass4.errors.txt +++ b/tests/baselines/reference/augmentedTypesClass4.errors.txt @@ -1,7 +1,13 @@ -==== tests/cases/compiler/augmentedTypesClass4.ts (1 errors) ==== +tests/cases/compiler/augmentedTypesClass4.ts(2,7): error TS2300: Duplicate identifier 'c3'. +tests/cases/compiler/augmentedTypesClass4.ts(3,7): error TS2300: Duplicate identifier 'c3'. + + +==== tests/cases/compiler/augmentedTypesClass4.ts (2 errors) ==== //// class then class - class c3 { public foo() { } } + class c3 { public foo() { } } // error + ~~ +!!! error TS2300: Duplicate identifier 'c3'. class c3 { public bar() { } } // error ~~ -!!! Duplicate identifier 'c3'. +!!! error TS2300: Duplicate identifier 'c3'. \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesClass4.js b/tests/baselines/reference/augmentedTypesClass4.js index c4e104e714b..71fc61d6659 100644 --- a/tests/baselines/reference/augmentedTypesClass4.js +++ b/tests/baselines/reference/augmentedTypesClass4.js @@ -1,6 +1,6 @@ //// [augmentedTypesClass4.ts] //// class then class -class c3 { public foo() { } } +class c3 { public foo() { } } // error class c3 { public bar() { } } // error @@ -12,7 +12,7 @@ var c3 = (function () { c3.prototype.foo = function () { }; return c3; -})(); +})(); // error var c3 = (function () { function c3() { } diff --git a/tests/baselines/reference/augmentedTypesEnum.errors.txt b/tests/baselines/reference/augmentedTypesEnum.errors.txt index d888f170b5d..3102f9d4786 100644 --- a/tests/baselines/reference/augmentedTypesEnum.errors.txt +++ b/tests/baselines/reference/augmentedTypesEnum.errors.txt @@ -1,39 +1,63 @@ -==== tests/cases/compiler/augmentedTypesEnum.ts (7 errors) ==== +tests/cases/compiler/augmentedTypesEnum.ts(2,6): error TS2300: Duplicate identifier 'e1111'. +tests/cases/compiler/augmentedTypesEnum.ts(3,5): error TS2300: Duplicate identifier 'e1111'. +tests/cases/compiler/augmentedTypesEnum.ts(6,6): error TS2300: Duplicate identifier 'e2'. +tests/cases/compiler/augmentedTypesEnum.ts(7,10): error TS2300: Duplicate identifier 'e2'. +tests/cases/compiler/augmentedTypesEnum.ts(9,6): error TS2300: Duplicate identifier 'e3'. +tests/cases/compiler/augmentedTypesEnum.ts(10,5): error TS2300: Duplicate identifier 'e3'. +tests/cases/compiler/augmentedTypesEnum.ts(13,6): error TS2300: Duplicate identifier 'e4'. +tests/cases/compiler/augmentedTypesEnum.ts(14,7): error TS2300: Duplicate identifier 'e4'. +tests/cases/compiler/augmentedTypesEnum.ts(18,11): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +tests/cases/compiler/augmentedTypesEnum.ts(20,12): error TS2300: Duplicate identifier 'One'. +tests/cases/compiler/augmentedTypesEnum.ts(21,12): error TS2300: Duplicate identifier 'One'. +tests/cases/compiler/augmentedTypesEnum.ts(21,12): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. + + +==== tests/cases/compiler/augmentedTypesEnum.ts (12 errors) ==== // enum then var - enum e1111 { One } + enum e1111 { One } // error + ~~~~~ +!!! error TS2300: Duplicate identifier 'e1111'. var e1111 = 1; // error ~~~~~ -!!! Duplicate identifier 'e1111'. +!!! error TS2300: Duplicate identifier 'e1111'. // enum then function - enum e2 { One } + enum e2 { One } // error + ~~ +!!! error TS2300: Duplicate identifier 'e2'. function e2() { } // error ~~ -!!! Duplicate identifier 'e2'. +!!! error TS2300: Duplicate identifier 'e2'. - enum e3 { One } + enum e3 { One } // error + ~~ +!!! error TS2300: Duplicate identifier 'e3'. var e3 = () => { } // error ~~ -!!! Duplicate identifier 'e3'. +!!! error TS2300: Duplicate identifier 'e3'. // enum then class - enum e4 { One } + enum e4 { One } // error + ~~ +!!! error TS2300: Duplicate identifier 'e4'. class e4 { public foo() { } } // error ~~ -!!! Duplicate identifier 'e4'. +!!! error TS2300: Duplicate identifier 'e4'. // enum then enum enum e5 { One } - enum e5 { Two } + enum e5 { Two } // error ~~~ -!!! In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +!!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. - enum e5a { One } enum e5a { One } // error ~~~ -!!! Duplicate identifier 'One'. +!!! error TS2300: Duplicate identifier 'One'. + enum e5a { One } // error ~~~ -!!! In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +!!! error TS2300: Duplicate identifier 'One'. + ~~~ +!!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. // enum then internal module enum e6 { One } diff --git a/tests/baselines/reference/augmentedTypesEnum.js b/tests/baselines/reference/augmentedTypesEnum.js index 8422b99798b..f7a83018cfd 100644 --- a/tests/baselines/reference/augmentedTypesEnum.js +++ b/tests/baselines/reference/augmentedTypesEnum.js @@ -1,24 +1,24 @@ //// [augmentedTypesEnum.ts] // enum then var -enum e1111 { One } +enum e1111 { One } // error var e1111 = 1; // error // enum then function -enum e2 { One } +enum e2 { One } // error function e2() { } // error -enum e3 { One } +enum e3 { One } // error var e3 = () => { } // error // enum then class -enum e4 { One } +enum e4 { One } // error class e4 { public foo() { } } // error // enum then enum enum e5 { One } -enum e5 { Two } +enum e5 { Two } // error -enum e5a { One } +enum e5a { One } // error enum e5a { One } // error // enum then internal module @@ -40,26 +40,26 @@ module e6b { export var y = 2; } // should be error var e1111; (function (e1111) { e1111[e1111["One"] = 0] = "One"; -})(e1111 || (e1111 = {})); +})(e1111 || (e1111 = {})); // error var e1111 = 1; // error // enum then function var e2; (function (e2) { e2[e2["One"] = 0] = "One"; -})(e2 || (e2 = {})); +})(e2 || (e2 = {})); // error function e2() { } // error var e3; (function (e3) { e3[e3["One"] = 0] = "One"; -})(e3 || (e3 = {})); +})(e3 || (e3 = {})); // error var e3 = function () { }; // error // enum then class var e4; (function (e4) { e4[e4["One"] = 0] = "One"; -})(e4 || (e4 = {})); +})(e4 || (e4 = {})); // error var e4 = (function () { function e4() { } @@ -75,11 +75,11 @@ var e5; var e5; (function (e5) { e5[e5["Two"] = 0] = "Two"; -})(e5 || (e5 = {})); +})(e5 || (e5 = {})); // error var e5a; (function (e5a) { e5a[e5a["One"] = 0] = "One"; -})(e5a || (e5a = {})); +})(e5a || (e5a = {})); // error var e5a; (function (e5a) { e5a[e5a["One"] = 0] = "One"; diff --git a/tests/baselines/reference/augmentedTypesEnum2.errors.txt b/tests/baselines/reference/augmentedTypesEnum2.errors.txt index 06581cf182c..8c6c7382f85 100644 --- a/tests/baselines/reference/augmentedTypesEnum2.errors.txt +++ b/tests/baselines/reference/augmentedTypesEnum2.errors.txt @@ -1,20 +1,30 @@ -==== tests/cases/compiler/augmentedTypesEnum2.ts (2 errors) ==== +tests/cases/compiler/augmentedTypesEnum2.ts(2,6): error TS2300: Duplicate identifier 'e1'. +tests/cases/compiler/augmentedTypesEnum2.ts(4,11): error TS2300: Duplicate identifier 'e1'. +tests/cases/compiler/augmentedTypesEnum2.ts(11,6): error TS2300: Duplicate identifier 'e2'. +tests/cases/compiler/augmentedTypesEnum2.ts(12,7): error TS2300: Duplicate identifier 'e2'. + + +==== tests/cases/compiler/augmentedTypesEnum2.ts (4 errors) ==== // enum then interface - enum e1 { One } + enum e1 { One } // error + ~~ +!!! error TS2300: Duplicate identifier 'e1'. - interface e1 { + interface e1 { // error ~~ -!!! Duplicate identifier 'e1'. +!!! error TS2300: Duplicate identifier 'e1'. foo(): void; } // interface then enum works // enum then class - enum e2 { One }; + enum e2 { One }; // error + ~~ +!!! error TS2300: Duplicate identifier 'e2'. class e2 { // error ~~ -!!! Duplicate identifier 'e2'. +!!! error TS2300: Duplicate identifier 'e2'. foo() { return 1; } diff --git a/tests/baselines/reference/augmentedTypesEnum2.js b/tests/baselines/reference/augmentedTypesEnum2.js index 13656b33411..8ab98a7cb7b 100644 --- a/tests/baselines/reference/augmentedTypesEnum2.js +++ b/tests/baselines/reference/augmentedTypesEnum2.js @@ -1,15 +1,15 @@ //// [augmentedTypesEnum2.ts] // enum then interface -enum e1 { One } +enum e1 { One } // error -interface e1 { +interface e1 { // error foo(): void; } // interface then enum works // enum then class -enum e2 { One }; +enum e2 { One }; // error class e2 { // error foo() { return 1; @@ -24,7 +24,7 @@ class e2 { // error var e1; (function (e1) { e1[e1["One"] = 0] = "One"; -})(e1 || (e1 = {})); +})(e1 || (e1 = {})); // error // interface then enum works // enum then class var e2; diff --git a/tests/baselines/reference/augmentedTypesEnum3.errors.txt b/tests/baselines/reference/augmentedTypesEnum3.errors.txt index c9e7bca61d4..9ec4f4d81c5 100644 --- a/tests/baselines/reference/augmentedTypesEnum3.errors.txt +++ b/tests/baselines/reference/augmentedTypesEnum3.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/augmentedTypesEnum3.ts(16,5): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. + + ==== tests/cases/compiler/augmentedTypesEnum3.ts (1 errors) ==== module E { var t; @@ -16,7 +19,7 @@ enum A { c ~ -!!! In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +!!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. } module A { var p; diff --git a/tests/baselines/reference/augmentedTypesFunction.errors.txt b/tests/baselines/reference/augmentedTypesFunction.errors.txt index ab42d79d8f7..8d1ce671c9e 100644 --- a/tests/baselines/reference/augmentedTypesFunction.errors.txt +++ b/tests/baselines/reference/augmentedTypesFunction.errors.txt @@ -1,37 +1,63 @@ -==== tests/cases/compiler/augmentedTypesFunction.ts (6 errors) ==== +tests/cases/compiler/augmentedTypesFunction.ts(2,10): error TS2300: Duplicate identifier 'y1'. +tests/cases/compiler/augmentedTypesFunction.ts(3,5): error TS2300: Duplicate identifier 'y1'. +tests/cases/compiler/augmentedTypesFunction.ts(6,10): error TS2393: Duplicate function implementation. +tests/cases/compiler/augmentedTypesFunction.ts(7,10): error TS2393: Duplicate function implementation. +tests/cases/compiler/augmentedTypesFunction.ts(9,10): error TS2300: Duplicate identifier 'y2a'. +tests/cases/compiler/augmentedTypesFunction.ts(10,5): error TS2300: Duplicate identifier 'y2a'. +tests/cases/compiler/augmentedTypesFunction.ts(13,10): error TS2300: Duplicate identifier 'y3'. +tests/cases/compiler/augmentedTypesFunction.ts(14,7): error TS2300: Duplicate identifier 'y3'. +tests/cases/compiler/augmentedTypesFunction.ts(16,10): error TS2300: Duplicate identifier 'y3a'. +tests/cases/compiler/augmentedTypesFunction.ts(17,7): error TS2300: Duplicate identifier 'y3a'. +tests/cases/compiler/augmentedTypesFunction.ts(20,10): error TS2300: Duplicate identifier 'y4'. +tests/cases/compiler/augmentedTypesFunction.ts(21,6): error TS2300: Duplicate identifier 'y4'. + + +==== tests/cases/compiler/augmentedTypesFunction.ts (12 errors) ==== // function then var - function y1() { } + function y1() { } // error + ~~ +!!! error TS2300: Duplicate identifier 'y1'. var y1 = 1; // error ~~ -!!! Duplicate identifier 'y1'. +!!! error TS2300: Duplicate identifier 'y1'. // function then function - function y2() { } function y2() { } // error - ~~~~~~~~~~~~~~~~~ -!!! Duplicate function implementation. + ~~ +!!! error TS2393: Duplicate function implementation. + function y2() { } // error + ~~ +!!! error TS2393: Duplicate function implementation. - function y2a() { } + function y2a() { } // error + ~~~ +!!! error TS2300: Duplicate identifier 'y2a'. var y2a = () => { } // error ~~~ -!!! Duplicate identifier 'y2a'. +!!! error TS2300: Duplicate identifier 'y2a'. // function then class - function y3() { } + function y3() { } // error + ~~ +!!! error TS2300: Duplicate identifier 'y3'. class y3 { } // error ~~ -!!! Duplicate identifier 'y3'. +!!! error TS2300: Duplicate identifier 'y3'. - function y3a() { } + function y3a() { } // error + ~~~ +!!! error TS2300: Duplicate identifier 'y3a'. class y3a { public foo() { } } // error ~~~ -!!! Duplicate identifier 'y3a'. +!!! error TS2300: Duplicate identifier 'y3a'. // function then enum - function y4() { } + function y4() { } // error + ~~ +!!! error TS2300: Duplicate identifier 'y4'. enum y4 { One } // error ~~ -!!! Duplicate identifier 'y4'. +!!! error TS2300: Duplicate identifier 'y4'. // function then internal module function y5() { } diff --git a/tests/baselines/reference/augmentedTypesFunction.js b/tests/baselines/reference/augmentedTypesFunction.js index 097482c7c5b..078854e227c 100644 --- a/tests/baselines/reference/augmentedTypesFunction.js +++ b/tests/baselines/reference/augmentedTypesFunction.js @@ -1,24 +1,24 @@ //// [augmentedTypesFunction.ts] // function then var -function y1() { } +function y1() { } // error var y1 = 1; // error // function then function -function y2() { } +function y2() { } // error function y2() { } // error -function y2a() { } +function y2a() { } // error var y2a = () => { } // error // function then class -function y3() { } +function y3() { } // error class y3 { } // error -function y3a() { } +function y3a() { } // error class y3a { public foo() { } } // error // function then enum -function y4() { } +function y4() { } // error enum y4 { One } // error // function then internal module @@ -41,27 +41,27 @@ module y5c { export interface I { foo(): void } } // should be an error //// [augmentedTypesFunction.js] // function then var function y1() { -} +} // error var y1 = 1; // error // function then function function y2() { -} +} // error function y2() { } // error function y2a() { -} +} // error var y2a = function () { }; // error // function then class function y3() { -} +} // error var y3 = (function () { function y3() { } return y3; })(); // error function y3a() { -} +} // error var y3a = (function () { function y3a() { } @@ -71,7 +71,7 @@ var y3a = (function () { })(); // error // function then enum function y4() { -} +} // error var y4; (function (y4) { y4[y4["One"] = 0] = "One"; diff --git a/tests/baselines/reference/augmentedTypesInterface.errors.txt b/tests/baselines/reference/augmentedTypesInterface.errors.txt index e26c2648c32..a9fc28dd5ae 100644 --- a/tests/baselines/reference/augmentedTypesInterface.errors.txt +++ b/tests/baselines/reference/augmentedTypesInterface.errors.txt @@ -1,4 +1,10 @@ -==== tests/cases/compiler/augmentedTypesInterface.ts (2 errors) ==== +tests/cases/compiler/augmentedTypesInterface.ts(12,11): error TS2300: Duplicate identifier 'i2'. +tests/cases/compiler/augmentedTypesInterface.ts(16,7): error TS2300: Duplicate identifier 'i2'. +tests/cases/compiler/augmentedTypesInterface.ts(23,11): error TS2300: Duplicate identifier 'i3'. +tests/cases/compiler/augmentedTypesInterface.ts(26,6): error TS2300: Duplicate identifier 'i3'. + + +==== tests/cases/compiler/augmentedTypesInterface.ts (4 errors) ==== // interface then interface interface i { @@ -10,25 +16,29 @@ } // interface then class - interface i2 { + interface i2 { // error + ~~ +!!! error TS2300: Duplicate identifier 'i2'. foo(): void; } class i2 { // error ~~ -!!! Duplicate identifier 'i2'. +!!! error TS2300: Duplicate identifier 'i2'. bar() { return 1; } } // interface then enum - interface i3 { + interface i3 { // error + ~~ +!!! error TS2300: Duplicate identifier 'i3'. foo(): void; } enum i3 { One }; // error ~~ -!!! Duplicate identifier 'i3'. +!!! error TS2300: Duplicate identifier 'i3'. // interface then import interface i4 { diff --git a/tests/baselines/reference/augmentedTypesInterface.js b/tests/baselines/reference/augmentedTypesInterface.js index 5c68ba9a744..709b16d615c 100644 --- a/tests/baselines/reference/augmentedTypesInterface.js +++ b/tests/baselines/reference/augmentedTypesInterface.js @@ -10,7 +10,7 @@ interface i { } // interface then class -interface i2 { +interface i2 { // error foo(): void; } @@ -21,7 +21,7 @@ class i2 { // error } // interface then enum -interface i3 { +interface i3 { // error foo(): void; } enum i3 { One }; // error diff --git a/tests/baselines/reference/augmentedTypesModules.errors.txt b/tests/baselines/reference/augmentedTypesModules.errors.txt index 6975ee37159..980837a18ef 100644 --- a/tests/baselines/reference/augmentedTypesModules.errors.txt +++ b/tests/baselines/reference/augmentedTypesModules.errors.txt @@ -1,29 +1,46 @@ -==== tests/cases/compiler/augmentedTypesModules.ts (6 errors) ==== +tests/cases/compiler/augmentedTypesModules.ts(5,8): error TS2300: Duplicate identifier 'm1a'. +tests/cases/compiler/augmentedTypesModules.ts(6,5): error TS2300: Duplicate identifier 'm1a'. +tests/cases/compiler/augmentedTypesModules.ts(8,8): error TS2300: Duplicate identifier 'm1b'. +tests/cases/compiler/augmentedTypesModules.ts(9,5): error TS2300: Duplicate identifier 'm1b'. +tests/cases/compiler/augmentedTypesModules.ts(16,8): error TS2300: Duplicate identifier 'm1d'. +tests/cases/compiler/augmentedTypesModules.ts(19,5): error TS2300: Duplicate identifier 'm1d'. +tests/cases/compiler/augmentedTypesModules.ts(25,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules.ts(28,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules.ts(51,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged + + +==== tests/cases/compiler/augmentedTypesModules.ts (9 errors) ==== // module then var module m1 { } var m1 = 1; // Should be allowed - module m1a { var y = 2; } - var m1a = 1; + module m1a { var y = 2; } // error + ~~~ +!!! error TS2300: Duplicate identifier 'm1a'. + var m1a = 1; // error ~~~ -!!! Duplicate identifier 'm1a'. +!!! error TS2300: Duplicate identifier 'm1a'. - module m1b { export var y = 2; } - var m1b = 1; + module m1b { export var y = 2; } // error + ~~~ +!!! error TS2300: Duplicate identifier 'm1b'. + var m1b = 1; // error ~~~ -!!! Duplicate identifier 'm1b'. +!!! error TS2300: Duplicate identifier 'm1b'. module m1c { export interface I { foo(): void; } } var m1c = 1; // Should be allowed - module m1d { + module m1d { // error + ~~~ +!!! error TS2300: Duplicate identifier 'm1d'. export class I { foo() { } } } var m1d = 1; // error ~~~ -!!! Duplicate identifier 'm1d'. +!!! error TS2300: Duplicate identifier 'm1d'. // module then function module m2 { } @@ -31,12 +48,12 @@ module m2a { var y = 2; } ~~~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged function m2a() { }; // error since the module is instantiated module m2b { export var y = 2; } ~~~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged function m2b() { }; // error since the module is instantiated // should be errors to have function first @@ -61,7 +78,7 @@ module m3a { var y = 2; } ~~~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged class m3a { foo() { } } // error, class isn't ambient or declared before the module class m3b { foo() { } } diff --git a/tests/baselines/reference/augmentedTypesModules.js b/tests/baselines/reference/augmentedTypesModules.js index 5085b1cbda3..0c7967b2227 100644 --- a/tests/baselines/reference/augmentedTypesModules.js +++ b/tests/baselines/reference/augmentedTypesModules.js @@ -3,18 +3,18 @@ module m1 { } var m1 = 1; // Should be allowed -module m1a { var y = 2; } -var m1a = 1; +module m1a { var y = 2; } // error +var m1a = 1; // error -module m1b { export var y = 2; } -var m1b = 1; +module m1b { export var y = 2; } // error +var m1b = 1; // error module m1c { export interface I { foo(): void; } } var m1c = 1; // Should be allowed -module m1d { +module m1d { // error export class I { foo() { } } } var m1d = 1; // error @@ -102,13 +102,13 @@ var m1 = 1; // Should be allowed var m1a; (function (m1a) { var y = 2; -})(m1a || (m1a = {})); -var m1a = 1; +})(m1a || (m1a = {})); // error +var m1a = 1; // error var m1b; (function (m1b) { m1b.y = 2; -})(m1b || (m1b = {})); -var m1b = 1; +})(m1b || (m1b = {})); // error +var m1b = 1; // error var m1c = 1; // Should be allowed var m1d; (function (m1d) { diff --git a/tests/baselines/reference/augmentedTypesModules2.errors.txt b/tests/baselines/reference/augmentedTypesModules2.errors.txt index e25682fa39e..19c87a14913 100644 --- a/tests/baselines/reference/augmentedTypesModules2.errors.txt +++ b/tests/baselines/reference/augmentedTypesModules2.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/augmentedTypesModules2.ts(5,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules2.ts(8,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/augmentedTypesModules2.ts(14,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged + + ==== tests/cases/compiler/augmentedTypesModules2.ts (3 errors) ==== // module then function module m2 { } @@ -5,12 +10,12 @@ module m2a { var y = 2; } ~~~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged function m2a() { }; // error since the module is instantiated module m2b { export var y = 2; } ~~~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged function m2b() { }; // error since the module is instantiated function m2c() { }; @@ -18,7 +23,7 @@ module m2cc { export var y = 2; } ~~~~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged function m2cc() { }; // error to have module first module m2d { } diff --git a/tests/baselines/reference/augmentedTypesModules3.errors.txt b/tests/baselines/reference/augmentedTypesModules3.errors.txt index aa5bc0336a4..e264c74463c 100644 --- a/tests/baselines/reference/augmentedTypesModules3.errors.txt +++ b/tests/baselines/reference/augmentedTypesModules3.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/augmentedTypesModules3.ts(5,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged + + ==== tests/cases/compiler/augmentedTypesModules3.ts (1 errors) ==== //// module then class module m3 { } @@ -5,5 +8,5 @@ module m3a { var y = 2; } ~~~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged class m3a { foo() { } } // error, class isn't ambient or declared before the module \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesVar.errors.txt b/tests/baselines/reference/augmentedTypesVar.errors.txt index 6edbb52ec50..24c194d25c3 100644 --- a/tests/baselines/reference/augmentedTypesVar.errors.txt +++ b/tests/baselines/reference/augmentedTypesVar.errors.txt @@ -1,49 +1,76 @@ -==== tests/cases/compiler/augmentedTypesVar.ts (7 errors) ==== +tests/cases/compiler/augmentedTypesVar.ts(6,5): error TS2300: Duplicate identifier 'x2'. +tests/cases/compiler/augmentedTypesVar.ts(7,10): error TS2300: Duplicate identifier 'x2'. +tests/cases/compiler/augmentedTypesVar.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'. +tests/cases/compiler/augmentedTypesVar.ts(13,5): error TS2300: Duplicate identifier 'x4'. +tests/cases/compiler/augmentedTypesVar.ts(14,7): error TS2300: Duplicate identifier 'x4'. +tests/cases/compiler/augmentedTypesVar.ts(16,5): error TS2300: Duplicate identifier 'x4a'. +tests/cases/compiler/augmentedTypesVar.ts(17,7): error TS2300: Duplicate identifier 'x4a'. +tests/cases/compiler/augmentedTypesVar.ts(20,5): error TS2300: Duplicate identifier 'x5'. +tests/cases/compiler/augmentedTypesVar.ts(21,6): error TS2300: Duplicate identifier 'x5'. +tests/cases/compiler/augmentedTypesVar.ts(27,5): error TS2300: Duplicate identifier 'x6a'. +tests/cases/compiler/augmentedTypesVar.ts(28,8): error TS2300: Duplicate identifier 'x6a'. +tests/cases/compiler/augmentedTypesVar.ts(30,5): error TS2300: Duplicate identifier 'x6b'. +tests/cases/compiler/augmentedTypesVar.ts(31,8): error TS2300: Duplicate identifier 'x6b'. + + +==== tests/cases/compiler/augmentedTypesVar.ts (13 errors) ==== // var then var var x1 = 1; var x1 = 2; // var then function - var x2 = 1; - function x2() { } // should be an error - ~~ -!!! Duplicate identifier 'x2'. - - var x3 = 1; - var x3 = () => { } // should be an error + var x2 = 1; // error ~~ -!!! Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'. +!!! error TS2300: Duplicate identifier 'x2'. + function x2() { } // error + ~~ +!!! error TS2300: Duplicate identifier 'x2'. + + var x3 = 1; + var x3 = () => { } // error + ~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'. // var then class - var x4 = 1; + var x4 = 1; // error + ~~ +!!! error TS2300: Duplicate identifier 'x4'. class x4 { } // error ~~ -!!! Duplicate identifier 'x4'. +!!! error TS2300: Duplicate identifier 'x4'. - var x4a = 1; + var x4a = 1; // error + ~~~ +!!! error TS2300: Duplicate identifier 'x4a'. class x4a { public foo() { } } // error ~~~ -!!! Duplicate identifier 'x4a'. +!!! error TS2300: Duplicate identifier 'x4a'. // var then enum var x5 = 1; + ~~ +!!! error TS2300: Duplicate identifier 'x5'. enum x5 { One } // error ~~ -!!! Duplicate identifier 'x5'. +!!! error TS2300: Duplicate identifier 'x5'. // var then module var x6 = 1; module x6 { } // ok since non-instantiated - var x6a = 1; + var x6a = 1; // error + ~~~ +!!! error TS2300: Duplicate identifier 'x6a'. module x6a { var y = 2; } // error since instantiated ~~~ -!!! Duplicate identifier 'x6a'. +!!! error TS2300: Duplicate identifier 'x6a'. - var x6b = 1; + var x6b = 1; // error + ~~~ +!!! error TS2300: Duplicate identifier 'x6b'. module x6b { export var y = 2; } // error ~~~ -!!! Duplicate identifier 'x6b'. +!!! error TS2300: Duplicate identifier 'x6b'. // var then import, messes with other error reporting //var x7 = 1; diff --git a/tests/baselines/reference/augmentedTypesVar.js b/tests/baselines/reference/augmentedTypesVar.js index ca50b8ab9a9..4735d647056 100644 --- a/tests/baselines/reference/augmentedTypesVar.js +++ b/tests/baselines/reference/augmentedTypesVar.js @@ -4,17 +4,17 @@ var x1 = 1; var x1 = 2; // var then function -var x2 = 1; -function x2() { } // should be an error +var x2 = 1; // error +function x2() { } // error -var x3 = 1; -var x3 = () => { } // should be an error +var x3 = 1; +var x3 = () => { } // error // var then class -var x4 = 1; +var x4 = 1; // error class x4 { } // error -var x4a = 1; +var x4a = 1; // error class x4a { public foo() { } } // error // var then enum @@ -25,10 +25,10 @@ enum x5 { One } // error var x6 = 1; module x6 { } // ok since non-instantiated -var x6a = 1; +var x6a = 1; // error module x6a { var y = 2; } // error since instantiated -var x6b = 1; +var x6b = 1; // error module x6b { export var y = 2; } // error // var then import, messes with other error reporting @@ -41,20 +41,20 @@ module x6b { export var y = 2; } // error var x1 = 1; var x1 = 2; // var then function -var x2 = 1; +var x2 = 1; // error function x2() { -} // should be an error +} // error var x3 = 1; var x3 = function () { -}; // should be an error +}; // error // var then class -var x4 = 1; +var x4 = 1; // error var x4 = (function () { function x4() { } return x4; })(); // error -var x4a = 1; +var x4a = 1; // error var x4a = (function () { function x4a() { } @@ -70,12 +70,12 @@ var x5; })(x5 || (x5 = {})); // error // var then module var x6 = 1; -var x6a = 1; +var x6a = 1; // error var x6a; (function (x6a) { var y = 2; })(x6a || (x6a = {})); // error since instantiated -var x6b = 1; +var x6b = 1; // error var x6b; (function (x6b) { x6b.y = 2; diff --git a/tests/baselines/reference/autoLift2.errors.txt b/tests/baselines/reference/autoLift2.errors.txt index 6f62c8e9e4b..dbe9e98cd63 100644 --- a/tests/baselines/reference/autoLift2.errors.txt +++ b/tests/baselines/reference/autoLift2.errors.txt @@ -1,3 +1,15 @@ +tests/cases/compiler/autoLift2.ts(5,17): error TS1005: ';' expected. +tests/cases/compiler/autoLift2.ts(6,17): error TS1005: ';' expected. +tests/cases/compiler/autoLift2.ts(5,14): error TS2339: Property 'foo' does not exist on type 'A'. +tests/cases/compiler/autoLift2.ts(5,19): error TS2304: Cannot find name 'any'. +tests/cases/compiler/autoLift2.ts(6,14): error TS2339: Property 'bar' does not exist on type 'A'. +tests/cases/compiler/autoLift2.ts(6,19): error TS2304: Cannot find name 'any'. +tests/cases/compiler/autoLift2.ts(12,11): error TS2339: Property 'foo' does not exist on type 'A'. +tests/cases/compiler/autoLift2.ts(14,11): error TS2339: Property 'bar' does not exist on type 'A'. +tests/cases/compiler/autoLift2.ts(16,33): error TS2339: Property 'foo' does not exist on type 'A'. +tests/cases/compiler/autoLift2.ts(18,33): error TS2339: Property 'bar' does not exist on type 'A'. + + ==== tests/cases/compiler/autoLift2.ts (10 errors) ==== class A @@ -5,18 +17,18 @@ constructor() { this.foo: any; ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~ -!!! Property 'foo' does not exist on type 'A'. +!!! error TS2339: Property 'foo' does not exist on type 'A'. ~~~ -!!! Cannot find name 'any'. +!!! error TS2304: Cannot find name 'any'. this.bar: any; ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~ -!!! Property 'bar' does not exist on type 'A'. +!!! error TS2339: Property 'bar' does not exist on type 'A'. ~~~ -!!! Cannot find name 'any'. +!!! error TS2304: Cannot find name 'any'. } @@ -24,19 +36,19 @@ this.foo = "foo"; ~~~ -!!! Property 'foo' does not exist on type 'A'. +!!! error TS2339: Property 'foo' does not exist on type 'A'. this.bar = "bar"; ~~~ -!!! Property 'bar' does not exist on type 'A'. +!!! error TS2339: Property 'bar' does not exist on type 'A'. [1, 2].forEach((p) => this.foo); ~~~ -!!! Property 'foo' does not exist on type 'A'. +!!! error TS2339: Property 'foo' does not exist on type 'A'. [1, 2].forEach((p) => this.bar); ~~~ -!!! Property 'bar' does not exist on type 'A'. +!!! error TS2339: Property 'bar' does not exist on type 'A'. } diff --git a/tests/baselines/reference/autolift3.errors.txt b/tests/baselines/reference/autolift3.errors.txt index a73368620f5..384ad498661 100644 --- a/tests/baselines/reference/autolift3.errors.txt +++ b/tests/baselines/reference/autolift3.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/autolift3.ts(26,3): error TS2339: Property 'foo' does not exist on type 'B'. + + ==== tests/cases/compiler/autolift3.ts (1 errors) ==== class B { @@ -26,7 +29,7 @@ b.foo(); ~~~ -!!! Property 'foo' does not exist on type 'B'. +!!! error TS2339: Property 'foo' does not exist on type 'B'. diff --git a/tests/baselines/reference/autolift4.errors.txt b/tests/baselines/reference/autolift4.errors.txt index 9469d976c59..b548479b692 100644 --- a/tests/baselines/reference/autolift4.errors.txt +++ b/tests/baselines/reference/autolift4.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/autolift4.ts(19,70): error TS2339: Property 'm' does not exist on type 'Point3D'. + + ==== tests/cases/compiler/autolift4.ts (1 errors) ==== class Point { @@ -19,7 +22,7 @@ getDist() { return Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.m); ~ -!!! Property 'm' does not exist on type 'Point3D'. +!!! error TS2339: Property 'm' does not exist on type 'Point3D'. } } diff --git a/tests/baselines/reference/badArrayIndex.errors.txt b/tests/baselines/reference/badArrayIndex.errors.txt index 71228c95e21..818870f6c26 100644 --- a/tests/baselines/reference/badArrayIndex.errors.txt +++ b/tests/baselines/reference/badArrayIndex.errors.txt @@ -1,6 +1,10 @@ +tests/cases/compiler/badArrayIndex.ts(1,22): error TS1109: Expression expected. +tests/cases/compiler/badArrayIndex.ts(1,15): error TS2304: Cannot find name 'number'. + + ==== tests/cases/compiler/badArrayIndex.ts (2 errors) ==== var results = number[]; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~~ -!!! Cannot find name 'number'. \ No newline at end of file +!!! error TS2304: Cannot find name 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/badArraySyntax.errors.txt b/tests/baselines/reference/badArraySyntax.errors.txt index 9c1edf93231..500a89d85a9 100644 --- a/tests/baselines/reference/badArraySyntax.errors.txt +++ b/tests/baselines/reference/badArraySyntax.errors.txt @@ -1,24 +1,29 @@ -==== tests/cases/compiler/badArraySyntax.ts (6 errors) ==== +tests/cases/compiler/badArraySyntax.ts(6,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(7,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(8,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(9,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(10,17): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + + +==== tests/cases/compiler/badArraySyntax.ts (5 errors) ==== class Z { public x = ""; } var a1: Z[] = []; var a2 = new Z[]; - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a3 = new Z[](); - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a4: Z[] = new Z[]; - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a5: Z[] = new Z[](); - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a6: Z[][] = new Z [ ] [ ]; - ~~~~~~~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. - ~~~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. \ No newline at end of file diff --git a/tests/baselines/reference/badExternalModuleReference.errors.txt b/tests/baselines/reference/badExternalModuleReference.errors.txt index 392336db379..96ac4224222 100644 --- a/tests/baselines/reference/badExternalModuleReference.errors.txt +++ b/tests/baselines/reference/badExternalModuleReference.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/badExternalModuleReference.ts(1,21): error TS2307: Cannot find external module 'garbage'. + + ==== tests/cases/compiler/badExternalModuleReference.ts (1 errors) ==== import a1 = require("garbage"); ~~~~~~~~~ -!!! Cannot find external module 'garbage'. +!!! error TS2307: Cannot find external module 'garbage'. export declare var a: { test1: a1.connectModule; (): a1.connectExport; diff --git a/tests/baselines/reference/badOverloadError.types b/tests/baselines/reference/badOverloadError.types index 837eb5c5c83..ba9d6e76c1c 100644 --- a/tests/baselines/reference/badOverloadError.types +++ b/tests/baselines/reference/badOverloadError.types @@ -6,6 +6,6 @@ function method() { >dictionary : { [x: string]: string; } ><{ [index: string]: string; }>{} : { [x: string]: string; } >index : string ->{} : { [x: string]: string; } +>{} : { [x: string]: undefined; } } diff --git a/tests/baselines/reference/baseCheck.errors.txt b/tests/baselines/reference/baseCheck.errors.txt index a09491ac455..f52ba4b3dbd 100644 --- a/tests/baselines/reference/baseCheck.errors.txt +++ b/tests/baselines/reference/baseCheck.errors.txt @@ -1,3 +1,14 @@ +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 TS2332: 'this' cannot be referenced in current location. +tests/cases/compiler/baseCheck.ts(18,62): error TS2332: 'this' cannot be referenced in current location. +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,68): error TS2332: 'this' cannot be referenced in current location. +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'. +tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'. + + ==== tests/cases/compiler/baseCheck.ts (9 errors) ==== class C { constructor(x: number, y: number) { } } class ELoc extends C { @@ -9,7 +20,7 @@ constructor(x: number) { super(0, loc); ~~~ -!!! Cannot find name 'loc'. +!!! error TS2304: Cannot find name 'loc'. } m() { @@ -19,30 +30,30 @@ class D extends C { constructor(public z: number) { super(this.z) } } // too few params ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. ~~~~ -!!! 'this' cannot be referenced in current location. +!!! error TS2332: 'this' cannot be referenced in current location. class E extends C { constructor(public z: number) { super(0, this.z) } } ~~~~ -!!! 'this' cannot be referenced in current location. +!!! error TS2332: 'this' cannot be referenced in current location. class F extends C { constructor(public z: number) { super("hello", this.z) } } // first param type ~~~~~~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. ~~~~ -!!! 'this' cannot be referenced in current location. +!!! error TS2332: 'this' cannot be referenced in current location. function f() { if (x<10) { ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. x=11; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. } else { x=12; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. } } \ No newline at end of file diff --git a/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt b/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt index eb083f30f3c..eca303ff72c 100644 --- a/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt +++ b/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'. + Named properties 'm' of types 'X' and 'Y' are not identical. + + ==== tests/cases/compiler/baseTypePrivateMemberClash.ts (1 errors) ==== class X { private m: number; @@ -8,5 +12,5 @@ interface Z extends X, Y { } ~ -!!! Interface 'Z' cannot simultaneously extend types 'X' and 'Y': -!!! Named properties 'm' of types 'X' and 'Y' are not identical. \ No newline at end of file +!!! error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'. +!!! error TS2320: Named properties 'm' of types 'X' and 'Y' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/bases.errors.txt b/tests/baselines/reference/bases.errors.txt index f4dc4ab5c8f..c9eabafaf80 100644 --- a/tests/baselines/reference/bases.errors.txt +++ b/tests/baselines/reference/bases.errors.txt @@ -1,3 +1,16 @@ +tests/cases/compiler/bases.ts(7,15): error TS1005: ';' expected. +tests/cases/compiler/bases.ts(13,15): error TS1005: ';' expected. +tests/cases/compiler/bases.ts(7,14): error TS2339: Property 'y' does not exist on type 'B'. +tests/cases/compiler/bases.ts(7,17): error TS2304: Cannot find name 'any'. +tests/cases/compiler/bases.ts(11,7): error TS2420: Class 'C' incorrectly implements interface 'I'. + Property 'x' is missing in type 'C'. +tests/cases/compiler/bases.ts(12,5): error TS2377: Constructors for derived classes must contain a 'super' call. +tests/cases/compiler/bases.ts(13,14): error TS2339: Property 'x' does not exist on type 'C'. +tests/cases/compiler/bases.ts(13,17): error TS2304: Cannot find name 'any'. +tests/cases/compiler/bases.ts(17,9): error TS2339: Property 'x' does not exist on type 'C'. +tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist on type 'C'. + + ==== tests/cases/compiler/bases.ts (10 errors) ==== interface I { x; @@ -7,38 +20,38 @@ constructor() { this.y: any; ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Property 'y' does not exist on type 'B'. +!!! error TS2339: Property 'y' does not exist on type 'B'. ~~~ -!!! Cannot find name 'any'. +!!! error TS2304: Cannot find name 'any'. } } class C extends B implements I { ~ -!!! Class 'C' incorrectly implements interface 'I': -!!! Property 'x' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is missing in type 'C'. constructor() { ~~~~~~~~~~~~~~~ this.x: any; ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~~~~~~~~~~~~~~~ ~ -!!! Property 'x' does not exist on type 'C'. +!!! error TS2339: Property 'x' does not exist on type 'C'. ~~~ -!!! Cannot find name 'any'. +!!! error TS2304: Cannot find name 'any'. } ~~~~~ -!!! Constructors for derived classes must contain a 'super' call. +!!! error TS2377: Constructors for derived classes must contain a 'super' call. } new C().x; ~ -!!! Property 'x' does not exist on type 'C'. +!!! error TS2339: Property 'x' does not exist on type 'C'. new C().y; ~ -!!! Property 'y' does not exist on type 'C'. +!!! error TS2339: Property 'y' does not exist on type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types index 3deeae69bbe..eb94c140883 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types @@ -48,14 +48,14 @@ var r3 = true ? 1 : {}; >{} : {} var r4 = true ? a : b; // typeof a ->r4 : { x: number; y?: number; } ->true ? a : b : { x: number; y?: number; } +>r4 : { x: number; y?: number; } | { x: number; z?: number; } +>true ? a : b : { x: number; y?: number; } | { x: number; z?: number; } >a : { x: number; y?: number; } >b : { x: number; z?: number; } var r5 = true ? b : a; // typeof b ->r5 : { x: number; z?: number; } ->true ? b : a : { x: number; z?: number; } +>r5 : { x: number; y?: number; } | { x: number; z?: number; } +>true ? b : a : { x: number; y?: number; } | { x: number; z?: number; } >b : { x: number; z?: number; } >a : { x: number; y?: number; } @@ -72,7 +72,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; >r7 : (x: Object) => void >x : Object >Object : Object ->true ? (x: number) => { } : (x: Object) => { } : (x: Object) => void +>true ? (x: number) => { } : (x: Object) => { } : (x: number) => void >(x: number) => { } : (x: number) => void >x : number >(x: Object) => { } : (x: Object) => void @@ -91,7 +91,7 @@ var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => vo var r10: Base = true ? derived : derived2; // no error since we use the contextual type in BCT >r10 : Base >Base : Base ->true ? derived : derived2 : Base +>true ? derived : derived2 : Derived | Derived2 >derived : Derived >derived2 : Derived2 @@ -112,7 +112,7 @@ function foo5(t: T, u: U): Object { >Object : Object return true ? t : u; // BCT is Object ->true ? t : u : Object +>true ? t : u : T | U >t : T >u : U } diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt index 9d86da98f3f..83f4678c8f3 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt @@ -1,4 +1,9 @@ -==== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts (8 errors) ==== +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts(18,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts(22,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts(22,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + +==== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts (3 errors) ==== // conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) // these are errors @@ -10,32 +15,22 @@ var derived2: Derived2; var r2 = true ? 1 : ''; - ~~~~~~~~~~~~~ -!!! No best common type exists between 'number' and 'string'. var r9 = true ? derived : derived2; - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! No best common type exists between 'Derived' and 'Derived2'. function foo(t: T, u: U) { return true ? t : u; - ~~~~~~~~~~~~ -!!! No best common type exists between 'T' and 'U'. } function foo2(t: T, u: U) { // Error for referencing own type parameter ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return true ? t : u; // Ok because BCT(T, U) = U - ~~~~~~~~~~~~ -!!! No best common type exists between 'T' and 'U'. } function foo3(t: T, u: U) { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return true ? t : u; - ~~~~~~~~~~~~ -!!! No best common type exists between 'T' and 'U'. } \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.js b/tests/baselines/reference/bestCommonTypeOfTuple.js new file mode 100644 index 00000000000..752523317b5 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfTuple.js @@ -0,0 +1,58 @@ +//// [bestCommonTypeOfTuple.ts] +function f1(x: number): string { return "foo"; } + +function f2(x: number): number { return 10; } + +function f3(x: number): boolean { return true; } + +enum E1 { one } + +enum E2 { two } + + +var t1: [(x: number) => string, (x: number) => number]; +var t2: [E1, E2]; +var t3: [number, any]; +var t4: [E1, E2, number]; + +// no error +t1 = [f1, f2]; +t2 = [E1.one, E2.two]; +t3 = [5, undefined]; +t4 = [E1.one, E2.two, 20]; +var e1 = t1[2]; // {} +var e2 = t2[2]; // {} +var e3 = t3[2]; // any +var e4 = t4[3]; // number + +//// [bestCommonTypeOfTuple.js] +function f1(x) { + return "foo"; +} +function f2(x) { + return 10; +} +function f3(x) { + return true; +} +var E1; +(function (E1) { + E1[E1["one"] = 0] = "one"; +})(E1 || (E1 = {})); +var E2; +(function (E2) { + E2[E2["two"] = 0] = "two"; +})(E2 || (E2 = {})); +var t1; +var t2; +var t3; +var t4; +// no error +t1 = [f1, f2]; +t2 = [0 /* one */, 0 /* two */]; +t3 = [5, undefined]; +t4 = [0 /* one */, 0 /* two */, 20]; +var e1 = t1[2]; // {} +var e2 = t2[2]; // {} +var e3 = t3[2]; // any +var e4 = t4[3]; // number diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.types b/tests/baselines/reference/bestCommonTypeOfTuple.types new file mode 100644 index 00000000000..0516fc4af2b --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfTuple.types @@ -0,0 +1,96 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts === +function f1(x: number): string { return "foo"; } +>f1 : (x: number) => string +>x : number + +function f2(x: number): number { return 10; } +>f2 : (x: number) => number +>x : number + +function f3(x: number): boolean { return true; } +>f3 : (x: number) => boolean +>x : number + +enum E1 { one } +>E1 : E1 +>one : E1 + +enum E2 { two } +>E2 : E2 +>two : E2 + + +var t1: [(x: number) => string, (x: number) => number]; +>t1 : [(x: number) => string, (x: number) => number] +>x : number +>x : number + +var t2: [E1, E2]; +>t2 : [E1, E2] +>E1 : E1 +>E2 : E2 + +var t3: [number, any]; +>t3 : [number, any] + +var t4: [E1, E2, number]; +>t4 : [E1, E2, number] +>E1 : E1 +>E2 : E2 + +// no error +t1 = [f1, f2]; +>t1 = [f1, f2] : [(x: number) => string, (x: number) => number] +>t1 : [(x: number) => string, (x: number) => number] +>[f1, f2] : [(x: number) => string, (x: number) => number] +>f1 : (x: number) => string +>f2 : (x: number) => number + +t2 = [E1.one, E2.two]; +>t2 = [E1.one, E2.two] : [E1, E2] +>t2 : [E1, E2] +>[E1.one, E2.two] : [E1, E2] +>E1.one : E1 +>E1 : typeof E1 +>one : E1 +>E2.two : E2 +>E2 : typeof E2 +>two : E2 + +t3 = [5, undefined]; +>t3 = [5, undefined] : [number, undefined] +>t3 : [number, any] +>[5, undefined] : [number, undefined] +>undefined : undefined + +t4 = [E1.one, E2.two, 20]; +>t4 = [E1.one, E2.two, 20] : [E1, E2, number] +>t4 : [E1, E2, number] +>[E1.one, E2.two, 20] : [E1, E2, number] +>E1.one : E1 +>E1 : typeof E1 +>one : E1 +>E2.two : E2 +>E2 : typeof E2 +>two : E2 + +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] + +var e2 = t2[2]; // {} +>e2 : E1 | E2 +>t2[2] : E1 | E2 +>t2 : [E1, E2] + +var e3 = t3[2]; // any +>e3 : any +>t3[2] : any +>t3 : [number, any] + +var e4 = t4[3]; // number +>e4 : number +>t4[3] : number +>t4 : [E1, E2, number] + diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js new file mode 100644 index 00000000000..f9183f41348 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -0,0 +1,77 @@ +//// [bestCommonTypeOfTuple2.ts] +interface base { } +interface base1 { i } +class C implements base { c } +class D implements base { d } +class E implements base { e } +class F extends C { f } + +class C1 implements base1 { i = "foo"; c } +class D1 extends C1 { i = "bar"; d } + +var t1: [C, base]; +var t2: [C, D]; +var t3: [C1, D1]; +var t4: [base1, C1]; +var t5: [C1, F] + +var e11 = t1[4]; // base +var e21 = t2[4]; // {} +var e31 = t3[4]; // C1 +var e41 = t4[2]; // base1 +var e51 = t5[2]; // {} + + +//// [bestCommonTypeOfTuple2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +var E = (function () { + function E() { + } + return E; +})(); +var F = (function (_super) { + __extends(F, _super); + function F() { + _super.apply(this, arguments); + } + return F; +})(C); +var C1 = (function () { + function C1() { + this.i = "foo"; + } + return C1; +})(); +var D1 = (function (_super) { + __extends(D1, _super); + function D1() { + _super.apply(this, arguments); + this.i = "bar"; + } + return D1; +})(C1); +var t1; +var t2; +var t3; +var t4; +var t5; +var e11 = t1[4]; // base +var e21 = t2[4]; // {} +var e31 = t3[4]; // C1 +var e41 = t4[2]; // base1 +var e51 = t5[2]; // {} diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.types b/tests/baselines/reference/bestCommonTypeOfTuple2.types new file mode 100644 index 00000000000..a87407e98fc --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.types @@ -0,0 +1,90 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts === +interface base { } +>base : base + +interface base1 { i } +>base1 : base1 +>i : any + +class C implements base { c } +>C : C +>base : base +>c : any + +class D implements base { d } +>D : D +>base : base +>d : any + +class E implements base { e } +>E : E +>base : base +>e : any + +class F extends C { f } +>F : F +>C : C +>f : any + +class C1 implements base1 { i = "foo"; c } +>C1 : C1 +>base1 : base1 +>i : string +>c : any + +class D1 extends C1 { i = "bar"; d } +>D1 : D1 +>C1 : C1 +>i : string +>d : any + +var t1: [C, base]; +>t1 : [C, base] +>C : C +>base : base + +var t2: [C, D]; +>t2 : [C, D] +>C : C +>D : D + +var t3: [C1, D1]; +>t3 : [C1, D1] +>C1 : C1 +>D1 : D1 + +var t4: [base1, C1]; +>t4 : [base1, C1] +>base1 : base1 +>C1 : C1 + +var t5: [C1, F] +>t5 : [C1, F] +>C1 : C1 +>F : F + +var e11 = t1[4]; // base +>e11 : base +>t1[4] : base +>t1 : [C, base] + +var e21 = t2[4]; // {} +>e21 : C | D +>t2[4] : C | D +>t2 : [C, D] + +var e31 = t3[4]; // C1 +>e31 : C1 +>t3[4] : C1 +>t3 : [C1, D1] + +var e41 = t4[2]; // base1 +>e41 : base1 +>t4[2] : base1 +>t4 : [base1, C1] + +var e51 = t5[2]; // {} +>e51 : F | C1 +>t5[2] : F | C1 +>t5 : [C1, F] + diff --git a/tests/baselines/reference/binaryArithmatic3.errors.txt b/tests/baselines/reference/binaryArithmatic3.errors.txt index 74f3662aad7..6dffe5e150c 100644 --- a/tests/baselines/reference/binaryArithmatic3.errors.txt +++ b/tests/baselines/reference/binaryArithmatic3.errors.txt @@ -1,6 +1,10 @@ +tests/cases/compiler/binaryArithmatic3.ts(1,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/binaryArithmatic3.ts(1,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + ==== tests/cases/compiler/binaryArithmatic3.ts (2 errors) ==== var v = undefined | undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! 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/binaryArithmatic4.errors.txt b/tests/baselines/reference/binaryArithmatic4.errors.txt index 87200bec116..f72c23073ca 100644 --- a/tests/baselines/reference/binaryArithmatic4.errors.txt +++ b/tests/baselines/reference/binaryArithmatic4.errors.txt @@ -1,6 +1,10 @@ +tests/cases/compiler/binaryArithmatic4.ts(1,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/binaryArithmatic4.ts(1,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + ==== tests/cases/compiler/binaryArithmatic4.ts (2 errors) ==== var v = null | null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! 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/bind1.errors.txt b/tests/baselines/reference/bind1.errors.txt index 0f883d94f52..3d50d18b1bc 100644 --- a/tests/baselines/reference/bind1.errors.txt +++ b/tests/baselines/reference/bind1.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/bind1.ts(2,31): error TS2304: Cannot find name 'I'. + + ==== tests/cases/compiler/bind1.ts (1 errors) ==== module M { export class C implements I {} // this should be an unresolved symbol I error ~ -!!! Cannot find name 'I'. +!!! error TS2304: Cannot find name 'I'. } \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseCompoundAssignmentOperators.errors.txt b/tests/baselines/reference/bitwiseCompoundAssignmentOperators.errors.txt new file mode 100644 index 00000000000..ae7a8fdce0a --- /dev/null +++ b/tests/baselines/reference/bitwiseCompoundAssignmentOperators.errors.txt @@ -0,0 +1,59 @@ +tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(3,1): error TS2447: The '^=' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(9,6): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(14,1): error TS2447: The '&=' operator is not allowed for boolean types. Consider using '&&' instead. +tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(18,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(20,6): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(24,1): error TS2447: The '|=' operator is not allowed for boolean types. Consider using '||' instead. +tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(28,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts (8 errors) ==== + var a = true; + var b = 1; + a ^= a; + ~~~~~~ +!!! error TS2447: The '^=' operator is not allowed for boolean types. Consider using '!==' instead. + a = true; + b ^= b; + b = 1; + a ^= b; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + a = true; + b ^= a; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + b = 1; + + var c = false; + var d = 2; + c &= c; + ~~~~~~ +!!! error TS2447: The '&=' operator is not allowed for boolean types. Consider using '&&' instead. + c = false; + d &= d; + d = 2; + c &= d; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + c = false; + d &= c; + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var e = true; + var f = 0; + e |= e; + ~~~~~~ +!!! error TS2447: The '|=' operator is not allowed for boolean types. Consider using '||' instead. + e = true; + f |= f; + f = 0; + e |= f; + ~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + e = true; + f |= f; + + \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseCompoundAssignmentOperators.js b/tests/baselines/reference/bitwiseCompoundAssignmentOperators.js new file mode 100644 index 00000000000..c148fc0142c --- /dev/null +++ b/tests/baselines/reference/bitwiseCompoundAssignmentOperators.js @@ -0,0 +1,63 @@ +//// [bitwiseCompoundAssignmentOperators.ts] +var a = true; +var b = 1; +a ^= a; +a = true; +b ^= b; +b = 1; +a ^= b; +a = true; +b ^= a; +b = 1; + +var c = false; +var d = 2; +c &= c; +c = false; +d &= d; +d = 2; +c &= d; +c = false; +d &= c; + +var e = true; +var f = 0; +e |= e; +e = true; +f |= f; +f = 0; +e |= f; +e = true; +f |= f; + + + +//// [bitwiseCompoundAssignmentOperators.js] +var a = true; +var b = 1; +a ^= a; +a = true; +b ^= b; +b = 1; +a ^= b; +a = true; +b ^= a; +b = 1; +var c = false; +var d = 2; +c &= c; +c = false; +d &= d; +d = 2; +c &= d; +c = false; +d &= c; +var e = true; +var f = 0; +e |= e; +e = true; +f |= f; +f = 0; +e |= f; +e = true; +f |= f; diff --git a/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.errors.txt b/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.errors.txt index 8ec2f4e0407..d730ef41fd8 100644 --- a/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.errors.txt +++ b/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorInvalidOperations.ts(5,10): error TS1005: ',' expected. +tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorInvalidOperations.ts(5,11): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorInvalidOperations.ts(8,27): error TS1134: Variable declaration expected. +tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorInvalidOperations.ts(11,9): error TS1109: Expression expected. + + ==== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorInvalidOperations.ts (4 errors) ==== // Unary operator ~ var q; @@ -5,16 +11,16 @@ // operand before ~ var a = q~; //expect error ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~ -!!! Expression expected. +!!! error TS1109: Expression expected. // multiple operands after ~ var mul = ~[1, 2, "abc"], ""; //expect error ~~ -!!! Variable declaration expected. +!!! error TS1134: Variable declaration expected. // miss an operand var b =~; ~ -!!! Expression expected. \ No newline at end of file +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt index 3513093d9f4..fe91cc8a339 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt @@ -1,3 +1,8 @@ +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 (3 errors) ==== // ~ operator on any type @@ -46,13 +51,13 @@ var ResultIsNumber15 = ~(ANY + ANY1); var ResultIsNumber16 = ~(null + undefined); ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber17 = ~(null + null); ~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber18 = ~(undefined + undefined); ~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. // multiple ~ operators var ResultIsNumber19 = ~~ANY; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js index e38520ef71a..710af4edfa7 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js @@ -1,40 +1,40 @@ //// [bitwiseNotOperatorWithEnumType.ts] // ~ operator on enum type -enum ENUM1 { 1, 2, "" }; +enum ENUM1 { A, B, "" }; // enum type var var ResultIsNumber1 = ~ENUM1; // enum type expressions -var ResultIsNumber2 = ~ENUM1[1]; -var ResultIsNumber3 = ~(ENUM1[1] + ENUM1[2]); +var ResultIsNumber2 = ~ENUM1["A"]; +var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); // multiple ~ operators -var ResultIsNumber4 = ~~~(ENUM1[1] + ENUM1[2]); +var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); // miss assignment operators ~ENUM1; -~ENUM1[1]; -~ENUM1[1], ~ENUM1[2]; +~ENUM1["A"]; +~ENUM1.A, ~ENUM1["B"]; //// [bitwiseNotOperatorWithEnumType.js] // ~ operator on enum type var ENUM1; (function (ENUM1) { - ENUM1[ENUM1["1"] = 0] = "1"; - ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1["A"] = 0] = "A"; + ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; })(ENUM1 || (ENUM1 = {})); ; // enum type var var ResultIsNumber1 = ~ENUM1; // enum type expressions -var ResultIsNumber2 = ~ENUM1[1]; -var ResultIsNumber3 = ~(ENUM1[1] + ENUM1[2]); +var ResultIsNumber2 = ~0 /* "A" */; +var ResultIsNumber3 = ~(0 /* A */ + 1 /* "B" */); // multiple ~ operators -var ResultIsNumber4 = ~~~(ENUM1[1] + ENUM1[2]); +var ResultIsNumber4 = ~~~(0 /* "A" */ + 1 /* B */); // miss assignment operators ~ENUM1; -~ENUM1[1]; -~ENUM1[1], ~ENUM1[2]; +~0 /* "A" */; +~0 /* A */, ~1 /* "B" */; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types index 077b8fdd4d6..71598c6f693 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types @@ -1,8 +1,10 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts === // ~ operator on enum type -enum ENUM1 { 1, 2, "" }; +enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 +>A : ENUM1 +>B : ENUM1 // enum type var var ResultIsNumber1 = ~ENUM1; @@ -11,51 +13,54 @@ var ResultIsNumber1 = ~ENUM1; >ENUM1 : typeof ENUM1 // enum type expressions -var ResultIsNumber2 = ~ENUM1[1]; +var ResultIsNumber2 = ~ENUM1["A"]; >ResultIsNumber2 : number ->~ENUM1[1] : number ->ENUM1[1] : ENUM1 +>~ENUM1["A"] : number +>ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 -var ResultIsNumber3 = ~(ENUM1[1] + ENUM1[2]); +var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); >ResultIsNumber3 : number ->~(ENUM1[1] + ENUM1[2]) : number ->(ENUM1[1] + ENUM1[2]) : number ->ENUM1[1] + ENUM1[2] : number ->ENUM1[1] : ENUM1 +>~(ENUM1.A + ENUM1["B"]) : number +>(ENUM1.A + ENUM1["B"]) : number +>ENUM1.A + ENUM1["B"] : number +>ENUM1.A : ENUM1 >ENUM1 : typeof ENUM1 ->ENUM1[2] : ENUM1 +>A : ENUM1 +>ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 // multiple ~ operators -var ResultIsNumber4 = ~~~(ENUM1[1] + ENUM1[2]); +var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); >ResultIsNumber4 : number ->~~~(ENUM1[1] + ENUM1[2]) : number ->~~(ENUM1[1] + ENUM1[2]) : number ->~(ENUM1[1] + ENUM1[2]) : number ->(ENUM1[1] + ENUM1[2]) : number ->ENUM1[1] + ENUM1[2] : number ->ENUM1[1] : ENUM1 +>~~~(ENUM1["A"] + ENUM1.B) : number +>~~(ENUM1["A"] + ENUM1.B) : number +>~(ENUM1["A"] + ENUM1.B) : number +>(ENUM1["A"] + ENUM1.B) : number +>ENUM1["A"] + ENUM1.B : number +>ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 ->ENUM1[2] : ENUM1 +>ENUM1.B : ENUM1 >ENUM1 : typeof ENUM1 +>B : ENUM1 // miss assignment operators ~ENUM1; >~ENUM1 : number >ENUM1 : typeof ENUM1 -~ENUM1[1]; ->~ENUM1[1] : number ->ENUM1[1] : ENUM1 +~ENUM1["A"]; +>~ENUM1["A"] : number +>ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 -~ENUM1[1], ~ENUM1[2]; ->~ENUM1[1], ~ENUM1[2] : number ->~ENUM1[1] : number ->ENUM1[1] : ENUM1 +~ENUM1.A, ~ENUM1["B"]; +>~ENUM1.A, ~ENUM1["B"] : number +>~ENUM1.A : number +>ENUM1.A : ENUM1 >ENUM1 : typeof ENUM1 ->~ENUM1[2] : number ->ENUM1[2] : ENUM1 +>A : ENUM1 +>~ENUM1["B"] : number +>ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/boolInsteadOfBoolean.errors.txt b/tests/baselines/reference/boolInsteadOfBoolean.errors.txt index 611d98995d8..13141b6235b 100644 --- a/tests/baselines/reference/boolInsteadOfBoolean.errors.txt +++ b/tests/baselines/reference/boolInsteadOfBoolean.errors.txt @@ -1,6 +1,9 @@ +tests/cases/conformance/types/primitives/boolean/boolInsteadOfBoolean.ts(1,8): error TS2304: Cannot find name 'bool'. + + ==== tests/cases/conformance/types/primitives/boolean/boolInsteadOfBoolean.ts (1 errors) ==== var x: bool; ~~~~ -!!! Cannot find name 'bool'. +!!! error TS2304: Cannot find name 'bool'. var a: boolean = x; x = a; \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline b/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline new file mode 100644 index 00000000000..d8bfbc84aa0 --- /dev/null +++ b/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline @@ -0,0 +1,198 @@ + +1 >var a = [10, 20, 30]; + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 21) SpanInfo: {"start":0,"length":20} + >var a = [10, 20, 30] + >:=> (line 1, col 0) to (line 1, col 20) +-------------------------------- +2 >function foo(a: number) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (22 to 47) SpanInfo: {"start":52,"length":8} + >return a + >:=> (line 3, col 4) to (line 3, col 12) +-------------------------------- +3 > return a; + + ~~~~~~~~~~~~~~ => Pos: (48 to 61) SpanInfo: {"start":52,"length":8} + >return a + >:=> (line 3, col 4) to (line 3, col 12) +-------------------------------- +4 >} + + ~~ => Pos: (62 to 63) SpanInfo: {"start":62,"length":1} + >} + >:=> (line 4, col 0) to (line 4, col 1) +-------------------------------- +5 >a = [foo(30), (function () { + + ~~~~~ => Pos: (64 to 68) SpanInfo: {"start":64,"length":49} + >a = [foo(30), (function () { + > return 30; + >})()] + >:=> (line 5, col 0) to (line 7, col 5) +5 >a = [foo(30), (function () { + + ~~~~~~~~ => Pos: (69 to 76) SpanInfo: {"start":69,"length":7} + >foo(30) + >:=> (line 5, col 5) to (line 5, col 12) +5 >a = [foo(30), (function () { + + ~~ => Pos: (77 to 78) SpanInfo: {"start":78,"length":34} + >(function () { + > return 30; + >})() + >:=> (line 5, col 14) to (line 7, col 4) +5 >a = [foo(30), (function () { + + ~~~~~~~~~~~~~~ => Pos: (79 to 92) SpanInfo: {"start":97,"length":9} + >return 30 + >:=> (line 6, col 4) to (line 6, col 13) +-------------------------------- +6 > return 30; + + ~~~~~~~~~~~~~~~ => Pos: (93 to 107) SpanInfo: {"start":97,"length":9} + >return 30 + >:=> (line 6, col 4) to (line 6, col 13) +-------------------------------- +7 >})()]; + + ~ => Pos: (108 to 108) SpanInfo: {"start":108,"length":1} + >} + >:=> (line 7, col 0) to (line 7, col 1) +7 >})()]; + + ~~~ => Pos: (109 to 111) SpanInfo: {"start":78,"length":34} + >(function () { + > return 30; + >})() + >:=> (line 5, col 14) to (line 7, col 4) +7 >})()]; + + ~~~ => Pos: (112 to 114) SpanInfo: {"start":64,"length":49} + >a = [foo(30), (function () { + > return 30; + >})()] + >:=> (line 5, col 0) to (line 7, col 5) +-------------------------------- +8 >function bar() { + + ~~~~~~~~~~~~~~~~~ => Pos: (115 to 131) SpanInfo: {"start":136,"length":8} + >return a + >:=> (line 9, col 4) to (line 9, col 12) +-------------------------------- +9 > return a; + + ~~~~~~~~~~~~~~ => Pos: (132 to 145) SpanInfo: {"start":136,"length":8} + >return a + >:=> (line 9, col 4) to (line 9, col 12) +-------------------------------- +10 >} + + ~~ => Pos: (146 to 147) SpanInfo: {"start":146,"length":1} + >} + >:=> (line 10, col 0) to (line 10, col 1) +-------------------------------- +11 >var x = bar()[0]; + + ~~~~~~~ => Pos: (148 to 154) SpanInfo: {"start":148,"length":16} + >var x = bar()[0] + >:=> (line 11, col 0) to (line 11, col 16) +11 >var x = bar()[0]; + + ~~~~~~ => Pos: (155 to 160) SpanInfo: {"start":156,"length":5} + >bar() + >:=> (line 11, col 8) to (line 11, col 13) +11 >var x = bar()[0]; + + ~~~~~ => Pos: (161 to 165) SpanInfo: {"start":148,"length":16} + >var x = bar()[0] + >:=> (line 11, col 0) to (line 11, col 16) +-------------------------------- +12 >x = (function () { + + ~~~ => Pos: (166 to 168) SpanInfo: {"start":166,"length":40} + >x = (function () { + > return a; + >})()[x] + >:=> (line 12, col 0) to (line 14, col 7) +12 >x = (function () { + + ~~ => Pos: (169 to 170) SpanInfo: {"start":170,"length":33} + >(function () { + > return a; + >})() + >:=> (line 12, col 4) to (line 14, col 4) +12 >x = (function () { + + ~~~~~~~~~~~~~~ => Pos: (171 to 184) SpanInfo: {"start":189,"length":8} + >return a + >:=> (line 13, col 4) to (line 13, col 12) +-------------------------------- +13 > return a; + + ~~~~~~~~~~~~~~ => Pos: (185 to 198) SpanInfo: {"start":189,"length":8} + >return a + >:=> (line 13, col 4) to (line 13, col 12) +-------------------------------- +14 >})()[x]; + + ~ => Pos: (199 to 199) SpanInfo: {"start":199,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +14 >})()[x]; + + ~~~ => Pos: (200 to 202) SpanInfo: {"start":170,"length":33} + >(function () { + > return a; + >})() + >:=> (line 12, col 4) to (line 14, col 4) +14 >})()[x]; + + ~~~~~ => Pos: (203 to 207) SpanInfo: {"start":166,"length":40} + >x = (function () { + > return a; + >})()[x] + >:=> (line 12, col 0) to (line 14, col 7) +-------------------------------- +15 >a[(function () { + + ~~ => Pos: (208 to 209) SpanInfo: {"start":208,"length":36} + >a[(function () { + > return x; + >})()] + >:=> (line 15, col 0) to (line 17, col 5) +15 >a[(function () { + + ~ => Pos: (210 to 210) SpanInfo: {"start":210,"length":33} + >(function () { + > return x; + >})() + >:=> (line 15, col 2) to (line 17, col 4) +15 >a[(function () { + + ~~~~~~~~~~~~~~ => Pos: (211 to 224) SpanInfo: {"start":229,"length":8} + >return x + >:=> (line 16, col 4) to (line 16, col 12) +-------------------------------- +16 > return x; + + ~~~~~~~~~~~~~~ => Pos: (225 to 238) SpanInfo: {"start":229,"length":8} + >return x + >:=> (line 16, col 4) to (line 16, col 12) +-------------------------------- +17 >})()]; + ~ => Pos: (239 to 239) SpanInfo: {"start":239,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +17 >})()]; + ~~~ => Pos: (240 to 242) SpanInfo: {"start":210,"length":33} + >(function () { + > return x; + >})() + >:=> (line 15, col 2) to (line 17, col 4) +17 >})()]; + ~~ => Pos: (243 to 244) SpanInfo: {"start":208,"length":36} + >a[(function () { + > return x; + >})()] + >:=> (line 15, col 0) to (line 17, col 5) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_binaryExpressions.baseline b/tests/baselines/reference/bpSpan_binaryExpressions.baseline new file mode 100644 index 00000000000..370fec39a25 --- /dev/null +++ b/tests/baselines/reference/bpSpan_binaryExpressions.baseline @@ -0,0 +1,119 @@ + +1 >var x = 10; + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":10} + >var x = 10 + >:=> (line 1, col 0) to (line 1, col 10) +-------------------------------- +2 >var y = 20; + + ~~~~~~~~~~~~ => Pos: (12 to 23) SpanInfo: {"start":12,"length":10} + >var y = 20 + >:=> (line 2, col 0) to (line 2, col 10) +-------------------------------- +3 >x += 30; + + ~~~~~~~~~ => Pos: (24 to 32) SpanInfo: {"start":24,"length":7} + >x += 30 + >:=> (line 3, col 0) to (line 3, col 7) +-------------------------------- +4 >x *= 0; + + ~~~~~~~~ => Pos: (33 to 40) SpanInfo: {"start":33,"length":6} + >x *= 0 + >:=> (line 4, col 0) to (line 4, col 6) +-------------------------------- +5 >x = x + 1; + + ~~~~~~~~~~~ => Pos: (41 to 51) SpanInfo: {"start":41,"length":9} + >x = x + 1 + >:=> (line 5, col 0) to (line 5, col 9) +-------------------------------- +6 >x = (function foo() { + + ~~~ => Pos: (52 to 54) SpanInfo: {"start":52,"length":44} + >x = (function foo() { + > return y; + >})() + y + >:=> (line 6, col 0) to (line 8, col 8) +6 >x = (function foo() { + + ~~ => Pos: (55 to 56) SpanInfo: {"start":56,"length":36} + >(function foo() { + > return y; + >})() + >:=> (line 6, col 4) to (line 8, col 4) +6 >x = (function foo() { + + ~~~~~~~~~~~~~~~~~ => Pos: (57 to 73) SpanInfo: {"start":78,"length":8} + >return y + >:=> (line 7, col 4) to (line 7, col 12) +-------------------------------- +7 > return y; + + ~~~~~~~~~~~~~~ => Pos: (74 to 87) SpanInfo: {"start":78,"length":8} + >return y + >:=> (line 7, col 4) to (line 7, col 12) +-------------------------------- +8 >})() + y; + + ~ => Pos: (88 to 88) SpanInfo: {"start":88,"length":1} + >} + >:=> (line 8, col 0) to (line 8, col 1) +8 >})() + y; + + ~~~ => Pos: (89 to 91) SpanInfo: {"start":56,"length":36} + >(function foo() { + > return y; + >})() + >:=> (line 6, col 4) to (line 8, col 4) +8 >})() + y; + + ~~~~~~ => Pos: (92 to 97) SpanInfo: {"start":52,"length":44} + >x = (function foo() { + > return y; + >})() + y + >:=> (line 6, col 0) to (line 8, col 8) +-------------------------------- +9 >x = y + 30 + (function foo() { + + ~~~~~~~~~~~~ => Pos: (98 to 109) SpanInfo: {"start":98,"length":54} + >x = y + 30 + (function foo() { + > return y; + >})() * 40 + >:=> (line 9, col 0) to (line 11, col 9) +9 >x = y + 30 + (function foo() { + + ~~ => Pos: (110 to 111) SpanInfo: {"start":111,"length":36} + >(function foo() { + > return y; + >})() + >:=> (line 9, col 13) to (line 11, col 4) +9 >x = y + 30 + (function foo() { + + ~~~~~~~~~~~~~~~~~ => Pos: (112 to 128) SpanInfo: {"start":133,"length":8} + >return y + >:=> (line 10, col 4) to (line 10, col 12) +-------------------------------- +10 > return y; + + ~~~~~~~~~~~~~~ => Pos: (129 to 142) SpanInfo: {"start":133,"length":8} + >return y + >:=> (line 10, col 4) to (line 10, col 12) +-------------------------------- +11 >})() * 40; + ~ => Pos: (143 to 143) SpanInfo: {"start":143,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +11 >})() * 40; + ~~~ => Pos: (144 to 146) SpanInfo: {"start":111,"length":36} + >(function foo() { + > return y; + >})() + >:=> (line 9, col 13) to (line 11, col 4) +11 >})() * 40; + ~~~~~~ => Pos: (147 to 152) SpanInfo: {"start":98,"length":54} + >x = y + 30 + (function foo() { + > return y; + >})() * 40 + >:=> (line 9, col 0) to (line 11, col 9) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_breakOrContinue.baseline b/tests/baselines/reference/bpSpan_breakOrContinue.baseline new file mode 100644 index 00000000000..617589b9047 --- /dev/null +++ b/tests/baselines/reference/bpSpan_breakOrContinue.baseline @@ -0,0 +1,71 @@ + +1 >while (true) { + + ~~~~~~~~~~~~~~~ => Pos: (0 to 14) SpanInfo: {"start":0,"length":12} + >while (true) + >:=> (line 1, col 0) to (line 1, col 12) +-------------------------------- +2 > break; + + ~~~~~~~~~~~ => Pos: (15 to 25) SpanInfo: {"start":19,"length":5} + >break + >:=> (line 2, col 4) to (line 2, col 9) +-------------------------------- +3 >} + + ~~ => Pos: (26 to 27) SpanInfo: {"start":19,"length":5} + >break + >:=> (line 2, col 4) to (line 2, col 9) +-------------------------------- +4 >y: while (true) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (28 to 45) SpanInfo: {"start":31,"length":12} + >while (true) + >:=> (line 4, col 3) to (line 4, col 15) +-------------------------------- +5 > break y; + + ~~~~~~~~~~~~~ => Pos: (46 to 58) SpanInfo: {"start":50,"length":7} + >break y + >:=> (line 5, col 4) to (line 5, col 11) +-------------------------------- +6 >} + + ~~ => Pos: (59 to 60) SpanInfo: {"start":50,"length":7} + >break y + >:=> (line 5, col 4) to (line 5, col 11) +-------------------------------- +7 >while (true) { + + ~~~~~~~~~~~~~~~ => Pos: (61 to 75) SpanInfo: {"start":61,"length":12} + >while (true) + >:=> (line 7, col 0) to (line 7, col 12) +-------------------------------- +8 > continue; + + ~~~~~~~~~~~~~~ => Pos: (76 to 89) SpanInfo: {"start":80,"length":8} + >continue + >:=> (line 8, col 4) to (line 8, col 12) +-------------------------------- +9 >} + + ~~ => Pos: (90 to 91) SpanInfo: {"start":80,"length":8} + >continue + >:=> (line 8, col 4) to (line 8, col 12) +-------------------------------- +10 >z: while (true) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (92 to 109) SpanInfo: {"start":95,"length":12} + >while (true) + >:=> (line 10, col 3) to (line 10, col 15) +-------------------------------- +11 > continue z; + + ~~~~~~~~~~~~~~~~ => Pos: (110 to 125) SpanInfo: {"start":114,"length":10} + >continue z + >:=> (line 11, col 4) to (line 11, col 14) +-------------------------------- +12 >} + ~ => Pos: (126 to 126) SpanInfo: {"start":114,"length":10} + >continue z + >:=> (line 11, col 4) to (line 11, col 14) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_class.baseline b/tests/baselines/reference/bpSpan_class.baseline new file mode 100644 index 00000000000..3370762f72b --- /dev/null +++ b/tests/baselines/reference/bpSpan_class.baseline @@ -0,0 +1,365 @@ + +1 >class Greeter { + + ~~~~~~~~~~~~~~~~ => Pos: (0 to 15) SpanInfo: {"start":0,"length":396} + >class Greeter { + > constructor(public greeting: string, ...b: string[]) { + > } + > greet() { + > return "

" + this.greeting + "

"; + > } + > private x: string; + > private x1: number = 10; + > private fn() { + > return this.greeting; + > } + > get greetings() { + > return this.greeting; + > } + > set greetings(greetings: string) { + > this.greeting = greetings; + > } + >} + >:=> (line 1, col 0) to (line 18, col 1) +-------------------------------- +2 > constructor(public greeting: string, ...b: string[]) { + + ~~~~~~~~~~~~~~~~ => Pos: (16 to 31) SpanInfo: {"start":79,"length":1} + >} + >:=> (line 3, col 4) to (line 3, col 5) +2 > constructor(public greeting: string, ...b: string[]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (32 to 55) SpanInfo: {"start":32,"length":23} + >public greeting: string + >:=> (line 2, col 16) to (line 2, col 39) +2 > constructor(public greeting: string, ...b: string[]) { + + ~~~~~~~~~~~~~~~~=> Pos: (56 to 71) SpanInfo: {"start":57,"length":14} + >...b: string[] + >:=> (line 2, col 41) to (line 2, col 55) +2 > constructor(public greeting: string, ...b: string[]) { + + ~~~=> Pos: (72 to 74) SpanInfo: {"start":79,"length":1} + >} + >:=> (line 3, col 4) to (line 3, col 5) +-------------------------------- +3 > } + + ~~~~~~ => Pos: (75 to 80) SpanInfo: {"start":79,"length":1} + >} + >:=> (line 3, col 4) to (line 3, col 5) +-------------------------------- +4 > greet() { + + ~~~~~~~~~~~~~~ => Pos: (81 to 94) SpanInfo: {"start":85,"length":64} + >greet() { + > return "

" + this.greeting + "

"; + > } + >:=> (line 4, col 4) to (line 6, col 5) +-------------------------------- +5 > return "

" + this.greeting + "

"; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (95 to 143) SpanInfo: {"start":103,"length":39} + >return "

" + this.greeting + "

" + >:=> (line 5, col 8) to (line 5, col 47) +-------------------------------- +6 > } + + ~~~~~~ => Pos: (144 to 149) SpanInfo: {"start":148,"length":1} + >} + >:=> (line 6, col 4) to (line 6, col 5) +-------------------------------- +7 > private x: string; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (150 to 172) SpanInfo: undefined +-------------------------------- +8 > private x1: number = 10; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (173 to 201) SpanInfo: {"start":177,"length":24} + >private x1: number = 10; + >:=> (line 8, col 4) to (line 8, col 28) +-------------------------------- +9 > private fn() { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (202 to 220) SpanInfo: {"start":206,"length":50} + >private fn() { + > return this.greeting; + > } + >:=> (line 9, col 4) to (line 11, col 5) +-------------------------------- +10 > return this.greeting; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (221 to 250) SpanInfo: {"start":229,"length":20} + >return this.greeting + >:=> (line 10, col 8) to (line 10, col 28) +-------------------------------- +11 > } + + ~~~~~~ => Pos: (251 to 256) SpanInfo: {"start":255,"length":1} + >} + >:=> (line 11, col 4) to (line 11, col 5) +-------------------------------- +12 > get greetings() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (257 to 278) SpanInfo: {"start":261,"length":53} + >get greetings() { + > return this.greeting; + > } + >:=> (line 12, col 4) to (line 14, col 5) +-------------------------------- +13 > return this.greeting; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (279 to 308) SpanInfo: {"start":287,"length":20} + >return this.greeting + >:=> (line 13, col 8) to (line 13, col 28) +-------------------------------- +14 > } + + ~~~~~~ => Pos: (309 to 314) SpanInfo: {"start":313,"length":1} + >} + >:=> (line 14, col 4) to (line 14, col 5) +-------------------------------- +15 > set greetings(greetings: string) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (315 to 353) SpanInfo: {"start":319,"length":75} + >set greetings(greetings: string) { + > this.greeting = greetings; + > } + >:=> (line 15, col 4) to (line 17, col 5) +-------------------------------- +16 > this.greeting = greetings; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (354 to 388) SpanInfo: {"start":362,"length":25} + >this.greeting = greetings + >:=> (line 16, col 8) to (line 16, col 33) +-------------------------------- +17 > } + + ~~~~~~ => Pos: (389 to 394) SpanInfo: {"start":393,"length":1} + >} + >:=> (line 17, col 4) to (line 17, col 5) +-------------------------------- +18 >} + + ~~ => Pos: (395 to 396) SpanInfo: {"start":395,"length":1} + >} + >:=> (line 18, col 0) to (line 18, col 1) +-------------------------------- +19 >class Greeter2 { + + ~~~~~~~~~~~~~~~~~ => Pos: (397 to 413) SpanInfo: {"start":397,"length":18} + >class Greeter2 { + >} + >:=> (line 19, col 0) to (line 20, col 1) +-------------------------------- +20 >} + + ~~ => Pos: (414 to 415) SpanInfo: {"start":414,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >class Greeter1 + + ~~~~~~~~~~~~~~~~ => Pos: (416 to 431) SpanInfo: {"start":416,"length":419} + >class Greeter1 + >{ + > constructor(public greeting: string, ...b: string[]) + > { + > } + > greet() + > { + > return "

" + this.greeting + "

"; + > } + > private x: string; + > private x1: number = 10; + > private fn() + > { + > return this.greeting; + > } + > get greetings() + > { + > return this.greeting; + > } + > set greetings(greetings: string) + > { + > this.greeting = greetings; + > } + >} + >:=> (line 21, col 0) to (line 44, col 1) +-------------------------------- +22 >{ + + ~~ => Pos: (432 to 433) SpanInfo: {"start":501,"length":1} + >} + >:=> (line 25, col 4) to (line 25, col 5) +-------------------------------- +23 > constructor(public greeting: string, ...b: string[]) + + ~~~~~~~~~~~~~~~~ => Pos: (434 to 449) SpanInfo: {"start":501,"length":1} + >} + >:=> (line 25, col 4) to (line 25, col 5) +23 > constructor(public greeting: string, ...b: string[]) + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (450 to 473) SpanInfo: {"start":450,"length":23} + >public greeting: string + >:=> (line 23, col 16) to (line 23, col 39) +23 > constructor(public greeting: string, ...b: string[]) + + ~~~~~~~~~~~~~~~~~=> Pos: (474 to 490) SpanInfo: {"start":475,"length":14} + >...b: string[] + >:=> (line 23, col 41) to (line 23, col 55) +-------------------------------- +24 > { + + ~~~~~~ => Pos: (491 to 496) SpanInfo: {"start":501,"length":1} + >} + >:=> (line 25, col 4) to (line 25, col 5) +-------------------------------- +25 > } + + ~~~~~~ => Pos: (497 to 502) SpanInfo: {"start":501,"length":1} + >} + >:=> (line 25, col 4) to (line 25, col 5) +-------------------------------- +26 > greet() + + ~~~~~~~~~~~~ => Pos: (503 to 514) SpanInfo: {"start":507,"length":68} + >greet() + > { + > return "

" + this.greeting + "

"; + > } + >:=> (line 26, col 4) to (line 29, col 5) +-------------------------------- +27 > { + + ~~~~~~ => Pos: (515 to 520) SpanInfo: {"start":529,"length":39} + >return "

" + this.greeting + "

" + >:=> (line 28, col 8) to (line 28, col 47) +-------------------------------- +28 > return "

" + this.greeting + "

"; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (521 to 569) SpanInfo: {"start":529,"length":39} + >return "

" + this.greeting + "

" + >:=> (line 28, col 8) to (line 28, col 47) +-------------------------------- +29 > } + + ~~~~~~ => Pos: (570 to 575) SpanInfo: {"start":574,"length":1} + >} + >:=> (line 29, col 4) to (line 29, col 5) +-------------------------------- +30 > private x: string; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (576 to 598) SpanInfo: undefined +-------------------------------- +31 > private x1: number = 10; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (599 to 627) SpanInfo: {"start":603,"length":24} + >private x1: number = 10; + >:=> (line 31, col 4) to (line 31, col 28) +-------------------------------- +32 > private fn() + + ~~~~~~~~~~~~~~~~~ => Pos: (628 to 644) SpanInfo: {"start":632,"length":54} + >private fn() + > { + > return this.greeting; + > } + >:=> (line 32, col 4) to (line 35, col 5) +-------------------------------- +33 > { + + ~~~~~~ => Pos: (645 to 650) SpanInfo: {"start":659,"length":20} + >return this.greeting + >:=> (line 34, col 8) to (line 34, col 28) +-------------------------------- +34 > return this.greeting; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (651 to 680) SpanInfo: {"start":659,"length":20} + >return this.greeting + >:=> (line 34, col 8) to (line 34, col 28) +-------------------------------- +35 > } + + ~~~~~~ => Pos: (681 to 686) SpanInfo: {"start":685,"length":1} + >} + >:=> (line 35, col 4) to (line 35, col 5) +-------------------------------- +36 > get greetings() + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (687 to 707) SpanInfo: {"start":691,"length":58} + >get greetings() + > { + > return this.greeting; + > } + >:=> (line 36, col 4) to (line 39, col 5) +-------------------------------- +37 > { + + ~~~~~~ => Pos: (708 to 713) SpanInfo: {"start":722,"length":20} + >return this.greeting + >:=> (line 38, col 8) to (line 38, col 28) +-------------------------------- +38 > return this.greeting; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (714 to 743) SpanInfo: {"start":722,"length":20} + >return this.greeting + >:=> (line 38, col 8) to (line 38, col 28) +-------------------------------- +39 > } + + ~~~~~~ => Pos: (744 to 749) SpanInfo: {"start":748,"length":1} + >} + >:=> (line 39, col 4) to (line 39, col 5) +-------------------------------- +40 > set greetings(greetings: string) + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (750 to 786) SpanInfo: {"start":754,"length":79} + >set greetings(greetings: string) + > { + > this.greeting = greetings; + > } + >:=> (line 40, col 4) to (line 43, col 5) +-------------------------------- +41 > { + + ~~~~~~ => Pos: (787 to 792) SpanInfo: {"start":801,"length":25} + >this.greeting = greetings + >:=> (line 42, col 8) to (line 42, col 33) +-------------------------------- +42 > this.greeting = greetings; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (793 to 827) SpanInfo: {"start":801,"length":25} + >this.greeting = greetings + >:=> (line 42, col 8) to (line 42, col 33) +-------------------------------- +43 > } + + ~~~~~~ => Pos: (828 to 833) SpanInfo: {"start":832,"length":1} + >} + >:=> (line 43, col 4) to (line 43, col 5) +-------------------------------- +44 >} + + ~~ => Pos: (834 to 835) SpanInfo: {"start":834,"length":1} + >} + >:=> (line 44, col 0) to (line 44, col 1) +-------------------------------- +45 >class Greeter12 + + ~~~~~~~~~~~~~~~~ => Pos: (836 to 851) SpanInfo: {"start":836,"length":19} + >class Greeter12 + >{ + >} + >:=> (line 45, col 0) to (line 47, col 1) +-------------------------------- +46 >{ + + ~~ => Pos: (852 to 853) SpanInfo: {"start":854,"length":1} + >} + >:=> (line 47, col 0) to (line 47, col 1) +-------------------------------- +47 >} + ~ => Pos: (854 to 854) SpanInfo: {"start":854,"length":1} + >} + >:=> (line 47, col 0) to (line 47, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_classAmbient.baseline b/tests/baselines/reference/bpSpan_classAmbient.baseline new file mode 100644 index 00000000000..b168c5416c5 --- /dev/null +++ b/tests/baselines/reference/bpSpan_classAmbient.baseline @@ -0,0 +1,31 @@ + +1 >declare class Greeter { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 23) SpanInfo: undefined +-------------------------------- +2 > public greeting: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (24 to 52) SpanInfo: undefined +-------------------------------- +3 > constructor(greeting: string, ...b: string[]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (53 to 103) SpanInfo: undefined +-------------------------------- +4 > greet(): string; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (104 to 124) SpanInfo: undefined +-------------------------------- +5 > private val; + + ~~~~~~~~~~~~~~~~~ => Pos: (125 to 141) SpanInfo: undefined +-------------------------------- +6 > static x: number; + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 163) SpanInfo: undefined +-------------------------------- +7 > static fn(a: number, ...b:string[]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (164 to 204) SpanInfo: undefined +-------------------------------- +8 >} + ~ => Pos: (205 to 205) SpanInfo: undefined \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_classes.baseline b/tests/baselines/reference/bpSpan_classes.baseline new file mode 100644 index 00000000000..811109af835 --- /dev/null +++ b/tests/baselines/reference/bpSpan_classes.baseline @@ -0,0 +1,356 @@ + +1 >module Foo.Bar { + + ~~~~~~~~~~~ => Pos: (0 to 10) SpanInfo: {"start":0,"length":881} + >module Foo.Bar { + > "use strict"; + > + > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + > + > + > function foo(greeting: string): Greeter { + > return new Greeter(greeting); + > } + > + > var greeter = new Greeter("Hello, world!"); + > var str = greeter.greet(); + > + > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + > var greeters: Greeter[] = []; /* inline block comment */ + > greeters[0] = new Greeter(greeting); + > for (var i = 0; i < restGreetings.length; i++) { + > greeters.push(new Greeter(restGreetings[i])); + > } + > + > return greeters; + > } + > + > var b = foo2("Hello", "World", "!"); + > // This is simple signle line comment + > for (var j = 0; j < b.length; j++) { + > b[j].greet(); + > } + >} + >:=> (line 1, col 0) to (line 36, col 1) +1 >module Foo.Bar { + + ~~~~~~ => Pos: (11 to 16) SpanInfo: {"start":11,"length":870} + >Bar { + > "use strict"; + > + > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + > + > + > function foo(greeting: string): Greeter { + > return new Greeter(greeting); + > } + > + > var greeter = new Greeter("Hello, world!"); + > var str = greeter.greet(); + > + > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + > var greeters: Greeter[] = []; /* inline block comment */ + > greeters[0] = new Greeter(greeting); + > for (var i = 0; i < restGreetings.length; i++) { + > greeters.push(new Greeter(restGreetings[i])); + > } + > + > return greeters; + > } + > + > var b = foo2("Hello", "World", "!"); + > // This is simple signle line comment + > for (var j = 0; j < b.length; j++) { + > b[j].greet(); + > } + >} + >:=> (line 1, col 11) to (line 36, col 1) +-------------------------------- +2 > "use strict"; + + ~~~~~~~~~~~~~~~~~~ => Pos: (17 to 34) SpanInfo: {"start":21,"length":12} + >"use strict" + >:=> (line 2, col 4) to (line 2, col 16) +-------------------------------- +3 > + + ~ => Pos: (35 to 35) SpanInfo: undefined +-------------------------------- +4 > class Greeter { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 55) SpanInfo: {"start":40,"length":160} + >class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + >:=> (line 4, col 4) to (line 11, col 5) +-------------------------------- +5 > constructor(public greeting: string) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (56 to 75) SpanInfo: {"start":111,"length":1} + >} + >:=> (line 6, col 8) to (line 6, col 9) +5 > constructor(public greeting: string) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (76 to 99) SpanInfo: {"start":76,"length":23} + >public greeting: string + >:=> (line 5, col 20) to (line 5, col 43) +5 > constructor(public greeting: string) { + + ~~~=> Pos: (100 to 102) SpanInfo: {"start":111,"length":1} + >} + >:=> (line 6, col 8) to (line 6, col 9) +-------------------------------- +6 > } + + ~~~~~~~~~~ => Pos: (103 to 112) SpanInfo: {"start":111,"length":1} + >} + >:=> (line 6, col 8) to (line 6, col 9) +-------------------------------- +7 > + + ~ => Pos: (113 to 113) SpanInfo: undefined +-------------------------------- +8 > greet() { + + ~~~~~~~~~~~~~~~~~~ => Pos: (114 to 131) SpanInfo: {"start":122,"length":72} + >greet() { + > return "

" + this.greeting + "

"; + > } + >:=> (line 8, col 8) to (line 10, col 9) +-------------------------------- +9 > return "

" + this.greeting + "

"; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (132 to 184) SpanInfo: {"start":144,"length":39} + >return "

" + this.greeting + "

" + >:=> (line 9, col 12) to (line 9, col 51) +-------------------------------- +10 > } + + ~~~~~~~~~~ => Pos: (185 to 194) SpanInfo: {"start":193,"length":1} + >} + >:=> (line 10, col 8) to (line 10, col 9) +-------------------------------- +11 > } + + ~~~~~~ => Pos: (195 to 200) SpanInfo: {"start":199,"length":1} + >} + >:=> (line 11, col 4) to (line 11, col 5) +-------------------------------- +12 > + + ~ => Pos: (201 to 201) SpanInfo: undefined +-------------------------------- +13 > + + ~ => Pos: (202 to 202) SpanInfo: undefined +-------------------------------- +14 > function foo(greeting: string): Greeter { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (203 to 248) SpanInfo: {"start":257,"length":28} + >return new Greeter(greeting) + >:=> (line 15, col 8) to (line 15, col 36) +-------------------------------- +15 > return new Greeter(greeting); + + ~~~~~~~~~~~~~~ => Pos: (249 to 262) SpanInfo: {"start":257,"length":28} + >return new Greeter(greeting) + >:=> (line 15, col 8) to (line 15, col 36) +15 > return new Greeter(greeting); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (263 to 286) SpanInfo: {"start":264,"length":21} + >new Greeter(greeting) + >:=> (line 15, col 15) to (line 15, col 36) +-------------------------------- +16 > } + + ~~~~~~ => Pos: (287 to 292) SpanInfo: {"start":291,"length":1} + >} + >:=> (line 16, col 4) to (line 16, col 5) +-------------------------------- +17 > + + ~ => Pos: (293 to 293) SpanInfo: undefined +-------------------------------- +18 > var greeter = new Greeter("Hello, world!"); + + ~~~~~~~~~~~~~~~~~ => Pos: (294 to 310) SpanInfo: {"start":298,"length":42} + >var greeter = new Greeter("Hello, world!") + >:=> (line 18, col 4) to (line 18, col 46) +18 > var greeter = new Greeter("Hello, world!"); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (311 to 341) SpanInfo: {"start":312,"length":28} + >new Greeter("Hello, world!") + >:=> (line 18, col 18) to (line 18, col 46) +-------------------------------- +19 > var str = greeter.greet(); + + ~~~~~~~~~~~~~ => Pos: (342 to 354) SpanInfo: {"start":346,"length":25} + >var str = greeter.greet() + >:=> (line 19, col 4) to (line 19, col 29) +19 > var str = greeter.greet(); + + ~~~~~~~~~~~~~~~~~~ => Pos: (355 to 372) SpanInfo: {"start":356,"length":15} + >greeter.greet() + >:=> (line 19, col 14) to (line 19, col 29) +-------------------------------- +20 > + + ~ => Pos: (373 to 373) SpanInfo: undefined +-------------------------------- +21 > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (374 to 408) SpanInfo: {"start":468,"length":28} + >var greeters: Greeter[] = [] + >:=> (line 22, col 8) to (line 22, col 36) +21 > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (409 to 456) SpanInfo: {"start":410,"length":46} + >...restGreetings /* more greeting */: string[] + >:=> (line 21, col 36) to (line 21, col 82) +21 > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + + ~~~=> Pos: (457 to 459) SpanInfo: {"start":468,"length":28} + >var greeters: Greeter[] = [] + >:=> (line 22, col 8) to (line 22, col 36) +-------------------------------- +22 > var greeters: Greeter[] = []; /* inline block comment */ + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (460 to 524) SpanInfo: {"start":468,"length":28} + >var greeters: Greeter[] = [] + >:=> (line 22, col 8) to (line 22, col 36) +-------------------------------- +23 > greeters[0] = new Greeter(greeting); + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (525 to 545) SpanInfo: {"start":533,"length":35} + >greeters[0] = new Greeter(greeting) + >:=> (line 23, col 8) to (line 23, col 43) +23 > greeters[0] = new Greeter(greeting); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (546 to 569) SpanInfo: {"start":547,"length":21} + >new Greeter(greeting) + >:=> (line 23, col 22) to (line 23, col 43) +-------------------------------- +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (570 to 592) SpanInfo: {"start":583,"length":9} + >var i = 0 + >:=> (line 24, col 13) to (line 24, col 22) +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (593 to 618) SpanInfo: {"start":594,"length":24} + >i < restGreetings.length + >:=> (line 24, col 24) to (line 24, col 48) +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~~~~~~~=> Pos: (619 to 626) SpanInfo: {"start":620,"length":3} + >i++ + >:=> (line 24, col 50) to (line 24, col 53) +-------------------------------- +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (627 to 652) SpanInfo: {"start":639,"length":44} + >greeters.push(new Greeter(restGreetings[i])) + >:=> (line 25, col 12) to (line 25, col 56) +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (653 to 681) SpanInfo: {"start":653,"length":29} + >new Greeter(restGreetings[i]) + >:=> (line 25, col 26) to (line 25, col 55) +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~~=> Pos: (682 to 684) SpanInfo: {"start":639,"length":44} + >greeters.push(new Greeter(restGreetings[i])) + >:=> (line 25, col 12) to (line 25, col 56) +-------------------------------- +26 > } + + ~~~~~~~~~~ => Pos: (685 to 694) SpanInfo: {"start":639,"length":44} + >greeters.push(new Greeter(restGreetings[i])) + >:=> (line 25, col 12) to (line 25, col 56) +-------------------------------- +27 > + + ~ => Pos: (695 to 695) SpanInfo: undefined +-------------------------------- +28 > return greeters; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (696 to 720) SpanInfo: {"start":704,"length":15} + >return greeters + >:=> (line 28, col 8) to (line 28, col 23) +-------------------------------- +29 > } + + ~~~~~~ => Pos: (721 to 726) SpanInfo: {"start":725,"length":1} + >} + >:=> (line 29, col 4) to (line 29, col 5) +-------------------------------- +30 > + + ~ => Pos: (727 to 727) SpanInfo: undefined +-------------------------------- +31 > var b = foo2("Hello", "World", "!"); + + ~~~~~~~~~~~ => Pos: (728 to 738) SpanInfo: {"start":732,"length":35} + >var b = foo2("Hello", "World", "!") + >:=> (line 31, col 4) to (line 31, col 39) +31 > var b = foo2("Hello", "World", "!"); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (739 to 768) SpanInfo: {"start":740,"length":27} + >foo2("Hello", "World", "!") + >:=> (line 31, col 12) to (line 31, col 39) +-------------------------------- +32 > // This is simple signle line comment + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (769 to 810) SpanInfo: undefined +-------------------------------- +33 > for (var j = 0; j < b.length; j++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (811 to 829) SpanInfo: {"start":820,"length":9} + >var j = 0 + >:=> (line 33, col 9) to (line 33, col 18) +33 > for (var j = 0; j < b.length; j++) { + + ~~~~~~~~~~~~~~ => Pos: (830 to 843) SpanInfo: {"start":831,"length":12} + >j < b.length + >:=> (line 33, col 20) to (line 33, col 32) +33 > for (var j = 0; j < b.length; j++) { + + ~~~~~~~~ => Pos: (844 to 851) SpanInfo: {"start":845,"length":3} + >j++ + >:=> (line 33, col 34) to (line 33, col 37) +-------------------------------- +34 > b[j].greet(); + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (852 to 873) SpanInfo: {"start":860,"length":12} + >b[j].greet() + >:=> (line 34, col 8) to (line 34, col 20) +-------------------------------- +35 > } + + ~~~~~~ => Pos: (874 to 879) SpanInfo: {"start":860,"length":12} + >b[j].greet() + >:=> (line 34, col 8) to (line 34, col 20) +-------------------------------- +36 >} + ~ => Pos: (880 to 880) SpanInfo: {"start":880,"length":1} + >} + >:=> (line 36, col 0) to (line 36, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_conditionalExpressions.baseline b/tests/baselines/reference/bpSpan_conditionalExpressions.baseline new file mode 100644 index 00000000000..5abd49d50cf --- /dev/null +++ b/tests/baselines/reference/bpSpan_conditionalExpressions.baseline @@ -0,0 +1,129 @@ + +1 >var x = 10; + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":10} + >var x = 10 + >:=> (line 1, col 0) to (line 1, col 10) +-------------------------------- +2 >var y = x ? x + 10 : 30; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (12 to 36) SpanInfo: {"start":12,"length":23} + >var y = x ? x + 10 : 30 + >:=> (line 2, col 0) to (line 2, col 23) +-------------------------------- +3 >var z = (function foo() { + + ~~~~~~~ => Pos: (37 to 43) SpanInfo: {"start":37,"length":90} + >var z = (function foo() { + > return x; + >})() ? y : function bar() { + > return x; + >} () + >:=> (line 3, col 0) to (line 7, col 4) +3 >var z = (function foo() { + + ~~ => Pos: (44 to 45) SpanInfo: {"start":45,"length":36} + >(function foo() { + > return x; + >})() + >:=> (line 3, col 8) to (line 5, col 4) +3 >var z = (function foo() { + + ~~~~~~~~~~~~~~~~~ => Pos: (46 to 62) SpanInfo: {"start":67,"length":8} + >return x + >:=> (line 4, col 4) to (line 4, col 12) +-------------------------------- +4 > return x; + + ~~~~~~~~~~~~~~ => Pos: (63 to 76) SpanInfo: {"start":67,"length":8} + >return x + >:=> (line 4, col 4) to (line 4, col 12) +-------------------------------- +5 >})() ? y : function bar() { + + ~ => Pos: (77 to 77) SpanInfo: {"start":77,"length":1} + >} + >:=> (line 5, col 0) to (line 5, col 1) +5 >})() ? y : function bar() { + + ~~~ => Pos: (78 to 80) SpanInfo: {"start":45,"length":36} + >(function foo() { + > return x; + >})() + >:=> (line 3, col 8) to (line 5, col 4) +5 >})() ? y : function bar() { + + ~~~~~~ => Pos: (81 to 86) SpanInfo: {"start":37,"length":90} + >var z = (function foo() { + > return x; + >})() ? y : function bar() { + > return x; + >} () + >:=> (line 3, col 0) to (line 7, col 4) +5 >})() ? y : function bar() { + + ~~~~~~~~~~~~~~~~~~ => Pos: (87 to 104) SpanInfo: {"start":113,"length":8} + >return x + >:=> (line 6, col 8) to (line 6, col 16) +-------------------------------- +6 > return x; + + ~~~~~~~~~~~~~~~~~~ => Pos: (105 to 122) SpanInfo: {"start":113,"length":8} + >return x + >:=> (line 6, col 8) to (line 6, col 16) +-------------------------------- +7 >} (); + + ~ => Pos: (123 to 123) SpanInfo: {"start":123,"length":1} + >} + >:=> (line 7, col 0) to (line 7, col 1) +7 >} (); + + ~~~~~ => Pos: (124 to 128) SpanInfo: {"start":88,"length":39} + >function bar() { + > return x; + >} () + >:=> (line 5, col 11) to (line 7, col 4) +-------------------------------- +8 >x = y ? (function () { + + ~~~~~~~ => Pos: (129 to 135) SpanInfo: {"start":129,"length":47} + >x = y ? (function () { + > return z; + >})() : 10 + >:=> (line 8, col 0) to (line 10, col 10) +8 >x = y ? (function () { + + ~~ => Pos: (136 to 137) SpanInfo: {"start":137,"length":33} + >(function () { + > return z; + >})() + >:=> (line 8, col 8) to (line 10, col 4) +8 >x = y ? (function () { + + ~~~~~~~~~~~~~~ => Pos: (138 to 151) SpanInfo: {"start":156,"length":8} + >return z + >:=> (line 9, col 4) to (line 9, col 12) +-------------------------------- +9 > return z; + + ~~~~~~~~~~~~~~ => Pos: (152 to 165) SpanInfo: {"start":156,"length":8} + >return z + >:=> (line 9, col 4) to (line 9, col 12) +-------------------------------- +10 >})() : 10; + ~ => Pos: (166 to 166) SpanInfo: {"start":166,"length":1} + >} + >:=> (line 10, col 0) to (line 10, col 1) +10 >})() : 10; + ~~~ => Pos: (167 to 169) SpanInfo: {"start":137,"length":33} + >(function () { + > return z; + >})() + >:=> (line 8, col 8) to (line 10, col 4) +10 >})() : 10; + ~~~~~~~ => Pos: (170 to 176) SpanInfo: {"start":129,"length":47} + >x = y ? (function () { + > return z; + >})() : 10 + >:=> (line 8, col 0) to (line 10, col 10) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_const.baseline b/tests/baselines/reference/bpSpan_const.baseline new file mode 100644 index 00000000000..bee7d930955 --- /dev/null +++ b/tests/baselines/reference/bpSpan_const.baseline @@ -0,0 +1,176 @@ + +1 >const c1 = false; + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: {"start":0,"length":16} + >const c1 = false + >:=> (line 1, col 0) to (line 1, col 16) +-------------------------------- +2 >const c2: number = 23; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (18 to 40) SpanInfo: {"start":18,"length":21} + >const c2: number = 23 + >:=> (line 2, col 0) to (line 2, col 21) +-------------------------------- +3 >const c3 = 0, c4 :string = "", c5 = null; + + ~~~~~~~~~~~~~ => Pos: (41 to 53) SpanInfo: {"start":41,"length":12} + >const c3 = 0 + >:=> (line 3, col 0) to (line 3, col 12) +3 >const c3 = 0, c4 :string = "", c5 = null; + + ~~~~~~~~~~~~~~~~~ => Pos: (54 to 70) SpanInfo: {"start":55,"length":15} + >c4 :string = "" + >:=> (line 3, col 14) to (line 3, col 29) +3 >const c3 = 0, c4 :string = "", c5 = null; + + ~~~~~~~~~~~~ => Pos: (71 to 82) SpanInfo: {"start":72,"length":9} + >c5 = null + >:=> (line 3, col 31) to (line 3, col 40) +-------------------------------- +4 >for(const c4 = 0; c4 < 9; ) { break; } + + ~~~~~~~~~~~~~~~~~ => Pos: (83 to 99) SpanInfo: {"start":87,"length":12} + >const c4 = 0 + >:=> (line 4, col 4) to (line 4, col 16) +4 >for(const c4 = 0; c4 < 9; ) { break; } + + ~~~~~~~~~~~~ => Pos: (100 to 111) SpanInfo: {"start":101,"length":6} + >c4 < 9 + >:=> (line 4, col 18) to (line 4, col 24) +4 >for(const c4 = 0; c4 < 9; ) { break; } + + ~~~~~~~~~~ => Pos: (112 to 121) SpanInfo: {"start":113,"length":5} + >break + >:=> (line 4, col 30) to (line 4, col 35) +-------------------------------- +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~~~~~~~~~~ => Pos: (122 to 138) SpanInfo: {"start":126,"length":12} + >const c5 = 0 + >:=> (line 5, col 4) to (line 5, col 16) +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~ => Pos: (139 to 146) SpanInfo: {"start":140,"length":6} + >c6 = 0 + >:=> (line 5, col 18) to (line 5, col 24) +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~~~~~~ => Pos: (147 to 159) SpanInfo: {"start":148,"length":7} + >c5 < c6 + >:=> (line 5, col 26) to (line 5, col 33) +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~~~=> Pos: (160 to 169) SpanInfo: {"start":161,"length":5} + >break + >:=> (line 5, col 39) to (line 5, col 44) +-------------------------------- +6 >module M { + + ~~~~~~~~~~~ => Pos: (170 to 180) SpanInfo: {"start":170,"length":133} + >module M { + > export const cc1 = false; + > export const cc2: number = 23; + > export const cc3 = 0, cc4 :string = "", cc5 = null; + >} + >:=> (line 6, col 0) to (line 10, col 1) +-------------------------------- +7 > export const cc1 = false; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (181 to 210) SpanInfo: {"start":185,"length":24} + >export const cc1 = false + >:=> (line 7, col 4) to (line 7, col 28) +-------------------------------- +8 > export const cc2: number = 23; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (211 to 245) SpanInfo: {"start":215,"length":29} + >export const cc2: number = 23 + >:=> (line 8, col 4) to (line 8, col 33) +-------------------------------- +9 > export const cc3 = 0, cc4 :string = "", cc5 = null; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (246 to 270) SpanInfo: {"start":250,"length":20} + >export const cc3 = 0 + >:=> (line 9, col 4) to (line 9, col 24) +9 > export const cc3 = 0, cc4 :string = "", cc5 = null; + + ~~~~~~~~~~~~~~~~~~ => Pos: (271 to 288) SpanInfo: {"start":272,"length":16} + >cc4 :string = "" + >:=> (line 9, col 26) to (line 9, col 42) +9 > export const cc3 = 0, cc4 :string = "", cc5 = null; + + ~~~~~~~~~~~~~=> Pos: (289 to 301) SpanInfo: {"start":290,"length":10} + >cc5 = null + >:=> (line 9, col 44) to (line 9, col 54) +-------------------------------- +10 >} + + ~~ => Pos: (302 to 303) SpanInfo: {"start":302,"length":1} + >} + >:=> (line 10, col 0) to (line 10, col 1) +-------------------------------- +11 >const enum E { + + ~~~~~~~~~~~~~~~ => Pos: (304 to 318) SpanInfo: {"start":304,"length":52} + >const enum E { + > A = 1, + > B = 2, + > C = A | B + >} + >:=> (line 11, col 0) to (line 15, col 1) +-------------------------------- +12 > A = 1, + + ~~~~~~~~~~~ => Pos: (319 to 329) SpanInfo: {"start":323,"length":5} + >A = 1 + >:=> (line 12, col 4) to (line 12, col 9) +-------------------------------- +13 > B = 2, + + ~~~~~~~~~~~ => Pos: (330 to 340) SpanInfo: {"start":334,"length":5} + >B = 2 + >:=> (line 13, col 4) to (line 13, col 9) +-------------------------------- +14 > C = A | B + + ~~~~~~~~~~~~~~ => Pos: (341 to 354) SpanInfo: {"start":345,"length":9} + >C = A | B + >:=> (line 14, col 4) to (line 14, col 13) +-------------------------------- +15 >} + + ~~ => Pos: (355 to 356) SpanInfo: {"start":355,"length":1} + >} + >:=> (line 15, col 0) to (line 15, col 1) +-------------------------------- +16 >const enum E2 { + + ~~~~~~~~~~~~~~~~ => Pos: (357 to 372) SpanInfo: {"start":357,"length":41} + >const enum E2 { + > A = 1, + > B, + > C + >} + >:=> (line 16, col 0) to (line 20, col 1) +-------------------------------- +17 > A = 1, + + ~~~~~~~~~~~ => Pos: (373 to 383) SpanInfo: {"start":377,"length":5} + >A = 1 + >:=> (line 17, col 4) to (line 17, col 9) +-------------------------------- +18 > B, + + ~~~~~~~ => Pos: (384 to 390) SpanInfo: {"start":388,"length":1} + >B + >:=> (line 18, col 4) to (line 18, col 5) +-------------------------------- +19 > C + + ~~~~~~ => Pos: (391 to 396) SpanInfo: {"start":395,"length":1} + >C + >:=> (line 19, col 4) to (line 19, col 5) +-------------------------------- +20 >} + ~ => Pos: (397 to 397) SpanInfo: {"start":397,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_debugger.baseline b/tests/baselines/reference/bpSpan_debugger.baseline new file mode 100644 index 00000000000..700ef7a56a9 --- /dev/null +++ b/tests/baselines/reference/bpSpan_debugger.baseline @@ -0,0 +1,5 @@ + +1 >debugger; + ~~~~~~~~~ => Pos: (0 to 8) SpanInfo: {"start":0,"length":8} + >debugger + >:=> (line 1, col 0) to (line 1, col 8) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_do.baseline b/tests/baselines/reference/bpSpan_do.baseline new file mode 100644 index 00000000000..3ff287c2046 --- /dev/null +++ b/tests/baselines/reference/bpSpan_do.baseline @@ -0,0 +1,142 @@ + +1 >var i = 0; + + ~~~~~~~~~~~ => Pos: (0 to 10) SpanInfo: {"start":0,"length":9} + >var i = 0 + >:=> (line 1, col 0) to (line 1, col 9) +-------------------------------- +2 >do + + ~~~ => Pos: (11 to 13) SpanInfo: {"start":20,"length":3} + >i++ + >:=> (line 4, col 4) to (line 4, col 7) +-------------------------------- +3 >{ + + ~~ => Pos: (14 to 15) SpanInfo: {"start":20,"length":3} + >i++ + >:=> (line 4, col 4) to (line 4, col 7) +-------------------------------- +4 > i++; + + ~~~~~~~~~ => Pos: (16 to 24) SpanInfo: {"start":20,"length":3} + >i++ + >:=> (line 4, col 4) to (line 4, col 7) +-------------------------------- +5 >} while (i < 10); + + ~ => Pos: (25 to 25) SpanInfo: {"start":20,"length":3} + >i++ + >:=> (line 4, col 4) to (line 4, col 7) +5 >} while (i < 10); + + ~~~~~~~~~~~~~~~~~ => Pos: (26 to 42) SpanInfo: {"start":27,"length":14} + >while (i < 10) + >:=> (line 5, col 2) to (line 5, col 16) +-------------------------------- +6 >do { + + ~~~~~ => Pos: (43 to 47) SpanInfo: {"start":52,"length":3} + >i++ + >:=> (line 7, col 4) to (line 7, col 7) +-------------------------------- +7 > i++; + + ~~~~~~~~~ => Pos: (48 to 56) SpanInfo: {"start":52,"length":3} + >i++ + >:=> (line 7, col 4) to (line 7, col 7) +-------------------------------- +8 >} while (i < 20); + + ~ => Pos: (57 to 57) SpanInfo: {"start":52,"length":3} + >i++ + >:=> (line 7, col 4) to (line 7, col 7) +8 >} while (i < 20); + + ~~~~~~~~~~~~~~~~~ => Pos: (58 to 74) SpanInfo: {"start":59,"length":14} + >while (i < 20) + >:=> (line 8, col 2) to (line 8, col 16) +-------------------------------- +9 >do { + + ~~~~~ => Pos: (75 to 79) SpanInfo: {"start":84,"length":3} + >i++ + >:=> (line 10, col 4) to (line 10, col 7) +-------------------------------- +10 > i++; + + ~~~~~~~~~ => Pos: (80 to 88) SpanInfo: {"start":84,"length":3} + >i++ + >:=> (line 10, col 4) to (line 10, col 7) +-------------------------------- +11 >} + + ~~~ => Pos: (89 to 91) SpanInfo: {"start":84,"length":3} + >i++ + >:=> (line 10, col 4) to (line 10, col 7) +-------------------------------- +12 >while (i < 30); + + ~~~~~~~~~~~~~~~~ => Pos: (92 to 107) SpanInfo: {"start":92,"length":14} + >while (i < 30) + >:=> (line 12, col 0) to (line 12, col 14) +-------------------------------- +13 >do { + + ~~~~~ => Pos: (108 to 112) SpanInfo: {"start":117,"length":3} + >i-- + >:=> (line 14, col 4) to (line 14, col 7) +-------------------------------- +14 > i--; + + ~~~~~~~~~ => Pos: (113 to 121) SpanInfo: {"start":117,"length":3} + >i-- + >:=> (line 14, col 4) to (line 14, col 7) +-------------------------------- +15 >} while ((function () { + + ~ => Pos: (122 to 122) SpanInfo: {"start":117,"length":3} + >i-- + >:=> (line 14, col 4) to (line 14, col 7) +15 >} while ((function () { + + ~~~~~~~~ => Pos: (123 to 130) SpanInfo: {"start":124,"length":60} + >while ((function () { + > return 30 * i; + > })() !== i) + >:=> (line 15, col 2) to (line 17, col 15) +15 >} while ((function () { + + ~ => Pos: (131 to 131) SpanInfo: {"start":131,"length":46} + >(function () { + > return 30 * i; + > })() + >:=> (line 15, col 9) to (line 17, col 8) +15 >} while ((function () { + + ~~~~~~~~~~~~~~ => Pos: (132 to 145) SpanInfo: {"start":154,"length":13} + >return 30 * i + >:=> (line 16, col 8) to (line 16, col 21) +-------------------------------- +16 > return 30 * i; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (146 to 168) SpanInfo: {"start":154,"length":13} + >return 30 * i + >:=> (line 16, col 8) to (line 16, col 21) +-------------------------------- +17 > })() !== i); + ~~~~~ => Pos: (169 to 173) SpanInfo: {"start":173,"length":1} + >} + >:=> (line 17, col 4) to (line 17, col 5) +17 > })() !== i); + ~~~ => Pos: (174 to 176) SpanInfo: {"start":131,"length":46} + >(function () { + > return 30 * i; + > })() + >:=> (line 15, col 9) to (line 17, col 8) +17 > })() !== i); + ~~~~~~~~~ => Pos: (177 to 185) SpanInfo: {"start":124,"length":60} + >while ((function () { + > return 30 * i; + > })() !== i) + >:=> (line 15, col 2) to (line 17, col 15) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_enums.baseline b/tests/baselines/reference/bpSpan_enums.baseline new file mode 100644 index 00000000000..1dd77f8d417 --- /dev/null +++ b/tests/baselines/reference/bpSpan_enums.baseline @@ -0,0 +1,248 @@ + +1 >enum e { + + ~~~~~~~~~ => Pos: (0 to 8) SpanInfo: {"start":0,"length":30} + >enum e { + > x, + > y, + > x + >} + >:=> (line 1, col 0) to (line 5, col 1) +-------------------------------- +2 > x, + + ~~~~~~~ => Pos: (9 to 15) SpanInfo: {"start":13,"length":1} + >x + >:=> (line 2, col 4) to (line 2, col 5) +-------------------------------- +3 > y, + + ~~~~~~~ => Pos: (16 to 22) SpanInfo: {"start":20,"length":1} + >y + >:=> (line 3, col 4) to (line 3, col 5) +-------------------------------- +4 > x + + ~~~~~~ => Pos: (23 to 28) SpanInfo: {"start":27,"length":1} + >x + >:=> (line 4, col 4) to (line 4, col 5) +-------------------------------- +5 >} + + ~~ => Pos: (29 to 30) SpanInfo: {"start":29,"length":1} + >} + >:=> (line 5, col 0) to (line 5, col 1) +-------------------------------- +6 >enum e2 { + + ~~~~~~~~~~ => Pos: (31 to 40) SpanInfo: {"start":31,"length":49} + >enum e2 { + > x = 10, + > y = 10, + > z, + > x2 + >} + >:=> (line 6, col 0) to (line 11, col 1) +-------------------------------- +7 > x = 10, + + ~~~~~~~~~~~~ => Pos: (41 to 52) SpanInfo: {"start":45,"length":6} + >x = 10 + >:=> (line 7, col 4) to (line 7, col 10) +-------------------------------- +8 > y = 10, + + ~~~~~~~~~~~~ => Pos: (53 to 64) SpanInfo: {"start":57,"length":6} + >y = 10 + >:=> (line 8, col 4) to (line 8, col 10) +-------------------------------- +9 > z, + + ~~~~~~~ => Pos: (65 to 71) SpanInfo: {"start":69,"length":1} + >z + >:=> (line 9, col 4) to (line 9, col 5) +-------------------------------- +10 > x2 + + ~~~~~~~ => Pos: (72 to 78) SpanInfo: {"start":76,"length":2} + >x2 + >:=> (line 10, col 4) to (line 10, col 6) +-------------------------------- +11 >} + + ~~ => Pos: (79 to 80) SpanInfo: {"start":79,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >enum e3 { + + ~~~~~~~~~~ => Pos: (81 to 90) SpanInfo: {"start":81,"length":11} + >enum e3 { + >} + >:=> (line 12, col 0) to (line 13, col 1) +-------------------------------- +13 >} + + ~~ => Pos: (91 to 92) SpanInfo: {"start":91,"length":1} + >} + >:=> (line 13, col 0) to (line 13, col 1) +-------------------------------- +14 >declare enum e4 { + + ~~~~~~~~~~~~~~~~~~ => Pos: (93 to 110) SpanInfo: undefined +-------------------------------- +15 > x, + + ~~~~~~~ => Pos: (111 to 117) SpanInfo: undefined +-------------------------------- +16 > y, + + ~~~~~~~ => Pos: (118 to 124) SpanInfo: undefined +-------------------------------- +17 > z, + + ~~~~~~~ => Pos: (125 to 131) SpanInfo: undefined +-------------------------------- +18 > x2 + + ~~~~~~~ => Pos: (132 to 138) SpanInfo: undefined +-------------------------------- +19 >} + + ~~ => Pos: (139 to 140) SpanInfo: undefined +-------------------------------- +20 >enum e11 + + ~~~~~~~~~~ => Pos: (141 to 150) SpanInfo: {"start":141,"length":33} + >enum e11 + >{ + > x, + > y, + > x + >} + >:=> (line 20, col 0) to (line 25, col 1) +-------------------------------- +21 >{ + + ~~ => Pos: (151 to 152) SpanInfo: {"start":157,"length":1} + >x + >:=> (line 22, col 4) to (line 22, col 5) +-------------------------------- +22 > x, + + ~~~~~~~ => Pos: (153 to 159) SpanInfo: {"start":157,"length":1} + >x + >:=> (line 22, col 4) to (line 22, col 5) +-------------------------------- +23 > y, + + ~~~~~~~ => Pos: (160 to 166) SpanInfo: {"start":164,"length":1} + >y + >:=> (line 23, col 4) to (line 23, col 5) +-------------------------------- +24 > x + + ~~~~~~ => Pos: (167 to 172) SpanInfo: {"start":171,"length":1} + >x + >:=> (line 24, col 4) to (line 24, col 5) +-------------------------------- +25 >} + + ~~ => Pos: (173 to 174) SpanInfo: {"start":173,"length":1} + >} + >:=> (line 25, col 0) to (line 25, col 1) +-------------------------------- +26 >enum e12 + + ~~~~~~~~~ => Pos: (175 to 183) SpanInfo: {"start":175,"length":50} + >enum e12 + >{ + > x = 10, + > y = 10, + > z, + > x2 + >} + >:=> (line 26, col 0) to (line 32, col 1) +-------------------------------- +27 >{ + + ~~ => Pos: (184 to 185) SpanInfo: {"start":190,"length":6} + >x = 10 + >:=> (line 28, col 4) to (line 28, col 10) +-------------------------------- +28 > x = 10, + + ~~~~~~~~~~~~ => Pos: (186 to 197) SpanInfo: {"start":190,"length":6} + >x = 10 + >:=> (line 28, col 4) to (line 28, col 10) +-------------------------------- +29 > y = 10, + + ~~~~~~~~~~~~ => Pos: (198 to 209) SpanInfo: {"start":202,"length":6} + >y = 10 + >:=> (line 29, col 4) to (line 29, col 10) +-------------------------------- +30 > z, + + ~~~~~~~ => Pos: (210 to 216) SpanInfo: {"start":214,"length":1} + >z + >:=> (line 30, col 4) to (line 30, col 5) +-------------------------------- +31 > x2 + + ~~~~~~~ => Pos: (217 to 223) SpanInfo: {"start":221,"length":2} + >x2 + >:=> (line 31, col 4) to (line 31, col 6) +-------------------------------- +32 >} + + ~~ => Pos: (224 to 225) SpanInfo: {"start":224,"length":1} + >} + >:=> (line 32, col 0) to (line 32, col 1) +-------------------------------- +33 >enum e13 + + ~~~~~~~~~ => Pos: (226 to 234) SpanInfo: {"start":226,"length":12} + >enum e13 + >{ + >} + >:=> (line 33, col 0) to (line 35, col 1) +-------------------------------- +34 >{ + + ~~ => Pos: (235 to 236) SpanInfo: {"start":237,"length":1} + >} + >:=> (line 35, col 0) to (line 35, col 1) +-------------------------------- +35 >} + + ~~ => Pos: (237 to 238) SpanInfo: {"start":237,"length":1} + >} + >:=> (line 35, col 0) to (line 35, col 1) +-------------------------------- +36 >declare enum e14 + + ~~~~~~~~~~~~~~~~~ => Pos: (239 to 255) SpanInfo: undefined +-------------------------------- +37 >{ + + ~~ => Pos: (256 to 257) SpanInfo: undefined +-------------------------------- +38 > x, + + ~~~~~~~ => Pos: (258 to 264) SpanInfo: undefined +-------------------------------- +39 > y, + + ~~~~~~~ => Pos: (265 to 271) SpanInfo: undefined +-------------------------------- +40 > z, + + ~~~~~~~ => Pos: (272 to 278) SpanInfo: undefined +-------------------------------- +41 > x2 + + ~~~~~~~ => Pos: (279 to 285) SpanInfo: undefined +-------------------------------- +42 >} + ~ => Pos: (286 to 286) SpanInfo: undefined \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_exportAssignment.baseline b/tests/baselines/reference/bpSpan_exportAssignment.baseline new file mode 100644 index 00000000000..a9d635a929c --- /dev/null +++ b/tests/baselines/reference/bpSpan_exportAssignment.baseline @@ -0,0 +1,23 @@ + +1 >class a { + + ~~~~~~~~~~ => Pos: (0 to 9) SpanInfo: {"start":0,"length":25} + >class a { + > public c; + >} + >:=> (line 1, col 0) to (line 3, col 1) +-------------------------------- +2 > public c; + + ~~~~~~~~~~~~~~ => Pos: (10 to 23) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (24 to 25) SpanInfo: {"start":24,"length":1} + >} + >:=> (line 3, col 0) to (line 3, col 1) +-------------------------------- +4 >export = a; + ~~~~~~~~~~~ => Pos: (26 to 36) SpanInfo: {"start":26,"length":10} + >export = a + >:=> (line 4, col 0) to (line 4, col 10) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_for.baseline b/tests/baselines/reference/bpSpan_for.baseline new file mode 100644 index 00000000000..7fd6ba4c858 --- /dev/null +++ b/tests/baselines/reference/bpSpan_for.baseline @@ -0,0 +1,253 @@ + +1 >for (var i = 0; i < 10; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (0 to 14) SpanInfo: {"start":5,"length":9} + >var i = 0 + >:=> (line 1, col 5) to (line 1, col 14) +1 >for (var i = 0; i < 10; i++) { + + ~~~~~~~~ => Pos: (15 to 22) SpanInfo: {"start":16,"length":6} + >i < 10 + >:=> (line 1, col 16) to (line 1, col 22) +1 >for (var i = 0; i < 10; i++) { + + ~~~~~~~~ => Pos: (23 to 30) SpanInfo: {"start":24,"length":3} + >i++ + >:=> (line 1, col 24) to (line 1, col 27) +-------------------------------- +2 > WScript.Echo("i: " + i); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (31 to 59) SpanInfo: {"start":35,"length":23} + >WScript.Echo("i: " + i) + >:=> (line 2, col 4) to (line 2, col 27) +-------------------------------- +3 >} + + ~~ => Pos: (60 to 61) SpanInfo: {"start":35,"length":23} + >WScript.Echo("i: " + i) + >:=> (line 2, col 4) to (line 2, col 27) +-------------------------------- +4 >for (i = 0; i < 10; i++) + + ~~~~~~~~~~~ => Pos: (62 to 72) SpanInfo: {"start":67,"length":5} + >i = 0 + >:=> (line 4, col 5) to (line 4, col 10) +4 >for (i = 0; i < 10; i++) + + ~~~~~~~~ => Pos: (73 to 80) SpanInfo: {"start":74,"length":6} + >i < 10 + >:=> (line 4, col 12) to (line 4, col 18) +4 >for (i = 0; i < 10; i++) + + ~~~~~~ => Pos: (81 to 86) SpanInfo: {"start":82,"length":3} + >i++ + >:=> (line 4, col 20) to (line 4, col 23) +-------------------------------- +5 >{ + + ~~ => Pos: (87 to 88) SpanInfo: {"start":93,"length":23} + >WScript.Echo("i: " + i) + >:=> (line 6, col 4) to (line 6, col 27) +-------------------------------- +6 > WScript.Echo("i: " + i); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (89 to 117) SpanInfo: {"start":93,"length":23} + >WScript.Echo("i: " + i) + >:=> (line 6, col 4) to (line 6, col 27) +-------------------------------- +7 >} + + ~~ => Pos: (118 to 119) SpanInfo: {"start":93,"length":23} + >WScript.Echo("i: " + i) + >:=> (line 6, col 4) to (line 6, col 27) +-------------------------------- +8 >for (var j = 0; j < 10; ) { + + ~~~~~~~~~~~~~~~ => Pos: (120 to 134) SpanInfo: {"start":125,"length":9} + >var j = 0 + >:=> (line 8, col 5) to (line 8, col 14) +8 >for (var j = 0; j < 10; ) { + + ~~~~~~~~~~~~~ => Pos: (135 to 147) SpanInfo: {"start":136,"length":6} + >j < 10 + >:=> (line 8, col 16) to (line 8, col 22) +-------------------------------- +9 > j++; + + ~~~~~~~~~ => Pos: (148 to 156) SpanInfo: {"start":152,"length":3} + >j++ + >:=> (line 9, col 4) to (line 9, col 7) +-------------------------------- +10 > if (j == 1) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (157 to 174) SpanInfo: {"start":161,"length":11} + >if (j == 1) + >:=> (line 10, col 4) to (line 10, col 15) +-------------------------------- +11 > continue; + + ~~~~~~~~~~~~~~~~~~ => Pos: (175 to 192) SpanInfo: {"start":183,"length":8} + >continue + >:=> (line 11, col 8) to (line 11, col 16) +-------------------------------- +12 > } + + ~~~~~~ => Pos: (193 to 198) SpanInfo: {"start":183,"length":8} + >continue + >:=> (line 11, col 8) to (line 11, col 16) +-------------------------------- +13 >} + + ~~ => Pos: (199 to 200) SpanInfo: {"start":161,"length":11} + >if (j == 1) + >:=> (line 10, col 4) to (line 10, col 15) +-------------------------------- +14 >for (j = 0; j < 10;) + + ~~~~~~~~~~~ => Pos: (201 to 211) SpanInfo: {"start":206,"length":5} + >j = 0 + >:=> (line 14, col 5) to (line 14, col 10) +14 >for (j = 0; j < 10;) + + ~~~~~~~~~~ => Pos: (212 to 221) SpanInfo: {"start":213,"length":6} + >j < 10 + >:=> (line 14, col 12) to (line 14, col 18) +-------------------------------- +15 >{ + + ~~ => Pos: (222 to 223) SpanInfo: {"start":228,"length":3} + >j++ + >:=> (line 16, col 4) to (line 16, col 7) +-------------------------------- +16 > j++; + + ~~~~~~~~~ => Pos: (224 to 232) SpanInfo: {"start":228,"length":3} + >j++ + >:=> (line 16, col 4) to (line 16, col 7) +-------------------------------- +17 >} + + ~~ => Pos: (233 to 234) SpanInfo: {"start":228,"length":3} + >j++ + >:=> (line 16, col 4) to (line 16, col 7) +-------------------------------- +18 >for (var k = 0;; k++) { + + ~~~~~~~~~~~~~~~~ => Pos: (235 to 250) SpanInfo: {"start":240,"length":9} + >var k = 0 + >:=> (line 18, col 5) to (line 18, col 14) +18 >for (var k = 0;; k++) { + + ~~~~~~~~ => Pos: (251 to 258) SpanInfo: {"start":252,"length":3} + >k++ + >:=> (line 18, col 17) to (line 18, col 20) +-------------------------------- +19 >} + + ~~ => Pos: (259 to 260) SpanInfo: undefined +-------------------------------- +20 >for (k = 0;; k++) + + ~~~~~~~~~~~~ => Pos: (261 to 272) SpanInfo: {"start":266,"length":5} + >k = 0 + >:=> (line 20, col 5) to (line 20, col 10) +20 >for (k = 0;; k++) + + ~~~~~~ => Pos: (273 to 278) SpanInfo: {"start":274,"length":3} + >k++ + >:=> (line 20, col 13) to (line 20, col 16) +-------------------------------- +21 >{ + + ~~ => Pos: (279 to 280) SpanInfo: undefined +-------------------------------- +22 >} + + ~~ => Pos: (281 to 282) SpanInfo: undefined +-------------------------------- +23 >for (; k < 10; k++) { + + ~~~~~~~~~~~~~~ => Pos: (283 to 296) SpanInfo: {"start":290,"length":6} + >k < 10 + >:=> (line 23, col 7) to (line 23, col 13) +23 >for (; k < 10; k++) { + + ~~~~~~~~ => Pos: (297 to 304) SpanInfo: {"start":298,"length":3} + >k++ + >:=> (line 23, col 15) to (line 23, col 18) +-------------------------------- +24 >} + + ~~ => Pos: (305 to 306) SpanInfo: undefined +-------------------------------- +25 >for (;;) { + + ~~~~~~~~~~~ => Pos: (307 to 317) SpanInfo: undefined +-------------------------------- +26 > i++; + + ~~~~~~~~~ => Pos: (318 to 326) SpanInfo: {"start":322,"length":3} + >i++ + >:=> (line 26, col 4) to (line 26, col 7) +-------------------------------- +27 >} + + ~~ => Pos: (327 to 328) SpanInfo: {"start":322,"length":3} + >i++ + >:=> (line 26, col 4) to (line 26, col 7) +-------------------------------- +28 >for (;;) + + ~~~~~~~~~ => Pos: (329 to 337) SpanInfo: undefined +-------------------------------- +29 >{ + + ~~ => Pos: (338 to 339) SpanInfo: {"start":344,"length":3} + >i++ + >:=> (line 30, col 4) to (line 30, col 7) +-------------------------------- +30 > i++; + + ~~~~~~~~~ => Pos: (340 to 348) SpanInfo: {"start":344,"length":3} + >i++ + >:=> (line 30, col 4) to (line 30, col 7) +-------------------------------- +31 >} + + ~~ => Pos: (349 to 350) SpanInfo: {"start":344,"length":3} + >i++ + >:=> (line 30, col 4) to (line 30, col 7) +-------------------------------- +32 >for (i = 0, j = 20; j < 20, i < 20; j++) { + + ~~~~~ => Pos: (351 to 355) SpanInfo: {"start":356,"length":13} + >i = 0, j = 20 + >:=> (line 32, col 5) to (line 32, col 18) +32 >for (i = 0, j = 20; j < 20, i < 20; j++) { + + ~~~~~~ => Pos: (356 to 361) SpanInfo: {"start":356,"length":5} + >i = 0 + >:=> (line 32, col 5) to (line 32, col 10) +32 >for (i = 0, j = 20; j < 20, i < 20; j++) { + + ~~~~~~~~ => Pos: (362 to 369) SpanInfo: {"start":363,"length":6} + >j = 20 + >:=> (line 32, col 12) to (line 32, col 18) +32 >for (i = 0, j = 20; j < 20, i < 20; j++) { + + ~~~~~~~~ => Pos: (370 to 377) SpanInfo: {"start":371,"length":6} + >j < 20 + >:=> (line 32, col 20) to (line 32, col 26) +32 >for (i = 0, j = 20; j < 20, i < 20; j++) { + + ~~~~~~~~ => Pos: (378 to 385) SpanInfo: {"start":379,"length":6} + >i < 20 + >:=> (line 32, col 28) to (line 32, col 34) +32 >for (i = 0, j = 20; j < 20, i < 20; j++) { + + ~~~~~~~~ => Pos: (386 to 393) SpanInfo: {"start":387,"length":3} + >j++ + >:=> (line 32, col 36) to (line 32, col 39) +-------------------------------- +33 >} + ~ => Pos: (394 to 394) SpanInfo: undefined \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_forIn.baseline b/tests/baselines/reference/bpSpan_forIn.baseline new file mode 100644 index 00000000000..c2b72df5b12 --- /dev/null +++ b/tests/baselines/reference/bpSpan_forIn.baseline @@ -0,0 +1,143 @@ + +1 >for (var x in String) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 23) SpanInfo: {"start":0,"length":21} + >for (var x in String) + >:=> (line 1, col 0) to (line 1, col 21) +-------------------------------- +2 > WScript.Echo(x); + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (24 to 44) SpanInfo: {"start":28,"length":15} + >WScript.Echo(x) + >:=> (line 2, col 4) to (line 2, col 19) +-------------------------------- +3 >} + + ~~ => Pos: (45 to 46) SpanInfo: {"start":28,"length":15} + >WScript.Echo(x) + >:=> (line 2, col 4) to (line 2, col 19) +-------------------------------- +4 >for (x in String) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (47 to 66) SpanInfo: {"start":47,"length":17} + >for (x in String) + >:=> (line 4, col 0) to (line 4, col 17) +-------------------------------- +5 > WScript.Echo(x); + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (67 to 87) SpanInfo: {"start":71,"length":15} + >WScript.Echo(x) + >:=> (line 5, col 4) to (line 5, col 19) +-------------------------------- +6 >} + + ~~ => Pos: (88 to 89) SpanInfo: {"start":71,"length":15} + >WScript.Echo(x) + >:=> (line 5, col 4) to (line 5, col 19) +-------------------------------- +7 >for (var x2 in String) + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (90 to 112) SpanInfo: {"start":90,"length":22} + >for (var x2 in String) + >:=> (line 7, col 0) to (line 7, col 22) +-------------------------------- +8 >{ + + ~~ => Pos: (113 to 114) SpanInfo: {"start":119,"length":16} + >WScript.Echo(x2) + >:=> (line 9, col 4) to (line 9, col 20) +-------------------------------- +9 > WScript.Echo(x2); + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (115 to 136) SpanInfo: {"start":119,"length":16} + >WScript.Echo(x2) + >:=> (line 9, col 4) to (line 9, col 20) +-------------------------------- +10 >} + + ~~ => Pos: (137 to 138) SpanInfo: {"start":119,"length":16} + >WScript.Echo(x2) + >:=> (line 9, col 4) to (line 9, col 20) +-------------------------------- +11 >for (x in String) + + ~~~~~~~~~~~~~~~~~~ => Pos: (139 to 156) SpanInfo: {"start":139,"length":17} + >for (x in String) + >:=> (line 11, col 0) to (line 11, col 17) +-------------------------------- +12 >{ + + ~~ => Pos: (157 to 158) SpanInfo: {"start":163,"length":15} + >WScript.Echo(x) + >:=> (line 13, col 4) to (line 13, col 19) +-------------------------------- +13 > WScript.Echo(x); + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (159 to 179) SpanInfo: {"start":163,"length":15} + >WScript.Echo(x) + >:=> (line 13, col 4) to (line 13, col 19) +-------------------------------- +14 >} + + ~~ => Pos: (180 to 181) SpanInfo: {"start":163,"length":15} + >WScript.Echo(x) + >:=> (line 13, col 4) to (line 13, col 19) +-------------------------------- +15 >var z = 10; + + ~~~~~~~~~~~~ => Pos: (182 to 193) SpanInfo: {"start":182,"length":10} + >var z = 10 + >:=> (line 15, col 0) to (line 15, col 10) +-------------------------------- +16 >for (x in function foo() { + + ~~~~~~~~~ => Pos: (194 to 202) SpanInfo: {"start":194,"length":54} + >for (x in function foo() { + > return new String(); + >}) + >:=> (line 16, col 0) to (line 18, col 2) +16 >for (x in function foo() { + + ~~~~~~~~~~~~~~~~~~ => Pos: (203 to 220) SpanInfo: {"start":225,"length":19} + >return new String() + >:=> (line 17, col 4) to (line 17, col 23) +-------------------------------- +17 > return new String(); + + ~~~~~~~~~~ => Pos: (221 to 230) SpanInfo: {"start":225,"length":19} + >return new String() + >:=> (line 17, col 4) to (line 17, col 23) +17 > return new String(); + + ~~~~~~~~~~~~~~~ => Pos: (231 to 245) SpanInfo: {"start":232,"length":12} + >new String() + >:=> (line 17, col 11) to (line 17, col 23) +-------------------------------- +18 >}) { + + ~ => Pos: (246 to 246) SpanInfo: {"start":246,"length":1} + >} + >:=> (line 18, col 0) to (line 18, col 1) +18 >}) { + + ~ => Pos: (247 to 247) SpanInfo: {"start":194,"length":54} + >for (x in function foo() { + > return new String(); + >}) + >:=> (line 16, col 0) to (line 18, col 2) +18 >}) { + + ~~~ => Pos: (248 to 250) SpanInfo: {"start":255,"length":3} + >z++ + >:=> (line 19, col 4) to (line 19, col 7) +-------------------------------- +19 > z++; + + ~~~~~~~~~ => Pos: (251 to 259) SpanInfo: {"start":255,"length":3} + >z++ + >:=> (line 19, col 4) to (line 19, col 7) +-------------------------------- +20 >} + ~ => Pos: (260 to 260) SpanInfo: {"start":255,"length":3} + >z++ + >:=> (line 19, col 4) to (line 19, col 7) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_functionExpressions.baseline b/tests/baselines/reference/bpSpan_functionExpressions.baseline new file mode 100644 index 00000000000..135edff9418 --- /dev/null +++ b/tests/baselines/reference/bpSpan_functionExpressions.baseline @@ -0,0 +1,189 @@ + +1 >var greetings = 0; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 18) SpanInfo: {"start":0,"length":17} + >var greetings = 0 + >:=> (line 1, col 0) to (line 1, col 17) +-------------------------------- +2 >var greet = (greeting: string): number => { + + ~~~~~~~~~~~ => Pos: (19 to 29) SpanInfo: {"start":19,"length":84} + >var greet = (greeting: string): number => { + > greetings++; + > return greetings; + >} + >:=> (line 2, col 0) to (line 5, col 1) +2 >var greet = (greeting: string): number => { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (30 to 62) SpanInfo: {"start":67,"length":11} + >greetings++ + >:=> (line 3, col 4) to (line 3, col 15) +-------------------------------- +3 > greetings++; + + ~~~~~~~~~~~~~~~~~ => Pos: (63 to 79) SpanInfo: {"start":67,"length":11} + >greetings++ + >:=> (line 3, col 4) to (line 3, col 15) +-------------------------------- +4 > return greetings; + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (80 to 101) SpanInfo: {"start":84,"length":16} + >return greetings + >:=> (line 4, col 4) to (line 4, col 20) +-------------------------------- +5 >} + + ~~ => Pos: (102 to 103) SpanInfo: {"start":102,"length":1} + >} + >:=> (line 5, col 0) to (line 5, col 1) +-------------------------------- +6 >greet("Hello"); + + ~~~~~~~~~~~~~~~~ => Pos: (104 to 119) SpanInfo: {"start":104,"length":14} + >greet("Hello") + >:=> (line 6, col 0) to (line 6, col 14) +-------------------------------- +7 >var incrGreetings = () => greetings++; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (120 to 138) SpanInfo: {"start":120,"length":37} + >var incrGreetings = () => greetings++ + >:=> (line 7, col 0) to (line 7, col 37) +7 >var incrGreetings = () => greetings++; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (139 to 158) SpanInfo: {"start":146,"length":11} + >greetings++ + >:=> (line 7, col 26) to (line 7, col 37) +-------------------------------- +8 >var greetNewMsg = msg => greet(msg); + + ~~~~~~~~~~~~~~~~~ => Pos: (159 to 175) SpanInfo: {"start":159,"length":35} + >var greetNewMsg = msg => greet(msg) + >:=> (line 8, col 0) to (line 8, col 35) +8 >var greetNewMsg = msg => greet(msg); + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (176 to 195) SpanInfo: {"start":184,"length":10} + >greet(msg) + >:=> (line 8, col 25) to (line 8, col 35) +-------------------------------- +9 >greetNewMsg = function (msg: string) { + + ~~~~~~~~~~~~~ => Pos: (196 to 208) SpanInfo: {"start":196,"length":63} + >greetNewMsg = function (msg: string) { + > return greet(msg); + >} + >:=> (line 9, col 0) to (line 11, col 1) +9 >greetNewMsg = function (msg: string) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (209 to 234) SpanInfo: {"start":239,"length":17} + >return greet(msg) + >:=> (line 10, col 4) to (line 10, col 21) +-------------------------------- +10 > return greet(msg); + + ~~~~~~~~~~ => Pos: (235 to 244) SpanInfo: {"start":239,"length":17} + >return greet(msg) + >:=> (line 10, col 4) to (line 10, col 21) +10 > return greet(msg); + + ~~~~~~~~~~~~~ => Pos: (245 to 257) SpanInfo: {"start":246,"length":10} + >greet(msg) + >:=> (line 10, col 11) to (line 10, col 21) +-------------------------------- +11 >}; + + ~~~ => Pos: (258 to 260) SpanInfo: {"start":258,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >function bar(a = function foo() { + + ~~~~~~~~~~~~~ => Pos: (261 to 273) SpanInfo: {"start":326,"length":9} + >if (!a()) + >:=> (line 15, col 4) to (line 15, col 13) +12 >function bar(a = function foo() { + + ~~~ => Pos: (274 to 276) SpanInfo: {"start":274,"length":44} + >a = function foo() { + > return greetings; + >} + >:=> (line 12, col 13) to (line 14, col 1) +12 >function bar(a = function foo() { + + ~~~~~~~~~~~~~~~~~~ => Pos: (277 to 294) SpanInfo: {"start":299,"length":16} + >return greetings + >:=> (line 13, col 4) to (line 13, col 20) +-------------------------------- +13 > return greetings; + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (295 to 316) SpanInfo: {"start":299,"length":16} + >return greetings + >:=> (line 13, col 4) to (line 13, col 20) +-------------------------------- +14 >}) { + + ~~ => Pos: (317 to 318) SpanInfo: {"start":317,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +14 >}) { + + ~~~ => Pos: (319 to 321) SpanInfo: {"start":326,"length":9} + >if (!a()) + >:=> (line 15, col 4) to (line 15, col 13) +-------------------------------- +15 > if (!a()) { + + ~~~~~~~~~ => Pos: (322 to 330) SpanInfo: {"start":326,"length":9} + >if (!a()) + >:=> (line 15, col 4) to (line 15, col 13) +15 > if (!a()) { + + ~~~ => Pos: (331 to 333) SpanInfo: {"start":331,"length":3} + >a() + >:=> (line 15, col 9) to (line 15, col 12) +15 > if (!a()) { + + ~~~~ => Pos: (334 to 337) SpanInfo: {"start":326,"length":9} + >if (!a()) + >:=> (line 15, col 4) to (line 15, col 13) +-------------------------------- +16 > return a; + + ~~~~~~~~~~~~~~~~~~ => Pos: (338 to 355) SpanInfo: {"start":346,"length":8} + >return a + >:=> (line 16, col 8) to (line 16, col 16) +-------------------------------- +17 > } + + ~~~~~~ => Pos: (356 to 361) SpanInfo: {"start":346,"length":8} + >return a + >:=> (line 16, col 8) to (line 16, col 16) +-------------------------------- +18 > return function bar() { + + ~~~~~~~~~~ => Pos: (362 to 371) SpanInfo: {"start":366,"length":56} + >return function bar() { + > return -greetings; + > } + >:=> (line 18, col 4) to (line 20, col 5) +18 > return function bar() { + + ~~~~~~~~~~~~~~~~~~ => Pos: (372 to 389) SpanInfo: {"start":398,"length":17} + >return -greetings + >:=> (line 19, col 8) to (line 19, col 25) +-------------------------------- +19 > return -greetings; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (390 to 416) SpanInfo: {"start":398,"length":17} + >return -greetings + >:=> (line 19, col 8) to (line 19, col 25) +-------------------------------- +20 > }; + + ~~~~~~~ => Pos: (417 to 423) SpanInfo: {"start":421,"length":1} + >} + >:=> (line 20, col 4) to (line 20, col 5) +-------------------------------- +21 >} + ~ => Pos: (424 to 424) SpanInfo: {"start":424,"length":1} + >} + >:=> (line 21, col 0) to (line 21, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_functions.baseline b/tests/baselines/reference/bpSpan_functions.baseline new file mode 100644 index 00000000000..535f177c0f6 --- /dev/null +++ b/tests/baselines/reference/bpSpan_functions.baseline @@ -0,0 +1,372 @@ + +1 >var greetings = 0; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 18) SpanInfo: {"start":0,"length":17} + >var greetings = 0 + >:=> (line 1, col 0) to (line 1, col 17) +-------------------------------- +2 >function greet(greeting: string): number { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (19 to 61) SpanInfo: {"start":66,"length":11} + >greetings++ + >:=> (line 3, col 4) to (line 3, col 15) +-------------------------------- +3 > greetings++; + + ~~~~~~~~~~~~~~~~~ => Pos: (62 to 78) SpanInfo: {"start":66,"length":11} + >greetings++ + >:=> (line 3, col 4) to (line 3, col 15) +-------------------------------- +4 > return greetings; + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (79 to 100) SpanInfo: {"start":83,"length":16} + >return greetings + >:=> (line 4, col 4) to (line 4, col 20) +-------------------------------- +5 >} + + ~~ => Pos: (101 to 102) SpanInfo: {"start":101,"length":1} + >} + >:=> (line 5, col 0) to (line 5, col 1) +-------------------------------- +6 >function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (103 to 135) SpanInfo: {"start":196,"length":11} + >greetings++ + >:=> (line 7, col 4) to (line 7, col 15) +6 >function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (136 to 155) SpanInfo: {"start":137,"length":6} + >n = 10 + >:=> (line 6, col 34) to (line 6, col 40) +6 >function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (156 to 188) SpanInfo: {"start":157,"length":23} + >...restParams: string[] + >:=> (line 6, col 54) to (line 6, col 77) +6 >function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~=> Pos: (189 to 191) SpanInfo: {"start":196,"length":11} + >greetings++ + >:=> (line 7, col 4) to (line 7, col 15) +-------------------------------- +7 > greetings++; + + ~~~~~~~~~~~~~~~~~ => Pos: (192 to 208) SpanInfo: {"start":196,"length":11} + >greetings++ + >:=> (line 7, col 4) to (line 7, col 15) +-------------------------------- +8 > return greetings; + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (209 to 230) SpanInfo: {"start":213,"length":16} + >return greetings + >:=> (line 8, col 4) to (line 8, col 20) +-------------------------------- +9 >} + + ~~ => Pos: (231 to 232) SpanInfo: {"start":231,"length":1} + >} + >:=> (line 9, col 0) to (line 9, col 1) +-------------------------------- +10 >function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (233 to 262) SpanInfo: {"start":315,"length":6} + >return + >:=> (line 12, col 4) to (line 12, col 10) +10 >function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (263 to 282) SpanInfo: {"start":264,"length":6} + >n = 10 + >:=> (line 10, col 31) to (line 10, col 37) +10 >function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + + ~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (283 to 308) SpanInfo: {"start":284,"length":23} + >...restParams: string[] + >:=> (line 10, col 51) to (line 10, col 74) +-------------------------------- +11 >{ + + ~~ => Pos: (309 to 310) SpanInfo: {"start":315,"length":6} + >return + >:=> (line 12, col 4) to (line 12, col 10) +-------------------------------- +12 > return; + + ~~~~~~~~~~~~ => Pos: (311 to 322) SpanInfo: {"start":315,"length":6} + >return + >:=> (line 12, col 4) to (line 12, col 10) +-------------------------------- +13 >} + + ~~ => Pos: (323 to 324) SpanInfo: {"start":323,"length":1} + >} + >:=> (line 13, col 0) to (line 13, col 1) +-------------------------------- +14 >module m { + + ~~~~~~~~~~~ => Pos: (325 to 335) SpanInfo: {"start":325,"length":389} + >module m { + > var greetings = 0; + > function greet(greeting: string): number { + > greetings++; + > return greetings; + > } + > function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + > greetings++; + > return greetings; + > } + > function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + > { + > return; + > } + >} + >:=> (line 14, col 0) to (line 28, col 1) +-------------------------------- +15 > var greetings = 0; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (336 to 358) SpanInfo: {"start":340,"length":17} + >var greetings = 0 + >:=> (line 15, col 4) to (line 15, col 21) +-------------------------------- +16 > function greet(greeting: string): number { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (359 to 405) SpanInfo: {"start":414,"length":11} + >greetings++ + >:=> (line 17, col 8) to (line 17, col 19) +-------------------------------- +17 > greetings++; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (406 to 426) SpanInfo: {"start":414,"length":11} + >greetings++ + >:=> (line 17, col 8) to (line 17, col 19) +-------------------------------- +18 > return greetings; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (427 to 452) SpanInfo: {"start":435,"length":16} + >return greetings + >:=> (line 18, col 8) to (line 18, col 24) +-------------------------------- +19 > } + + ~~~~~~ => Pos: (453 to 458) SpanInfo: {"start":457,"length":1} + >} + >:=> (line 19, col 4) to (line 19, col 5) +-------------------------------- +20 > function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (459 to 495) SpanInfo: {"start":560,"length":11} + >greetings++ + >:=> (line 21, col 8) to (line 21, col 19) +20 > function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (496 to 515) SpanInfo: {"start":497,"length":6} + >n = 10 + >:=> (line 20, col 38) to (line 20, col 44) +20 > function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (516 to 548) SpanInfo: {"start":517,"length":23} + >...restParams: string[] + >:=> (line 20, col 58) to (line 20, col 81) +20 > function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~=> Pos: (549 to 551) SpanInfo: {"start":560,"length":11} + >greetings++ + >:=> (line 21, col 8) to (line 21, col 19) +-------------------------------- +21 > greetings++; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (552 to 572) SpanInfo: {"start":560,"length":11} + >greetings++ + >:=> (line 21, col 8) to (line 21, col 19) +-------------------------------- +22 > return greetings; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (573 to 598) SpanInfo: {"start":581,"length":16} + >return greetings + >:=> (line 22, col 8) to (line 22, col 24) +-------------------------------- +23 > } + + ~~~~~~ => Pos: (599 to 604) SpanInfo: {"start":603,"length":1} + >} + >:=> (line 23, col 4) to (line 23, col 5) +-------------------------------- +24 > function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (605 to 638) SpanInfo: {"start":699,"length":6} + >return + >:=> (line 26, col 8) to (line 26, col 14) +24 > function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (639 to 658) SpanInfo: {"start":640,"length":6} + >n = 10 + >:=> (line 24, col 35) to (line 24, col 41) +24 > function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + + ~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (659 to 684) SpanInfo: {"start":660,"length":23} + >...restParams: string[] + >:=> (line 24, col 55) to (line 24, col 78) +-------------------------------- +25 > { + + ~~~~~~ => Pos: (685 to 690) SpanInfo: {"start":699,"length":6} + >return + >:=> (line 26, col 8) to (line 26, col 14) +-------------------------------- +26 > return; + + ~~~~~~~~~~~~~~~~ => Pos: (691 to 706) SpanInfo: {"start":699,"length":6} + >return + >:=> (line 26, col 8) to (line 26, col 14) +-------------------------------- +27 > } + + ~~~~~~ => Pos: (707 to 712) SpanInfo: {"start":711,"length":1} + >} + >:=> (line 27, col 4) to (line 27, col 5) +-------------------------------- +28 >} + + ~~ => Pos: (713 to 714) SpanInfo: {"start":713,"length":1} + >} + >:=> (line 28, col 0) to (line 28, col 1) +-------------------------------- +29 >module m1 { + + ~~~~~~~~~~~~ => Pos: (715 to 726) SpanInfo: {"start":715,"length":411} + >module m1 { + > var greetings = 0; + > export function greet(greeting: string): number { + > greetings++; + > return greetings; + > } + > export function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + > greetings++; + > return greetings; + > } + > export function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + > { + > return; + > } + >} + >:=> (line 29, col 0) to (line 43, col 1) +-------------------------------- +30 > var greetings = 0; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (727 to 749) SpanInfo: {"start":731,"length":17} + >var greetings = 0 + >:=> (line 30, col 4) to (line 30, col 21) +-------------------------------- +31 > export function greet(greeting: string): number { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (750 to 803) SpanInfo: {"start":754,"length":102} + >export function greet(greeting: string): number { + > greetings++; + > return greetings; + > } + >:=> (line 31, col 4) to (line 34, col 5) +-------------------------------- +32 > greetings++; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (804 to 824) SpanInfo: {"start":812,"length":11} + >greetings++ + >:=> (line 32, col 8) to (line 32, col 19) +-------------------------------- +33 > return greetings; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (825 to 850) SpanInfo: {"start":833,"length":16} + >return greetings + >:=> (line 33, col 8) to (line 33, col 24) +-------------------------------- +34 > } + + ~~~~~~ => Pos: (851 to 856) SpanInfo: {"start":855,"length":1} + >} + >:=> (line 34, col 4) to (line 34, col 5) +-------------------------------- +35 > export function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (857 to 900) SpanInfo: {"start":861,"length":148} + >export function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + > greetings++; + > return greetings; + > } + >:=> (line 35, col 4) to (line 38, col 5) +35 > export function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (901 to 920) SpanInfo: {"start":902,"length":6} + >n = 10 + >:=> (line 35, col 45) to (line 35, col 51) +35 > export function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (921 to 953) SpanInfo: {"start":922,"length":23} + >...restParams: string[] + >:=> (line 35, col 65) to (line 35, col 88) +35 > export function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + + ~~~=> Pos: (954 to 956) SpanInfo: {"start":861,"length":148} + >export function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + > greetings++; + > return greetings; + > } + >:=> (line 35, col 4) to (line 38, col 5) +-------------------------------- +36 > greetings++; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (957 to 977) SpanInfo: {"start":965,"length":11} + >greetings++ + >:=> (line 36, col 8) to (line 36, col 19) +-------------------------------- +37 > return greetings; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (978 to 1003) SpanInfo: {"start":986,"length":16} + >return greetings + >:=> (line 37, col 8) to (line 37, col 24) +-------------------------------- +38 > } + + ~~~~~~ => Pos: (1004 to 1009) SpanInfo: {"start":1008,"length":1} + >} + >:=> (line 38, col 4) to (line 38, col 5) +-------------------------------- +39 > export function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1010 to 1050) SpanInfo: {"start":1014,"length":110} + >export function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + > { + > return; + > } + >:=> (line 39, col 4) to (line 42, col 5) +39 > export function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (1051 to 1070) SpanInfo: {"start":1052,"length":6} + >n = 10 + >:=> (line 39, col 42) to (line 39, col 48) +39 > export function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) + + ~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1071 to 1096) SpanInfo: {"start":1072,"length":23} + >...restParams: string[] + >:=> (line 39, col 62) to (line 39, col 85) +-------------------------------- +40 > { + + ~~~~~~ => Pos: (1097 to 1102) SpanInfo: {"start":1111,"length":6} + >return + >:=> (line 41, col 8) to (line 41, col 14) +-------------------------------- +41 > return; + + ~~~~~~~~~~~~~~~~ => Pos: (1103 to 1118) SpanInfo: {"start":1111,"length":6} + >return + >:=> (line 41, col 8) to (line 41, col 14) +-------------------------------- +42 > } + + ~~~~~~ => Pos: (1119 to 1124) SpanInfo: {"start":1123,"length":1} + >} + >:=> (line 42, col 4) to (line 42, col 5) +-------------------------------- +43 >} + ~ => Pos: (1125 to 1125) SpanInfo: {"start":1125,"length":1} + >} + >:=> (line 43, col 0) to (line 43, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_ifElse.baseline b/tests/baselines/reference/bpSpan_ifElse.baseline new file mode 100644 index 00000000000..b66316d3392 --- /dev/null +++ b/tests/baselines/reference/bpSpan_ifElse.baseline @@ -0,0 +1,166 @@ + +1 >var i = 10; + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":10} + >var i = 10 + >:=> (line 1, col 0) to (line 1, col 10) +-------------------------------- +2 >if (i == 10) { + + ~~~~~~~~~~~~~~~ => Pos: (12 to 26) SpanInfo: {"start":12,"length":12} + >if (i == 10) + >:=> (line 2, col 0) to (line 2, col 12) +-------------------------------- +3 > i++; + + ~~~~~~~~~ => Pos: (27 to 35) SpanInfo: {"start":31,"length":3} + >i++ + >:=> (line 3, col 4) to (line 3, col 7) +-------------------------------- +4 >} else + + ~ => Pos: (36 to 36) SpanInfo: {"start":31,"length":3} + >i++ + >:=> (line 3, col 4) to (line 3, col 7) +4 >} else + + ~~~~~~ => Pos: (37 to 42) SpanInfo: undefined +-------------------------------- +5 >{ + + ~~ => Pos: (43 to 44) SpanInfo: undefined +-------------------------------- +6 >} + + ~~ => Pos: (45 to 46) SpanInfo: undefined +-------------------------------- +7 >if (i == 10) + + ~~~~~~~~~~~~~ => Pos: (47 to 59) SpanInfo: {"start":47,"length":12} + >if (i == 10) + >:=> (line 7, col 0) to (line 7, col 12) +-------------------------------- +8 >{ + + ~~ => Pos: (60 to 61) SpanInfo: {"start":66,"length":3} + >i++ + >:=> (line 9, col 4) to (line 9, col 7) +-------------------------------- +9 > i++; + + ~~~~~~~~~ => Pos: (62 to 70) SpanInfo: {"start":66,"length":3} + >i++ + >:=> (line 9, col 4) to (line 9, col 7) +-------------------------------- +10 >} + + ~~ => Pos: (71 to 72) SpanInfo: {"start":66,"length":3} + >i++ + >:=> (line 9, col 4) to (line 9, col 7) +-------------------------------- +11 >else if (i == 20) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (73 to 92) SpanInfo: {"start":78,"length":12} + >if (i == 20) + >:=> (line 11, col 5) to (line 11, col 17) +-------------------------------- +12 > i--; + + ~~~~~~~~~ => Pos: (93 to 101) SpanInfo: {"start":97,"length":3} + >i-- + >:=> (line 12, col 4) to (line 12, col 7) +-------------------------------- +13 >} else if (i == 30) { + + ~ => Pos: (102 to 102) SpanInfo: {"start":97,"length":3} + >i-- + >:=> (line 12, col 4) to (line 12, col 7) +13 >} else if (i == 30) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (103 to 123) SpanInfo: {"start":109,"length":12} + >if (i == 30) + >:=> (line 13, col 7) to (line 13, col 19) +-------------------------------- +14 > i += 70; + + ~~~~~~~~~~~~~ => Pos: (124 to 136) SpanInfo: {"start":128,"length":7} + >i += 70 + >:=> (line 14, col 4) to (line 14, col 11) +-------------------------------- +15 >} else { + + ~ => Pos: (137 to 137) SpanInfo: {"start":128,"length":7} + >i += 70 + >:=> (line 14, col 4) to (line 14, col 11) +15 >} else { + + ~~~~~~~~ => Pos: (138 to 145) SpanInfo: {"start":150,"length":3} + >i-- + >:=> (line 16, col 4) to (line 16, col 7) +-------------------------------- +16 > i--; + + ~~~~~~~~~ => Pos: (146 to 154) SpanInfo: {"start":150,"length":3} + >i-- + >:=> (line 16, col 4) to (line 16, col 7) +-------------------------------- +17 >} + + ~~ => Pos: (155 to 156) SpanInfo: {"start":150,"length":3} + >i-- + >:=> (line 16, col 4) to (line 16, col 7) +-------------------------------- +18 >if (function foo() { + + ~~~~ => Pos: (157 to 160) SpanInfo: {"start":157,"length":41} + >if (function foo() { + > return 30; + >} ()) + >:=> (line 18, col 0) to (line 20, col 5) +18 >if (function foo() { + + ~~~~~~~~~~~~~~~~~ => Pos: (161 to 177) SpanInfo: {"start":182,"length":9} + >return 30 + >:=> (line 19, col 4) to (line 19, col 13) +-------------------------------- +19 > return 30; + + ~~~~~~~~~~~~~~~ => Pos: (178 to 192) SpanInfo: {"start":182,"length":9} + >return 30 + >:=> (line 19, col 4) to (line 19, col 13) +-------------------------------- +20 >} ()) { + + ~ => Pos: (193 to 193) SpanInfo: {"start":193,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +20 >} ()) { + + ~~~ => Pos: (194 to 196) SpanInfo: {"start":161,"length":36} + >function foo() { + > return 30; + >} () + >:=> (line 18, col 4) to (line 20, col 4) +20 >} ()) { + + ~ => Pos: (197 to 197) SpanInfo: {"start":157,"length":41} + >if (function foo() { + > return 30; + >} ()) + >:=> (line 18, col 0) to (line 20, col 5) +20 >} ()) { + + ~~~ => Pos: (198 to 200) SpanInfo: {"start":205,"length":3} + >i++ + >:=> (line 21, col 4) to (line 21, col 7) +-------------------------------- +21 > i++; + + ~~~~~~~~~ => Pos: (201 to 209) SpanInfo: {"start":205,"length":3} + >i++ + >:=> (line 21, col 4) to (line 21, col 7) +-------------------------------- +22 >} + ~ => Pos: (210 to 210) SpanInfo: {"start":205,"length":3} + >i++ + >:=> (line 21, col 4) to (line 21, col 7) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_import.baseline b/tests/baselines/reference/bpSpan_import.baseline new file mode 100644 index 00000000000..26279b48f26 --- /dev/null +++ b/tests/baselines/reference/bpSpan_import.baseline @@ -0,0 +1,60 @@ + +1 >module m { + + ~~~~~~~~~~~ => Pos: (0 to 10) SpanInfo: {"start":0,"length":32} + >module m { + > class c { + > } + >} + >:=> (line 1, col 0) to (line 4, col 1) +-------------------------------- +2 > class c { + + ~~~~~~~~~~~~~~ => Pos: (11 to 24) SpanInfo: {"start":15,"length":15} + >class c { + > } + >:=> (line 2, col 4) to (line 3, col 5) +-------------------------------- +3 > } + + ~~~~~~ => Pos: (25 to 30) SpanInfo: {"start":29,"length":1} + >} + >:=> (line 3, col 4) to (line 3, col 5) +-------------------------------- +4 >} + + ~~ => Pos: (31 to 32) SpanInfo: {"start":31,"length":1} + >} + >:=> (line 4, col 0) to (line 4, col 1) +-------------------------------- +5 >import a = m.c; + + ~~~~~~~~~~~~~~~~ => Pos: (33 to 48) SpanInfo: {"start":33,"length":14} + >import a = m.c + >:=> (line 5, col 0) to (line 5, col 14) +-------------------------------- +6 >export import b = m.c; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (49 to 71) SpanInfo: {"start":49,"length":21} + >export import b = m.c + >:=> (line 6, col 0) to (line 6, col 21) +-------------------------------- +7 >var x = new a(); + + ~~~~~~~ => Pos: (72 to 78) SpanInfo: {"start":72,"length":15} + >var x = new a() + >:=> (line 7, col 0) to (line 7, col 15) +7 >var x = new a(); + + ~~~~~~~~~~ => Pos: (79 to 88) SpanInfo: {"start":80,"length":7} + >new a() + >:=> (line 7, col 8) to (line 7, col 15) +-------------------------------- +8 >var y = new b(); + ~~~~~~~ => Pos: (89 to 95) SpanInfo: {"start":89,"length":15} + >var y = new b() + >:=> (line 8, col 0) to (line 8, col 15) +8 >var y = new b(); + ~~~~~~~~~ => Pos: (96 to 104) SpanInfo: {"start":97,"length":7} + >new b() + >:=> (line 8, col 8) to (line 8, col 15) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_inBlankLine.baseline b/tests/baselines/reference/bpSpan_inBlankLine.baseline new file mode 100644 index 00000000000..40fe26a16a6 --- /dev/null +++ b/tests/baselines/reference/bpSpan_inBlankLine.baseline @@ -0,0 +1,15 @@ + +1 >var x = 10; + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":10} + >var x = 10 + >:=> (line 1, col 0) to (line 1, col 10) +-------------------------------- +2 > + + ~ => Pos: (12 to 12) SpanInfo: undefined +-------------------------------- +3 >var y = 10; + ~~~~~~~~~~~ => Pos: (13 to 23) SpanInfo: {"start":13,"length":10} + >var y = 10 + >:=> (line 3, col 0) to (line 3, col 10) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_inComments.baseline b/tests/baselines/reference/bpSpan_inComments.baseline new file mode 100644 index 00000000000..5c167293513 --- /dev/null +++ b/tests/baselines/reference/bpSpan_inComments.baseline @@ -0,0 +1,19 @@ + +1 >/*comment here*/ var x = 10; /*comment here*/ + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (0 to 45) SpanInfo: {"start":17,"length":10} + >var x = 10 + >:=> (line 1, col 17) to (line 1, col 27) +-------------------------------- +2 >// comment only line + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (46 to 66) SpanInfo: undefined +-------------------------------- +3 >/*multiline comment + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (67 to 86) SpanInfo: undefined +-------------------------------- +4 >another line of multiline comment */ var y = 10; // comment here + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (87 to 150) SpanInfo: {"start":124,"length":10} + >var y = 10 + >:=> (line 4, col 37) to (line 4, col 47) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_interface.baseline b/tests/baselines/reference/bpSpan_interface.baseline new file mode 100644 index 00000000000..14e7921757d --- /dev/null +++ b/tests/baselines/reference/bpSpan_interface.baseline @@ -0,0 +1,91 @@ + +1 >interface I { + + ~~~~~~~~~~~~~~ => Pos: (0 to 13) SpanInfo: undefined +-------------------------------- +2 > property: string; + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (14 to 35) SpanInfo: undefined +-------------------------------- +3 > method(): number; + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 57) SpanInfo: undefined +-------------------------------- +4 > (a: string): string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (58 to 82) SpanInfo: undefined +-------------------------------- +5 > new (a: string): I; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (83 to 106) SpanInfo: undefined +-------------------------------- +6 > [a: number]: number; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 131) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (132 to 133) SpanInfo: undefined +-------------------------------- +8 >module m { + + ~~~~~~~~~~~ => Pos: (134 to 144) SpanInfo: undefined +-------------------------------- +9 > interface I1 { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (145 to 163) SpanInfo: undefined +-------------------------------- +10 > property: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (164 to 189) SpanInfo: undefined +-------------------------------- +11 > method(): number; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (190 to 215) SpanInfo: undefined +-------------------------------- +12 > (a: string): string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (216 to 244) SpanInfo: undefined +-------------------------------- +13 > new (a: string): I; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (245 to 272) SpanInfo: undefined +-------------------------------- +14 > [a: number]: number; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (273 to 301) SpanInfo: undefined +-------------------------------- +15 > } + + ~~~~~~ => Pos: (302 to 307) SpanInfo: undefined +-------------------------------- +16 > export interface I2 { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (308 to 333) SpanInfo: undefined +-------------------------------- +17 > property: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (334 to 359) SpanInfo: undefined +-------------------------------- +18 > method(): number; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (360 to 385) SpanInfo: undefined +-------------------------------- +19 > (a: string): string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (386 to 414) SpanInfo: undefined +-------------------------------- +20 > new (a: string): I; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (415 to 442) SpanInfo: undefined +-------------------------------- +21 > [a: number]: number; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (443 to 471) SpanInfo: undefined +-------------------------------- +22 > } + + ~~~~~~ => Pos: (472 to 477) SpanInfo: undefined +-------------------------------- +23 >} + ~ => Pos: (478 to 478) SpanInfo: undefined \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_labeled.baseline b/tests/baselines/reference/bpSpan_labeled.baseline new file mode 100644 index 00000000000..8c2d23adedb --- /dev/null +++ b/tests/baselines/reference/bpSpan_labeled.baseline @@ -0,0 +1,11 @@ + +1 >x: + + ~~~ => Pos: (0 to 2) SpanInfo: {"start":3,"length":10} + >var b = 10 + >:=> (line 2, col 0) to (line 2, col 10) +-------------------------------- +2 >var b = 10; + ~~~~~~~~~~~ => Pos: (3 to 13) SpanInfo: {"start":3,"length":10} + >var b = 10 + >:=> (line 2, col 0) to (line 2, col 10) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_let.baseline b/tests/baselines/reference/bpSpan_let.baseline new file mode 100644 index 00000000000..dff12280a96 --- /dev/null +++ b/tests/baselines/reference/bpSpan_let.baseline @@ -0,0 +1,94 @@ + +1 >let l1; + + ~~~~~~~~ => Pos: (0 to 7) SpanInfo: undefined +-------------------------------- +2 >let l2: number; + + ~~~~~~~~~~~~~~~~ => Pos: (8 to 23) SpanInfo: undefined +-------------------------------- +3 >let l3, l4, l5 :string, l6; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (24 to 51) SpanInfo: undefined +-------------------------------- +4 >let l7 = false; + + ~~~~~~~~~~~~~~~~ => Pos: (52 to 67) SpanInfo: {"start":52,"length":14} + >let l7 = false + >:=> (line 4, col 0) to (line 4, col 14) +-------------------------------- +5 >let l8: number = 23; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (68 to 88) SpanInfo: {"start":68,"length":19} + >let l8: number = 23 + >:=> (line 5, col 0) to (line 5, col 19) +-------------------------------- +6 >let l9 = 0, l10 :string = "", l11 = null; + + ~~~~~~~~~~~ => Pos: (89 to 99) SpanInfo: {"start":89,"length":10} + >let l9 = 0 + >:=> (line 6, col 0) to (line 6, col 10) +6 >let l9 = 0, l10 :string = "", l11 = null; + + ~~~~~~~~~~~~~~~~~~ => Pos: (100 to 117) SpanInfo: {"start":101,"length":16} + >l10 :string = "" + >:=> (line 6, col 12) to (line 6, col 28) +6 >let l9 = 0, l10 :string = "", l11 = null; + + ~~~~~~~~~~~~~ => Pos: (118 to 130) SpanInfo: {"start":119,"length":10} + >l11 = null + >:=> (line 6, col 30) to (line 6, col 40) +-------------------------------- +7 >for(let l11 in {}) { } + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (131 to 150) SpanInfo: {"start":131,"length":18} + >for(let l11 in {}) + >:=> (line 7, col 0) to (line 7, col 18) +7 >for(let l11 in {}) { } + + ~~~ => Pos: (151 to 153) SpanInfo: undefined +-------------------------------- +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~~~~~~~~~~~~~~ => Pos: (154 to 169) SpanInfo: {"start":158,"length":11} + >let l12 = 0 + >:=> (line 8, col 4) to (line 8, col 15) +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~~~~~~~ => Pos: (170 to 178) SpanInfo: {"start":171,"length":7} + >l12 < 9 + >:=> (line 8, col 17) to (line 8, col 24) +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~~~~~~~ => Pos: (179 to 187) SpanInfo: {"start":180,"length":5} + >l12++ + >:=> (line 8, col 26) to (line 8, col 31) +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~ => Pos: (188 to 190) SpanInfo: undefined +-------------------------------- +9 >module M { + + ~~~~~~~~~~~ => Pos: (191 to 201) SpanInfo: {"start":191,"length":55} + >module M { + > let ll1 = "s"; + > export let ll2 = 0; + >} + >:=> (line 9, col 0) to (line 12, col 1) +-------------------------------- +10 > let ll1 = "s"; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (202 to 220) SpanInfo: {"start":206,"length":13} + >let ll1 = "s" + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 > export let ll2 = 0; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (221 to 244) SpanInfo: {"start":225,"length":18} + >export let ll2 = 0 + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +12 >} + ~ => Pos: (245 to 245) SpanInfo: {"start":245,"length":1} + >} + >:=> (line 12, col 0) to (line 12, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_module.baseline b/tests/baselines/reference/bpSpan_module.baseline new file mode 100644 index 00000000000..14145512658 --- /dev/null +++ b/tests/baselines/reference/bpSpan_module.baseline @@ -0,0 +1,234 @@ + +1 >module m2 { + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":38} + >module m2 { + > var a = 10; + > a++; + >} + >:=> (line 1, col 0) to (line 4, col 1) +-------------------------------- +2 > var a = 10; + + ~~~~~~~~~~~~~~~~ => Pos: (12 to 27) SpanInfo: {"start":16,"length":10} + >var a = 10 + >:=> (line 2, col 4) to (line 2, col 14) +-------------------------------- +3 > a++; + + ~~~~~~~~~ => Pos: (28 to 36) SpanInfo: {"start":32,"length":3} + >a++ + >:=> (line 3, col 4) to (line 3, col 7) +-------------------------------- +4 >} + + ~~ => Pos: (37 to 38) SpanInfo: {"start":37,"length":1} + >} + >:=> (line 4, col 0) to (line 4, col 1) +-------------------------------- +5 >module m3 { + + ~~~~~~~~~~~~ => Pos: (39 to 50) SpanInfo: {"start":39,"length":118} + >module m3 { + > module m4 { + > export var x = 30; + > } + > + > export function foo() { + > return m4.x; + > } + >} + >:=> (line 5, col 0) to (line 13, col 1) +-------------------------------- +6 > module m4 { + + ~~~~~~~~~~~~~~~~ => Pos: (51 to 66) SpanInfo: {"start":55,"length":44} + >module m4 { + > export var x = 30; + > } + >:=> (line 6, col 4) to (line 8, col 5) +-------------------------------- +7 > export var x = 30; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (67 to 93) SpanInfo: {"start":75,"length":17} + >export var x = 30 + >:=> (line 7, col 8) to (line 7, col 25) +-------------------------------- +8 > } + + ~~~~~~ => Pos: (94 to 99) SpanInfo: {"start":98,"length":1} + >} + >:=> (line 8, col 4) to (line 8, col 5) +-------------------------------- +9 > + + ~ => Pos: (100 to 100) SpanInfo: undefined +-------------------------------- +10 > export function foo() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (101 to 128) SpanInfo: {"start":105,"length":50} + >export function foo() { + > return m4.x; + > } + >:=> (line 10, col 4) to (line 12, col 5) +-------------------------------- +11 > return m4.x; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (129 to 149) SpanInfo: {"start":137,"length":11} + >return m4.x + >:=> (line 11, col 8) to (line 11, col 19) +-------------------------------- +12 > } + + ~~~~~~ => Pos: (150 to 155) SpanInfo: {"start":154,"length":1} + >} + >:=> (line 12, col 4) to (line 12, col 5) +-------------------------------- +13 >} + + ~~ => Pos: (156 to 157) SpanInfo: {"start":156,"length":1} + >} + >:=> (line 13, col 0) to (line 13, col 1) +-------------------------------- +14 >module m4 { + + ~~~~~~~~~~~~ => Pos: (158 to 169) SpanInfo: undefined +-------------------------------- +15 > interface I { } + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (170 to 189) SpanInfo: undefined +-------------------------------- +16 >} + + ~~ => Pos: (190 to 191) SpanInfo: undefined +-------------------------------- +17 >module m12 + + ~~~~~~~~~~~ => Pos: (192 to 202) SpanInfo: {"start":192,"length":39} + >module m12 + >{ + > var a = 10; + > a++; + >} + >:=> (line 17, col 0) to (line 21, col 1) +-------------------------------- +18 >{ + + ~~ => Pos: (203 to 204) SpanInfo: {"start":209,"length":10} + >var a = 10 + >:=> (line 19, col 4) to (line 19, col 14) +-------------------------------- +19 > var a = 10; + + ~~~~~~~~~~~~~~~~ => Pos: (205 to 220) SpanInfo: {"start":209,"length":10} + >var a = 10 + >:=> (line 19, col 4) to (line 19, col 14) +-------------------------------- +20 > a++; + + ~~~~~~~~~ => Pos: (221 to 229) SpanInfo: {"start":225,"length":3} + >a++ + >:=> (line 20, col 4) to (line 20, col 7) +-------------------------------- +21 >} + + ~~ => Pos: (230 to 231) SpanInfo: {"start":230,"length":1} + >} + >:=> (line 21, col 0) to (line 21, col 1) +-------------------------------- +22 >module m13 + + ~~~~~~~~~~~ => Pos: (232 to 242) SpanInfo: {"start":232,"length":125} + >module m13 + >{ + > module m14 + > { + > export var x = 30; + > } + > + > export function foo() { + > return m4.x; + > } + >} + >:=> (line 22, col 0) to (line 32, col 1) +-------------------------------- +23 >{ + + ~~ => Pos: (243 to 244) SpanInfo: {"start":249,"length":50} + >module m14 + > { + > export var x = 30; + > } + >:=> (line 24, col 4) to (line 27, col 5) +-------------------------------- +24 > module m14 + + ~~~~~~~~~~~~~~~~ => Pos: (245 to 260) SpanInfo: {"start":249,"length":50} + >module m14 + > { + > export var x = 30; + > } + >:=> (line 24, col 4) to (line 27, col 5) +-------------------------------- +25 > { + + ~~~~~~ => Pos: (261 to 266) SpanInfo: {"start":275,"length":17} + >export var x = 30 + >:=> (line 26, col 8) to (line 26, col 25) +-------------------------------- +26 > export var x = 30; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (267 to 293) SpanInfo: {"start":275,"length":17} + >export var x = 30 + >:=> (line 26, col 8) to (line 26, col 25) +-------------------------------- +27 > } + + ~~~~~~ => Pos: (294 to 299) SpanInfo: {"start":298,"length":1} + >} + >:=> (line 27, col 4) to (line 27, col 5) +-------------------------------- +28 > + + ~ => Pos: (300 to 300) SpanInfo: undefined +-------------------------------- +29 > export function foo() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (301 to 328) SpanInfo: {"start":305,"length":50} + >export function foo() { + > return m4.x; + > } + >:=> (line 29, col 4) to (line 31, col 5) +-------------------------------- +30 > return m4.x; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (329 to 349) SpanInfo: {"start":337,"length":11} + >return m4.x + >:=> (line 30, col 8) to (line 30, col 19) +-------------------------------- +31 > } + + ~~~~~~ => Pos: (350 to 355) SpanInfo: {"start":354,"length":1} + >} + >:=> (line 31, col 4) to (line 31, col 5) +-------------------------------- +32 >} + + ~~ => Pos: (356 to 357) SpanInfo: {"start":356,"length":1} + >} + >:=> (line 32, col 0) to (line 32, col 1) +-------------------------------- +33 >module m14 + + ~~~~~~~~~~~~ => Pos: (358 to 369) SpanInfo: undefined +-------------------------------- +34 >{ + + ~~ => Pos: (370 to 371) SpanInfo: undefined +-------------------------------- +35 > interface I { } + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (372 to 391) SpanInfo: undefined +-------------------------------- +36 >} + ~ => Pos: (392 to 392) SpanInfo: undefined \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_moduleAmbient.baseline b/tests/baselines/reference/bpSpan_moduleAmbient.baseline new file mode 100644 index 00000000000..8ea705dc09f --- /dev/null +++ b/tests/baselines/reference/bpSpan_moduleAmbient.baseline @@ -0,0 +1,19 @@ + +1 >declare module Bar { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 20) SpanInfo: undefined +-------------------------------- +2 >} + + ~~ => Pos: (21 to 22) SpanInfo: undefined +-------------------------------- +3 >declare module Foo { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 43) SpanInfo: undefined +-------------------------------- +4 > var x; + + ~~~~~~~~~~~ => Pos: (44 to 54) SpanInfo: undefined +-------------------------------- +5 >} + ~ => Pos: (55 to 55) SpanInfo: undefined \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_moduleEmpty.baseline b/tests/baselines/reference/bpSpan_moduleEmpty.baseline new file mode 100644 index 00000000000..3139d4603d2 --- /dev/null +++ b/tests/baselines/reference/bpSpan_moduleEmpty.baseline @@ -0,0 +1,7 @@ + +1 >module Bar { + + ~~~~~~~~~~~~~ => Pos: (0 to 12) SpanInfo: undefined +-------------------------------- +2 >} + ~ => Pos: (13 to 13) SpanInfo: undefined \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_objectLiteralExpressions.baseline b/tests/baselines/reference/bpSpan_objectLiteralExpressions.baseline new file mode 100644 index 00000000000..0d864a9b1bd --- /dev/null +++ b/tests/baselines/reference/bpSpan_objectLiteralExpressions.baseline @@ -0,0 +1,233 @@ + +1 >var x = { + + ~~~~~~~~~~ => Pos: (0 to 9) SpanInfo: {"start":0,"length":179} + >var x = { + > a: 10, + > b: () => 10, + > someMethod() { + > return "Hello"; + > }, + > get y() { + > return 30; + > }, + > set z(x: number) { + > var bar = x; + > } + >} + >:=> (line 1, col 0) to (line 13, col 1) +-------------------------------- +2 > a: 10, + + ~~~~~~~~~~~ => Pos: (10 to 20) SpanInfo: {"start":0,"length":179} + >var x = { + > a: 10, + > b: () => 10, + > someMethod() { + > return "Hello"; + > }, + > get y() { + > return 30; + > }, + > set z(x: number) { + > var bar = x; + > } + >} + >:=> (line 1, col 0) to (line 13, col 1) +-------------------------------- +3 > b: () => 10, + + ~~~~~~~~~~~~~~~~~ => Pos: (21 to 37) SpanInfo: {"start":34,"length":2} + >10 + >:=> (line 3, col 13) to (line 3, col 15) +-------------------------------- +4 > someMethod() { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (38 to 56) SpanInfo: {"start":65,"length":14} + >return "Hello" + >:=> (line 5, col 8) to (line 5, col 22) +-------------------------------- +5 > return "Hello"; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (57 to 80) SpanInfo: {"start":65,"length":14} + >return "Hello" + >:=> (line 5, col 8) to (line 5, col 22) +-------------------------------- +6 > }, + + ~~~~~~~ => Pos: (81 to 87) SpanInfo: {"start":85,"length":1} + >} + >:=> (line 6, col 4) to (line 6, col 5) +-------------------------------- +7 > get y() { + + ~~~~~~~~~~~~~~ => Pos: (88 to 101) SpanInfo: {"start":110,"length":9} + >return 30 + >:=> (line 8, col 8) to (line 8, col 17) +-------------------------------- +8 > return 30; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (102 to 120) SpanInfo: {"start":110,"length":9} + >return 30 + >:=> (line 8, col 8) to (line 8, col 17) +-------------------------------- +9 > }, + + ~~~~~~~ => Pos: (121 to 127) SpanInfo: {"start":125,"length":1} + >} + >:=> (line 9, col 4) to (line 9, col 5) +-------------------------------- +10 > set z(x: number) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (128 to 150) SpanInfo: {"start":159,"length":11} + >var bar = x + >:=> (line 11, col 8) to (line 11, col 19) +-------------------------------- +11 > var bar = x; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (151 to 171) SpanInfo: {"start":159,"length":11} + >var bar = x + >:=> (line 11, col 8) to (line 11, col 19) +-------------------------------- +12 > } + + ~~~~~~ => Pos: (172 to 177) SpanInfo: {"start":176,"length":1} + >} + >:=> (line 12, col 4) to (line 12, col 5) +-------------------------------- +13 >}; + + ~~~ => Pos: (178 to 180) SpanInfo: {"start":0,"length":179} + >var x = { + > a: 10, + > b: () => 10, + > someMethod() { + > return "Hello"; + > }, + > get y() { + > return 30; + > }, + > set z(x: number) { + > var bar = x; + > } + >} + >:=> (line 1, col 0) to (line 13, col 1) +-------------------------------- +14 >var a = ({ + + ~~~~~~~~~~~ => Pos: (181 to 191) SpanInfo: {"start":181,"length":192} + >var a = ({ + > a: 10, + > b: () => 10, + > someMethod() { + > return "Hello"; + > }, + > get y() { + > return 30; + > }, + > set z(x: number) { + > var bar = x; + > } + >}).someMethod + >:=> (line 14, col 0) to (line 26, col 13) +-------------------------------- +15 > a: 10, + + ~~~~~~~~~~~ => Pos: (192 to 202) SpanInfo: {"start":181,"length":192} + >var a = ({ + > a: 10, + > b: () => 10, + > someMethod() { + > return "Hello"; + > }, + > get y() { + > return 30; + > }, + > set z(x: number) { + > var bar = x; + > } + >}).someMethod + >:=> (line 14, col 0) to (line 26, col 13) +-------------------------------- +16 > b: () => 10, + + ~~~~~~~~~~~~~~~~~ => Pos: (203 to 219) SpanInfo: {"start":216,"length":2} + >10 + >:=> (line 16, col 13) to (line 16, col 15) +-------------------------------- +17 > someMethod() { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (220 to 238) SpanInfo: {"start":247,"length":14} + >return "Hello" + >:=> (line 18, col 8) to (line 18, col 22) +-------------------------------- +18 > return "Hello"; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (239 to 262) SpanInfo: {"start":247,"length":14} + >return "Hello" + >:=> (line 18, col 8) to (line 18, col 22) +-------------------------------- +19 > }, + + ~~~~~~~ => Pos: (263 to 269) SpanInfo: {"start":267,"length":1} + >} + >:=> (line 19, col 4) to (line 19, col 5) +-------------------------------- +20 > get y() { + + ~~~~~~~~~~~~~~ => Pos: (270 to 283) SpanInfo: {"start":292,"length":9} + >return 30 + >:=> (line 21, col 8) to (line 21, col 17) +-------------------------------- +21 > return 30; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (284 to 302) SpanInfo: {"start":292,"length":9} + >return 30 + >:=> (line 21, col 8) to (line 21, col 17) +-------------------------------- +22 > }, + + ~~~~~~~ => Pos: (303 to 309) SpanInfo: {"start":307,"length":1} + >} + >:=> (line 22, col 4) to (line 22, col 5) +-------------------------------- +23 > set z(x: number) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (310 to 332) SpanInfo: {"start":341,"length":11} + >var bar = x + >:=> (line 24, col 8) to (line 24, col 19) +-------------------------------- +24 > var bar = x; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (333 to 353) SpanInfo: {"start":341,"length":11} + >var bar = x + >:=> (line 24, col 8) to (line 24, col 19) +-------------------------------- +25 > } + + ~~~~~~ => Pos: (354 to 359) SpanInfo: {"start":358,"length":1} + >} + >:=> (line 25, col 4) to (line 25, col 5) +-------------------------------- +26 >}).someMethod; + + ~~~~~~~~~~~~~~~ => Pos: (360 to 374) SpanInfo: {"start":181,"length":192} + >var a = ({ + > a: 10, + > b: () => 10, + > someMethod() { + > return "Hello"; + > }, + > get y() { + > return 30; + > }, + > set z(x: number) { + > var bar = x; + > } + >}).someMethod + >:=> (line 14, col 0) to (line 26, col 13) +-------------------------------- +27 >a(); + ~~~~ => Pos: (375 to 378) SpanInfo: {"start":375,"length":3} + >a() + >:=> (line 27, col 0) to (line 27, col 3) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline b/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline new file mode 100644 index 00000000000..47c932640f9 --- /dev/null +++ b/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline @@ -0,0 +1,364 @@ + +1 >function foo(a: number) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 25) SpanInfo: {"start":30,"length":8} + >return a + >:=> (line 2, col 4) to (line 2, col 12) +-------------------------------- +2 > return a; + + ~~~~~~~~~~~~~~ => Pos: (26 to 39) SpanInfo: {"start":30,"length":8} + >return a + >:=> (line 2, col 4) to (line 2, col 12) +-------------------------------- +3 >} + + ~~ => Pos: (40 to 41) SpanInfo: {"start":40,"length":1} + >} + >:=> (line 3, col 0) to (line 3, col 1) +-------------------------------- +4 >foo((function bar() { + + ~~~~ => Pos: (42 to 45) SpanInfo: {"start":42,"length":47} + >foo((function bar() { + > return foo(40); + >})()) + >:=> (line 4, col 0) to (line 6, col 5) +4 >foo((function bar() { + + ~ => Pos: (46 to 46) SpanInfo: {"start":46,"length":42} + >(function bar() { + > return foo(40); + >})() + >:=> (line 4, col 4) to (line 6, col 4) +4 >foo((function bar() { + + ~~~~~~~~~~~~~~~~~ => Pos: (47 to 63) SpanInfo: {"start":68,"length":14} + >return foo(40) + >:=> (line 5, col 4) to (line 5, col 18) +-------------------------------- +5 > return foo(40); + + ~~~~~~~~~~ => Pos: (64 to 73) SpanInfo: {"start":68,"length":14} + >return foo(40) + >:=> (line 5, col 4) to (line 5, col 18) +5 > return foo(40); + + ~~~~~~~~~~ => Pos: (74 to 83) SpanInfo: {"start":75,"length":7} + >foo(40) + >:=> (line 5, col 11) to (line 5, col 18) +-------------------------------- +6 >})()); + + ~ => Pos: (84 to 84) SpanInfo: {"start":84,"length":1} + >} + >:=> (line 6, col 0) to (line 6, col 1) +6 >})()); + + ~~~ => Pos: (85 to 87) SpanInfo: {"start":46,"length":42} + >(function bar() { + > return foo(40); + >})() + >:=> (line 4, col 4) to (line 6, col 4) +6 >})()); + + ~~~ => Pos: (88 to 90) SpanInfo: {"start":42,"length":47} + >foo((function bar() { + > return foo(40); + >})()) + >:=> (line 4, col 0) to (line 6, col 5) +-------------------------------- +7 >var y = foo((function () { + + ~~~~~~~ => Pos: (91 to 97) SpanInfo: {"start":91,"length":52} + >var y = foo((function () { + > return foo(40); + >})()) + >:=> (line 7, col 0) to (line 9, col 5) +7 >var y = foo((function () { + + ~~~~~ => Pos: (98 to 102) SpanInfo: {"start":99,"length":44} + >foo((function () { + > return foo(40); + >})()) + >:=> (line 7, col 8) to (line 9, col 5) +7 >var y = foo((function () { + + ~ => Pos: (103 to 103) SpanInfo: {"start":103,"length":39} + >(function () { + > return foo(40); + >})() + >:=> (line 7, col 12) to (line 9, col 4) +7 >var y = foo((function () { + + ~~~~~~~~~~~~~~ => Pos: (104 to 117) SpanInfo: {"start":122,"length":14} + >return foo(40) + >:=> (line 8, col 4) to (line 8, col 18) +-------------------------------- +8 > return foo(40); + + ~~~~~~~~~~ => Pos: (118 to 127) SpanInfo: {"start":122,"length":14} + >return foo(40) + >:=> (line 8, col 4) to (line 8, col 18) +8 > return foo(40); + + ~~~~~~~~~~ => Pos: (128 to 137) SpanInfo: {"start":129,"length":7} + >foo(40) + >:=> (line 8, col 11) to (line 8, col 18) +-------------------------------- +9 >})());; + + ~ => Pos: (138 to 138) SpanInfo: {"start":138,"length":1} + >} + >:=> (line 9, col 0) to (line 9, col 1) +9 >})());; + + ~~~ => Pos: (139 to 141) SpanInfo: {"start":103,"length":39} + >(function () { + > return foo(40); + >})() + >:=> (line 7, col 12) to (line 9, col 4) +9 >})());; + + ~~~~ => Pos: (142 to 145) SpanInfo: {"start":99,"length":44} + >foo((function () { + > return foo(40); + >})()) + >:=> (line 7, col 8) to (line 9, col 5) +-------------------------------- +10 >class greeter { + + ~~~~~~~~~~~~~~~~ => Pos: (146 to 161) SpanInfo: {"start":146,"length":52} + >class greeter { + > constructor(a: number) { + > } + >} + >:=> (line 10, col 0) to (line 13, col 1) +-------------------------------- +11 > constructor(a: number) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 190) SpanInfo: {"start":195,"length":1} + >} + >:=> (line 12, col 4) to (line 12, col 5) +-------------------------------- +12 > } + + ~~~~~~ => Pos: (191 to 196) SpanInfo: {"start":195,"length":1} + >} + >:=> (line 12, col 4) to (line 12, col 5) +-------------------------------- +13 >} + + ~~ => Pos: (197 to 198) SpanInfo: {"start":197,"length":1} + >} + >:=> (line 13, col 0) to (line 13, col 1) +-------------------------------- +14 >foo(30); + + ~~~~~~~~~ => Pos: (199 to 207) SpanInfo: {"start":199,"length":7} + >foo(30) + >:=> (line 14, col 0) to (line 14, col 7) +-------------------------------- +15 >foo(40 + y); + + ~~~~~~~~~~~~~ => Pos: (208 to 220) SpanInfo: {"start":208,"length":11} + >foo(40 + y) + >:=> (line 15, col 0) to (line 15, col 11) +-------------------------------- +16 >y = foo(30); + + ~~~ => Pos: (221 to 223) SpanInfo: {"start":221,"length":11} + >y = foo(30) + >:=> (line 16, col 0) to (line 16, col 11) +16 >y = foo(30); + + ~~~~~~~~~~ => Pos: (224 to 233) SpanInfo: {"start":225,"length":7} + >foo(30) + >:=> (line 16, col 4) to (line 16, col 11) +-------------------------------- +17 >y = foo(500 + y); + + ~~~ => Pos: (234 to 236) SpanInfo: {"start":234,"length":16} + >y = foo(500 + y) + >:=> (line 17, col 0) to (line 17, col 16) +17 >y = foo(500 + y); + + ~~~~~~~~~~~~~~~ => Pos: (237 to 251) SpanInfo: {"start":238,"length":12} + >foo(500 + y) + >:=> (line 17, col 4) to (line 17, col 16) +-------------------------------- +18 >new greeter((function bar() { + + ~~~~~~~~~~~~ => Pos: (252 to 263) SpanInfo: {"start":252,"length":55} + >new greeter((function bar() { + > return foo(40); + >})()) + >:=> (line 18, col 0) to (line 20, col 5) +18 >new greeter((function bar() { + + ~ => Pos: (264 to 264) SpanInfo: {"start":264,"length":42} + >(function bar() { + > return foo(40); + >})() + >:=> (line 18, col 12) to (line 20, col 4) +18 >new greeter((function bar() { + + ~~~~~~~~~~~~~~~~~ => Pos: (265 to 281) SpanInfo: {"start":286,"length":14} + >return foo(40) + >:=> (line 19, col 4) to (line 19, col 18) +-------------------------------- +19 > return foo(40); + + ~~~~~~~~~~ => Pos: (282 to 291) SpanInfo: {"start":286,"length":14} + >return foo(40) + >:=> (line 19, col 4) to (line 19, col 18) +19 > return foo(40); + + ~~~~~~~~~~ => Pos: (292 to 301) SpanInfo: {"start":293,"length":7} + >foo(40) + >:=> (line 19, col 11) to (line 19, col 18) +-------------------------------- +20 >})()); + + ~ => Pos: (302 to 302) SpanInfo: {"start":302,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +20 >})()); + + ~~~ => Pos: (303 to 305) SpanInfo: {"start":264,"length":42} + >(function bar() { + > return foo(40); + >})() + >:=> (line 18, col 12) to (line 20, col 4) +20 >})()); + + ~~~ => Pos: (306 to 308) SpanInfo: {"start":252,"length":55} + >new greeter((function bar() { + > return foo(40); + >})()) + >:=> (line 18, col 0) to (line 20, col 5) +-------------------------------- +21 >var anotherGreeter = new greeter((function bar() { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (309 to 328) SpanInfo: {"start":309,"length":76} + >var anotherGreeter = new greeter((function bar() { + > return foo(40); + >})()) + >:=> (line 21, col 0) to (line 23, col 5) +21 >var anotherGreeter = new greeter((function bar() { + + ~~~~~~~~~~~~~ => Pos: (329 to 341) SpanInfo: {"start":330,"length":55} + >new greeter((function bar() { + > return foo(40); + >})()) + >:=> (line 21, col 21) to (line 23, col 5) +21 >var anotherGreeter = new greeter((function bar() { + + ~ => Pos: (342 to 342) SpanInfo: {"start":342,"length":42} + >(function bar() { + > return foo(40); + >})() + >:=> (line 21, col 33) to (line 23, col 4) +21 >var anotherGreeter = new greeter((function bar() { + + ~~~~~~~~~~~~~~~~~=> Pos: (343 to 359) SpanInfo: {"start":364,"length":14} + >return foo(40) + >:=> (line 22, col 4) to (line 22, col 18) +-------------------------------- +22 > return foo(40); + + ~~~~~~~~~~ => Pos: (360 to 369) SpanInfo: {"start":364,"length":14} + >return foo(40) + >:=> (line 22, col 4) to (line 22, col 18) +22 > return foo(40); + + ~~~~~~~~~~ => Pos: (370 to 379) SpanInfo: {"start":371,"length":7} + >foo(40) + >:=> (line 22, col 11) to (line 22, col 18) +-------------------------------- +23 >})()); + + ~ => Pos: (380 to 380) SpanInfo: {"start":380,"length":1} + >} + >:=> (line 23, col 0) to (line 23, col 1) +23 >})()); + + ~~~ => Pos: (381 to 383) SpanInfo: {"start":342,"length":42} + >(function bar() { + > return foo(40); + >})() + >:=> (line 21, col 33) to (line 23, col 4) +23 >})()); + + ~~~ => Pos: (384 to 386) SpanInfo: {"start":330,"length":55} + >new greeter((function bar() { + > return foo(40); + >})()) + >:=> (line 21, col 21) to (line 23, col 5) +-------------------------------- +24 >anotherGreeter = new greeter(30); + + ~~~~~~~~~~~~~~~~ => Pos: (387 to 402) SpanInfo: {"start":387,"length":32} + >anotherGreeter = new greeter(30) + >:=> (line 24, col 0) to (line 24, col 32) +24 >anotherGreeter = new greeter(30); + + ~~~~~~~~~~~~~~~~~~ => Pos: (403 to 420) SpanInfo: {"start":404,"length":15} + >new greeter(30) + >:=> (line 24, col 17) to (line 24, col 32) +-------------------------------- +25 >anotherGreeter = new greeter(40 + y); + + ~~~~~~~~~~~~~~~~ => Pos: (421 to 436) SpanInfo: {"start":421,"length":36} + >anotherGreeter = new greeter(40 + y) + >:=> (line 25, col 0) to (line 25, col 36) +25 >anotherGreeter = new greeter(40 + y); + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (437 to 458) SpanInfo: {"start":438,"length":19} + >new greeter(40 + y) + >:=> (line 25, col 17) to (line 25, col 36) +-------------------------------- +26 >new greeter(30); + + ~~~~~~~~~~~~~~~~~ => Pos: (459 to 475) SpanInfo: {"start":459,"length":15} + >new greeter(30) + >:=> (line 26, col 0) to (line 26, col 15) +-------------------------------- +27 >new greeter(40 + y); + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (476 to 496) SpanInfo: {"start":476,"length":19} + >new greeter(40 + y) + >:=> (line 27, col 0) to (line 27, col 19) +-------------------------------- +28 >function foo2(x: number, y: string) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (497 to 534) SpanInfo: {"start":535,"length":1} + >} + >:=> (line 29, col 0) to (line 29, col 1) +-------------------------------- +29 >} + + ~~ => Pos: (535 to 536) SpanInfo: {"start":535,"length":1} + >} + >:=> (line 29, col 0) to (line 29, col 1) +-------------------------------- +30 >foo2(foo(30), foo(40).toString()); + ~~~~~ => Pos: (537 to 541) SpanInfo: {"start":537,"length":33} + >foo2(foo(30), foo(40).toString()) + >:=> (line 30, col 0) to (line 30, col 33) +30 >foo2(foo(30), foo(40).toString()); + ~~~~~~~~ => Pos: (542 to 549) SpanInfo: {"start":542,"length":7} + >foo(30) + >:=> (line 30, col 5) to (line 30, col 12) +30 >foo2(foo(30), foo(40).toString()); + ~~~~~~~~ => Pos: (550 to 557) SpanInfo: {"start":551,"length":7} + >foo(40) + >:=> (line 30, col 14) to (line 30, col 21) +30 >foo2(foo(30), foo(40).toString()); + ~~~~~~~~~~~ => Pos: (558 to 568) SpanInfo: {"start":551,"length":18} + >foo(40).toString() + >:=> (line 30, col 14) to (line 30, col 32) +30 >foo2(foo(30), foo(40).toString()); + ~~ => Pos: (569 to 570) SpanInfo: {"start":537,"length":33} + >foo2(foo(30), foo(40).toString()) + >:=> (line 30, col 0) to (line 30, col 33) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_stmts.baseline b/tests/baselines/reference/bpSpan_stmts.baseline new file mode 100644 index 00000000000..a81559ee9a5 --- /dev/null +++ b/tests/baselines/reference/bpSpan_stmts.baseline @@ -0,0 +1,572 @@ + +1 >function f() { + + ~~~~~~~~~~~~~~~ => Pos: (0 to 14) SpanInfo: undefined +-------------------------------- +2 > var y; + + ~~~~~~~~~~~ => Pos: (15 to 25) SpanInfo: undefined +-------------------------------- +3 > var x = 0; + + ~~~~~~~~~~~~~~~ => Pos: (26 to 40) SpanInfo: {"start":30,"length":9} + >var x = 0 + >:=> (line 3, col 4) to (line 3, col 13) +-------------------------------- +4 > for (var i = 0; i < 10; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (41 to 59) SpanInfo: {"start":50,"length":9} + >var i = 0 + >:=> (line 4, col 9) to (line 4, col 18) +4 > for (var i = 0; i < 10; i++) { + + ~~~~~~~~ => Pos: (60 to 67) SpanInfo: {"start":61,"length":6} + >i < 10 + >:=> (line 4, col 20) to (line 4, col 26) +4 > for (var i = 0; i < 10; i++) { + + ~~~~~~~~ => Pos: (68 to 75) SpanInfo: {"start":69,"length":3} + >i++ + >:=> (line 4, col 28) to (line 4, col 31) +-------------------------------- +5 > x += i; + + ~~~~~~~~~~~~~~~~ => Pos: (76 to 91) SpanInfo: {"start":84,"length":6} + >x += i + >:=> (line 5, col 8) to (line 5, col 14) +-------------------------------- +6 > x *= 0; + + ~~~~~~~~~~~~~~~~ => Pos: (92 to 107) SpanInfo: {"start":100,"length":6} + >x *= 0 + >:=> (line 6, col 8) to (line 6, col 14) +-------------------------------- +7 > } + + ~~~~~~ => Pos: (108 to 113) SpanInfo: {"start":100,"length":6} + >x *= 0 + >:=> (line 6, col 8) to (line 6, col 14) +-------------------------------- +8 > if (x > 17) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (114 to 131) SpanInfo: {"start":118,"length":11} + >if (x > 17) + >:=> (line 8, col 4) to (line 8, col 15) +-------------------------------- +9 > x /= 9; + + ~~~~~~~~~~~~~~~~ => Pos: (132 to 147) SpanInfo: {"start":140,"length":6} + >x /= 9 + >:=> (line 9, col 8) to (line 9, col 14) +-------------------------------- +10 > } else { + + ~~~~~ => Pos: (148 to 152) SpanInfo: {"start":140,"length":6} + >x /= 9 + >:=> (line 9, col 8) to (line 9, col 14) +10 > } else { + + ~~~~~~~~ => Pos: (153 to 160) SpanInfo: {"start":169,"length":7} + >x += 10 + >:=> (line 11, col 8) to (line 11, col 15) +-------------------------------- +11 > x += 10; + + ~~~~~~~~~~~~~~~~~ => Pos: (161 to 177) SpanInfo: {"start":169,"length":7} + >x += 10 + >:=> (line 11, col 8) to (line 11, col 15) +-------------------------------- +12 > x++; + + ~~~~~~~~~~~~~ => Pos: (178 to 190) SpanInfo: {"start":186,"length":3} + >x++ + >:=> (line 12, col 8) to (line 12, col 11) +-------------------------------- +13 > } + + ~~~~~~ => Pos: (191 to 196) SpanInfo: {"start":186,"length":3} + >x++ + >:=> (line 12, col 8) to (line 12, col 11) +-------------------------------- +14 > var a = [ + + ~~~~~~~~~~~~~~ => Pos: (197 to 210) SpanInfo: {"start":201,"length":47} + >var a = [ + > 1, + > 2, + > 3 + > ] + >:=> (line 14, col 4) to (line 18, col 5) +-------------------------------- +15 > 1, + + ~~~~~~~~~~~ => Pos: (211 to 221) SpanInfo: {"start":201,"length":47} + >var a = [ + > 1, + > 2, + > 3 + > ] + >:=> (line 14, col 4) to (line 18, col 5) +-------------------------------- +16 > 2, + + ~~~~~~~~~~~ => Pos: (222 to 232) SpanInfo: {"start":201,"length":47} + >var a = [ + > 1, + > 2, + > 3 + > ] + >:=> (line 14, col 4) to (line 18, col 5) +-------------------------------- +17 > 3 + + ~~~~~~~~~~ => Pos: (233 to 242) SpanInfo: {"start":201,"length":47} + >var a = [ + > 1, + > 2, + > 3 + > ] + >:=> (line 14, col 4) to (line 18, col 5) +-------------------------------- +18 > ]; + + ~~~~~~~ => Pos: (243 to 249) SpanInfo: {"start":201,"length":47} + >var a = [ + > 1, + > 2, + > 3 + > ] + >:=> (line 14, col 4) to (line 18, col 5) +-------------------------------- +19 > var obj = { + + ~~~~~~~~~~~~~~~~ => Pos: (250 to 265) SpanInfo: {"start":254,"length":50} + >var obj = { + > z: 1, + > q: "hello" + > } + >:=> (line 19, col 4) to (line 22, col 5) +-------------------------------- +20 > z: 1, + + ~~~~~~~~~~~~~~ => Pos: (266 to 279) SpanInfo: {"start":254,"length":50} + >var obj = { + > z: 1, + > q: "hello" + > } + >:=> (line 19, col 4) to (line 22, col 5) +-------------------------------- +21 > q: "hello" + + ~~~~~~~~~~~~~~~~~~~ => Pos: (280 to 298) SpanInfo: {"start":254,"length":50} + >var obj = { + > z: 1, + > q: "hello" + > } + >:=> (line 19, col 4) to (line 22, col 5) +-------------------------------- +22 > }; + + ~~~~~~~ => Pos: (299 to 305) SpanInfo: {"start":254,"length":50} + >var obj = { + > z: 1, + > q: "hello" + > } + >:=> (line 19, col 4) to (line 22, col 5) +-------------------------------- +23 > for (var j in a) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (306 to 328) SpanInfo: {"start":310,"length":16} + >for (var j in a) + >:=> (line 23, col 4) to (line 23, col 20) +-------------------------------- +24 > obj.z = a[j]; + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (329 to 350) SpanInfo: {"start":337,"length":12} + >obj.z = a[j] + >:=> (line 24, col 8) to (line 24, col 20) +-------------------------------- +25 > var v = 10; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (351 to 370) SpanInfo: {"start":359,"length":10} + >var v = 10 + >:=> (line 25, col 8) to (line 25, col 18) +-------------------------------- +26 > } + + ~~~~~~ => Pos: (371 to 376) SpanInfo: {"start":359,"length":10} + >var v = 10 + >:=> (line 25, col 8) to (line 25, col 18) +-------------------------------- +27 > try { + + ~~~~~~~~~~ => Pos: (377 to 386) SpanInfo: {"start":395,"length":14} + >obj.q = "ohhh" + >:=> (line 28, col 8) to (line 28, col 22) +-------------------------------- +28 > obj.q = "ohhh"; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (387 to 410) SpanInfo: {"start":395,"length":14} + >obj.q = "ohhh" + >:=> (line 28, col 8) to (line 28, col 22) +-------------------------------- +29 > } catch (e) { + + ~~~~~ => Pos: (411 to 415) SpanInfo: {"start":395,"length":14} + >obj.q = "ohhh" + >:=> (line 28, col 8) to (line 28, col 22) +29 > } catch (e) { + + ~~~~~~~~~~~~~ => Pos: (416 to 428) SpanInfo: {"start":437,"length":15} + >if (obj.z < 10) + >:=> (line 30, col 8) to (line 30, col 23) +-------------------------------- +30 > if (obj.z < 10) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (429 to 454) SpanInfo: {"start":437,"length":15} + >if (obj.z < 10) + >:=> (line 30, col 8) to (line 30, col 23) +-------------------------------- +31 > obj.z = 12; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (455 to 478) SpanInfo: {"start":467,"length":10} + >obj.z = 12 + >:=> (line 31, col 12) to (line 31, col 22) +-------------------------------- +32 > } else { + + ~~~~~~~~~ => Pos: (479 to 487) SpanInfo: {"start":467,"length":10} + >obj.z = 12 + >:=> (line 31, col 12) to (line 31, col 22) +32 > } else { + + ~~~~~~~~ => Pos: (488 to 495) SpanInfo: {"start":508,"length":13} + >obj.q = "hmm" + >:=> (line 33, col 12) to (line 33, col 25) +-------------------------------- +33 > obj.q = "hmm"; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (496 to 522) SpanInfo: {"start":508,"length":13} + >obj.q = "hmm" + >:=> (line 33, col 12) to (line 33, col 25) +-------------------------------- +34 > } + + ~~~~~~~~~~ => Pos: (523 to 532) SpanInfo: {"start":508,"length":13} + >obj.q = "hmm" + >:=> (line 33, col 12) to (line 33, col 25) +-------------------------------- +35 > } + + ~~~~~~ => Pos: (533 to 538) SpanInfo: {"start":437,"length":15} + >if (obj.z < 10) + >:=> (line 30, col 8) to (line 30, col 23) +-------------------------------- +36 > try { + + ~~~~~~~~~~ => Pos: (539 to 548) SpanInfo: {"start":557,"length":17} + >throw new Error() + >:=> (line 37, col 8) to (line 37, col 25) +-------------------------------- +37 > throw new Error(); + + ~~~~~~~~~~~~~ => Pos: (549 to 561) SpanInfo: {"start":557,"length":17} + >throw new Error() + >:=> (line 37, col 8) to (line 37, col 25) +37 > throw new Error(); + + ~~~~~~~~~~~~~~ => Pos: (562 to 575) SpanInfo: {"start":563,"length":11} + >new Error() + >:=> (line 37, col 14) to (line 37, col 25) +-------------------------------- +38 > } catch (e1) { + + ~~~~~ => Pos: (576 to 580) SpanInfo: {"start":557,"length":17} + >throw new Error() + >:=> (line 37, col 8) to (line 37, col 25) +38 > } catch (e1) { + + ~~~~~~~~~~~~~~ => Pos: (581 to 594) SpanInfo: {"start":603,"length":10} + >var b = e1 + >:=> (line 39, col 8) to (line 39, col 18) +-------------------------------- +39 > var b = e1; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (595 to 614) SpanInfo: {"start":603,"length":10} + >var b = e1 + >:=> (line 39, col 8) to (line 39, col 18) +-------------------------------- +40 > } finally { + + ~~~~~ => Pos: (615 to 619) SpanInfo: {"start":603,"length":10} + >var b = e1 + >:=> (line 39, col 8) to (line 39, col 18) +40 > } finally { + + ~~~~~~~~~~~ => Pos: (620 to 630) SpanInfo: {"start":639,"length":6} + >y = 70 + >:=> (line 41, col 8) to (line 41, col 14) +-------------------------------- +41 > y = 70; + + ~~~~~~~~~~~~~~~~ => Pos: (631 to 646) SpanInfo: {"start":639,"length":6} + >y = 70 + >:=> (line 41, col 8) to (line 41, col 14) +-------------------------------- +42 > } + + ~~~~~~ => Pos: (647 to 652) SpanInfo: {"start":639,"length":6} + >y = 70 + >:=> (line 41, col 8) to (line 41, col 14) +-------------------------------- +43 > with (obj) { + + ~~~~~~~~~~~~~~~~~ => Pos: (653 to 669) SpanInfo: {"start":678,"length":5} + >i = 2 + >:=> (line 44, col 8) to (line 44, col 13) +-------------------------------- +44 > i = 2; + + ~~~~~~~~~~~~~~~ => Pos: (670 to 684) SpanInfo: {"start":678,"length":5} + >i = 2 + >:=> (line 44, col 8) to (line 44, col 13) +-------------------------------- +45 > z = 10; + + ~~~~~~~~~~~~~~~~ => Pos: (685 to 700) SpanInfo: {"start":693,"length":6} + >z = 10 + >:=> (line 45, col 8) to (line 45, col 14) +-------------------------------- +46 > } + + ~~~~~~ => Pos: (701 to 706) SpanInfo: {"start":693,"length":6} + >z = 10 + >:=> (line 45, col 8) to (line 45, col 14) +-------------------------------- +47 > switch (obj.z) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (707 to 727) SpanInfo: {"start":711,"length":14} + >switch (obj.z) + >:=> (line 47, col 4) to (line 47, col 18) +-------------------------------- +48 > case 0: { + + ~~~~~~~~~~~~~~~~~~ => Pos: (728 to 745) SpanInfo: {"start":758,"length":3} + >x++ + >:=> (line 49, col 12) to (line 49, col 15) +-------------------------------- +49 > x++; + + ~~~~~~~~~~~~~~~~~ => Pos: (746 to 762) SpanInfo: {"start":758,"length":3} + >x++ + >:=> (line 49, col 12) to (line 49, col 15) +-------------------------------- +50 > break; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (763 to 781) SpanInfo: {"start":775,"length":5} + >break + >:=> (line 50, col 12) to (line 50, col 17) +-------------------------------- +51 > + + ~ => Pos: (782 to 782) SpanInfo: undefined +-------------------------------- +52 > } + + ~~~~~~~~~~ => Pos: (783 to 792) SpanInfo: {"start":775,"length":5} + >break + >:=> (line 50, col 12) to (line 50, col 17) +-------------------------------- +53 > case 1: { + + ~~~~~~~~~~~~~~~~~~ => Pos: (793 to 810) SpanInfo: {"start":823,"length":3} + >x-- + >:=> (line 54, col 12) to (line 54, col 15) +-------------------------------- +54 > x--; + + ~~~~~~~~~~~~~~~~~ => Pos: (811 to 827) SpanInfo: {"start":823,"length":3} + >x-- + >:=> (line 54, col 12) to (line 54, col 15) +-------------------------------- +55 > break; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (828 to 846) SpanInfo: {"start":840,"length":5} + >break + >:=> (line 55, col 12) to (line 55, col 17) +-------------------------------- +56 > + + ~ => Pos: (847 to 847) SpanInfo: undefined +-------------------------------- +57 > } + + ~~~~~~~~~~ => Pos: (848 to 857) SpanInfo: {"start":840,"length":5} + >break + >:=> (line 55, col 12) to (line 55, col 17) +-------------------------------- +58 > default: { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (858 to 876) SpanInfo: {"start":889,"length":6} + >x *= 2 + >:=> (line 59, col 12) to (line 59, col 18) +-------------------------------- +59 > x *= 2; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (877 to 896) SpanInfo: {"start":889,"length":6} + >x *= 2 + >:=> (line 59, col 12) to (line 59, col 18) +-------------------------------- +60 > x = 50; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (897 to 916) SpanInfo: {"start":909,"length":6} + >x = 50 + >:=> (line 60, col 12) to (line 60, col 18) +-------------------------------- +61 > break; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (917 to 935) SpanInfo: {"start":929,"length":5} + >break + >:=> (line 61, col 12) to (line 61, col 17) +-------------------------------- +62 > + + ~ => Pos: (936 to 936) SpanInfo: undefined +-------------------------------- +63 > } + + ~~~~~~~~~~ => Pos: (937 to 946) SpanInfo: {"start":929,"length":5} + >break + >:=> (line 61, col 12) to (line 61, col 17) +-------------------------------- +64 > } + + ~~~~~~ => Pos: (947 to 952) SpanInfo: {"start":889,"length":6} + >x *= 2 + >:=> (line 59, col 12) to (line 59, col 18) +-------------------------------- +65 > while (x < 10) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (953 to 973) SpanInfo: {"start":957,"length":14} + >while (x < 10) + >:=> (line 65, col 4) to (line 65, col 18) +-------------------------------- +66 > x++; + + ~~~~~~~~~~~~~ => Pos: (974 to 986) SpanInfo: {"start":982,"length":3} + >x++ + >:=> (line 66, col 8) to (line 66, col 11) +-------------------------------- +67 > } + + ~~~~~~ => Pos: (987 to 992) SpanInfo: {"start":982,"length":3} + >x++ + >:=> (line 66, col 8) to (line 66, col 11) +-------------------------------- +68 > do { + + ~~~~~~~~~ => Pos: (993 to 1001) SpanInfo: {"start":1010,"length":3} + >x-- + >:=> (line 69, col 8) to (line 69, col 11) +-------------------------------- +69 > x--; + + ~~~~~~~~~~~~~ => Pos: (1002 to 1014) SpanInfo: {"start":1010,"length":3} + >x-- + >:=> (line 69, col 8) to (line 69, col 11) +-------------------------------- +70 > } while (x > 4) + + ~~~~~ => Pos: (1015 to 1019) SpanInfo: {"start":1010,"length":3} + >x-- + >:=> (line 69, col 8) to (line 69, col 11) +70 > } while (x > 4) + + ~~~~~~~~~~~~~~~ => Pos: (1020 to 1034) SpanInfo: {"start":1021,"length":13} + >while (x > 4) + >:=> (line 70, col 6) to (line 70, col 19) +-------------------------------- +71 > x = y; + + ~~~~~~~~~~~ => Pos: (1035 to 1045) SpanInfo: {"start":1039,"length":5} + >x = y + >:=> (line 71, col 4) to (line 71, col 9) +-------------------------------- +72 > var z = (x == 1) ? x + 1 : x - 1; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1046 to 1083) SpanInfo: {"start":1050,"length":32} + >var z = (x == 1) ? x + 1 : x - 1 + >:=> (line 72, col 4) to (line 72, col 36) +-------------------------------- +73 > (x == 1) ? x + 1 : x - 1; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1084 to 1113) SpanInfo: {"start":1088,"length":24} + >(x == 1) ? x + 1 : x - 1 + >:=> (line 73, col 4) to (line 73, col 28) +-------------------------------- +74 > x === 1; + + ~~~~~~~~~~~~~ => Pos: (1114 to 1126) SpanInfo: {"start":1118,"length":7} + >x === 1 + >:=> (line 74, col 4) to (line 74, col 11) +-------------------------------- +75 > x = z = 40; + + ~~~~~~~~~~~~~~~~ => Pos: (1127 to 1142) SpanInfo: {"start":1131,"length":10} + >x = z = 40 + >:=> (line 75, col 4) to (line 75, col 14) +-------------------------------- +76 > eval("y"); + + ~~~~~~~~~~~~~~~ => Pos: (1143 to 1157) SpanInfo: {"start":1147,"length":9} + >eval("y") + >:=> (line 76, col 4) to (line 76, col 13) +-------------------------------- +77 > return; + + ~~~~~~~~~~~~ => Pos: (1158 to 1169) SpanInfo: {"start":1162,"length":6} + >return + >:=> (line 77, col 4) to (line 77, col 10) +-------------------------------- +78 >} + + ~~ => Pos: (1170 to 1171) SpanInfo: {"start":1170,"length":1} + >} + >:=> (line 78, col 0) to (line 78, col 1) +-------------------------------- +79 >var b = function () { + + ~~~~~~~ => Pos: (1172 to 1178) SpanInfo: {"start":1172,"length":54} + >var b = function () { + > var x = 10; + > x = x + 1; + >} + >:=> (line 79, col 0) to (line 82, col 1) +79 >var b = function () { + + ~~~~~~~~~~~~~~~ => Pos: (1179 to 1193) SpanInfo: {"start":1198,"length":10} + >var x = 10 + >:=> (line 80, col 4) to (line 80, col 14) +-------------------------------- +80 > var x = 10; + + ~~~~~~~~~~~~~~~~ => Pos: (1194 to 1209) SpanInfo: {"start":1198,"length":10} + >var x = 10 + >:=> (line 80, col 4) to (line 80, col 14) +-------------------------------- +81 > x = x + 1; + + ~~~~~~~~~~~~~~~ => Pos: (1210 to 1224) SpanInfo: {"start":1214,"length":9} + >x = x + 1 + >:=> (line 81, col 4) to (line 81, col 13) +-------------------------------- +82 >}; + + ~~~ => Pos: (1225 to 1227) SpanInfo: {"start":1225,"length":1} + >} + >:=> (line 82, col 0) to (line 82, col 1) +-------------------------------- +83 >f(); + ~~~~ => Pos: (1228 to 1231) SpanInfo: {"start":1228,"length":3} + >f() + >:=> (line 83, col 0) to (line 83, col 3) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_switch.baseline b/tests/baselines/reference/bpSpan_switch.baseline new file mode 100644 index 00000000000..c0e2259784d --- /dev/null +++ b/tests/baselines/reference/bpSpan_switch.baseline @@ -0,0 +1,272 @@ + +1 >var x = 10; + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":10} + >var x = 10 + >:=> (line 1, col 0) to (line 1, col 10) +-------------------------------- +2 >switch (x) { + + ~~~~~~~~~~~~~ => Pos: (12 to 24) SpanInfo: {"start":12,"length":10} + >switch (x) + >:=> (line 2, col 0) to (line 2, col 10) +-------------------------------- +3 > case 5: + + ~~~~~~~~~~~~ => Pos: (25 to 36) SpanInfo: {"start":45,"length":3} + >x++ + >:=> (line 4, col 8) to (line 4, col 11) +-------------------------------- +4 > x++; + + ~~~~~~~~~~~~~ => Pos: (37 to 49) SpanInfo: {"start":45,"length":3} + >x++ + >:=> (line 4, col 8) to (line 4, col 11) +-------------------------------- +5 > break; + + ~~~~~~~~~~~~~~~ => Pos: (50 to 64) SpanInfo: {"start":58,"length":5} + >break + >:=> (line 5, col 8) to (line 5, col 13) +-------------------------------- +6 > case 10: + + ~~~~~~~~~~~~~ => Pos: (65 to 77) SpanInfo: {"start":100,"length":3} + >x-- + >:=> (line 8, col 12) to (line 8, col 15) +-------------------------------- +7 > { + + ~~~~~~~~~~ => Pos: (78 to 87) SpanInfo: {"start":100,"length":3} + >x-- + >:=> (line 8, col 12) to (line 8, col 15) +-------------------------------- +8 > x--; + + ~~~~~~~~~~~~~~~~~ => Pos: (88 to 104) SpanInfo: {"start":100,"length":3} + >x-- + >:=> (line 8, col 12) to (line 8, col 15) +-------------------------------- +9 > break; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (105 to 123) SpanInfo: {"start":117,"length":5} + >break + >:=> (line 9, col 12) to (line 9, col 17) +-------------------------------- +10 > } + + ~~~~~~~~~~ => Pos: (124 to 133) SpanInfo: {"start":117,"length":5} + >break + >:=> (line 9, col 12) to (line 9, col 17) +-------------------------------- +11 > default: + + ~~~~~~~~~~~~~ => Pos: (134 to 146) SpanInfo: {"start":155,"length":9} + >x = x *10 + >:=> (line 12, col 8) to (line 12, col 17) +-------------------------------- +12 > x = x *10; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (147 to 165) SpanInfo: {"start":155,"length":9} + >x = x *10 + >:=> (line 12, col 8) to (line 12, col 17) +-------------------------------- +13 >} + + ~~ => Pos: (166 to 167) SpanInfo: {"start":155,"length":9} + >x = x *10 + >:=> (line 12, col 8) to (line 12, col 17) +-------------------------------- +14 >switch (x) + + ~~~~~~~~~~~ => Pos: (168 to 178) SpanInfo: {"start":168,"length":10} + >switch (x) + >:=> (line 14, col 0) to (line 14, col 10) +-------------------------------- +15 >{ + + ~~ => Pos: (179 to 180) SpanInfo: {"start":201,"length":3} + >x++ + >:=> (line 17, col 8) to (line 17, col 11) +-------------------------------- +16 > case 5: + + ~~~~~~~~~~~~ => Pos: (181 to 192) SpanInfo: {"start":201,"length":3} + >x++ + >:=> (line 17, col 8) to (line 17, col 11) +-------------------------------- +17 > x++; + + ~~~~~~~~~~~~~ => Pos: (193 to 205) SpanInfo: {"start":201,"length":3} + >x++ + >:=> (line 17, col 8) to (line 17, col 11) +-------------------------------- +18 > break; + + ~~~~~~~~~~~~~~~ => Pos: (206 to 220) SpanInfo: {"start":214,"length":5} + >break + >:=> (line 18, col 8) to (line 18, col 13) +-------------------------------- +19 > case 10: + + ~~~~~~~~~~~~~ => Pos: (221 to 233) SpanInfo: {"start":256,"length":3} + >x-- + >:=> (line 21, col 12) to (line 21, col 15) +-------------------------------- +20 > { + + ~~~~~~~~~~ => Pos: (234 to 243) SpanInfo: {"start":256,"length":3} + >x-- + >:=> (line 21, col 12) to (line 21, col 15) +-------------------------------- +21 > x--; + + ~~~~~~~~~~~~~~~~~ => Pos: (244 to 260) SpanInfo: {"start":256,"length":3} + >x-- + >:=> (line 21, col 12) to (line 21, col 15) +-------------------------------- +22 > break; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (261 to 279) SpanInfo: {"start":273,"length":5} + >break + >:=> (line 22, col 12) to (line 22, col 17) +-------------------------------- +23 > } + + ~~~~~~~~~~ => Pos: (280 to 289) SpanInfo: {"start":273,"length":5} + >break + >:=> (line 22, col 12) to (line 22, col 17) +-------------------------------- +24 > default: + + ~~~~~~~~~~~~~ => Pos: (290 to 302) SpanInfo: {"start":325,"length":10} + >x = x * 10 + >:=> (line 26, col 12) to (line 26, col 22) +-------------------------------- +25 > { + + ~~~~~~~~~~ => Pos: (303 to 312) SpanInfo: {"start":325,"length":10} + >x = x * 10 + >:=> (line 26, col 12) to (line 26, col 22) +-------------------------------- +26 > x = x * 10; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (313 to 336) SpanInfo: {"start":325,"length":10} + >x = x * 10 + >:=> (line 26, col 12) to (line 26, col 22) +-------------------------------- +27 > } + + ~~~~~~~~~~ => Pos: (337 to 346) SpanInfo: {"start":325,"length":10} + >x = x * 10 + >:=> (line 26, col 12) to (line 26, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (347 to 348) SpanInfo: {"start":325,"length":10} + >x = x * 10 + >:=> (line 26, col 12) to (line 26, col 22) +-------------------------------- +29 >switch ((function foo() { + + ~~~~~~~~ => Pos: (349 to 356) SpanInfo: {"start":349,"length":50} + >switch ((function foo() { + > return x * 30; + >})()) + >:=> (line 29, col 0) to (line 31, col 5) +29 >switch ((function foo() { + + ~ => Pos: (357 to 357) SpanInfo: {"start":357,"length":41} + >(function foo() { + > return x * 30; + >})() + >:=> (line 29, col 8) to (line 31, col 4) +29 >switch ((function foo() { + + ~~~~~~~~~~~~~~~~~ => Pos: (358 to 374) SpanInfo: {"start":379,"length":13} + >return x * 30 + >:=> (line 30, col 4) to (line 30, col 17) +-------------------------------- +30 > return x * 30; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (375 to 393) SpanInfo: {"start":379,"length":13} + >return x * 30 + >:=> (line 30, col 4) to (line 30, col 17) +-------------------------------- +31 >})()) { + + ~ => Pos: (394 to 394) SpanInfo: {"start":394,"length":1} + >} + >:=> (line 31, col 0) to (line 31, col 1) +31 >})()) { + + ~~~ => Pos: (395 to 397) SpanInfo: {"start":357,"length":41} + >(function foo() { + > return x * 30; + >})() + >:=> (line 29, col 8) to (line 31, col 4) +31 >})()) { + + ~ => Pos: (398 to 398) SpanInfo: {"start":349,"length":50} + >switch ((function foo() { + > return x * 30; + >})()) + >:=> (line 29, col 0) to (line 31, col 5) +31 >})()) { + + ~~~ => Pos: (399 to 401) SpanInfo: {"start":466,"length":3} + >x++ + >:=> (line 35, col 8) to (line 35, col 11) +-------------------------------- +32 > case (function bar() { + + ~~~~~~~~ => Pos: (402 to 409) SpanInfo: {"start":466,"length":3} + >x++ + >:=> (line 35, col 8) to (line 35, col 11) +32 > case (function bar() { + + ~~ => Pos: (410 to 411) SpanInfo: {"start":411,"length":45} + >(function bar() { + > return 30; + > })() + >:=> (line 32, col 9) to (line 34, col 8) +32 > case (function bar() { + + ~~~~~~~~~~~~~~~~~ => Pos: (412 to 428) SpanInfo: {"start":437,"length":9} + >return 30 + >:=> (line 33, col 8) to (line 33, col 17) +-------------------------------- +33 > return 30; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (429 to 447) SpanInfo: {"start":437,"length":9} + >return 30 + >:=> (line 33, col 8) to (line 33, col 17) +-------------------------------- +34 > })(): + + ~~~~~ => Pos: (448 to 452) SpanInfo: {"start":452,"length":1} + >} + >:=> (line 34, col 4) to (line 34, col 5) +34 > })(): + + ~~~ => Pos: (453 to 455) SpanInfo: {"start":411,"length":45} + >(function bar() { + > return 30; + > })() + >:=> (line 32, col 9) to (line 34, col 8) +34 > })(): + + ~~ => Pos: (456 to 457) SpanInfo: {"start":466,"length":3} + >x++ + >:=> (line 35, col 8) to (line 35, col 11) +-------------------------------- +35 > x++; + + ~~~~~~~~~~~~~ => Pos: (458 to 470) SpanInfo: {"start":466,"length":3} + >x++ + >:=> (line 35, col 8) to (line 35, col 11) +-------------------------------- +36 >} + ~ => Pos: (471 to 471) SpanInfo: {"start":466,"length":3} + >x++ + >:=> (line 35, col 8) to (line 35, col 11) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_tryCatchFinally.baseline b/tests/baselines/reference/bpSpan_tryCatchFinally.baseline new file mode 100644 index 00000000000..5a9e569f403 --- /dev/null +++ b/tests/baselines/reference/bpSpan_tryCatchFinally.baseline @@ -0,0 +1,223 @@ + +1 >var x = 10; + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":10} + >var x = 10 + >:=> (line 1, col 0) to (line 1, col 10) +-------------------------------- +2 >try { + + ~~~~~~ => Pos: (12 to 17) SpanInfo: {"start":22,"length":9} + >x = x + 1 + >:=> (line 3, col 4) to (line 3, col 13) +-------------------------------- +3 > x = x + 1; + + ~~~~~~~~~~~~~~~ => Pos: (18 to 32) SpanInfo: {"start":22,"length":9} + >x = x + 1 + >:=> (line 3, col 4) to (line 3, col 13) +-------------------------------- +4 >} catch (e) { + + ~ => Pos: (33 to 33) SpanInfo: {"start":22,"length":9} + >x = x + 1 + >:=> (line 3, col 4) to (line 3, col 13) +4 >} catch (e) { + + ~~~~~~~~~~~~~ => Pos: (34 to 46) SpanInfo: {"start":51,"length":9} + >x = x - 1 + >:=> (line 5, col 4) to (line 5, col 13) +-------------------------------- +5 > x = x - 1; + + ~~~~~~~~~~~~~~~ => Pos: (47 to 61) SpanInfo: {"start":51,"length":9} + >x = x - 1 + >:=> (line 5, col 4) to (line 5, col 13) +-------------------------------- +6 >} finally { + + ~ => Pos: (62 to 62) SpanInfo: {"start":51,"length":9} + >x = x - 1 + >:=> (line 5, col 4) to (line 5, col 13) +6 >} finally { + + ~~~~~~~~~~~ => Pos: (63 to 73) SpanInfo: {"start":78,"length":10} + >x = x * 10 + >:=> (line 7, col 4) to (line 7, col 14) +-------------------------------- +7 > x = x * 10; + + ~~~~~~~~~~~~~~~~ => Pos: (74 to 89) SpanInfo: {"start":78,"length":10} + >x = x * 10 + >:=> (line 7, col 4) to (line 7, col 14) +-------------------------------- +8 >} + + ~~ => Pos: (90 to 91) SpanInfo: {"start":78,"length":10} + >x = x * 10 + >:=> (line 7, col 4) to (line 7, col 14) +-------------------------------- +9 >try + + ~~~~ => Pos: (92 to 95) SpanInfo: {"start":102,"length":9} + >x = x + 1 + >:=> (line 11, col 4) to (line 11, col 13) +-------------------------------- +10 >{ + + ~~ => Pos: (96 to 97) SpanInfo: {"start":102,"length":9} + >x = x + 1 + >:=> (line 11, col 4) to (line 11, col 13) +-------------------------------- +11 > x = x + 1; + + ~~~~~~~~~~~~~~~ => Pos: (98 to 112) SpanInfo: {"start":102,"length":9} + >x = x + 1 + >:=> (line 11, col 4) to (line 11, col 13) +-------------------------------- +12 > throw new Error(); + + ~~~~~~~~~ => Pos: (113 to 121) SpanInfo: {"start":117,"length":17} + >throw new Error() + >:=> (line 12, col 4) to (line 12, col 21) +12 > throw new Error(); + + ~~~~~~~~~~~~~~ => Pos: (122 to 135) SpanInfo: {"start":123,"length":11} + >new Error() + >:=> (line 12, col 10) to (line 12, col 21) +-------------------------------- +13 >} + + ~~ => Pos: (136 to 137) SpanInfo: {"start":117,"length":17} + >throw new Error() + >:=> (line 12, col 4) to (line 12, col 21) +-------------------------------- +14 >catch (e) + + ~~~~~~~~~~ => Pos: (138 to 147) SpanInfo: {"start":154,"length":9} + >x = x - 1 + >:=> (line 16, col 4) to (line 16, col 13) +-------------------------------- +15 >{ + + ~~ => Pos: (148 to 149) SpanInfo: {"start":154,"length":9} + >x = x - 1 + >:=> (line 16, col 4) to (line 16, col 13) +-------------------------------- +16 > x = x - 1; + + ~~~~~~~~~~~~~~~ => Pos: (150 to 164) SpanInfo: {"start":154,"length":9} + >x = x - 1 + >:=> (line 16, col 4) to (line 16, col 13) +-------------------------------- +17 >} + + ~~ => Pos: (165 to 166) SpanInfo: {"start":154,"length":9} + >x = x - 1 + >:=> (line 16, col 4) to (line 16, col 13) +-------------------------------- +18 >finally + + ~~~~~~~~ => Pos: (167 to 174) SpanInfo: {"start":181,"length":10} + >x = x * 10 + >:=> (line 20, col 4) to (line 20, col 14) +-------------------------------- +19 >{ + + ~~ => Pos: (175 to 176) SpanInfo: {"start":181,"length":10} + >x = x * 10 + >:=> (line 20, col 4) to (line 20, col 14) +-------------------------------- +20 > x = x * 10; + + ~~~~~~~~~~~~~~~~ => Pos: (177 to 192) SpanInfo: {"start":181,"length":10} + >x = x * 10 + >:=> (line 20, col 4) to (line 20, col 14) +-------------------------------- +21 >} + + ~~ => Pos: (193 to 194) SpanInfo: {"start":181,"length":10} + >x = x * 10 + >:=> (line 20, col 4) to (line 20, col 14) +-------------------------------- +22 >try { + + ~~~~~~ => Pos: (195 to 200) SpanInfo: {"start":205,"length":65} + >throw (function foo() { + > new Error(x.toString()); + > })() + >:=> (line 23, col 4) to (line 25, col 8) +-------------------------------- +23 > throw (function foo() { + + ~~~~~~~~~ => Pos: (201 to 209) SpanInfo: {"start":205,"length":65} + >throw (function foo() { + > new Error(x.toString()); + > })() + >:=> (line 23, col 4) to (line 25, col 8) +23 > throw (function foo() { + + ~~ => Pos: (210 to 211) SpanInfo: {"start":211,"length":59} + >(function foo() { + > new Error(x.toString()); + > })() + >:=> (line 23, col 10) to (line 25, col 8) +23 > throw (function foo() { + + ~~~~~~~~~~~~~~~~~ => Pos: (212 to 228) SpanInfo: {"start":237,"length":23} + >new Error(x.toString()) + >:=> (line 24, col 8) to (line 24, col 31) +-------------------------------- +24 > new Error(x.toString()); + + ~~~~~~~~~~~~~~~~~~ => Pos: (229 to 246) SpanInfo: {"start":237,"length":23} + >new Error(x.toString()) + >:=> (line 24, col 8) to (line 24, col 31) +24 > new Error(x.toString()); + + ~~~~~~~~~~~~ => Pos: (247 to 258) SpanInfo: {"start":247,"length":12} + >x.toString() + >:=> (line 24, col 18) to (line 24, col 30) +24 > new Error(x.toString()); + + ~~~ => Pos: (259 to 261) SpanInfo: {"start":237,"length":23} + >new Error(x.toString()) + >:=> (line 24, col 8) to (line 24, col 31) +-------------------------------- +25 > })(); + + ~~~~~ => Pos: (262 to 266) SpanInfo: {"start":266,"length":1} + >} + >:=> (line 25, col 4) to (line 25, col 5) +25 > })(); + + ~~~~~ => Pos: (267 to 271) SpanInfo: {"start":211,"length":59} + >(function foo() { + > new Error(x.toString()); + > })() + >:=> (line 23, col 10) to (line 25, col 8) +-------------------------------- +26 >} + + ~~ => Pos: (272 to 273) SpanInfo: {"start":205,"length":65} + >throw (function foo() { + > new Error(x.toString()); + > })() + >:=> (line 23, col 4) to (line 25, col 8) +-------------------------------- +27 >finally { + + ~~~~~~~~~~ => Pos: (274 to 283) SpanInfo: {"start":288,"length":3} + >x++ + >:=> (line 28, col 4) to (line 28, col 7) +-------------------------------- +28 > x++; + + ~~~~~~~~~ => Pos: (284 to 292) SpanInfo: {"start":288,"length":3} + >x++ + >:=> (line 28, col 4) to (line 28, col 7) +-------------------------------- +29 >} + ~ => Pos: (293 to 293) SpanInfo: {"start":288,"length":3} + >x++ + >:=> (line 28, col 4) to (line 28, col 7) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline b/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline new file mode 100644 index 00000000000..c04ddb8503b --- /dev/null +++ b/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline @@ -0,0 +1,82 @@ + +1 >class Greeter { + + ~~~~~~~~~~~~~~~~ => Pos: (0 to 15) SpanInfo: {"start":0,"length":17} + >class Greeter { + >} + >:=> (line 1, col 0) to (line 2, col 1) +-------------------------------- +2 >} + + ~~ => Pos: (16 to 17) SpanInfo: {"start":16,"length":1} + >} + >:=> (line 2, col 0) to (line 2, col 1) +-------------------------------- +3 >var a = new Greeter(); + + ~~~~~~~ => Pos: (18 to 24) SpanInfo: {"start":18,"length":30} + >var a = new Greeter() + >:=> (line 3, col 0) to (line 3, col 30) +3 >var a = new Greeter(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (25 to 49) SpanInfo: {"start":35,"length":13} + >new Greeter() + >:=> (line 3, col 17) to (line 3, col 30) +-------------------------------- +4 >a = ( new Greeter()); + + ~~~~~ => Pos: (50 to 54) SpanInfo: {"start":50,"length":29} + >a = ( new Greeter()) + >:=> (line 4, col 0) to (line 4, col 29) +4 >a = ( new Greeter()); + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (55 to 77) SpanInfo: {"start":65,"length":13} + >new Greeter() + >:=> (line 4, col 15) to (line 4, col 28) +4 >a = ( new Greeter()); + + ~~~ => Pos: (78 to 80) SpanInfo: {"start":50,"length":29} + >a = ( new Greeter()) + >:=> (line 4, col 0) to (line 4, col 29) +-------------------------------- +5 >a = (function foo() { + + ~~~ => Pos: (81 to 83) SpanInfo: {"start":81,"length":61} + >a = (function foo() { + > return new Greeter(); + >})() + >:=> (line 5, col 0) to (line 7, col 4) +5 >a = (function foo() { + + ~~~~~~~~~~~ => Pos: (84 to 94) SpanInfo: {"start":94,"length":48} + >(function foo() { + > return new Greeter(); + >})() + >:=> (line 5, col 13) to (line 7, col 4) +5 >a = (function foo() { + + ~~~~~~~~~~~~~~~~~ => Pos: (95 to 111) SpanInfo: {"start":116,"length":20} + >return new Greeter() + >:=> (line 6, col 4) to (line 6, col 24) +-------------------------------- +6 > return new Greeter(); + + ~~~~~~~~~~ => Pos: (112 to 121) SpanInfo: {"start":116,"length":20} + >return new Greeter() + >:=> (line 6, col 4) to (line 6, col 24) +6 > return new Greeter(); + + ~~~~~~~~~~~~~~~~ => Pos: (122 to 137) SpanInfo: {"start":123,"length":13} + >new Greeter() + >:=> (line 6, col 11) to (line 6, col 24) +-------------------------------- +7 >})(); + ~ => Pos: (138 to 138) SpanInfo: {"start":138,"length":1} + >} + >:=> (line 7, col 0) to (line 7, col 1) +7 >})(); + ~~~~ => Pos: (139 to 142) SpanInfo: {"start":94,"length":48} + >(function foo() { + > return new Greeter(); + >})() + >:=> (line 5, col 13) to (line 7, col 4) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_typealias.baseline b/tests/baselines/reference/bpSpan_typealias.baseline new file mode 100644 index 00000000000..88e60b55e47 --- /dev/null +++ b/tests/baselines/reference/bpSpan_typealias.baseline @@ -0,0 +1,78 @@ + +1 >module m2 { + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":164} + >module m2 { + > module m { + > export class c { + > } + > } + > type a = m.c; + > export type b = m.c; + > var x: a = new m.c(); + > var y: b = new m.c(); + >} + >:=> (line 1, col 0) to (line 10, col 1) +-------------------------------- +2 > module m { + + ~~~~~~~~~~~~~~~ => Pos: (12 to 26) SpanInfo: {"start":16,"length":51} + >module m { + > export class c { + > } + > } + >:=> (line 2, col 4) to (line 5, col 5) +-------------------------------- +3 > export class c { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (27 to 51) SpanInfo: {"start":35,"length":26} + >export class c { + > } + >:=> (line 3, col 8) to (line 4, col 9) +-------------------------------- +4 > } + + ~~~~~~~~~~ => Pos: (52 to 61) SpanInfo: {"start":60,"length":1} + >} + >:=> (line 4, col 8) to (line 4, col 9) +-------------------------------- +5 > } + + ~~~~~~ => Pos: (62 to 67) SpanInfo: {"start":66,"length":1} + >} + >:=> (line 5, col 4) to (line 5, col 5) +-------------------------------- +6 > type a = m.c; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +7 > export type b = m.c; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 110) SpanInfo: undefined +-------------------------------- +8 > var x: a = new m.c(); + + ~~~~~~~~~~~~~~ => Pos: (111 to 124) SpanInfo: {"start":115,"length":20} + >var x: a = new m.c() + >:=> (line 8, col 4) to (line 8, col 24) +8 > var x: a = new m.c(); + + ~~~~~~~~~~~~ => Pos: (125 to 136) SpanInfo: {"start":126,"length":9} + >new m.c() + >:=> (line 8, col 15) to (line 8, col 24) +-------------------------------- +9 > var y: b = new m.c(); + + ~~~~~~~~~~~~~~ => Pos: (137 to 150) SpanInfo: {"start":141,"length":20} + >var y: b = new m.c() + >:=> (line 9, col 4) to (line 9, col 24) +9 > var y: b = new m.c(); + + ~~~~~~~~~~~~ => Pos: (151 to 162) SpanInfo: {"start":152,"length":9} + >new m.c() + >:=> (line 9, col 15) to (line 9, col 24) +-------------------------------- +10 >} + ~ => Pos: (163 to 163) SpanInfo: {"start":163,"length":1} + >} + >:=> (line 10, col 0) to (line 10, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_unaryExpressions.baseline b/tests/baselines/reference/bpSpan_unaryExpressions.baseline new file mode 100644 index 00000000000..2ad1191cf95 --- /dev/null +++ b/tests/baselines/reference/bpSpan_unaryExpressions.baseline @@ -0,0 +1,74 @@ + +1 >var x = 10; + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":10} + >var x = 10 + >:=> (line 1, col 0) to (line 1, col 10) +-------------------------------- +2 >var y = 20; + + ~~~~~~~~~~~~ => Pos: (12 to 23) SpanInfo: {"start":12,"length":10} + >var y = 20 + >:=> (line 2, col 0) to (line 2, col 10) +-------------------------------- +3 >x++; + + ~~~~~ => Pos: (24 to 28) SpanInfo: {"start":24,"length":3} + >x++ + >:=> (line 3, col 0) to (line 3, col 3) +-------------------------------- +4 >y--; + + ~~~~~ => Pos: (29 to 33) SpanInfo: {"start":29,"length":3} + >y-- + >:=> (line 4, col 0) to (line 4, col 3) +-------------------------------- +5 >typeof (function foo() { + + ~~~~~~ => Pos: (34 to 39) SpanInfo: {"start":34,"length":43} + >typeof (function foo() { + > return y; + >})() + >:=> (line 5, col 0) to (line 7, col 4) +5 >typeof (function foo() { + + ~~ => Pos: (40 to 41) SpanInfo: {"start":41,"length":36} + >(function foo() { + > return y; + >})() + >:=> (line 5, col 7) to (line 7, col 4) +5 >typeof (function foo() { + + ~~~~~~~~~~~~~~~~~ => Pos: (42 to 58) SpanInfo: {"start":63,"length":8} + >return y + >:=> (line 6, col 4) to (line 6, col 12) +-------------------------------- +6 > return y; + + ~~~~~~~~~~~~~~ => Pos: (59 to 72) SpanInfo: {"start":63,"length":8} + >return y + >:=> (line 6, col 4) to (line 6, col 12) +-------------------------------- +7 >})(); + + ~ => Pos: (73 to 73) SpanInfo: {"start":73,"length":1} + >} + >:=> (line 7, col 0) to (line 7, col 1) +7 >})(); + + ~~~~~ => Pos: (74 to 78) SpanInfo: {"start":41,"length":36} + >(function foo() { + > return y; + >})() + >:=> (line 5, col 7) to (line 7, col 4) +-------------------------------- +8 >++x; + + ~~~~~ => Pos: (79 to 83) SpanInfo: {"start":79,"length":3} + >++x + >:=> (line 8, col 0) to (line 8, col 3) +-------------------------------- +9 >++y; + ~~~~ => Pos: (84 to 87) SpanInfo: {"start":84,"length":3} + >++y + >:=> (line 9, col 0) to (line 9, col 3) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_variables.baseline b/tests/baselines/reference/bpSpan_variables.baseline new file mode 100644 index 00000000000..1904c34b835 --- /dev/null +++ b/tests/baselines/reference/bpSpan_variables.baseline @@ -0,0 +1,90 @@ + +1 >var a = 10; + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":10} + >var a = 10 + >:=> (line 1, col 0) to (line 1, col 10) +-------------------------------- +2 >var b; + + ~~~~~~~ => Pos: (12 to 18) SpanInfo: undefined +-------------------------------- +3 >var c = 10, d, e; + + ~~~~~~~~~~~~~~~~~~ => Pos: (19 to 36) SpanInfo: {"start":19,"length":10} + >var c = 10 + >:=> (line 3, col 0) to (line 3, col 10) +-------------------------------- +4 >var c2, d2 = 10; + + ~~~~~~~ => Pos: (37 to 43) SpanInfo: undefined +4 >var c2, d2 = 10; + + ~~~~~~~~~~ => Pos: (44 to 53) SpanInfo: {"start":45,"length":7} + >d2 = 10 + >:=> (line 4, col 8) to (line 4, col 15) +-------------------------------- +5 >module m { + + ~~~~~~~~~~~ => Pos: (54 to 64) SpanInfo: {"start":54,"length":146} + >module m { + > var x1; + > var x2 = 10, x3 = 10; + > var x4, x5; + > export var xx1; + > export var xx2 = 10, xx3 = 10; + > export var xx4, xx5; + >} + >:=> (line 5, col 0) to (line 12, col 1) +-------------------------------- +6 > var x1; + + ~~~~~~~~~~~~ => Pos: (65 to 76) SpanInfo: undefined +-------------------------------- +7 > var x2 = 10, x3 = 10; + + ~~~~~~~~~~~~~~~~ => Pos: (77 to 92) SpanInfo: {"start":81,"length":11} + >var x2 = 10 + >:=> (line 7, col 4) to (line 7, col 15) +7 > var x2 = 10, x3 = 10; + + ~~~~~~~~~~ => Pos: (93 to 102) SpanInfo: {"start":94,"length":7} + >x3 = 10 + >:=> (line 7, col 17) to (line 7, col 24) +-------------------------------- +8 > var x4, x5; + + ~~~~~~~~~~~~~~~~ => Pos: (103 to 118) SpanInfo: undefined +-------------------------------- +9 > export var xx1; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (119 to 138) SpanInfo: {"start":123,"length":14} + >export var xx1 + >:=> (line 9, col 4) to (line 9, col 18) +-------------------------------- +10 > export var xx2 = 10, xx3 = 10; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (139 to 162) SpanInfo: {"start":143,"length":19} + >export var xx2 = 10 + >:=> (line 10, col 4) to (line 10, col 23) +10 > export var xx2 = 10, xx3 = 10; + + ~~~~~~~~~~~ => Pos: (163 to 173) SpanInfo: {"start":164,"length":8} + >xx3 = 10 + >:=> (line 10, col 25) to (line 10, col 33) +-------------------------------- +11 > export var xx4, xx5; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (174 to 192) SpanInfo: {"start":178,"length":14} + >export var xx4 + >:=> (line 11, col 4) to (line 11, col 18) +11 > export var xx4, xx5; + + ~~~~~~ => Pos: (193 to 198) SpanInfo: {"start":194,"length":3} + >xx5 + >:=> (line 11, col 20) to (line 11, col 23) +-------------------------------- +12 >} + ~ => Pos: (199 to 199) SpanInfo: {"start":199,"length":1} + >} + >:=> (line 12, col 0) to (line 12, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_while.baseline b/tests/baselines/reference/bpSpan_while.baseline new file mode 100644 index 00000000000..91632b78009 --- /dev/null +++ b/tests/baselines/reference/bpSpan_while.baseline @@ -0,0 +1,133 @@ + +1 >var a = 10; + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":10} + >var a = 10 + >:=> (line 1, col 0) to (line 1, col 10) +-------------------------------- +2 >while (a == 10) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (12 to 29) SpanInfo: {"start":12,"length":15} + >while (a == 10) + >:=> (line 2, col 0) to (line 2, col 15) +-------------------------------- +3 > a++; + + ~~~~~~~~~ => Pos: (30 to 38) SpanInfo: {"start":34,"length":3} + >a++ + >:=> (line 3, col 4) to (line 3, col 7) +-------------------------------- +4 >} + + ~~ => Pos: (39 to 40) SpanInfo: {"start":34,"length":3} + >a++ + >:=> (line 3, col 4) to (line 3, col 7) +-------------------------------- +5 >while (a == 10) + + ~~~~~~~~~~~~~~~~~ => Pos: (41 to 57) SpanInfo: {"start":41,"length":15} + >while (a == 10) + >:=> (line 5, col 0) to (line 5, col 15) +-------------------------------- +6 >{ + + ~~ => Pos: (58 to 59) SpanInfo: {"start":64,"length":3} + >a++ + >:=> (line 7, col 4) to (line 7, col 7) +-------------------------------- +7 > a++; + + ~~~~~~~~~ => Pos: (60 to 68) SpanInfo: {"start":64,"length":3} + >a++ + >:=> (line 7, col 4) to (line 7, col 7) +-------------------------------- +8 >} + + ~~ => Pos: (69 to 70) SpanInfo: {"start":64,"length":3} + >a++ + >:=> (line 7, col 4) to (line 7, col 7) +-------------------------------- +9 >while (a == 10) a++; + + ~~~~~~~~~~~~~~~ => Pos: (71 to 85) SpanInfo: {"start":71,"length":15} + >while (a == 10) + >:=> (line 9, col 0) to (line 9, col 15) +9 >while (a == 10) a++; + + ~~~~~~~ => Pos: (86 to 92) SpanInfo: {"start":88,"length":3} + >a++ + >:=> (line 9, col 17) to (line 9, col 20) +-------------------------------- +10 >while (a == 10) + + ~~~~~~~~~~~~~~~~~ => Pos: (93 to 109) SpanInfo: {"start":93,"length":15} + >while (a == 10) + >:=> (line 10, col 0) to (line 10, col 15) +-------------------------------- +11 > a++; + + ~~~~~~~~~ => Pos: (110 to 118) SpanInfo: {"start":114,"length":3} + >a++ + >:=> (line 11, col 4) to (line 11, col 7) +-------------------------------- +12 >while ((function () { + + ~~~~~~~ => Pos: (119 to 125) SpanInfo: {"start":119,"length":52} + >while ((function () { + > return 30 * a; + >})() !== a) + >:=> (line 12, col 0) to (line 14, col 11) +12 >while ((function () { + + ~ => Pos: (126 to 126) SpanInfo: {"start":126,"length":38} + >(function () { + > return 30 * a; + >})() + >:=> (line 12, col 7) to (line 14, col 4) +12 >while ((function () { + + ~~~~~~~~~~~~~~ => Pos: (127 to 140) SpanInfo: {"start":145,"length":13} + >return 30 * a + >:=> (line 13, col 4) to (line 13, col 17) +-------------------------------- +13 > return 30 * a; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (141 to 159) SpanInfo: {"start":145,"length":13} + >return 30 * a + >:=> (line 13, col 4) to (line 13, col 17) +-------------------------------- +14 >})() !== a) { + + ~ => Pos: (160 to 160) SpanInfo: {"start":160,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +14 >})() !== a) { + + ~~~ => Pos: (161 to 163) SpanInfo: {"start":126,"length":38} + >(function () { + > return 30 * a; + >})() + >:=> (line 12, col 7) to (line 14, col 4) +14 >})() !== a) { + + ~~~~~~~ => Pos: (164 to 170) SpanInfo: {"start":119,"length":52} + >while ((function () { + > return 30 * a; + >})() !== a) + >:=> (line 12, col 0) to (line 14, col 11) +14 >})() !== a) { + + ~~~ => Pos: (171 to 173) SpanInfo: {"start":178,"length":3} + >a-- + >:=> (line 15, col 4) to (line 15, col 7) +-------------------------------- +15 > a--; + + ~~~~~~~~~ => Pos: (174 to 182) SpanInfo: {"start":178,"length":3} + >a-- + >:=> (line 15, col 4) to (line 15, col 7) +-------------------------------- +16 >} + ~ => Pos: (183 to 183) SpanInfo: {"start":178,"length":3} + >a-- + >:=> (line 15, col 4) to (line 15, col 7) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_with.baseline b/tests/baselines/reference/bpSpan_with.baseline new file mode 100644 index 00000000000..d4a00e7a3aa --- /dev/null +++ b/tests/baselines/reference/bpSpan_with.baseline @@ -0,0 +1,21 @@ + +1 >var obj: string; + + ~~~~~~~~~~~~~~~~~ => Pos: (0 to 16) SpanInfo: undefined +-------------------------------- +2 >with (obj) { + + ~~~~~~~~~~~~~ => Pos: (17 to 29) SpanInfo: {"start":34,"length":6} + >x = 10 + >:=> (line 3, col 4) to (line 3, col 10) +-------------------------------- +3 > x = 10; + + ~~~~~~~~~~~~ => Pos: (30 to 41) SpanInfo: {"start":34,"length":6} + >x = 10 + >:=> (line 3, col 4) to (line 3, col 10) +-------------------------------- +4 >} + ~ => Pos: (42 to 42) SpanInfo: {"start":34,"length":6} + >x = 10 + >:=> (line 3, col 4) to (line 3, col 10) \ No newline at end of file diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt b/tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt index 667108c902d..c331ff09c2c 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/breakInIterationOrSwitchStatement4.ts(1,15): error TS2304: Cannot find name 'something'. + + ==== tests/cases/compiler/breakInIterationOrSwitchStatement4.ts (1 errors) ==== for (var i in something) { ~~~~~~~~~ -!!! Cannot find name 'something'. +!!! error TS2304: Cannot find name 'something'. break; } \ No newline at end of file diff --git a/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.errors.txt b/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.errors.txt index 6220fd09e9d..28a762f3d09 100644 --- a/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.errors.txt +++ b/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/breakNotInIterationOrSwitchStatement1.ts(1,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. + + ==== tests/cases/compiler/breakNotInIterationOrSwitchStatement1.ts (1 errors) ==== break; ~~~~~~ -!!! A 'break' statement can only be used within an enclosing iteration or switch statement. \ No newline at end of file +!!! error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. \ No newline at end of file diff --git a/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.errors.txt b/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.errors.txt index e34345f8e8c..d77fb4bc05b 100644 --- a/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.errors.txt +++ b/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/breakNotInIterationOrSwitchStatement2.ts(3,5): error TS1107: Jump target cannot cross function boundary. + + ==== tests/cases/compiler/breakNotInIterationOrSwitchStatement2.ts (1 errors) ==== while (true) { function f() { break; ~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget5.errors.txt b/tests/baselines/reference/breakTarget5.errors.txt index a9b3932bcbb..a54a415b990 100644 --- a/tests/baselines/reference/breakTarget5.errors.txt +++ b/tests/baselines/reference/breakTarget5.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/breakTarget5.ts(5,7): error TS1107: Jump target cannot cross function boundary. + + ==== tests/cases/compiler/breakTarget5.ts (1 errors) ==== target: while (true) { @@ -5,7 +8,7 @@ while (true) { break target; ~~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } } \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget6.errors.txt b/tests/baselines/reference/breakTarget6.errors.txt index 3a921bc6d36..82d823c986d 100644 --- a/tests/baselines/reference/breakTarget6.errors.txt +++ b/tests/baselines/reference/breakTarget6.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/breakTarget6.ts(2,3): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. + + ==== tests/cases/compiler/breakTarget6.ts (1 errors) ==== while (true) { break target; ~~~~~~~~~~~~~ -!!! A 'break' statement can only jump to a label of an enclosing statement. +!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. } \ No newline at end of file diff --git a/tests/baselines/reference/callConstructAssignment.errors.txt b/tests/baselines/reference/callConstructAssignment.errors.txt index e80dbcbfc38..42949cf585d 100644 --- a/tests/baselines/reference/callConstructAssignment.errors.txt +++ b/tests/baselines/reference/callConstructAssignment.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/callConstructAssignment.ts(7,1): error TS2322: Type 'new () => any' is not assignable to type '() => void'. +tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2322: Type '() => void' is not assignable to type 'new () => any'. + + ==== tests/cases/compiler/callConstructAssignment.ts (2 errors) ==== @@ -7,7 +11,7 @@ foo = bar; // error ~~~ -!!! Type 'new () => any' is not assignable to type '() => void'. +!!! error TS2322: Type 'new () => any' is not assignable to type '() => void'. bar = foo; // error ~~~ -!!! Type '() => void' is not assignable to type 'new () => any'. \ No newline at end of file +!!! error TS2322: Type '() => void' is not assignable to type 'new () => any'. \ No newline at end of file diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt index dfe311ab86c..0e8e8ff9303 100644 --- a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt @@ -1,3 +1,19 @@ +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(5,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(6,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(9,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(10,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(13,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(14,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(21,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(22,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(28,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(29,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(36,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(37,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(43,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,11): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts (14 errors) ==== // type parameter lists must exactly match type argument lists // all of these invocations are errors @@ -5,26 +21,26 @@ function f(x: T, y: U): T { return null; } var r1 = f(1, ''); ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r1b = f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var f2 = (x: T, y: U): T => { return null; } var r2 = f2(1, ''); ~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r2b = f2(1, ''); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var f3: { (x: T, y: U): T; } var r3 = f3(1, ''); ~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r3b = f3(1, ''); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. class C { f(x: T, y: U): T { @@ -33,10 +49,10 @@ } var r4 = (new C()).f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r4b = (new C()).f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. interface I { f(x: T, y: U): T; @@ -44,10 +60,10 @@ var i: I; var r5 = i.f(1, ''); ~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r5b = i.f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. class C2 { f(x: T, y: U): T { @@ -56,10 +72,10 @@ } var r6 = (new C2()).f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r6b = (new C2()).f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. interface I2 { f(x: T, y: U): T; @@ -67,7 +83,7 @@ var i2: I2; var r7 = i2.f(1, ''); ~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r7b = i2.f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt index 69284efdf82..6a11751ead3 100644 --- a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt +++ b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt @@ -1,3 +1,14 @@ +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(5,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(8,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(11,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(18,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(24,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(31,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(37,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(40,10): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(43,10): error TS2347: Untyped function calls may not accept type arguments. + + ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts (9 errors) ==== // it is always illegal to provide type arguments to a non-generic function // all invocations here are illegal @@ -5,17 +16,17 @@ function f(x: number) { return null; } var r = f(1); ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var f2 = (x: number) => { return null; } var r2 = f2(1); ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var f3: { (x: number): any; } var r3 = f3(1); ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. class C { f(x: number) { @@ -24,7 +35,7 @@ } var r4 = (new C()).f(1); ~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. interface I { f(x: number): any; @@ -32,7 +43,7 @@ var i: I; var r5 = i.f(1); ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. class C2 { f(x: number) { @@ -41,7 +52,7 @@ } var r6 = (new C2()).f(1); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. interface I2 { f(x: number); @@ -49,14 +60,14 @@ var i2: I2; var r7 = i2.f(1); ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var a; var r8 = a(); ~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. var a2: any; var r8 = a2(); ~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. \ No newline at end of file +!!! error TS2347: Untyped function calls may not accept type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/callOnClass.errors.txt b/tests/baselines/reference/callOnClass.errors.txt index 9232fefe703..83e4472dd4f 100644 --- a/tests/baselines/reference/callOnClass.errors.txt +++ b/tests/baselines/reference/callOnClass.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/callOnClass.ts(2,9): error TS2348: Value of type 'typeof C' is not callable. Did you mean to include 'new'? + + ==== tests/cases/compiler/callOnClass.ts (1 errors) ==== class C { } var c = C(); ~~~ -!!! Value of type 'typeof C' is not callable. Did you mean to include 'new'? +!!! error TS2348: Value of type 'typeof C' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/callOnInstance.errors.txt b/tests/baselines/reference/callOnInstance.errors.txt index da866a56e04..156bdfd512a 100644 --- a/tests/baselines/reference/callOnInstance.errors.txt +++ b/tests/baselines/reference/callOnInstance.errors.txt @@ -1,19 +1,28 @@ -==== tests/cases/compiler/callOnInstance.ts (4 errors) ==== - declare function D(): string; +tests/cases/compiler/callOnInstance.ts(1,18): error TS2300: Duplicate identifier 'D'. +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 (5 errors) ==== + declare function D(): string; // error + ~ +!!! error TS2300: Duplicate identifier 'D'. - declare class D { constructor (value: number); } // Duplicate identifier + declare class D { constructor (value: number); } // error ~ -!!! Duplicate identifier 'D'. +!!! error TS2300: Duplicate identifier 'D'. var s1: string = D(); // OK var s2: string = (new D(1))(); ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. ~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. +!!! error TS2350: Only a void function can be called with the 'new' keyword. declare class C { constructor(value: number); } (new C(1))(); // Error for calling an instance ~~~~~~~~~~~~ -!!! 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. \ No newline at end of file diff --git a/tests/baselines/reference/callOnInstance.js b/tests/baselines/reference/callOnInstance.js index 477bdca26a7..3b07d0affc8 100644 --- a/tests/baselines/reference/callOnInstance.js +++ b/tests/baselines/reference/callOnInstance.js @@ -1,7 +1,7 @@ //// [callOnInstance.ts] -declare function D(): string; +declare function D(): string; // error -declare class D { constructor (value: number); } // Duplicate identifier +declare class D { constructor (value: number); } // error var s1: string = D(); // OK diff --git a/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt b/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt index 46b7f099ff0..cc8599ca91f 100644 --- a/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt +++ b/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/callOverloadViaElementAccessExpression.ts(10,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/callOverloadViaElementAccessExpression.ts(11,5): error TS2322: Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/callOverloadViaElementAccessExpression.ts (2 errors) ==== class C { foo(x: number): number; @@ -10,7 +14,7 @@ var c = new C(); var r: string = c['foo'](1); ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r2: number = c['foo'](''); ~~ -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/callOverloads1.errors.txt b/tests/baselines/reference/callOverloads1.errors.txt index a561ffb0c83..64927462104 100644 --- a/tests/baselines/reference/callOverloads1.errors.txt +++ b/tests/baselines/reference/callOverloads1.errors.txt @@ -1,5 +1,13 @@ -==== tests/cases/compiler/callOverloads1.ts (3 errors) ==== - class Foo { +tests/cases/compiler/callOverloads1.ts(1,7): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads1.ts(9,10): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads1.ts(9,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/callOverloads1.ts(17,1): error TS2348: Value of type 'typeof Foo' is not callable. Did you mean to include 'new'? + + +==== tests/cases/compiler/callOverloads1.ts (4 errors) ==== + class Foo { // error + ~~~ +!!! error TS2300: Duplicate identifier 'Foo'. bar1() { /*WScript.Echo("bar1");*/ } constructor(x: any) { @@ -9,9 +17,9 @@ function Foo(); // error ~~~ -!!! Duplicate identifier 'Foo'. +!!! error TS2300: Duplicate identifier 'Foo'. ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. function F1(s:string); function F1(a:any) { return a;} @@ -21,4 +29,4 @@ f1.bar1(); Foo(); ~~~~~ -!!! Value of type 'typeof Foo' is not callable. Did you mean to include 'new'? \ No newline at end of file +!!! error TS2348: Value of type 'typeof Foo' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/callOverloads1.js b/tests/baselines/reference/callOverloads1.js index dc76fcba98a..86cb951f853 100644 --- a/tests/baselines/reference/callOverloads1.js +++ b/tests/baselines/reference/callOverloads1.js @@ -1,5 +1,5 @@ //// [callOverloads1.ts] -class Foo { +class Foo { // error bar1() { /*WScript.Echo("bar1");*/ } constructor(x: any) { diff --git a/tests/baselines/reference/callOverloads2.errors.txt b/tests/baselines/reference/callOverloads2.errors.txt index a715c13401e..6291fa8f3de 100644 --- a/tests/baselines/reference/callOverloads2.errors.txt +++ b/tests/baselines/reference/callOverloads2.errors.txt @@ -1,7 +1,18 @@ -==== tests/cases/compiler/callOverloads2.ts (5 errors) ==== +tests/cases/compiler/callOverloads2.ts(3,7): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads2.ts(11,10): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads2.ts(13,10): error TS2389: Function implementation name must be 'Foo'. +tests/cases/compiler/callOverloads2.ts(13,10): error TS2393: Duplicate function implementation. +tests/cases/compiler/callOverloads2.ts(14,10): error TS2393: Duplicate function implementation. +tests/cases/compiler/callOverloads2.ts(16,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/callOverloads2.ts(24,1): error TS2348: Value of type 'typeof Foo' is not callable. Did you mean to include 'new'? + + +==== tests/cases/compiler/callOverloads2.ts (7 errors) ==== - class Foo { + class Foo { // error + ~~~ +!!! error TS2300: Duplicate identifier 'Foo'. bar1() { /*WScript.Echo("bar1");*/ } constructor(x: any) { @@ -9,20 +20,22 @@ } } - function Foo(); + function Foo(); // error ~~~ -!!! Duplicate identifier 'Foo'. +!!! error TS2300: Duplicate identifier 'Foo'. - function F1(s:string) {return s;} + function F1(s:string) {return s;} // error ~~ -!!! Function implementation name must be 'Foo'. - function F1(a:any) { return a;} // error - duplicate identifier - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate function implementation. +!!! error TS2389: Function implementation name must be 'Foo'. + ~~ +!!! error TS2393: Duplicate function implementation. + function F1(a:any) { return a;} // error + ~~ +!!! error TS2393: Duplicate function implementation. function Goo(s:string); // error - no implementation ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. declare function Gar(s:String); // expect no error @@ -32,5 +45,5 @@ f1.bar1(); Foo(); ~~~~~ -!!! Value of type 'typeof Foo' is not callable. Did you mean to include 'new'? +!!! error TS2348: Value of type 'typeof Foo' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/callOverloads2.js b/tests/baselines/reference/callOverloads2.js index be42753bc3d..e3cbceb177a 100644 --- a/tests/baselines/reference/callOverloads2.js +++ b/tests/baselines/reference/callOverloads2.js @@ -1,7 +1,7 @@ //// [callOverloads2.ts] -class Foo { +class Foo { // error bar1() { /*WScript.Echo("bar1");*/ } constructor(x: any) { @@ -9,10 +9,10 @@ class Foo { } } -function Foo(); +function Foo(); // error -function F1(s:string) {return s;} -function F1(a:any) { return a;} // error - duplicate identifier +function F1(s:string) {return s;} // error +function F1(a:any) { return a;} // error function Goo(s:string); // error - no implementation @@ -36,10 +36,10 @@ var Foo = (function () { })(); function F1(s) { return s; -} +} // error function F1(a) { return a; -} // error - duplicate identifier +} // error var f1 = new Foo("hey"); f1.bar1(); Foo(); diff --git a/tests/baselines/reference/callOverloads3.errors.txt b/tests/baselines/reference/callOverloads3.errors.txt index e6b7fecb59f..ecb889bc1ab 100644 --- a/tests/baselines/reference/callOverloads3.errors.txt +++ b/tests/baselines/reference/callOverloads3.errors.txt @@ -1,16 +1,29 @@ -==== tests/cases/compiler/callOverloads3.ts (5 errors) ==== +tests/cases/compiler/callOverloads3.ts(2,10): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads3.ts(2,16): error TS2304: Cannot find name 'Foo'. +tests/cases/compiler/callOverloads3.ts(3,10): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads3.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/callOverloads3.ts(3,24): error TS2304: Cannot find name 'Foo'. +tests/cases/compiler/callOverloads3.ts(4,7): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads3.ts(12,10): error TS2350: Only a void function can be called with the 'new' keyword. + + +==== tests/cases/compiler/callOverloads3.ts (7 errors) ==== - function Foo():Foo; - ~~~ -!!! Cannot find name 'Foo'. - function Foo(s:string):Foo; + function Foo():Foo; // error ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2300: Duplicate identifier 'Foo'. + ~~~ +!!! error TS2304: Cannot find name 'Foo'. + function Foo(s:string):Foo; // error + ~~~ +!!! error TS2300: Duplicate identifier 'Foo'. + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. ~~~ -!!! Cannot find name 'Foo'. - class Foo { +!!! error TS2304: Cannot find name 'Foo'. + class Foo { // error ~~~ -!!! Duplicate identifier 'Foo'. +!!! error TS2300: Duplicate identifier 'Foo'. bar1() { /*WScript.Echo("bar1");*/ } constructor(x: any) { // WScript.Echo("Constructor function has executed"); @@ -20,7 +33,7 @@ var f1 = new Foo("hey"); ~~~~~~~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. +!!! error TS2350: Only a void function can be called with the 'new' keyword. f1.bar1(); diff --git a/tests/baselines/reference/callOverloads3.js b/tests/baselines/reference/callOverloads3.js index 93176cc1edb..85c16fe85a6 100644 --- a/tests/baselines/reference/callOverloads3.js +++ b/tests/baselines/reference/callOverloads3.js @@ -1,8 +1,8 @@ //// [callOverloads3.ts] -function Foo():Foo; -function Foo(s:string):Foo; -class Foo { +function Foo():Foo; // error +function Foo(s:string):Foo; // error +class Foo { // error bar1() { /*WScript.Echo("bar1");*/ } constructor(x: any) { // WScript.Echo("Constructor function has executed"); diff --git a/tests/baselines/reference/callOverloads4.errors.txt b/tests/baselines/reference/callOverloads4.errors.txt index 5fafef84f4c..3010d7c15d8 100644 --- a/tests/baselines/reference/callOverloads4.errors.txt +++ b/tests/baselines/reference/callOverloads4.errors.txt @@ -1,16 +1,29 @@ -==== tests/cases/compiler/callOverloads4.ts (5 errors) ==== +tests/cases/compiler/callOverloads4.ts(2,10): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads4.ts(2,16): error TS2304: Cannot find name 'Foo'. +tests/cases/compiler/callOverloads4.ts(3,10): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads4.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/callOverloads4.ts(3,24): error TS2304: Cannot find name 'Foo'. +tests/cases/compiler/callOverloads4.ts(4,7): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads4.ts(12,10): error TS2350: Only a void function can be called with the 'new' keyword. + + +==== tests/cases/compiler/callOverloads4.ts (7 errors) ==== - function Foo():Foo; - ~~~ -!!! Cannot find name 'Foo'. - function Foo(s:string):Foo; + function Foo():Foo; // error ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2300: Duplicate identifier 'Foo'. + ~~~ +!!! error TS2304: Cannot find name 'Foo'. + function Foo(s:string):Foo; // error + ~~~ +!!! error TS2300: Duplicate identifier 'Foo'. + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. ~~~ -!!! Cannot find name 'Foo'. - class Foo { +!!! error TS2304: Cannot find name 'Foo'. + class Foo { // error ~~~ -!!! Duplicate identifier 'Foo'. +!!! error TS2300: Duplicate identifier 'Foo'. bar1() { /*WScript.Echo("bar1");*/ } constructor(s: string); constructor(x: any) { @@ -20,7 +33,7 @@ var f1 = new Foo("hey"); ~~~~~~~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. +!!! error TS2350: Only a void function can be called with the 'new' keyword. f1.bar1(); diff --git a/tests/baselines/reference/callOverloads4.js b/tests/baselines/reference/callOverloads4.js index 86ec2b91e7e..6aab555b721 100644 --- a/tests/baselines/reference/callOverloads4.js +++ b/tests/baselines/reference/callOverloads4.js @@ -1,8 +1,8 @@ //// [callOverloads4.ts] -function Foo():Foo; -function Foo(s:string):Foo; -class Foo { +function Foo():Foo; // error +function Foo(s:string):Foo; // error +class Foo { // error bar1() { /*WScript.Echo("bar1");*/ } constructor(s: string); constructor(x: any) { diff --git a/tests/baselines/reference/callOverloads5.errors.txt b/tests/baselines/reference/callOverloads5.errors.txt index 7df261b7e0c..e521a9a9076 100644 --- a/tests/baselines/reference/callOverloads5.errors.txt +++ b/tests/baselines/reference/callOverloads5.errors.txt @@ -1,15 +1,28 @@ -==== tests/cases/compiler/callOverloads5.ts (5 errors) ==== - function Foo():Foo; - ~~~ -!!! Cannot find name 'Foo'. - function Foo(s:string):Foo; +tests/cases/compiler/callOverloads5.ts(1,10): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads5.ts(1,16): error TS2304: Cannot find name 'Foo'. +tests/cases/compiler/callOverloads5.ts(2,10): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads5.ts(2,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/callOverloads5.ts(2,24): error TS2304: Cannot find name 'Foo'. +tests/cases/compiler/callOverloads5.ts(3,7): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/callOverloads5.ts(13,10): error TS2350: Only a void function can be called with the 'new' keyword. + + +==== tests/cases/compiler/callOverloads5.ts (7 errors) ==== + function Foo():Foo; // error ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2300: Duplicate identifier 'Foo'. + ~~~ +!!! error TS2304: Cannot find name 'Foo'. + function Foo(s:string):Foo; // error + ~~~ +!!! error TS2300: Duplicate identifier 'Foo'. + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. ~~~ -!!! Cannot find name 'Foo'. - class Foo { +!!! error TS2304: Cannot find name 'Foo'. + class Foo { // error ~~~ -!!! Duplicate identifier 'Foo'. +!!! error TS2300: Duplicate identifier 'Foo'. bar1(s:string); bar1(n:number); bar1(a:any) { /*WScript.Echo(a);*/ } @@ -21,7 +34,7 @@ var f1 = new Foo("hey"); ~~~~~~~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. +!!! error TS2350: Only a void function can be called with the 'new' keyword. f1.bar1("a"); diff --git a/tests/baselines/reference/callOverloads5.js b/tests/baselines/reference/callOverloads5.js index 30cc65915ec..2220568e4c2 100644 --- a/tests/baselines/reference/callOverloads5.js +++ b/tests/baselines/reference/callOverloads5.js @@ -1,7 +1,7 @@ //// [callOverloads5.ts] -function Foo():Foo; -function Foo(s:string):Foo; -class Foo { +function Foo():Foo; // error +function Foo(s:string):Foo; // error +class Foo { // error bar1(s:string); bar1(n:number); bar1(a:any) { /*WScript.Echo(a);*/ } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt index 17087865020..d6efdd66868 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts(57,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. + Type '(x: number) => string' is not assignable to type '(x: number) => number'. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts (1 errors) ==== module CallSignature { interface Base { // T @@ -57,10 +63,10 @@ // S's interface I2 extends Base2 { ~~ -!!! Interface 'I2' incorrectly extends interface 'Base2': -!!! Types of property 'a' are incompatible: -!!! Type '(x: number) => string' is not assignable to type '(x: number) => number': -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: number) => string' is not assignable to type '(x: number) => number'. +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: (x: number) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt index 81cd8b924f0..7e9d75b1b41 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt @@ -1,3 +1,19 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(51,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. + Types of property 'a2' are incompatible. + Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'. + Types of parameters 'x' and 'x' are incompatible. + Type 'T' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(60,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'. + Types of property 'a8' are incompatible. + Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts (2 errors) ==== // checking subtype relations for function types as it relates to contextual signature instantiation // error cases @@ -51,11 +67,11 @@ interface I2 extends A { ~~ -!!! Interface 'I2' incorrectly extends interface 'A': -!!! Types of property 'a2' are incompatible: -!!! Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a2' are incompatible. +!!! error TS2430: Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. a2: (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic } @@ -66,15 +82,15 @@ interface I4 extends A { ~~ -!!! Interface 'I4' incorrectly extends interface 'A': -!!! Types of property 'a8' are incompatible: -!!! Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! Types of parameters 'arg2' and 'arg2' are incompatible: -!!! Type '{ foo: number; }' is not assignable to type 'Base': -!!! Types of property 'foo' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a8' are incompatible. +!!! error TS2430: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt index 7cd13f2fafb..35718ca9612 100644 --- a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt +++ b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt @@ -1,15 +1,33 @@ +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(3,14): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(4,22): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(5,22): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(15,9): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(23,6): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(24,20): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(34,6): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(35,9): error TS1015: Parameter cannot have question mark and initializer. +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(46,9): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(23,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(24,20): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(34,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +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(45,32): error TS2322: Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts (16 errors) ==== // Optional parameters cannot also have initializer expressions, these are all errors function foo(x?: number = 1) { } ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. var f = function foo(x?: number = 1) { } ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. var f2 = (x: number, y? = 1) => { } ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. foo(1); foo(); @@ -21,7 +39,7 @@ class C { foo(x?: number = 1) { } ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. } var c: C; @@ -31,14 +49,14 @@ interface I { (x? = 1); ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. ~~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. foo(x: number, y?: number = 1); ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. ~~~~~~~~~~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. } var i: I; @@ -50,14 +68,14 @@ var a: { (x?: number = 1); ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. ~~~~~~~~~~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. foo(x? = 1); ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. ~~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. } a(); @@ -68,15 +86,15 @@ var b = { foo(x?: number = 1) { }, ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. a: function foo(x: number, y?: number = '') { }, ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. ~~~~~~~~~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. b: (x?: any = '') => { } ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. } b.foo(); diff --git a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt index 349e8513e70..1c558910a8c 100644 --- a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt +++ b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt @@ -1,3 +1,6 @@ +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 (1 errors) ==== interface I1 { (value: T): void; @@ -9,5 +12,5 @@ test("expects boolean instead of string"); // should not error - "test" should not expect a boolean test(true); // should error - string expected ~~~~ -!!! Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'boolean' 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 b0df8303150..5fabfd0b7ad 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I'. + Named properties '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 (2 errors) ==== // Normally it is an error to have multiple overloads which differ only by return type in a single type declaration. // Here the multiple overloads come from multiple bases. @@ -8,13 +13,13 @@ interface A extends I, I { } ~ -!!! Interface 'A' cannot simultaneously extend types 'I' and 'I': -!!! Named properties 'foo' of types 'I' and 'I' are not identical. +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I'. +!!! error TS2320: Named properties 'foo' of types 'I' and 'I' are not identical. var x: A; // BUG 822524 var r = x.foo(1); // no error var r2 = x.foo(''); // error ~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.errors.txt b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.errors.txt index f7d58ea096e..c5a30ad21ad 100644 --- a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.errors.txt +++ b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.errors.txt @@ -1,119 +1,161 @@ +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(3,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(3,24): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(4,22): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(4,32): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(5,20): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(5,30): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(6,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(7,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(9,15): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(9,34): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(10,23): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(10,42): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(11,20): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(11,39): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(12,11): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(12,30): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(13,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(13,28): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(16,9): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(16,19): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(17,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(17,28): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(18,13): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(18,26): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(22,6): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(22,17): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(23,6): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(23,25): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(24,9): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(24,20): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(25,9): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(26,19): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(30,9): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(30,19): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(31,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(31,29): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(35,9): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(36,32): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(37,12): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts(37,25): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts (40 errors) ==== // Call signature parameters do not allow accessibility modifiers function foo(public x, private y) { } ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. var f = function foo(public x, private y) { } ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. var f2 = function (public x, private y) { } ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. var f3 = (x, private y) => { } ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. var f4 = (public x: T, y: T) => { } ~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. function foo2(private x: string, public y: number) { } ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. var f5 = function foo(private x: string, public y: number) { } ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. var f6 = function (private x: string, public y: number) { } ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. var f7 = (private x: string, public y: number) => { } ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. var f8 = (private x: T, public y: T) => { } ~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. class C { foo(public x, private y) { } ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. foo2(public x: number, private y: string) { } ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. foo3(public x: T, private y: T) { } ~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } interface I { (private x, public y); ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. (private x: string, public y: number); ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. foo(private x, public y); ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. foo(public x: number, y: string); ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. foo3(x: T, private y: T); ~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } var a: { foo(public x, private y); ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. foo2(private x: number, public y: string); ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. }; var b = { foo(public x, y) { }, ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. a: function foo(x: number, private y: string) { }, ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. b: (public x: T, private y: T) => { } ~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. ~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesWithDuplicateParameters.errors.txt b/tests/baselines/reference/callSignaturesWithDuplicateParameters.errors.txt index facb92dd461..034aa4039cf 100644 --- a/tests/baselines/reference/callSignaturesWithDuplicateParameters.errors.txt +++ b/tests/baselines/reference/callSignaturesWithDuplicateParameters.errors.txt @@ -1,83 +1,173 @@ -==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts (22 errors) ==== +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(3,14): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(3,17): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(4,22): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(4,25): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(5,20): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(5,23): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(6,11): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(6,14): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(7,14): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(7,20): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(9,15): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(9,26): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(10,23): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(10,34): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(11,20): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(11,31): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(12,11): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(12,22): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(16,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(16,12): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(17,10): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(17,21): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(18,13): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(18,19): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(22,6): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(22,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(23,6): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(23,17): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(24,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(24,12): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(25,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(25,20): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(26,13): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(26,19): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(30,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(30,12): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(31,10): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(31,21): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(35,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(35,12): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(36,21): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(36,32): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(37,12): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(37,18): error TS2300: Duplicate identifier 'x'. + + +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts (44 errors) ==== // Duplicate parameter names are always an error function foo(x, x) { } - ~ -!!! Duplicate identifier 'x'. - var f = function foo(x, x) { } - ~ -!!! Duplicate identifier 'x'. - var f2 = function (x, x) { } - ~ -!!! Duplicate identifier 'x'. - var f3 = (x, x) => { } ~ -!!! Duplicate identifier 'x'. - var f4 = (x: T, x: T) => { } +!!! error TS2300: Duplicate identifier 'x'. + ~ +!!! error TS2300: Duplicate identifier 'x'. + var f = function foo(x, x) { } + ~ +!!! error TS2300: Duplicate identifier 'x'. + ~ +!!! error TS2300: Duplicate identifier 'x'. + var f2 = function (x, x) { } ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. + ~ +!!! error TS2300: Duplicate identifier 'x'. + var f3 = (x, x) => { } + ~ +!!! error TS2300: Duplicate identifier 'x'. + ~ +!!! error TS2300: Duplicate identifier 'x'. + var f4 = (x: T, x: T) => { } + ~ +!!! error TS2300: Duplicate identifier 'x'. + ~ +!!! error TS2300: Duplicate identifier 'x'. function foo2(x: string, x: number) { } + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. var f5 = function foo(x: string, x: number) { } + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. var f6 = function (x: string, x: number) { } + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. var f7 = (x: string, x: number) => { } + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. var f8 = (x: T, y: T) => { } class C { foo(x, x) { } + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. foo2(x: number, x: string) { } + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. foo3(x: T, x: T) { } + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } interface I { (x, x); + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. (x: string, x: number); + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. foo(x, x); + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. foo(x: number, x: string); + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. foo3(x: T, x: T); + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } var a: { foo(x, x); + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. foo2(x: number, x: string); + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. }; var b = { foo(x, x) { }, + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. a: function foo(x: number, x: string) { }, + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. b: (x: T, x: T) => { } + ~ +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers.errors.txt b/tests/baselines/reference/callSignaturesWithParameterInitializers.errors.txt index 033fa6d51c0..ffff3886375 100644 --- a/tests/baselines/reference/callSignaturesWithParameterInitializers.errors.txt +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers.ts(24,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers.ts(25,20): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers.ts(36,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers.ts(37,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + + ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers.ts (4 errors) ==== // Optional parameters allow initializers only in implementation signatures @@ -24,10 +30,10 @@ interface I { (x = 1); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. foo(x: number, y = 1); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. } var i: I; @@ -40,10 +46,10 @@ var a: { (x = 1); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. foo(x = 1); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. } a(); diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt b/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt index ad4a81aa7f1..1801bd42e4d 100644 --- a/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt @@ -1,10 +1,17 @@ -==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts (4 errors) ==== +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,15): error TS1005: '{' expected. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(4,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(11,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(21,5): error TS2300: Duplicate identifier 'foo'. + + +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts (5 errors) ==== // Optional parameters allow initializers only in implementation signatures // All the below declarations are errors function foo(x = 2); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. function foo(x = 1) { } foo(1); @@ -13,7 +20,7 @@ class C { foo(x = 2); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. foo(x = 1) { } } @@ -22,12 +29,14 @@ c.foo(1); var b = { - foo(x = 1), + foo(x = 1), // error ~ -!!! '{' expected. - foo(x = 1) { }, +!!! error TS1005: '{' expected. ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. + foo(x = 1) { }, // error + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. } b.foo(); diff --git a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt index 027efabf4a4..a3776946292 100644 --- a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt +++ b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(3,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts (2 errors) ==== function f() { } f(); ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. f(); f(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/callbackArgsDifferByOptionality.errors.txt b/tests/baselines/reference/callbackArgsDifferByOptionality.errors.txt index aaa831dc2ac..2df02c30185 100644 --- a/tests/baselines/reference/callbackArgsDifferByOptionality.errors.txt +++ b/tests/baselines/reference/callbackArgsDifferByOptionality.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/callbackArgsDifferByOptionality.ts(1,23): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/callbackArgsDifferByOptionality.ts(4,5): error TS2304: Cannot find name 'cb'. + + ==== tests/cases/compiler/callbackArgsDifferByOptionality.ts (2 errors) ==== function x3(callback: (x?: 'hi') => number); ~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function x3(callback: (x: string) => number); function x3(callback: (x: any) => number) { cb(); ~~ -!!! Cannot find name 'cb'. +!!! error TS2304: Cannot find name 'cb'. } \ No newline at end of file diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt index 504e08eadf0..f0397f5ee60 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,9): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,15): error TS2339: Property 'ClassA' does not exist on type 'typeof M'. + + ==== tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts (2 errors) ==== module M { class ClassA {} } var t = new M.ClassA[]; - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ -!!! Property 'ClassA' does not exist on type 'typeof M'. \ No newline at end of file +!!! error TS2339: Property 'ClassA' does not exist on type 'typeof M'. \ No newline at end of file diff --git a/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt b/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt index 015bd2d43c3..7be5a1f086c 100644 --- a/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt +++ b/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/cannotInvokeNewOnIndexExpression.ts(1,23): error TS2304: Cannot find name 'any'. + + ==== tests/cases/compiler/cannotInvokeNewOnIndexExpression.ts (1 errors) ==== var test: any[] = new any[1]; ~~~ -!!! Cannot find name 'any'. \ No newline at end of file +!!! error TS2304: Cannot find name 'any'. \ No newline at end of file diff --git a/tests/baselines/reference/castExpressionParentheses.js b/tests/baselines/reference/castExpressionParentheses.js index 2f62d6e9447..2b518226c60 100644 --- a/tests/baselines/reference/castExpressionParentheses.js +++ b/tests/baselines/reference/castExpressionParentheses.js @@ -43,7 +43,7 @@ new (A()); // parentheses should be omitted // literals { a: 0 }; -[1, 3, ]; +[1, 3,]; "string"; 23.0; /regexp/g; diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt new file mode 100644 index 00000000000..f4efed6f1d1 --- /dev/null +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -0,0 +1,71 @@ +tests/cases/conformance/types/tuple/castingTuple.ts(13,23): error TS2352: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other. + Property '2' is missing in type '[number, string]'. +tests/cases/conformance/types/tuple/castingTuple.ts(16,21): error TS2352: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other. + Property '2' is missing in type '[C, D]'. +tests/cases/conformance/types/tuple/castingTuple.ts(24,10): error TS2352: Neither type '[number, string]' nor type '[number, number]' is assignable to the other. + Types of property '1' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/tuple/castingTuple.ts(25,10): error TS2352: Neither type '[C, D]' nor type '[A, I]' is assignable to the other. + Types of property '0' are incompatible. + Type 'C' is not assignable to type 'A'. +tests/cases/conformance/types/tuple/castingTuple.ts(26,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. +tests/cases/conformance/types/tuple/castingTuple.ts(26,14): error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => number'. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot find name 't4'. + + +==== tests/cases/conformance/types/tuple/castingTuple.ts (7 errors) ==== + interface I { } + class A { a = 10; } + class C implements I { c }; + class D implements I { d }; + class E extends A { e }; + class F extends A { f }; + enum E1 { one } + enum E2 { one } + + // no error + var numStrTuple: [number, string] = [5, "foo"]; + var emptyObjTuple = <[{}, {}]>numStrTuple; + var numStrBoolTuple = <[number, string, boolean]>numStrTuple; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other. +!!! error TS2352: Property '2' is missing in type '[number, string]'. + var classCDTuple: [C, D] = [new C(), new D()]; + var interfaceIITuple = <[I, I]>classCDTuple; + var classCDATuple = <[C, D, A]>classCDTuple; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other. +!!! error TS2352: Property '2' is missing in type '[C, D]'. + var eleFromCDA1 = classCDATuple[2]; // A + var eleFromCDA2 = classCDATuple[5]; // {} + var t10: [E1, E2] = [E1.one, E2.one]; + var t11 = <[number, number]>t10; + var array1 = <{}[]>emptyObjTuple; + + // error + var t3 = <[number, number]>numStrTuple; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Neither type '[number, string]' nor type '[number, number]' is assignable to the other. +!!! error TS2352: Types of property '1' are incompatible. +!!! error TS2352: Type 'string' is not assignable to type 'number'. + var t9 = <[A, I]>classCDTuple; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Neither type '[C, D]' nor type '[A, I]' is assignable to the other. +!!! error TS2352: Types of property '0' are incompatible. +!!! error TS2352: Type 'C' is not assignable to type 'A'. + var array1 = numStrTuple; + ~~~~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other. +!!! error TS2352: Types of property 'pop' are incompatible. +!!! error TS2352: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2352: Type 'string | number' is not assignable to type 'number'. +!!! error TS2352: Type 'string' is not assignable to type 'number'. + t4[2] = 10; + ~~ +!!! error TS2304: Cannot find name 't4'. \ No newline at end of file diff --git a/tests/baselines/reference/castingTuple.js b/tests/baselines/reference/castingTuple.js new file mode 100644 index 00000000000..0671062bb4e --- /dev/null +++ b/tests/baselines/reference/castingTuple.js @@ -0,0 +1,95 @@ +//// [castingTuple.ts] +interface I { } +class A { a = 10; } +class C implements I { c }; +class D implements I { d }; +class E extends A { e }; +class F extends A { f }; +enum E1 { one } +enum E2 { one } + +// no error +var numStrTuple: [number, string] = [5, "foo"]; +var emptyObjTuple = <[{}, {}]>numStrTuple; +var numStrBoolTuple = <[number, string, boolean]>numStrTuple; +var classCDTuple: [C, D] = [new C(), new D()]; +var interfaceIITuple = <[I, I]>classCDTuple; +var classCDATuple = <[C, D, A]>classCDTuple; +var eleFromCDA1 = classCDATuple[2]; // A +var eleFromCDA2 = classCDATuple[5]; // {} +var t10: [E1, E2] = [E1.one, E2.one]; +var t11 = <[number, number]>t10; +var array1 = <{}[]>emptyObjTuple; + +// error +var t3 = <[number, number]>numStrTuple; +var t9 = <[A, I]>classCDTuple; +var array1 = numStrTuple; +t4[2] = 10; + +//// [castingTuple.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + this.a = 10; + } + return A; +})(); +var C = (function () { + function C() { + } + return C; +})(); +; +var D = (function () { + function D() { + } + return D; +})(); +; +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + return E; +})(A); +; +var F = (function (_super) { + __extends(F, _super); + function F() { + _super.apply(this, arguments); + } + return F; +})(A); +; +var E1; +(function (E1) { + E1[E1["one"] = 0] = "one"; +})(E1 || (E1 = {})); +var E2; +(function (E2) { + E2[E2["one"] = 0] = "one"; +})(E2 || (E2 = {})); +// no error +var numStrTuple = [5, "foo"]; +var emptyObjTuple = numStrTuple; +var numStrBoolTuple = numStrTuple; +var classCDTuple = [new C(), new D()]; +var interfaceIITuple = classCDTuple; +var classCDATuple = classCDTuple; +var eleFromCDA1 = classCDATuple[2]; // A +var eleFromCDA2 = classCDATuple[5]; // {} +var t10 = [0 /* one */, 0 /* one */]; +var t11 = t10; +var array1 = emptyObjTuple; +// error +var t3 = numStrTuple; +var t9 = classCDTuple; +var array1 = numStrTuple; +t4[2] = 10; diff --git a/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt b/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt index 3052a7fb28a..d3eea6619b6 100644 --- a/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt +++ b/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/catchClauseWithTypeAnnotation.ts(2,11): error TS1013: Catch clause parameter cannot have a type annotation. + + ==== tests/cases/compiler/catchClauseWithTypeAnnotation.ts (1 errors) ==== try { } catch (e: any) { ~ -!!! Catch clause parameter cannot have a type annotation. +!!! error TS1013: Catch clause parameter cannot have a type annotation. } \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment1.errors.txt b/tests/baselines/reference/chainedAssignment1.errors.txt index 9bab75fe15c..3fa654c62cc 100644 --- a/tests/baselines/reference/chainedAssignment1.errors.txt +++ b/tests/baselines/reference/chainedAssignment1.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/chainedAssignment1.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X'. + Property 'a' is missing in type 'Z'. +tests/cases/compiler/chainedAssignment1.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y'. + Property 'a' is missing in type 'Z'. +tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2322: Type 'Z' is not assignable to type 'Y'. + + ==== tests/cases/compiler/chainedAssignment1.ts (3 errors) ==== class X { constructor(public z) { } @@ -21,11 +28,11 @@ var c3 = new Z(); c1 = c2 = c3; // a bug made this not report the same error as below ~~ -!!! Type 'Z' is not assignable to type 'X': -!!! Property 'a' is missing in type 'Z'. +!!! error TS2322: Type 'Z' is not assignable to type 'X'. +!!! error TS2322: Property 'a' is missing in type 'Z'. ~~ -!!! Type 'Z' is not assignable to type 'Y': -!!! Property 'a' is missing in type 'Z'. +!!! error TS2322: Type 'Z' is not assignable to type 'Y'. +!!! error TS2322: Property 'a' is missing in type 'Z'. c2 = c3; // Error TS111: Cannot convert Z to Y ~~ -!!! Type 'Z' is not assignable to type 'Y'. \ No newline at end of file +!!! error TS2322: Type 'Z' is not assignable to type 'Y'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment3.errors.txt b/tests/baselines/reference/chainedAssignment3.errors.txt index 61d34172032..8a64a35cbc0 100644 --- a/tests/baselines/reference/chainedAssignment3.errors.txt +++ b/tests/baselines/reference/chainedAssignment3.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/chainedAssignment3.ts(18,1): error TS2322: Type 'A' is not assignable to type 'B'. + Property 'value' is missing in type 'A'. +tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2322: Type 'A' is not assignable to type 'B'. + + ==== tests/cases/compiler/chainedAssignment3.ts (2 errors) ==== class A { id: number; @@ -18,11 +23,11 @@ // error cases b = a = new A(); ~ -!!! Type 'A' is not assignable to type 'B': -!!! Property 'value' is missing in type 'A'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'value' is missing in type 'A'. a = b = new A(); ~ -!!! Type 'A' is not assignable to type 'B'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignmentChecking.errors.txt b/tests/baselines/reference/chainedAssignmentChecking.errors.txt index f5580d38c03..ac3bade0aae 100644 --- a/tests/baselines/reference/chainedAssignmentChecking.errors.txt +++ b/tests/baselines/reference/chainedAssignmentChecking.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/chainedAssignmentChecking.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X'. + Property 'a' is missing in type 'Z'. +tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y'. + Property 'a' is missing in type 'Z'. + + ==== tests/cases/compiler/chainedAssignmentChecking.ts (2 errors) ==== class X { constructor(public z) { } @@ -21,9 +27,9 @@ c1 = c2 = c3; // Should be error ~~ -!!! Type 'Z' is not assignable to type 'X': -!!! Property 'a' is missing in type 'Z'. +!!! error TS2322: Type 'Z' is not assignable to type 'X'. +!!! error TS2322: Property 'a' is missing in type 'Z'. ~~ -!!! Type 'Z' is not assignable to type 'Y': -!!! Property 'a' is missing in type 'Z'. +!!! error TS2322: Type 'Z' is not assignable to type 'Y'. +!!! error TS2322: Property 'a' is missing in type 'Z'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt index 0448b6d44a0..be465275de5 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts(19,59): error TS2345: Argument of type '(c: C) => B' is not assignable to parameter of type '(x: C) => C'. + + ==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts (1 errors) ==== class Chain { constructor(public value: T) { } @@ -19,4 +22,4 @@ // Ok to go down the chain, but error to try to climb back up (new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); ~~~~~~~~~~ -!!! Argument of type '(c: C) => B' is not assignable to parameter of type '(x: C) => C'. \ No newline at end of file +!!! error TS2345: Argument of type '(c: C) => B' is not assignable to parameter of type '(x: C) => C'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt index 3cb1395700d..e307cc9be89 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(7,43): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => 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'. +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 (5 errors) ==== class Chain { constructor(public value: T) { } @@ -7,12 +14,12 @@ // Ok to go down the chain, but error to climb up the chain (new Chain(t)).then(tt => s).then(ss => t); ~~~~~~~ -!!! Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. +!!! error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. // But error to try to climb up the chain (new Chain(s)).then(ss => t); ~~~~~~~ -!!! Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. +!!! error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. // Staying at T or S should be fine (new Chain(t)).then(tt => t).then(tt => t).then(tt => t); @@ -36,16 +43,16 @@ // Should get an error that we are assigning a string to a number (new Chain2(i)).then(ii => t).then(tt => s).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' 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 = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (new Chain2(i)).then(ii => s).then(ss => s).then(ss => s).then(ss => s).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. return null; } diff --git a/tests/baselines/reference/checkForObjectTooStrict.errors.txt b/tests/baselines/reference/checkForObjectTooStrict.errors.txt index cc2cfc4cf7d..7af7481f6ae 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.errors.txt +++ b/tests/baselines/reference/checkForObjectTooStrict.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/checkForObjectTooStrict.ts(22,19): error TS2311: A class may only extend another class. +tests/cases/compiler/checkForObjectTooStrict.ts(26,9): error TS2335: 'super' can only be referenced in a derived class. + + ==== tests/cases/compiler/checkForObjectTooStrict.ts (2 errors) ==== module Foo { @@ -22,13 +26,13 @@ class Baz extends Object { ~~~~~~ -!!! A class may only extend another class. +!!! error TS2311: A class may only extend another class. constructor () { // ERROR, as expected super(); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination.js b/tests/baselines/reference/checkInfiniteExpansionTermination.js new file mode 100644 index 00000000000..ed52ea6b419 --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination.js @@ -0,0 +1,25 @@ +//// [checkInfiniteExpansionTermination.ts] +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { + n: IObservable; // Needed, must be T[] +} + +// Needed +interface ISubject extends IObservable { } + +interface Foo { x } +interface Bar { y } + +var values: IObservable; +var values2: ISubject; +values = values2; + + +//// [checkInfiniteExpansionTermination.js] +// Regression test for #1002 +// Before fix this code would cause infinite loop +var values; +var values2; +values = values2; diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination.types b/tests/baselines/reference/checkInfiniteExpansionTermination.types new file mode 100644 index 00000000000..bd4858126dd --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination.types @@ -0,0 +1,44 @@ +=== tests/cases/compiler/checkInfiniteExpansionTermination.ts === +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { +>IObservable : IObservable +>T : T + + n: IObservable; // Needed, must be T[] +>n : IObservable +>IObservable : IObservable +>T : T +} + +// Needed +interface ISubject extends IObservable { } +>ISubject : ISubject +>T : T +>IObservable : IObservable +>T : T + +interface Foo { x } +>Foo : Foo +>x : any + +interface Bar { y } +>Bar : Bar +>y : any + +var values: IObservable; +>values : IObservable +>IObservable : IObservable +>Foo : Foo + +var values2: ISubject; +>values2 : ISubject +>ISubject : ISubject +>Bar : Bar + +values = values2; +>values = values2 : ISubject +>values : IObservable +>values2 : ISubject + diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination2.js b/tests/baselines/reference/checkInfiniteExpansionTermination2.js new file mode 100644 index 00000000000..6175b34e522 --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination2.js @@ -0,0 +1,27 @@ +//// [checkInfiniteExpansionTermination2.ts] +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { + n: IObservable; +} +interface ISubject extends IObservable { } + +declare function combineLatest(x: IObservable[]): void; +declare function combineLatest(): void; + +function fn() { + var values: ISubject[] = []; + // Hang when using , but not + combineLatest(values); +} + + +//// [checkInfiniteExpansionTermination2.js] +// Regression test for #1002 +// Before fix this code would cause infinite loop +function fn() { + var values = []; + // Hang when using , but not + combineLatest(values); +} diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination2.types b/tests/baselines/reference/checkInfiniteExpansionTermination2.types new file mode 100644 index 00000000000..fc81e1c9304 --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination2.types @@ -0,0 +1,46 @@ +=== tests/cases/compiler/checkInfiniteExpansionTermination2.ts === +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { +>IObservable : IObservable +>T : T + + n: IObservable; +>n : IObservable +>IObservable : IObservable +>T : T +} +interface ISubject extends IObservable { } +>ISubject : ISubject +>T : T +>IObservable : IObservable +>T : T + +declare function combineLatest(x: IObservable[]): void; +>combineLatest : { (x: IObservable[]): void; (): void; } +>TOther : TOther +>x : IObservable[] +>IObservable : IObservable +>TOther : TOther + +declare function combineLatest(): void; +>combineLatest : { (x: IObservable[]): void; (): void; } + +function fn() { +>fn : () => void +>T : T + + var values: ISubject[] = []; +>values : ISubject[] +>ISubject : ISubject +>[] : undefined[] + + // Hang when using , but not + combineLatest(values); +>combineLatest(values) : void +>combineLatest : { (x: IObservable[]): void; (): void; } +>T : T +>values : ISubject[] +} + diff --git a/tests/baselines/reference/circularModuleImports.errors.txt b/tests/baselines/reference/circularModuleImports.errors.txt index 8ce4566a683..9423ddd05ff 100644 --- a/tests/baselines/reference/circularModuleImports.errors.txt +++ b/tests/baselines/reference/circularModuleImports.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/circularModuleImports.ts(5,5): error TS2303: Circular definition of import alias 'A'. + + ==== tests/cases/compiler/circularModuleImports.ts (1 errors) ==== module M @@ -5,7 +8,7 @@ import A = B; ~~~~~~~~~~~~~ -!!! Circular definition of import alias 'A'. +!!! error TS2303: Circular definition of import alias 'A'. import B = A; diff --git a/tests/baselines/reference/circularReference.errors.txt b/tests/baselines/reference/circularReference.errors.txt index 2a825b9fc87..667d1ca895d 100644 --- a/tests/baselines/reference/circularReference.errors.txt +++ b/tests/baselines/reference/circularReference.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/externalModules/foo1.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo1.ts(9,12): error TS2339: Property 'x' does not exist on type 'C1'. +tests/cases/conformance/externalModules/foo2.ts(8,12): error TS2339: Property 'y' does not exist on type 'C1'. +tests/cases/conformance/externalModules/foo2.ts(13,8): error TS2339: Property 'x' does not exist on type 'C1'. + + ==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ==== import foo1 = require('./foo1'); export module M1 { @@ -8,14 +14,14 @@ this.m1 = new foo1.M1.C1(); this.m1.y = 10; // Error ~ -!!! Property 'y' does not exist on type 'C1'. +!!! error TS2339: Property 'y' does not exist on type 'C1'. this.m1.x = 20; // OK var tmp = new M1.C1(); tmp.y = 10; // OK tmp.x = 20; // Error ~ -!!! Property 'x' does not exist on type 'C1'. +!!! error TS2339: Property 'x' does not exist on type 'C1'. } } } @@ -23,7 +29,7 @@ ==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ==== import foo2 = require('./foo2'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. export module M1 { export class C1 { m1: foo2.M1.C1; @@ -33,7 +39,7 @@ this.m1.y = 10; // OK this.m1.x = 20; // Error ~ -!!! Property 'x' does not exist on type 'C1'. +!!! error TS2339: Property 'x' does not exist on type 'C1'. } } } diff --git a/tests/baselines/reference/class1.errors.txt b/tests/baselines/reference/class1.errors.txt index 9acb45f4c2a..b90fae9cb40 100644 --- a/tests/baselines/reference/class1.errors.txt +++ b/tests/baselines/reference/class1.errors.txt @@ -1,5 +1,11 @@ -==== tests/cases/compiler/class1.ts (1 errors) ==== - interface foo{ } - class foo{ } +tests/cases/compiler/class1.ts(1,11): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/class1.ts(2,7): error TS2300: Duplicate identifier 'foo'. + + +==== tests/cases/compiler/class1.ts (2 errors) ==== + interface foo{ } // error + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. + class foo{ } // error ~~~ -!!! Duplicate identifier 'foo'. \ No newline at end of file +!!! error TS2300: Duplicate identifier 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/class1.js b/tests/baselines/reference/class1.js index 96b279e58c6..7a104e237b6 100644 --- a/tests/baselines/reference/class1.js +++ b/tests/baselines/reference/class1.js @@ -1,10 +1,10 @@ //// [class1.ts] -interface foo{ } -class foo{ } +interface foo{ } // error +class foo{ } // error //// [class1.js] var foo = (function () { function foo() { } return foo; -})(); +})(); // error diff --git a/tests/baselines/reference/class2.errors.txt b/tests/baselines/reference/class2.errors.txt index 5e362d9941a..dde3612b68f 100644 --- a/tests/baselines/reference/class2.errors.txt +++ b/tests/baselines/reference/class2.errors.txt @@ -1,6 +1,10 @@ +tests/cases/compiler/class2.ts(1,29): error TS1129: Statement expected. +tests/cases/compiler/class2.ts(1,45): error TS1128: Declaration or statement expected. + + ==== tests/cases/compiler/class2.ts (2 errors) ==== class foo { constructor() { static f = 3; } } ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. ~ -!!! Declaration or statement expected. \ No newline at end of file +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/classAndInterface1.errors.txt b/tests/baselines/reference/classAndInterface1.errors.txt index 6d6bb495c3d..8d31e847d71 100644 --- a/tests/baselines/reference/classAndInterface1.errors.txt +++ b/tests/baselines/reference/classAndInterface1.errors.txt @@ -1,5 +1,11 @@ -==== tests/cases/compiler/classAndInterface1.ts (1 errors) ==== - class cli { } +tests/cases/compiler/classAndInterface1.ts(1,8): error TS2300: Duplicate identifier 'cli'. +tests/cases/compiler/classAndInterface1.ts(2,11): error TS2300: Duplicate identifier 'cli'. + + +==== tests/cases/compiler/classAndInterface1.ts (2 errors) ==== + class cli { } // error + ~~~ +!!! error TS2300: Duplicate identifier 'cli'. interface cli { } // error ~~~ -!!! Duplicate identifier 'cli'. \ No newline at end of file +!!! error TS2300: Duplicate identifier 'cli'. \ No newline at end of file diff --git a/tests/baselines/reference/classAndInterface1.js b/tests/baselines/reference/classAndInterface1.js index 74eec3e942e..5efabded838 100644 --- a/tests/baselines/reference/classAndInterface1.js +++ b/tests/baselines/reference/classAndInterface1.js @@ -1,5 +1,5 @@ //// [classAndInterface1.ts] -class cli { } + class cli { } // error interface cli { } // error //// [classAndInterface1.js] @@ -7,4 +7,4 @@ var cli = (function () { function cli() { } return cli; -})(); +})(); // error diff --git a/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt b/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt index 95c1893ff1d..aa3e687cf4d 100644 --- a/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt +++ b/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt @@ -1,17 +1,27 @@ -==== tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts (2 errors) ==== +tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(1,7): error TS2300: Duplicate identifier 'C'. +tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(2,11): error TS2300: Duplicate identifier 'C'. +tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(5,11): error TS2300: Duplicate identifier 'D'. +tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(9,15): error TS2300: Duplicate identifier 'D'. + + +==== tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts (4 errors) ==== class C { foo: string; } + ~ +!!! error TS2300: Duplicate identifier 'C'. interface C { foo: string; } // error ~ -!!! Duplicate identifier 'C'. +!!! error TS2300: Duplicate identifier 'C'. module M { class D { + ~ +!!! error TS2300: Duplicate identifier 'D'. bar: string; } interface D { // error ~ -!!! Duplicate identifier 'D'. +!!! error TS2300: Duplicate identifier 'D'. bar: string; } } \ No newline at end of file diff --git a/tests/baselines/reference/classAndVariableWithSameName.errors.txt b/tests/baselines/reference/classAndVariableWithSameName.errors.txt index fa9d852a976..2e8c16d4494 100644 --- a/tests/baselines/reference/classAndVariableWithSameName.errors.txt +++ b/tests/baselines/reference/classAndVariableWithSameName.errors.txt @@ -1,15 +1,25 @@ -==== tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts (2 errors) ==== - class C { foo: string; } +tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts(1,7): error TS2300: Duplicate identifier 'C'. +tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts(2,5): error TS2300: Duplicate identifier 'C'. +tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts(5,11): error TS2300: Duplicate identifier 'D'. +tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts(9,9): error TS2300: Duplicate identifier 'D'. + + +==== tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts (4 errors) ==== + class C { foo: string; } // error + ~ +!!! error TS2300: Duplicate identifier 'C'. var C = ''; // error ~ -!!! Duplicate identifier 'C'. +!!! error TS2300: Duplicate identifier 'C'. module M { - class D { + class D { // error + ~ +!!! error TS2300: Duplicate identifier 'D'. bar: string; } var D = 1; // error ~ -!!! Duplicate identifier 'D'. +!!! error TS2300: Duplicate identifier 'D'. } \ No newline at end of file diff --git a/tests/baselines/reference/classAndVariableWithSameName.js b/tests/baselines/reference/classAndVariableWithSameName.js index ab17905d5b2..1d547dc5508 100644 --- a/tests/baselines/reference/classAndVariableWithSameName.js +++ b/tests/baselines/reference/classAndVariableWithSameName.js @@ -1,9 +1,9 @@ //// [classAndVariableWithSameName.ts] -class C { foo: string; } +class C { foo: string; } // error var C = ''; // error module M { - class D { + class D { // error bar: string; } @@ -15,7 +15,7 @@ var C = (function () { function C() { } return C; -})(); +})(); // error var C = ''; // error var M; (function (M) { diff --git a/tests/baselines/reference/classBodyWithStatements.errors.txt b/tests/baselines/reference/classBodyWithStatements.errors.txt index 840402821fa..6da42dbb6bf 100644 --- a/tests/baselines/reference/classBodyWithStatements.errors.txt +++ b/tests/baselines/reference/classBodyWithStatements.errors.txt @@ -1,19 +1,25 @@ +tests/cases/conformance/classes/classDeclarations/classBody/classBodyWithStatements.ts(2,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/classes/classDeclarations/classBody/classBodyWithStatements.ts(3,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/classes/classDeclarations/classBody/classBodyWithStatements.ts(6,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/classes/classDeclarations/classBody/classBodyWithStatements.ts(7,1): error TS1128: Declaration or statement expected. + + ==== tests/cases/conformance/classes/classDeclarations/classBody/classBodyWithStatements.ts (4 errors) ==== class C { var x = 1; ~~~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. class C2 { function foo() {} ~~~~~~~~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. var x = 1; var y = 2; diff --git a/tests/baselines/reference/classCannotExtendVar.errors.txt b/tests/baselines/reference/classCannotExtendVar.errors.txt index 94d116248fa..5af07801bb4 100644 --- a/tests/baselines/reference/classCannotExtendVar.errors.txt +++ b/tests/baselines/reference/classCannotExtendVar.errors.txt @@ -1,9 +1,15 @@ -==== tests/cases/compiler/classCannotExtendVar.ts (1 errors) ==== +tests/cases/compiler/classCannotExtendVar.ts(1,5): error TS2300: Duplicate identifier 'Markup'. +tests/cases/compiler/classCannotExtendVar.ts(3,7): error TS2300: Duplicate identifier 'Markup'. + + +==== tests/cases/compiler/classCannotExtendVar.ts (2 errors) ==== var Markup; + ~~~~~~ +!!! error TS2300: Duplicate identifier 'Markup'. class Markup { ~~~~~~ -!!! Duplicate identifier 'Markup'. +!!! error TS2300: Duplicate identifier 'Markup'. constructor() { } } diff --git a/tests/baselines/reference/classConstructorAccessibility.errors.txt b/tests/baselines/reference/classConstructorAccessibility.errors.txt index fe2f1e22458..c22f3593bc5 100644 --- a/tests/baselines/reference/classConstructorAccessibility.errors.txt +++ b/tests/baselines/reference/classConstructorAccessibility.errors.txt @@ -1,4 +1,10 @@ -==== tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts (2 errors) ==== +tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts(6,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. +tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts(10,5): error TS1089: 'protected' modifier cannot appear on a constructor declaration. +tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts(23,9): error TS1089: 'private' modifier cannot appear on a constructor declaration. +tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts(27,9): error TS1089: 'protected' modifier cannot appear on a constructor declaration. + + +==== tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts (4 errors) ==== class C { public constructor(public x: number) { } } @@ -6,11 +12,18 @@ class D { private constructor(public x: number) { } // error ~~~~~~~ -!!! 'private' modifier cannot appear on a constructor declaration. +!!! error TS1089: 'private' modifier cannot appear on a constructor declaration. + } + + class E { + protected constructor(public x: number) { } // error + ~~~~~~~~~ +!!! error TS1089: 'protected' modifier cannot appear on a constructor declaration. } var c = new C(1); var d = new D(1); + var e = new E(1); module Generic { class C { @@ -20,10 +33,17 @@ class D { private constructor(public x: T) { } // error ~~~~~~~ -!!! 'private' modifier cannot appear on a constructor declaration. +!!! error TS1089: 'private' modifier cannot appear on a constructor declaration. + } + + class E { + protected constructor(public x: T) { } // error + ~~~~~~~~~ +!!! error TS1089: 'protected' modifier cannot appear on a constructor declaration. } var c = new C(1); var d = new D(1); + var e = new E(1); } \ No newline at end of file diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.errors.txt b/tests/baselines/reference/classConstructorParametersAccessibility.errors.txt new file mode 100644 index 00000000000..029c3fae018 --- /dev/null +++ b/tests/baselines/reference/classConstructorParametersAccessibility.errors.txt @@ -0,0 +1,35 @@ +tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility.ts(12,1): error TS2341: Property 'p' is private and only accessible within class 'C2'. +tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility.ts(19,1): error TS2445: Property 'p' is protected and only accessible within class 'C3' and its subclasses. + + +==== tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility.ts (2 errors) ==== + class C1 { + constructor(public x: number) { } + } + var c1: C1; + c1.x // OK + + + class C2 { + constructor(private p: number) { } + } + var c2: C2; + c2.p // private, error + ~~~~ +!!! error TS2341: Property 'p' is private and only accessible within class 'C2'. + + + class C3 { + constructor(protected p: number) { } + } + var c3: C3; + c3.p // protected, error + ~~~~ +!!! error TS2445: Property 'p' is protected and only accessible within class 'C3' and its subclasses. + class Derived extends C3 { + constructor(p: number) { + super(p); + this.p; // OK + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js new file mode 100644 index 00000000000..03d56d94e58 --- /dev/null +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -0,0 +1,67 @@ +//// [classConstructorParametersAccessibility.ts] +class C1 { + constructor(public x: number) { } +} +var c1: C1; +c1.x // OK + + +class C2 { + constructor(private p: number) { } +} +var c2: C2; +c2.p // private, error + + +class C3 { + constructor(protected p: number) { } +} +var c3: C3; +c3.p // protected, error +class Derived extends C3 { + constructor(p: number) { + super(p); + this.p; // OK + } +} + + +//// [classConstructorParametersAccessibility.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C1 = (function () { + function C1(x) { + this.x = x; + } + return C1; +})(); +var c1; +c1.x; // OK +var C2 = (function () { + function C2(p) { + this.p = p; + } + return C2; +})(); +var c2; +c2.p; // private, error +var C3 = (function () { + function C3(p) { + this.p = p; + } + return C3; +})(); +var c3; +c3.p; // protected, error +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived(p) { + _super.call(this, p); + this.p; // OK + } + return Derived; +})(C3); diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.errors.txt b/tests/baselines/reference/classConstructorParametersAccessibility2.errors.txt new file mode 100644 index 00000000000..7c95a35e1da --- /dev/null +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.errors.txt @@ -0,0 +1,35 @@ +tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility2.ts(12,1): error TS2341: Property 'p' is private and only accessible within class 'C2'. +tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility2.ts(19,1): error TS2445: Property 'p' is protected and only accessible within class 'C3' and its subclasses. + + +==== tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility2.ts (2 errors) ==== + class C1 { + constructor(public x?: number) { } + } + var c1: C1; + c1.x // OK + + + class C2 { + constructor(private p?: number) { } + } + var c2: C2; + c2.p // private, error + ~~~~ +!!! error TS2341: Property 'p' is private and only accessible within class 'C2'. + + + class C3 { + constructor(protected p?: number) { } + } + var c3: C3; + c3.p // protected, error + ~~~~ +!!! error TS2445: Property 'p' is protected and only accessible within class 'C3' and its subclasses. + class Derived extends C3 { + constructor(p: number) { + super(p); + this.p; // OK + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.js b/tests/baselines/reference/classConstructorParametersAccessibility2.js new file mode 100644 index 00000000000..1b16d13c82a --- /dev/null +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -0,0 +1,67 @@ +//// [classConstructorParametersAccessibility2.ts] +class C1 { + constructor(public x?: number) { } +} +var c1: C1; +c1.x // OK + + +class C2 { + constructor(private p?: number) { } +} +var c2: C2; +c2.p // private, error + + +class C3 { + constructor(protected p?: number) { } +} +var c3: C3; +c3.p // protected, error +class Derived extends C3 { + constructor(p: number) { + super(p); + this.p; // OK + } +} + + +//// [classConstructorParametersAccessibility2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C1 = (function () { + function C1(x) { + this.x = x; + } + return C1; +})(); +var c1; +c1.x; // OK +var C2 = (function () { + function C2(p) { + this.p = p; + } + return C2; +})(); +var c2; +c2.p; // private, error +var C3 = (function () { + function C3(p) { + this.p = p; + } + return C3; +})(); +var c3; +c3.p; // protected, error +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived(p) { + _super.call(this, p); + this.p; // OK + } + return Derived; +})(C3); diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.js b/tests/baselines/reference/classConstructorParametersAccessibility3.js new file mode 100644 index 00000000000..9bd6c4bf7f5 --- /dev/null +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -0,0 +1,39 @@ +//// [classConstructorParametersAccessibility3.ts] +class Base { + constructor(protected p: number) { } +} + +class Derived extends Base { + constructor(public p: number) { + super(p); + this.p; // OK + } +} + +var d: Derived; +d.p; // public, OK + +//// [classConstructorParametersAccessibility3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base(p) { + this.p = p; + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived(p) { + _super.call(this, p); + this.p = p; + this.p; // OK + } + return Derived; +})(Base); +var d; +d.p; // public, OK diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.types b/tests/baselines/reference/classConstructorParametersAccessibility3.types new file mode 100644 index 00000000000..3372044569c --- /dev/null +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility3.ts === +class Base { +>Base : Base + + constructor(protected p: number) { } +>p : number +} + +class Derived extends Base { +>Derived : Derived +>Base : Base + + constructor(public p: number) { +>p : number + + super(p); +>super(p) : void +>super : typeof Base +>p : number + + this.p; // OK +>this.p : number +>this : Derived +>p : number + } +} + +var d: Derived; +>d : Derived +>Derived : Derived + +d.p; // public, OK +>d.p : number +>d : Derived +>p : number + diff --git a/tests/baselines/reference/classExpression.errors.txt b/tests/baselines/reference/classExpression.errors.txt index 220bd9581e8..5a2bc4fd179 100644 --- a/tests/baselines/reference/classExpression.errors.txt +++ b/tests/baselines/reference/classExpression.errors.txt @@ -1,27 +1,36 @@ +tests/cases/conformance/classes/classExpression.ts(1,9): error TS1109: Expression expected. +tests/cases/conformance/classes/classExpression.ts(5,10): error TS1109: Expression expected. +tests/cases/conformance/classes/classExpression.ts(5,16): error TS1005: ':' expected. +tests/cases/conformance/classes/classExpression.ts(5,19): error TS1005: ',' expected. +tests/cases/conformance/classes/classExpression.ts(7,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/classes/classExpression.ts(10,13): error TS1109: Expression expected. +tests/cases/conformance/classes/classExpression.ts(5,16): error TS2304: Cannot find name 'C2'. + + ==== tests/cases/conformance/classes/classExpression.ts (7 errors) ==== var x = class C { ~~~~~ -!!! Expression expected. +!!! error TS1109: Expression expected. } var y = { foo: class C2 { ~~~~~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~ -!!! ':' expected. +!!! error TS1005: ':' expected. ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~~ -!!! Cannot find name 'C2'. +!!! error TS2304: Cannot find name 'C2'. } } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. module M { var z = class C4 { ~~~~~ -!!! Expression expected. +!!! error TS1109: Expression expected. } } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingPrimitive.errors.txt b/tests/baselines/reference/classExtendingPrimitive.errors.txt index 5b3ddb4fe7a..cab86e9e38e 100644 --- a/tests/baselines/reference/classExtendingPrimitive.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive.errors.txt @@ -1,37 +1,50 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1003: Identifier expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS1003: Identifier expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,24): error TS1005: ';' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(3,17): error TS2304: Cannot find name 'number'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(4,18): error TS2304: Cannot find name 'string'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(5,18): error TS2304: Cannot find name 'boolean'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(6,18): error TS2304: Cannot find name 'Void'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(8,18): error TS2304: Cannot find name 'Null'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(10,18): error TS2304: Cannot find name 'undefined'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(11,18): error TS2304: Cannot find name 'Undefined'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(14,18): error TS2311: A class may only extend another class. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (11 errors) ==== // classes cannot extend primitives class C extends number { } ~~~~~~ -!!! Cannot find name 'number'. +!!! error TS2304: Cannot find name 'number'. class C2 extends string { } ~~~~~~ -!!! Cannot find name 'string'. +!!! error TS2304: Cannot find name 'string'. class C3 extends boolean { } ~~~~~~~ -!!! Cannot find name 'boolean'. +!!! error TS2304: Cannot find name 'boolean'. class C4 extends Void { } ~~~~ -!!! Cannot find name 'Void'. +!!! error TS2304: Cannot find name 'Void'. class C4a extends void {} ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. class C5 extends Null { } ~~~~ -!!! Cannot find name 'Null'. +!!! error TS2304: Cannot find name 'Null'. class C5a extends null { } ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. class C6 extends undefined { } ~~~~~~~~~ -!!! Cannot find name 'undefined'. +!!! error TS2304: Cannot find name 'undefined'. class C7 extends Undefined { } ~~~~~~~~~ -!!! Cannot find name 'Undefined'. +!!! error TS2304: Cannot find name 'Undefined'. enum E { A } class C8 extends E { } ~ -!!! A class may only extend another class. \ No newline at end of file +!!! error TS2311: A class may only extend another class. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingPrimitive2.errors.txt b/tests/baselines/reference/classExtendingPrimitive2.errors.txt index 9d1f62d5350..9378c7bdc19 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.errors.txt +++ b/tests/baselines/reference/classExtendingPrimitive2.errors.txt @@ -1,11 +1,16 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1003: Identifier expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS1003: Identifier expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,24): error TS1005: ';' expected. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (3 errors) ==== // classes cannot extend primitives class C4a extends void {} ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. class C5a extends null { } ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ~ -!!! ';' expected. \ No newline at end of file +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingQualifiedName.errors.txt b/tests/baselines/reference/classExtendingQualifiedName.errors.txt index 626c9d551c8..42eae691050 100644 --- a/tests/baselines/reference/classExtendingQualifiedName.errors.txt +++ b/tests/baselines/reference/classExtendingQualifiedName.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/classExtendingQualifiedName.ts(5,21): error TS2305: Module 'M' has no exported member 'C'. + + ==== tests/cases/compiler/classExtendingQualifiedName.ts (1 errors) ==== module M { class C { @@ -5,6 +8,6 @@ class D extends M.C { ~~~ -!!! Module 'M' has no exported member 'C'. +!!! error TS2305: Module 'M' has no exported member 'C'. } } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt index 01a09095a99..50c90389520 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(10,21): error TS2419: Type name 'A' in extends clause does not reference constructor function for 'A'. + + ==== tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts (1 errors) ==== class A { a: number; @@ -10,7 +13,7 @@ var A = 1; class B extends A { ~ -!!! Type name 'A' in extends clause does not reference constructor function for 'A'. +!!! error TS2419: Type name 'A' in extends clause does not reference constructor function for 'A'. b: string; } } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt index a3329ee1391..7f8b6fb411b 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts(4,21): error TS2419: Type name 'A' in extends clause does not reference constructor function for 'A'. + + ==== tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts (1 errors) ==== class A { a: number; } module Foo { var A = 1; class B extends A { b: string; } ~ -!!! Type name 'A' in extends clause does not reference constructor function for 'A'. +!!! error TS2419: Type name 'A' in extends clause does not reference constructor function for 'A'. } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt index 1c6dacfd6d7..35fc2d30a35 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt @@ -1,31 +1,40 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS1003: Identifier expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS1003: Identifier expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,20): error TS1005: ';' expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2311: A class may only extend another class. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2304: Cannot find name 'x'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(11,18): error TS2304: Cannot find name 'M'. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2304: Cannot find name 'foo'. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (7 errors) ==== interface I { foo: string; } class C extends I { } // error ~ -!!! A class may only extend another class. +!!! error TS2311: A class may only extend another class. class C2 extends { foo: string; } { } // error ~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. var x: { foo: string; } class C3 extends x { } // error ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. module M { export var x = 1; } class C4 extends M { } // error ~ -!!! Cannot find name 'M'. +!!! error TS2304: Cannot find name 'M'. function foo() { } class C5 extends foo { } // error ~~~ -!!! Cannot find name 'foo'. +!!! error TS2304: Cannot find name 'foo'. class C6 extends []{ } // error ~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ~ -!!! ';' expected. \ No newline at end of file +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt index 7a5573ae000..a60745020e7 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt @@ -1,10 +1,15 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS1003: Identifier expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS1003: Identifier expected. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,20): error TS1005: ';' expected. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (3 errors) ==== class C2 extends { foo: string; } { } // error ~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. class C6 extends []{ } // error ~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ~ -!!! ';' expected. \ No newline at end of file +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsInterface.errors.txt b/tests/baselines/reference/classExtendsInterface.errors.txt index 4274e5e7089..746f3c4bea0 100644 --- a/tests/baselines/reference/classExtendsInterface.errors.txt +++ b/tests/baselines/reference/classExtendsInterface.errors.txt @@ -1,13 +1,17 @@ +tests/cases/compiler/classExtendsInterface.ts(2,17): error TS2311: A class may only extend another class. +tests/cases/compiler/classExtendsInterface.ts(6,21): error TS2311: A class may only extend another class. + + ==== tests/cases/compiler/classExtendsInterface.ts (2 errors) ==== interface Comparable {} class A extends Comparable {} ~~~~~~~~~~ -!!! A class may only extend another class. +!!! error TS2311: A class may only extend another class. class B implements Comparable {} interface Comparable2 {} class A2 extends Comparable2 {} ~~~~~~~~~~~~~~ -!!! A class may only extend another class. +!!! error TS2311: A class may only extend another class. class B2 implements Comparable2 {} \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt index a74abc33755..ea3927b51d1 100644 --- a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt +++ b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7): error TS2420: Class 'D2' incorrectly implements interface 'I'. + Types have separate declarations of a private property 'x'. + + ==== tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts (1 errors) ==== class C { public foo(x: any) { return x; } @@ -10,8 +14,8 @@ class D2 implements I { ~~ -!!! Class 'D2' incorrectly implements interface 'I': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'D2' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. public foo(x: any) { return x } private x = 3; other(x: any) { return x } diff --git a/tests/baselines/reference/classExtendsItself.errors.txt b/tests/baselines/reference/classExtendsItself.errors.txt index 6168ca3802a..bd15ae22c12 100644 --- a/tests/baselines/reference/classExtendsItself.errors.txt +++ b/tests/baselines/reference/classExtendsItself.errors.txt @@ -1,12 +1,17 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts(1,7): error TS2310: Type 'C' recursively references itself as a base type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts(3,7): error TS2310: Type 'D' recursively references itself as a base type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts(5,7): error TS2310: Type 'E' recursively references itself as a base type. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts (3 errors) ==== class C extends C { } // error ~ -!!! Type 'C' recursively references itself as a base type. +!!! error TS2310: Type 'C' recursively references itself as a base type. class D extends D { } // error ~ -!!! Type 'D' recursively references itself as a base type. +!!! error TS2310: Type 'D' recursively references itself as a base type. class E extends E { } // error ~ -!!! Type 'E' recursively references itself as a base type. \ No newline at end of file +!!! error TS2310: Type 'E' recursively references itself as a base type. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt index 16184543cc3..b39ef5b905f 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt +++ b/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt @@ -1,7 +1,11 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts(1,7): error TS2310: Type 'C' recursively references itself as a base type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts(7,7): error TS2310: Type 'C2' recursively references itself as a base type. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts (2 errors) ==== class C extends E { foo: string; } // error ~ -!!! Type 'C' recursively references itself as a base type. +!!! error TS2310: Type 'C' recursively references itself as a base type. class D extends C { bar: string; } @@ -9,7 +13,7 @@ class C2 extends E2 { foo: T; } // error ~~ -!!! Type 'C2' recursively references itself as a base type. +!!! error TS2310: Type 'C2' recursively references itself as a base type. class D2 extends C2 { bar: T; } diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt index 0a5dcdd6316..a61291b5aa9 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt @@ -1,7 +1,11 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts(1,7): error TS2310: Type 'C' recursively references itself as a base type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts(13,11): error TS2310: Type 'C2' recursively references itself as a base type. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts (2 errors) ==== class C extends N.E { foo: string; } // error ~ -!!! Type 'C' recursively references itself as a base type. +!!! error TS2310: Type 'C' recursively references itself as a base type. module M { export class D extends C { bar: string; } @@ -15,7 +19,7 @@ module O { class C2 extends Q.E2 { foo: T; } // error ~~ -!!! Type 'C2' recursively references itself as a base type. +!!! error TS2310: Type 'C2' recursively references itself as a base type. module P { export class D2 extends C2 { bar: T; } diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt index 3eeccb7e618..8430ec887b5 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt @@ -1,7 +1,11 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file1.ts(1,7): error TS2310: Type 'C' recursively references itself as a base type. +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file4.ts(1,7): error TS2310: Type 'C2' recursively references itself as a base type. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file1.ts (1 errors) ==== class C extends E { foo: string; } // error ~ -!!! Type 'C' recursively references itself as a base type. +!!! error TS2310: Type 'C' recursively references itself as a base type. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file2.ts (0 errors) ==== class D extends C { bar: string; } @@ -12,7 +16,7 @@ ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file4.ts (1 errors) ==== class C2 extends E2 { foo: T; } // error ~~ -!!! Type 'C2' recursively references itself as a base type. +!!! error TS2310: Type 'C2' recursively references itself as a base type. ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file5.ts (0 errors) ==== class D2 extends C2 { bar: T; } diff --git a/tests/baselines/reference/classExtendsMultipleBaseClasses.errors.txt b/tests/baselines/reference/classExtendsMultipleBaseClasses.errors.txt index 545c2b21961..86b271c9ae8 100644 --- a/tests/baselines/reference/classExtendsMultipleBaseClasses.errors.txt +++ b/tests/baselines/reference/classExtendsMultipleBaseClasses.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/classExtendsMultipleBaseClasses.ts(3,18): error TS1005: '{' expected. +tests/cases/compiler/classExtendsMultipleBaseClasses.ts(3,21): error TS1005: ';' expected. + + ==== tests/cases/compiler/classExtendsMultipleBaseClasses.ts (2 errors) ==== class A { } class B { } class C extends A,B { } ~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~ -!!! ';' expected. \ No newline at end of file +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt b/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt index 516154005ce..782dd2a2dbc 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsShadowedConstructorFunction.ts(5,21): error TS2419: Type name 'C' in extends clause does not reference constructor function for 'C'. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsShadowedConstructorFunction.ts (1 errors) ==== class C { foo: string; } @@ -5,7 +8,7 @@ var C = 1; class D extends C { // error, C must evaluate to constructor function ~ -!!! Type name 'C' in extends clause does not reference constructor function for 'C'. +!!! error TS2419: Type name 'C' in extends clause does not reference constructor function for 'C'. bar: string; } } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt b/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt index eb7571a2436..ad2262819ed 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsValidConstructorFunction.ts(5,17): error TS2304: Cannot find name 'foo'. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsValidConstructorFunction.ts (1 errors) ==== function foo() { } @@ -5,4 +8,4 @@ class C extends foo { } // error, cannot extend it though ~~~ -!!! Cannot find name 'foo'. \ No newline at end of file +!!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt b/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt index 216f434d161..1a323fd5aa4 100644 --- a/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/classHeritageWithTrailingSeparator.ts(2,18): error TS1005: '{' expected. + + ==== tests/cases/compiler/classHeritageWithTrailingSeparator.ts (1 errors) ==== class C { foo: number } class D extends C, { ~ -!!! '{' expected. +!!! error TS1005: '{' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass2.errors.txt b/tests/baselines/reference/classImplementsClass2.errors.txt index a48b000b895..49eeed75fe0 100644 --- a/tests/baselines/reference/classImplementsClass2.errors.txt +++ b/tests/baselines/reference/classImplementsClass2.errors.txt @@ -1,9 +1,15 @@ +tests/cases/compiler/classImplementsClass2.ts(2,7): error TS2420: Class 'C' incorrectly implements interface 'A'. + Property 'foo' is missing in type 'C'. +tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is not assignable to type 'C2'. + Property 'foo' is missing in type 'C'. + + ==== tests/cases/compiler/classImplementsClass2.ts (2 errors) ==== class A { foo(): number { return 1; } } class C implements A {} // error ~ -!!! Class 'C' incorrectly implements interface 'A': -!!! Property 'foo' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'A'. +!!! error TS2420: Property 'foo' is missing in type 'C'. class C2 extends A { foo() { @@ -16,5 +22,5 @@ c = c2; c2 = c; ~~ -!!! Type 'C' is not assignable to type 'C2': -!!! Property 'foo' is missing in type 'C'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'C2'. +!!! error TS2322: Property 'foo' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass4.errors.txt b/tests/baselines/reference/classImplementsClass4.errors.txt index eb9848c63a9..ecc9d6d8582 100644 --- a/tests/baselines/reference/classImplementsClass4.errors.txt +++ b/tests/baselines/reference/classImplementsClass4.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/classImplementsClass4.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'. + Property 'x' is missing in type 'C'. +tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is not assignable to type 'C2'. + Property 'x' is missing in type 'C'. + + ==== tests/cases/compiler/classImplementsClass4.ts (2 errors) ==== class A { private x = 1; @@ -5,8 +11,8 @@ } class C implements A { ~ -!!! Class 'C' incorrectly implements interface 'A': -!!! Property 'x' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'A'. +!!! error TS2420: Property 'x' is missing in type 'C'. foo() { return 1; } @@ -19,5 +25,5 @@ c = c2; c2 = c; ~~ -!!! Type 'C' is not assignable to type 'C2': -!!! Property 'x' is missing in type 'C'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'C2'. +!!! error TS2322: Property 'x' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass5.errors.txt b/tests/baselines/reference/classImplementsClass5.errors.txt index 97f83fc83f8..076120fdbaf 100644 --- a/tests/baselines/reference/classImplementsClass5.errors.txt +++ b/tests/baselines/reference/classImplementsClass5.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/classImplementsClass5.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'. + Types have separate declarations of a private property 'x'. +tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2322: Type 'C2' is not assignable to type 'C'. + Types have separate declarations of a private property 'x'. +tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is not assignable to type 'C2'. + Types have separate declarations of a private property 'x'. + + ==== tests/cases/compiler/classImplementsClass5.ts (3 errors) ==== class A { private x = 1; @@ -5,8 +13,8 @@ } class C implements A { ~ -!!! Class 'C' incorrectly implements interface 'A': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'C' incorrectly implements interface 'A'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x = 1; foo() { return 1; @@ -19,9 +27,9 @@ var c2: C2; c = c2; ~ -!!! Type 'C2' is not assignable to type 'C': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2322: Type 'C2' is not assignable to type 'C'. +!!! error TS2322: Types have separate declarations of a private property 'x'. c2 = c; ~~ -!!! Type 'C' is not assignable to type 'C2': -!!! Private property 'x' cannot be reimplemented. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'C2'. +!!! error TS2322: Types have separate declarations of a private property 'x'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass6.errors.txt b/tests/baselines/reference/classImplementsClass6.errors.txt index 789c579fe94..706f94c8fbb 100644 --- a/tests/baselines/reference/classImplementsClass6.errors.txt +++ b/tests/baselines/reference/classImplementsClass6.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/classImplementsClass6.ts(20,3): error TS2339: Property 'bar' does not exist on type 'C'. +tests/cases/compiler/classImplementsClass6.ts(21,4): error TS2339: Property 'bar' does not exist on type 'C2'. + + ==== tests/cases/compiler/classImplementsClass6.ts (2 errors) ==== class A { static bar(): string { @@ -20,7 +24,7 @@ c2 = c; c.bar(); // error ~~~ -!!! Property 'bar' does not exist on type 'C'. +!!! error TS2339: Property 'bar' does not exist on type 'C'. c2.bar(); // should error ~~~ -!!! Property 'bar' does not exist on type 'C2'. \ No newline at end of file +!!! error TS2339: Property 'bar' does not exist on type 'C2'. \ No newline at end of file diff --git a/tests/baselines/reference/classIndexer2.errors.txt b/tests/baselines/reference/classIndexer2.errors.txt index 4278564d8ff..82629584ee5 100644 --- a/tests/baselines/reference/classIndexer2.errors.txt +++ b/tests/baselines/reference/classIndexer2.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/classIndexer2.ts(4,5): error TS2411: Property 'y' of type 'string' is not assignable to string index type 'number'. + + ==== tests/cases/compiler/classIndexer2.ts (1 errors) ==== class C123 { [s: string]: number; x: number; y: string; ~~~~~~~~~~ -!!! Property 'y' of type 'string' is not assignable to string index type 'number'. +!!! error TS2411: Property 'y' of type 'string' is not assignable to string index type 'number'. constructor() { } } \ No newline at end of file diff --git a/tests/baselines/reference/classIndexer3.errors.txt b/tests/baselines/reference/classIndexer3.errors.txt index f923a3364a1..eb7a2467fba 100644 --- a/tests/baselines/reference/classIndexer3.errors.txt +++ b/tests/baselines/reference/classIndexer3.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/classIndexer3.ts(9,5): error TS2411: Property 'y' of type 'string' is not assignable to string index type 'number'. + + ==== tests/cases/compiler/classIndexer3.ts (1 errors) ==== class C123 { [s: string]: number; @@ -9,5 +12,5 @@ x: number; y: string; ~~~~~~~~~~ -!!! Property 'y' of type 'string' is not assignable to string index type 'number'. +!!! error TS2411: Property 'y' of type 'string' is not assignable to string index type 'number'. } \ No newline at end of file diff --git a/tests/baselines/reference/classIndexer4.errors.txt b/tests/baselines/reference/classIndexer4.errors.txt index 06559adf909..f5a132b3dc2 100644 --- a/tests/baselines/reference/classIndexer4.errors.txt +++ b/tests/baselines/reference/classIndexer4.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/classIndexer4.ts(9,5): error TS2411: Property 'y' of type 'string' is not assignable to string index type 'number'. + + ==== tests/cases/compiler/classIndexer4.ts (1 errors) ==== class C123 { [s: string]: number; @@ -9,5 +12,5 @@ x: number; y: string; ~~~~~~~~~~ -!!! Property 'y' of type 'string' is not assignable to string index type 'number'. +!!! error TS2411: Property 'y' of type 'string' is not assignable to string index type 'number'. } \ No newline at end of file diff --git a/tests/baselines/reference/classInheritence.errors.txt b/tests/baselines/reference/classInheritence.errors.txt index 0b655daf932..483812c6b5f 100644 --- a/tests/baselines/reference/classInheritence.errors.txt +++ b/tests/baselines/reference/classInheritence.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/classInheritence.ts(2,7): error TS2310: Type 'A' recursively references itself as a base type. + + ==== tests/cases/compiler/classInheritence.ts (1 errors) ==== class B extends A { } class A extends A { } ~ -!!! Type 'A' recursively references itself as a base type. \ No newline at end of file +!!! error TS2310: Type 'A' recursively references itself as a base type. \ No newline at end of file diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt b/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt index fa5dcab0973..88176d95026 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts(11,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>'. + Types of property 'foo' are incompatible. + Type '{ bar?: string; }' is not assignable to type '{ bar: string; }'. + Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'. + + ==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts (1 errors) ==== class Base { foo: T; @@ -11,10 +17,10 @@ class Derived2 extends Base<{ bar: string; }> { ~~~~~~~~ -!!! Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>': -!!! Types of property 'foo' are incompatible: -!!! Type '{ bar?: string; }' is not assignable to type '{ bar: string; }': -!!! Required property 'bar' cannot be reimplemented with optional property in '{ bar?: string; }'. +!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type '{ bar?: string; }' is not assignable to type '{ bar: string; }'. +!!! error TS2415: Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'. foo: { bar?: string; // error } diff --git a/tests/baselines/reference/classMemberInitializerScoping.errors.txt b/tests/baselines/reference/classMemberInitializerScoping.errors.txt index c34cdca7c90..dddc7a82a3f 100644 --- a/tests/baselines/reference/classMemberInitializerScoping.errors.txt +++ b/tests/baselines/reference/classMemberInitializerScoping.errors.txt @@ -1,14 +1,18 @@ +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 (2 errors) ==== var aaa = 1; class CCC { y: number = aaa; ~~~ -!!! Initializer of instance member variable 'y' cannot reference identifier 'aaa' declared in the constructor. +!!! error TS2301: Initializer of instance member variable 'y' cannot reference identifier 'aaa' declared in the constructor. static staticY: number = aaa; // This shouldnt be error constructor(aaa) { this.y = ''; // was: error, cannot assign string to number ~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. } } diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping.errors.txt b/tests/baselines/reference/classMemberInitializerWithLamdaScoping.errors.txt index 6f05862d765..2fac6733cca 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping.errors.txt +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/classMemberInitializerWithLamdaScoping.ts(23,21): error TS2301: Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. + + ==== tests/cases/compiler/classMemberInitializerWithLamdaScoping.ts (1 errors) ==== declare var console: { log(msg?: any): void; @@ -23,7 +26,7 @@ messageHandler = () => { console.log(field1); // But this should be error as the field1 will resolve to var field1 ~~~~~~ -!!! Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. +!!! error TS2301: Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. // but since this code would be generated inside constructor, in generated js // it would resolve to private field1 and thats not what user intended here. }; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.errors.txt b/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.errors.txt index d5864dac852..7a41e8bdeed 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.errors.txt +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/classMemberInitializerWithLamdaScoping2_1.ts(8,21): error TS2301: Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. + + ==== tests/cases/compiler/classMemberInitializerWithLamdaScoping2_0.ts (0 errors) ==== var field1: string; @@ -11,7 +14,7 @@ messageHandler = () => { console.log(field1); // But this should be error as the field1 will resolve to var field1 ~~~~~~ -!!! Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. +!!! error TS2301: Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. // but since this code would be generated inside constructor, in generated js // it would resolve to private field1 and thats not what user intended here. }; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt index e77499fca31..f396b722263 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(4,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error TS2301: Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. + + ==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (0 errors) ==== var field1: string; @@ -7,13 +11,13 @@ }; export class Test1 { ~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. constructor(private field1: string) { } messageHandler = () => { console.log(field1); // But this should be error as the field1 will resolve to var field1 ~~~~~~ -!!! Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. +!!! error TS2301: Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. // but since this code would be generated inside constructor, in generated js // it would resolve to private field1 and thats not what user intended here. }; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt index 4926a2c6410..84e7994fd0c 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt @@ -1,7 +1,11 @@ +tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error TS2304: Cannot find name 'field1'. + + ==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (1 errors) ==== export var field1: string; ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts (1 errors) ==== declare var console: { @@ -13,6 +17,6 @@ messageHandler = () => { console.log(field1); // Should be error that couldnt find symbol field1 ~~~~~~ -!!! Cannot find name 'field1'. +!!! error TS2304: Cannot find name 'field1'. }; } \ No newline at end of file diff --git a/tests/baselines/reference/classOverloadForFunction.errors.txt b/tests/baselines/reference/classOverloadForFunction.errors.txt index eb3fe5bc33b..14bc27fb5ca 100644 --- a/tests/baselines/reference/classOverloadForFunction.errors.txt +++ b/tests/baselines/reference/classOverloadForFunction.errors.txt @@ -1,6 +1,12 @@ -==== tests/cases/compiler/classOverloadForFunction.ts (1 errors) ==== +tests/cases/compiler/classOverloadForFunction.ts(1,7): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/classOverloadForFunction.ts(2,10): error TS2300: Duplicate identifier 'foo'. + + +==== tests/cases/compiler/classOverloadForFunction.ts (2 errors) ==== class foo { }; + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. function foo() {} ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/classOverloadForFunction2.errors.txt b/tests/baselines/reference/classOverloadForFunction2.errors.txt index 3d73a8bb3f3..4dd459c48ec 100644 --- a/tests/baselines/reference/classOverloadForFunction2.errors.txt +++ b/tests/baselines/reference/classOverloadForFunction2.errors.txt @@ -1,7 +1,14 @@ -==== tests/cases/compiler/classOverloadForFunction2.ts (2 errors) ==== +tests/cases/compiler/classOverloadForFunction2.ts(1,10): error TS2300: Duplicate identifier 'bar'. +tests/cases/compiler/classOverloadForFunction2.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/classOverloadForFunction2.ts(2,7): error TS2300: Duplicate identifier 'bar'. + + +==== tests/cases/compiler/classOverloadForFunction2.ts (3 errors) ==== function bar(): string; ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2300: Duplicate identifier 'bar'. + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. class bar {} ~~~ -!!! Duplicate identifier 'bar'. \ No newline at end of file +!!! error TS2300: Duplicate identifier 'bar'. \ No newline at end of file diff --git a/tests/baselines/reference/classPropertyAsPrivate.errors.txt b/tests/baselines/reference/classPropertyAsPrivate.errors.txt index c5d922c0ad5..a5fdffe091a 100644 --- a/tests/baselines/reference/classPropertyAsPrivate.errors.txt +++ b/tests/baselines/reference/classPropertyAsPrivate.errors.txt @@ -1,21 +1,35 @@ +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(3,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(4,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(8,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(9,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(15,1): error TS2341: Property 'x' is private and only accessible within class 'C'. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(16,1): error TS2341: Property 'y' is private and only accessible within class 'C'. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(17,1): error TS2341: Property 'y' is private and only accessible within class 'C'. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(18,1): error TS2341: Property 'foo' is private and only accessible within class 'C'. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(20,1): error TS2341: Property 'a' is private and only accessible within class 'C'. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(21,1): error TS2341: Property 'b' is private and only accessible within class 'C'. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(22,1): error TS2341: Property 'b' is private and only accessible within class 'C'. +tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts(23,1): error TS2341: Property 'foo' is private and only accessible within class 'C'. + + ==== tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts (12 errors) ==== class C { private x: string; private get y() { return null; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. private set y(x) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. private foo() { } private static a: string; private static get b() { return null; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. private static set b(x) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. private static foo() { } } @@ -23,26 +37,26 @@ // all errors c.x; ~~~ -!!! Property 'C.x' is inaccessible. +!!! error TS2341: Property 'x' is private and only accessible within class 'C'. c.y; ~~~ -!!! Property 'C.y' is inaccessible. +!!! error TS2341: Property 'y' is private and only accessible within class 'C'. c.y = 1; ~~~ -!!! Property 'C.y' is inaccessible. +!!! error TS2341: Property 'y' is private and only accessible within class 'C'. c.foo(); ~~~~~ -!!! Property 'C.foo' is inaccessible. +!!! error TS2341: Property 'foo' is private and only accessible within class 'C'. C.a; ~~~ -!!! Property 'C.a' is inaccessible. +!!! error TS2341: Property 'a' is private and only accessible within class 'C'. C.b(); ~~~ -!!! Property 'C.b' is inaccessible. +!!! error TS2341: Property 'b' is private and only accessible within class 'C'. C.b = 1; ~~~ -!!! Property 'C.b' is inaccessible. +!!! error TS2341: Property 'b' is private and only accessible within class 'C'. C.foo(); ~~~~~ -!!! Property 'C.foo' is inaccessible. \ No newline at end of file +!!! error TS2341: Property 'foo' is private and only accessible within class 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classPropertyAsProtected.errors.txt b/tests/baselines/reference/classPropertyAsProtected.errors.txt new file mode 100644 index 00000000000..570ebc718ac --- /dev/null +++ b/tests/baselines/reference/classPropertyAsProtected.errors.txt @@ -0,0 +1,62 @@ +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(3,19): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(4,19): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(8,26): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(9,26): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(15,1): error TS2445: Property 'x' is protected and only accessible within class 'C' and its subclasses. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(16,1): error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(17,1): error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(18,1): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(20,1): error TS2445: Property 'a' is protected and only accessible within class 'C' and its subclasses. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(21,1): error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(22,1): error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses. +tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts(23,1): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. + + +==== tests/cases/conformance/classes/members/accessibility/classPropertyAsProtected.ts (12 errors) ==== + class C { + protected x: string; + protected get y() { return null; } + ~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + protected set y(x) { } + ~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + protected foo() { } + + protected static a: string; + protected static get b() { return null; } + ~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + protected static set b(x) { } + ~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + protected static foo() { } + } + + var c: C; + // all errors + c.x; + ~~~ +!!! error TS2445: Property 'x' is protected and only accessible within class 'C' and its subclasses. + c.y; + ~~~ +!!! error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses. + c.y = 1; + ~~~ +!!! error TS2445: Property 'y' is protected and only accessible within class 'C' and its subclasses. + c.foo(); + ~~~~~ +!!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. + + C.a; + ~~~ +!!! error TS2445: Property 'a' is protected and only accessible within class 'C' and its subclasses. + C.b(); + ~~~ +!!! error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses. + C.b = 1; + ~~~ +!!! error TS2445: Property 'b' is protected and only accessible within class 'C' and its subclasses. + C.foo(); + ~~~~~ +!!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. \ No newline at end of file diff --git a/tests/baselines/reference/classPropertyIsPublicByDefault.errors.txt b/tests/baselines/reference/classPropertyIsPublicByDefault.errors.txt index c8c7f86dde0..1d200f6e2e7 100644 --- a/tests/baselines/reference/classPropertyIsPublicByDefault.errors.txt +++ b/tests/baselines/reference/classPropertyIsPublicByDefault.errors.txt @@ -1,21 +1,27 @@ +tests/cases/conformance/classes/members/accessibility/classPropertyIsPublicByDefault.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyIsPublicByDefault.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyIsPublicByDefault.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/accessibility/classPropertyIsPublicByDefault.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/conformance/classes/members/accessibility/classPropertyIsPublicByDefault.ts (4 errors) ==== class C { x: string; get y() { return null; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. set y(x) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. foo() { } static a: string; static get b() { return null; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static set b(x) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static foo() { } } diff --git a/tests/baselines/reference/classSideInheritance1.errors.txt b/tests/baselines/reference/classSideInheritance1.errors.txt index fa1035551ed..b1f02bac123 100644 --- a/tests/baselines/reference/classSideInheritance1.errors.txt +++ b/tests/baselines/reference/classSideInheritance1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/classSideInheritance1.ts(12,3): error TS2339: Property 'bar' does not exist on type 'A'. +tests/cases/compiler/classSideInheritance1.ts(13,3): error TS2339: Property 'bar' does not exist on type 'C2'. + + ==== tests/cases/compiler/classSideInheritance1.ts (2 errors) ==== class A { static bar(): string { @@ -12,9 +16,9 @@ var c: C2; a.bar(); // static off an instance - should be an error ~~~ -!!! Property 'bar' does not exist on type 'A'. +!!! error TS2339: Property 'bar' does not exist on type 'A'. c.bar(); // static off an instance - should be an error ~~~ -!!! Property 'bar' does not exist on type 'C2'. +!!! error TS2339: Property 'bar' does not exist on type 'C2'. A.bar(); // valid C2.bar(); // valid \ No newline at end of file diff --git a/tests/baselines/reference/classSideInheritance3.errors.txt b/tests/baselines/reference/classSideInheritance3.errors.txt index c7ce9606b02..c845defa5b8 100644 --- a/tests/baselines/reference/classSideInheritance3.errors.txt +++ b/tests/baselines/reference/classSideInheritance3.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. +tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. + + ==== tests/cases/compiler/classSideInheritance3.ts (2 errors) ==== class A { constructor(public x: string) { @@ -16,8 +20,8 @@ var r1: typeof A = B; // error ~~ -!!! Type 'typeof B' is not assignable to type 'typeof A'. +!!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. var r2: new (x: string) => A = B; // error ~~ -!!! Type 'typeof B' is not assignable to type 'new (x: string) => A'. +!!! error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. var r3: typeof A = C; // ok \ No newline at end of file diff --git a/tests/baselines/reference/classTypeParametersInStatics.errors.txt b/tests/baselines/reference/classTypeParametersInStatics.errors.txt index 8fc40c979f7..cc1336a8804 100644 --- a/tests/baselines/reference/classTypeParametersInStatics.errors.txt +++ b/tests/baselines/reference/classTypeParametersInStatics.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/classTypeParametersInStatics.ts(12,40): error TS2302: Static members cannot reference class type parameters. +tests/cases/compiler/classTypeParametersInStatics.ts(13,29): error TS2302: Static members cannot reference class type parameters. +tests/cases/compiler/classTypeParametersInStatics.ts(13,43): error TS2302: Static members cannot reference class type parameters. + + ==== tests/cases/compiler/classTypeParametersInStatics.ts (3 errors) ==== module Editor { @@ -12,12 +17,12 @@ public static MakeHead(): List { // should error ~ -!!! Static members cannot reference class type parameters. +!!! error TS2302: Static members cannot reference class type parameters. var entry: List = new List(true, null); ~ -!!! Static members cannot reference class type parameters. +!!! error TS2302: Static members cannot reference class type parameters. ~ -!!! Static members cannot reference class type parameters. +!!! error TS2302: Static members cannot reference class type parameters. entry.prev = entry; entry.next = entry; return entry; diff --git a/tests/baselines/reference/classUpdateTests.errors.txt b/tests/baselines/reference/classUpdateTests.errors.txt index f7f4036254b..6bfd7518855 100644 --- a/tests/baselines/reference/classUpdateTests.errors.txt +++ b/tests/baselines/reference/classUpdateTests.errors.txt @@ -1,3 +1,23 @@ +tests/cases/compiler/classUpdateTests.ts(93,3): error TS1129: Statement expected. +tests/cases/compiler/classUpdateTests.ts(95,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/classUpdateTests.ts(99,3): error TS1129: Statement expected. +tests/cases/compiler/classUpdateTests.ts(101,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/classUpdateTests.ts(105,3): error TS1129: Statement expected. +tests/cases/compiler/classUpdateTests.ts(111,3): error TS1129: Statement expected. +tests/cases/compiler/classUpdateTests.ts(34,2): error TS2377: Constructors for derived classes must contain a 'super' call. +tests/cases/compiler/classUpdateTests.ts(43,18): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/compiler/classUpdateTests.ts(46,17): error TS2311: A class may only extend another class. +tests/cases/compiler/classUpdateTests.ts(47,18): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/compiler/classUpdateTests.ts(57,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +tests/cases/compiler/classUpdateTests.ts(63,7): error TS2415: Class 'L' incorrectly extends base class 'G'. + Property 'p1' is private in type 'L' but not in type 'G'. +tests/cases/compiler/classUpdateTests.ts(69,7): error TS2415: Class 'M' incorrectly extends base class 'G'. + Property 'p1' is private in type 'M' but not in type 'G'. +tests/cases/compiler/classUpdateTests.ts(70,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +tests/cases/compiler/classUpdateTests.ts(105,15): error TS2339: Property 'p1' does not exist on type 'Q'. +tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' does not exist on type 'R'. + + ==== tests/cases/compiler/classUpdateTests.ts (16 errors) ==== // // test codegen for instance properties @@ -34,7 +54,7 @@ class F extends E { constructor() {} // ERROR - super call required ~~~~~~~~~~~~~~~~ -!!! Constructors for derived classes must contain a 'super' call. +!!! error TS2377: Constructors for derived classes must contain a 'super' call. } class G extends D { @@ -45,15 +65,15 @@ class H { constructor() { super(); } // ERROR - no super call allowed ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } class I extends Object { ~~~~~~ -!!! A class may only extend another class. +!!! error TS2311: A class may only extend another class. constructor() { super(); } // ERROR - no super call allowed ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } class J extends G { @@ -71,13 +91,13 @@ ~~~~~~~~~~ } ~~ -!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. } class L extends G { ~ -!!! Class 'L' incorrectly extends base class 'G': -!!! Private property 'p1' cannot be reimplemented. +!!! error TS2415: Class 'L' incorrectly extends base class 'G'. +!!! error TS2415: Property 'p1' is private in type 'L' but not in type 'G'. constructor(private p1:number) { super(); // NO ERROR } @@ -85,8 +105,8 @@ class M extends G { ~ -!!! Class 'M' incorrectly extends base class 'G': -!!! Private property 'p1' cannot be reimplemented. +!!! error TS2415: Class 'M' incorrectly extends base class 'G'. +!!! error TS2415: Property 'p1' is private in type 'M' but not in type 'G'. constructor(private p1:number) { // ERROR ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var i = 0; @@ -95,7 +115,7 @@ ~~~~~~~~~~ } ~~ -!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. } // @@ -117,29 +137,29 @@ constructor() { public p1 = 0; // ERROR ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. } } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. class P { constructor() { private p1 = 0; // ERROR ~~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. } } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. class Q { constructor() { public this.p1 = 0; // ERROR ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. ~~ -!!! Property 'p1' does not exist on type 'Q'. +!!! error TS2339: Property 'p1' does not exist on type 'Q'. } } @@ -147,8 +167,8 @@ constructor() { private this.p1 = 0; // ERROR ~~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. ~~ -!!! Property 'p1' does not exist on type 'R'. +!!! error TS2339: Property 'p1' does not exist on type 'R'. } } \ No newline at end of file diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt b/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt index 28938907d7a..75f24d8c45a 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(10,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(22,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(31,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts(39,10): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts (4 errors) ==== class Base { constructor(x: number) { } @@ -10,7 +16,7 @@ var r = C; var c = new C(); // error ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var c2 = new C(1); // ok class Base2 { @@ -24,7 +30,7 @@ var r2 = D; var d = new D(); // error ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var d2 = new D(1); // ok // specialized base class @@ -35,7 +41,7 @@ var r3 = D2; var d3 = new D(); // error ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var d4 = new D(1); // ok class D3 extends Base2 { @@ -45,5 +51,5 @@ var r4 = D3; var d5 = new D(); // error ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var d6 = new D(1); // ok \ No newline at end of file diff --git a/tests/baselines/reference/classWithConstructors.errors.txt b/tests/baselines/reference/classWithConstructors.errors.txt index f6612ca87f7..61e0b1248b1 100644 --- a/tests/baselines/reference/classWithConstructors.errors.txt +++ b/tests/baselines/reference/classWithConstructors.errors.txt @@ -1,3 +1,11 @@ +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(6,13): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(15,14): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(21,13): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(31,13): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(40,14): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts(46,13): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts (6 errors) ==== module NonGeneric { class C { @@ -6,7 +14,7 @@ var c = new C(); // error ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var c2 = new C(''); // ok class C2 { @@ -17,7 +25,7 @@ var c3 = new C2(); // error ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var c4 = new C2(''); // ok var c5 = new C2(1); // ok @@ -25,7 +33,7 @@ var d = new D(); // error ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var d2 = new D(1); // ok var d3 = new D(''); // ok } @@ -37,7 +45,7 @@ var c = new C(); // error ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var c2 = new C(''); // ok class C2 { @@ -48,7 +56,7 @@ var c3 = new C2(); // error ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var c4 = new C2(''); // ok var c5 = new C2(1, 2); // ok @@ -56,7 +64,7 @@ var d = new D(); // error ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var d2 = new D(1); // ok var d3 = new D(''); // ok } \ No newline at end of file diff --git a/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt b/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt index 56f34575468..37eb63547ed 100644 --- a/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt +++ b/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/classWithMultipleBaseClasses.ts(18,7): error TS2420: Class 'D' incorrectly implements interface 'I'. + Property 'foo' is missing in type 'D'. + + ==== tests/cases/compiler/classWithMultipleBaseClasses.ts (1 errors) ==== class A { foo() { } @@ -18,8 +22,8 @@ class D implements I, J { ~ -!!! Class 'D' incorrectly implements interface 'I': -!!! Property 'foo' is missing in type 'D'. +!!! error TS2420: Class 'D' incorrectly implements interface 'I'. +!!! error TS2420: Property 'foo' is missing in type 'D'. baz() { } bat() { } } diff --git a/tests/baselines/reference/classWithOptionalParameter.errors.txt b/tests/baselines/reference/classWithOptionalParameter.errors.txt index 028e1f62dff..6e512c2a02e 100644 --- a/tests/baselines/reference/classWithOptionalParameter.errors.txt +++ b/tests/baselines/reference/classWithOptionalParameter.errors.txt @@ -1,20 +1,26 @@ +tests/cases/conformance/types/namedTypes/classWithOptionalParameter.ts(4,6): error TS1112: A class member cannot be declared optional. +tests/cases/conformance/types/namedTypes/classWithOptionalParameter.ts(5,6): error TS1112: A class member cannot be declared optional. +tests/cases/conformance/types/namedTypes/classWithOptionalParameter.ts(9,6): error TS1112: A class member cannot be declared optional. +tests/cases/conformance/types/namedTypes/classWithOptionalParameter.ts(10,6): error TS1112: A class member cannot be declared optional. + + ==== tests/cases/conformance/types/namedTypes/classWithOptionalParameter.ts (4 errors) ==== // classes do not permit optional parameters, these are errors class C { x?: string; ~ -!!! A class member cannot be declared optional. +!!! error TS1112: A class member cannot be declared optional. f?() {} ~ -!!! A class member cannot be declared optional. +!!! error TS1112: A class member cannot be declared optional. } class C2 { x?: T; ~ -!!! A class member cannot be declared optional. +!!! error TS1112: A class member cannot be declared optional. f?(x: T) {} ~ -!!! A class member cannot be declared optional. +!!! error TS1112: A class member cannot be declared optional. } \ No newline at end of file diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt index 1d2d5bb0c70..23d6c6a6847 100644 --- a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/classWithOverloadImplementationOfWrongName.ts(4,5): error TS2389: Function implementation name must be 'foo'. + + ==== tests/cases/compiler/classWithOverloadImplementationOfWrongName.ts (1 errors) ==== class C { foo(): string; foo(x): number; bar(x): any { } ~~~ -!!! Function implementation name must be 'foo'. +!!! error TS2389: Function implementation name must be 'foo'. } \ No newline at end of file diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt index 9d4c0588e63..6ed05607d19 100644 --- a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/classWithOverloadImplementationOfWrongName2.ts(3,5): error TS2389: Function implementation name must be 'foo'. +tests/cases/compiler/classWithOverloadImplementationOfWrongName2.ts(4,5): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/classWithOverloadImplementationOfWrongName2.ts (2 errors) ==== class C { foo(): string; bar(x): any { } ~~~ -!!! Function implementation name must be 'foo'. +!!! error TS2389: Function implementation name must be 'foo'. foo(x): number; ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames.errors.txt b/tests/baselines/reference/classWithPredefinedTypesAsNames.errors.txt index 47ff1f52e66..a0dfb5d62c1 100644 --- a/tests/baselines/reference/classWithPredefinedTypesAsNames.errors.txt +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames.errors.txt @@ -1,15 +1,21 @@ +tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames.ts(3,7): error TS2414: Class name cannot be 'any' +tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames.ts(4,7): error TS2414: Class name cannot be 'number' +tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames.ts(5,7): error TS2414: Class name cannot be 'boolean' +tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames.ts(6,7): error TS2414: Class name cannot be 'string' + + ==== tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames.ts (4 errors) ==== // classes cannot use predefined types as names class any { } ~~~ -!!! Class name cannot be 'any' +!!! error TS2414: Class name cannot be 'any' class number { } ~~~~~~ -!!! Class name cannot be 'number' +!!! error TS2414: Class name cannot be 'number' class boolean { } ~~~~~~~ -!!! Class name cannot be 'boolean' +!!! error TS2414: Class name cannot be 'boolean' class string { } ~~~~~~ -!!! Class name cannot be 'string' \ No newline at end of file +!!! error TS2414: Class name cannot be 'string' \ No newline at end of file diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt b/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt index 0d6065e7a71..73cb373180c 100644 --- a/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt @@ -1,6 +1,9 @@ +tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames2.ts(3,7): error TS1003: Identifier expected. + + ==== tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames2.ts (1 errors) ==== // classes cannot use predefined types as names class void {} ~~~~ -!!! Identifier expected. \ No newline at end of file +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/classWithPrivateProperty.errors.txt b/tests/baselines/reference/classWithPrivateProperty.errors.txt index aa1664bbb37..93a94e21075 100644 --- a/tests/baselines/reference/classWithPrivateProperty.errors.txt +++ b/tests/baselines/reference/classWithPrivateProperty.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/types/members/classWithPrivateProperty.ts(15,18): error TS2341: Property 'x' is private and only accessible within class 'C'. +tests/cases/conformance/types/members/classWithPrivateProperty.ts(16,18): error TS2341: Property 'a' is private and only accessible within class 'C'. +tests/cases/conformance/types/members/classWithPrivateProperty.ts(17,18): error TS2341: Property 'b' is private and only accessible within class 'C'. +tests/cases/conformance/types/members/classWithPrivateProperty.ts(18,18): error TS2341: Property 'c' is private and only accessible within class 'C'. +tests/cases/conformance/types/members/classWithPrivateProperty.ts(19,18): error TS2341: Property 'd' is private and only accessible within class 'C'. +tests/cases/conformance/types/members/classWithPrivateProperty.ts(20,18): error TS2341: Property 'e' is private and only accessible within class 'C'. +tests/cases/conformance/types/members/classWithPrivateProperty.ts(21,18): error TS2341: Property 'f' is private and only accessible within class 'C'. +tests/cases/conformance/types/members/classWithPrivateProperty.ts(22,18): error TS2341: Property 'g' is private and only accessible within class 'C'. + + ==== tests/cases/conformance/types/members/classWithPrivateProperty.ts (8 errors) ==== // accessing any private outside the class is an error @@ -15,25 +25,25 @@ var c = new C(); var r1: string = c.x; ~~~ -!!! Property 'C.x' is inaccessible. +!!! error TS2341: Property 'x' is private and only accessible within class 'C'. var r2: string = c.a; ~~~ -!!! Property 'C.a' is inaccessible. +!!! error TS2341: Property 'a' is private and only accessible within class 'C'. var r3: string = c.b; ~~~ -!!! Property 'C.b' is inaccessible. +!!! error TS2341: Property 'b' is private and only accessible within class 'C'. var r4: string = c.c(); ~~~ -!!! Property 'C.c' is inaccessible. +!!! error TS2341: Property 'c' is private and only accessible within class 'C'. var r5: string = c.d(); ~~~ -!!! Property 'C.d' is inaccessible. +!!! error TS2341: Property 'd' is private and only accessible within class 'C'. var r6: string = C.e; ~~~ -!!! Property 'C.e' is inaccessible. +!!! error TS2341: Property 'e' is private and only accessible within class 'C'. var r7: string = C.f(); ~~~ -!!! Property 'C.f' is inaccessible. +!!! error TS2341: Property 'f' is private and only accessible within class 'C'. var r8: string = C.g(); ~~~ -!!! Property 'C.g' is inaccessible. \ No newline at end of file +!!! error TS2341: Property 'g' is private and only accessible within class 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classWithProtectedProperty.js b/tests/baselines/reference/classWithProtectedProperty.js new file mode 100644 index 00000000000..c0dde0d3237 --- /dev/null +++ b/tests/baselines/reference/classWithProtectedProperty.js @@ -0,0 +1,71 @@ +//// [classWithProtectedProperty.ts] +// accessing any protected outside the class is an error + +class C { + protected x; + protected a = ''; + protected b: string = ''; + protected c() { return '' } + protected d = () => ''; + protected static e; + protected static f() { return '' } + protected static g = () => ''; +} + +class D extends C { + method() { + // No errors + var d = new D(); + var r1: string = d.x; + var r2: string = d.a; + var r3: string = d.b; + var r4: string = d.c(); + var r5: string = d.d(); + var r6: string = C.e; + var r7: string = C.f(); + var r8: string = C.g(); + } +} + +//// [classWithProtectedProperty.js] +// accessing any protected outside the class is an error +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + this.a = ''; + this.b = ''; + this.d = function () { return ''; }; + } + C.prototype.c = function () { + return ''; + }; + C.f = function () { + return ''; + }; + C.g = function () { return ''; }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.prototype.method = function () { + // No errors + var d = new D(); + var r1 = d.x; + var r2 = d.a; + var r3 = d.b; + var r4 = d.c(); + var r5 = d.d(); + var r6 = C.e; + var r7 = C.f(); + var r8 = C.g(); + }; + return D; +})(C); diff --git a/tests/baselines/reference/classWithProtectedProperty.types b/tests/baselines/reference/classWithProtectedProperty.types new file mode 100644 index 00000000000..a091206cde0 --- /dev/null +++ b/tests/baselines/reference/classWithProtectedProperty.types @@ -0,0 +1,99 @@ +=== tests/cases/conformance/types/members/classWithProtectedProperty.ts === +// accessing any protected outside the class is an error + +class C { +>C : C + + protected x; +>x : any + + protected a = ''; +>a : string + + protected b: string = ''; +>b : string + + protected c() { return '' } +>c : () => string + + protected d = () => ''; +>d : () => string +>() => '' : () => string + + protected static e; +>e : any + + protected static f() { return '' } +>f : () => string + + protected static g = () => ''; +>g : () => string +>() => '' : () => string +} + +class D extends C { +>D : D +>C : C + + method() { +>method : () => void + + // No errors + var d = new D(); +>d : D +>new D() : D +>D : typeof D + + var r1: string = d.x; +>r1 : string +>d.x : any +>d : D +>x : any + + var r2: string = d.a; +>r2 : string +>d.a : string +>d : D +>a : string + + var r3: string = d.b; +>r3 : string +>d.b : string +>d : D +>b : string + + var r4: string = d.c(); +>r4 : string +>d.c() : string +>d.c : () => string +>d : D +>c : () => string + + var r5: string = d.d(); +>r5 : string +>d.d() : string +>d.d : () => string +>d : D +>d : () => string + + var r6: string = C.e; +>r6 : string +>C.e : any +>C : typeof C +>e : any + + var r7: string = C.f(); +>r7 : string +>C.f() : string +>C.f : () => string +>C : typeof C +>f : () => string + + var r8: string = C.g(); +>r8 : string +>C.g() : string +>C.g : () => string +>C : typeof C +>g : () => string + } +} diff --git a/tests/baselines/reference/classWithStaticMembers.errors.txt b/tests/baselines/reference/classWithStaticMembers.errors.txt index 63f6d4b76e0..814cb9343e8 100644 --- a/tests/baselines/reference/classWithStaticMembers.errors.txt +++ b/tests/baselines/reference/classWithStaticMembers.errors.txt @@ -1,12 +1,16 @@ +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithStaticMembers.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/constructorFunctionTypes/classWithStaticMembers.ts(4,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithStaticMembers.ts (2 errors) ==== class C { static fn() { return this; } static get x() { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static set x(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. constructor(public a: number, private b: number) { } static foo: string; } diff --git a/tests/baselines/reference/classWithTwoConstructorDefinitions.errors.txt b/tests/baselines/reference/classWithTwoConstructorDefinitions.errors.txt index 6ed2fe3f84d..6b08be330a0 100644 --- a/tests/baselines/reference/classWithTwoConstructorDefinitions.errors.txt +++ b/tests/baselines/reference/classWithTwoConstructorDefinitions.errors.txt @@ -1,14 +1,24 @@ -==== tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts (2 errors) ==== +tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts(2,5): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts(3,5): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts(7,5): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts(8,5): error TS2392: Multiple constructor implementations are not allowed. + + +==== tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts (4 errors) ==== class C { - constructor() { } + constructor() { } // error + ~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. constructor(x) { } // error ~~~~~~~~~~~~~~~~~~ -!!! Multiple constructor implementations are not allowed. +!!! error TS2392: Multiple constructor implementations are not allowed. } class D { - constructor(x: T) { } + constructor(x: T) { } // error + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. constructor(x: T, y: T) { } // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Multiple constructor implementations are not allowed. +!!! error TS2392: Multiple constructor implementations are not allowed. } \ No newline at end of file diff --git a/tests/baselines/reference/classWithTwoConstructorDefinitions.js b/tests/baselines/reference/classWithTwoConstructorDefinitions.js index 77c98697f1f..31e5498cfc9 100644 --- a/tests/baselines/reference/classWithTwoConstructorDefinitions.js +++ b/tests/baselines/reference/classWithTwoConstructorDefinitions.js @@ -1,22 +1,22 @@ //// [classWithTwoConstructorDefinitions.ts] class C { - constructor() { } + constructor() { } // error constructor(x) { } // error } class D { - constructor(x: T) { } + constructor(x: T) { } // error constructor(x: T, y: T) { } // error } //// [classWithTwoConstructorDefinitions.js] var C = (function () { function C() { - } + } // error return C; })(); var D = (function () { function D(x) { - } + } // error return D; })(); diff --git a/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt b/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt index 8f21178ed72..981f38f017c 100644 --- a/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt +++ b/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts(7,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts (2 errors) ==== class C { x = 1 @@ -7,7 +11,7 @@ var c = new C(); var c2 = new C(null); // error ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. class D { x = 2 @@ -17,4 +21,4 @@ var d = new D(); var d2 = new D(null); // error ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/classdecl.errors.txt b/tests/baselines/reference/classdecl.errors.txt index fcb0ad8b25a..e43be2f5ad0 100644 --- a/tests/baselines/reference/classdecl.errors.txt +++ b/tests/baselines/reference/classdecl.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/classdecl.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/classdecl.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/classdecl.ts(18,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/classdecl.ts(24,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/classdecl.ts (4 errors) ==== class a { //constructor (); @@ -12,17 +18,17 @@ public pv; public get d() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 30; } public set d() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } public static get p2() { ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return { x: 30, y: 40 }; } @@ -30,7 +36,7 @@ } private static get p3() { ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "string"; } private pv3; diff --git a/tests/baselines/reference/clinterfaces.errors.txt b/tests/baselines/reference/clinterfaces.errors.txt index e187459e4f4..d5eab2c7994 100644 --- a/tests/baselines/reference/clinterfaces.errors.txt +++ b/tests/baselines/reference/clinterfaces.errors.txt @@ -1,32 +1,50 @@ -==== tests/cases/compiler/clinterfaces.ts (4 errors) ==== +tests/cases/compiler/clinterfaces.ts(2,11): error TS2300: Duplicate identifier 'C'. +tests/cases/compiler/clinterfaces.ts(3,15): error TS2300: Duplicate identifier 'C'. +tests/cases/compiler/clinterfaces.ts(4,15): error TS2300: Duplicate identifier 'D'. +tests/cases/compiler/clinterfaces.ts(5,11): error TS2300: Duplicate identifier 'D'. +tests/cases/compiler/clinterfaces.ts(8,11): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/clinterfaces.ts(12,7): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/clinterfaces.ts(16,7): error TS2300: Duplicate identifier 'Bar'. +tests/cases/compiler/clinterfaces.ts(20,11): error TS2300: Duplicate identifier 'Bar'. + + +==== tests/cases/compiler/clinterfaces.ts (8 errors) ==== module M { class C { } + ~ +!!! error TS2300: Duplicate identifier 'C'. interface C { } ~ -!!! Duplicate identifier 'C'. +!!! error TS2300: Duplicate identifier 'C'. interface D { } + ~ +!!! error TS2300: Duplicate identifier 'D'. class D { } ~ -!!! Duplicate identifier 'D'. +!!! error TS2300: Duplicate identifier 'D'. } interface Foo { + ~~~ +!!! error TS2300: Duplicate identifier 'Foo'. a: string; } class Foo{ ~~~ -!!! Duplicate identifier 'Foo'. +!!! error TS2300: Duplicate identifier 'Foo'. b: number; } class Bar{ + ~~~ +!!! error TS2300: Duplicate identifier 'Bar'. b: number; } interface Bar { ~~~ -!!! Duplicate identifier 'Bar'. +!!! error TS2300: Duplicate identifier 'Bar'. a: string; } diff --git a/tests/baselines/reference/cloduleAndTypeParameters.types b/tests/baselines/reference/cloduleAndTypeParameters.types index 493aaa2d395..ad43bc90f2f 100644 --- a/tests/baselines/reference/cloduleAndTypeParameters.types +++ b/tests/baselines/reference/cloduleAndTypeParameters.types @@ -2,7 +2,7 @@ class Foo { >Foo : Foo >T : T ->Foo : Foo +>Foo : unknown >Bar : Foo.Bar constructor() { diff --git a/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt b/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt index 4d33163d693..e9001265feb 100644 --- a/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt +++ b/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/cloduleSplitAcrossFiles_module.ts(1,8): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged + + ==== tests/cases/compiler/cloduleSplitAcrossFiles_class.ts (0 errors) ==== class D { } ==== tests/cases/compiler/cloduleSplitAcrossFiles_module.ts (1 errors) ==== module D { ~ -!!! A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged export var y = "hi"; } D.y; \ No newline at end of file diff --git a/tests/baselines/reference/cloduleStaticMembers.errors.txt b/tests/baselines/reference/cloduleStaticMembers.errors.txt index ad1a3572c93..914fea72424 100644 --- a/tests/baselines/reference/cloduleStaticMembers.errors.txt +++ b/tests/baselines/reference/cloduleStaticMembers.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/cloduleStaticMembers.ts(6,13): error TS2341: Property 'x' is private and only accessible within class 'Clod'. +tests/cases/compiler/cloduleStaticMembers.ts(7,13): error TS2304: Cannot find name 'x'. +tests/cases/compiler/cloduleStaticMembers.ts(10,13): error TS2304: Cannot find name 'y'. + + ==== tests/cases/compiler/cloduleStaticMembers.ts (3 errors) ==== class Clod { private static x = 10; @@ -6,14 +11,14 @@ module Clod { var p = Clod.x; ~~~~~~ -!!! Property 'Clod.x' is inaccessible. +!!! error TS2341: Property 'x' is private and only accessible within class 'Clod'. var q = x; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. var s = Clod.y; var t = y; ~ -!!! Cannot find name 'y'. +!!! error TS2304: Cannot find name 'y'. } \ No newline at end of file diff --git a/tests/baselines/reference/cloduleTest2.errors.txt b/tests/baselines/reference/cloduleTest2.errors.txt index a1355c0c9f1..9659b5b0d4c 100644 --- a/tests/baselines/reference/cloduleTest2.errors.txt +++ b/tests/baselines/reference/cloduleTest2.errors.txt @@ -1,10 +1,20 @@ +tests/cases/compiler/cloduleTest2.ts(4,13): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/cloduleTest2.ts(10,13): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/cloduleTest2.ts(18,7): error TS2339: Property 'bar' does not exist on type 'm3d'. +tests/cases/compiler/cloduleTest2.ts(19,7): error TS2339: Property 'y' does not exist on type 'm3d'. +tests/cases/compiler/cloduleTest2.ts(27,7): error TS2339: Property 'bar' does not exist on type 'm3d'. +tests/cases/compiler/cloduleTest2.ts(28,7): error TS2339: Property 'y' does not exist on type 'm3d'. +tests/cases/compiler/cloduleTest2.ts(33,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/cloduleTest2.ts(36,10): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/cloduleTest2.ts (8 errors) ==== module T1 { module m3d { export var y = 2; } declare class m3d { constructor(foo); foo(): void ; static bar(); } var r = new m3d(); // error ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. } module T2 { @@ -12,7 +22,7 @@ module m3d { export var y = 2; } var r = new m3d(); // error ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. } module T3 { @@ -22,10 +32,10 @@ r.foo(); r.bar(); // error ~~~ -!!! Property 'bar' does not exist on type 'm3d'. +!!! error TS2339: Property 'bar' does not exist on type 'm3d'. r.y; // error ~ -!!! Property 'y' does not exist on type 'm3d'. +!!! error TS2339: Property 'y' does not exist on type 'm3d'. } module T4 { @@ -35,19 +45,19 @@ r.foo(); r.bar(); // error ~~~ -!!! Property 'bar' does not exist on type 'm3d'. +!!! error TS2339: Property 'bar' does not exist on type 'm3d'. r.y; // error ~ -!!! Property 'y' does not exist on type 'm3d'. +!!! error TS2339: Property 'y' does not exist on type 'm3d'. } module m3d { export var y = 2; } declare class m3d { constructor(foo); foo(): void; static bar(); } var r = new m3d(); // error ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. declare class m4d extends m3d { } var r2 = new m4d(); // error ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt b/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt index d4c17e19bd1..914088f6c19 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt +++ b/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt @@ -1,26 +1,39 @@ -==== tests/cases/compiler/cloduleWithDuplicateMember1.ts (5 errors) ==== +tests/cases/compiler/cloduleWithDuplicateMember1.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/cloduleWithDuplicateMember1.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/cloduleWithDuplicateMember1.ts(3,16): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/cloduleWithDuplicateMember1.ts(6,12): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/cloduleWithDuplicateMember1.ts(10,16): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/cloduleWithDuplicateMember1.ts(13,21): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/cloduleWithDuplicateMember1.ts(14,21): error TS2300: Duplicate identifier 'x'. + + +==== tests/cases/compiler/cloduleWithDuplicateMember1.ts (7 errors) ==== class C { get x() { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! error TS2300: Duplicate identifier 'x'. return ''; } static foo() { } + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. } module C { export var x = 1; ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } module C { export function foo() { } ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. export function x() { } ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } \ No newline at end of file diff --git a/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt b/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt index 1eca71ea428..55d2fdbddf2 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt +++ b/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt @@ -1,18 +1,26 @@ -==== tests/cases/compiler/cloduleWithDuplicateMember2.ts (3 errors) ==== +tests/cases/compiler/cloduleWithDuplicateMember2.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/cloduleWithDuplicateMember2.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/cloduleWithDuplicateMember2.ts(7,16): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/cloduleWithDuplicateMember2.ts(10,21): error TS2300: Duplicate identifier 'x'. + + +==== tests/cases/compiler/cloduleWithDuplicateMember2.ts (4 errors) ==== class C { set x(y) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static set y(z) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } module C { export var x = 1; + ~ +!!! error TS2300: Duplicate identifier 'x'. } module C { export function x() { } ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } \ No newline at end of file diff --git a/tests/baselines/reference/clodulesDerivedClasses.errors.txt b/tests/baselines/reference/clodulesDerivedClasses.errors.txt index 8ee9d5817a0..1753f6051bd 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.errors.txt +++ b/tests/baselines/reference/clodulesDerivedClasses.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/clodulesDerivedClasses.ts(9,7): error TS2417: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape'. + Types of property 'Utils' are incompatible. + Type 'typeof Utils' is not assignable to type 'typeof Utils'. + Property 'convert' is missing in type 'typeof Utils'. + + ==== tests/cases/compiler/clodulesDerivedClasses.ts (1 errors) ==== class Shape { id: number; @@ -9,10 +15,10 @@ class Path extends Shape { ~~~~ -!!! Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape': -!!! Types of property 'Utils' are incompatible: -!!! Type 'typeof Utils' is not assignable to type 'typeof Utils': -!!! Property 'convert' is missing in type 'typeof Utils'. +!!! error TS2417: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape'. +!!! error TS2417: Types of property 'Utils' are incompatible. +!!! error TS2417: Type 'typeof Utils' is not assignable to type 'typeof Utils'. +!!! error TS2417: Property 'convert' is missing in type 'typeof Utils'. name: string; } diff --git a/tests/baselines/reference/collisionArgumentsArrowFunctions.errors.txt b/tests/baselines/reference/collisionArgumentsArrowFunctions.errors.txt index 958ff48235c..f5291d3de43 100644 --- a/tests/baselines/reference/collisionArgumentsArrowFunctions.errors.txt +++ b/tests/baselines/reference/collisionArgumentsArrowFunctions.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/collisionArgumentsArrowFunctions.ts(1,22): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsArrowFunctions.ts(4,12): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + + ==== tests/cases/compiler/collisionArgumentsArrowFunctions.ts (2 errors) ==== var f1 = (i: number, ...arguments) => { //arguments is error ~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any[]; // no error } var f12 = (arguments: number, ...rest) => { //arguments is error ~~~~~~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error } var f1NoError = (arguments: number) => { // no error diff --git a/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt b/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt index bff94980b72..f2ec9429eb7 100644 --- a/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt +++ b/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt @@ -1,16 +1,23 @@ +tests/cases/compiler/collisionArgumentsClassConstructor.ts(3,28): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(8,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(30,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(53,25): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassConstructor.ts(61,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + + ==== tests/cases/compiler/collisionArgumentsClassConstructor.ts (5 errors) ==== // Constructors class c1 { constructor(i: number, ...arguments) { // error ~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any[]; // no error } } class c12 { constructor(arguments: number, ...rest) { // error ~~~~~~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error } } @@ -34,7 +41,7 @@ class c3 { constructor(public arguments: number, ...restParameters) { //arguments is error ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error } } @@ -59,7 +66,7 @@ constructor(i: string, ...arguments); // no codegen no error constructor(i: any, ...arguments) { // error ~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any[]; // no error } } @@ -69,7 +76,7 @@ constructor(arguments: string, ...rest); // no codegen no error constructor(arguments: any, ...rest) { // error ~~~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any; // no error } } diff --git a/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt b/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt index 57342c1006d..38ad6867200 100644 --- a/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt +++ b/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt @@ -1,13 +1,19 @@ +tests/cases/compiler/collisionArgumentsClassMethod.ts(2,27): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(5,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(13,23): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsClassMethod.ts(18,16): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + + ==== tests/cases/compiler/collisionArgumentsClassMethod.ts (4 errors) ==== class c1 { public foo(i: number, ...arguments) { //arguments is error ~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any[]; // no error } public foo1(arguments: number, ...rest) { //arguments is error ~~~~~~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error } public fooNoError(arguments: number) { // no error @@ -17,14 +23,14 @@ public f4(i: string, ...arguments); // no codegen no error public f4(i: any, ...arguments) { // error ~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any[]; // no error } public f41(arguments: number, ...rest); // no codegen no error public f41(arguments: string, ...rest); // no codegen no error public f41(arguments: any, ...rest) { // error ~~~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any; // no error } public f4NoError(arguments: number); // no error diff --git a/tests/baselines/reference/collisionArgumentsFunction.errors.txt b/tests/baselines/reference/collisionArgumentsFunction.errors.txt index 9d76598113a..a557e9cbcba 100644 --- a/tests/baselines/reference/collisionArgumentsFunction.errors.txt +++ b/tests/baselines/reference/collisionArgumentsFunction.errors.txt @@ -1,13 +1,19 @@ +tests/cases/compiler/collisionArgumentsFunction.ts(2,13): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsFunction.ts(5,25): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsFunction.ts(25,13): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsFunction.ts(30,22): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + + ==== tests/cases/compiler/collisionArgumentsFunction.ts (4 errors) ==== // Functions function f1(arguments: number, ...restParameters) { //arguments is error ~~~~~~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error } function f12(i: number, ...arguments) { //arguments is error ~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any[]; // no error } function f1NoError(arguments: number) { // no error @@ -29,14 +35,14 @@ function f4(arguments: string, ...rest); // no codegen no error function f4(arguments: any, ...rest) { // error ~~~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any; // No error } function f42(i: number, ...arguments); // no codegen no error function f42(i: string, ...arguments); // no codegen no error function f42(i: any, ...arguments) { // error ~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any[]; // No error } function f4NoError(arguments: number); // no error diff --git a/tests/baselines/reference/collisionArgumentsFunctionExpressions.errors.txt b/tests/baselines/reference/collisionArgumentsFunctionExpressions.errors.txt index d4b8bbd9e94..fda61160717 100644 --- a/tests/baselines/reference/collisionArgumentsFunctionExpressions.errors.txt +++ b/tests/baselines/reference/collisionArgumentsFunctionExpressions.errors.txt @@ -1,13 +1,19 @@ +tests/cases/compiler/collisionArgumentsFunctionExpressions.ts(2,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsFunctionExpressions.ts(5,29): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsFunctionExpressions.ts(21,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +tests/cases/compiler/collisionArgumentsFunctionExpressions.ts(26,26): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + + ==== tests/cases/compiler/collisionArgumentsFunctionExpressions.ts (4 errors) ==== function foo() { function f1(arguments: number, ...restParameters) { //arguments is error ~~~~~~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error } function f12(i: number, ...arguments) { //arguments is error ~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any[]; // no error } function f1NoError(arguments: number) { // no error @@ -25,14 +31,14 @@ function f4(arguments: string, ...rest); // no codegen no error function f4(arguments: any, ...rest) { // error ~~~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any; // No error } function f42(i: number, ...arguments); // no codegen no error function f42(i: string, ...arguments); // no codegen no error function f42(i: any, ...arguments) { // error ~~~~~~~~~~~~ -!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +!!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any[]; // No error } function f4NoError(arguments: number); // no error diff --git a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt index 23c7fe49f73..9ba074a1cae 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt +++ b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(5,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(14,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(24,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(32,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts(41,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts (5 errors) ==== module M { export var x = 3; @@ -5,7 +12,7 @@ private y; set Z(M) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. this.y = x; } } @@ -16,7 +23,7 @@ private y; set Z(p) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var M = 10; this.y = x; } @@ -28,7 +35,7 @@ private y; set M(p) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. this.y = x; } } @@ -38,7 +45,7 @@ class f { get Z() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var M = 10; return x; } @@ -49,7 +56,7 @@ class e { get M() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return x; } } diff --git a/tests/baselines/reference/collisionExportsRequireAndAlias.errors.txt b/tests/baselines/reference/collisionExportsRequireAndAlias.errors.txt index 2ed2ee5d10e..e782abd08b8 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAlias.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndAlias.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/collisionExportsRequireAndAlias_file2.ts(1,8): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndAlias_file2.ts(2,8): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. + + ==== tests/cases/compiler/collisionExportsRequireAndAlias_file2.ts (2 errors) ==== import require = require('collisionExportsRequireAndAlias_file1'); // Error ~~~~~~~ -!!! Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. import exports = require('collisionExportsRequireAndAlias_file3333'); // Error ~~~~~~~ -!!! Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. export function foo() { require.bar(); } diff --git a/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt b/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt index 8fea5b475f2..ef0a9018f1d 100644 --- a/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt @@ -1,11 +1,15 @@ +tests/cases/compiler/collisionExportsRequireAndClass_externalmodule.ts(1,14): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndClass_externalmodule.ts(3,14): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. + + ==== tests/cases/compiler/collisionExportsRequireAndClass_externalmodule.ts (2 errors) ==== export class require { ~~~~~~~ -!!! Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. } export class exports { ~~~~~~~ -!!! Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. } module m1 { class require { diff --git a/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt b/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt index 782e4958363..d421cbe4d4b 100644 --- a/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt @@ -1,13 +1,17 @@ +tests/cases/compiler/collisionExportsRequireAndEnum_externalmodule.ts(1,13): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndEnum_externalmodule.ts(5,13): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. + + ==== tests/cases/compiler/collisionExportsRequireAndEnum_externalmodule.ts (2 errors) ==== export enum require { // Error ~~~~~~~ -!!! Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. _thisVal1, _thisVal2, } export enum exports { // Error ~~~~~~~ -!!! Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. _thisVal1, _thisVal2, } diff --git a/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt b/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt index 49c6355c480..f52390ec28c 100644 --- a/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/collisionExportsRequireAndFunction.ts(1,17): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndFunction.ts(4,17): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. + + ==== tests/cases/compiler/collisionExportsRequireAndFunction.ts (2 errors) ==== export function exports() { ~~~~~~~ -!!! Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. return 1; } export function require() { ~~~~~~~ -!!! Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. return "require"; } module m1 { diff --git a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt index 9facc72da23..4207db04f53 100644 --- a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/collisionExportsRequireAndInternalModuleAlias.ts(5,8): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndInternalModuleAlias.ts(6,8): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. + + ==== tests/cases/compiler/collisionExportsRequireAndInternalModuleAlias.ts (2 errors) ==== export module m { export class c { @@ -5,10 +9,10 @@ } import exports = m.c; ~~~~~~~ -!!! Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. import require = m.c; ~~~~~~~ -!!! Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. new exports(); new require(); diff --git a/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt b/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt index 4f1f9c4cd4d..cb11155718e 100644 --- a/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt @@ -1,7 +1,11 @@ +tests/cases/compiler/collisionExportsRequireAndModule_externalmodule.ts(1,15): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndModule_externalmodule.ts(10,15): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. + + ==== tests/cases/compiler/collisionExportsRequireAndModule_externalmodule.ts (2 errors) ==== export module require { ~~~~~~~ -!!! Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. export interface I { } export class C { @@ -12,7 +16,7 @@ } export module exports { ~~~~~~~ -!!! Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. export interface I { } export class C { diff --git a/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt b/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt index d5106a0fe50..2efc84d5436 100644 --- a/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/collisionExportsRequireAndVar_externalmodule.ts(3,5): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +tests/cases/compiler/collisionExportsRequireAndVar_externalmodule.ts(4,5): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. + + ==== tests/cases/compiler/collisionExportsRequireAndVar_externalmodule.ts (2 errors) ==== export function foo() { } var exports = 1; ~~~~~~~ -!!! Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of an external module. var require = "require"; ~~~~~~~ -!!! Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of an external module. module m1 { var exports = 0; var require = "require"; diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.errors.txt b/tests/baselines/reference/collisionRestParameterArrowFunctions.errors.txt index 223565f664b..5c585e5a6c3 100644 --- a/tests/baselines/reference/collisionRestParameterArrowFunctions.errors.txt +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/collisionRestParameterArrowFunctions.ts(1,11): error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + + ==== tests/cases/compiler/collisionRestParameterArrowFunctions.ts (1 errors) ==== var f1 = (_i: number, ...restParameters) => { //_i is error ~~~~~~~~~~ -!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +!!! error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. var _i = 10; // no error } var f1NoError = (_i: number) => { // no error diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.errors.txt b/tests/baselines/reference/collisionRestParameterClassConstructor.errors.txt index d64474d412b..a30b6d11d4b 100644 --- a/tests/baselines/reference/collisionRestParameterClassConstructor.errors.txt +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.errors.txt @@ -1,9 +1,14 @@ +tests/cases/compiler/collisionRestParameterClassConstructor.ts(3,17): error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +tests/cases/compiler/collisionRestParameterClassConstructor.ts(25,17): error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +tests/cases/compiler/collisionRestParameterClassConstructor.ts(45,17): error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + + ==== tests/cases/compiler/collisionRestParameterClassConstructor.ts (3 errors) ==== // Constructors class c1 { constructor(_i: number, ...restParameters) { //_i is error ~~~~~~~~~~ -!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +!!! error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. var _i = 10; // no error } } @@ -27,7 +32,7 @@ class c3 { constructor(public _i: number, ...restParameters) { //_i is error ~~~~~~~~~~~~~~~~~ -!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +!!! error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. var _i = 10; // no error } } @@ -49,7 +54,7 @@ constructor(_i: string, ...rest); // no codegen no error constructor(_i: any, ...rest) { // error ~~~~~~~ -!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +!!! error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. var _i: any; // no error } } diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.errors.txt b/tests/baselines/reference/collisionRestParameterClassMethod.errors.txt index 789901bc54e..ac3fb1a5561 100644 --- a/tests/baselines/reference/collisionRestParameterClassMethod.errors.txt +++ b/tests/baselines/reference/collisionRestParameterClassMethod.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/collisionRestParameterClassMethod.ts(2,16): error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +tests/cases/compiler/collisionRestParameterClassMethod.ts(10,15): error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + + ==== tests/cases/compiler/collisionRestParameterClassMethod.ts (2 errors) ==== class c1 { public foo(_i: number, ...restParameters) { //_i is error ~~~~~~~~~~ -!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +!!! error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. var _i = 10; // no error } public fooNoError(_i: number) { // no error @@ -12,7 +16,7 @@ public f4(_i: string, ...rest); // no codegen no error public f4(_i: any, ...rest) { // error ~~~~~~~ -!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +!!! error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. var _i: any; // no error } diff --git a/tests/baselines/reference/collisionRestParameterFunction.errors.txt b/tests/baselines/reference/collisionRestParameterFunction.errors.txt index 3b3cb2a66ae..88a98b9c778 100644 --- a/tests/baselines/reference/collisionRestParameterFunction.errors.txt +++ b/tests/baselines/reference/collisionRestParameterFunction.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/collisionRestParameterFunction.ts(2,13): error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +tests/cases/compiler/collisionRestParameterFunction.ts(21,13): error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + + ==== tests/cases/compiler/collisionRestParameterFunction.ts (2 errors) ==== // Functions function f1(_i: number, ...restParameters) { //_i is error ~~~~~~~~~~ -!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +!!! error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. var _i = 10; // no error } function f1NoError(_i: number) { // no error @@ -23,7 +27,7 @@ function f4(_i: string, ...rest); // no codegen no error function f4(_i: any, ...rest) { // error ~~~~~~~ -!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +!!! error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. } function f4NoError(_i: number); // no error diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.errors.txt b/tests/baselines/reference/collisionRestParameterFunctionExpressions.errors.txt index 102693b2fcc..c2c237f98b3 100644 --- a/tests/baselines/reference/collisionRestParameterFunctionExpressions.errors.txt +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/collisionRestParameterFunctionExpressions.ts(2,17): error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +tests/cases/compiler/collisionRestParameterFunctionExpressions.ts(17,17): error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + + ==== tests/cases/compiler/collisionRestParameterFunctionExpressions.ts (2 errors) ==== function foo() { function f1(_i: number, ...restParameters) { //_i is error ~~~~~~~~~~ -!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +!!! error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. var _i = 10; // no error } function f1NoError(_i: number) { // no error @@ -19,7 +23,7 @@ function f4(_i: string, ...rest); // no codegen no error function f4(_i: any, ...rest) { // error ~~~~~~~ -!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. +!!! error TS2397: Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. } function f4NoError(_i: number); // no error diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.errors.txt b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.errors.txt index cf43c5433e7..08df732096b 100644 --- a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.errors.txt +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/collisionRestParameterUnderscoreIUsage.ts(5,21): error TS2398: Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter. + + ==== tests/cases/compiler/collisionRestParameterUnderscoreIUsage.ts (1 errors) ==== declare var console: { log(msg?: string): void; }; var _i = "This is what I'd expect to see"; @@ -5,7 +8,7 @@ constructor(...args: any[]) { console.log(_i); // This should result in error ~~ -!!! Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter. +!!! error TS2398: Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter. } } new Foo(); \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt index 05b000677db..15ad1e0e8e7 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt @@ -1,17 +1,29 @@ +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(9,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(20,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(33,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(16,9): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(21,9): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(28,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts(35,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts (10 errors) ==== function _super() { // No error } class Foo { get prop1(): number { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. function _super() { // No error } return 10; } set prop1(val: number) { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. function _super() { // No error } } @@ -19,46 +31,46 @@ class b extends Foo { get prop2(): number { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. function _super() { // Should be error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. return 10; } set prop2(val: number) { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. function _super() { // Should be error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } class c extends Foo { get prop2(): number { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x = () => { function _super() { // Should be error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } return 10; } set prop2(val: number) { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x = () => { function _super() { // Should be error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.errors.txt b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.errors.txt index e6b0a98a4a7..8fce8f63f9d 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.errors.txt +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/collisionSuperAndLocalFunctionInConstructor.ts(12,9): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalFunctionInConstructor.ts(20,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndLocalFunctionInConstructor.ts (2 errors) ==== function _super() { // No error } @@ -14,7 +18,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } class c extends Foo { @@ -25,7 +29,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.errors.txt b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.errors.txt index c4ba64b811c..e45219e43c3 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.errors.txt +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/collisionSuperAndLocalFunctionInMethod.ts(13,9): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalFunctionInMethod.ts(22,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndLocalFunctionInMethod.ts (2 errors) ==== function _super() { // No error } @@ -15,7 +19,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } _super() { // No Error } @@ -27,7 +31,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } _super() { // No error diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.errors.txt b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.errors.txt index 17ffba88341..6313eb2d830 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.errors.txt +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/collisionSuperAndLocalFunctionInProperty.ts(14,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndLocalFunctionInProperty.ts (1 errors) ==== function _super() { // No error } @@ -16,7 +19,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt index 1a09105b30c..47c52c2582e 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt @@ -1,53 +1,65 @@ +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(7,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(16,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(21,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(27,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(13,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(17,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(23,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts(29,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts (10 errors) ==== var _super = 10; // No Error class Foo { get prop1(): number { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var _super = 10; // No error return 10; } set prop1(val: number) { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var _super = 10; // No error } } class b extends Foo { get prop2(): number { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var _super = 10; // Should be error ~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. return 10; } set prop2(val: number) { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var _super = 10; // Should be error ~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } class c extends Foo { get prop2(): number { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x = () => { var _super = 10; // Should be error ~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } return 10; } set prop2(val: number) { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x = () => { var _super = 10; // Should be error ~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.errors.txt b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.errors.txt index 7274264ffeb..4097187c3bf 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.errors.txt +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/collisionSuperAndLocalVarInConstructor.ts(10,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalVarInConstructor.ts(17,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndLocalVarInConstructor.ts (2 errors) ==== var _super = 10; // No Error class Foo { @@ -10,7 +14,7 @@ super(); var _super = 10; // Should be error ~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } class c extends Foo { @@ -19,7 +23,7 @@ var x = () => { var _super = 10; // Should be error ~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.errors.txt b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.errors.txt index c7bed578121..72e19e20094 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.errors.txt +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/collisionSuperAndLocalVarInMethod.ts(9,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndLocalVarInMethod.ts(15,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndLocalVarInMethod.ts (2 errors) ==== var _super = 10; // No Error class Foo { @@ -9,7 +13,7 @@ public foo() { var _super = 10; // Should be error ~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } class c extends Foo { @@ -17,7 +21,7 @@ var x = () => { var _super = 10; // Should be error ~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.errors.txt b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.errors.txt index 481f080357e..6c786c83d8a 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.errors.txt +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/collisionSuperAndLocalVarInProperty.ts(13,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndLocalVarInProperty.ts (1 errors) ==== var _super = 10; // No Error class Foo { @@ -13,7 +16,7 @@ doStuff: () => { var _super = 10; // Should be error ~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } public _super = 10; // No error diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.errors.txt b/tests/baselines/reference/collisionSuperAndNameResolution.errors.txt index 74fdc3ea68e..ea874952320 100644 --- a/tests/baselines/reference/collisionSuperAndNameResolution.errors.txt +++ b/tests/baselines/reference/collisionSuperAndNameResolution.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/collisionSuperAndNameResolution.ts(9,21): error TS2402: Expression resolves to '_super' that compiler uses to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndNameResolution.ts (1 errors) ==== var console: { log(message: any); @@ -9,6 +12,6 @@ x() { console.log(_super); // Error as this doesnt not resolve to user defined _super ~~~~~~ -!!! Expression resolves to '_super' that compiler uses to capture base class reference. +!!! error TS2402: Expression resolves to '_super' that compiler uses to capture base class reference. } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndParameter.errors.txt b/tests/baselines/reference/collisionSuperAndParameter.errors.txt index 4c6c0079fcc..b3dcdbf1be8 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.errors.txt +++ b/tests/baselines/reference/collisionSuperAndParameter.errors.txt @@ -1,3 +1,14 @@ +tests/cases/compiler/collisionSuperAndParameter.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndParameter.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionSuperAndParameter.ts(17,22): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndParameter.ts(21,7): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndParameter.ts(26,11): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndParameter.ts(32,19): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndParameter.ts(35,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndParameter.ts(52,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndParameter.ts(57,7): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndParameter.ts (9 errors) ==== class Foo { a() { @@ -12,29 +23,29 @@ } set c(_super: number) { // No error ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } class Foo2 extends Foo { x() { var lamda = (_super: number) => { // Error ~~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. return x => this; // New scope. So should inject new _this capture } } y(_super: number) { // Error ~~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. var lambda = () => { return x => this; // New scope. So should inject new _this capture } } set z(_super: number) { // Error ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } public prop3: { doStuff: (_super: number) => void; // no error - no code gen @@ -42,12 +53,12 @@ public prop4 = { doStuff: (_super: number) => { // should be error ~~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } constructor(_super: number) { // should be error ~~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. super(); } } @@ -66,14 +77,14 @@ constructor(_super: string);// no code gen - no error constructor(_super: any) { // should be error ~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. super(); } y(_super: number); // no code gen - no error y(_super: string); // no code gen - no error y(_super: any) { // Error ~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. var lambda = () => { return x => this; // New scope. So should inject new _this capture } diff --git a/tests/baselines/reference/collisionSuperAndParameter1.errors.txt b/tests/baselines/reference/collisionSuperAndParameter1.errors.txt index ea3c3d9b420..361ecc1668e 100644 --- a/tests/baselines/reference/collisionSuperAndParameter1.errors.txt +++ b/tests/baselines/reference/collisionSuperAndParameter1.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/collisionSuperAndParameter1.ts(6,23): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndParameter1.ts (1 errors) ==== class Foo { } @@ -6,7 +9,7 @@ x() { var lambda = (_super: number) => { // Error ~~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. } } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.errors.txt b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.errors.txt index 5eed3b86bbc..20e71ee1b7a 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.errors.txt +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.ts(5,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.ts(11,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.ts(19,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +tests/cases/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.ts(27,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + + ==== tests/cases/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.ts (4 errors) ==== class a { } @@ -5,7 +11,7 @@ class b1 extends a { constructor(_super: number) { // should be error ~~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. super(); } } @@ -13,7 +19,7 @@ class b2 extends a { constructor(private _super: number) { // should be error ~~~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. super(); } } @@ -23,7 +29,7 @@ constructor(_super: string);// no code gen - no error constructor(_super: any) { // should be error ~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. super(); } } @@ -33,7 +39,7 @@ constructor(_super: string);// no code gen - no error constructor(private _super: any) { // should be error ~~~~~~~~~~~~~~~~~~~ -!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. +!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. super(); } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.errors.txt b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.errors.txt index d12256f4199..96f05d6bfcc 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/collisionThisExpressionAndAliasInGlobal.ts(5,8): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndAliasInGlobal.ts (1 errors) ==== module a { export var b = 10; @@ -5,4 +8,4 @@ var f = () => this; import _this = a; // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. \ No newline at end of file +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. \ No newline at end of file diff --git a/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.errors.txt b/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.errors.txt index 0c6a7955e13..562f0d2a94a 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/collisionThisExpressionAndAmbientClassInGlobal.ts(4,13): error TS2400: Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndAmbientClassInGlobal.ts (1 errors) ==== declare class _this { // no error - as no code generation } var f = () => this; var a = new _this(); // Error ~~~~~ -!!! Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference. \ No newline at end of file +!!! error TS2400: Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference. \ No newline at end of file diff --git a/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.errors.txt b/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.errors.txt index 77439118c9a..412b2c8e18d 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/collisionThisExpressionAndAmbientVarInGlobal.ts(3,1): error TS2400: Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndAmbientVarInGlobal.ts (1 errors) ==== declare var _this: number; // no error as no code gen var f = () => this; _this = 10; // Error ~~~~~ -!!! Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference. \ No newline at end of file +!!! error TS2400: Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference. \ No newline at end of file diff --git a/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.errors.txt b/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.errors.txt index e4256953b85..26e37d4b327 100644 --- a/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/collisionThisExpressionAndClassInGlobal.ts(1,7): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndClassInGlobal.ts (1 errors) ==== class _this { ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. } var f = () => this; \ No newline at end of file diff --git a/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.errors.txt b/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.errors.txt index 8e31ac24291..e6c7b70216c 100644 --- a/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/collisionThisExpressionAndEnumInGlobal.ts(1,6): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndEnumInGlobal.ts (1 errors) ==== enum _this { // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. _thisVal1, _thisVal2, } diff --git a/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.errors.txt b/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.errors.txt index d76412ccad5..30fa4a444e2 100644 --- a/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/collisionThisExpressionAndFunctionInGlobal.ts(1,10): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndFunctionInGlobal.ts (1 errors) ==== function _this() { //Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return 10; } var f = () => this; \ No newline at end of file diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt index 5b84e2b779f..951a349be2b 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt @@ -1,13 +1,23 @@ +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(24,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(34,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(5,21): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(15,21): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(25,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts(35,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts (8 errors) ==== class class1 { get a(): number { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x2 = { doStuff: (callback) => () => { var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return callback(this); } } @@ -16,12 +26,12 @@ } set a(val: number) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x2 = { doStuff: (callback) => () => { var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return callback(this); } } @@ -32,10 +42,10 @@ class class2 { get a(): number { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var x2 = { doStuff: (callback) => () => { return callback(this); @@ -46,10 +56,10 @@ } set a(val: number) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var x2 = { doStuff: (callback) => () => { return callback(this); diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.errors.txt b/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.errors.txt index 17689e7d434..af1b43786a4 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/collisionThisExpressionAndLocalVarInConstructor.ts(5,21): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndLocalVarInConstructor.ts(14,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndLocalVarInConstructor.ts (2 errors) ==== class class1 { constructor() { @@ -5,7 +9,7 @@ doStuff: (callback) => () => { var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return callback(this); } } @@ -16,7 +20,7 @@ constructor() { var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var x2 = { doStuff: (callback) => () => { return callback(this); diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.errors.txt b/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.errors.txt index 171f41fa107..3dd4f6e31a3 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/collisionThisExpressionAndLocalVarInFunction.ts(5,9): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndLocalVarInFunction.ts (1 errors) ==== var console: { log(val: any); @@ -5,6 +8,6 @@ function x() { var _this = 5; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. x => { console.log(this.x); }; } \ No newline at end of file diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.errors.txt b/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.errors.txt index 5e734c998ae..3b6e8cb4cca 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/collisionThisExpressionAndLocalVarInLambda.ts(5,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndLocalVarInLambda.ts (1 errors) ==== declare function alert(message?: any): void; @@ -5,7 +8,7 @@ doStuff: (callback) => () => { var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return callback(this); } } diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.errors.txt b/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.errors.txt index da6a81be808..018f3bb49d2 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/collisionThisExpressionAndLocalVarInMethod.ts(5,21): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndLocalVarInMethod.ts(11,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndLocalVarInMethod.ts (2 errors) ==== class a { method1() { @@ -5,7 +9,7 @@ doStuff: (callback) => () => { var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return callback(this); } } @@ -13,7 +17,7 @@ method2() { var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return { doStuff: (callback) => () => { return callback(this); diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.errors.txt b/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.errors.txt index 57a768213a3..4c166ac13ac 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/collisionThisExpressionAndLocalVarInProperty.ts(4,17): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndLocalVarInProperty.ts(12,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndLocalVarInProperty.ts (2 errors) ==== class class1 { public prop1 = { doStuff: (callback) => () => { var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return callback(this); } } @@ -14,7 +18,7 @@ constructor() { var _this = 2; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. } public prop1 = { doStuff: (callback) => () => { diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.errors.txt b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.errors.txt index 307c829c986..df308b894f1 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/collisionThisExpressionAndLocalVarWithSuperExperssion.ts(7,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndLocalVarWithSuperExperssion.ts(14,17): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndLocalVarWithSuperExperssion.ts (2 errors) ==== class a { public foo() { @@ -7,7 +11,7 @@ public foo() { var _this = 10; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var f = () => super.foo(); } } @@ -16,7 +20,7 @@ var f = () => { var _this = 10; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return super.foo() } } diff --git a/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.errors.txt b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.errors.txt index 7bd8fd289b4..bcc719972dc 100644 --- a/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/collisionThisExpressionAndModuleInGlobal.ts(1,8): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndModuleInGlobal.ts (1 errors) ==== module _this { //Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. class c { } } diff --git a/tests/baselines/reference/collisionThisExpressionAndNameResolution.errors.txt b/tests/baselines/reference/collisionThisExpressionAndNameResolution.errors.txt index 7684f5293bc..76875f46e46 100644 --- a/tests/baselines/reference/collisionThisExpressionAndNameResolution.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndNameResolution.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/collisionThisExpressionAndNameResolution.ts(8,25): error TS2400: Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndNameResolution.ts (1 errors) ==== var console : { log(message: any); @@ -8,7 +11,7 @@ function inner() { console.log(_this); // Error as this doesnt not resolve to user defined _this ~~~~~ -!!! Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference. +!!! error TS2400: Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference. return x => this; // New scope. So should inject new _this capture into function inner } } diff --git a/tests/baselines/reference/collisionThisExpressionAndParameter.errors.txt b/tests/baselines/reference/collisionThisExpressionAndParameter.errors.txt index 0e3d5945887..d2bf00483e4 100644 --- a/tests/baselines/reference/collisionThisExpressionAndParameter.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndParameter.errors.txt @@ -1,23 +1,33 @@ +tests/cases/compiler/collisionThisExpressionAndParameter.ts(4,24): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndParameter.ts(9,22): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndParameter.ts(13,7): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndParameter.ts(34,17): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndParameter.ts(46,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndParameter.ts(59,17): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndParameter.ts(69,7): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndParameter.ts(81,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndParameter.ts (8 errors) ==== class Foo { x() { var _this = 10; // Local var. No this capture in x(), so no conflict. function inner(_this: number) { // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return x => this; // New scope. So should inject new _this capture into function inner } } y() { var lamda = (_this: number) => { // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. return x => this; // New scope. So should inject new _this capture } } z(_this: number) { // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var lambda = () => { return x => this; // New scope. So should inject new _this capture } @@ -40,7 +50,7 @@ class Foo1 { constructor(_this: number) { // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var x2 = { doStuff: (callback) => () => { return callback(this); @@ -54,7 +64,7 @@ function f1(_this: number) { ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. x => { console.log(this.x); }; } @@ -69,7 +79,7 @@ constructor(_this: number); // no code gen - no error constructor(_this: any) { // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var x2 = { doStuff: (callback) => () => { return callback(this); @@ -81,7 +91,7 @@ z(_this: number); // no code gen - no error z(_this: any) { // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var lambda = () => { return x => this; // New scope. So should inject new _this capture } @@ -95,7 +105,7 @@ function f3(_this: string); // no code gen - no error function f3(_this: any) { ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. x => { console.log(this.x); }; } diff --git a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.errors.txt b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.errors.txt index bc60fffd80c..fda0ebc930d 100644 --- a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.errors.txt @@ -1,8 +1,14 @@ +tests/cases/compiler/collisionThisExpressionAndPropertyNameAsConstuctorParameter.ts(2,17): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndPropertyNameAsConstuctorParameter.ts(10,25): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndPropertyNameAsConstuctorParameter.ts(20,17): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +tests/cases/compiler/collisionThisExpressionAndPropertyNameAsConstuctorParameter.ts(30,25): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndPropertyNameAsConstuctorParameter.ts (4 errors) ==== class Foo2 { constructor(_this: number) { //Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var lambda = () => { return x => this; // New scope. So should inject new _this capture } @@ -12,7 +18,7 @@ class Foo3 { constructor(private _this: number) { // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var lambda = () => { return x => this; // New scope. So should inject new _this capture } @@ -24,7 +30,7 @@ constructor(_this: string); // No code gen - no error constructor(_this: any) { // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var lambda = () => { return x => this; // New scope. So should inject new _this capture } @@ -36,7 +42,7 @@ constructor(_this: string); // No code gen - no error constructor(private _this: any) { // Error ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var lambda = () => { return x => this; // New scope. So should inject new _this capture } diff --git a/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.errors.txt b/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.errors.txt index c1c7e43f927..31e37f9c255 100644 --- a/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.errors.txt +++ b/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/collisionThisExpressionAndVarInGlobal.ts(1,5): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. + + ==== tests/cases/compiler/collisionThisExpressionAndVarInGlobal.ts (1 errors) ==== var _this = 1; ~~~~~ -!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. +!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference. var f = () => this; \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt index d426c3f5eb0..ecf7e5ed1dc 100644 --- a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt +++ b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt @@ -1,3 +1,11 @@ +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 (6 errors) ==== var BOOLEAN: boolean; var NUMBER: number; @@ -10,22 +18,22 @@ //Expect errors when the results type is different form the second operand resultIsBoolean = (BOOLEAN, STRING); ~~~~~~~~~~~~~~~ -!!! Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. resultIsBoolean = (BOOLEAN, NUMBER); ~~~~~~~~~~~~~~~ -!!! Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. resultIsNumber = (NUMBER, BOOLEAN); ~~~~~~~~~~~~~~ -!!! Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. resultIsNumber = (NUMBER, STRING); ~~~~~~~~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. resultIsString = (STRING, BOOLEAN); ~~~~~~~~~~~~~~ -!!! Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. resultIsString = (STRING, NUMBER); ~~~~~~~~~~~~~~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt index e8a8027eab8..32e8464a195 100644 --- a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt @@ -1,3 +1,7 @@ +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 (2 errors) ==== //Expect to have compiler errors //Comma operator in fuction arguments and return @@ -6,7 +10,7 @@ } var resultIsString: number = foo(1, "123"); //error here ~~~~~~~~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. //TypeParameters function foo1() { @@ -14,5 +18,5 @@ var y: T2; var result: T1 = (x, y); //error here ~~~~~~ -!!! Type 'T2' is not assignable to type 'T1'. +!!! error TS2322: Type 'T2' is not assignable to type 'T1'. } \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt b/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt index a213d416492..7120a827042 100644 --- a/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt +++ b/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt @@ -1,3 +1,17 @@ +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(9,7): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(10,11): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(11,10): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(12,10): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(13,10): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(16,2): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(17,2): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(18,2): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(19,2): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(20,2): error TS1109: Expression expected. +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) ==== var ANY: any; var BOOLEAN: boolean; @@ -9,40 +23,40 @@ // Missing the second operand (ANY, ); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. (BOOLEAN, ); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. (NUMBER, ); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. (STRING, ); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. (OBJECT, ); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. // Missing the first operand (, ANY); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. (, BOOLEAN); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. (, NUMBER); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. (, STRING); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. (, OBJECT); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. // Missing all operands ( , ); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~ -!!! Expression expected. \ No newline at end of file +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnClassAccessor1.errors.txt b/tests/baselines/reference/commentOnClassAccessor1.errors.txt index b434f9fc57d..4ec9a1e1052 100644 --- a/tests/baselines/reference/commentOnClassAccessor1.errors.txt +++ b/tests/baselines/reference/commentOnClassAccessor1.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/commentOnClassAccessor1.ts(5,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/commentOnClassAccessor1.ts (1 errors) ==== class C { /** @@ -5,5 +8,5 @@ */ get bar(): number { return 1;} ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/commentOnClassAccessor2.errors.txt b/tests/baselines/reference/commentOnClassAccessor2.errors.txt index 137490042a7..959a708e05c 100644 --- a/tests/baselines/reference/commentOnClassAccessor2.errors.txt +++ b/tests/baselines/reference/commentOnClassAccessor2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/commentOnClassAccessor2.ts(5,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/commentOnClassAccessor2.ts(10,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/commentOnClassAccessor2.ts (2 errors) ==== class C { /** @@ -5,12 +9,12 @@ */ get bar(): number { return 1;} ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. /** * Setter. */ set bar(v) { } ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/commentOnImportStatement1.errors.txt b/tests/baselines/reference/commentOnImportStatement1.errors.txt index 580b96bd61e..26a725a8f7c 100644 --- a/tests/baselines/reference/commentOnImportStatement1.errors.txt +++ b/tests/baselines/reference/commentOnImportStatement1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/commentOnImportStatement1.ts(3,22): error TS2307: Cannot find external module './foo'. + + ==== tests/cases/compiler/commentOnImportStatement1.ts (1 errors) ==== /* Copyright */ import foo = require('./foo'); ~~~~~~~ -!!! Cannot find external module './foo'. +!!! error TS2307: Cannot find external module './foo'. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnImportStatement2.errors.txt b/tests/baselines/reference/commentOnImportStatement2.errors.txt index 5b600cf4bcf..a2ea6c19d6e 100644 --- a/tests/baselines/reference/commentOnImportStatement2.errors.txt +++ b/tests/baselines/reference/commentOnImportStatement2.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/commentOnImportStatement2.ts(2,22): error TS2307: Cannot find external module './foo'. + + ==== tests/cases/compiler/commentOnImportStatement2.ts (1 errors) ==== /* not copyright */ import foo = require('./foo'); ~~~~~~~ -!!! Cannot find external module './foo'. \ No newline at end of file +!!! error TS2307: Cannot find external module './foo'. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnImportStatement3.errors.txt b/tests/baselines/reference/commentOnImportStatement3.errors.txt index dede9f0f713..427bcf3aef7 100644 --- a/tests/baselines/reference/commentOnImportStatement3.errors.txt +++ b/tests/baselines/reference/commentOnImportStatement3.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/commentOnImportStatement3.ts(4,22): error TS2307: Cannot find external module './foo'. + + ==== tests/cases/compiler/commentOnImportStatement3.ts (1 errors) ==== /* copyright */ /* not copyright */ import foo = require('./foo'); ~~~~~~~ -!!! Cannot find external module './foo'. \ No newline at end of file +!!! error TS2307: Cannot find external module './foo'. \ No newline at end of file diff --git a/tests/baselines/reference/commentsClassMembers.js b/tests/baselines/reference/commentsClassMembers.js index a0cf8f2b631..298991c2eef 100644 --- a/tests/baselines/reference/commentsClassMembers.js +++ b/tests/baselines/reference/commentsClassMembers.js @@ -557,11 +557,11 @@ declare var i1_ncf: (b: number) => number; declare var i1_ncr: number; declare var i1_ncprop: number; declare var i1_s_p: number; -declare var i1_s_f: typeof s2; +declare var i1_s_f: typeof c1.s2; declare var i1_s_r: number; declare var i1_s_prop: number; declare var i1_s_nc_p: number; -declare var i1_s_ncf: typeof nc_s2; +declare var i1_s_ncf: typeof c1.nc_s2; declare var i1_s_ncr: number; declare var i1_s_ncprop: number; declare var i1_c: typeof c1; @@ -577,111 +577,3 @@ declare class cProperties { private y; } declare var cProperties_i: cProperties; - - -//// [DtsFileErrors] - - -==== tests/cases/compiler/commentsClassMembers.d.ts (2 errors) ==== - /** This is comment for c1*/ - declare class c1 { - /** p1 is property of c1*/ - p1: number; - /** sum with property*/ - p2(/** number to add*/ b: number): number; - /** getter property*/ - /** setter property*/ - p3: number; - /** pp1 is property of c1*/ - private pp1; - /** sum with property*/ - private pp2(/** number to add*/ b); - /** getter property*/ - /** setter property*/ - private pp3; - /** Constructor method*/ - constructor(); - /** s1 is static property of c1*/ - static s1: number; - /** static sum with property*/ - static s2(/** number to add*/ b: number): number; - /** static getter property*/ - /** setter property*/ - static s3: number; - nc_p1: number; - nc_p2(b: number): number; - nc_p3: number; - private nc_pp1; - private nc_pp2(b); - private nc_pp3; - static nc_s1: number; - static nc_s2(b: number): number; - static nc_s3: number; - a_p1: number; - a_p2(b: number): number; - a_p3: number; - private a_pp1; - private a_pp2(b); - private a_pp3; - static a_s1: number; - static a_s2(b: number): number; - static a_s3: number; - /** p1 is property of c1 */ - b_p1: number; - /** sum with property */ - b_p2(b: number): number; - /** getter property */ - /** setter property */ - b_p3: number; - /** pp1 is property of c1 */ - private b_pp1; - /** sum with property */ - private b_pp2(b); - /** getter property */ - /** setter property */ - private b_pp3; - /** s1 is static property of c1 */ - static b_s1: number; - /** static sum with property */ - static b_s2(b: number): number; - /** static getter property - */ - /** setter property - */ - static b_s3: number; - } - declare var i1: c1; - declare var i1_p: number; - declare var i1_f: (b: number) => number; - declare var i1_r: number; - declare var i1_prop: number; - declare var i1_nc_p: number; - declare var i1_ncf: (b: number) => number; - declare var i1_ncr: number; - declare var i1_ncprop: number; - declare var i1_s_p: number; - declare var i1_s_f: typeof s2; - ~~ -!!! Cannot find name 's2'. - declare var i1_s_r: number; - declare var i1_s_prop: number; - declare var i1_s_nc_p: number; - declare var i1_s_ncf: typeof nc_s2; - ~~~~~ -!!! Cannot find name 'nc_s2'. - declare var i1_s_ncr: number; - declare var i1_s_ncprop: number; - declare var i1_c: typeof c1; - declare class cProperties { - private val; - /** getter only property*/ - p1: number; - nc_p1: number; - /**setter only property*/ - p2: number; - nc_p2: number; - x: number; - private y; - } - declare var cProperties_i: cProperties; - \ No newline at end of file diff --git a/tests/baselines/reference/commentsInterface.js b/tests/baselines/reference/commentsInterface.js index 1951137b048..bff79a02aa5 100644 --- a/tests/baselines/reference/commentsInterface.js +++ b/tests/baselines/reference/commentsInterface.js @@ -116,7 +116,7 @@ interface i2 { /** this is x*/ x: number; /** this is foo*/ - foo: (b: number) => string; + foo: (/**param help*/ b: number) => string; /** this is indexer*/ [/**string param*/ i: string]: any; /**new method*/ @@ -152,7 +152,7 @@ interface i3 { /** Function i3 f*/ f(/**number parameter*/ a: number): string; /** i3 l*/ - l: (b: number) => string; + l: (/**comment i3 l b*/ b: number) => string; nc_x: number; nc_f(a: number): string; nc_l: (b: number) => string; diff --git a/tests/baselines/reference/commentsOnObjectLiteral1.errors.txt b/tests/baselines/reference/commentsOnObjectLiteral1.errors.txt index dd737b2b54a..3c80588c2fa 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral1.errors.txt +++ b/tests/baselines/reference/commentsOnObjectLiteral1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/commentsOnObjectLiteral1.ts(1,14): error TS2304: Cannot find name 'makeClass'. + + ==== tests/cases/compiler/commentsOnObjectLiteral1.ts (1 errors) ==== var Person = makeClass( ~~~~~~~~~ -!!! Cannot find name 'makeClass'. +!!! error TS2304: Cannot find name 'makeClass'. /** @scope Person */ diff --git a/tests/baselines/reference/commentsOnObjectLiteral2.errors.txt b/tests/baselines/reference/commentsOnObjectLiteral2.errors.txt index aa338e31db4..2a2394ced48 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral2.errors.txt +++ b/tests/baselines/reference/commentsOnObjectLiteral2.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/commentsOnObjectLiteral2.ts(1,14): error TS2304: Cannot find name 'makeClass'. + + ==== tests/cases/compiler/commentsOnObjectLiteral2.ts (1 errors) ==== var Person = makeClass( ~~~~~~~~~ -!!! Cannot find name 'makeClass'. +!!! error TS2304: Cannot find name 'makeClass'. { /** This is just another way to define a constructor. diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt index c866a79e23c..2563baf1c72 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt @@ -1,3 +1,101 @@ +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(35,12): error TS2365: Operator '<' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(36,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(37,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(38,12): error TS2365: Operator '<' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(39,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(40,12): error TS2365: Operator '<' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(43,12): error TS2365: Operator '<' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(44,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(45,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(46,12): error TS2365: Operator '<' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(47,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(48,12): error TS2365: Operator '<' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(52,12): error TS2365: Operator '>' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(53,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(54,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(55,12): error TS2365: Operator '>' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(56,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(57,12): error TS2365: Operator '>' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(60,12): error TS2365: Operator '>' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(61,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(62,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(63,12): error TS2365: Operator '>' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(64,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(65,12): error TS2365: Operator '>' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(69,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(70,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(71,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(72,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(73,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(74,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(77,12): error TS2365: Operator '<=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(78,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(79,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(80,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(81,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(82,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(86,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(87,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(88,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(89,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(90,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(91,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(94,12): error TS2365: Operator '>=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(95,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(96,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(97,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(98,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(99,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(103,12): error TS2365: Operator '==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(104,12): error TS2365: Operator '==' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(105,12): error TS2365: Operator '==' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(106,12): error TS2365: Operator '==' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(107,12): error TS2365: Operator '==' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(108,12): error TS2365: Operator '==' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(111,12): error TS2365: Operator '==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(112,12): error TS2365: Operator '==' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(113,12): error TS2365: Operator '==' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(114,12): error TS2365: Operator '==' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(115,12): error TS2365: Operator '==' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(116,12): error TS2365: Operator '==' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(120,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(121,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(122,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(123,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(124,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(125,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(128,12): error TS2365: Operator '!=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(129,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(130,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(131,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(132,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(133,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(137,12): error TS2365: Operator '===' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(138,12): error TS2365: Operator '===' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(139,12): error TS2365: Operator '===' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(140,12): error TS2365: Operator '===' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(141,12): error TS2365: Operator '===' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(142,12): error TS2365: Operator '===' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(145,12): error TS2365: Operator '===' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(146,12): error TS2365: Operator '===' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(147,12): error TS2365: Operator '===' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(148,12): error TS2365: Operator '===' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(149,12): error TS2365: Operator '===' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(150,12): error TS2365: Operator '===' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(154,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(155,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(156,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(157,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(158,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(159,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(162,12): error TS2365: Operator '!==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(163,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(164,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(165,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(166,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. + + ==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts (96 errors) ==== class Base { public a: string; @@ -35,327 +133,327 @@ // operator < var r1a1 = a1 < b1; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r1a2 = a2 < b2; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. var r1a3 = a3 < b3; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. var r1a4 = a4 < b4; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r1a5 = a5 < b5; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r1a6 = a6 < b6; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. var r1a7 = a7 < b7; var r1b1 = b1 < a1; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '<' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r1b2 = b2 < a2; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. var r1b3 = b3 < a3; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. var r1b4 = b4 < a4; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r1b5 = b5 < a5; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r1b6 = b6 < a6; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. var r1b7 = b7 < a7; // operator > var r2a1 = a1 > b1; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r2a2 = a2 > b2; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. var r2a3 = a3 > b3; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. var r2a4 = a4 > b4; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r2a5 = a5 > b5; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r2a6 = a6 > b6; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. var r2a7 = a7 > b7; var r2b1 = b1 > a1; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '>' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r2b2 = b2 > a2; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. var r2b3 = b3 > a3; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. var r2b4 = b4 > a4; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r2b5 = b5 > a5; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r2b6 = b6 > a6; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. var r2b7 = b7 > a7; // operator <= var r3a1 = a1 <= b1; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r3a2 = a2 <= b2; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. var r3a3 = a3 <= b3; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. var r3a4 = a4 <= b4; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r3a5 = a5 <= b5; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r3a6 = a6 <= b6; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. var r3a7 = a7 <= b7; var r3b1 = b1 <= a1; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r3b2 = b2 <= a2; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. var r3b3 = b3 <= a3; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. var r3b4 = b4 <= a4; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r3b5 = b5 <= a5; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r3b6 = b6 <= a6; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. var r3b7 = b7 <= a7; // operator >= var r4a1 = a1 >= b1; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r4a2 = a2 >= b2; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. var r4a3 = a3 >= b3; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. var r4a4 = a4 >= b4; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r4a5 = a5 >= b5; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r4a6 = a6 >= b6; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. var r4a7 = a7 >= b7; var r4b1 = b1 >= a1; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r4b2 = b2 >= a2; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. var r4b3 = b3 >= a3; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. var r4b4 = b4 >= a4; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r4b5 = b5 >= a5; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r4b6 = b6 >= a6; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. var r4b7 = b7 >= a7; // operator == var r5a1 = a1 == b1; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r5a2 = a2 == b2; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. var r5a3 = a3 == b3; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. var r5a4 = a4 == b4; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r5a5 = a5 == b5; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r5a6 = a6 == b6; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. var r5a7 = a7 == b7; var r5b1 = b1 == a1; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r5b2 = b2 == a2; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. var r5b3 = b3 == a3; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. var r5b4 = b4 == a4; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r5b5 = b5 == a5; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r5b6 = b6 == a6; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. var r5b7 = b7 == a7; // operator != var r6a1 = a1 != b1; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r6a2 = a2 != b2; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. var r6a3 = a3 != b3; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. var r6a4 = a4 != b4; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r6a5 = a5 != b5; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r6a6 = a6 != b6; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. var r6a7 = a7 != b7; var r6b1 = b1 != a1; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r6b2 = b2 != a2; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. var r6b3 = b3 != a3; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. var r6b4 = b4 != a4; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r6b5 = b5 != a5; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r6b6 = b6 != a6; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. var r6b7 = b7 != a7; // operator === var r7a1 = a1 === b1; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r7a2 = a2 === b2; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. var r7a3 = a3 === b3; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. var r7a4 = a4 === b4; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r7a5 = a5 === b5; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r7a6 = a6 === b6; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. var r7a7 = a7 === b7; var r7b1 = b1 === a1; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '===' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r7b2 = b2 === a2; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. var r7b3 = b3 === a3; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. var r7b4 = b4 === a4; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r7b5 = b5 === a5; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r7b6 = b6 === a6; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. var r7b7 = b7 === a7; // operator !== var r8a1 = a1 !== b1; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r8a2 = a2 !== b2; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. var r8a3 = a3 !== b3; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. var r8a4 = a4 !== b4; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r8a5 = a5 !== b5; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r8a6 = a6 !== b6; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. var r8a7 = a7 !== b7; var r8b1 = b1 !== a1; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r8b2 = b2 !== a2; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. var r8b3 = b3 !== a3; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. var r8b4 = b4 !== a4; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r8b5 = b5 !== a5; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r8b6 = b6 !== a6; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. var r8b7 = b7 !== a7; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt index d0cfd9493b8..cdfd199c0fa 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt @@ -1,3 +1,101 @@ +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(35,12): error TS2365: Operator '<' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(36,12): error TS2365: Operator '<' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(37,12): error TS2365: Operator '<' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(38,12): error TS2365: Operator '<' cannot be applied to types 'new () => Base' and 'new () => C'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(39,12): error TS2365: Operator '<' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(40,12): error TS2365: Operator '<' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(43,12): error TS2365: Operator '<' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(44,12): error TS2365: Operator '<' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(45,12): error TS2365: Operator '<' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(46,12): error TS2365: Operator '<' cannot be applied to types 'new () => C' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(47,12): error TS2365: Operator '<' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(48,12): error TS2365: Operator '<' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(52,12): error TS2365: Operator '>' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(53,12): error TS2365: Operator '>' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(54,12): error TS2365: Operator '>' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(55,12): error TS2365: Operator '>' cannot be applied to types 'new () => Base' and 'new () => C'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(56,12): error TS2365: Operator '>' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(57,12): error TS2365: Operator '>' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(60,12): error TS2365: Operator '>' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(61,12): error TS2365: Operator '>' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(62,12): error TS2365: Operator '>' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(63,12): error TS2365: Operator '>' cannot be applied to types 'new () => C' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(64,12): error TS2365: Operator '>' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(65,12): error TS2365: Operator '>' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(69,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(70,12): error TS2365: Operator '<=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(71,12): error TS2365: Operator '<=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(72,12): error TS2365: Operator '<=' cannot be applied to types 'new () => Base' and 'new () => C'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(73,12): error TS2365: Operator '<=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(74,12): error TS2365: Operator '<=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(77,12): error TS2365: Operator '<=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(78,12): error TS2365: Operator '<=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(79,12): error TS2365: Operator '<=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(80,12): error TS2365: Operator '<=' cannot be applied to types 'new () => C' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(81,12): error TS2365: Operator '<=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(82,12): error TS2365: Operator '<=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(86,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(87,12): error TS2365: Operator '>=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(88,12): error TS2365: Operator '>=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(89,12): error TS2365: Operator '>=' cannot be applied to types 'new () => Base' and 'new () => C'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(90,12): error TS2365: Operator '>=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(91,12): error TS2365: Operator '>=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(94,12): error TS2365: Operator '>=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(95,12): error TS2365: Operator '>=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(96,12): error TS2365: Operator '>=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(97,12): error TS2365: Operator '>=' cannot be applied to types 'new () => C' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(98,12): error TS2365: Operator '>=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(99,12): error TS2365: Operator '>=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(103,12): error TS2365: Operator '==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(104,12): error TS2365: Operator '==' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(105,12): error TS2365: Operator '==' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(106,12): error TS2365: Operator '==' cannot be applied to types 'new () => Base' and 'new () => C'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(107,12): error TS2365: Operator '==' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(108,12): error TS2365: Operator '==' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(111,12): error TS2365: Operator '==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(112,12): error TS2365: Operator '==' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(113,12): error TS2365: Operator '==' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(114,12): error TS2365: Operator '==' cannot be applied to types 'new () => C' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(115,12): error TS2365: Operator '==' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(116,12): error TS2365: Operator '==' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(120,12): error TS2365: Operator '!=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(121,12): error TS2365: Operator '!=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(122,12): error TS2365: Operator '!=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(123,12): error TS2365: Operator '!=' cannot be applied to types 'new () => Base' and 'new () => C'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(124,12): error TS2365: Operator '!=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(125,12): error TS2365: Operator '!=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(128,12): error TS2365: Operator '!=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(129,12): error TS2365: Operator '!=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(130,12): error TS2365: Operator '!=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(131,12): error TS2365: Operator '!=' cannot be applied to types 'new () => C' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(132,12): error TS2365: Operator '!=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(133,12): error TS2365: Operator '!=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(137,12): error TS2365: Operator '===' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(138,12): error TS2365: Operator '===' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(139,12): error TS2365: Operator '===' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(140,12): error TS2365: Operator '===' cannot be applied to types 'new () => Base' and 'new () => C'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(141,12): error TS2365: Operator '===' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(142,12): error TS2365: Operator '===' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(145,12): error TS2365: Operator '===' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(146,12): error TS2365: Operator '===' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(147,12): error TS2365: Operator '===' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(148,12): error TS2365: Operator '===' cannot be applied to types 'new () => C' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(149,12): error TS2365: Operator '===' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(150,12): error TS2365: Operator '===' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(154,12): error TS2365: Operator '!==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(155,12): error TS2365: Operator '!==' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(156,12): error TS2365: Operator '!==' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(157,12): error TS2365: Operator '!==' cannot be applied to types 'new () => Base' and 'new () => C'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(158,12): error TS2365: Operator '!==' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(159,12): error TS2365: Operator '!==' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(162,12): error TS2365: Operator '!==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(163,12): error TS2365: Operator '!==' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(164,12): error TS2365: Operator '!==' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(165,12): error TS2365: Operator '!==' cannot be applied to types 'new () => C' and 'new () => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(166,12): error TS2365: Operator '!==' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): error TS2365: Operator '!==' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. + + ==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts (96 errors) ==== class Base { public a: string; @@ -35,327 +133,327 @@ // operator < var r1a1 = a1 < b1; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '<' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r1a2 = a2 < b2; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +!!! error TS2365: Operator '<' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. var r1a3 = a3 < b3; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +!!! error TS2365: Operator '<' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. var r1a4 = a4 < b4; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new () => Base' and 'new () => C'. +!!! error TS2365: Operator '<' cannot be applied to types 'new () => Base' and 'new () => C'. var r1a5 = a5 < b5; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +!!! error TS2365: Operator '<' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r1a6 = a6 < b6; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +!!! error TS2365: Operator '<' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. var r1a7 = a7 < b7; var r1b1 = b1 < a1; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '<' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r1b2 = b2 < a2; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +!!! error TS2365: Operator '<' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. var r1b3 = b3 < a3; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +!!! error TS2365: Operator '<' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. var r1b4 = b4 < a4; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new () => C' and 'new () => Base'. +!!! error TS2365: Operator '<' cannot be applied to types 'new () => C' and 'new () => Base'. var r1b5 = b5 < a5; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +!!! error TS2365: Operator '<' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r1b6 = b6 < a6; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +!!! error TS2365: Operator '<' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. var r1b7 = b7 < a7; // operator > var r2a1 = a1 > b1; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '>' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r2a2 = a2 > b2; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +!!! error TS2365: Operator '>' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. var r2a3 = a3 > b3; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +!!! error TS2365: Operator '>' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. var r2a4 = a4 > b4; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new () => Base' and 'new () => C'. +!!! error TS2365: Operator '>' cannot be applied to types 'new () => Base' and 'new () => C'. var r2a5 = a5 > b5; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +!!! error TS2365: Operator '>' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r2a6 = a6 > b6; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +!!! error TS2365: Operator '>' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. var r2a7 = a7 > b7; var r2b1 = b1 > a1; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '>' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r2b2 = b2 > a2; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +!!! error TS2365: Operator '>' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. var r2b3 = b3 > a3; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +!!! error TS2365: Operator '>' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. var r2b4 = b4 > a4; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new () => C' and 'new () => Base'. +!!! error TS2365: Operator '>' cannot be applied to types 'new () => C' and 'new () => Base'. var r2b5 = b5 > a5; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +!!! error TS2365: Operator '>' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r2b6 = b6 > a6; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +!!! error TS2365: Operator '>' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. var r2b7 = b7 > a7; // operator <= var r3a1 = a1 <= b1; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r3a2 = a2 <= b2; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. var r3a3 = a3 <= b3; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. var r3a4 = a4 <= b4; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new () => Base' and 'new () => C'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new () => Base' and 'new () => C'. var r3a5 = a5 <= b5; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r3a6 = a6 <= b6; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. var r3a7 = a7 <= b7; var r3b1 = b1 <= a1; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r3b2 = b2 <= a2; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. var r3b3 = b3 <= a3; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. var r3b4 = b4 <= a4; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new () => C' and 'new () => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new () => C' and 'new () => Base'. var r3b5 = b5 <= a5; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r3b6 = b6 <= a6; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +!!! error TS2365: Operator '<=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. var r3b7 = b7 <= a7; // operator >= var r4a1 = a1 >= b1; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r4a2 = a2 >= b2; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. var r4a3 = a3 >= b3; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. var r4a4 = a4 >= b4; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new () => Base' and 'new () => C'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new () => Base' and 'new () => C'. var r4a5 = a5 >= b5; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r4a6 = a6 >= b6; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. var r4a7 = a7 >= b7; var r4b1 = b1 >= a1; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r4b2 = b2 >= a2; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. var r4b3 = b3 >= a3; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. var r4b4 = b4 >= a4; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new () => C' and 'new () => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new () => C' and 'new () => Base'. var r4b5 = b5 >= a5; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r4b6 = b6 >= a6; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +!!! error TS2365: Operator '>=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. var r4b7 = b7 >= a7; // operator == var r5a1 = a1 == b1; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r5a2 = a2 == b2; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +!!! error TS2365: Operator '==' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. var r5a3 = a3 == b3; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +!!! error TS2365: Operator '==' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. var r5a4 = a4 == b4; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new () => Base' and 'new () => C'. +!!! error TS2365: Operator '==' cannot be applied to types 'new () => Base' and 'new () => C'. var r5a5 = a5 == b5; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +!!! error TS2365: Operator '==' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r5a6 = a6 == b6; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +!!! error TS2365: Operator '==' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. var r5a7 = a7 == b7; var r5b1 = b1 == a1; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r5b2 = b2 == a2; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +!!! error TS2365: Operator '==' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. var r5b3 = b3 == a3; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +!!! error TS2365: Operator '==' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. var r5b4 = b4 == a4; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new () => C' and 'new () => Base'. +!!! error TS2365: Operator '==' cannot be applied to types 'new () => C' and 'new () => Base'. var r5b5 = b5 == a5; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +!!! error TS2365: Operator '==' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r5b6 = b6 == a6; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +!!! error TS2365: Operator '==' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. var r5b7 = b7 == a7; // operator != var r6a1 = a1 != b1; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r6a2 = a2 != b2; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. var r6a3 = a3 != b3; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. var r6a4 = a4 != b4; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new () => Base' and 'new () => C'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new () => Base' and 'new () => C'. var r6a5 = a5 != b5; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r6a6 = a6 != b6; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. var r6a7 = a7 != b7; var r6b1 = b1 != a1; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r6b2 = b2 != a2; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. var r6b3 = b3 != a3; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. var r6b4 = b4 != a4; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new () => C' and 'new () => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new () => C' and 'new () => Base'. var r6b5 = b5 != a5; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r6b6 = b6 != a6; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +!!! error TS2365: Operator '!=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. var r6b7 = b7 != a7; // operator === var r7a1 = a1 === b1; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '===' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r7a2 = a2 === b2; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +!!! error TS2365: Operator '===' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. var r7a3 = a3 === b3; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +!!! error TS2365: Operator '===' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. var r7a4 = a4 === b4; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new () => Base' and 'new () => C'. +!!! error TS2365: Operator '===' cannot be applied to types 'new () => Base' and 'new () => C'. var r7a5 = a5 === b5; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +!!! error TS2365: Operator '===' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r7a6 = a6 === b6; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +!!! error TS2365: Operator '===' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. var r7a7 = a7 === b7; var r7b1 = b1 === a1; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '===' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r7b2 = b2 === a2; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +!!! error TS2365: Operator '===' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. var r7b3 = b3 === a3; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +!!! error TS2365: Operator '===' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. var r7b4 = b4 === a4; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new () => C' and 'new () => Base'. +!!! error TS2365: Operator '===' cannot be applied to types 'new () => C' and 'new () => Base'. var r7b5 = b5 === a5; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +!!! error TS2365: Operator '===' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r7b6 = b6 === a6; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +!!! error TS2365: Operator '===' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. var r7b7 = b7 === a7; // operator !== var r8a1 = a1 !== b1; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. var r8a2 = a2 !== b2; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. var r8a3 = a3 !== b3; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. var r8a4 = a4 !== b4; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new () => Base' and 'new () => C'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new () => Base' and 'new () => C'. var r8a5 = a5 !== b5; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r8a6 = a6 !== b6; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. var r8a7 = a7 !== b7; var r8b1 = b1 !== a1; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. var r8b2 = b2 !== a2; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. var r8b3 = b3 !== a3; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. var r8b4 = b4 !== a4; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new () => C' and 'new () => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new () => C' and 'new () => Base'. var r8b5 = b5 !== a5; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r8b6 = b6 !== a6; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. +!!! error TS2365: Operator '!==' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. var r8b7 = b7 !== a7; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt index dda19ceaa18..5bb7772e75f 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt @@ -1,3 +1,69 @@ +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(26,12): error TS2365: Operator '<' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(27,12): error TS2365: Operator '<' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(28,12): error TS2365: Operator '<' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(29,12): error TS2365: Operator '<' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(31,12): error TS2365: Operator '<' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(32,12): error TS2365: Operator '<' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(33,12): error TS2365: Operator '<' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(34,12): error TS2365: Operator '<' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(37,12): error TS2365: Operator '>' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(38,12): error TS2365: Operator '>' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(39,12): error TS2365: Operator '>' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(40,12): error TS2365: Operator '>' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(42,12): error TS2365: Operator '>' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(43,12): error TS2365: Operator '>' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(44,12): error TS2365: Operator '>' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(45,12): error TS2365: Operator '>' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(48,12): error TS2365: Operator '<=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(49,12): error TS2365: Operator '<=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(50,12): error TS2365: Operator '<=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(51,12): error TS2365: Operator '<=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(53,12): error TS2365: Operator '<=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(54,12): error TS2365: Operator '<=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(55,12): error TS2365: Operator '<=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(56,12): error TS2365: Operator '<=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(59,12): error TS2365: Operator '>=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(60,12): error TS2365: Operator '>=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(61,12): error TS2365: Operator '>=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(62,12): error TS2365: Operator '>=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(64,12): error TS2365: Operator '>=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(65,12): error TS2365: Operator '>=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(66,12): error TS2365: Operator '>=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(67,12): error TS2365: Operator '>=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(70,12): error TS2365: Operator '==' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(71,12): error TS2365: Operator '==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(72,12): error TS2365: Operator '==' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(73,12): error TS2365: Operator '==' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(75,12): error TS2365: Operator '==' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(76,12): error TS2365: Operator '==' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(77,12): error TS2365: Operator '==' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(78,12): error TS2365: Operator '==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(81,12): error TS2365: Operator '!=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(82,12): error TS2365: Operator '!=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(83,12): error TS2365: Operator '!=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(84,12): error TS2365: Operator '!=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(86,12): error TS2365: Operator '!=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(87,12): error TS2365: Operator '!=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(88,12): error TS2365: Operator '!=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(89,12): error TS2365: Operator '!=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(92,12): error TS2365: Operator '===' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(93,12): error TS2365: Operator '===' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(94,12): error TS2365: Operator '===' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(95,12): error TS2365: Operator '===' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(97,12): error TS2365: Operator '===' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(98,12): error TS2365: Operator '===' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(99,12): error TS2365: Operator '===' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(100,12): error TS2365: Operator '===' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(103,12): error TS2365: Operator '!==' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(104,12): error TS2365: Operator '!==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(105,12): error TS2365: Operator '!==' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(106,12): error TS2365: Operator '!==' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(108,12): error TS2365: Operator '!==' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(109,12): error TS2365: Operator '!==' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(110,12): error TS2365: Operator '!==' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(111,12): error TS2365: Operator '!==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. + + ==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts (64 errors) ==== class Base { public a: string; @@ -26,215 +92,215 @@ // operator < var r1a1 = a1 < b1; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. var r1a2 = a2 < b2; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. var r1a3 = a3 < b3; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. var r1a4 = a4 < b4; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. var r1b1 = b1 < a1; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. var r1b2 = b2 < a2; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. var r1b3 = b3 < a3; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. var r1b4 = b4 < a4; ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +!!! error TS2365: Operator '<' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. // operator > var r2a1 = a1 > b1; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. var r2a2 = a2 > b2; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. var r2a3 = a3 > b3; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. var r2a4 = a4 > b4; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. var r2b1 = b1 > a1; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. var r2b2 = b2 > a2; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. var r2b3 = b3 > a3; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. var r2b4 = b4 > a4; ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +!!! error TS2365: Operator '>' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. // operator <= var r3a1 = a1 <= b1; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. var r3a2 = a2 <= b2; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. var r3a3 = a3 <= b3; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. var r3a4 = a4 <= b4; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. var r3b1 = b1 <= a1; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. var r3b2 = b2 <= a2; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. var r3b3 = b3 <= a3; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. var r3b4 = b4 <= a4; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +!!! error TS2365: Operator '<=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. // operator >= var r4a1 = a1 >= b1; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. var r4a2 = a2 >= b2; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. var r4a3 = a3 >= b3; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. var r4a4 = a4 >= b4; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. var r4b1 = b1 >= a1; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. var r4b2 = b2 >= a2; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. var r4b3 = b3 >= a3; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. var r4b4 = b4 >= a4; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +!!! error TS2365: Operator '>=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. // operator == var r5a1 = a1 == b1; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. var r5a2 = a2 == b2; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. var r5a3 = a3 == b3; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. var r5a4 = a4 == b4; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. var r5b1 = b1 == a1; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. var r5b2 = b2 == a2; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. var r5b3 = b3 == a3; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. var r5b4 = b4 == a4; ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +!!! error TS2365: Operator '==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. // operator != var r6a1 = a1 != b1; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. var r6a2 = a2 != b2; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. var r6a3 = a3 != b3; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. var r6a4 = a4 != b4; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. var r6b1 = b1 != a1; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. var r6b2 = b2 != a2; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. var r6b3 = b3 != a3; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. var r6b4 = b4 != a4; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +!!! error TS2365: Operator '!=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. // operator === var r7a1 = a1 === b1; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. var r7a2 = a2 === b2; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. var r7a3 = a3 === b3; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. var r7a4 = a4 === b4; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. var r7b1 = b1 === a1; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. var r7b2 = b2 === a2; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. var r7b3 = b3 === a3; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. var r7b4 = b4 === a4; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. +!!! error TS2365: Operator '===' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. // operator !== var r8a1 = a1 !== b1; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. var r8a2 = a2 !== b2; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. var r8a3 = a3 !== b3; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. var r8a4 = a4 !== b4; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. var r8b1 = b1 !== a1; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. var r8b2 = b2 !== a2; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. var r8b3 = b3 !== a3; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. +!!! error TS2365: Operator '!==' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. var r8b4 = b4 !== a4; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. \ No newline at end of file +!!! error TS2365: Operator '!==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt index 79da7a1389b..908f97345a1 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(28,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts (1 errors) ==== class Base { public a: string; @@ -28,7 +31,7 @@ var a6: { fn(x: T, y: U): T }; ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var b6: { fn(x: Base, y: C): Base }; // operator < diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt index 870a40fa0a3..5364fea089c 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(28,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts (1 errors) ==== class Base { public a: string; @@ -28,7 +31,7 @@ var a6: { new (x: T, y: U): T }; ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var b6: { new (x: Base, y: C): Base }; // operator < diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.errors.txt index fd3be68dee0..5e700926eb5 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.errors.txt @@ -1,3 +1,21 @@ +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(13,11): error TS2365: Operator '<' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(14,11): error TS2365: Operator '<' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(17,11): error TS2365: Operator '>' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(18,11): error TS2365: Operator '>' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(21,11): error TS2365: Operator '<=' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(22,11): error TS2365: Operator '<=' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(25,11): error TS2365: Operator '>=' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(26,11): error TS2365: Operator '>=' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(29,11): error TS2365: Operator '==' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(30,11): error TS2365: Operator '==' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(33,11): error TS2365: Operator '!=' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(34,11): error TS2365: Operator '!=' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(37,11): error TS2365: Operator '===' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(38,11): error TS2365: Operator '===' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(41,11): error TS2365: Operator '!==' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(42,11): error TS2365: Operator '!==' cannot be applied to types 'B1' and 'A1'. + + ==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts (16 errors) ==== interface A1 { b?: number; @@ -13,63 +31,63 @@ // operator < var ra1 = a < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '<' cannot be applied to types 'A1' and 'B1'. var ra2 = b < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '<' cannot be applied to types 'B1' and 'A1'. // operator > var rb1 = a > b; ~~~~~ -!!! Operator '>' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '>' cannot be applied to types 'A1' and 'B1'. var rb2 = b > a; ~~~~~ -!!! Operator '>' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '>' cannot be applied to types 'B1' and 'A1'. // operator <= var rc1 = a <= b; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '<=' cannot be applied to types 'A1' and 'B1'. var rc2 = b <= a; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '<=' cannot be applied to types 'B1' and 'A1'. // operator >= var rd1 = a >= b; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '>=' cannot be applied to types 'A1' and 'B1'. var rd2 = b >= a; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '>=' cannot be applied to types 'B1' and 'A1'. // operator == var re1 = a == b; ~~~~~~ -!!! Operator '==' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '==' cannot be applied to types 'A1' and 'B1'. var re2 = b == a; ~~~~~~ -!!! Operator '==' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '==' cannot be applied to types 'B1' and 'A1'. // operator != var rf1 = a != b; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '!=' cannot be applied to types 'A1' and 'B1'. var rf2 = b != a; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '!=' cannot be applied to types 'B1' and 'A1'. // operator === var rg1 = a === b; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '===' cannot be applied to types 'A1' and 'B1'. var rg2 = b === a; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '===' cannot be applied to types 'B1' and 'A1'. // operator !== var rh1 = a !== b; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '!==' cannot be applied to types 'A1' and 'B1'. var rh2 = b !== a; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'B1' and 'A1'. \ No newline at end of file +!!! error TS2365: Operator '!==' cannot be applied to types 'B1' and 'A1'. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt index c8d6dd24fa3..10033087946 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt @@ -1,3 +1,37 @@ +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(23,12): error TS2365: Operator '<' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(24,12): error TS2365: Operator '<' cannot be applied to types 'A2' and 'B2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(26,12): error TS2365: Operator '<' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(27,12): error TS2365: Operator '<' cannot be applied to types 'B2' and 'A2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(30,12): error TS2365: Operator '>' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(31,12): error TS2365: Operator '>' cannot be applied to types 'A2' and 'B2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(33,12): error TS2365: Operator '>' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(34,12): error TS2365: Operator '>' cannot be applied to types 'B2' and 'A2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(37,12): error TS2365: Operator '<=' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(38,12): error TS2365: Operator '<=' cannot be applied to types 'A2' and 'B2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(40,12): error TS2365: Operator '<=' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(41,12): error TS2365: Operator '<=' cannot be applied to types 'B2' and 'A2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(44,12): error TS2365: Operator '>=' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(45,12): error TS2365: Operator '>=' cannot be applied to types 'A2' and 'B2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(47,12): error TS2365: Operator '>=' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(48,12): error TS2365: Operator '>=' cannot be applied to types 'B2' and 'A2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(51,12): error TS2365: Operator '==' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(52,12): error TS2365: Operator '==' cannot be applied to types 'A2' and 'B2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(54,12): error TS2365: Operator '==' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(55,12): error TS2365: Operator '==' cannot be applied to types 'B2' and 'A2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(58,12): error TS2365: Operator '!=' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(59,12): error TS2365: Operator '!=' cannot be applied to types 'A2' and 'B2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(61,12): error TS2365: Operator '!=' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(62,12): error TS2365: Operator '!=' cannot be applied to types 'B2' and 'A2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(65,12): error TS2365: Operator '===' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(66,12): error TS2365: Operator '===' cannot be applied to types 'A2' and 'B2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(68,12): error TS2365: Operator '===' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(69,12): error TS2365: Operator '===' cannot be applied to types 'B2' and 'A2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(72,12): error TS2365: Operator '!==' cannot be applied to types 'A1' and 'B1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(73,12): error TS2365: Operator '!==' cannot be applied to types 'A2' and 'B2'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(75,12): error TS2365: Operator '!==' cannot be applied to types 'B1' and 'A1'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(76,12): error TS2365: Operator '!==' cannot be applied to types 'B2' and 'A2'. + + ==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts (32 errors) ==== class A1 { public a: number; @@ -23,119 +57,119 @@ // operator < var r1a1 = a1 < b1; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '<' cannot be applied to types 'A1' and 'B1'. var r1a2 = a2 < b2; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'A2' and 'B2'. +!!! error TS2365: Operator '<' cannot be applied to types 'A2' and 'B2'. var r1b1 = b1 < a1; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '<' cannot be applied to types 'B1' and 'A1'. var r1b2 = b2 < a2; ~~~~~~~ -!!! Operator '<' cannot be applied to types 'B2' and 'A2'. +!!! error TS2365: Operator '<' cannot be applied to types 'B2' and 'A2'. // operator > var r2a1 = a1 > b1; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '>' cannot be applied to types 'A1' and 'B1'. var r2a2 = a2 > b2; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'A2' and 'B2'. +!!! error TS2365: Operator '>' cannot be applied to types 'A2' and 'B2'. var r2b1 = b1 > a1; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '>' cannot be applied to types 'B1' and 'A1'. var r2b2 = b2 > a2; ~~~~~~~ -!!! Operator '>' cannot be applied to types 'B2' and 'A2'. +!!! error TS2365: Operator '>' cannot be applied to types 'B2' and 'A2'. // operator <= var r3a1 = a1 <= b1; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '<=' cannot be applied to types 'A1' and 'B1'. var r3a2 = a2 <= b2; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'A2' and 'B2'. +!!! error TS2365: Operator '<=' cannot be applied to types 'A2' and 'B2'. var r3b1 = b1 <= a1; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '<=' cannot be applied to types 'B1' and 'A1'. var r3b2 = b2 <= a2; ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'B2' and 'A2'. +!!! error TS2365: Operator '<=' cannot be applied to types 'B2' and 'A2'. // operator >= var r4a1 = a1 >= b1; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '>=' cannot be applied to types 'A1' and 'B1'. var r4a2 = a2 >= b2; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'A2' and 'B2'. +!!! error TS2365: Operator '>=' cannot be applied to types 'A2' and 'B2'. var r4b1 = b1 >= a1; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '>=' cannot be applied to types 'B1' and 'A1'. var r4b2 = b2 >= a2; ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'B2' and 'A2'. +!!! error TS2365: Operator '>=' cannot be applied to types 'B2' and 'A2'. // operator == var r5a1 = a1 == b1; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '==' cannot be applied to types 'A1' and 'B1'. var r5a2 = a2 == b2; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'A2' and 'B2'. +!!! error TS2365: Operator '==' cannot be applied to types 'A2' and 'B2'. var r5b1 = b1 == a1; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '==' cannot be applied to types 'B1' and 'A1'. var r5b2 = b2 == a2; ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'B2' and 'A2'. +!!! error TS2365: Operator '==' cannot be applied to types 'B2' and 'A2'. // operator != var r6a1 = a1 != b1; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '!=' cannot be applied to types 'A1' and 'B1'. var r6a2 = a2 != b2; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'A2' and 'B2'. +!!! error TS2365: Operator '!=' cannot be applied to types 'A2' and 'B2'. var r6b1 = b1 != a1; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '!=' cannot be applied to types 'B1' and 'A1'. var r6b2 = b2 != a2; ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'B2' and 'A2'. +!!! error TS2365: Operator '!=' cannot be applied to types 'B2' and 'A2'. // operator === var r7a1 = a1 === b1; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '===' cannot be applied to types 'A1' and 'B1'. var r7a2 = a2 === b2; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'A2' and 'B2'. +!!! error TS2365: Operator '===' cannot be applied to types 'A2' and 'B2'. var r7b1 = b1 === a1; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '===' cannot be applied to types 'B1' and 'A1'. var r7b2 = b2 === a2; ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'B2' and 'A2'. +!!! error TS2365: Operator '===' cannot be applied to types 'B2' and 'A2'. // operator !== var r8a1 = a1 !== b1; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'A1' and 'B1'. +!!! error TS2365: Operator '!==' cannot be applied to types 'A1' and 'B1'. var r8a2 = a2 !== b2; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'A2' and 'B2'. +!!! error TS2365: Operator '!==' cannot be applied to types 'A2' and 'B2'. var r8b1 = b1 !== a1; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'B1' and 'A1'. +!!! error TS2365: Operator '!==' cannot be applied to types 'B1' and 'A1'. var r8b2 = b2 !== a2; ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'B2' and 'A2'. \ No newline at end of file +!!! error TS2365: Operator '!==' cannot be applied to types 'B2' and 'A2'. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.errors.txt index d614662c0a1..ec511069130 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.errors.txt @@ -1,3 +1,149 @@ +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(10,12): error TS2365: Operator '<' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(11,12): error TS2365: Operator '<' cannot be applied to types 'number' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(12,12): error TS2365: Operator '<' cannot be applied to types 'number' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(15,12): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(16,12): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(17,12): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(18,12): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(20,12): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(21,12): error TS2365: Operator '<' cannot be applied to types 'string' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(22,12): error TS2365: Operator '<' cannot be applied to types 'string' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(23,12): error TS2365: Operator '<' cannot be applied to types 'string' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(25,12): error TS2365: Operator '<' cannot be applied to types 'void' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(26,12): error TS2365: Operator '<' cannot be applied to types 'void' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(27,12): error TS2365: Operator '<' cannot be applied to types 'void' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(28,12): error TS2365: Operator '<' cannot be applied to types 'void' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(31,12): error TS2365: Operator '<' cannot be applied to types 'E' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(32,12): error TS2365: Operator '<' cannot be applied to types 'E' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(33,12): error TS2365: Operator '<' cannot be applied to types 'E' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(36,12): error TS2365: Operator '>' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(37,12): error TS2365: Operator '>' cannot be applied to types 'number' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(38,12): error TS2365: Operator '>' cannot be applied to types 'number' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(41,12): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(42,12): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(43,12): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(44,12): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(46,12): error TS2365: Operator '>' cannot be applied to types 'string' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(47,12): error TS2365: Operator '>' cannot be applied to types 'string' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(48,12): error TS2365: Operator '>' cannot be applied to types 'string' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(49,12): error TS2365: Operator '>' cannot be applied to types 'string' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(51,12): error TS2365: Operator '>' cannot be applied to types 'void' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(52,12): error TS2365: Operator '>' cannot be applied to types 'void' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(53,12): error TS2365: Operator '>' cannot be applied to types 'void' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(54,12): error TS2365: Operator '>' cannot be applied to types 'void' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(57,12): error TS2365: Operator '>' cannot be applied to types 'E' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(58,12): error TS2365: Operator '>' cannot be applied to types 'E' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(59,12): error TS2365: Operator '>' cannot be applied to types 'E' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(62,12): error TS2365: Operator '<=' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(63,12): error TS2365: Operator '<=' cannot be applied to types 'number' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(64,12): error TS2365: Operator '<=' cannot be applied to types 'number' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(67,12): error TS2365: Operator '<=' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(68,12): error TS2365: Operator '<=' cannot be applied to types 'boolean' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(69,12): error TS2365: Operator '<=' cannot be applied to types 'boolean' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(70,12): error TS2365: Operator '<=' cannot be applied to types 'boolean' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(72,12): error TS2365: Operator '<=' cannot be applied to types 'string' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(73,12): error TS2365: Operator '<=' cannot be applied to types 'string' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(74,12): error TS2365: Operator '<=' cannot be applied to types 'string' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(75,12): error TS2365: Operator '<=' cannot be applied to types 'string' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(77,12): error TS2365: Operator '<=' cannot be applied to types 'void' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(78,12): error TS2365: Operator '<=' cannot be applied to types 'void' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(79,12): error TS2365: Operator '<=' cannot be applied to types 'void' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(80,12): error TS2365: Operator '<=' cannot be applied to types 'void' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(83,12): error TS2365: Operator '<=' cannot be applied to types 'E' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(84,12): error TS2365: Operator '<=' cannot be applied to types 'E' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(85,12): error TS2365: Operator '<=' cannot be applied to types 'E' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(88,12): error TS2365: Operator '>=' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(89,12): error TS2365: Operator '>=' cannot be applied to types 'number' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(90,12): error TS2365: Operator '>=' cannot be applied to types 'number' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(93,12): error TS2365: Operator '>=' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(94,12): error TS2365: Operator '>=' cannot be applied to types 'boolean' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(95,12): error TS2365: Operator '>=' cannot be applied to types 'boolean' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(96,12): error TS2365: Operator '>=' cannot be applied to types 'boolean' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(98,12): error TS2365: Operator '>=' cannot be applied to types 'string' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(99,12): error TS2365: Operator '>=' cannot be applied to types 'string' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(100,12): error TS2365: Operator '>=' cannot be applied to types 'string' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(101,12): error TS2365: Operator '>=' cannot be applied to types 'string' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(103,12): error TS2365: Operator '>=' cannot be applied to types 'void' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(104,12): error TS2365: Operator '>=' cannot be applied to types 'void' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(105,12): error TS2365: Operator '>=' cannot be applied to types 'void' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(106,12): error TS2365: Operator '>=' cannot be applied to types 'void' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(109,12): error TS2365: Operator '>=' cannot be applied to types 'E' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(110,12): error TS2365: Operator '>=' cannot be applied to types 'E' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(111,12): error TS2365: Operator '>=' cannot be applied to types 'E' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(114,12): error TS2365: Operator '==' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(115,12): error TS2365: Operator '==' cannot be applied to types 'number' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(116,12): error TS2365: Operator '==' cannot be applied to types 'number' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(119,12): error TS2365: Operator '==' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(120,12): error TS2365: Operator '==' cannot be applied to types 'boolean' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(121,12): error TS2365: Operator '==' cannot be applied to types 'boolean' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(122,12): error TS2365: Operator '==' cannot be applied to types 'boolean' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(124,12): error TS2365: Operator '==' cannot be applied to types 'string' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(125,12): error TS2365: Operator '==' cannot be applied to types 'string' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(126,12): error TS2365: Operator '==' cannot be applied to types 'string' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(127,12): error TS2365: Operator '==' cannot be applied to types 'string' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(129,12): error TS2365: Operator '==' cannot be applied to types 'void' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(130,12): error TS2365: Operator '==' cannot be applied to types 'void' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(131,12): error TS2365: Operator '==' cannot be applied to types 'void' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(132,12): error TS2365: Operator '==' cannot be applied to types 'void' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(135,12): error TS2365: Operator '==' cannot be applied to types 'E' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(136,12): error TS2365: Operator '==' cannot be applied to types 'E' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(137,12): error TS2365: Operator '==' cannot be applied to types 'E' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(140,12): error TS2365: Operator '!=' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(141,12): error TS2365: Operator '!=' cannot be applied to types 'number' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(142,12): error TS2365: Operator '!=' cannot be applied to types 'number' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(145,12): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(146,12): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(147,12): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(148,12): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(150,12): error TS2365: Operator '!=' cannot be applied to types 'string' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(151,12): error TS2365: Operator '!=' cannot be applied to types 'string' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(152,12): error TS2365: Operator '!=' cannot be applied to types 'string' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(153,12): error TS2365: Operator '!=' cannot be applied to types 'string' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(155,12): error TS2365: Operator '!=' cannot be applied to types 'void' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(156,12): error TS2365: Operator '!=' cannot be applied to types 'void' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(157,12): error TS2365: Operator '!=' cannot be applied to types 'void' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(158,12): error TS2365: Operator '!=' cannot be applied to types 'void' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(161,12): error TS2365: Operator '!=' cannot be applied to types 'E' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(162,12): error TS2365: Operator '!=' cannot be applied to types 'E' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(163,12): error TS2365: Operator '!=' cannot be applied to types 'E' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(166,12): error TS2365: Operator '===' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(167,12): error TS2365: Operator '===' cannot be applied to types 'number' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(168,12): error TS2365: Operator '===' cannot be applied to types 'number' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(171,12): error TS2365: Operator '===' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(172,12): error TS2365: Operator '===' cannot be applied to types 'boolean' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(173,12): error TS2365: Operator '===' cannot be applied to types 'boolean' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(174,12): error TS2365: Operator '===' cannot be applied to types 'boolean' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(176,12): error TS2365: Operator '===' cannot be applied to types 'string' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(177,12): error TS2365: Operator '===' cannot be applied to types 'string' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(178,12): error TS2365: Operator '===' cannot be applied to types 'string' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(179,12): error TS2365: Operator '===' cannot be applied to types 'string' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(181,12): error TS2365: Operator '===' cannot be applied to types 'void' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(182,12): error TS2365: Operator '===' cannot be applied to types 'void' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(183,12): error TS2365: Operator '===' cannot be applied to types 'void' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(184,12): error TS2365: Operator '===' cannot be applied to types 'void' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(187,12): error TS2365: Operator '===' cannot be applied to types 'E' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(188,12): error TS2365: Operator '===' cannot be applied to types 'E' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(189,12): error TS2365: Operator '===' cannot be applied to types 'E' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(192,12): error TS2365: Operator '!==' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(193,12): error TS2365: Operator '!==' cannot be applied to types 'number' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(194,12): error TS2365: Operator '!==' cannot be applied to types 'number' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(197,12): error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(198,12): error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(199,12): error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(200,12): error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(202,12): error TS2365: Operator '!==' cannot be applied to types 'string' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(203,12): error TS2365: Operator '!==' cannot be applied to types 'string' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(204,12): error TS2365: Operator '!==' cannot be applied to types 'string' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(205,12): error TS2365: Operator '!==' cannot be applied to types 'string' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(207,12): error TS2365: Operator '!==' cannot be applied to types 'void' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(208,12): error TS2365: Operator '!==' cannot be applied to types 'void' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(209,12): error TS2365: Operator '!==' cannot be applied to types 'void' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(210,12): error TS2365: Operator '!==' cannot be applied to types 'void' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(213,12): error TS2365: Operator '!==' cannot be applied to types 'E' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(214,12): error TS2365: Operator '!==' cannot be applied to types 'E' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts(215,12): error TS2365: Operator '!==' cannot be applied to types 'E' and 'void'. + + ==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts (144 errors) ==== enum E { a, b, c } @@ -10,495 +156,495 @@ // operator < var r1a1 = a < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'boolean'. var r1a1 = a < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'string'. var r1a1 = a < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'void'. var r1a1 = a < e; // no error, expected var r1b1 = b < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'number'. var r1b1 = b < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'string'. var r1b1 = b < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'void'. var r1b1 = b < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'E'. var r1c1 = c < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. var r1c1 = c < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'boolean'. var r1c1 = c < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'void'. var r1c1 = c < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'E'. var r1d1 = d < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'number'. var r1d1 = d < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'boolean'. var r1d1 = d < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'string'. var r1d1 = d < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'E'. var r1e1 = e < a; // no error, expected var r1e1 = e < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'boolean'. var r1e1 = e < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'string'. var r1e1 = e < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'void'. // operator > var r2a1 = a > b; ~~~~~ -!!! Operator '>' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '>' cannot be applied to types 'number' and 'boolean'. var r2a1 = a > c; ~~~~~ -!!! Operator '>' cannot be applied to types 'number' and 'string'. +!!! error TS2365: Operator '>' cannot be applied to types 'number' and 'string'. var r2a1 = a > d; ~~~~~ -!!! Operator '>' cannot be applied to types 'number' and 'void'. +!!! error TS2365: Operator '>' cannot be applied to types 'number' and 'void'. var r2a1 = a > e; // no error, expected var r2b1 = b > a; ~~~~~ -!!! Operator '>' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. var r2b1 = b > c; ~~~~~ -!!! Operator '>' cannot be applied to types 'boolean' and 'string'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'string'. var r2b1 = b > d; ~~~~~ -!!! Operator '>' cannot be applied to types 'boolean' and 'void'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'void'. var r2b1 = b > e; ~~~~~ -!!! Operator '>' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'E'. var r2c1 = c > a; ~~~~~ -!!! Operator '>' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'string' and 'number'. var r2c1 = c > b; ~~~~~ -!!! Operator '>' cannot be applied to types 'string' and 'boolean'. +!!! error TS2365: Operator '>' cannot be applied to types 'string' and 'boolean'. var r2c1 = c > d; ~~~~~ -!!! Operator '>' cannot be applied to types 'string' and 'void'. +!!! error TS2365: Operator '>' cannot be applied to types 'string' and 'void'. var r2c1 = c > e; ~~~~~ -!!! Operator '>' cannot be applied to types 'string' and 'E'. +!!! error TS2365: Operator '>' cannot be applied to types 'string' and 'E'. var r2d1 = d > a; ~~~~~ -!!! Operator '>' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'void' and 'number'. var r2d1 = d > b; ~~~~~ -!!! Operator '>' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '>' cannot be applied to types 'void' and 'boolean'. var r2d1 = d > c; ~~~~~ -!!! Operator '>' cannot be applied to types 'void' and 'string'. +!!! error TS2365: Operator '>' cannot be applied to types 'void' and 'string'. var r2d1 = d > e; ~~~~~ -!!! Operator '>' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '>' cannot be applied to types 'void' and 'E'. var r2e1 = e > a; // no error, expected var r2e1 = e > b; ~~~~~ -!!! Operator '>' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '>' cannot be applied to types 'E' and 'boolean'. var r2e1 = e > c; ~~~~~ -!!! Operator '>' cannot be applied to types 'E' and 'string'. +!!! error TS2365: Operator '>' cannot be applied to types 'E' and 'string'. var r2e1 = e > d; ~~~~~ -!!! Operator '>' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '>' cannot be applied to types 'E' and 'void'. // operator <= var r3a1 = a <= b; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '<=' cannot be applied to types 'number' and 'boolean'. var r3a1 = a <= c; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'number' and 'string'. +!!! error TS2365: Operator '<=' cannot be applied to types 'number' and 'string'. var r3a1 = a <= d; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'number' and 'void'. +!!! error TS2365: Operator '<=' cannot be applied to types 'number' and 'void'. var r3a1 = a <= e; // no error, expected var r3b1 = b <= a; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '<=' cannot be applied to types 'boolean' and 'number'. var r3b1 = b <= c; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'boolean' and 'string'. +!!! error TS2365: Operator '<=' cannot be applied to types 'boolean' and 'string'. var r3b1 = b <= d; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'boolean' and 'void'. +!!! error TS2365: Operator '<=' cannot be applied to types 'boolean' and 'void'. var r3b1 = b <= e; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '<=' cannot be applied to types 'boolean' and 'E'. var r3c1 = c <= a; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '<=' cannot be applied to types 'string' and 'number'. var r3c1 = c <= b; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'string' and 'boolean'. +!!! error TS2365: Operator '<=' cannot be applied to types 'string' and 'boolean'. var r3c1 = c <= d; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'string' and 'void'. +!!! error TS2365: Operator '<=' cannot be applied to types 'string' and 'void'. var r3c1 = c <= e; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'string' and 'E'. +!!! error TS2365: Operator '<=' cannot be applied to types 'string' and 'E'. var r3d1 = d <= a; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '<=' cannot be applied to types 'void' and 'number'. var r3d1 = d <= b; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '<=' cannot be applied to types 'void' and 'boolean'. var r3d1 = d <= c; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'void' and 'string'. +!!! error TS2365: Operator '<=' cannot be applied to types 'void' and 'string'. var r3d1 = d <= e; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '<=' cannot be applied to types 'void' and 'E'. var r3e1 = e <= a; // no error, expected var r3e1 = e <= b; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '<=' cannot be applied to types 'E' and 'boolean'. var r3e1 = e <= c; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'E' and 'string'. +!!! error TS2365: Operator '<=' cannot be applied to types 'E' and 'string'. var r3e1 = e <= d; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '<=' cannot be applied to types 'E' and 'void'. // operator >= var r4a1 = a >= b; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '>=' cannot be applied to types 'number' and 'boolean'. var r4a1 = a >= c; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'number' and 'string'. +!!! error TS2365: Operator '>=' cannot be applied to types 'number' and 'string'. var r4a1 = a >= d; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'number' and 'void'. +!!! error TS2365: Operator '>=' cannot be applied to types 'number' and 'void'. var r4a1 = a >= e; // no error, expected var r4b1 = b >= a; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '>=' cannot be applied to types 'boolean' and 'number'. var r4b1 = b >= c; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'boolean' and 'string'. +!!! error TS2365: Operator '>=' cannot be applied to types 'boolean' and 'string'. var r4b1 = b >= d; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'boolean' and 'void'. +!!! error TS2365: Operator '>=' cannot be applied to types 'boolean' and 'void'. var r4b1 = b >= e; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '>=' cannot be applied to types 'boolean' and 'E'. var r4c1 = c >= a; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '>=' cannot be applied to types 'string' and 'number'. var r4c1 = c >= b; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'string' and 'boolean'. +!!! error TS2365: Operator '>=' cannot be applied to types 'string' and 'boolean'. var r4c1 = c >= d; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'string' and 'void'. +!!! error TS2365: Operator '>=' cannot be applied to types 'string' and 'void'. var r4c1 = c >= e; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'string' and 'E'. +!!! error TS2365: Operator '>=' cannot be applied to types 'string' and 'E'. var r4d1 = d >= a; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '>=' cannot be applied to types 'void' and 'number'. var r4d1 = d >= b; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '>=' cannot be applied to types 'void' and 'boolean'. var r4d1 = d >= c; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'void' and 'string'. +!!! error TS2365: Operator '>=' cannot be applied to types 'void' and 'string'. var r4d1 = d >= e; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '>=' cannot be applied to types 'void' and 'E'. var r4e1 = e >= a; // no error, expected var r4e1 = e >= b; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '>=' cannot be applied to types 'E' and 'boolean'. var r4e1 = e >= c; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'E' and 'string'. +!!! error TS2365: Operator '>=' cannot be applied to types 'E' and 'string'. var r4e1 = e >= d; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '>=' cannot be applied to types 'E' and 'void'. // operator == var r5a1 = a == b; ~~~~~~ -!!! Operator '==' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '==' cannot be applied to types 'number' and 'boolean'. var r5a1 = a == c; ~~~~~~ -!!! Operator '==' cannot be applied to types 'number' and 'string'. +!!! error TS2365: Operator '==' cannot be applied to types 'number' and 'string'. var r5a1 = a == d; ~~~~~~ -!!! Operator '==' cannot be applied to types 'number' and 'void'. +!!! error TS2365: Operator '==' cannot be applied to types 'number' and 'void'. var r5a1 = a == e; // no error, expected var r5b1 = b == a; ~~~~~~ -!!! Operator '==' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '==' cannot be applied to types 'boolean' and 'number'. var r5b1 = b == c; ~~~~~~ -!!! Operator '==' cannot be applied to types 'boolean' and 'string'. +!!! error TS2365: Operator '==' cannot be applied to types 'boolean' and 'string'. var r5b1 = b == d; ~~~~~~ -!!! Operator '==' cannot be applied to types 'boolean' and 'void'. +!!! error TS2365: Operator '==' cannot be applied to types 'boolean' and 'void'. var r5b1 = b == e; ~~~~~~ -!!! Operator '==' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '==' cannot be applied to types 'boolean' and 'E'. var r5c1 = c == a; ~~~~~~ -!!! Operator '==' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'number'. var r5c1 = c == b; ~~~~~~ -!!! Operator '==' cannot be applied to types 'string' and 'boolean'. +!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'boolean'. var r5c1 = c == d; ~~~~~~ -!!! Operator '==' cannot be applied to types 'string' and 'void'. +!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'void'. var r5c1 = c == e; ~~~~~~ -!!! Operator '==' cannot be applied to types 'string' and 'E'. +!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'E'. var r5d1 = d == a; ~~~~~~ -!!! Operator '==' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '==' cannot be applied to types 'void' and 'number'. var r5d1 = d == b; ~~~~~~ -!!! Operator '==' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '==' cannot be applied to types 'void' and 'boolean'. var r5d1 = d == c; ~~~~~~ -!!! Operator '==' cannot be applied to types 'void' and 'string'. +!!! error TS2365: Operator '==' cannot be applied to types 'void' and 'string'. var r5d1 = d == e; ~~~~~~ -!!! Operator '==' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '==' cannot be applied to types 'void' and 'E'. var r5e1 = e == a; // no error, expected var r5e1 = e == b; ~~~~~~ -!!! Operator '==' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '==' cannot be applied to types 'E' and 'boolean'. var r5e1 = e == c; ~~~~~~ -!!! Operator '==' cannot be applied to types 'E' and 'string'. +!!! error TS2365: Operator '==' cannot be applied to types 'E' and 'string'. var r5e1 = e == d; ~~~~~~ -!!! Operator '==' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '==' cannot be applied to types 'E' and 'void'. // operator != var r6a1 = a != b; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '!=' cannot be applied to types 'number' and 'boolean'. var r6a1 = a != c; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'number' and 'string'. +!!! error TS2365: Operator '!=' cannot be applied to types 'number' and 'string'. var r6a1 = a != d; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'number' and 'void'. +!!! error TS2365: Operator '!=' cannot be applied to types 'number' and 'void'. var r6a1 = a != e; // no error, expected var r6b1 = b != a; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'. var r6b1 = b != c; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'boolean' and 'string'. +!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'string'. var r6b1 = b != d; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'boolean' and 'void'. +!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'void'. var r6b1 = b != e; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'E'. var r6c1 = c != a; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '!=' cannot be applied to types 'string' and 'number'. var r6c1 = c != b; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'string' and 'boolean'. +!!! error TS2365: Operator '!=' cannot be applied to types 'string' and 'boolean'. var r6c1 = c != d; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'string' and 'void'. +!!! error TS2365: Operator '!=' cannot be applied to types 'string' and 'void'. var r6c1 = c != e; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'string' and 'E'. +!!! error TS2365: Operator '!=' cannot be applied to types 'string' and 'E'. var r6d1 = d != a; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '!=' cannot be applied to types 'void' and 'number'. var r6d1 = d != b; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '!=' cannot be applied to types 'void' and 'boolean'. var r6d1 = d != c; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'void' and 'string'. +!!! error TS2365: Operator '!=' cannot be applied to types 'void' and 'string'. var r6d1 = d != e; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '!=' cannot be applied to types 'void' and 'E'. var r6e1 = e != a; // no error, expected var r6e1 = e != b; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '!=' cannot be applied to types 'E' and 'boolean'. var r6e1 = e != c; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'E' and 'string'. +!!! error TS2365: Operator '!=' cannot be applied to types 'E' and 'string'. var r6e1 = e != d; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '!=' cannot be applied to types 'E' and 'void'. // operator === var r7a1 = a === b; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '===' cannot be applied to types 'number' and 'boolean'. var r7a1 = a === c; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'number' and 'string'. +!!! error TS2365: Operator '===' cannot be applied to types 'number' and 'string'. var r7a1 = a === d; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'number' and 'void'. +!!! error TS2365: Operator '===' cannot be applied to types 'number' and 'void'. var r7a1 = a === e; // no error, expected var r7b1 = b === a; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '===' cannot be applied to types 'boolean' and 'number'. var r7b1 = b === c; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'boolean' and 'string'. +!!! error TS2365: Operator '===' cannot be applied to types 'boolean' and 'string'. var r7b1 = b === d; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'boolean' and 'void'. +!!! error TS2365: Operator '===' cannot be applied to types 'boolean' and 'void'. var r7b1 = b === e; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '===' cannot be applied to types 'boolean' and 'E'. var r7c1 = c === a; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '===' cannot be applied to types 'string' and 'number'. var r7c1 = c === b; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'string' and 'boolean'. +!!! error TS2365: Operator '===' cannot be applied to types 'string' and 'boolean'. var r7c1 = c === d; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'string' and 'void'. +!!! error TS2365: Operator '===' cannot be applied to types 'string' and 'void'. var r7c1 = c === e; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'string' and 'E'. +!!! error TS2365: Operator '===' cannot be applied to types 'string' and 'E'. var r7d1 = d === a; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '===' cannot be applied to types 'void' and 'number'. var r7d1 = d === b; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '===' cannot be applied to types 'void' and 'boolean'. var r7d1 = d === c; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'void' and 'string'. +!!! error TS2365: Operator '===' cannot be applied to types 'void' and 'string'. var r7d1 = d === e; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '===' cannot be applied to types 'void' and 'E'. var r7e1 = e === a; // no error, expected var r7e1 = e === b; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '===' cannot be applied to types 'E' and 'boolean'. var r7e1 = e === c; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'E' and 'string'. +!!! error TS2365: Operator '===' cannot be applied to types 'E' and 'string'. var r7e1 = e === d; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '===' cannot be applied to types 'E' and 'void'. // operator !== var r8a1 = a !== b; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '!==' cannot be applied to types 'number' and 'boolean'. var r8a1 = a !== c; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'number' and 'string'. +!!! error TS2365: Operator '!==' cannot be applied to types 'number' and 'string'. var r8a1 = a !== d; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'number' and 'void'. +!!! error TS2365: Operator '!==' cannot be applied to types 'number' and 'void'. var r8a1 = a !== e; // no error, expected var r8b1 = b !== a; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'number'. var r8b1 = b !== c; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'boolean' and 'string'. +!!! error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'string'. var r8b1 = b !== d; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'boolean' and 'void'. +!!! error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'void'. var r8b1 = b !== e; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'E'. var r8c1 = c !== a; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '!==' cannot be applied to types 'string' and 'number'. var r8c1 = c !== b; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'string' and 'boolean'. +!!! error TS2365: Operator '!==' cannot be applied to types 'string' and 'boolean'. var r8c1 = c !== d; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'string' and 'void'. +!!! error TS2365: Operator '!==' cannot be applied to types 'string' and 'void'. var r8c1 = c !== e; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'string' and 'E'. +!!! error TS2365: Operator '!==' cannot be applied to types 'string' and 'E'. var r8d1 = d !== a; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '!==' cannot be applied to types 'void' and 'number'. var r8d1 = d !== b; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '!==' cannot be applied to types 'void' and 'boolean'. var r8d1 = d !== c; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'void' and 'string'. +!!! error TS2365: Operator '!==' cannot be applied to types 'void' and 'string'. var r8d1 = d !== e; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '!==' cannot be applied to types 'void' and 'E'. var r8e1 = e !== a; // no error, expected var r8e1 = e !== b; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '!==' cannot be applied to types 'E' and 'boolean'. var r8e1 = e !== c; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'E' and 'string'. +!!! error TS2365: Operator '!==' cannot be applied to types 'E' and 'string'. var r8e1 = e !== d; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'E' and 'void'. \ No newline at end of file +!!! error TS2365: Operator '!==' cannot be applied to types 'E' and 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt index 6114521d63c..6bd8c30b205 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt @@ -1,3 +1,125 @@ +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(12,14): error TS2365: Operator '<' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(13,14): error TS2365: Operator '>' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(14,14): error TS2365: Operator '<=' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(15,14): error TS2365: Operator '>=' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(16,14): error TS2365: Operator '==' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(17,14): error TS2365: Operator '!=' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(18,14): error TS2365: Operator '===' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(19,14): error TS2365: Operator '!==' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(22,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(23,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(24,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(25,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(26,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(27,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(28,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(30,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(31,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(32,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(33,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(34,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(35,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(36,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(39,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(40,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(41,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(42,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(43,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(44,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(45,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(47,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(48,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(49,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(50,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(51,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(52,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(53,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(56,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(57,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(58,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(59,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(60,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(61,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(62,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(64,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(65,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(66,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(67,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(68,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(69,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(70,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(73,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(74,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(75,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(76,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(77,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(78,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(79,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(81,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(82,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(83,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(84,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(85,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(86,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(87,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(90,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(91,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(92,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(93,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(94,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(95,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(96,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(98,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(99,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(100,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(101,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(102,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(103,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(104,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(107,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(108,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(109,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(110,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(111,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(112,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(113,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(115,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(116,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(117,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(118,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(119,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(120,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(121,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(124,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(125,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(126,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(127,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(128,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(129,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(130,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(132,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(133,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(134,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(135,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(136,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(137,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(138,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(141,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(142,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(143,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(144,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(145,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(146,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(147,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(149,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(150,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(151,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(152,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(153,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(154,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(155,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. + + ==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts (120 errors) ==== enum E { a, b, c } @@ -12,386 +134,386 @@ function foo(t: T, u: U) { var r1 = t < u; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'U'. var r2 = t > u; ~~~~~ -!!! Operator '>' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '>' cannot be applied to types 'T' and 'U'. var r3 = t <= u; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '<=' cannot be applied to types 'T' and 'U'. var r4 = t >= u; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '>=' cannot be applied to types 'T' and 'U'. var r5 = t == u; ~~~~~~ -!!! Operator '==' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '==' cannot be applied to types 'T' and 'U'. var r6 = t != u; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '!=' cannot be applied to types 'T' and 'U'. var r7 = t === u; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '===' cannot be applied to types 'T' and 'U'. var r8 = t !== u; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '!==' cannot be applied to types 'T' and 'U'. // operator < var r1a1 = t < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r1a2 = t < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r1a3 = t < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r1a4 = t < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r1a5 = t < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r1a6 = t < f; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r1a7 = t < g; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r1b1 = a < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r1b2 = b < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r1b3 = c < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r1b4 = d < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r1b5 = e < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r1b6 = f < t; ~~~~~ -!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r1b7 = g < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator > var r2a1 = t < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r2a2 = t < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r2a3 = t < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r2a4 = t < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r2a5 = t < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r2a6 = t < f; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r2a7 = t < g; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r2b1 = a < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r2b2 = b < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r2b3 = c < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r2b4 = d < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r2b5 = e < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r2b6 = f < t; ~~~~~ -!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r2b7 = g < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator <= var r3a1 = t < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r3a2 = t < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r3a3 = t < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r3a4 = t < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r3a5 = t < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r3a6 = t < f; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r3a7 = t < g; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r3b1 = a < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r3b2 = b < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r3b3 = c < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r3b4 = d < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r3b5 = e < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r3b6 = f < t; ~~~~~ -!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r3b7 = g < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator >= var r4a1 = t < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r4a2 = t < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r4a3 = t < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r4a4 = t < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r4a5 = t < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r4a6 = t < f; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r4a7 = t < g; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r4b1 = a < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r4b2 = b < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r4b3 = c < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r4b4 = d < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r4b5 = e < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r4b6 = f < t; ~~~~~ -!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r4b7 = g < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator == var r5a1 = t < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r5a2 = t < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r5a3 = t < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r5a4 = t < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r5a5 = t < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r5a6 = t < f; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r5a7 = t < g; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r5b1 = a < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r5b2 = b < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r5b3 = c < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r5b4 = d < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r5b5 = e < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r5b6 = f < t; ~~~~~ -!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r5b7 = g < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator != var r6a1 = t < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r6a2 = t < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r6a3 = t < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r6a4 = t < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r6a5 = t < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r6a6 = t < f; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r6a7 = t < g; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r6b1 = a < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r6b2 = b < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r6b3 = c < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r6b4 = d < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r6b5 = e < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r6b6 = f < t; ~~~~~ -!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r6b7 = g < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator === var r7a1 = t < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r7a2 = t < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r7a3 = t < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r7a4 = t < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r7a5 = t < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r7a6 = t < f; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r7a7 = t < g; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r7b1 = a < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r7b2 = b < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r7b3 = c < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r7b4 = d < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r7b5 = e < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r7b6 = f < t; ~~~~~ -!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r7b7 = g < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator !== var r8a1 = t < a; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'boolean'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r8a2 = t < b; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r8a3 = t < c; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'string'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r8a4 = t < d; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r8a5 = t < e; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'E'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r8a6 = t < f; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r8a7 = t < g; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'any[]'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r8b1 = a < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'boolean' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r8b2 = b < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'number' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r8b3 = c < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'string' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r8b4 = d < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r8b5 = e < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'E' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r8b6 = f < t; ~~~~~ -!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r8b7 = g < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'any[]' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.errors.txt deleted file mode 100644 index 33fcc439e0a..00000000000 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.errors.txt +++ /dev/null @@ -1,197 +0,0 @@ -==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts (16 errors) ==== - class Base { - public a: string; - } - - class Derived extends Base { - public b: string; - } - - var a1: { fn(x: T): T }; - var b1: { fn(x: string): string }; - - var a2: { fn(x: T): T }; - var b2: { fn(x: string, y: number): string }; - - var a3: { fn(x: T, y: U): T }; - var b3: { fn(x: string, y: number): string }; - - var a4: { fn(x?: T): T }; - var b4: { fn(x?: string): string }; - - var a5: { fn(...x: T[]): T }; - var b5: { fn(...x: string[]): string }; - - var a6: { fn(x: T, y: T): T }; - var b6: { fn(x: string, y: number): {} }; - - //var a7: { fn(x: T, y: U): T }; - var b7: { fn(x: Base, y: Derived): Base }; - - // operator < - var r1a1 = a1 < b1; - var r1a2 = a2 < b2; - ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. - var r1a3 = a3 < b3; - var r1a4 = a4 < b4; - var r1a5 = a5 < b5; - var r1a6 = a6 < b6; - //var r1a7 = a7 < b7; - - var r1b1 = b1 < a1; - var r1b2 = b2 < a2; - ~~~~~~~ -!!! Operator '<' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. - var r1b3 = b3 < a3; - var r1b4 = b4 < a4; - var r1b5 = b5 < a5; - var r1b6 = b6 < a6; - //var r1b7 = b7 < a7; - - // operator > - var r2a1 = a1 > b1; - var r2a2 = a2 > b2; - ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. - var r2a3 = a3 > b3; - var r2a4 = a4 > b4; - var r2a5 = a5 > b5; - var r2a6 = a6 > b6; - //var r2a7 = a7 > b7; - - var r2b1 = b1 > a1; - var r2b2 = b2 > a2; - ~~~~~~~ -!!! Operator '>' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. - var r2b3 = b3 > a3; - var r2b4 = b4 > a4; - var r2b5 = b5 > a5; - var r2b6 = b6 > a6; - //var r2b7 = b7 > a7; - - // operator <= - var r3a1 = a1 <= b1; - var r3a2 = a2 <= b2; - ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. - var r3a3 = a3 <= b3; - var r3a4 = a4 <= b4; - var r3a5 = a5 <= b5; - var r3a6 = a6 <= b6; - //var r3a7 = a7 <= b7; - - var r3b1 = b1 <= a1; - var r3b2 = b2 <= a2; - ~~~~~~~~ -!!! Operator '<=' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. - var r3b3 = b3 <= a3; - var r3b4 = b4 <= a4; - var r3b5 = b5 <= a5; - var r3b6 = b6 <= a6; - //var r3b7 = b7 <= a7; - - // operator >= - var r4a1 = a1 >= b1; - var r4a2 = a2 >= b2; - ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. - var r4a3 = a3 >= b3; - var r4a4 = a4 >= b4; - var r4a5 = a5 >= b5; - var r4a6 = a6 >= b6; - //var r4a7 = a7 >= b7; - - var r4b1 = b1 >= a1; - var r4b2 = b2 >= a2; - ~~~~~~~~ -!!! Operator '>=' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. - var r4b3 = b3 >= a3; - var r4b4 = b4 >= a4; - var r4b5 = b5 >= a5; - var r4b6 = b6 >= a6; - //var r4b7 = b7 >= a7; - - // operator == - var r5a1 = a1 == b1; - var r5a2 = a2 == b2; - ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. - var r5a3 = a3 == b3; - var r5a4 = a4 == b4; - var r5a5 = a5 == b5; - var r5a6 = a6 == b6; - //var r5a7 = a7 == b7; - - var r5b1 = b1 == a1; - var r5b2 = b2 == a2; - ~~~~~~~~ -!!! Operator '==' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. - var r5b3 = b3 == a3; - var r5b4 = b4 == a4; - var r5b5 = b5 == a5; - var r5b6 = b6 == a6; - //var r5b7 = b7 == a7; - - // operator != - var r6a1 = a1 != b1; - var r6a2 = a2 != b2; - ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. - var r6a3 = a3 != b3; - var r6a4 = a4 != b4; - var r6a5 = a5 != b5; - var r6a6 = a6 != b6; - //var r6a7 = a7 != b7; - - var r6b1 = b1 != a1; - var r6b2 = b2 != a2; - ~~~~~~~~ -!!! Operator '!=' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. - var r6b3 = b3 != a3; - var r6b4 = b4 != a4; - var r6b5 = b5 != a5; - var r6b6 = b6 != a6; - //var r6b7 = b7 != a7; - - // operator === - var r7a1 = a1 === b1; - var r7a2 = a2 === b2; - ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. - var r7a3 = a3 === b3; - var r7a4 = a4 === b4; - var r7a5 = a5 === b5; - var r7a6 = a6 === b6; - //var r7a7 = a7 === b7; - - var r7b1 = b1 === a1; - var r7b2 = b2 === a2; - ~~~~~~~~~ -!!! Operator '===' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. - var r7b3 = b3 === a3; - var r7b4 = b4 === a4; - var r7b5 = b5 === a5; - var r7b6 = b6 === a6; - //var r7b7 = b7 === a7; - - // operator !== - var r8a1 = a1 !== b1; - var r8a2 = a2 !== b2; - ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. - var r8a3 = a3 !== b3; - var r8a4 = a4 !== b4; - var r8a5 = a5 !== b5; - var r8a6 = a6 !== b6; - //var r8a7 = a7 !== b7; - - var r8b1 = b1 !== a1; - var r8b2 = b2 !== a2; - ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. - var r8b3 = b3 !== a3; - var r8b4 = b4 !== a4; - var r8b5 = b5 !== a5; - var r8b6 = b6 !== a6; - //var r8b7 = b7 !== a7; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.types b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.types new file mode 100644 index 00000000000..c3f0d96e839 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.types @@ -0,0 +1,727 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts === +class Base { +>Base : Base + + public a: string; +>a : string +} + +class Derived extends Base { +>Derived : Derived +>Base : Base + + public b: string; +>b : string +} + +var a1: { fn(x: T): T }; +>a1 : { fn(x: T): T; } +>fn : (x: T) => T +>T : T +>x : T +>T : T +>T : T + +var b1: { fn(x: string): string }; +>b1 : { fn(x: string): string; } +>fn : (x: string) => string +>x : string + +var a2: { fn(x: T): T }; +>a2 : { fn(x: T): T; } +>fn : (x: T) => T +>T : T +>x : T +>T : T +>T : T + +var b2: { fn(x: string, y: number): string }; +>b2 : { fn(x: string, y: number): string; } +>fn : (x: string, y: number) => string +>x : string +>y : number + +var a3: { fn(x: T, y: U): T }; +>a3 : { fn(x: T, y: U): T; } +>fn : (x: T, y: U) => T +>T : T +>U : U +>x : T +>T : T +>y : U +>U : U +>T : T + +var b3: { fn(x: string, y: number): string }; +>b3 : { fn(x: string, y: number): string; } +>fn : (x: string, y: number) => string +>x : string +>y : number + +var a4: { fn(x?: T): T }; +>a4 : { fn(x?: T): T; } +>fn : (x?: T) => T +>T : T +>x : T +>T : T +>T : T + +var b4: { fn(x?: string): string }; +>b4 : { fn(x?: string): string; } +>fn : (x?: string) => string +>x : string + +var a5: { fn(...x: T[]): T }; +>a5 : { fn(...x: T[]): T; } +>fn : (...x: T[]) => T +>T : T +>x : T[] +>T : T +>T : T + +var b5: { fn(...x: string[]): string }; +>b5 : { fn(...x: string[]): string; } +>fn : (...x: string[]) => string +>x : string[] + +var a6: { fn(x: T, y: T): T }; +>a6 : { fn(x: T, y: T): T; } +>fn : (x: T, y: T) => T +>T : T +>x : T +>T : T +>y : T +>T : T +>T : T + +var b6: { fn(x: string, y: number): {} }; +>b6 : { fn(x: string, y: number): {}; } +>fn : (x: string, y: number) => {} +>x : string +>y : number + +//var a7: { fn(x: T, y: U): T }; +var b7: { fn(x: Base, y: Derived): Base }; +>b7 : { fn(x: Base, y: Derived): Base; } +>fn : (x: Base, y: Derived) => Base +>x : Base +>Base : Base +>y : Derived +>Derived : Derived +>Base : Base + +// operator < +var r1a1 = a1 < b1; +>r1a1 : boolean +>a1 < b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(x: string): string; } + +var r1a2 = a2 < b2; +>r1a2 : boolean +>a2 < b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string, y: number): string; } + +var r1a3 = a3 < b3; +>r1a3 : boolean +>a3 < b3 : boolean +>a3 : { fn(x: T, y: U): T; } +>b3 : { fn(x: string, y: number): string; } + +var r1a4 = a4 < b4; +>r1a4 : boolean +>a4 < b4 : boolean +>a4 : { fn(x?: T): T; } +>b4 : { fn(x?: string): string; } + +var r1a5 = a5 < b5; +>r1a5 : boolean +>a5 < b5 : boolean +>a5 : { fn(...x: T[]): T; } +>b5 : { fn(...x: string[]): string; } + +var r1a6 = a6 < b6; +>r1a6 : boolean +>a6 < b6 : boolean +>a6 : { fn(x: T, y: T): T; } +>b6 : { fn(x: string, y: number): {}; } + +//var r1a7 = a7 < b7; + +var r1b1 = b1 < a1; +>r1b1 : boolean +>b1 < a1 : boolean +>b1 : { fn(x: string): string; } +>a1 : { fn(x: T): T; } + +var r1b2 = b2 < a2; +>r1b2 : boolean +>b2 < a2 : boolean +>b2 : { fn(x: string, y: number): string; } +>a2 : { fn(x: T): T; } + +var r1b3 = b3 < a3; +>r1b3 : boolean +>b3 < a3 : boolean +>b3 : { fn(x: string, y: number): string; } +>a3 : { fn(x: T, y: U): T; } + +var r1b4 = b4 < a4; +>r1b4 : boolean +>b4 < a4 : boolean +>b4 : { fn(x?: string): string; } +>a4 : { fn(x?: T): T; } + +var r1b5 = b5 < a5; +>r1b5 : boolean +>b5 < a5 : boolean +>b5 : { fn(...x: string[]): string; } +>a5 : { fn(...x: T[]): T; } + +var r1b6 = b6 < a6; +>r1b6 : boolean +>b6 < a6 : boolean +>b6 : { fn(x: string, y: number): {}; } +>a6 : { fn(x: T, y: T): T; } + +//var r1b7 = b7 < a7; + +// operator > +var r2a1 = a1 > b1; +>r2a1 : boolean +>a1 > b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(x: string): string; } + +var r2a2 = a2 > b2; +>r2a2 : boolean +>a2 > b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string, y: number): string; } + +var r2a3 = a3 > b3; +>r2a3 : boolean +>a3 > b3 : boolean +>a3 : { fn(x: T, y: U): T; } +>b3 : { fn(x: string, y: number): string; } + +var r2a4 = a4 > b4; +>r2a4 : boolean +>a4 > b4 : boolean +>a4 : { fn(x?: T): T; } +>b4 : { fn(x?: string): string; } + +var r2a5 = a5 > b5; +>r2a5 : boolean +>a5 > b5 : boolean +>a5 : { fn(...x: T[]): T; } +>b5 : { fn(...x: string[]): string; } + +var r2a6 = a6 > b6; +>r2a6 : boolean +>a6 > b6 : boolean +>a6 : { fn(x: T, y: T): T; } +>b6 : { fn(x: string, y: number): {}; } + +//var r2a7 = a7 > b7; + +var r2b1 = b1 > a1; +>r2b1 : boolean +>b1 > a1 : boolean +>b1 : { fn(x: string): string; } +>a1 : { fn(x: T): T; } + +var r2b2 = b2 > a2; +>r2b2 : boolean +>b2 > a2 : boolean +>b2 : { fn(x: string, y: number): string; } +>a2 : { fn(x: T): T; } + +var r2b3 = b3 > a3; +>r2b3 : boolean +>b3 > a3 : boolean +>b3 : { fn(x: string, y: number): string; } +>a3 : { fn(x: T, y: U): T; } + +var r2b4 = b4 > a4; +>r2b4 : boolean +>b4 > a4 : boolean +>b4 : { fn(x?: string): string; } +>a4 : { fn(x?: T): T; } + +var r2b5 = b5 > a5; +>r2b5 : boolean +>b5 > a5 : boolean +>b5 : { fn(...x: string[]): string; } +>a5 : { fn(...x: T[]): T; } + +var r2b6 = b6 > a6; +>r2b6 : boolean +>b6 > a6 : boolean +>b6 : { fn(x: string, y: number): {}; } +>a6 : { fn(x: T, y: T): T; } + +//var r2b7 = b7 > a7; + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : boolean +>a1 <= b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(x: string): string; } + +var r3a2 = a2 <= b2; +>r3a2 : boolean +>a2 <= b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string, y: number): string; } + +var r3a3 = a3 <= b3; +>r3a3 : boolean +>a3 <= b3 : boolean +>a3 : { fn(x: T, y: U): T; } +>b3 : { fn(x: string, y: number): string; } + +var r3a4 = a4 <= b4; +>r3a4 : boolean +>a4 <= b4 : boolean +>a4 : { fn(x?: T): T; } +>b4 : { fn(x?: string): string; } + +var r3a5 = a5 <= b5; +>r3a5 : boolean +>a5 <= b5 : boolean +>a5 : { fn(...x: T[]): T; } +>b5 : { fn(...x: string[]): string; } + +var r3a6 = a6 <= b6; +>r3a6 : boolean +>a6 <= b6 : boolean +>a6 : { fn(x: T, y: T): T; } +>b6 : { fn(x: string, y: number): {}; } + +//var r3a7 = a7 <= b7; + +var r3b1 = b1 <= a1; +>r3b1 : boolean +>b1 <= a1 : boolean +>b1 : { fn(x: string): string; } +>a1 : { fn(x: T): T; } + +var r3b2 = b2 <= a2; +>r3b2 : boolean +>b2 <= a2 : boolean +>b2 : { fn(x: string, y: number): string; } +>a2 : { fn(x: T): T; } + +var r3b3 = b3 <= a3; +>r3b3 : boolean +>b3 <= a3 : boolean +>b3 : { fn(x: string, y: number): string; } +>a3 : { fn(x: T, y: U): T; } + +var r3b4 = b4 <= a4; +>r3b4 : boolean +>b4 <= a4 : boolean +>b4 : { fn(x?: string): string; } +>a4 : { fn(x?: T): T; } + +var r3b5 = b5 <= a5; +>r3b5 : boolean +>b5 <= a5 : boolean +>b5 : { fn(...x: string[]): string; } +>a5 : { fn(...x: T[]): T; } + +var r3b6 = b6 <= a6; +>r3b6 : boolean +>b6 <= a6 : boolean +>b6 : { fn(x: string, y: number): {}; } +>a6 : { fn(x: T, y: T): T; } + +//var r3b7 = b7 <= a7; + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : boolean +>a1 >= b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(x: string): string; } + +var r4a2 = a2 >= b2; +>r4a2 : boolean +>a2 >= b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string, y: number): string; } + +var r4a3 = a3 >= b3; +>r4a3 : boolean +>a3 >= b3 : boolean +>a3 : { fn(x: T, y: U): T; } +>b3 : { fn(x: string, y: number): string; } + +var r4a4 = a4 >= b4; +>r4a4 : boolean +>a4 >= b4 : boolean +>a4 : { fn(x?: T): T; } +>b4 : { fn(x?: string): string; } + +var r4a5 = a5 >= b5; +>r4a5 : boolean +>a5 >= b5 : boolean +>a5 : { fn(...x: T[]): T; } +>b5 : { fn(...x: string[]): string; } + +var r4a6 = a6 >= b6; +>r4a6 : boolean +>a6 >= b6 : boolean +>a6 : { fn(x: T, y: T): T; } +>b6 : { fn(x: string, y: number): {}; } + +//var r4a7 = a7 >= b7; + +var r4b1 = b1 >= a1; +>r4b1 : boolean +>b1 >= a1 : boolean +>b1 : { fn(x: string): string; } +>a1 : { fn(x: T): T; } + +var r4b2 = b2 >= a2; +>r4b2 : boolean +>b2 >= a2 : boolean +>b2 : { fn(x: string, y: number): string; } +>a2 : { fn(x: T): T; } + +var r4b3 = b3 >= a3; +>r4b3 : boolean +>b3 >= a3 : boolean +>b3 : { fn(x: string, y: number): string; } +>a3 : { fn(x: T, y: U): T; } + +var r4b4 = b4 >= a4; +>r4b4 : boolean +>b4 >= a4 : boolean +>b4 : { fn(x?: string): string; } +>a4 : { fn(x?: T): T; } + +var r4b5 = b5 >= a5; +>r4b5 : boolean +>b5 >= a5 : boolean +>b5 : { fn(...x: string[]): string; } +>a5 : { fn(...x: T[]): T; } + +var r4b6 = b6 >= a6; +>r4b6 : boolean +>b6 >= a6 : boolean +>b6 : { fn(x: string, y: number): {}; } +>a6 : { fn(x: T, y: T): T; } + +//var r4b7 = b7 >= a7; + +// operator == +var r5a1 = a1 == b1; +>r5a1 : boolean +>a1 == b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(x: string): string; } + +var r5a2 = a2 == b2; +>r5a2 : boolean +>a2 == b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string, y: number): string; } + +var r5a3 = a3 == b3; +>r5a3 : boolean +>a3 == b3 : boolean +>a3 : { fn(x: T, y: U): T; } +>b3 : { fn(x: string, y: number): string; } + +var r5a4 = a4 == b4; +>r5a4 : boolean +>a4 == b4 : boolean +>a4 : { fn(x?: T): T; } +>b4 : { fn(x?: string): string; } + +var r5a5 = a5 == b5; +>r5a5 : boolean +>a5 == b5 : boolean +>a5 : { fn(...x: T[]): T; } +>b5 : { fn(...x: string[]): string; } + +var r5a6 = a6 == b6; +>r5a6 : boolean +>a6 == b6 : boolean +>a6 : { fn(x: T, y: T): T; } +>b6 : { fn(x: string, y: number): {}; } + +//var r5a7 = a7 == b7; + +var r5b1 = b1 == a1; +>r5b1 : boolean +>b1 == a1 : boolean +>b1 : { fn(x: string): string; } +>a1 : { fn(x: T): T; } + +var r5b2 = b2 == a2; +>r5b2 : boolean +>b2 == a2 : boolean +>b2 : { fn(x: string, y: number): string; } +>a2 : { fn(x: T): T; } + +var r5b3 = b3 == a3; +>r5b3 : boolean +>b3 == a3 : boolean +>b3 : { fn(x: string, y: number): string; } +>a3 : { fn(x: T, y: U): T; } + +var r5b4 = b4 == a4; +>r5b4 : boolean +>b4 == a4 : boolean +>b4 : { fn(x?: string): string; } +>a4 : { fn(x?: T): T; } + +var r5b5 = b5 == a5; +>r5b5 : boolean +>b5 == a5 : boolean +>b5 : { fn(...x: string[]): string; } +>a5 : { fn(...x: T[]): T; } + +var r5b6 = b6 == a6; +>r5b6 : boolean +>b6 == a6 : boolean +>b6 : { fn(x: string, y: number): {}; } +>a6 : { fn(x: T, y: T): T; } + +//var r5b7 = b7 == a7; + +// operator != +var r6a1 = a1 != b1; +>r6a1 : boolean +>a1 != b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(x: string): string; } + +var r6a2 = a2 != b2; +>r6a2 : boolean +>a2 != b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string, y: number): string; } + +var r6a3 = a3 != b3; +>r6a3 : boolean +>a3 != b3 : boolean +>a3 : { fn(x: T, y: U): T; } +>b3 : { fn(x: string, y: number): string; } + +var r6a4 = a4 != b4; +>r6a4 : boolean +>a4 != b4 : boolean +>a4 : { fn(x?: T): T; } +>b4 : { fn(x?: string): string; } + +var r6a5 = a5 != b5; +>r6a5 : boolean +>a5 != b5 : boolean +>a5 : { fn(...x: T[]): T; } +>b5 : { fn(...x: string[]): string; } + +var r6a6 = a6 != b6; +>r6a6 : boolean +>a6 != b6 : boolean +>a6 : { fn(x: T, y: T): T; } +>b6 : { fn(x: string, y: number): {}; } + +//var r6a7 = a7 != b7; + +var r6b1 = b1 != a1; +>r6b1 : boolean +>b1 != a1 : boolean +>b1 : { fn(x: string): string; } +>a1 : { fn(x: T): T; } + +var r6b2 = b2 != a2; +>r6b2 : boolean +>b2 != a2 : boolean +>b2 : { fn(x: string, y: number): string; } +>a2 : { fn(x: T): T; } + +var r6b3 = b3 != a3; +>r6b3 : boolean +>b3 != a3 : boolean +>b3 : { fn(x: string, y: number): string; } +>a3 : { fn(x: T, y: U): T; } + +var r6b4 = b4 != a4; +>r6b4 : boolean +>b4 != a4 : boolean +>b4 : { fn(x?: string): string; } +>a4 : { fn(x?: T): T; } + +var r6b5 = b5 != a5; +>r6b5 : boolean +>b5 != a5 : boolean +>b5 : { fn(...x: string[]): string; } +>a5 : { fn(...x: T[]): T; } + +var r6b6 = b6 != a6; +>r6b6 : boolean +>b6 != a6 : boolean +>b6 : { fn(x: string, y: number): {}; } +>a6 : { fn(x: T, y: T): T; } + +//var r6b7 = b7 != a7; + +// operator === +var r7a1 = a1 === b1; +>r7a1 : boolean +>a1 === b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(x: string): string; } + +var r7a2 = a2 === b2; +>r7a2 : boolean +>a2 === b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string, y: number): string; } + +var r7a3 = a3 === b3; +>r7a3 : boolean +>a3 === b3 : boolean +>a3 : { fn(x: T, y: U): T; } +>b3 : { fn(x: string, y: number): string; } + +var r7a4 = a4 === b4; +>r7a4 : boolean +>a4 === b4 : boolean +>a4 : { fn(x?: T): T; } +>b4 : { fn(x?: string): string; } + +var r7a5 = a5 === b5; +>r7a5 : boolean +>a5 === b5 : boolean +>a5 : { fn(...x: T[]): T; } +>b5 : { fn(...x: string[]): string; } + +var r7a6 = a6 === b6; +>r7a6 : boolean +>a6 === b6 : boolean +>a6 : { fn(x: T, y: T): T; } +>b6 : { fn(x: string, y: number): {}; } + +//var r7a7 = a7 === b7; + +var r7b1 = b1 === a1; +>r7b1 : boolean +>b1 === a1 : boolean +>b1 : { fn(x: string): string; } +>a1 : { fn(x: T): T; } + +var r7b2 = b2 === a2; +>r7b2 : boolean +>b2 === a2 : boolean +>b2 : { fn(x: string, y: number): string; } +>a2 : { fn(x: T): T; } + +var r7b3 = b3 === a3; +>r7b3 : boolean +>b3 === a3 : boolean +>b3 : { fn(x: string, y: number): string; } +>a3 : { fn(x: T, y: U): T; } + +var r7b4 = b4 === a4; +>r7b4 : boolean +>b4 === a4 : boolean +>b4 : { fn(x?: string): string; } +>a4 : { fn(x?: T): T; } + +var r7b5 = b5 === a5; +>r7b5 : boolean +>b5 === a5 : boolean +>b5 : { fn(...x: string[]): string; } +>a5 : { fn(...x: T[]): T; } + +var r7b6 = b6 === a6; +>r7b6 : boolean +>b6 === a6 : boolean +>b6 : { fn(x: string, y: number): {}; } +>a6 : { fn(x: T, y: T): T; } + +//var r7b7 = b7 === a7; + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : boolean +>a1 !== b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(x: string): string; } + +var r8a2 = a2 !== b2; +>r8a2 : boolean +>a2 !== b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string, y: number): string; } + +var r8a3 = a3 !== b3; +>r8a3 : boolean +>a3 !== b3 : boolean +>a3 : { fn(x: T, y: U): T; } +>b3 : { fn(x: string, y: number): string; } + +var r8a4 = a4 !== b4; +>r8a4 : boolean +>a4 !== b4 : boolean +>a4 : { fn(x?: T): T; } +>b4 : { fn(x?: string): string; } + +var r8a5 = a5 !== b5; +>r8a5 : boolean +>a5 !== b5 : boolean +>a5 : { fn(...x: T[]): T; } +>b5 : { fn(...x: string[]): string; } + +var r8a6 = a6 !== b6; +>r8a6 : boolean +>a6 !== b6 : boolean +>a6 : { fn(x: T, y: T): T; } +>b6 : { fn(x: string, y: number): {}; } + +//var r8a7 = a7 !== b7; + +var r8b1 = b1 !== a1; +>r8b1 : boolean +>b1 !== a1 : boolean +>b1 : { fn(x: string): string; } +>a1 : { fn(x: T): T; } + +var r8b2 = b2 !== a2; +>r8b2 : boolean +>b2 !== a2 : boolean +>b2 : { fn(x: string, y: number): string; } +>a2 : { fn(x: T): T; } + +var r8b3 = b3 !== a3; +>r8b3 : boolean +>b3 !== a3 : boolean +>b3 : { fn(x: string, y: number): string; } +>a3 : { fn(x: T, y: U): T; } + +var r8b4 = b4 !== a4; +>r8b4 : boolean +>b4 !== a4 : boolean +>b4 : { fn(x?: string): string; } +>a4 : { fn(x?: T): T; } + +var r8b5 = b5 !== a5; +>r8b5 : boolean +>b5 !== a5 : boolean +>b5 : { fn(...x: string[]): string; } +>a5 : { fn(...x: T[]): T; } + +var r8b6 = b6 !== a6; +>r8b6 : boolean +>b6 !== a6 : boolean +>b6 : { fn(x: string, y: number): {}; } +>a6 : { fn(x: T, y: T): T; } + +//var r8b7 = b7 !== a7; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.errors.txt deleted file mode 100644 index 573322f8d66..00000000000 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.errors.txt +++ /dev/null @@ -1,197 +0,0 @@ -==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts (16 errors) ==== - class Base { - public a: string; - } - - class Derived extends Base { - public b: string; - } - - var a1: { new (x: T): T }; - var b1: { new (x: string): string }; - - var a2: { new (x: T): T }; - var b2: { new (x: string, y: number): string }; - - var a3: { new (x: T, y: U): T }; - var b3: { new (x: string, y: number): string }; - - var a4: { new (x?: T): T }; - var b4: { new (x?: string): string }; - - var a5: { new (...x: T[]): T }; - var b5: { new (...x: string[]): string }; - - var a6: { new (x: T, y: T): T }; - var b6: { new (x: string, y: number): {} }; - - //var a7: { new (x: T, y: U): T }; - var b7: { new (x: Base, y: Derived): Base }; - - // operator < - var r1a1 = a1 < b1; - var r1a2 = a2 < b2; - ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. - var r1a3 = a3 < b3; - var r1a4 = a4 < b4; - var r1a5 = a5 < b5; - var r1a6 = a6 < b6; - //var r1a7 = a7 < b7; - - var r1b1 = b1 < a1; - var r1b2 = b2 < a2; - ~~~~~~~ -!!! Operator '<' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. - var r1b3 = b3 < a3; - var r1b4 = b4 < a4; - var r1b5 = b5 < a5; - var r1b6 = b6 < a6; - //var r1b7 = b7 < a7; - - // operator > - var r2a1 = a1 > b1; - var r2a2 = a2 > b2; - ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. - var r2a3 = a3 > b3; - var r2a4 = a4 > b4; - var r2a5 = a5 > b5; - var r2a6 = a6 > b6; - //var r2a7 = a7 > b7; - - var r2b1 = b1 > a1; - var r2b2 = b2 > a2; - ~~~~~~~ -!!! Operator '>' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. - var r2b3 = b3 > a3; - var r2b4 = b4 > a4; - var r2b5 = b5 > a5; - var r2b6 = b6 > a6; - //var r2b7 = b7 > a7; - - // operator <= - var r3a1 = a1 <= b1; - var r3a2 = a2 <= b2; - ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. - var r3a3 = a3 <= b3; - var r3a4 = a4 <= b4; - var r3a5 = a5 <= b5; - var r3a6 = a6 <= b6; - //var r3a7 = a7 <= b7; - - var r3b1 = b1 <= a1; - var r3b2 = b2 <= a2; - ~~~~~~~~ -!!! Operator '<=' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. - var r3b3 = b3 <= a3; - var r3b4 = b4 <= a4; - var r3b5 = b5 <= a5; - var r3b6 = b6 <= a6; - //var r3b7 = b7 <= a7; - - // operator >= - var r4a1 = a1 >= b1; - var r4a2 = a2 >= b2; - ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. - var r4a3 = a3 >= b3; - var r4a4 = a4 >= b4; - var r4a5 = a5 >= b5; - var r4a6 = a6 >= b6; - //var r4a7 = a7 >= b7; - - var r4b1 = b1 >= a1; - var r4b2 = b2 >= a2; - ~~~~~~~~ -!!! Operator '>=' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. - var r4b3 = b3 >= a3; - var r4b4 = b4 >= a4; - var r4b5 = b5 >= a5; - var r4b6 = b6 >= a6; - //var r4b7 = b7 >= a7; - - // operator == - var r5a1 = a1 == b1; - var r5a2 = a2 == b2; - ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. - var r5a3 = a3 == b3; - var r5a4 = a4 == b4; - var r5a5 = a5 == b5; - var r5a6 = a6 == b6; - //var r5a7 = a7 == b7; - - var r5b1 = b1 == a1; - var r5b2 = b2 == a2; - ~~~~~~~~ -!!! Operator '==' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. - var r5b3 = b3 == a3; - var r5b4 = b4 == a4; - var r5b5 = b5 == a5; - var r5b6 = b6 == a6; - //var r5b7 = b7 == a7; - - // operator != - var r6a1 = a1 != b1; - var r6a2 = a2 != b2; - ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. - var r6a3 = a3 != b3; - var r6a4 = a4 != b4; - var r6a5 = a5 != b5; - var r6a6 = a6 != b6; - //var r6a7 = a7 != b7; - - var r6b1 = b1 != a1; - var r6b2 = b2 != a2; - ~~~~~~~~ -!!! Operator '!=' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. - var r6b3 = b3 != a3; - var r6b4 = b4 != a4; - var r6b5 = b5 != a5; - var r6b6 = b6 != a6; - //var r6b7 = b7 != a7; - - // operator === - var r7a1 = a1 === b1; - var r7a2 = a2 === b2; - ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. - var r7a3 = a3 === b3; - var r7a4 = a4 === b4; - var r7a5 = a5 === b5; - var r7a6 = a6 === b6; - //var r7a7 = a7 === b7; - - var r7b1 = b1 === a1; - var r7b2 = b2 === a2; - ~~~~~~~~~ -!!! Operator '===' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. - var r7b3 = b3 === a3; - var r7b4 = b4 === a4; - var r7b5 = b5 === a5; - var r7b6 = b6 === a6; - //var r7b7 = b7 === a7; - - // operator !== - var r8a1 = a1 !== b1; - var r8a2 = a2 !== b2; - ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. - var r8a3 = a3 !== b3; - var r8a4 = a4 !== b4; - var r8a5 = a5 !== b5; - var r8a6 = a6 !== b6; - //var r8a7 = a7 !== b7; - - var r8b1 = b1 !== a1; - var r8b2 = b2 !== a2; - ~~~~~~~~~ -!!! Operator '!==' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. - var r8b3 = b3 !== a3; - var r8b4 = b4 !== a4; - var r8b5 = b5 !== a5; - var r8b6 = b6 !== a6; - //var r8b7 = b7 !== a7; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.types b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.types new file mode 100644 index 00000000000..29d92c25726 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.types @@ -0,0 +1,714 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts === +class Base { +>Base : Base + + public a: string; +>a : string +} + +class Derived extends Base { +>Derived : Derived +>Base : Base + + public b: string; +>b : string +} + +var a1: { new (x: T): T }; +>a1 : new (x: T) => T +>T : T +>x : T +>T : T +>T : T + +var b1: { new (x: string): string }; +>b1 : new (x: string) => string +>x : string + +var a2: { new (x: T): T }; +>a2 : new (x: T) => T +>T : T +>x : T +>T : T +>T : T + +var b2: { new (x: string, y: number): string }; +>b2 : new (x: string, y: number) => string +>x : string +>y : number + +var a3: { new (x: T, y: U): T }; +>a3 : new (x: T, y: U) => T +>T : T +>U : U +>x : T +>T : T +>y : U +>U : U +>T : T + +var b3: { new (x: string, y: number): string }; +>b3 : new (x: string, y: number) => string +>x : string +>y : number + +var a4: { new (x?: T): T }; +>a4 : new (x?: T) => T +>T : T +>x : T +>T : T +>T : T + +var b4: { new (x?: string): string }; +>b4 : new (x?: string) => string +>x : string + +var a5: { new (...x: T[]): T }; +>a5 : new (...x: T[]) => T +>T : T +>x : T[] +>T : T +>T : T + +var b5: { new (...x: string[]): string }; +>b5 : new (...x: string[]) => string +>x : string[] + +var a6: { new (x: T, y: T): T }; +>a6 : new (x: T, y: T) => T +>T : T +>x : T +>T : T +>y : T +>T : T +>T : T + +var b6: { new (x: string, y: number): {} }; +>b6 : new (x: string, y: number) => {} +>x : string +>y : number + +//var a7: { new (x: T, y: U): T }; +var b7: { new (x: Base, y: Derived): Base }; +>b7 : new (x: Base, y: Derived) => Base +>x : Base +>Base : Base +>y : Derived +>Derived : Derived +>Base : Base + +// operator < +var r1a1 = a1 < b1; +>r1a1 : boolean +>a1 < b1 : boolean +>a1 : new (x: T) => T +>b1 : new (x: string) => string + +var r1a2 = a2 < b2; +>r1a2 : boolean +>a2 < b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string, y: number) => string + +var r1a3 = a3 < b3; +>r1a3 : boolean +>a3 < b3 : boolean +>a3 : new (x: T, y: U) => T +>b3 : new (x: string, y: number) => string + +var r1a4 = a4 < b4; +>r1a4 : boolean +>a4 < b4 : boolean +>a4 : new (x?: T) => T +>b4 : new (x?: string) => string + +var r1a5 = a5 < b5; +>r1a5 : boolean +>a5 < b5 : boolean +>a5 : new (...x: T[]) => T +>b5 : new (...x: string[]) => string + +var r1a6 = a6 < b6; +>r1a6 : boolean +>a6 < b6 : boolean +>a6 : new (x: T, y: T) => T +>b6 : new (x: string, y: number) => {} + +//var r1a7 = a7 < b7; + +var r1b1 = b1 < a1; +>r1b1 : boolean +>b1 < a1 : boolean +>b1 : new (x: string) => string +>a1 : new (x: T) => T + +var r1b2 = b2 < a2; +>r1b2 : boolean +>b2 < a2 : boolean +>b2 : new (x: string, y: number) => string +>a2 : new (x: T) => T + +var r1b3 = b3 < a3; +>r1b3 : boolean +>b3 < a3 : boolean +>b3 : new (x: string, y: number) => string +>a3 : new (x: T, y: U) => T + +var r1b4 = b4 < a4; +>r1b4 : boolean +>b4 < a4 : boolean +>b4 : new (x?: string) => string +>a4 : new (x?: T) => T + +var r1b5 = b5 < a5; +>r1b5 : boolean +>b5 < a5 : boolean +>b5 : new (...x: string[]) => string +>a5 : new (...x: T[]) => T + +var r1b6 = b6 < a6; +>r1b6 : boolean +>b6 < a6 : boolean +>b6 : new (x: string, y: number) => {} +>a6 : new (x: T, y: T) => T + +//var r1b7 = b7 < a7; + +// operator > +var r2a1 = a1 > b1; +>r2a1 : boolean +>a1 > b1 : boolean +>a1 : new (x: T) => T +>b1 : new (x: string) => string + +var r2a2 = a2 > b2; +>r2a2 : boolean +>a2 > b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string, y: number) => string + +var r2a3 = a3 > b3; +>r2a3 : boolean +>a3 > b3 : boolean +>a3 : new (x: T, y: U) => T +>b3 : new (x: string, y: number) => string + +var r2a4 = a4 > b4; +>r2a4 : boolean +>a4 > b4 : boolean +>a4 : new (x?: T) => T +>b4 : new (x?: string) => string + +var r2a5 = a5 > b5; +>r2a5 : boolean +>a5 > b5 : boolean +>a5 : new (...x: T[]) => T +>b5 : new (...x: string[]) => string + +var r2a6 = a6 > b6; +>r2a6 : boolean +>a6 > b6 : boolean +>a6 : new (x: T, y: T) => T +>b6 : new (x: string, y: number) => {} + +//var r2a7 = a7 > b7; + +var r2b1 = b1 > a1; +>r2b1 : boolean +>b1 > a1 : boolean +>b1 : new (x: string) => string +>a1 : new (x: T) => T + +var r2b2 = b2 > a2; +>r2b2 : boolean +>b2 > a2 : boolean +>b2 : new (x: string, y: number) => string +>a2 : new (x: T) => T + +var r2b3 = b3 > a3; +>r2b3 : boolean +>b3 > a3 : boolean +>b3 : new (x: string, y: number) => string +>a3 : new (x: T, y: U) => T + +var r2b4 = b4 > a4; +>r2b4 : boolean +>b4 > a4 : boolean +>b4 : new (x?: string) => string +>a4 : new (x?: T) => T + +var r2b5 = b5 > a5; +>r2b5 : boolean +>b5 > a5 : boolean +>b5 : new (...x: string[]) => string +>a5 : new (...x: T[]) => T + +var r2b6 = b6 > a6; +>r2b6 : boolean +>b6 > a6 : boolean +>b6 : new (x: string, y: number) => {} +>a6 : new (x: T, y: T) => T + +//var r2b7 = b7 > a7; + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : boolean +>a1 <= b1 : boolean +>a1 : new (x: T) => T +>b1 : new (x: string) => string + +var r3a2 = a2 <= b2; +>r3a2 : boolean +>a2 <= b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string, y: number) => string + +var r3a3 = a3 <= b3; +>r3a3 : boolean +>a3 <= b3 : boolean +>a3 : new (x: T, y: U) => T +>b3 : new (x: string, y: number) => string + +var r3a4 = a4 <= b4; +>r3a4 : boolean +>a4 <= b4 : boolean +>a4 : new (x?: T) => T +>b4 : new (x?: string) => string + +var r3a5 = a5 <= b5; +>r3a5 : boolean +>a5 <= b5 : boolean +>a5 : new (...x: T[]) => T +>b5 : new (...x: string[]) => string + +var r3a6 = a6 <= b6; +>r3a6 : boolean +>a6 <= b6 : boolean +>a6 : new (x: T, y: T) => T +>b6 : new (x: string, y: number) => {} + +//var r3a7 = a7 <= b7; + +var r3b1 = b1 <= a1; +>r3b1 : boolean +>b1 <= a1 : boolean +>b1 : new (x: string) => string +>a1 : new (x: T) => T + +var r3b2 = b2 <= a2; +>r3b2 : boolean +>b2 <= a2 : boolean +>b2 : new (x: string, y: number) => string +>a2 : new (x: T) => T + +var r3b3 = b3 <= a3; +>r3b3 : boolean +>b3 <= a3 : boolean +>b3 : new (x: string, y: number) => string +>a3 : new (x: T, y: U) => T + +var r3b4 = b4 <= a4; +>r3b4 : boolean +>b4 <= a4 : boolean +>b4 : new (x?: string) => string +>a4 : new (x?: T) => T + +var r3b5 = b5 <= a5; +>r3b5 : boolean +>b5 <= a5 : boolean +>b5 : new (...x: string[]) => string +>a5 : new (...x: T[]) => T + +var r3b6 = b6 <= a6; +>r3b6 : boolean +>b6 <= a6 : boolean +>b6 : new (x: string, y: number) => {} +>a6 : new (x: T, y: T) => T + +//var r3b7 = b7 <= a7; + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : boolean +>a1 >= b1 : boolean +>a1 : new (x: T) => T +>b1 : new (x: string) => string + +var r4a2 = a2 >= b2; +>r4a2 : boolean +>a2 >= b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string, y: number) => string + +var r4a3 = a3 >= b3; +>r4a3 : boolean +>a3 >= b3 : boolean +>a3 : new (x: T, y: U) => T +>b3 : new (x: string, y: number) => string + +var r4a4 = a4 >= b4; +>r4a4 : boolean +>a4 >= b4 : boolean +>a4 : new (x?: T) => T +>b4 : new (x?: string) => string + +var r4a5 = a5 >= b5; +>r4a5 : boolean +>a5 >= b5 : boolean +>a5 : new (...x: T[]) => T +>b5 : new (...x: string[]) => string + +var r4a6 = a6 >= b6; +>r4a6 : boolean +>a6 >= b6 : boolean +>a6 : new (x: T, y: T) => T +>b6 : new (x: string, y: number) => {} + +//var r4a7 = a7 >= b7; + +var r4b1 = b1 >= a1; +>r4b1 : boolean +>b1 >= a1 : boolean +>b1 : new (x: string) => string +>a1 : new (x: T) => T + +var r4b2 = b2 >= a2; +>r4b2 : boolean +>b2 >= a2 : boolean +>b2 : new (x: string, y: number) => string +>a2 : new (x: T) => T + +var r4b3 = b3 >= a3; +>r4b3 : boolean +>b3 >= a3 : boolean +>b3 : new (x: string, y: number) => string +>a3 : new (x: T, y: U) => T + +var r4b4 = b4 >= a4; +>r4b4 : boolean +>b4 >= a4 : boolean +>b4 : new (x?: string) => string +>a4 : new (x?: T) => T + +var r4b5 = b5 >= a5; +>r4b5 : boolean +>b5 >= a5 : boolean +>b5 : new (...x: string[]) => string +>a5 : new (...x: T[]) => T + +var r4b6 = b6 >= a6; +>r4b6 : boolean +>b6 >= a6 : boolean +>b6 : new (x: string, y: number) => {} +>a6 : new (x: T, y: T) => T + +//var r4b7 = b7 >= a7; + +// operator == +var r5a1 = a1 == b1; +>r5a1 : boolean +>a1 == b1 : boolean +>a1 : new (x: T) => T +>b1 : new (x: string) => string + +var r5a2 = a2 == b2; +>r5a2 : boolean +>a2 == b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string, y: number) => string + +var r5a3 = a3 == b3; +>r5a3 : boolean +>a3 == b3 : boolean +>a3 : new (x: T, y: U) => T +>b3 : new (x: string, y: number) => string + +var r5a4 = a4 == b4; +>r5a4 : boolean +>a4 == b4 : boolean +>a4 : new (x?: T) => T +>b4 : new (x?: string) => string + +var r5a5 = a5 == b5; +>r5a5 : boolean +>a5 == b5 : boolean +>a5 : new (...x: T[]) => T +>b5 : new (...x: string[]) => string + +var r5a6 = a6 == b6; +>r5a6 : boolean +>a6 == b6 : boolean +>a6 : new (x: T, y: T) => T +>b6 : new (x: string, y: number) => {} + +//var r5a7 = a7 == b7; + +var r5b1 = b1 == a1; +>r5b1 : boolean +>b1 == a1 : boolean +>b1 : new (x: string) => string +>a1 : new (x: T) => T + +var r5b2 = b2 == a2; +>r5b2 : boolean +>b2 == a2 : boolean +>b2 : new (x: string, y: number) => string +>a2 : new (x: T) => T + +var r5b3 = b3 == a3; +>r5b3 : boolean +>b3 == a3 : boolean +>b3 : new (x: string, y: number) => string +>a3 : new (x: T, y: U) => T + +var r5b4 = b4 == a4; +>r5b4 : boolean +>b4 == a4 : boolean +>b4 : new (x?: string) => string +>a4 : new (x?: T) => T + +var r5b5 = b5 == a5; +>r5b5 : boolean +>b5 == a5 : boolean +>b5 : new (...x: string[]) => string +>a5 : new (...x: T[]) => T + +var r5b6 = b6 == a6; +>r5b6 : boolean +>b6 == a6 : boolean +>b6 : new (x: string, y: number) => {} +>a6 : new (x: T, y: T) => T + +//var r5b7 = b7 == a7; + +// operator != +var r6a1 = a1 != b1; +>r6a1 : boolean +>a1 != b1 : boolean +>a1 : new (x: T) => T +>b1 : new (x: string) => string + +var r6a2 = a2 != b2; +>r6a2 : boolean +>a2 != b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string, y: number) => string + +var r6a3 = a3 != b3; +>r6a3 : boolean +>a3 != b3 : boolean +>a3 : new (x: T, y: U) => T +>b3 : new (x: string, y: number) => string + +var r6a4 = a4 != b4; +>r6a4 : boolean +>a4 != b4 : boolean +>a4 : new (x?: T) => T +>b4 : new (x?: string) => string + +var r6a5 = a5 != b5; +>r6a5 : boolean +>a5 != b5 : boolean +>a5 : new (...x: T[]) => T +>b5 : new (...x: string[]) => string + +var r6a6 = a6 != b6; +>r6a6 : boolean +>a6 != b6 : boolean +>a6 : new (x: T, y: T) => T +>b6 : new (x: string, y: number) => {} + +//var r6a7 = a7 != b7; + +var r6b1 = b1 != a1; +>r6b1 : boolean +>b1 != a1 : boolean +>b1 : new (x: string) => string +>a1 : new (x: T) => T + +var r6b2 = b2 != a2; +>r6b2 : boolean +>b2 != a2 : boolean +>b2 : new (x: string, y: number) => string +>a2 : new (x: T) => T + +var r6b3 = b3 != a3; +>r6b3 : boolean +>b3 != a3 : boolean +>b3 : new (x: string, y: number) => string +>a3 : new (x: T, y: U) => T + +var r6b4 = b4 != a4; +>r6b4 : boolean +>b4 != a4 : boolean +>b4 : new (x?: string) => string +>a4 : new (x?: T) => T + +var r6b5 = b5 != a5; +>r6b5 : boolean +>b5 != a5 : boolean +>b5 : new (...x: string[]) => string +>a5 : new (...x: T[]) => T + +var r6b6 = b6 != a6; +>r6b6 : boolean +>b6 != a6 : boolean +>b6 : new (x: string, y: number) => {} +>a6 : new (x: T, y: T) => T + +//var r6b7 = b7 != a7; + +// operator === +var r7a1 = a1 === b1; +>r7a1 : boolean +>a1 === b1 : boolean +>a1 : new (x: T) => T +>b1 : new (x: string) => string + +var r7a2 = a2 === b2; +>r7a2 : boolean +>a2 === b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string, y: number) => string + +var r7a3 = a3 === b3; +>r7a3 : boolean +>a3 === b3 : boolean +>a3 : new (x: T, y: U) => T +>b3 : new (x: string, y: number) => string + +var r7a4 = a4 === b4; +>r7a4 : boolean +>a4 === b4 : boolean +>a4 : new (x?: T) => T +>b4 : new (x?: string) => string + +var r7a5 = a5 === b5; +>r7a5 : boolean +>a5 === b5 : boolean +>a5 : new (...x: T[]) => T +>b5 : new (...x: string[]) => string + +var r7a6 = a6 === b6; +>r7a6 : boolean +>a6 === b6 : boolean +>a6 : new (x: T, y: T) => T +>b6 : new (x: string, y: number) => {} + +//var r7a7 = a7 === b7; + +var r7b1 = b1 === a1; +>r7b1 : boolean +>b1 === a1 : boolean +>b1 : new (x: string) => string +>a1 : new (x: T) => T + +var r7b2 = b2 === a2; +>r7b2 : boolean +>b2 === a2 : boolean +>b2 : new (x: string, y: number) => string +>a2 : new (x: T) => T + +var r7b3 = b3 === a3; +>r7b3 : boolean +>b3 === a3 : boolean +>b3 : new (x: string, y: number) => string +>a3 : new (x: T, y: U) => T + +var r7b4 = b4 === a4; +>r7b4 : boolean +>b4 === a4 : boolean +>b4 : new (x?: string) => string +>a4 : new (x?: T) => T + +var r7b5 = b5 === a5; +>r7b5 : boolean +>b5 === a5 : boolean +>b5 : new (...x: string[]) => string +>a5 : new (...x: T[]) => T + +var r7b6 = b6 === a6; +>r7b6 : boolean +>b6 === a6 : boolean +>b6 : new (x: string, y: number) => {} +>a6 : new (x: T, y: T) => T + +//var r7b7 = b7 === a7; + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : boolean +>a1 !== b1 : boolean +>a1 : new (x: T) => T +>b1 : new (x: string) => string + +var r8a2 = a2 !== b2; +>r8a2 : boolean +>a2 !== b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string, y: number) => string + +var r8a3 = a3 !== b3; +>r8a3 : boolean +>a3 !== b3 : boolean +>a3 : new (x: T, y: U) => T +>b3 : new (x: string, y: number) => string + +var r8a4 = a4 !== b4; +>r8a4 : boolean +>a4 !== b4 : boolean +>a4 : new (x?: T) => T +>b4 : new (x?: string) => string + +var r8a5 = a5 !== b5; +>r8a5 : boolean +>a5 !== b5 : boolean +>a5 : new (...x: T[]) => T +>b5 : new (...x: string[]) => string + +var r8a6 = a6 !== b6; +>r8a6 : boolean +>a6 !== b6 : boolean +>a6 : new (x: T, y: T) => T +>b6 : new (x: string, y: number) => {} + +//var r8a7 = a7 !== b7; + +var r8b1 = b1 !== a1; +>r8b1 : boolean +>b1 !== a1 : boolean +>b1 : new (x: string) => string +>a1 : new (x: T) => T + +var r8b2 = b2 !== a2; +>r8b2 : boolean +>b2 !== a2 : boolean +>b2 : new (x: string, y: number) => string +>a2 : new (x: T) => T + +var r8b3 = b3 !== a3; +>r8b3 : boolean +>b3 !== a3 : boolean +>b3 : new (x: string, y: number) => string +>a3 : new (x: T, y: U) => T + +var r8b4 = b4 !== a4; +>r8b4 : boolean +>b4 !== a4 : boolean +>b4 : new (x?: string) => string +>a4 : new (x?: T) => T + +var r8b5 = b5 !== a5; +>r8b5 : boolean +>b5 !== a5 : boolean +>b5 : new (...x: string[]) => string +>a5 : new (...x: T[]) => T + +var r8b6 = b6 !== a6; +>r8b6 : boolean +>b6 !== a6 : boolean +>b6 : new (x: string, y: number) => {} +>a6 : new (x: T, y: T) => T + +//var r8b7 = b7 !== a7; diff --git a/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt b/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt index 139efbbfc99..e8193e91a0f 100644 --- a/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt @@ -1,3 +1,37 @@ +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(6,15): error TS2365: Operator '<' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(7,15): error TS2365: Operator '>' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(8,15): error TS2365: Operator '<=' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(9,15): error TS2365: Operator '>=' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(10,15): error TS2365: Operator '==' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(11,15): error TS2365: Operator '!=' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(12,15): error TS2365: Operator '===' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(13,15): error TS2365: Operator '!==' cannot be applied to types 'T' and 'U'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(15,15): error TS2365: Operator '<' cannot be applied to types 'U' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(16,15): error TS2365: Operator '>' cannot be applied to types 'U' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(17,15): error TS2365: Operator '<=' cannot be applied to types 'U' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(18,15): error TS2365: Operator '>=' cannot be applied to types 'U' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(19,15): error TS2365: Operator '==' cannot be applied to types 'U' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(20,15): error TS2365: Operator '!=' cannot be applied to types 'U' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(21,15): error TS2365: Operator '===' cannot be applied to types 'U' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(22,15): error TS2365: Operator '!==' cannot be applied to types 'U' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(24,15): error TS2365: Operator '<' cannot be applied to types 'T' and 'V'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(25,15): error TS2365: Operator '>' cannot be applied to types 'T' and 'V'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(26,15): error TS2365: Operator '<=' cannot be applied to types 'T' and 'V'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(27,15): error TS2365: Operator '>=' cannot be applied to types 'T' and 'V'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(28,15): error TS2365: Operator '==' cannot be applied to types 'T' and 'V'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(29,15): error TS2365: Operator '!=' cannot be applied to types 'T' and 'V'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(30,15): error TS2365: Operator '===' cannot be applied to types 'T' and 'V'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(31,15): error TS2365: Operator '!==' cannot be applied to types 'T' and 'V'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(33,15): error TS2365: Operator '<' cannot be applied to types 'V' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(34,15): error TS2365: Operator '>' cannot be applied to types 'V' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(35,15): error TS2365: Operator '<=' cannot be applied to types 'V' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(36,15): error TS2365: Operator '>=' cannot be applied to types 'V' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(37,15): error TS2365: Operator '==' cannot be applied to types 'V' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(38,15): error TS2365: Operator '!=' cannot be applied to types 'V' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(39,15): error TS2365: Operator '===' cannot be applied to types 'V' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(40,15): error TS2365: Operator '!==' cannot be applied to types 'V' and 'T'. + + ==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts (32 errors) ==== var a: {}; var b: Object; @@ -6,103 +40,103 @@ // errors var ra1 = t < u; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'U'. var ra2 = t > u; ~~~~~ -!!! Operator '>' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '>' cannot be applied to types 'T' and 'U'. var ra3 = t <= u; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '<=' cannot be applied to types 'T' and 'U'. var ra4 = t >= u; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '>=' cannot be applied to types 'T' and 'U'. var ra5 = t == u; ~~~~~~ -!!! Operator '==' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '==' cannot be applied to types 'T' and 'U'. var ra6 = t != u; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '!=' cannot be applied to types 'T' and 'U'. var ra7 = t === u; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '===' cannot be applied to types 'T' and 'U'. var ra8 = t !== u; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'T' and 'U'. +!!! error TS2365: Operator '!==' cannot be applied to types 'T' and 'U'. var rb1 = u < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'U' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'U' and 'T'. var rb2 = u > t; ~~~~~ -!!! Operator '>' cannot be applied to types 'U' and 'T'. +!!! error TS2365: Operator '>' cannot be applied to types 'U' and 'T'. var rb3 = u <= t; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'U' and 'T'. +!!! error TS2365: Operator '<=' cannot be applied to types 'U' and 'T'. var rb4 = u >= t; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'U' and 'T'. +!!! error TS2365: Operator '>=' cannot be applied to types 'U' and 'T'. var rb5 = u == t; ~~~~~~ -!!! Operator '==' cannot be applied to types 'U' and 'T'. +!!! error TS2365: Operator '==' cannot be applied to types 'U' and 'T'. var rb6 = u != t; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'U' and 'T'. +!!! error TS2365: Operator '!=' cannot be applied to types 'U' and 'T'. var rb7 = u === t; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'U' and 'T'. +!!! error TS2365: Operator '===' cannot be applied to types 'U' and 'T'. var rb8 = u !== t; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'U' and 'T'. +!!! error TS2365: Operator '!==' cannot be applied to types 'U' and 'T'. var rc1 = t < v; ~~~~~ -!!! Operator '<' cannot be applied to types 'T' and 'V'. +!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'V'. var rc2 = t > v; ~~~~~ -!!! Operator '>' cannot be applied to types 'T' and 'V'. +!!! error TS2365: Operator '>' cannot be applied to types 'T' and 'V'. var rc3 = t <= v; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'T' and 'V'. +!!! error TS2365: Operator '<=' cannot be applied to types 'T' and 'V'. var rc4 = t >= v; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'T' and 'V'. +!!! error TS2365: Operator '>=' cannot be applied to types 'T' and 'V'. var rc5 = t == v; ~~~~~~ -!!! Operator '==' cannot be applied to types 'T' and 'V'. +!!! error TS2365: Operator '==' cannot be applied to types 'T' and 'V'. var rc6 = t != v; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'T' and 'V'. +!!! error TS2365: Operator '!=' cannot be applied to types 'T' and 'V'. var rc7 = t === v; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'T' and 'V'. +!!! error TS2365: Operator '===' cannot be applied to types 'T' and 'V'. var rc8 = t !== v; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'T' and 'V'. +!!! error TS2365: Operator '!==' cannot be applied to types 'T' and 'V'. var rd1 = v < t; ~~~~~ -!!! Operator '<' cannot be applied to types 'V' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'V' and 'T'. var rd2 = v > t; ~~~~~ -!!! Operator '>' cannot be applied to types 'V' and 'T'. +!!! error TS2365: Operator '>' cannot be applied to types 'V' and 'T'. var rd3 = v <= t; ~~~~~~ -!!! Operator '<=' cannot be applied to types 'V' and 'T'. +!!! error TS2365: Operator '<=' cannot be applied to types 'V' and 'T'. var rd4 = v >= t; ~~~~~~ -!!! Operator '>=' cannot be applied to types 'V' and 'T'. +!!! error TS2365: Operator '>=' cannot be applied to types 'V' and 'T'. var rd5 = v == t; ~~~~~~ -!!! Operator '==' cannot be applied to types 'V' and 'T'. +!!! error TS2365: Operator '==' cannot be applied to types 'V' and 'T'. var rd6 = v != t; ~~~~~~ -!!! Operator '!=' cannot be applied to types 'V' and 'T'. +!!! error TS2365: Operator '!=' cannot be applied to types 'V' and 'T'. var rd7 = v === t; ~~~~~~~ -!!! Operator '===' cannot be applied to types 'V' and 'T'. +!!! error TS2365: Operator '===' cannot be applied to types 'V' and 'T'. var rd8 = v !== t; ~~~~~~~ -!!! Operator '!==' cannot be applied to types 'V' and 'T'. +!!! error TS2365: Operator '!==' cannot be applied to types 'V' and 'T'. // ok var re1 = t < a; diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt index 3aa94844f14..204a7d4c21a 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(1,7): error TS2310: Type 'S18' recursively references itself as a base type. +tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(4,2): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts (2 errors) ==== class S18 extends S18 ~~~ -!!! Type 'S18' recursively references itself as a base type. +!!! error TS2310: Type 'S18' recursively references itself as a base type. { } (new S18(123)).S18 = 0; ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/complicatedPrivacy.errors.txt b/tests/baselines/reference/complicatedPrivacy.errors.txt index 443fefd9487..fd47927f883 100644 --- a/tests/baselines/reference/complicatedPrivacy.errors.txt +++ b/tests/baselines/reference/complicatedPrivacy.errors.txt @@ -1,4 +1,8 @@ -==== tests/cases/compiler/complicatedPrivacy.ts (4 errors) ==== +tests/cases/compiler/complicatedPrivacy.ts(24,38): error TS1005: ';' expected. +tests/cases/compiler/complicatedPrivacy.ts(73,49): error TS2305: Module 'mglo5' has no exported member 'i6'. + + +==== tests/cases/compiler/complicatedPrivacy.ts (2 errors) ==== module m1 { export module m2 { @@ -10,8 +14,6 @@ export class C2 implements m3.i3 { public get p1(arg) { - ~~ -!!! A 'get' accessor cannot have parameters. return new C1(); } @@ -26,7 +28,7 @@ export function f2(arg1: { x?: C1, y: number }) { ~ -!!! ';' expected. +!!! error TS1005: ';' expected. } export function f3(): { @@ -38,8 +40,6 @@ export function f4(arg1: { [number]: C1; - ~~~~~~ -!!! An index signature parameter must have a type annotation. }) { } @@ -79,7 +79,7 @@ export class c_pr implements mglo5.i5, mglo5.i6 { ~~~~~~~~ -!!! Module 'mglo5' has no exported member 'i6'. +!!! error TS2305: Module 'mglo5' has no exported member 'i6'. f1() { return "Hello"; } diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt index 6313e08471c..535e4eb1a30 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt @@ -1,3 +1,11 @@ +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(5,1): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(8,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(11,1): error TS2322: Type 'string' is not assignable to type 'E'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2322: Type 'string' is not assignable to type '{ a: string; }'. + Property 'a' is missing in type 'String'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(17,1): error TS2322: Type 'string' is not assignable to type 'void'. + + ==== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts (5 errors) ==== // string can add every type, and result string cannot be assigned to below types enum E { a, b, c } @@ -5,25 +13,25 @@ var x1: boolean; x1 += ''; ~~ -!!! Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. var x2: number; x2 += ''; ~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var x3: E; x3 += ''; ~~ -!!! Type 'string' is not assignable to type 'E'. +!!! error TS2322: Type 'string' is not assignable to type 'E'. var x4: {a: string}; x4 += ''; ~~ -!!! Type 'string' is not assignable to type '{ a: string; }': -!!! Property 'a' is missing in type 'String'. +!!! error TS2322: Type 'string' is not assignable to type '{ a: string; }'. +!!! error TS2322: Property 'a' is missing in type 'String'. var x5: void; x5 += ''; ~~ -!!! Type 'string' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt index d7a4cca8e99..45be0c3129f 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt @@ -1,3 +1,32 @@ +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(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(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(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(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(40,1): error TS2365: Operator '+=' cannot be applied to types 'E' and '{}'. + + ==== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts (27 errors) ==== enum E { a, b } @@ -6,90 +35,90 @@ var x1: boolean; x1 += a; ~~~~~~~ -!!! Operator '+=' cannot be applied to types 'boolean' and 'void'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'void'. x1 += true; ~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. x1 += 0; ~~~~~~~ -!!! Operator '+=' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'number'. x1 += E.a; ~~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E'. x1 += {}; ~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'boolean' and '{}'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and '{}'. x1 += null; ~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. x1 += undefined; ~~~~~~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. var x2: {}; x2 += a; ~~~~~~~ -!!! Operator '+=' cannot be applied to types '{}' and 'void'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'void'. x2 += true; ~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types '{}' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'boolean'. x2 += 0; ~~~~~~~ -!!! Operator '+=' cannot be applied to types '{}' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'number'. x2 += E.a; ~~~~~~~~~ -!!! Operator '+=' cannot be applied to types '{}' and 'E'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'E'. x2 += {}; ~~~~~~~~ -!!! Operator '+=' cannot be applied to types '{}' and '{}'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. x2 += null; ~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types '{}' and '{}'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. x2 += undefined; ~~~~~~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types '{}' and '{}'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. var x3: void; x3 += a; ~~~~~~~ -!!! Operator '+=' cannot be applied to types 'void' and 'void'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. x3 += true; ~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'boolean'. x3 += 0; ~~~~~~~ -!!! Operator '+=' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'number'. x3 += E.a; ~~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'E'. x3 += {}; ~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'void' and '{}'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and '{}'. x3 += null; ~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'void' and 'void'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. x3 += undefined; ~~~~~~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'void' and 'void'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. var x4: number; x4 += a; ~~~~~~~ -!!! Operator '+=' cannot be applied to types 'number' and 'void'. +!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. x4 += true; ~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'boolean'. x4 += {}; ~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'number' and '{}'. +!!! error TS2365: Operator '+=' cannot be applied to types 'number' and '{}'. var x5: E; x5 += a; ~~~~~~~ -!!! Operator '+=' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'void'. x5 += true; ~~~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'boolean'. x5 += {}; ~~~~~~~~ -!!! Operator '+=' cannot be applied to types 'E' and '{}'. \ No newline at end of file +!!! error TS2365: Operator '+=' cannot be applied to types 'E' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.errors.txt b/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.errors.txt index d0045d92aa0..9367285ef93 100644 --- a/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.errors.txt @@ -1,3 +1,73 @@ +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.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/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(8,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(9,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(9,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(10,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.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/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(11,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(12,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(13,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(13,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(14,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(14,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(15,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(15,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(18,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(19,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(19,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(20,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(20,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(21,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(22,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(22,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(23,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(24,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(24,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(25,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(25,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(26,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(26,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(29,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(30,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(30,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(31,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(31,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(32,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(33,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(33,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(34,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(35,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(35,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(36,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(36,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(37,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(37,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(40,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(41,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(41,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(42,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(42,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(43,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(44,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(44,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(45,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(46,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(46,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(47,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(47,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(48,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(48,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(51,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(52,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(53,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(54,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(57,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(58,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(59,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts(60,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + ==== tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts (68 errors) ==== enum E { a, b } @@ -7,191 +77,191 @@ var x1: boolean; x1 *= a; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x1 *= b; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x1 *= true; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x1 *= 0; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x1 *= '' ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x1 *= E.a; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x1 *= {}; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x1 *= null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x1 *= undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var x2: string; x2 *= a; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x2 *= b; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x2 *= true; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x2 *= 0; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x2 *= '' ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x2 *= E.a; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x2 *= {}; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x2 *= null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x2 *= undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var x3: {}; x3 *= a; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x3 *= b; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x3 *= true; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x3 *= 0; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x3 *= '' ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x3 *= E.a; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x3 *= {}; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x3 *= null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x3 *= undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var x4: void; x4 *= a; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x4 *= b; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x4 *= true; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x4 *= 0; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x4 *= '' ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x4 *= E.a; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x4 *= {}; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x4 *= null; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x4 *= undefined; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var x5: number; x5 *= b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x5 *= true; ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x5 *= '' ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x5 *= {}; ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var x6: E; x6 *= b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x6 *= true; ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x6 *= '' ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. x6 *= {}; ~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! 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/compoundAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt index 7fe036ef084..b850d0a0d38 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt @@ -1,3 +1,85 @@ +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(58,9): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(59,9): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(69,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(70,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(74,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(75,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(79,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(80,15): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(85,21): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(86,21): error TS1128: Declaration or statement expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(87,11): error TS1005: ';' expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(88,11): error TS1005: ';' expected. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(7,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(8,9): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(11,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(12,9): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(15,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(16,9): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(21,5): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(22,5): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(25,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(26,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(30,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(31,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(33,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(34,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(37,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(38,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(40,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(41,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(44,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(45,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(46,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(47,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(48,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(49,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(50,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(51,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(52,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(53,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(54,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(55,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(62,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(63,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(69,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(70,9): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(74,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(75,9): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(79,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(80,9): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(91,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(92,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(95,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(96,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(97,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(98,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(99,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(100,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(101,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(102,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(103,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(104,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(105,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(106,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(107,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(108,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(109,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(110,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(111,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(112,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(113,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(114,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(115,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(116,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(117,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(118,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(119,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(120,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(121,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(122,1): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts (80 errors) ==== // expected error for all the LHS of compound assignments (arithmetic and addition) var value; @@ -7,129 +89,129 @@ constructor() { this *= value; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. this += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } foo() { this *= value; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. this += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } static sfoo() { this *= value; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. this += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } } function foo() { this *= value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. this += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } this *= value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. this += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. // identifiers: module, class, enum, function module M { export var a; } M *= value; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. M += value; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. C *= value; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. C += value; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. enum E { } E *= value; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. E += value; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. foo *= value; ~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. foo += value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. // literals null *= value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. null += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. true *= value; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. true += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. false *= value; ~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. false += value; ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. 0 *= value; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. 0 += value; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. '' *= value; ~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. '' += value; ~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. /d+/ *= value; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. /d+/ += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. // object literals { a: 0} *= value; ~~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. { a: 0} += value; ~~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. // array literals ['', ''] *= value; ~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ['', ''] += value; ~~~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. // super class Derived extends C { @@ -137,147 +219,147 @@ super(); super *= value; ~~ -!!! 'super' must be followed by an argument list or member access. +!!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. super += value; ~~ -!!! 'super' must be followed by an argument list or member access. +!!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } foo() { super *= value; ~~ -!!! 'super' must be followed by an argument list or member access. +!!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. super += value; ~~ -!!! 'super' must be followed by an argument list or member access. +!!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } static sfoo() { super *= value; ~~ -!!! 'super' must be followed by an argument list or member access. +!!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. super += value; ~~ -!!! 'super' must be followed by an argument list or member access. +!!! error TS1034: 'super' must be followed by an argument list or member access. ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. } } // function expression function bar1() { } *= value; ~~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. function bar2() { } += value; ~~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. () => { } *= value; ~~ -!!! ';' expected. +!!! error TS1005: ';' expected. () => { } += value; ~~ -!!! ';' expected. +!!! error TS1005: ';' expected. // function calls foo() *= value; ~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. foo() += value; ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. // parentheses, the containted expression is value (this) *= value; ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (this) += value; ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (M) *= value; ~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. (M) += value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (C) *= value; ~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. (C) += value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (E) *= value; ~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. (E) += value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (foo) *= value; ~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. (foo) += value; ~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (null) *= value; ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (null) += value; ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (true) *= value; ~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. (true) += value; ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (0) *= value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (0) += value; ~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. ('') *= value; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ('') += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (/d+/) *= value; ~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. (/d+/) += value; ~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. ({}) *= value; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ({}) += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. ([]) *= value; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ([]) += value; ~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (function baz1() { }) *= value; ~~~~~~~~~~~~~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. (function baz2() { }) += value; ~~~~~~~~~~~~~~~~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. (foo()) *= value; ~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. (foo()) += value; ~~~~~~~ -!!! Invalid left-hand side of assignment expression. \ No newline at end of file +!!! error TS2364: Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/concatClassAndString.errors.txt b/tests/baselines/reference/concatClassAndString.errors.txt index e97ff01d754..623c213181f 100644 --- a/tests/baselines/reference/concatClassAndString.errors.txt +++ b/tests/baselines/reference/concatClassAndString.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/concatClassAndString.ts(4,1): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/compiler/concatClassAndString.ts (1 errors) ==== // Shouldn't compile (the long form f = f + ""; doesn't): class f { } f += ''; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalExpression1.errors.txt b/tests/baselines/reference/conditionalExpression1.errors.txt index 0ae4814113d..0e291986785 100644 --- a/tests/baselines/reference/conditionalExpression1.errors.txt +++ b/tests/baselines/reference/conditionalExpression1.errors.txt @@ -1,6 +1,9 @@ -==== tests/cases/compiler/conditionalExpression1.ts (2 errors) ==== +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 errors) ==== var x: boolean = (true ? 1 : ""); // should be an error ~ -!!! Type '{}' is not assignable to type 'boolean'. - ~~~~~~~~~~~~~ -!!! No best common type exists between 'number' and 'string'. \ No newline at end of file +!!! 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 diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types index 8ad918936d2..f925f7f1db6 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types @@ -80,7 +80,7 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; >result4 : (t: A) => any >t : A >A : A ->true ? (m) => m.propertyX : (n) => n.propertyA : (t: A) => any +>true ? (m) => m.propertyX : (n) => n.propertyA : (m: A) => any >(m) => m.propertyX : (m: A) => any >m : A >m.propertyX : any @@ -144,7 +144,7 @@ var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; >result8 : (t: A) => any >t : A >A : A ->true ? (m) => m.propertyA : (n) => n.propertyX : (t: A) => any +>true ? (m) => m.propertyA : (n) => n.propertyX : (n: A) => any >(m) => m.propertyA : (m: A) => number >m : A >m.propertyA : number @@ -161,7 +161,7 @@ var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; var resultIsX3: X = true ? a : b; >resultIsX3 : X >X : X ->true ? a : b : X +>true ? a : b : A | B >a : A >b : B @@ -169,7 +169,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; >result10 : (t: X) => any >t : X >X : X ->true ? (m) => m.propertyX1 : (n) => n.propertyX2 : (t: X) => any +>true ? (m) => m.propertyX1 : (n) => n.propertyX2 : ((m: X) => number) | ((n: X) => string) >(m) => m.propertyX1 : (m: X) => number >m : X >m.propertyX1 : number @@ -184,5 +184,5 @@ 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' : any +>true ? 1 : 'string' : string | number diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt index 4a34e042b1e..954e8af856f 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt @@ -1,4 +1,21 @@ -==== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts (12 errors) ==== +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(15,5): error TS2322: Type 'A | B' is not assignable to type 'A'. + Type 'B' is not assignable to type 'A'. + Property 'propertyA' is missing in type 'B'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(16,5): error TS2322: Type 'A | B' is not assignable to type 'B'. + Type 'A' is not assignable to type 'B'. + Property 'propertyB' is missing in type 'A'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(18,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. + Type '(n: X) => string' is not assignable to type '(t: X) => number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. + Type '(m: X) => number' is not assignable to type '(t: X) => string'. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. + Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. + Type 'number' is not assignable to type 'boolean'. + + +==== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts (5 errors) ==== //Cond ? Expr1 : Expr2, Expr1 and Expr2 have no identical best common type class X { propertyX: any; propertyX1: number; propertyX2: string }; class A extends X { propertyA: number }; @@ -8,41 +25,34 @@ var a: A; var b: B; - //Expect to have compiler errors - //Be not contextually typed + // No errors anymore, uses union types true ? a : b; - ~~~~~~~~~~~~ -!!! No best common type exists between 'A' and 'B'. var result1 = true ? a : b; - ~~~~~~~~~~~~ -!!! No best common type exists between 'A' and 'B'. - //Be contextually typed and and bct is not identical + //Be contextually typed and and bct is not identical, results in errors that union type is not assignable to target var result2: A = true ? a : b; ~~~~~~~ -!!! Type '{}' is not assignable to type 'A': -!!! Property 'propertyA' is missing in type '{}'. - ~~~~~~~~~~~~ -!!! No best common type exists between 'A', 'A', and 'B'. +!!! error TS2322: Type 'A | B' is not assignable to type 'A'. +!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Property 'propertyA' is missing in type 'B'. var result3: B = true ? a : b; ~~~~~~~ -!!! Type '{}' is not assignable to type 'B': -!!! Property 'propertyB' is missing in type '{}'. - ~~~~~~~~~~~~ -!!! No best common type exists between 'B', 'A', and 'B'. +!!! error TS2322: Type 'A | B' is not assignable to type 'B'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'propertyB' is missing in type 'A'. var result4: (t: X) => number = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! Type '{}' is not assignable to type '(t: X) => number'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! No best common type exists between '(t: X) => number', '(m: X) => number', and '(n: X) => string'. +!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. +!!! error TS2322: Type '(n: X) => string' is not assignable to type '(t: X) => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var result5: (t: X) => string = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! Type '{}' is not assignable to type '(t: X) => string'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! No best common type exists between '(t: X) => string', '(m: X) => number', and '(n: X) => string'. +!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. +!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var result6: (t: X) => boolean = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! Type '{}' is not assignable to type '(t: X) => boolean'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! No best common type exists between '(t: X) => boolean', '(m: X) => number', and '(n: X) => string'. \ No newline at end of file +!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. +!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js index 90125d4ebf6..b6376dd781f 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -8,12 +8,11 @@ var x: X; var a: A; var b: B; -//Expect to have compiler errors -//Be not contextually typed +// No errors anymore, uses union types true ? a : b; var result1 = true ? a : b; -//Be contextually typed and and bct is not identical +//Be contextually typed and and bct is not identical, results in errors that union type is not assignable to target var result2: A = true ? a : b; var result3: B = true ? a : b; @@ -54,11 +53,10 @@ var B = (function (_super) { var x; var a; var b; -//Expect to have compiler errors -//Be not contextually typed +// No errors anymore, uses union types true ? a : b; var result1 = true ? a : b; -//Be contextually typed and and bct is not identical +//Be contextually typed and and bct is not identical, results in errors that union type is not assignable to target var result2 = true ? a : b; var result3 = true ? a : b; var result4 = true ? function (m) { return m.propertyX1; } : function (n) { return n.propertyX2; }; diff --git a/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt b/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt index 9bf1480f8bb..58fdcb4c7ae 100644 --- a/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt +++ b/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'. + Named properties 'm' of types 'B' and 'D' are not identical. + + ==== tests/cases/compiler/conflictingMemberTypesInBases.ts (1 errors) ==== interface A { m: string; @@ -12,7 +16,7 @@ interface E extends B { } // Error here for extending B and D ~ -!!! Interface 'E' cannot simultaneously extend types 'B' and 'D': -!!! Named properties 'm' of types 'B' and 'D' are not identical. +!!! error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'. +!!! error TS2320: Named properties 'm' of types 'B' and 'D' are not identical. interface E extends D { } // No duplicate error here \ No newline at end of file diff --git a/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt b/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt index 6bb45b67ee7..0b667108b5f 100644 --- a/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt +++ b/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt @@ -1,12 +1,21 @@ -==== tests/cases/compiler/conflictingTypeAnnotatedVar.ts (4 errors) ==== +tests/cases/compiler/conflictingTypeAnnotatedVar.ts(1,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/conflictingTypeAnnotatedVar.ts(2,10): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/conflictingTypeAnnotatedVar.ts(2,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,10): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + + +==== tests/cases/compiler/conflictingTypeAnnotatedVar.ts (5 errors) ==== var foo: string; + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. function foo(): number { } ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. function foo(): number { } ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. \ No newline at end of file +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration.errors.txt b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration.errors.txt new file mode 100644 index 00000000000..629cf7f75af --- /dev/null +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration.errors.txt @@ -0,0 +1,35 @@ +tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(7,9): error TS2451: Cannot redeclare block-scoped variable 'x'. +tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(15,13): error TS2451: Cannot redeclare block-scoped variable 'y'. +tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts(22,7): error TS2451: Cannot redeclare block-scoped variable 'z'. + + +==== tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts (3 errors) ==== + + // Error as declaration of var would cause a write to the const value + var x = 0; + { + const x = 0; + + var x = 0; + ~ +!!! error TS2451: Cannot redeclare block-scoped variable 'x'. + } + + + var y = 0; + { + const y = 0; + { + var y = 0; + ~ +!!! error TS2451: Cannot redeclare block-scoped variable 'y'. + } + } + + + { + const z = 0; + var z = 0 + ~ +!!! error TS2451: Cannot redeclare block-scoped variable 'z'. + } \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.js b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.js new file mode 100644 index 00000000000..67d3e688075 --- /dev/null +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.js @@ -0,0 +1,18 @@ +//// [constDeclarationShadowedByVarDeclaration2.ts] + +// No errors, const declaration is not shadowed +function outer() { + const x = 0; + function inner() { + var x = "inner"; + } +} + +//// [constDeclarationShadowedByVarDeclaration2.js] +// No errors, const declaration is not shadowed +function outer() { + const x = 0; + function inner() { + var x = "inner"; + } +} diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types new file mode 100644 index 00000000000..4217db45509 --- /dev/null +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/constDeclarationShadowedByVarDeclaration2.ts === + +// No errors, const declaration is not shadowed +function outer() { +>outer : () => void + + const x = 0; +>x : number + + function inner() { +>inner : () => void + + var x = "inner"; +>x : string + } +} diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js new file mode 100644 index 00000000000..6f5b898c5ff --- /dev/null +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js @@ -0,0 +1,21 @@ +//// [constDeclarationShadowedByVarDeclaration3.ts] +// Ensure only checking for const declarations shadowed by vars +class Rule { + public regex: RegExp = new RegExp(''); + public name: string = ''; + + constructor(name: string) { + this.name = name; + } +} + +//// [constDeclarationShadowedByVarDeclaration3.js] +// Ensure only checking for const declarations shadowed by vars +var Rule = (function () { + function Rule(name) { + this.regex = new RegExp(''); + this.name = ''; + this.name = name; + } + return Rule; +})(); diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types new file mode 100644 index 00000000000..89490567f14 --- /dev/null +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types @@ -0,0 +1,25 @@ +=== tests/cases/compiler/constDeclarationShadowedByVarDeclaration3.ts === +// Ensure only checking for const declarations shadowed by vars +class Rule { +>Rule : Rule + + public regex: RegExp = new RegExp(''); +>regex : RegExp +>RegExp : RegExp +>new RegExp('') : RegExp +>RegExp : { (pattern: string, flags?: string): RegExp; new (pattern: string, flags?: string): RegExp; $1: string; $2: string; $3: string; $4: string; $5: string; $6: string; $7: string; $8: string; $9: string; lastMatch: string; } + + public name: string = ''; +>name : string + + constructor(name: string) { +>name : string + + this.name = name; +>this.name = name : string +>this.name : string +>this : Rule +>name : string +>name : string + } +} diff --git a/tests/baselines/reference/constDeclarations-access.errors.txt b/tests/baselines/reference/constDeclarations-access.errors.txt new file mode 100644 index 00000000000..04b942aec09 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-access.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/file2.ts(1,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. + + +==== tests/cases/compiler/file1.ts (0 errors) ==== + + const x = 0 + +==== tests/cases/compiler/file2.ts (1 errors) ==== + x++; + ~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-access2.errors.txt b/tests/baselines/reference/constDeclarations-access2.errors.txt new file mode 100644 index 00000000000..6a360e11014 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-access2.errors.txt @@ -0,0 +1,94 @@ +tests/cases/compiler/constDeclarations-access2.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(6,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(18,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(19,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(20,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(21,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. + + +==== tests/cases/compiler/constDeclarations-access2.ts (17 errors) ==== + + const x = 0 + + // Errors + x = 1; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x += 2; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x -= 3; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x *= 4; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x /= 5; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x %= 6; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x <<= 7; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x >>= 8; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x >>>= 9; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x &= 10; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x |= 11; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + x ^= 12; + ~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + + x++; + ~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + x--; + ~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + ++x; + ~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + --x; + ~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + + ++((x)); + ~~~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + + // OK + var a = x + 1; + + function f(v: number) { } + f(x); + + if (x) { } + + x; + (x); + + -x; + +x; + + x.toString(); + \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-access3.errors.txt b/tests/baselines/reference/constDeclarations-access3.errors.txt new file mode 100644 index 00000000000..577b087dff0 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-access3.errors.txt @@ -0,0 +1,102 @@ +tests/cases/compiler/constDeclarations-access3.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(21,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(22,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(24,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(26,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(28,1): error TS2450: Left-hand side of assignment expression cannot be a constant. + + +==== tests/cases/compiler/constDeclarations-access3.ts (18 errors) ==== + + + module M { + export const x = 0; + } + + // Errors + M.x = 1; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x += 2; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x -= 3; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x *= 4; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x /= 5; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x %= 6; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x <<= 7; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x >>= 8; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x >>>= 9; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x &= 10; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x |= 11; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x ^= 12; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + + M.x++; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + M.x--; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + ++M.x; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + --M.x; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + + ++((M.x)); + ~~~~~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + + M["x"] = 0; + ~~~~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + + // OK + var a = M.x + 1; + + function f(v: number) { } + f(M.x); + + if (M.x) { } + + M.x; + (M.x); + + -M.x; + +M.x; + + M.x.toString(); + \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-access4.errors.txt b/tests/baselines/reference/constDeclarations-access4.errors.txt new file mode 100644 index 00000000000..9745c0d2624 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-access4.errors.txt @@ -0,0 +1,102 @@ +tests/cases/compiler/constDeclarations-access4.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(21,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(22,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(24,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(26,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(28,1): error TS2450: Left-hand side of assignment expression cannot be a constant. + + +==== tests/cases/compiler/constDeclarations-access4.ts (18 errors) ==== + + + declare module M { + const x: number; + } + + // Errors + M.x = 1; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x += 2; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x -= 3; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x *= 4; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x /= 5; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x %= 6; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x <<= 7; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x >>= 8; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x >>>= 9; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x &= 10; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x |= 11; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + M.x ^= 12; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + + M.x++; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + M.x--; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + ++M.x; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + --M.x; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + + ++((M.x)); + ~~~~~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + + M["x"] = 0; + ~~~~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + + // OK + var a = M.x + 1; + + function f(v: number) { } + f(M.x); + + if (M.x) { } + + M.x; + (M.x); + + -M.x; + +M.x; + + M.x.toString(); + \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-access5.errors.txt b/tests/baselines/reference/constDeclarations-access5.errors.txt new file mode 100644 index 00000000000..23200e50ee4 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-access5.errors.txt @@ -0,0 +1,103 @@ +tests/cases/compiler/constDeclarations_access_2.ts(4,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(6,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(17,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(18,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(19,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(20,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(22,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(24,1): error TS2450: Left-hand side of assignment expression cannot be a constant. + + +==== tests/cases/compiler/constDeclarations_access_2.ts (18 errors) ==== + /// + import m = require('constDeclarations_access_1'); + // Errors + m.x = 1; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x += 2; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x -= 3; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x *= 4; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x /= 5; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x %= 6; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x <<= 7; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x >>= 8; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x >>>= 9; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x &= 10; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x |= 11; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m.x ^= 12; + ~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + m + m.x++; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + m.x--; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + ++m.x; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + --m.x; + ~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + + ++((m.x)); + ~~~~~~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + + m["x"] = 0; + ~~~~~~ +!!! error TS2450: Left-hand side of assignment expression cannot be a constant. + + // OK + var a = m.x + 1; + + function f(v: number) { } + f(m.x); + + if (m.x) { } + + m.x; + (m.x); + + -m.x; + +m.x; + + m.x.toString(); + +==== tests/cases/compiler/constDeclarations_access_1.ts (0 errors) ==== + + + export const x = 0; + \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-ambient-errors.errors.txt b/tests/baselines/reference/constDeclarations-ambient-errors.errors.txt new file mode 100644 index 00000000000..6e2d00dc4c4 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-ambient-errors.errors.txt @@ -0,0 +1,34 @@ +tests/cases/compiler/constDeclarations-ambient-errors.ts(3,27): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/compiler/constDeclarations-ambient-errors.ts(4,26): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/compiler/constDeclarations-ambient-errors.ts(5,18): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/compiler/constDeclarations-ambient-errors.ts(5,37): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/compiler/constDeclarations-ambient-errors.ts(5,51): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/compiler/constDeclarations-ambient-errors.ts(8,14): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/compiler/constDeclarations-ambient-errors.ts(9,22): error TS1039: Initializers are not allowed in ambient contexts. + + +==== tests/cases/compiler/constDeclarations-ambient-errors.ts (7 errors) ==== + + // error: no intialization expected in ambient declarations + declare const c1: boolean = true; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + declare const c2: number = 0; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + declare const c3 = null, c4 :string = "", c5: any = 0; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + + declare module M { + const c6 = 0; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + const c7: number = 7; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + } \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-ambient.js b/tests/baselines/reference/constDeclarations-ambient.js new file mode 100644 index 00000000000..dd78f73051a --- /dev/null +++ b/tests/baselines/reference/constDeclarations-ambient.js @@ -0,0 +1,13 @@ +//// [constDeclarations-ambient.ts] + +// No error +declare const c1: boolean; +declare const c2: number; +declare const c3, c4 :string, c5: any; + +declare module M { + const c6; + const c7: number; +} + +//// [constDeclarations-ambient.js] diff --git a/tests/baselines/reference/constDeclarations-ambient.types b/tests/baselines/reference/constDeclarations-ambient.types new file mode 100644 index 00000000000..0ab2d4b700a --- /dev/null +++ b/tests/baselines/reference/constDeclarations-ambient.types @@ -0,0 +1,23 @@ +=== tests/cases/compiler/constDeclarations-ambient.ts === + +// No error +declare const c1: boolean; +>c1 : boolean + +declare const c2: number; +>c2 : number + +declare const c3, c4 :string, c5: any; +>c3 : any +>c4 : string +>c5 : any + +declare module M { +>M : typeof M + + const c6; +>c6 : any + + const c7: number; +>c7 : number +} diff --git a/tests/baselines/reference/constDeclarations-errors.errors.txt b/tests/baselines/reference/constDeclarations-errors.errors.txt new file mode 100644 index 00000000000..d87007474a1 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-errors.errors.txt @@ -0,0 +1,50 @@ +tests/cases/compiler/constDeclarations-errors.ts(3,7): error TS1155: 'const' declarations must be initialized +tests/cases/compiler/constDeclarations-errors.ts(4,7): error TS1155: 'const' declarations must be initialized +tests/cases/compiler/constDeclarations-errors.ts(5,7): error TS1155: 'const' declarations must be initialized +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(8,11): error TS1155: 'const' declarations must be initialized +tests/cases/compiler/constDeclarations-errors.ts(14,11): error TS1155: 'const' declarations must be initialized +tests/cases/compiler/constDeclarations-errors.ts(17,20): error TS1155: 'const' declarations must be initialized +tests/cases/compiler/constDeclarations-errors.ts(11,27): error TS2449: The operand of an increment or decrement operator cannot be a constant. + + +==== tests/cases/compiler/constDeclarations-errors.ts (10 errors) ==== + + // error, missing intialicer + const c1; + ~~ +!!! error TS1155: 'const' declarations must be initialized + const c2: number; + ~~ +!!! error TS1155: 'const' declarations must be initialized + const c3, c4, c5 :string, c6; // error, missing initialicer + ~~ +!!! error TS1155: 'const' declarations must be initialized + ~~ +!!! error TS1155: 'const' declarations must be initialized + ~~ +!!! error TS1155: 'const' declarations must be initialized + ~~ +!!! error TS1155: 'const' declarations must be initialized + + // error, can not be unintalized + for(const c in {}) { } + ~ +!!! error TS1155: 'const' declarations must be initialized + + // error, assigning to a const + for(const c8 = 0; c8 < 1; c8++) { } + ~~ +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. + + // error, can not be unintalized + for(const c9; c9 < 1;) { } + ~~ +!!! error TS1155: 'const' declarations must be initialized + + // 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 diff --git a/tests/baselines/reference/constDeclarations-es5.errors.txt b/tests/baselines/reference/constDeclarations-es5.errors.txt new file mode 100644 index 00000000000..c928e6ae48e --- /dev/null +++ b/tests/baselines/reference/constDeclarations-es5.errors.txt @@ -0,0 +1,17 @@ +tests/cases/compiler/constDeclarations-es5.ts(2,7): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/constDeclarations-es5.ts(3,7): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/constDeclarations-es5.ts(4,7): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/compiler/constDeclarations-es5.ts (3 errors) ==== + + const z7 = false; + ~~ +!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + const z8: number = 23; + ~~ +!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + const z9 = 0, z10 :string = "", z11 = null; + ~~ +!!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. + \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt new file mode 100644 index 00000000000..745ef305ac6 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt @@ -0,0 +1,66 @@ +tests/cases/compiler/constDeclarations-invalidContexts.ts(4,5): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(6,5): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(9,5): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(12,5): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(17,5): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(20,5): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(23,5): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(26,12): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(29,29): error TS1156: 'const' declarations can only be declared inside a block. +tests/cases/compiler/constDeclarations-invalidContexts.ts(16,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. + + +==== tests/cases/compiler/constDeclarations-invalidContexts.ts (10 errors) ==== + + // Errors, const must be defined inside a block + if (true) + const c1 = 0; + ~~~~~~~~~~~~~ +!!! error TS1156: 'const' declarations can only be declared inside a block. + else + const c2 = 0; + ~~~~~~~~~~~~~ +!!! error TS1156: 'const' declarations can only be declared inside a block. + + while (true) + const c3 = 0; + ~~~~~~~~~~~~~ +!!! error TS1156: 'const' declarations can only be declared inside a block. + + do + const c4 = 0; + ~~~~~~~~~~~~~ +!!! error TS1156: 'const' declarations can only be declared inside a block. + while (true); + + var obj; + with (obj) + ~~~ +!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + const c5 = 0; + ~~~~~~~~~~~~~ +!!! error TS1156: 'const' declarations can only be declared inside a block. + + for (var i = 0; i < 10; i++) + const c6 = 0; + ~~~~~~~~~~~~~ +!!! error TS1156: 'const' declarations can only be declared inside a block. + + for (var i2 in {}) + const c7 = 0; + ~~~~~~~~~~~~~ +!!! error TS1156: 'const' declarations can only be declared inside a block. + + if (true) + label: const c8 = 0; + ~~~~~~~~~~~~~ +!!! error TS1156: 'const' declarations can only be declared inside a block. + + while (false) + label2: label3: label4: const c9 = 0; + ~~~~~~~~~~~~~ +!!! error TS1156: 'const' declarations can only be declared inside a block. + + + + \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-scopes.errors.txt b/tests/baselines/reference/constDeclarations-scopes.errors.txt new file mode 100644 index 00000000000..138acd9b16d --- /dev/null +++ b/tests/baselines/reference/constDeclarations-scopes.errors.txt @@ -0,0 +1,153 @@ +tests/cases/compiler/constDeclarations-scopes.ts(28,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. + + +==== tests/cases/compiler/constDeclarations-scopes.ts (1 errors) ==== + + // global + const c = "string"; + + var n: number; + + // Control flow statements with blocks + if (true) { + const c = 0; + n = c; + } + else { + const c = 0; + n = c; + } + + while (true) { + const c = 0; + n = c; + } + + do { + const c = 0; + n = c; + } while (true); + + var obj; + with (obj) { + ~~~ +!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + const c = 0; + n = c; + } + + for (var i = 0; i < 10; i++) { + const c = 0; + n = c; + } + + for (var i2 in {}) { + const c = 0; + n = c; + } + + if (true) { + label: const c = 0; + n = c; + } + + while (false) { + label2: label3: label4: const c = 0; + n = c; + } + + // Try/catch/finally + try { + const c = 0; + n = c; + } + catch (e) { + const c = 0; + n = c; + } + finally { + const c = 0; + n = c; + } + + // Switch + switch (0) { + case 0: + const c = 0; + n = c; + break; + } + + // blocks + { + const c = 0; + n = c; + { + const c = false; + var b: boolean = c; + } + } + + // functions + + function F() { + const c = 0; + n = c; + } + + var F2 = () => { + const c = 0; + n = c; + }; + + var F3 = function () { + const c = 0; + n = c; + }; + + // modules + module m { + const c = 0; + n = c; + + { + const c = false; + var b2: boolean = c; + } + } + + // methods + class C { + constructor() { + const c = 0; + n = c; + } + + method() { + const c = 0; + n = c; + } + + get v() { + const c = 0; + n = c; + return n; + } + + set v(value) { + const c = 0; + n = c; + } + } + + // object literals + var o = { + f() { + const c = 0; + n = c; + }, + f2: () => { + const c = 0; + n = c; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-scopes.js b/tests/baselines/reference/constDeclarations-scopes.js new file mode 100644 index 00000000000..800dd856422 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-scopes.js @@ -0,0 +1,276 @@ +//// [constDeclarations-scopes.ts] + +// global +const c = "string"; + +var n: number; + +// Control flow statements with blocks +if (true) { + const c = 0; + n = c; +} +else { + const c = 0; + n = c; +} + +while (true) { + const c = 0; + n = c; +} + +do { + const c = 0; + n = c; +} while (true); + +var obj; +with (obj) { + const c = 0; + n = c; +} + +for (var i = 0; i < 10; i++) { + const c = 0; + n = c; +} + +for (var i2 in {}) { + const c = 0; + n = c; +} + +if (true) { + label: const c = 0; + n = c; +} + +while (false) { + label2: label3: label4: const c = 0; + n = c; +} + +// Try/catch/finally +try { + const c = 0; + n = c; +} +catch (e) { + const c = 0; + n = c; +} +finally { + const c = 0; + n = c; +} + +// Switch +switch (0) { + case 0: + const c = 0; + n = c; + break; +} + +// blocks +{ + const c = 0; + n = c; + { + const c = false; + var b: boolean = c; + } +} + +// functions + +function F() { + const c = 0; + n = c; +} + +var F2 = () => { + const c = 0; + n = c; +}; + +var F3 = function () { + const c = 0; + n = c; +}; + +// modules +module m { + const c = 0; + n = c; + + { + const c = false; + var b2: boolean = c; + } +} + +// methods +class C { + constructor() { + const c = 0; + n = c; + } + + method() { + const c = 0; + n = c; + } + + get v() { + const c = 0; + n = c; + return n; + } + + set v(value) { + const c = 0; + n = c; + } +} + +// object literals +var o = { + f() { + const c = 0; + n = c; + }, + f2: () => { + const c = 0; + n = c; + } +} + +//// [constDeclarations-scopes.js] +// global +const c = "string"; +var n; +// Control flow statements with blocks +if (true) { + const c = 0; + n = c; +} +else { + const c = 0; + n = c; +} +while (true) { + const c = 0; + n = c; +} +do { + const c = 0; + n = c; +} while (true); +var obj; +with (obj) { + const c = 0; + n = c; +} +for (var i = 0; i < 10; i++) { + const c = 0; + n = c; +} +for (var i2 in {}) { + const c = 0; + n = c; +} +if (true) { + label: const c = 0; + n = c; +} +while (false) { + label2: label3: label4: const c = 0; + n = c; +} +try { + const c = 0; + n = c; +} +catch (e) { + const c = 0; + n = c; +} +finally { + const c = 0; + n = c; +} +switch (0) { + case 0: + const c = 0; + n = c; + break; +} +{ + const c = 0; + n = c; + { + const c = false; + var b = c; + } +} +// functions +function F() { + const c = 0; + n = c; +} +var F2 = function () { + const c = 0; + n = c; +}; +var F3 = function () { + const c = 0; + n = c; +}; +// modules +var m; +(function (m) { + const c = 0; + n = c; + { + const c = false; + var b2 = c; + } +})(m || (m = {})); +// methods +var C = (function () { + function C() { + const c = 0; + n = c; + } + C.prototype.method = function () { + const c = 0; + n = c; + }; + Object.defineProperty(C.prototype, "v", { + get: function () { + const c = 0; + n = c; + return n; + }, + set: function (value) { + const c = 0; + n = c; + }, + enumerable: true, + configurable: true + }); + return C; +})(); +// object literals +var o = { + f: function () { + const c = 0; + n = c; + }, + f2: function () { + const c = 0; + n = c; + } +}; diff --git a/tests/baselines/reference/constDeclarations-scopes2.js b/tests/baselines/reference/constDeclarations-scopes2.js new file mode 100644 index 00000000000..1d0f252ab4f --- /dev/null +++ b/tests/baselines/reference/constDeclarations-scopes2.js @@ -0,0 +1,27 @@ +//// [constDeclarations-scopes2.ts] + +// global +const c = "string"; + +var n: number; +var b: boolean; + +// for scope +for (const c = 0; c < 10; n = c ) { + // for block + const c = false; + b = c; +} + + + +//// [constDeclarations-scopes2.js] +// global +const c = "string"; +var n; +var b; +for (const c = 0; c < 10; n = c) { + // for block + const c = false; + b = c; +} diff --git a/tests/baselines/reference/constDeclarations-scopes2.types b/tests/baselines/reference/constDeclarations-scopes2.types new file mode 100644 index 00000000000..9609ef8f44b --- /dev/null +++ b/tests/baselines/reference/constDeclarations-scopes2.types @@ -0,0 +1,32 @@ +=== tests/cases/compiler/constDeclarations-scopes2.ts === + +// global +const c = "string"; +>c : string + +var n: number; +>n : number + +var b: boolean; +>b : boolean + +// for scope +for (const c = 0; c < 10; n = c ) { +>c : number +>c < 10 : boolean +>c : number +>n = c : number +>n : number +>c : number + + // for block + const c = false; +>c : boolean + + b = c; +>b = c : boolean +>b : boolean +>c : boolean +} + + diff --git a/tests/baselines/reference/constDeclarations-useBeforeDefinition.errors.txt b/tests/baselines/reference/constDeclarations-useBeforeDefinition.errors.txt new file mode 100644 index 00000000000..97cf58c6e9d --- /dev/null +++ b/tests/baselines/reference/constDeclarations-useBeforeDefinition.errors.txt @@ -0,0 +1,21 @@ +tests/cases/compiler/constDeclarations-useBeforeDefinition.ts(3,5): error TS2448: Block-scoped variable 'c1' used before its declaration. +tests/cases/compiler/constDeclarations-useBeforeDefinition.ts(9,5): error TS2448: Block-scoped variable 'v1' used before its declaration. + + +==== tests/cases/compiler/constDeclarations-useBeforeDefinition.ts (2 errors) ==== + + { + c1; + ~~ +!!! error TS2448: Block-scoped variable 'c1' used before its declaration. + const c1 = 0; + } + + var v1; + { + v1; + ~~ +!!! error TS2448: Block-scoped variable 'v1' used before its declaration. + const v1 = 0; + } + \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt b/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt new file mode 100644 index 00000000000..a4d28f51878 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/file1.ts(2,1): error TS2448: Block-scoped variable 'c' used before its declaration. + + +==== tests/cases/compiler/file1.ts (1 errors) ==== + + c; + ~ +!!! error TS2448: Block-scoped variable 'c' used before its declaration. + +==== tests/cases/compiler/file2.ts (0 errors) ==== + const c = 0; \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-validContexts.errors.txt b/tests/baselines/reference/constDeclarations-validContexts.errors.txt new file mode 100644 index 00000000000..7af16a53cbe --- /dev/null +++ b/tests/baselines/reference/constDeclarations-validContexts.errors.txt @@ -0,0 +1,129 @@ +tests/cases/compiler/constDeclarations-validContexts.ts(20,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. + + +==== tests/cases/compiler/constDeclarations-validContexts.ts (1 errors) ==== + + + // Control flow statements with blocks + if (true) { + const c1 = 0; + } + else { + const c2 = 0; + } + + while (true) { + const c3 = 0; + } + + do { + const c4 = 0; + } while (true); + + var obj; + with (obj) { + ~~~ +!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + const c5 = 0; + } + + for (var i = 0; i < 10; i++) { + const c6 = 0; + } + + for (var i2 in {}) { + const c7 = 0; + } + + if (true) { + label: const c8 = 0; + } + + while (false) { + label2: label3: label4: const c9 = 0; + } + + // Try/catch/finally + try { + const c10 = 0; + } + catch (e) { + const c11 = 0; + } + finally { + const c12 = 0; + } + + // Switch + switch (0) { + case 0: + const c13 = 0; + break; + default: + const c14 = 0; + break; + } + + // blocks + { + const c15 = 0; + { + const c16 = 0 + label17: const c17 = 0; + } + } + + // global + const c18 = 0; + + // functions + function F() { + const c19 = 0; + } + + var F2 = () => { + const c20 = 0; + }; + + var F3 = function () { + const c21 = 0; + }; + + // modules + module m { + const c22 = 0; + + { + const c23 = 0; + } + } + + // methods + class C { + constructor() { + const c24 = 0; + } + + method() { + const c25 = 0; + } + + get v() { + const c26 = 0; + return c26; + } + + set v(value) { + const c27 = value; + } + } + + // object literals + var o = { + f() { + const c28 = 0; + }, + f2: () => { + const c29 = 0; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-validContexts.js b/tests/baselines/reference/constDeclarations-validContexts.js new file mode 100644 index 00000000000..355f39af2f2 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-validContexts.js @@ -0,0 +1,229 @@ +//// [constDeclarations-validContexts.ts] + + +// Control flow statements with blocks +if (true) { + const c1 = 0; +} +else { + const c2 = 0; +} + +while (true) { + const c3 = 0; +} + +do { + const c4 = 0; +} while (true); + +var obj; +with (obj) { + const c5 = 0; +} + +for (var i = 0; i < 10; i++) { + const c6 = 0; +} + +for (var i2 in {}) { + const c7 = 0; +} + +if (true) { + label: const c8 = 0; +} + +while (false) { + label2: label3: label4: const c9 = 0; +} + +// Try/catch/finally +try { + const c10 = 0; +} +catch (e) { + const c11 = 0; +} +finally { + const c12 = 0; +} + +// Switch +switch (0) { + case 0: + const c13 = 0; + break; + default: + const c14 = 0; + break; +} + +// blocks +{ + const c15 = 0; + { + const c16 = 0 + label17: const c17 = 0; + } +} + +// global +const c18 = 0; + +// functions +function F() { + const c19 = 0; +} + +var F2 = () => { + const c20 = 0; +}; + +var F3 = function () { + const c21 = 0; +}; + +// modules +module m { + const c22 = 0; + + { + const c23 = 0; + } +} + +// methods +class C { + constructor() { + const c24 = 0; + } + + method() { + const c25 = 0; + } + + get v() { + const c26 = 0; + return c26; + } + + set v(value) { + const c27 = value; + } +} + +// object literals +var o = { + f() { + const c28 = 0; + }, + f2: () => { + const c29 = 0; + } +} + +//// [constDeclarations-validContexts.js] +// Control flow statements with blocks +if (true) { + const c1 = 0; +} +else { + const c2 = 0; +} +while (true) { + const c3 = 0; +} +do { + const c4 = 0; +} while (true); +var obj; +with (obj) { + const c5 = 0; +} +for (var i = 0; i < 10; i++) { + const c6 = 0; +} +for (var i2 in {}) { + const c7 = 0; +} +if (true) { + label: const c8 = 0; +} +while (false) { + label2: label3: label4: const c9 = 0; +} +try { + const c10 = 0; +} +catch (e) { + const c11 = 0; +} +finally { + const c12 = 0; +} +switch (0) { + case 0: + const c13 = 0; + break; + default: + const c14 = 0; + break; +} +{ + const c15 = 0; + { + const c16 = 0; + label17: const c17 = 0; + } +} +// global +const c18 = 0; +// functions +function F() { + const c19 = 0; +} +var F2 = function () { + const c20 = 0; +}; +var F3 = function () { + const c21 = 0; +}; +// modules +var m; +(function (m) { + const c22 = 0; + { + const c23 = 0; + } +})(m || (m = {})); +// methods +var C = (function () { + function C() { + const c24 = 0; + } + C.prototype.method = function () { + const c25 = 0; + }; + Object.defineProperty(C.prototype, "v", { + get: function () { + const c26 = 0; + return c26; + }, + set: function (value) { + const c27 = value; + }, + enumerable: true, + configurable: true + }); + return C; +})(); +// object literals +var o = { + f: function () { + const c28 = 0; + }, + f2: function () { + const c29 = 0; + } +}; diff --git a/tests/baselines/reference/constDeclarations.js b/tests/baselines/reference/constDeclarations.js new file mode 100644 index 00000000000..060c0aba61c --- /dev/null +++ b/tests/baselines/reference/constDeclarations.js @@ -0,0 +1,30 @@ +//// [constDeclarations.ts] + +// No error +const c1 = false; +const c2: number = 23; +const c3 = 0, c4 :string = "", c5 = null; + + +for(const c4 = 0; c4 < 9; ) { break; } + + +for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + +//// [constDeclarations.js] +// No error +const c1 = false; +const c2 = 23; +const c3 = 0, c4 = "", c5 = null; +for (const c4 = 0; c4 < 9;) { + break; +} +for (const c5 = 0, c6 = 0; c5 < c6;) { + break; +} + + +//// [constDeclarations.d.ts] +declare const c1: boolean; +declare const c2: number; +declare const c3: number, c4: string, c5: any; diff --git a/tests/baselines/reference/constDeclarations.types b/tests/baselines/reference/constDeclarations.types new file mode 100644 index 00000000000..e82a2f0035f --- /dev/null +++ b/tests/baselines/reference/constDeclarations.types @@ -0,0 +1,28 @@ +=== tests/cases/compiler/constDeclarations.ts === + +// No error +const c1 = false; +>c1 : boolean + +const c2: number = 23; +>c2 : number + +const c3 = 0, c4 :string = "", c5 = null; +>c3 : number +>c4 : string +>c5 : any + + +for(const c4 = 0; c4 < 9; ) { break; } +>c4 : number +>c4 < 9 : boolean +>c4 : number + + +for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } +>c5 : number +>c6 : number +>c5 < c6 : boolean +>c5 : number +>c6 : number + diff --git a/tests/baselines/reference/constDeclarations2.js b/tests/baselines/reference/constDeclarations2.js new file mode 100644 index 00000000000..e4ee67ebdcd --- /dev/null +++ b/tests/baselines/reference/constDeclarations2.js @@ -0,0 +1,26 @@ +//// [constDeclarations2.ts] + +// No error +module M { + export const c1 = false; + export const c2: number = 23; + export const c3 = 0, c4 :string = "", c5 = null; +} + + +//// [constDeclarations2.js] +// No error +var M; +(function (M) { + M.c1 = false; + M.c2 = 23; + M.c3 = 0, M.c4 = "", M.c5 = null; +})(M || (M = {})); + + +//// [constDeclarations2.d.ts] +declare module M { + const c1: boolean; + const c2: number; + const c3: number, c4: string, c5: any; +} diff --git a/tests/baselines/reference/constDeclarations2.types b/tests/baselines/reference/constDeclarations2.types new file mode 100644 index 00000000000..c81eca96b0d --- /dev/null +++ b/tests/baselines/reference/constDeclarations2.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/constDeclarations2.ts === + +// No error +module M { +>M : typeof M + + export const c1 = false; +>c1 : boolean + + export const c2: number = 23; +>c2 : number + + export const c3 = 0, c4 :string = "", c5 = null; +>c3 : number +>c4 : string +>c5 : any +} + diff --git a/tests/baselines/reference/constEnumDeclarations.js b/tests/baselines/reference/constEnumDeclarations.js new file mode 100644 index 00000000000..1cbacb13bbd --- /dev/null +++ b/tests/baselines/reference/constEnumDeclarations.js @@ -0,0 +1,28 @@ +//// [constEnumDeclarations.ts] + +const enum E { + A = 1, + B = 2, + C = A | B +} + +const enum E2 { + A = 1, + B, + C +} + +//// [constEnumDeclarations.js] + + +//// [constEnumDeclarations.d.ts] +declare const enum E { + A = 1, + B = 2, + C = 3, +} +declare const enum E2 { + A = 1, + B = 2, + C = 3, +} diff --git a/tests/baselines/reference/constEnumDeclarations.types b/tests/baselines/reference/constEnumDeclarations.types new file mode 100644 index 00000000000..9dc87eadef7 --- /dev/null +++ b/tests/baselines/reference/constEnumDeclarations.types @@ -0,0 +1,30 @@ +=== tests/cases/compiler/constEnumDeclarations.ts === + +const enum E { +>E : E + + A = 1, +>A : E + + B = 2, +>B : E + + C = A | B +>C : E +>A | B : number +>A : E +>B : E +} + +const enum E2 { +>E2 : E2 + + A = 1, +>A : E2 + + B, +>B : E2 + + C +>C : E2 +} diff --git a/tests/baselines/reference/constEnumErrors.errors.txt b/tests/baselines/reference/constEnumErrors.errors.txt new file mode 100644 index 00000000000..541f814af98 --- /dev/null +++ b/tests/baselines/reference/constEnumErrors.errors.txt @@ -0,0 +1,85 @@ +tests/cases/compiler/constEnumErrors.ts(1,12): error TS2300: Duplicate identifier 'E'. +tests/cases/compiler/constEnumErrors.ts(5,8): error TS2300: Duplicate identifier 'E'. +tests/cases/compiler/constEnumErrors.ts(12,9): error TS4083: In 'const' enum declarations member initializer must be constant expression. +tests/cases/compiler/constEnumErrors.ts(14,9): error TS4083: In 'const' enum declarations member initializer must be constant expression. +tests/cases/compiler/constEnumErrors.ts(15,10): error TS4083: In 'const' enum declarations member initializer must be constant expression. +tests/cases/compiler/constEnumErrors.ts(22,13): error TS4085: Index expression arguments in 'const' enums must be of type 'string'. +tests/cases/compiler/constEnumErrors.ts(24,13): error TS4085: Index expression arguments in 'const' enums must be of type 'string'. +tests/cases/compiler/constEnumErrors.ts(26,9): error TS4084: '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/compiler/constEnumErrors.ts(27,10): error TS4084: '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/compiler/constEnumErrors.ts(32,5): error TS4084: '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/compiler/constEnumErrors.ts(40,9): error TS4086: 'const' enum member initializer was evaluated to a non-finite value. +tests/cases/compiler/constEnumErrors.ts(41,9): error TS4086: 'const' enum member initializer was evaluated to a non-finite value. +tests/cases/compiler/constEnumErrors.ts(42,9): error TS4087: 'const' enum member initializer was evaluated to disallowed value 'NaN'. + + +==== tests/cases/compiler/constEnumErrors.ts (13 errors) ==== + const enum E { + ~ +!!! error TS2300: Duplicate identifier 'E'. + A + } + + module E { + ~ +!!! error TS2300: Duplicate identifier 'E'. + var x = 1; + } + + const enum E1 { + // illegal case + // forward reference to the element of the same enum + X = Y, + ~ +!!! error TS4083: In 'const' enum declarations member initializer must be constant expression. + // forward reference to the element of the same enum + Y = E1.Z, + ~~~~ +!!! error TS4083: In 'const' enum declarations member initializer must be constant expression. + Y1 = E1["Z"] + ~~~~~~~ +!!! error TS4083: In 'const' enum declarations member initializer must be constant expression. + } + + const enum E2 { + A + } + + var y0 = E2[1] + ~ +!!! error TS4085: Index expression arguments in 'const' enums must be of type 'string'. + var name = "A"; + var y1 = E2[name]; + ~~~~ +!!! error TS4085: Index expression arguments in 'const' enums must be of type 'string'. + + var x = E2; + ~~ +!!! error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. + var y = [E2]; + ~~ +!!! error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. + + function foo(t: any): void { + } + + foo(E2); + ~~ +!!! error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. + + const enum NaNOrInfinity { + A = 9007199254740992, + B = A * A, + C = B * B, + D = C * C, + E = D * D, + F = E * E, // overflow + ~~~~~ +!!! error TS4086: 'const' enum member initializer was evaluated to a non-finite value. + G = 1 / 0, // overflow + ~~~~~ +!!! error TS4086: 'const' enum member initializer was evaluated to a non-finite value. + H = 0 / 0 // NaN + ~~~~~ +!!! error TS4087: 'const' enum member initializer was evaluated to disallowed value 'NaN'. + } \ No newline at end of file diff --git a/tests/baselines/reference/constEnumExternalModule.js b/tests/baselines/reference/constEnumExternalModule.js new file mode 100644 index 00000000000..4054ba788cb --- /dev/null +++ b/tests/baselines/reference/constEnumExternalModule.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/constEnumExternalModule.ts] //// + +//// [m1.ts] +const enum E { + V = 100 +} + +export = E +//// [m2.ts] +import A = require('m1') +var v = A.V; + +//// [m1.js] +define(["require", "exports"], function (require, exports) { +}); +//// [m2.js] +define(["require", "exports"], function (require, exports) { + var v = 100 /* V */; +}); diff --git a/tests/baselines/reference/constEnumExternalModule.types b/tests/baselines/reference/constEnumExternalModule.types new file mode 100644 index 00000000000..9c7b43a24d4 --- /dev/null +++ b/tests/baselines/reference/constEnumExternalModule.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/m2.ts === +import A = require('m1') +>A : typeof A + +var v = A.V; +>v : A +>A.V : A +>A : typeof A +>V : A + +=== tests/cases/compiler/m1.ts === +const enum E { +>E : E + + V = 100 +>V : E +} + +export = E +>E : E + diff --git a/tests/baselines/reference/constEnums.js b/tests/baselines/reference/constEnums.js new file mode 100644 index 00000000000..4f85cc59d0e --- /dev/null +++ b/tests/baselines/reference/constEnums.js @@ -0,0 +1,223 @@ +//// [constEnums.ts] +const enum Enum1 { + A0 = 100, +} + +const enum Enum1 { + // correct cases + A, + B, + C = 10, + D = A | B, + E = A | 1, + F = 1 | A, + G = (1 & 1), + H = ~(A | B), + I = A >>> 1, + J = 1 & A, + K = ~(1 | 5), + L = ~D, + M = E << B, + N = E << 1, + O = E >> B, + P = E >> 1, + Q = -D, + R = C & 5, + S = 5 & C, + T = C | D, + U = C | 1, + V = 10 | D, + W = Enum1.V, + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, + W2 = Enum1.A0, + W3 = Enum1["A0"], + W4 = Enum1["W"], +} + + +module A { + export module B { + export module C { + export const enum E { + V1 = 1, + V2 = A.B.C.E.V1 | 100 + } + } + } +} + +module A { + export module B { + export module C { + export const enum E { + V3 = A.B.C.E["V2"] & 200, + } + } + } +} + +module A1 { + export module B { + export module C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + } +} + +module A2 { + export module B { + export module C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + // module C will be classified as value + export module C { + var x = 1 + } + } +} + +import I = A.B.C.E; +import I1 = A1.B; +import I2 = A2.B; + +function foo0(e: I): void { + if (e === I.V1) { + } + else if (e === I.V2) { + } +} + +function foo1(e: I1.C.E): void { + if (e === I1.C.E.V1) { + } + else if (e === I1.C.E.V2) { + } +} + +function foo2(e: I2.C.E): void { + if (e === I2.C.E.V1) { + } + else if (e === I2.C.E.V2) { + } +} + + +function foo(x: Enum1) { + switch (x) { + case Enum1.A: + case Enum1.B: + case Enum1.C: + case Enum1.D: + case Enum1.E: + case Enum1.F: + case Enum1.G: + case Enum1.H: + case Enum1.I: + case Enum1.J: + case Enum1.K: + case Enum1.L: + case Enum1.M: + case Enum1.N: + case Enum1.O: + case Enum1.P: + case Enum1.Q: + case Enum1.R: + case Enum1.S: + case Enum1["T"]: + case Enum1.U: + case Enum1.V: + case Enum1.W: + case Enum1.W1: + case Enum1.W2: + case Enum1.W3: + case Enum1.W4: + break; + } +} + +function bar(e: A.B.C.E): number { + switch (e) { + case A.B.C.E.V1: return 1; + case A.B.C.E.V2: return 1; + case A.B.C.E.V3: return 1; + } +} + +//// [constEnums.js] +var A2; +(function (A2) { + var B; + (function (B) { + // module C will be classified as value + var C; + (function (C) { + var x = 1; + })(C = B.C || (B.C = {})); + })(B = A2.B || (A2.B = {})); +})(A2 || (A2 = {})); +var I2 = A2.B; +function foo0(e) { + if (e === 1 /* V1 */) { + } + else if (e === 101 /* V2 */) { + } +} +function foo1(e) { + if (e === 10 /* V1 */) { + } + else if (e === 110 /* V2 */) { + } +} +function foo2(e) { + if (e === 10 /* V1 */) { + } + else if (e === 110 /* V2 */) { + } +} +function foo(x) { + switch (x) { + case 0 /* A */: + case 1 /* B */: + case 10 /* C */: + case 1 /* D */: + case 1 /* E */: + case 1 /* F */: + case 1 /* G */: + case -2 /* H */: + case 0 /* I */: + case 0 /* J */: + case -6 /* K */: + case -2 /* L */: + case 2 /* M */: + case 2 /* N */: + case 0 /* O */: + case 0 /* P */: + case -1 /* Q */: + case 0 /* R */: + case 0 /* S */: + case 11 /* "T" */: + case 11 /* U */: + case 11 /* V */: + case 11 /* W */: + case 100 /* W1 */: + case 100 /* W2 */: + case 100 /* W3 */: + case 11 /* W4 */: + break; + } +} +function bar(e) { + switch (e) { + case 1 /* V1 */: return 1; + case 101 /* V2 */: return 1; + case 64 /* V3 */: return 1; + } +} diff --git a/tests/baselines/reference/constEnums.types b/tests/baselines/reference/constEnums.types new file mode 100644 index 00000000000..396b2e1c32b --- /dev/null +++ b/tests/baselines/reference/constEnums.types @@ -0,0 +1,556 @@ +=== tests/cases/compiler/constEnums.ts === +const enum Enum1 { +>Enum1 : Enum1 + + A0 = 100, +>A0 : Enum1 +} + +const enum Enum1 { +>Enum1 : Enum1 + + // correct cases + A, +>A : Enum1 + + B, +>B : Enum1 + + C = 10, +>C : Enum1 + + D = A | B, +>D : Enum1 +>A | B : number +>A : Enum1 +>B : Enum1 + + E = A | 1, +>E : Enum1 +>A | 1 : number +>A : Enum1 + + F = 1 | A, +>F : Enum1 +>1 | A : number +>A : Enum1 + + G = (1 & 1), +>G : Enum1 +>(1 & 1) : number +>1 & 1 : number + + H = ~(A | B), +>H : Enum1 +>~(A | B) : number +>(A | B) : number +>A | B : number +>A : Enum1 +>B : Enum1 + + I = A >>> 1, +>I : Enum1 +>A >>> 1 : number +>A : Enum1 + + J = 1 & A, +>J : Enum1 +>1 & A : number +>A : Enum1 + + K = ~(1 | 5), +>K : Enum1 +>~(1 | 5) : number +>(1 | 5) : number +>1 | 5 : number + + L = ~D, +>L : Enum1 +>~D : number +>D : Enum1 + + M = E << B, +>M : Enum1 +>E << B : number +>E : Enum1 +>B : Enum1 + + N = E << 1, +>N : Enum1 +>E << 1 : number +>E : Enum1 + + O = E >> B, +>O : Enum1 +>E >> B : number +>E : Enum1 +>B : Enum1 + + P = E >> 1, +>P : Enum1 +>E >> 1 : number +>E : Enum1 + + Q = -D, +>Q : Enum1 +>-D : number +>D : Enum1 + + R = C & 5, +>R : Enum1 +>C & 5 : number +>C : Enum1 + + S = 5 & C, +>S : Enum1 +>5 & C : number +>C : Enum1 + + T = C | D, +>T : Enum1 +>C | D : number +>C : Enum1 +>D : Enum1 + + U = C | 1, +>U : Enum1 +>C | 1 : number +>C : Enum1 + + V = 10 | D, +>V : Enum1 +>10 | D : number +>D : Enum1 + + W = Enum1.V, +>W : Enum1 +>Enum1.V : Enum1 +>Enum1 : typeof Enum1 +>V : Enum1 + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, +>W1 : Enum1 +>A0 : Enum1 + + W2 = Enum1.A0, +>W2 : Enum1 +>Enum1.A0 : Enum1 +>Enum1 : typeof Enum1 +>A0 : Enum1 + + W3 = Enum1["A0"], +>W3 : Enum1 +>Enum1["A0"] : Enum1 +>Enum1 : typeof Enum1 + + W4 = Enum1["W"], +>W4 : Enum1 +>Enum1["W"] : Enum1 +>Enum1 : typeof Enum1 +} + + +module A { +>A : typeof A + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V1 = 1, +>V1 : E + + V2 = A.B.C.E.V1 | 100 +>V2 : E +>A.B.C.E.V1 | 100 : number +>A.B.C.E.V1 : E +>A.B.C.E : typeof E +>A.B.C : typeof C +>A.B : typeof B +>A : typeof A +>B : typeof B +>C : typeof C +>E : typeof E +>V1 : E + } + } + } +} + +module A { +>A : typeof A + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V3 = A.B.C.E["V2"] & 200, +>V3 : E +>A.B.C.E["V2"] & 200 : number +>A.B.C.E["V2"] : E +>A.B.C.E : typeof E +>A.B.C : typeof C +>A.B : typeof B +>A : typeof A +>B : typeof B +>C : typeof C +>E : typeof E + } + } + } +} + +module A1 { +>A1 : typeof A1 + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V1 = 10, +>V1 : E + + V2 = 110, +>V2 : E + } + } + } +} + +module A2 { +>A2 : typeof A2 + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V1 = 10, +>V1 : E + + V2 = 110, +>V2 : E + } + } + // module C will be classified as value + export module C { +>C : typeof C + + var x = 1 +>x : number + } + } +} + +import I = A.B.C.E; +>I : typeof I +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : I + +import I1 = A1.B; +>I1 : typeof I1 +>A1 : typeof A1 +>B : typeof I1 + +import I2 = A2.B; +>I2 : typeof I2 +>A2 : typeof A2 +>B : typeof I2 + +function foo0(e: I): void { +>foo0 : (e: I) => void +>e : I +>I : I + + if (e === I.V1) { +>e === I.V1 : boolean +>e : I +>I.V1 : I +>I : typeof I +>V1 : I + } + else if (e === I.V2) { +>e === I.V2 : boolean +>e : I +>I.V2 : I +>I : typeof I +>V2 : I + } +} + +function foo1(e: I1.C.E): void { +>foo1 : (e: I1.C.E) => void +>e : I1.C.E +>I1 : unknown +>C : unknown +>E : I1.C.E + + if (e === I1.C.E.V1) { +>e === I1.C.E.V1 : boolean +>e : I1.C.E +>I1.C.E.V1 : I1.C.E +>I1.C.E : typeof I1.C.E +>I1.C : typeof I1.C +>I1 : typeof I1 +>C : typeof I1.C +>E : typeof I1.C.E +>V1 : I1.C.E + } + else if (e === I1.C.E.V2) { +>e === I1.C.E.V2 : boolean +>e : I1.C.E +>I1.C.E.V2 : I1.C.E +>I1.C.E : typeof I1.C.E +>I1.C : typeof I1.C +>I1 : typeof I1 +>C : typeof I1.C +>E : typeof I1.C.E +>V2 : I1.C.E + } +} + +function foo2(e: I2.C.E): void { +>foo2 : (e: I2.C.E) => void +>e : I2.C.E +>I2 : unknown +>C : unknown +>E : I2.C.E + + if (e === I2.C.E.V1) { +>e === I2.C.E.V1 : boolean +>e : I2.C.E +>I2.C.E.V1 : I2.C.E +>I2.C.E : typeof I2.C.E +>I2.C : typeof I2.C +>I2 : typeof I2 +>C : typeof I2.C +>E : typeof I2.C.E +>V1 : I2.C.E + } + else if (e === I2.C.E.V2) { +>e === I2.C.E.V2 : boolean +>e : I2.C.E +>I2.C.E.V2 : I2.C.E +>I2.C.E : typeof I2.C.E +>I2.C : typeof I2.C +>I2 : typeof I2 +>C : typeof I2.C +>E : typeof I2.C.E +>V2 : I2.C.E + } +} + + +function foo(x: Enum1) { +>foo : (x: Enum1) => void +>x : Enum1 +>Enum1 : Enum1 + + switch (x) { +>x : Enum1 + + case Enum1.A: +>Enum1.A : Enum1 +>Enum1 : typeof Enum1 +>A : Enum1 + + case Enum1.B: +>Enum1.B : Enum1 +>Enum1 : typeof Enum1 +>B : Enum1 + + case Enum1.C: +>Enum1.C : Enum1 +>Enum1 : typeof Enum1 +>C : Enum1 + + case Enum1.D: +>Enum1.D : Enum1 +>Enum1 : typeof Enum1 +>D : Enum1 + + case Enum1.E: +>Enum1.E : Enum1 +>Enum1 : typeof Enum1 +>E : Enum1 + + case Enum1.F: +>Enum1.F : Enum1 +>Enum1 : typeof Enum1 +>F : Enum1 + + case Enum1.G: +>Enum1.G : Enum1 +>Enum1 : typeof Enum1 +>G : Enum1 + + case Enum1.H: +>Enum1.H : Enum1 +>Enum1 : typeof Enum1 +>H : Enum1 + + case Enum1.I: +>Enum1.I : Enum1 +>Enum1 : typeof Enum1 +>I : Enum1 + + case Enum1.J: +>Enum1.J : Enum1 +>Enum1 : typeof Enum1 +>J : Enum1 + + case Enum1.K: +>Enum1.K : Enum1 +>Enum1 : typeof Enum1 +>K : Enum1 + + case Enum1.L: +>Enum1.L : Enum1 +>Enum1 : typeof Enum1 +>L : Enum1 + + case Enum1.M: +>Enum1.M : Enum1 +>Enum1 : typeof Enum1 +>M : Enum1 + + case Enum1.N: +>Enum1.N : Enum1 +>Enum1 : typeof Enum1 +>N : Enum1 + + case Enum1.O: +>Enum1.O : Enum1 +>Enum1 : typeof Enum1 +>O : Enum1 + + case Enum1.P: +>Enum1.P : Enum1 +>Enum1 : typeof Enum1 +>P : Enum1 + + case Enum1.Q: +>Enum1.Q : Enum1 +>Enum1 : typeof Enum1 +>Q : Enum1 + + case Enum1.R: +>Enum1.R : Enum1 +>Enum1 : typeof Enum1 +>R : Enum1 + + case Enum1.S: +>Enum1.S : Enum1 +>Enum1 : typeof Enum1 +>S : Enum1 + + case Enum1["T"]: +>Enum1["T"] : Enum1 +>Enum1 : typeof Enum1 + + case Enum1.U: +>Enum1.U : Enum1 +>Enum1 : typeof Enum1 +>U : Enum1 + + case Enum1.V: +>Enum1.V : Enum1 +>Enum1 : typeof Enum1 +>V : Enum1 + + case Enum1.W: +>Enum1.W : Enum1 +>Enum1 : typeof Enum1 +>W : Enum1 + + case Enum1.W1: +>Enum1.W1 : Enum1 +>Enum1 : typeof Enum1 +>W1 : Enum1 + + case Enum1.W2: +>Enum1.W2 : Enum1 +>Enum1 : typeof Enum1 +>W2 : Enum1 + + case Enum1.W3: +>Enum1.W3 : Enum1 +>Enum1 : typeof Enum1 +>W3 : Enum1 + + case Enum1.W4: +>Enum1.W4 : Enum1 +>Enum1 : typeof Enum1 +>W4 : Enum1 + + break; + } +} + +function bar(e: A.B.C.E): number { +>bar : (e: I) => number +>e : I +>A : unknown +>B : unknown +>C : unknown +>E : I + + switch (e) { +>e : I + + case A.B.C.E.V1: return 1; +>A.B.C.E.V1 : I +>A.B.C.E : typeof I +>A.B.C : typeof A.B.C +>A.B : typeof A.B +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : typeof I +>V1 : I + + case A.B.C.E.V2: return 1; +>A.B.C.E.V2 : I +>A.B.C.E : typeof I +>A.B.C : typeof A.B.C +>A.B : typeof A.B +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : typeof I +>V2 : I + + case A.B.C.E.V3: return 1; +>A.B.C.E.V3 : I +>A.B.C.E : typeof I +>A.B.C : typeof A.B.C +>A.B : typeof A.B +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : typeof I +>V3 : I + } +} diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt index 3501f1b79be..b0a4a871f21 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/constantOverloadFunctionNoSubtypeError.ts(6,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/constantOverloadFunctionNoSubtypeError.ts(7,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/constantOverloadFunctionNoSubtypeError.ts(8,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/constantOverloadFunctionNoSubtypeError.ts (3 errors) ==== class Base { foo() { } } class Derived1 extends Base { bar() { } } @@ -6,13 +11,13 @@ function foo(tagName: 'canvas'): Derived3; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(tagName: 'div'): Derived2; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(tagName: 'span'): Derived1; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(tagName: number): Base; function foo(tagName: any): Base { diff --git a/tests/baselines/reference/constraintErrors1.errors.txt b/tests/baselines/reference/constraintErrors1.errors.txt index f081959d028..2a6ef4f120f 100644 --- a/tests/baselines/reference/constraintErrors1.errors.txt +++ b/tests/baselines/reference/constraintErrors1.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/constraintErrors1.ts(1,25): error TS2304: Cannot find name 'hm'. + + ==== tests/cases/compiler/constraintErrors1.ts (1 errors) ==== function foo5(test: T) { } ~~ -!!! Cannot find name 'hm'. \ No newline at end of file +!!! error TS2304: Cannot find name 'hm'. \ No newline at end of file diff --git a/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.errors.txt b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.errors.txt index 09a54bb89e9..15293f3953a 100644 --- a/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.errors.txt +++ b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(5,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(8,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(10,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(13,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(21,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(21,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts (6 errors) ==== // used to be valid, now an error to do this @@ -5,21 +13,21 @@ } function f>() { ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } interface I1> { // Error, any does not satisfy the constraint I1 ~~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } interface I2 { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } interface I4 T> { ~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } // No error @@ -29,9 +37,9 @@ function foo(v: V) => void>() { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } \ No newline at end of file diff --git a/tests/baselines/reference/constraintSatisfactionWithAny2.errors.txt b/tests/baselines/reference/constraintSatisfactionWithAny2.errors.txt index c3f3b04a441..b297d2be970 100644 --- a/tests/baselines/reference/constraintSatisfactionWithAny2.errors.txt +++ b/tests/baselines/reference/constraintSatisfactionWithAny2.errors.txt @@ -1,10 +1,13 @@ +tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny2.ts(4,25): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny2.ts (1 errors) ==== // errors expected for type parameter cannot be referenced in the constraints of the same list // any is not a valid type argument unless there is no constraint, or the constraint is any declare function foo(x: U) => Z>(y: T): Z; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var a: any; foo(a); diff --git a/tests/baselines/reference/constraints0.errors.txt b/tests/baselines/reference/constraints0.errors.txt index 1ace0a1b18f..217a7408fbd 100644 --- a/tests/baselines/reference/constraints0.errors.txt +++ b/tests/baselines/reference/constraints0.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/constraints0.ts(14,9): error TS2344: Type 'B' does not satisfy the constraint 'A'. + Property 'a' is missing in type 'B'. + + ==== tests/cases/compiler/constraints0.ts (1 errors) ==== interface A { a: number; @@ -14,7 +18,7 @@ var v1: C
; // should work var v2: C; // should not work ~~~~ -!!! Type 'B' does not satisfy the constraint 'A': -!!! Property 'a' is missing in type 'B'. +!!! error TS2344: Type 'B' does not satisfy the constraint 'A'. +!!! error TS2344: Property 'a' is missing in type 'B'. var y = v1.x.a; // 'a' should be of type 'number' \ No newline at end of file diff --git a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt index 13b6be52ae2..b7375989e6b 100644 --- a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt +++ b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/constraintsThatReferenceOtherContstraints1.ts(3,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/constraintsThatReferenceOtherContstraints1.ts(4,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/constraintsThatReferenceOtherContstraints1.ts (2 errors) ==== interface Object { } class Foo { } ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. class Bar { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. data: Foo; // Error 1 Type 'Object' does not satisfy the constraint 'T' for type parameter 'U extends T'. } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt index e33107575e4..51278fc3f44 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts(61,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. + Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts (1 errors) ==== // Checking basic subtype relations with construct signatures @@ -61,10 +67,10 @@ // S's interface I2 extends Base2 { ~~ -!!! Interface 'I2' incorrectly extends interface 'Base2': -!!! Types of property 'a' are incompatible: -!!! Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number': -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'. +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: new (x: number) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt index 2d267d5a260..8d6273804f7 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt @@ -1,3 +1,19 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(41,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. + Types of property 'a2' are incompatible. + Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'. + Types of parameters 'x' and 'x' are incompatible. + Type 'T' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(50,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'. + Types of property 'a8' are incompatible. + Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts (2 errors) ==== // checking subtype relations for function types as it relates to contextual signature instantiation // error cases @@ -41,11 +57,11 @@ interface I2 extends A { ~~ -!!! Interface 'I2' incorrectly extends interface 'A': -!!! Types of property 'a2' are incompatible: -!!! Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a2' are incompatible. +!!! error TS2430: Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. a2: new (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic } @@ -56,15 +72,15 @@ interface I4 extends A { ~~ -!!! Interface 'I4' incorrectly extends interface 'A': -!!! Types of property 'a8' are incompatible: -!!! Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! Types of parameters 'arg2' and 'arg2' are incompatible: -!!! Type '{ foo: number; }' is not assignable to type 'Base': -!!! Types of property 'foo' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a8' are incompatible. +!!! error TS2430: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.errors.txt b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.errors.txt index 970bafa4927..d07dcad58c3 100644 --- a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.errors.txt +++ b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters.ts(16,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters.ts(20,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters.ts(24,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters.ts(28,10): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters.ts (4 errors) ==== // Parameter properties are only valid in constructor definitions, not even in other forms of construct signatures @@ -16,23 +22,23 @@ interface I { new (public x); ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } interface I2 { new (private x); ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } var a: { new (public x); ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } var b: { new (private x); ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.errors.txt b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.errors.txt index 5d208c89133..e12f3a59ca1 100644 --- a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.errors.txt +++ b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.errors.txt @@ -1,67 +1,93 @@ -==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts (15 errors) ==== +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,17): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,24): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,27): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,35): error TS2300: Duplicate identifier 'y'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(5,24): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(5,35): error TS2300: Duplicate identifier 'y'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(9,17): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(9,25): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(10,24): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(14,17): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(19,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(20,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(24,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(25,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(29,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(30,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(34,10): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(35,10): error TS2369: A parameter property is only allowed in a constructor implementation. + + +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts (18 errors) ==== // Parameter properties are not valid in overloads of constructors class C { constructor(public x, private y); ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~ +!!! error TS2300: Duplicate identifier 'x'. ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~ +!!! error TS2300: Duplicate identifier 'y'. constructor(public x, private y) { } ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. ~ -!!! Duplicate identifier 'y'. +!!! error TS2300: Duplicate identifier 'y'. } class C2 { constructor(private x); ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~ +!!! error TS2300: Duplicate identifier 'x'. constructor(public x) { } ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } class C3 { constructor(private x); ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. constructor(private y) { } } interface I { new (public x); ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. new (public x); ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } interface I2 { new (private x); ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. new (private x); ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } var a: { new (public x); ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. new (public y); ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } var b: { new (private x); ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. new (private y); ~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt b/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt index 2d08a7ae1c6..ceb828dd061 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt +++ b/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads2.ts(32,11): error TS2428: All declarations of an interface must have identical type parameters. + + ==== tests/cases/conformance/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads2.ts (1 errors) ==== // No errors expected for basic overloads of construct signatures with merged declarations @@ -32,7 +35,7 @@ interface I { ~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. new (x: T, y?: number): C2; new (x: T, y: number): C2; } diff --git a/tests/baselines/reference/constructorArgsErrors1.errors.txt b/tests/baselines/reference/constructorArgsErrors1.errors.txt index 2b7754f8600..639a1a8d18a 100644 --- a/tests/baselines/reference/constructorArgsErrors1.errors.txt +++ b/tests/baselines/reference/constructorArgsErrors1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/constructorArgsErrors1.ts(2,18): error TS1090: 'static' modifier cannot appear on a parameter. + + ==== tests/cases/compiler/constructorArgsErrors1.ts (1 errors) ==== class foo { constructor (static a: number) { ~~~~~~ -!!! 'static' modifier cannot appear on a parameter. +!!! error TS1090: 'static' modifier cannot appear on a parameter. } } \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgsErrors2.errors.txt b/tests/baselines/reference/constructorArgsErrors2.errors.txt index 75af2005138..dc60f1803bf 100644 --- a/tests/baselines/reference/constructorArgsErrors2.errors.txt +++ b/tests/baselines/reference/constructorArgsErrors2.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/constructorArgsErrors2.ts(2,25): error TS1090: 'static' modifier cannot appear on a parameter. + + ==== tests/cases/compiler/constructorArgsErrors2.ts (1 errors) ==== class foo { constructor (public static a: number) { ~~~~~~ -!!! 'static' modifier cannot appear on a parameter. +!!! error TS1090: 'static' modifier cannot appear on a parameter. } } \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgsErrors3.errors.txt b/tests/baselines/reference/constructorArgsErrors3.errors.txt index b01950da279..1eb4de31f6b 100644 --- a/tests/baselines/reference/constructorArgsErrors3.errors.txt +++ b/tests/baselines/reference/constructorArgsErrors3.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/constructorArgsErrors3.ts(2,25): error TS1028: Accessibility modifier already seen. + + ==== tests/cases/compiler/constructorArgsErrors3.ts (1 errors) ==== class foo { constructor (public public a: number) { ~~~~~~ -!!! Accessibility modifier already seen. +!!! error TS1028: Accessibility modifier already seen. } } \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgsErrors4.errors.txt b/tests/baselines/reference/constructorArgsErrors4.errors.txt index 431844358ee..44ca10ebff5 100644 --- a/tests/baselines/reference/constructorArgsErrors4.errors.txt +++ b/tests/baselines/reference/constructorArgsErrors4.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/constructorArgsErrors4.ts(2,26): error TS1028: Accessibility modifier already seen. + + ==== tests/cases/compiler/constructorArgsErrors4.ts (1 errors) ==== class foo { constructor (private public a: number) { ~~~~~~ -!!! Accessibility modifier already seen. +!!! error TS1028: Accessibility modifier already seen. } } \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgsErrors5.errors.txt b/tests/baselines/reference/constructorArgsErrors5.errors.txt index 176a2b7db06..04a4ea7fade 100644 --- a/tests/baselines/reference/constructorArgsErrors5.errors.txt +++ b/tests/baselines/reference/constructorArgsErrors5.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/constructorArgsErrors5.ts(2,18): error TS1090: 'export' modifier cannot appear on a parameter. + + ==== tests/cases/compiler/constructorArgsErrors5.ts (1 errors) ==== class foo { constructor (export a: number) { ~~~~~~ -!!! 'export' modifier cannot appear on a parameter. +!!! error TS1090: 'export' modifier cannot appear on a parameter. } } \ No newline at end of file diff --git a/tests/baselines/reference/constructorAsType.errors.txt b/tests/baselines/reference/constructorAsType.errors.txt index 1824ae98c82..b0d30295cde 100644 --- a/tests/baselines/reference/constructorAsType.errors.txt +++ b/tests/baselines/reference/constructorAsType.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/constructorAsType.ts(1,5): error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. + + ==== tests/cases/compiler/constructorAsType.ts (1 errors) ==== var Person:new () => {name: string;} = function () {return {name:"joe"};}; ~~~~~~ -!!! Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. +!!! error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. var Person2:{new() : {name:string;};}; diff --git a/tests/baselines/reference/constructorDefaultValuesReferencingThis.errors.txt b/tests/baselines/reference/constructorDefaultValuesReferencingThis.errors.txt index 07bd240bfab..b7b2ac330ca 100644 --- a/tests/baselines/reference/constructorDefaultValuesReferencingThis.errors.txt +++ b/tests/baselines/reference/constructorDefaultValuesReferencingThis.errors.txt @@ -1,18 +1,23 @@ +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorDefaultValuesReferencingThis.ts(2,21): error TS2333: 'this' cannot be referenced in constructor arguments. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorDefaultValuesReferencingThis.ts(6,21): error TS2333: 'this' cannot be referenced in constructor arguments. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorDefaultValuesReferencingThis.ts(10,28): error TS2333: 'this' cannot be referenced in constructor arguments. + + ==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorDefaultValuesReferencingThis.ts (3 errors) ==== class C { constructor(x = this) { } ~~~~ -!!! 'this' cannot be referenced in constructor arguments. +!!! error TS2333: 'this' cannot be referenced in constructor arguments. } class D { constructor(x = this) { } ~~~~ -!!! 'this' cannot be referenced in constructor arguments. +!!! error TS2333: 'this' cannot be referenced in constructor arguments. } class E { constructor(public x = this) { } ~~~~ -!!! 'this' cannot be referenced in constructor arguments. +!!! error TS2333: 'this' cannot be referenced in constructor arguments. } \ No newline at end of file diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt index 9e25a43bec6..2fb24c0d5d8 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt @@ -1,9 +1,15 @@ +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(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'. + + ==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts (4 errors) ==== class C { constructor(x); constructor(public x: string = 1) { // error ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var y = x; } } @@ -12,9 +18,9 @@ constructor(x: T, y: U); constructor(x: T = 1, public y: U = x) { // error ~~~~~~~~ -!!! Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type 'number' is not assignable to type 'T'. ~~~~~~~~~~~~~~~ -!!! Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. var z = x; } } @@ -23,7 +29,7 @@ constructor(x); constructor(x: T = new Date()) { // error ~~~~~~~~~~~~~~~~~ -!!! Type 'Date' is not assignable to type 'T'. +!!! error TS2322: Type 'Date' is not assignable to type 'T'. var y = x; } } \ No newline at end of file diff --git a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt index c2021bb97f1..8a15123dfc8 100644 --- a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt +++ b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts(9,9): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts (1 errors) ==== class D { @@ -9,5 +12,5 @@ var d = new D(); ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index c11e69d12bb..2e8c79d159a 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -1,17 +1,33 @@ -==== tests/cases/compiler/constructorOverloads1.ts (3 errors) ==== +tests/cases/compiler/constructorOverloads1.ts(2,5): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/constructorOverloads1.ts(16,18): error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'number'. +tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'number'. + + +==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ==== class Foo { constructor(s: string); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. constructor(n: number); - constructor(x: any) { - - } + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. constructor(x: any) { ~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! Multiple constructor implementations are not allowed. +!!! error TS2392: Multiple constructor implementations are not allowed. + constructor(x: any) { + ~~~~~~~~~~~~~~~~~~~~~ + + + } + ~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. bar1() { /*WScript.Echo("bar1");*/ } bar2() { /*WScript.Echo("bar1");*/ } } @@ -20,10 +36,10 @@ var f2 = new Foo(0); var f3 = new Foo(f1); ~~ -!!! Argument of type 'Foo' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'number'. var f4 = new Foo([f1,f2,f3]); ~~~~~~~~~~ -!!! Argument of type 'unknown[]' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'number'. f1.bar1(); f1.bar2(); diff --git a/tests/baselines/reference/constructorOverloads3.errors.txt b/tests/baselines/reference/constructorOverloads3.errors.txt index 0e106af99dc..4662a277f52 100644 --- a/tests/baselines/reference/constructorOverloads3.errors.txt +++ b/tests/baselines/reference/constructorOverloads3.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/constructorOverloads3.ts(12,5): error TS2377: Constructors for derived classes must contain a 'super' call. + + ==== tests/cases/compiler/constructorOverloads3.ts (1 errors) ==== declare class FooBase { constructor(s: string); @@ -12,7 +15,7 @@ constructor(a: any); constructor(x: any, y?: any) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Constructors for derived classes must contain a 'super' call. +!!! error TS2377: Constructors for derived classes must contain a 'super' call. bar1() { /*WScript.Echo("Yo");*/} } diff --git a/tests/baselines/reference/constructorOverloads4.errors.txt b/tests/baselines/reference/constructorOverloads4.errors.txt index 5f46390fae1..d2cc5ecd65b 100644 --- a/tests/baselines/reference/constructorOverloads4.errors.txt +++ b/tests/baselines/reference/constructorOverloads4.errors.txt @@ -1,21 +1,30 @@ -==== tests/cases/compiler/constructorOverloads4.ts (4 errors) ==== +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(11,1): error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'? + + +==== tests/cases/compiler/constructorOverloads4.ts (5 errors) ==== declare module M { export class Function { + ~~~~~~~~ +!!! error TS2300: Duplicate identifier 'Function'. constructor(...args: string[]); } export function Function(...args: any[]): any; ~~~~~~~~ -!!! Duplicate identifier 'Function'. +!!! error TS2300: Duplicate identifier 'Function'. export function Function(...args: string[]): Function; ~~~~~~~~ -!!! Duplicate identifier 'Function'. +!!! error TS2300: Duplicate identifier 'Function'. } (new M.Function("return 5"))(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. M.Function("yo"); ~~~~~~~~~~~~~~~~ -!!! Value of type 'typeof Function' is not callable. Did you mean to include 'new'? +!!! error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloads5.errors.txt b/tests/baselines/reference/constructorOverloads5.errors.txt index 706d9854e14..0a695fc001c 100644 --- a/tests/baselines/reference/constructorOverloads5.errors.txt +++ b/tests/baselines/reference/constructorOverloads5.errors.txt @@ -1,12 +1,21 @@ -==== tests/cases/compiler/constructorOverloads5.ts (1 errors) ==== +tests/cases/compiler/constructorOverloads5.ts(4,21): error TS2300: Duplicate identifier 'RegExp'. +tests/cases/compiler/constructorOverloads5.ts(5,21): error TS2300: Duplicate identifier 'RegExp'. +tests/cases/compiler/constructorOverloads5.ts(6,18): error TS2300: Duplicate identifier 'RegExp'. + + +==== tests/cases/compiler/constructorOverloads5.ts (3 errors) ==== interface IArguments {} declare module M { export function RegExp(pattern: string): RegExp; + ~~~~~~ +!!! error TS2300: Duplicate identifier 'RegExp'. export function RegExp(pattern: string, flags: string): RegExp; + ~~~~~~ +!!! error TS2300: Duplicate identifier 'RegExp'. export class RegExp { ~~~~~~ -!!! Duplicate identifier 'RegExp'. +!!! error TS2300: Duplicate identifier 'RegExp'. constructor(pattern: string); constructor(pattern: string, flags: string); exec(string: string): string[]; diff --git a/tests/baselines/reference/constructorOverloads6.errors.txt b/tests/baselines/reference/constructorOverloads6.errors.txt index 42256f68f8d..d5cf2486fe1 100644 --- a/tests/baselines/reference/constructorOverloads6.errors.txt +++ b/tests/baselines/reference/constructorOverloads6.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/constructorOverloads6.ts(4,25): error TS1111: A constructor implementation cannot be declared in an ambient context. + + ==== tests/cases/compiler/constructorOverloads6.ts (1 errors) ==== declare class FooBase { constructor(s: string); constructor(n: number); constructor(x: any) { ~ -!!! A constructor implementation cannot be declared in an ambient context. +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. } bar1():void; diff --git a/tests/baselines/reference/constructorOverloads7.errors.txt b/tests/baselines/reference/constructorOverloads7.errors.txt index dab93a3cc27..e3409dbb399 100644 --- a/tests/baselines/reference/constructorOverloads7.errors.txt +++ b/tests/baselines/reference/constructorOverloads7.errors.txt @@ -1,5 +1,12 @@ -==== tests/cases/compiler/constructorOverloads7.ts (2 errors) ==== +tests/cases/compiler/constructorOverloads7.ts(1,15): error TS2300: Duplicate identifier 'Point'. +tests/cases/compiler/constructorOverloads7.ts(15,10): error TS2300: Duplicate identifier 'Point'. +tests/cases/compiler/constructorOverloads7.ts(22,18): error TS2384: Overload signatures must all be ambient or non-ambient. + + +==== tests/cases/compiler/constructorOverloads7.ts (3 errors) ==== declare class Point + ~~~~~ +!!! error TS2300: Duplicate identifier 'Point'. { x: number; y: number; @@ -15,7 +22,7 @@ // to be Point and return type is inferred to be void function Point(x, y) { ~~~~~ -!!! Duplicate identifier 'Point'. +!!! error TS2300: Duplicate identifier 'Point'. this.x = x; this.y = y; @@ -24,7 +31,7 @@ declare function EF1(a:number, b:number):number; ~~~ -!!! Overload signatures must all be ambient or non-ambient. +!!! error TS2384: Overload signatures must all be ambient or non-ambient. function EF1(a,b) { return a+b; } \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloads8.errors.txt b/tests/baselines/reference/constructorOverloads8.errors.txt index 15f43a432f8..ca79964ad3f 100644 --- a/tests/baselines/reference/constructorOverloads8.errors.txt +++ b/tests/baselines/reference/constructorOverloads8.errors.txt @@ -1,9 +1,15 @@ -==== tests/cases/compiler/constructorOverloads8.ts (1 errors) ==== +tests/cases/compiler/constructorOverloads8.ts(2,5): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/constructorOverloads8.ts(3,5): error TS2392: Multiple constructor implementations are not allowed. + + +==== tests/cases/compiler/constructorOverloads8.ts (2 errors) ==== class C { constructor(x) { } + ~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. constructor(y, x) { } // illegal, 2 constructor implementations ~~~~~~~~~~~~~~~~~~~~~ -!!! Multiple constructor implementations are not allowed. +!!! error TS2392: Multiple constructor implementations are not allowed. } class D { diff --git a/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt b/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt index f594e176269..8bb052da947 100644 --- a/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt +++ b/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt @@ -1,9 +1,13 @@ +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorOverloadsWithDefaultValues.ts(3,17): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorOverloadsWithDefaultValues.ts(10,17): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + + ==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorOverloadsWithDefaultValues.ts (2 errors) ==== class C { foo: string; constructor(x = 1); // error ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. constructor() { } } @@ -12,7 +16,7 @@ foo: string; constructor(x = 1); // error ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. constructor() { } } \ No newline at end of file diff --git a/tests/baselines/reference/constructorParameterProperties.errors.txt b/tests/baselines/reference/constructorParameterProperties.errors.txt index b92f2fd9a8c..ab9bebe9d2d 100644 --- a/tests/baselines/reference/constructorParameterProperties.errors.txt +++ b/tests/baselines/reference/constructorParameterProperties.errors.txt @@ -1,25 +1,39 @@ -==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts (3 errors) ==== +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(8,10): error TS2341: Property 'x' is private and only accessible within class 'C'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(9,10): error TS2445: Property 'z' is protected and only accessible within class 'C' and its subclasses. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(18,10): error TS2341: Property 'x' is private and only accessible within class 'D'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(19,12): error TS2339: Property 'a' does not exist on type 'D'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts(20,10): error TS2445: Property 'z' is protected and only accessible within class 'D' and its subclasses. + + +==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts (5 errors) ==== class C { y: string; - constructor(private x: string) { } + constructor(private x: string, protected z: string) { } } var c: C; var r = c.y; var r2 = c.x; // error ~~~ -!!! Property 'C.x' is inaccessible. +!!! error TS2341: Property 'x' is private and only accessible within class 'C'. + var r3 = c.z; // error + ~~~ +!!! error TS2445: Property 'z' is protected and only accessible within class 'C' and its subclasses. class D { y: T; - constructor(a: T, private x: T) { } + constructor(a: T, private x: T, protected z: T) { } } var d: D; var r = d.y; var r2 = d.x; // error ~~~ -!!! Property 'D.x' is inaccessible. +!!! error TS2341: Property 'x' is private and only accessible within class 'D'. var r3 = d.a; // error ~ -!!! Property 'a' does not exist on type 'D'. \ No newline at end of file +!!! error TS2339: Property 'a' does not exist on type 'D'. + var r4 = d.z; // error + ~~~ +!!! error TS2445: Property 'z' is protected and only accessible within class 'D' and its subclasses. + \ No newline at end of file diff --git a/tests/baselines/reference/constructorParameterProperties.js b/tests/baselines/reference/constructorParameterProperties.js index 37ba30d24b0..11446a316d3 100644 --- a/tests/baselines/reference/constructorParameterProperties.js +++ b/tests/baselines/reference/constructorParameterProperties.js @@ -1,36 +1,42 @@ //// [constructorParameterProperties.ts] class C { y: string; - constructor(private x: string) { } + constructor(private x: string, protected z: string) { } } var c: C; var r = c.y; var r2 = c.x; // error +var r3 = c.z; // error class D { y: T; - constructor(a: T, private x: T) { } + constructor(a: T, private x: T, protected z: T) { } } var d: D; var r = d.y; var r2 = d.x; // error -var r3 = d.a; // error +var r3 = d.a; // error +var r4 = d.z; // error + //// [constructorParameterProperties.js] var C = (function () { - function C(x) { + function C(x, z) { this.x = x; + this.z = z; } return C; })(); var c; var r = c.y; var r2 = c.x; // error +var r3 = c.z; // error var D = (function () { - function D(a, x) { + function D(a, x, z) { this.x = x; + this.z = z; } return D; })(); @@ -38,3 +44,4 @@ var d; var r = d.y; var r2 = d.x; // error var r3 = d.a; // error +var r4 = d.z; // error diff --git a/tests/baselines/reference/constructorParameterProperties2.errors.txt b/tests/baselines/reference/constructorParameterProperties2.errors.txt index b8b04833db8..42df015bc5b 100644 --- a/tests/baselines/reference/constructorParameterProperties2.errors.txt +++ b/tests/baselines/reference/constructorParameterProperties2.errors.txt @@ -1,4 +1,12 @@ -==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts (2 errors) ==== +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(10,5): error TS2300: Duplicate identifier 'y'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(11,24): error TS2300: Duplicate identifier 'y'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(18,5): error TS2300: Duplicate identifier 'y'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(19,25): error TS2300: Duplicate identifier 'y'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(26,5): error TS2300: Duplicate identifier 'y'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(27,27): error TS2300: Duplicate identifier 'y'. + + +==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts (6 errors) ==== class C { y: number; constructor(y: number) { } // ok @@ -9,9 +17,11 @@ class D { y: number; + ~ +!!! error TS2300: Duplicate identifier 'y'. constructor(public y: number) { } // error ~ -!!! Duplicate identifier 'y'. +!!! error TS2300: Duplicate identifier 'y'. } var d: D; @@ -19,10 +29,25 @@ class E { y: number; + ~ +!!! error TS2300: Duplicate identifier 'y'. constructor(private y: number) { } // error ~ -!!! Duplicate identifier 'y'. +!!! error TS2300: Duplicate identifier 'y'. } var e: E; - var r3 = e.y; // error \ No newline at end of file + var r3 = e.y; // error + + class F { + y: number; + ~ +!!! error TS2300: Duplicate identifier 'y'. + constructor(protected y: number) { } // error + ~ +!!! error TS2300: Duplicate identifier 'y'. + } + + var f: F; + var r4 = f.y; // error + \ No newline at end of file diff --git a/tests/baselines/reference/constructorParameterProperties2.js b/tests/baselines/reference/constructorParameterProperties2.js index 8ad0c8b6ea6..02e4cf82c84 100644 --- a/tests/baselines/reference/constructorParameterProperties2.js +++ b/tests/baselines/reference/constructorParameterProperties2.js @@ -21,7 +21,16 @@ class E { } var e: E; -var r3 = e.y; // error +var r3 = e.y; // error + +class F { + y: number; + constructor(protected y: number) { } // error +} + +var f: F; +var r4 = f.y; // error + //// [constructorParameterProperties2.js] var C = (function () { @@ -47,3 +56,11 @@ var E = (function () { })(); var e; var r3 = e.y; // error +var F = (function () { + function F(y) { + this.y = y; + } // error + return F; +})(); +var f; +var r4 = f.y; // error diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt index f784cd0b8bb..87af1b85f2d 100644 --- a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt @@ -1,3 +1,8 @@ +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(16,9): error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'y' declared in the constructor. + + ==== tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts (3 errors) ==== // Initializer expressions for instance member variables are evaluated in the scope of the class constructor // body but are not permitted to reference parameters or local variables of the constructor. @@ -8,11 +13,11 @@ class C { b = x; // error, evaluated in scope of constructor, cannot reference x ~ -!!! Initializer of instance member variable 'b' cannot reference identifier 'x' declared in the constructor. +!!! error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'x' declared in the constructor. constructor(x: string) { x = 2; // error, x is string ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } } @@ -20,7 +25,7 @@ class D { b = y; // error, evaluated in scope of constructor, cannot reference y ~ -!!! Initializer of instance member variable 'b' cannot reference identifier 'y' declared in the constructor. +!!! error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'y' declared in the constructor. constructor(x: string) { var y = ""; } diff --git a/tests/baselines/reference/constructorParametersInVariableDeclarations.errors.txt b/tests/baselines/reference/constructorParametersInVariableDeclarations.errors.txt index 4afccf82d93..3220a4cd87c 100644 --- a/tests/baselines/reference/constructorParametersInVariableDeclarations.errors.txt +++ b/tests/baselines/reference/constructorParametersInVariableDeclarations.errors.txt @@ -1,14 +1,22 @@ +tests/cases/compiler/constructorParametersInVariableDeclarations.ts(2,17): error TS2304: Cannot find name 'x'. +tests/cases/compiler/constructorParametersInVariableDeclarations.ts(3,22): error TS2304: Cannot find name 'x'. +tests/cases/compiler/constructorParametersInVariableDeclarations.ts(4,23): error TS2304: Cannot find name 'x'. +tests/cases/compiler/constructorParametersInVariableDeclarations.ts(10,17): error TS2304: Cannot find name 'x'. +tests/cases/compiler/constructorParametersInVariableDeclarations.ts(11,22): error TS2304: Cannot find name 'x'. +tests/cases/compiler/constructorParametersInVariableDeclarations.ts(12,23): error TS2304: Cannot find name 'x'. + + ==== tests/cases/compiler/constructorParametersInVariableDeclarations.ts (6 errors) ==== class A { private a = x; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. private b = { p: x }; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. private c = () => x; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. constructor(x: number) { } } @@ -16,13 +24,13 @@ class B { private a = x; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. private b = { p: x }; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. private c = () => x; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. constructor() { var x = 1; } diff --git a/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.errors.txt b/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.errors.txt index 92619b68154..35e281c2fb6 100644 --- a/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.errors.txt +++ b/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.errors.txt @@ -1,9 +1,13 @@ +tests/cases/compiler/constructorParametersThatShadowExternalNamesInVariableDeclarations.ts(3,17): error TS2301: Initializer of instance member variable 'a' cannot reference identifier 'x' declared in the constructor. +tests/cases/compiler/constructorParametersThatShadowExternalNamesInVariableDeclarations.ts(9,17): error TS2301: Initializer of instance member variable 'a' cannot reference identifier 'x' declared in the constructor. + + ==== tests/cases/compiler/constructorParametersThatShadowExternalNamesInVariableDeclarations.ts (2 errors) ==== var x = 1; class A { private a = x; ~ -!!! Initializer of instance member variable 'a' cannot reference identifier 'x' declared in the constructor. +!!! error TS2301: Initializer of instance member variable 'a' cannot reference identifier 'x' declared in the constructor. constructor(x: number) { } } @@ -11,7 +15,7 @@ class B { private a = x; ~ -!!! Initializer of instance member variable 'a' cannot reference identifier 'x' declared in the constructor. +!!! error TS2301: Initializer of instance member variable 'a' cannot reference identifier 'x' declared in the constructor. constructor() { var x = ""; } diff --git a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt index fb2ac126a91..2ebd59b3d93 100644 --- a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt +++ b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class + + ==== tests/cases/compiler/constructorReturnsInvalidType.ts (1 errors) ==== class X { constructor() { return 1; ~ -!!! Return type of constructor signature must be assignable to the instance type of the class +!!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } foo() { } } diff --git a/tests/baselines/reference/constructorStaticParamNameErrors.errors.txt b/tests/baselines/reference/constructorStaticParamNameErrors.errors.txt index 494c28e89e9..4739f54397c 100644 --- a/tests/baselines/reference/constructorStaticParamNameErrors.errors.txt +++ b/tests/baselines/reference/constructorStaticParamNameErrors.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/constructorStaticParamNameErrors.ts(4,18): error TS1003: Identifier expected. + + ==== tests/cases/compiler/constructorStaticParamNameErrors.ts (1 errors) ==== 'use strict' // static as constructor parameter name should give error if 'use strict' class test { constructor (static) { } ~~~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. } \ No newline at end of file diff --git a/tests/baselines/reference/constructorTypeWithTypeParameters.js b/tests/baselines/reference/constructorTypeWithTypeParameters.js index 195536d5b15..9b93d54ba89 100644 --- a/tests/baselines/reference/constructorTypeWithTypeParameters.js +++ b/tests/baselines/reference/constructorTypeWithTypeParameters.js @@ -12,6 +12,10 @@ var anotherVar; //// [constructorTypeWithTypeParameters.d.ts] -declare var X: new () => number; -declare var Y: new () => number; +declare var X: { + new (): number; +}; +declare var Y: { + new (): number; +}; declare var anotherVar: new () => number; diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt index 9fc31435515..f5ef669d31b 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt @@ -1,3 +1,7 @@ +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 TS2409: Return type of constructor signature must be assignable to the instance type of the class + + ==== tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts (2 errors) ==== // a class constructor may return an expression, it must be assignable to the class instance type to be valid @@ -12,7 +16,7 @@ constructor() { return 1; // error ~ -!!! Return type of constructor signature must be assignable to the instance type of the class +!!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } } @@ -28,7 +32,7 @@ constructor() { return { x: 1 }; // error ~~~~~~~~ -!!! Return type of constructor signature must be assignable to the instance type of the class +!!! 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 new file mode 100644 index 00000000000..53d24b3d0f8 --- /dev/null +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -0,0 +1,549 @@ +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,28): error TS1005: ':' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(24,29): error TS1005: ',' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,18): error TS1129: Statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: ',' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,33): error TS1138: Parameter declaration expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,34): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,36): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1129: Statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(38,17): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,41): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,45): error TS1002: Unterminated string literal. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(46,13): error TS1005: 'try' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(81,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(90,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(105,29): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(106,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(138,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(141,32): error TS1005: '{' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(143,13): error TS1005: 'try' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,24): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '(' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(205,28): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,36): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(227,13): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(234,14): error TS1005: '{' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,26): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(241,5): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,69): error TS1110: Type expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,31): error TS1005: ',' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,9): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error TS1135: Argument expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,59): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1129: Statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS1129: Statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,35): error TS1109: Expression expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(11,1): error TS2304: Cannot find name 'module'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(27,26): error TS2304: Cannot find name 'bfs'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,17): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,17): error TS2304: Cannot find name 'retValue'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(34,28): error TS2304: Cannot find name 'bfs'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,21): error TS2304: Cannot find name 'retValue'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,17): error TS2304: Cannot find name 'retValue'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,28): error TS2304: Cannot find name 'bfs'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2304: Cannot find name 'retValue'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS2304: Cannot find name 'console'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2304: Cannot find name 'console'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(166,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(213,16): error TS2304: Cannot find name 'bool'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,29): error TS2304: Cannot find name 'yield'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(223,23): error TS2304: Cannot find name 'bool'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,16): error TS2304: Cannot find name 'method1'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,24): error TS2304: Cannot find name 'val'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,28): error TS2304: Cannot find name 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,16): error TS2304: Cannot find name 'method2'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(246,25): error TS2339: Property 'method1' does not exist on type 'B'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,9): error TS2390: Constructor implementation is missing. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,21): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,44): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,16): error TS2304: Cannot find name 'Overloads'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,26): error TS2304: Cannot find name 'value'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,33): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,16): error TS2304: Cannot find name 'Overloads'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,35): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,52): error TS2304: Cannot find name 'string'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,16): error TS2304: Cannot find name 'DefaultValue'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error TS2304: Cannot find name 'value'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'. + + +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (88 errors) ==== + declare module "fs" { + export class File { + constructor(filename: string); + public ReadAllText(): string; + } + export interface IFile { + [index: number]: string; + } + } + + import fs = module("fs"); + ~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'module'. + + + module TypeScriptAllInOne { + export class Program { + static Main(...args: string[]) { + try { + var bfs = new BasicFeatures(); + var retValue: number = 0; + + retValue = bfs.VARIABLES(); + if (retValue != 0 ^= { + ~~ +!!! error TS1005: ')' expected. + ~ + + + return 1; + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS1005: ',' expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + case = bfs.STATEMENTS(4); + ~~~~ +!!! error TS1129: Statement expected. + ~~~ +!!! error TS2304: Cannot find name 'bfs'. + if (retValue != 0) { + ~~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1138: Parameter declaration expected. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + + return 1; + ^ + ~ +!!! error TS1129: Statement expected. + + + retValue = bfs.TYPES(); + ~~~~~~~~ +!!! error TS2304: Cannot find name 'retValue'. + ~~~ +!!! error TS2304: Cannot find name 'bfs'. + if (retValue != 0) { + ~~~~~~~~ +!!! error TS2304: Cannot find name 'retValue'. + + return 1 && + } + ~ +!!! error TS1109: Expression expected. + + retValue = bfs.OPERATOR ' ); + ~~~~ +!!! error TS1005: ';' expected. + +!!! error TS1002: Unterminated string literal. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'retValue'. + ~~~ +!!! error TS2304: Cannot find name 'bfs'. + if (retValue != 0) { + ~~~~~~~~ +!!! error TS2304: Cannot find name 'retValue'. + + return 1; + } + } + catch (e) { + ~~~~~ +!!! error TS1005: 'try' expected. + console.log(e); + ~~~~~~~ +!!! error TS2304: Cannot find name 'console'. + } + finally { + + } + + console.log('Done'); + ~~~~~~~ +!!! error TS2304: Cannot find name 'console'. + + return 0; + + } + } + ~ +!!! error TS1128: Declaration or statement expected. + + class BasicFeatures { + /// + /// Test various of variables. Including nullable,key world as variable,special format + /// + /// + public VARIABLES(): number { + var local = Number.MAX_VALUE; + var min = Number.MIN_VALUE; + var inf = Number.NEGATIVE_INFINITY - + var nan = Number.NaN; + ~~~ +!!! error TS1109: Expression expected. + var undef = undefined; + + var _\uD4A5\u7204\uC316\uE59F = local; + +!!! error TS1127: Invalid character. + var мир = local; + + var local5 = null; + var local6 = local5 instanceof fs.File; + + var hex = 0xBADC0DE, Hex = 0XDEADBEEF; + var float = 6.02e23, float2 = 6.02E-23 + var char = 'c', \u0066 = '\u0066', hexchar = '\x42' != + var quoted = '"', quoted2 = "'"; + ~~~ +!!! error TS1109: Expression expected. + var reg = /\w*/; + var objLit = { "var": number = 42, equals: function (x) { return x["var"] === 42; }, instanceof : () => 'objLit{42}' }; + var weekday = Weekdays.Monday; + + var con = char + f + hexchar + float.toString() + float2.toString() + reg.toString() + objLit + weekday; + + // + var any = 0 ^= + ~ +!!! error TS2364: Invalid left-hand side of assignment expression. + var bool = 0; + ~~~ +!!! error TS1109: Expression expected. + var declare = 0; + var constructor = 0; + var get = 0; + var implements = 0; + var interface = 0; + var let = 0; + var module = 0; + var number = 0; + var package = 0; + var private = 0; + var protected = 0; + var public = 0; + var set = 0; + var static = 0; + var string = 0 /> + ~ +!!! error TS1109: Expression expected. + var yield = 0; + ~~~ +!!! error TS1109: Expression expected. + + var sum3 = any + bool + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. + + return 0; + } + + /// + /// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally + /// + /// + /// + STATEMENTS(i: number): number { + var retVal = 0; + if (i == 1) + retVal = 1; + else + retVal = 0; + switch (i) { + case 2: + retVal = 1; + break; + case 3: + retVal = 1; + break; + default: + break; + } + + for (var x in { x: 0, y: 1 }) { + ! + + try { + ~~~ +!!! error TS1109: Expression expected. + throw null; + } + catch (Exception) ? + ~ +!!! error TS1005: '{' expected. + } + finally { + ~~~~~~~ +!!! error TS1005: 'try' expected. + try { } + catch (Exception) { } + } + + return retVal; + } + + /// + /// Test types in ts language. Including class,struct,interface,delegate,anonymous type + /// + /// + public TYPES(): number { + var retVal = 0; + var c = new CLASS(); + var xx: IF = c; + retVal += catch .Property; + ~~~~~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1005: '(' expected. + ~~~~~~~~ +!!! error TS2304: Cannot find name 'Property'. + retVal += c.Member(); + retVal += xx.Foo() ? 0 : 1; + + //anonymous type + var anony = { a: new CLASS() }; + + retVal += anony.a.d(); + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. + + return retVal; + } + + + ///// + ///// Test different operators + ///// + ///// + public OPERATOR(): number { + var a: number[] = [1, 2, 3, 4, 5, ];/*[] bug*/ // YES [] + var i = a[1];/*[]*/ + i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/ + var b = true && false || true ^ false;/*& | ^*/ + ~~~~~~~~~~~~ +!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. + b = !b;/*!*/ + i = ~i;/*~i*/ + b = i < (i - 1) && (i + 1) > i;/*< && >*/ + var f = true ? 1 : 0;/*? :*/ // YES : + i++;/*++*/ + i--;/*--*/ + b = true && false || true;/*&& ||*/ + i = i << 5;/*<<*/ + i = i >> 5;/*>>*/ + var j = i; + b = i == j && i != j && i <= j && i >= j;/*= == && != <= >=*/ + i += 5.0;/*+=*/ + i -= i;/*-=*/ + i *= i;/**=*/ + if (i == 0) + i++; + i /= i;/*/=*/ + i %= i;/*%=*/ + i &= i;/*&=*/ + i |= i;/*|=*/ + i ^= i;/*^=*/ + i <<= i;/*<<=*/ + i >>= i;/*>>=*/ + + if (i == 0 && != b && f == 1) + ~~ +!!! error TS1109: Expression expected. + return 0; + else return 1; + } + + } + + interface IF { + Foo(): bool; + ~~~~ +!!! error TS2304: Cannot find name 'bool'. + } + + class CLASS implements IF { + + case d = () => { yield 0; }; + ~~~~ +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! error TS1005: ';' expected. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + public get Property() { return 0; } + public Member() { + return 0; + } + public Foo(): bool { + ~~~~ +!!! error TS2304: Cannot find name 'bool'. + var myEvent = () => { return 1; }; + if (myEvent() == 1) + return true ? + else + ~~~~ +!!! error TS1109: Expression expected. + return false; + } + } + + + // todo: use these + class A . + ~ +!!! error TS1005: '{' expected. + public method1(val:number) { + ~~~~~~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1005: ';' expected. + ~~~~~~~ +!!! error TS2304: Cannot find name 'method1'. + ~~~ +!!! error TS2304: Cannot find name 'val'. + ~~~~~~ +!!! error TS2304: Cannot find name 'number'. + return val; + } + public method2() { + ~~~~~~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1005: ';' expected. + ~~~~~~~ +!!! error TS2304: Cannot find name 'method2'. + return 2 * this.method1(2); + } + } + ~ +!!! error TS1128: Declaration or statement expected. + + class B extends A { + + public method2() { + return this.method1(2); + ~~~~~~~ +!!! error TS2339: Property 'method1' does not exist on type 'B'. + } + } + + class Overloading { + + private otherValue = 42; + + constructor(private value: number, public name: string) : } + ~ +!!! error TS1110: Type expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2390: Constructor implementation is missing. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2369: A parameter property is only allowed in a constructor implementation. + + public Overloads(value: string); + ~~~~~~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1005: ',' expected. + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'Overloads'. + ~~~~~ +!!! error TS2304: Cannot find name 'value'. + ~~~~~~ +!!! error TS2304: Cannot find name 'string'. + public Overloads( while : string, ...rest: string[]) { & + ~~~~~~ +!!! error TS1128: Declaration or statement expected. + ~~~~~ +!!! error TS1135: Argument expression expected. + ~ +!!! error TS1005: '(' expected. + ~~~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1129: Statement expected. + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'Overloads'. + ~~~~~~ +!!! error TS2304: Cannot find name 'string'. + ~~~~~~ +!!! error TS2304: Cannot find name 'string'. + + public DefaultValue(value?: string = "Hello") { } + ~~~~~~ +!!! error TS1129: Statement expected. + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'DefaultValue'. + ~~~~~ +!!! error TS2304: Cannot find name 'value'. + ~~~~~~ +!!! error TS2304: Cannot find name 'string'. + } + } + ~ +!!! error TS1128: Declaration or statement expected. + + enum Weekdays { + Monday, + Tuesday, + Weekend, + } + + enum Fruit { + Apple, + Pear + } + + interface IDisposable { + Dispose(): void; + } + + TypeScriptAllInOne.Program.Main(); + \ No newline at end of file diff --git a/tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt b/tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt index d7ba7dcf92b..c4d0c7ffb66 100644 --- a/tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt @@ -1,12 +1,22 @@ +tests/cases/compiler/constructorsWithSpecializedSignatures.ts(3,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/constructorsWithSpecializedSignatures.ts(4,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/constructorsWithSpecializedSignatures.ts(17,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/constructorsWithSpecializedSignatures.ts(18,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/constructorsWithSpecializedSignatures.ts(20,5): error TS2381: A signature with an implementation cannot use a string literal type. +tests/cases/compiler/constructorsWithSpecializedSignatures.ts(28,5): error TS2381: A signature with an implementation cannot use a string literal type. +tests/cases/compiler/constructorsWithSpecializedSignatures.ts(33,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/constructorsWithSpecializedSignatures.ts(34,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/constructorsWithSpecializedSignatures.ts (8 errors) ==== // errors declare class C { constructor(x: "hi"); ~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. constructor(x: "foo"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. constructor(x: number); } @@ -21,14 +31,14 @@ class D { constructor(x: "hi"); ~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. constructor(x: "foo"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. constructor(x: number); constructor(x: "hi") { } ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! A signature with an implementation cannot use a string literal type. +!!! error TS2381: A signature with an implementation cannot use a string literal type. } // overloads are ok @@ -38,17 +48,17 @@ constructor(x: string); constructor(x: "hi") { } // error ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! A signature with an implementation cannot use a string literal type. +!!! error TS2381: A signature with an implementation cannot use a string literal type. } // errors interface I { new (x: "hi"); ~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. new (x: "foo"); ~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. new (x: number); } diff --git a/tests/baselines/reference/contextualSignatureInstantiation.js b/tests/baselines/reference/contextualSignatureInstantiation.js new file mode 100644 index 00000000000..11e19b3262e --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation.js @@ -0,0 +1,50 @@ +//// [contextualSignatureInstantiation.ts] +// TypeScript Spec, section 4.12.2: +// If e is an expression of a function type that contains exactly one generic call signature and no other members, +// and T is a function type with exactly one non - generic call signature and no other members, then any inferences +// made for type parameters referenced by the parameters of T's call signature are fixed, and e's type is changed +// to a function type with e's call signature instantiated in the context of T's call signature (section 3.8.5). + +declare function foo(cb: (x: number, y: string) => T): T; +declare function bar(x: T, y: U, cb: (x: T, y: U) => V): V; +declare function baz(x: T, y: T, cb: (x: T, y: T) => U): U; + +declare function g(x: T, y: T): T; +declare function h(x: T, y: U): T[] | U[]; + +var a: number; +var a = bar(1, 1, g); // Should be number +var a = baz(1, 1, g); // Should be number + +var b: number | string; +var b = foo(g); // Should be number | string +var b = bar(1, "one", g); // Should be number | string +var b = bar("one", 1, g); // Should be number | string +var b = baz(b, b, g); // Should be number | string + +var d: number[] | string[]; +var d = foo(h); // Should be number[] | string[] +var d = bar(1, "one", h); // Should be number[] | string[] +var d = bar("one", 1, h); // Should be number[] | string[] +var d = baz(d, d, g); // Should be number[] | string[] + + +//// [contextualSignatureInstantiation.js] +// TypeScript Spec, section 4.12.2: +// If e is an expression of a function type that contains exactly one generic call signature and no other members, +// and T is a function type with exactly one non - generic call signature and no other members, then any inferences +// made for type parameters referenced by the parameters of T's call signature are fixed, and e's type is changed +// to a function type with e's call signature instantiated in the context of T's call signature (section 3.8.5). +var a; +var a = bar(1, 1, g); // Should be number +var a = baz(1, 1, g); // Should be number +var b; +var b = foo(g); // Should be number | string +var b = bar(1, "one", g); // Should be number | string +var b = bar("one", 1, g); // Should be number | string +var b = baz(b, b, g); // Should be number | string +var d; +var d = foo(h); // Should be number[] | string[] +var d = bar(1, "one", h); // Should be number[] | string[] +var d = bar("one", 1, h); // Should be number[] | string[] +var d = baz(d, d, g); // Should be number[] | string[] diff --git a/tests/baselines/reference/contextualSignatureInstantiation.types b/tests/baselines/reference/contextualSignatureInstantiation.types new file mode 100644 index 00000000000..4363272622a --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation.types @@ -0,0 +1,142 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts === +// TypeScript Spec, section 4.12.2: +// If e is an expression of a function type that contains exactly one generic call signature and no other members, +// and T is a function type with exactly one non - generic call signature and no other members, then any inferences +// made for type parameters referenced by the parameters of T's call signature are fixed, and e's type is changed +// to a function type with e's call signature instantiated in the context of T's call signature (section 3.8.5). + +declare function foo(cb: (x: number, y: string) => T): T; +>foo : (cb: (x: number, y: string) => T) => T +>T : T +>cb : (x: number, y: string) => T +>x : number +>y : string +>T : T +>T : T + +declare function bar(x: T, y: U, cb: (x: T, y: U) => V): V; +>bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>T : T +>U : U +>V : V +>x : T +>T : T +>y : U +>U : U +>cb : (x: T, y: U) => V +>x : T +>T : T +>y : U +>U : U +>V : V +>V : V + +declare function baz(x: T, y: T, cb: (x: T, y: T) => U): U; +>baz : (x: T, y: T, cb: (x: T, y: T) => U) => U +>T : T +>U : U +>x : T +>T : T +>y : T +>T : T +>cb : (x: T, y: T) => U +>x : T +>T : T +>y : T +>T : T +>U : U +>U : U + +declare function g(x: T, y: T): T; +>g : (x: T, y: T) => T +>T : T +>x : T +>T : T +>y : T +>T : T +>T : T + +declare function h(x: T, y: U): T[] | U[]; +>h : (x: T, y: U) => T[] | U[] +>T : T +>U : U +>x : T +>T : T +>y : U +>U : U +>T : T +>U : U + +var a: number; +>a : number + +var a = bar(1, 1, g); // Should be number +>a : number +>bar(1, 1, g) : number +>bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>g : (x: T, y: T) => T + +var a = baz(1, 1, g); // Should be number +>a : number +>baz(1, 1, g) : number +>baz : (x: T, y: T, cb: (x: T, y: T) => U) => U +>g : (x: T, y: T) => T + +var b: number | string; +>b : string | number + +var b = foo(g); // Should be number | string +>b : string | number +>foo(g) : string | number +>foo : (cb: (x: number, y: string) => T) => T +>g : (x: T, y: T) => T + +var b = bar(1, "one", g); // Should be number | string +>b : string | number +>bar(1, "one", g) : string | number +>bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>g : (x: T, y: T) => T + +var b = bar("one", 1, g); // Should be number | string +>b : string | number +>bar("one", 1, g) : string | number +>bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>g : (x: T, y: T) => T + +var b = baz(b, b, g); // Should be number | string +>b : string | number +>baz(b, b, g) : string | number +>baz : (x: T, y: T, cb: (x: T, y: T) => U) => U +>b : string | number +>b : string | number +>g : (x: T, y: T) => T + +var d: number[] | string[]; +>d : string[] | number[] + +var d = foo(h); // Should be number[] | string[] +>d : string[] | number[] +>foo(h) : string[] | number[] +>foo : (cb: (x: number, y: string) => T) => T +>h : (x: T, y: U) => T[] | U[] + +var d = bar(1, "one", h); // Should be number[] | string[] +>d : string[] | number[] +>bar(1, "one", h) : string[] | number[] +>bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>h : (x: T, y: U) => T[] | U[] + +var d = bar("one", 1, h); // Should be number[] | string[] +>d : string[] | number[] +>bar("one", 1, h) : string[] | number[] +>bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>h : (x: T, y: U) => T[] | U[] + +var d = baz(d, d, g); // Should be number[] | string[] +>d : string[] | number[] +>baz(d, d, g) : string[] | number[] +>baz : (x: T, y: T, cb: (x: T, y: T) => U) => U +>d : string[] | number[] +>d : string[] | number[] +>g : (x: T, y: T) => T + diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.types b/tests/baselines/reference/contextualTypeArrayReturnType.types index b0cd03f8510..ceb7aa53f67 100644 --- a/tests/baselines/reference/contextualTypeArrayReturnType.types +++ b/tests/baselines/reference/contextualTypeArrayReturnType.types @@ -26,18 +26,18 @@ interface Transform3D { var style: IBookStyle = { >style : IBookStyle >IBookStyle : IBookStyle ->{ initialLeftPageTransforms: (width: number) => { return [ {'ry': null } ]; }} : { initialLeftPageTransforms: (width: number) => NamedTransform[]; } +>{ initialLeftPageTransforms: (width: number) => { return [ {'ry': null } ]; }} : { initialLeftPageTransforms: (width: number) => { [x: string]: any; 'ry': any; }[]; } initialLeftPageTransforms: (width: number) => { ->initialLeftPageTransforms : (width: number) => NamedTransform[] ->(width: number) => { return [ {'ry': null } ]; } : (width: number) => NamedTransform[] +>initialLeftPageTransforms : (width: number) => { [x: string]: any; 'ry': any; }[] +>(width: number) => { return [ {'ry': null } ]; } : (width: number) => { [x: string]: any; 'ry': any; }[] >width : number return [ ->[ {'ry': null } ] : NamedTransform[] +>[ {'ry': null } ] : { [x: string]: null; 'ry': null; }[] {'ry': null } ->{'ry': null } : { [x: string]: Transform3D; 'ry': null; } +>{'ry': null } : { [x: string]: null; 'ry': null; } ]; } diff --git a/tests/baselines/reference/contextualTypeWithTuple.errors.txt b/tests/baselines/reference/contextualTypeWithTuple.errors.txt new file mode 100644 index 00000000000..875d7b5e20a --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithTuple.errors.txt @@ -0,0 +1,58 @@ +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. + Types of property 'pop' are incompatible. + Type '() => string | number | boolean' is not assignable to type '() => string | number'. + Type 'string | number | boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(8,1): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(11,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. + Types of property '0' are incompatible. + Type '{}' is not assignable to type '{ a: string; }'. + Property 'a' is missing in type '{}'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(12,1): error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]'. + Property '2' is missing in type '[number, string]'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => string'. + Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. + + +==== tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts (5 errors) ==== + // no error + var numStrTuple: [number, string] = [5, "hello"]; + var numStrTuple2: [number, string] = [5, "foo", true]; + ~~~~~~~~~~~~ +!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number'. +!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + var numStrBoolTuple: [number, string, boolean] = [5, "foo", true]; + var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5]; + var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]]; + numStrTuple = numStrTuple2; + numStrTuple = numStrBoolTuple; + ~~~~~~~~~~~ +!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. + + // error + objNumTuple = [ {}, 5]; + ~~~~~~~~~~~ +!!! error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type '{}' is not assignable to type '{ a: string; }'. +!!! error TS2322: Property 'a' is missing in type '{}'. + numStrBoolTuple = numStrTuple; + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]'. +!!! error TS2322: Property '2' is missing in type '[number, string]'. + var strStrTuple: [string, string] = ["foo", "bar", 5]; + ~~~~~~~~~~~ +!!! error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number' is not assignable to type '() => string'. +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. + \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypeWithTuple.js b/tests/baselines/reference/contextualTypeWithTuple.js new file mode 100644 index 00000000000..61a2df5d8ce --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithTuple.js @@ -0,0 +1,29 @@ +//// [contextualTypeWithTuple.ts] +// no error +var numStrTuple: [number, string] = [5, "hello"]; +var numStrTuple2: [number, string] = [5, "foo", true]; +var numStrBoolTuple: [number, string, boolean] = [5, "foo", true]; +var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5]; +var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]]; +numStrTuple = numStrTuple2; +numStrTuple = numStrBoolTuple; + +// error +objNumTuple = [ {}, 5]; +numStrBoolTuple = numStrTuple; +var strStrTuple: [string, string] = ["foo", "bar", 5]; + + +//// [contextualTypeWithTuple.js] +// no error +var numStrTuple = [5, "hello"]; +var numStrTuple2 = [5, "foo", true]; +var numStrBoolTuple = [5, "foo", true]; +var objNumTuple = [{ a: "world" }, 5]; +var strTupleTuple = ["bar", [5, { x: 1, y: 1 }]]; +numStrTuple = numStrTuple2; +numStrTuple = numStrBoolTuple; +// error +objNumTuple = [{}, 5]; +numStrBoolTuple = numStrTuple; +var strStrTuple = ["foo", "bar", 5]; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js new file mode 100644 index 00000000000..2e21235ea0a --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js @@ -0,0 +1,86 @@ +//// [contextualTypeWithUnionTypeCallSignatures.ts] +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. + +// Let S be the set of types in U that have call signatures. +// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types, +// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S. + +interface IWithNoCallSignatures { + foo: string; +} +interface IWithCallSignatures { + (a: number): string; +} +interface IWithCallSignatures2 { + (a: number): number; +} +interface IWithCallSignatures3 { + (b: string): number; +} +interface IWithCallSignatures4 { + (a: number): string; + (a: string, b: number): number; +} + +// With no call signature | callSignatures +var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString(); + +// With call signatures with different return type +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2 + +// With call signatures of mismatching parameter type +var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString(); + +// With call signature count mismatch +var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString(); + +//// [contextualTypeWithUnionTypeCallSignatures.js] +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +// With no call signature | callSignatures +var x = function (a) { return a.toString(); }; +// With call signatures with different return type +var x2 = function (a) { return a.toString(); }; // Like iWithCallSignatures +var x2 = function (a) { return a; }; // Like iWithCallSignatures2 +// With call signatures of mismatching parameter type +var x3 = function (a /*here a should be any*/) { return a.toString(); }; +// With call signature count mismatch +var x4 = function (a //When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. + +// Let S be the set of types in U that have call signatures. +// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types, +// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S. + +interface IWithNoCallSignatures { + foo: string; +} +interface IWithCallSignatures { + (a: number): string; +} +interface IWithCallSignatures2 { + (a: number): number; +} +interface IWithCallSignatures3 { + (b: string): number; +} +interface IWithCallSignatures4 { + (a: number): string; + (a: string, b: number): number; +} + +// With no call signature | callSignatures +var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString(); + +// With call signatures with different return type +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2 + +// With call signatures of mismatching parameter type +var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString(); + +// With call signature count mismatch +var x4: IWithCallSignatures | IWithCallSignatures4 = a => + ) { return a.toString(); }; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types new file mode 100644 index 00000000000..02dfecf5c08 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types @@ -0,0 +1,99 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeCallSignatures.ts === +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. + +// Let S be the set of types in U that have call signatures. +// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types, +// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S. + +interface IWithNoCallSignatures { +>IWithNoCallSignatures : IWithNoCallSignatures + + foo: string; +>foo : string +} +interface IWithCallSignatures { +>IWithCallSignatures : IWithCallSignatures + + (a: number): string; +>a : number +} +interface IWithCallSignatures2 { +>IWithCallSignatures2 : IWithCallSignatures2 + + (a: number): number; +>a : number +} +interface IWithCallSignatures3 { +>IWithCallSignatures3 : IWithCallSignatures3 + + (b: string): number; +>b : string +} +interface IWithCallSignatures4 { +>IWithCallSignatures4 : IWithCallSignatures4 + + (a: number): string; +>a : number + + (a: string, b: number): number; +>a : string +>b : number +} + +// With no call signature | callSignatures +var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString(); +>x : IWithNoCallSignatures | IWithCallSignatures +>IWithNoCallSignatures : IWithNoCallSignatures +>IWithCallSignatures : IWithCallSignatures +>a => a.toString() : (a: number) => string +>a : number +>a.toString() : string +>a.toString : (radix?: number) => string +>a : number +>toString : (radix?: number) => string + +// With call signatures with different return type +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures +>x2 : IWithCallSignatures | IWithCallSignatures2 +>IWithCallSignatures : IWithCallSignatures +>IWithCallSignatures2 : IWithCallSignatures2 +>a => a.toString() : (a: number) => string +>a : number +>a.toString() : string +>a.toString : (radix?: number) => string +>a : number +>toString : (radix?: number) => string + +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2 +>x2 : IWithCallSignatures | IWithCallSignatures2 +>IWithCallSignatures : IWithCallSignatures +>IWithCallSignatures2 : IWithCallSignatures2 +>a => a : (a: number) => number +>a : number +>a : number + +// With call signatures of mismatching parameter type +var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString(); +>x3 : IWithCallSignatures | IWithCallSignatures3 +>IWithCallSignatures : IWithCallSignatures +>IWithCallSignatures3 : IWithCallSignatures3 +>a => /*here a should be any*/ a.toString() : (a: any) => any +>a : any +>a.toString() : any +>a.toString : any +>a : any +>toString : any + +// With call signature count mismatch +var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString(); +>x4 : IWithCallSignatures | IWithCallSignatures4 +>IWithCallSignatures : IWithCallSignatures +>IWithCallSignatures4 : IWithCallSignatures4 +>a => /*here a should be any*/ a.toString() : (a: any) => any +>a : any +>a.toString() : any +>a.toString : any +>a : any +>toString : any + diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js new file mode 100644 index 00000000000..2c07f461424 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js @@ -0,0 +1,80 @@ +//// [contextualTypeWithUnionTypeIndexSignatures.ts] +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface SomeType { + (a: number): number; +} +interface SomeType2 { + (a: number): string; +} + +interface IWithNoStringIndexSignature { + foo: string; +} +interface IWithNoNumberIndexSignature { + 0: string; +} +interface IWithStringIndexSignature1 { + [a: string]: SomeType; +} +interface IWithStringIndexSignature2 { + [a: string]: SomeType2; +} +interface IWithNumberIndexSignature1 { + [a: number]: SomeType; +} +interface IWithNumberIndexSignature2 { + [a: number]: SomeType2; +} + +// When an object literal is contextually typed by a type that includes a string index signature, +// the resulting type of the object literal includes a string index signature with the union type of +// the types of the properties declared in the object literal, or the Undefined type if the object literal +// is empty.Likewise, when an object literal is contextually typed by a type that includes a numeric index +// signature, the resulting type of the object literal includes a numeric index signature with the union type +// of the types of the numerically named properties(section 3.7.4) declared in the object literal, +// or the Undefined type if the object literal declares no numerically named properties. + +// Let S be the set of types in U that has a string index signature. +// If S is not empty, U has a string index signature of a union type of +// the types of the string index signatures from each type in S. +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { z: a => a }; // a should be number +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: a => a }; // a should be any +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" }; +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a }; // a should be number + + +// Let S be the set of types in U that has a numeric index signature. +// If S is not empty, U has a numeric index signature of a union type of +// the types of the numeric index signatures from each type in S. +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 1: a => a }; // a should be number +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: a => a }; // a should be any +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" }; +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; // a should be number + +//// [contextualTypeWithUnionTypeIndexSignatures.js] +// When an object literal is contextually typed by a type that includes a string index signature, +// the resulting type of the object literal includes a string index signature with the union type of +// the types of the properties declared in the object literal, or the Undefined type if the object literal +// is empty.Likewise, when an object literal is contextually typed by a type that includes a numeric index +// signature, the resulting type of the object literal includes a numeric index signature with the union type +// of the types of the numerically named properties(section 3.7.4) declared in the object literal, +// or the Undefined type if the object literal declares no numerically named properties. +// Let S be the set of types in U that has a string index signature. +// If S is not empty, U has a string index signature of a union type of +// the types of the string index signatures from each type in S. +var x = { z: function (a) { return a; } }; // a should be number +var x = { foo: function (a) { return a; } }; // a should be any +var x = { foo: "hello" }; +var x2 = { z: function (a) { return a.toString(); } }; // a should be number +var x2 = { z: function (a) { return a; } }; // a should be number +// Let S be the set of types in U that has a numeric index signature. +// If S is not empty, U has a numeric index signature of a union type of +// the types of the numeric index signatures from each type in S. +var x3 = { 1: function (a) { return a; } }; // a should be number +var x3 = { 0: function (a) { return a; } }; // a should be any +var x3 = { 0: "hello" }; +var x4 = { 1: function (a) { return a.toString(); } }; // a should be number +var x4 = { 1: function (a) { return a; } }; // a should be number diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types new file mode 100644 index 00000000000..8a91fe18698 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types @@ -0,0 +1,166 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeIndexSignatures.ts === +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface SomeType { +>SomeType : SomeType + + (a: number): number; +>a : number +} +interface SomeType2 { +>SomeType2 : SomeType2 + + (a: number): string; +>a : number +} + +interface IWithNoStringIndexSignature { +>IWithNoStringIndexSignature : IWithNoStringIndexSignature + + foo: string; +>foo : string +} +interface IWithNoNumberIndexSignature { +>IWithNoNumberIndexSignature : IWithNoNumberIndexSignature + + 0: string; +} +interface IWithStringIndexSignature1 { +>IWithStringIndexSignature1 : IWithStringIndexSignature1 + + [a: string]: SomeType; +>a : string +>SomeType : SomeType +} +interface IWithStringIndexSignature2 { +>IWithStringIndexSignature2 : IWithStringIndexSignature2 + + [a: string]: SomeType2; +>a : string +>SomeType2 : SomeType2 +} +interface IWithNumberIndexSignature1 { +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 + + [a: number]: SomeType; +>a : number +>SomeType : SomeType +} +interface IWithNumberIndexSignature2 { +>IWithNumberIndexSignature2 : IWithNumberIndexSignature2 + + [a: number]: SomeType2; +>a : number +>SomeType2 : SomeType2 +} + +// When an object literal is contextually typed by a type that includes a string index signature, +// the resulting type of the object literal includes a string index signature with the union type of +// the types of the properties declared in the object literal, or the Undefined type if the object literal +// is empty.Likewise, when an object literal is contextually typed by a type that includes a numeric index +// signature, the resulting type of the object literal includes a numeric index signature with the union type +// of the types of the numerically named properties(section 3.7.4) declared in the object literal, +// or the Undefined type if the object literal declares no numerically named properties. + +// Let S be the set of types in U that has a string index signature. +// If S is not empty, U has a string index signature of a union type of +// the types of the string index signatures from each type in S. +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { z: a => a }; // a should be number +>x : IWithNoStringIndexSignature | IWithStringIndexSignature1 +>IWithNoStringIndexSignature : IWithNoStringIndexSignature +>IWithStringIndexSignature1 : IWithStringIndexSignature1 +>{ z: a => a } : { [x: string]: (a: number) => number; z: (a: number) => number; } +>z : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: a => a }; // a should be any +>x : IWithNoStringIndexSignature | IWithStringIndexSignature1 +>IWithNoStringIndexSignature : IWithNoStringIndexSignature +>IWithStringIndexSignature1 : IWithStringIndexSignature1 +>{ foo: a => a } : { [x: string]: (a: any) => any; foo: (a: any) => any; } +>foo : (a: any) => any +>a => a : (a: any) => any +>a : any +>a : any + +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" }; +>x : IWithNoStringIndexSignature | IWithStringIndexSignature1 +>IWithNoStringIndexSignature : IWithNoStringIndexSignature +>IWithStringIndexSignature1 : IWithStringIndexSignature1 +>{ foo: "hello" } : { [x: string]: string; foo: string; } +>foo : string + +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number +>x2 : IWithStringIndexSignature1 | IWithStringIndexSignature2 +>IWithStringIndexSignature1 : IWithStringIndexSignature1 +>IWithStringIndexSignature2 : IWithStringIndexSignature2 +>{ z: a => a.toString() } : { [x: string]: (a: number) => string; z: (a: number) => string; } +>z : (a: number) => string +>a => a.toString() : (a: number) => string +>a : number +>a.toString() : string +>a.toString : (radix?: number) => string +>a : number +>toString : (radix?: number) => string + +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a }; // a should be number +>x2 : IWithStringIndexSignature1 | IWithStringIndexSignature2 +>IWithStringIndexSignature1 : IWithStringIndexSignature1 +>IWithStringIndexSignature2 : IWithStringIndexSignature2 +>{ z: a => a } : { [x: string]: (a: number) => number; z: (a: number) => number; } +>z : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + +// Let S be the set of types in U that has a numeric index signature. +// If S is not empty, U has a numeric index signature of a union type of +// the types of the numeric index signatures from each type in S. +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 1: a => a }; // a should be number +>x3 : IWithNoNumberIndexSignature | IWithNumberIndexSignature1 +>IWithNoNumberIndexSignature : IWithNoNumberIndexSignature +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 +>{ 1: a => a } : { [x: number]: (a: number) => number; 1: (a: number) => number; } +>a => a : (a: number) => number +>a : number +>a : number + +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: a => a }; // a should be any +>x3 : IWithNoNumberIndexSignature | IWithNumberIndexSignature1 +>IWithNoNumberIndexSignature : IWithNoNumberIndexSignature +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 +>{ 0: a => a } : { [x: number]: (a: any) => any; 0: (a: any) => any; } +>a => a : (a: any) => any +>a : any +>a : any + +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" }; +>x3 : IWithNoNumberIndexSignature | IWithNumberIndexSignature1 +>IWithNoNumberIndexSignature : IWithNoNumberIndexSignature +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 +>{ 0: "hello" } : { [x: number]: string; 0: string; } + +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number +>x4 : IWithNumberIndexSignature1 | IWithNumberIndexSignature2 +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 +>IWithNumberIndexSignature2 : IWithNumberIndexSignature2 +>{ 1: a => a.toString() } : { [x: number]: (a: number) => string; 1: (a: number) => string; } +>a => a.toString() : (a: number) => string +>a : number +>a.toString() : string +>a.toString : (radix?: number) => string +>a : number +>toString : (radix?: number) => string + +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; // a should be number +>x4 : IWithNumberIndexSignature1 | IWithNumberIndexSignature2 +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 +>IWithNumberIndexSignature2 : IWithNumberIndexSignature2 +>{ 1: a => a } : { [x: number]: (a: number) => number; 1: (a: number) => number; } +>a => a : (a: number) => number +>a : number +>a : number + diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js new file mode 100644 index 00000000000..b04c804ad7e --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js @@ -0,0 +1,207 @@ +//// [contextualTypeWithUnionTypeMembers.ts] +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface I1 { + commonMethodType(a: string): string; + commonPropertyType: string; + commonMethodWithTypeParameter(a: T): T; + + methodOnlyInI1(a: string): string; + propertyOnlyInI1: string; +} +interface I2 { + commonMethodType(a: string): string; + commonPropertyType: string; + commonMethodWithTypeParameter(a: T): T; + + methodOnlyInI2(a: string): string; + propertyOnlyInI2: string; +} + +// Let S be the set of types in U that has a property P. +// If S is not empty, U has a property P of a union type of the types of P from each type in S. +var i1: I1; +var i2: I2; +var i1Ori2: I1 | I2 = i1; +var i1Ori2: I1 | I2 = i2; +var i1Ori2: I1 | I2 = { // Like i1 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", +}; +var i1Ori2: I1 | I2 = { // Like i2 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", +}; +var i1Ori2: I1 | I2 = { // Like i1 and i2 both + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", +}; + +var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + }, + { // Like i2 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", + }, { // Like i1 and i2 both + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", + }]; + +interface I11 { + commonMethodDifferentReturnType(a: string, b: number): string; + commonPropertyDifferentType: string; +} +interface I21 { + commonMethodDifferentReturnType(a: string, b: number): number; + commonPropertyDifferentType: number; +} +var i11: I11; +var i21: I21; +var i11Ori21: I11 | I21 = i11; +var i11Ori21: I11 | I21 = i21; +var i11Ori21: I11 | I21 = { + // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello", +}; +var i11Ori21: I11 | I21 = { + // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10, +}; +var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { + // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello", + }, { + // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10, + }]; + +//// [contextualTypeWithUnionTypeMembers.js] +// Let S be the set of types in U that has a property P. +// If S is not empty, U has a property P of a union type of the types of P from each type in S. +var i1; +var i2; +var i1Ori2 = i1; +var i1Ori2 = i2; +var i1Ori2 = { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, + propertyOnlyInI1: "Hello" +}; +var i1Ori2 = { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI2: function (a) { return a; }, + propertyOnlyInI2: "Hello" +}; +var i1Ori2 = { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, + propertyOnlyInI1: "Hello", + methodOnlyInI2: function (a) { return a; }, + propertyOnlyInI2: "Hello" +}; +var arrayI1OrI2 = [i1, i2, { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, + propertyOnlyInI1: "Hello" +}, { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI2: function (a) { return a; }, + propertyOnlyInI2: "Hello" +}, { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, + propertyOnlyInI1: "Hello", + methodOnlyInI2: function (a) { return a; }, + propertyOnlyInI2: "Hello" +}]; +var i11; +var i21; +var i11Ori21 = i11; +var i11Ori21 = i21; +var i11Ori21 = { + // Like i1 + commonMethodDifferentReturnType: function (a, b) { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello" +}; +var i11Ori21 = { + // Like i2 + commonMethodDifferentReturnType: function (a, b) { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10 +}; +var arrayOrI11OrI21 = [i11, i21, i11 || i21, { + // Like i1 + commonMethodDifferentReturnType: function (a, b) { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello" +}, { + // Like i2 + commonMethodDifferentReturnType: function (a, b) { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10 +}]; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types new file mode 100644 index 00000000000..522d4a4a555 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types @@ -0,0 +1,438 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeMembers.ts === +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface I1 { +>I1 : I1 +>T : T + + commonMethodType(a: string): string; +>commonMethodType : (a: string) => string +>a : string + + commonPropertyType: string; +>commonPropertyType : string + + commonMethodWithTypeParameter(a: T): T; +>commonMethodWithTypeParameter : (a: T) => T +>a : T +>T : T +>T : T + + methodOnlyInI1(a: string): string; +>methodOnlyInI1 : (a: string) => string +>a : string + + propertyOnlyInI1: string; +>propertyOnlyInI1 : string +} +interface I2 { +>I2 : I2 +>T : T + + commonMethodType(a: string): string; +>commonMethodType : (a: string) => string +>a : string + + commonPropertyType: string; +>commonPropertyType : string + + commonMethodWithTypeParameter(a: T): T; +>commonMethodWithTypeParameter : (a: T) => T +>a : T +>T : T +>T : T + + methodOnlyInI2(a: string): string; +>methodOnlyInI2 : (a: string) => string +>a : string + + propertyOnlyInI2: string; +>propertyOnlyInI2 : string +} + +// Let S be the set of types in U that has a property P. +// If S is not empty, U has a property P of a union type of the types of P from each type in S. +var i1: I1; +>i1 : I1 +>I1 : I1 + +var i2: I2; +>i2 : I2 +>I2 : I2 + +var i1Ori2: I1 | I2 = i1; +>i1Ori2 : I1 | I2 +>I1 : I1 +>I2 : I2 +>i1 : I1 + +var i1Ori2: I1 | I2 = i2; +>i1Ori2 : I1 | I2 +>I1 : I1 +>I2 : I2 +>i2 : I2 + +var i1Ori2: I1 | I2 = { // Like i1 +>i1Ori2 : I1 | I2 +>I1 : I1 +>I2 : I2 +>{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI1: a => a, +>methodOnlyInI1 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : string + +}; +var i1Ori2: I1 | I2 = { // Like i2 +>i1Ori2 : I1 | I2 +>I1 : I1 +>I2 : I2 +>{ // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI2: a => a, +>methodOnlyInI2 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : string + +}; +var i1Ori2: I1 | I2 = { // Like i1 and i2 both +>i1Ori2 : I1 | I2 +>I1 : I1 +>I2 : I2 +>{ // 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 + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI1: a => a, +>methodOnlyInI1 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : string + + methodOnlyInI2: a => a, +>methodOnlyInI2 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : string + +}; + +var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 +>arrayI1OrI2 : (I1 | I2)[] +>Array : T[] +>I1 : I1 +>I2 : I2 +>[i1, i2, { // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", }, { // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }, { // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }] : (I1 | I2)[] +>i1 : I1 +>i2 : I2 +>{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI1: a => a, +>methodOnlyInI1 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : string + + }, + { // Like i2 +>{ // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI2: a => a, +>methodOnlyInI2 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : string + + }, { // Like i1 and i2 both +>{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI1: a => a, +>methodOnlyInI1 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : string + + methodOnlyInI2: a => a, +>methodOnlyInI2 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : string + + }]; + +interface I11 { +>I11 : I11 + + commonMethodDifferentReturnType(a: string, b: number): string; +>commonMethodDifferentReturnType : (a: string, b: number) => string +>a : string +>b : number + + commonPropertyDifferentType: string; +>commonPropertyDifferentType : string +} +interface I21 { +>I21 : I21 + + commonMethodDifferentReturnType(a: string, b: number): number; +>commonMethodDifferentReturnType : (a: string, b: number) => number +>a : string +>b : number + + commonPropertyDifferentType: number; +>commonPropertyDifferentType : number +} +var i11: I11; +>i11 : I11 +>I11 : I11 + +var i21: I21; +>i21 : I21 +>I21 : I21 + +var i11Ori21: I11 | I21 = i11; +>i11Ori21 : I11 | I21 +>I11 : I11 +>I21 : I21 +>i11 : I11 + +var i11Ori21: I11 | I21 = i21; +>i11Ori21 : I11 | I21 +>I11 : I11 +>I21 : I21 +>i21 : I21 + +var i11Ori21: I11 | I21 = { +>i11Ori21 : I11 | I21 +>I11 : I11 +>I21 : I21 +>{ // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", } : { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: string; } + + // Like i1 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : (a: string, b: number) => string +>(a, b) => { var z = a.charAt(b); return z; } : (a: string, b: number) => string +>a : string +>b : number + + var z = a.charAt(b); +>z : string +>a.charAt(b) : string +>a.charAt : (pos: number) => string +>a : string +>charAt : (pos: number) => string +>b : number + + return z; +>z : string + + }, + commonPropertyDifferentType: "hello", +>commonPropertyDifferentType : string + +}; +var i11Ori21: I11 | I21 = { +>i11Ori21 : I11 | I21 +>I11 : I11 +>I21 : I21 +>{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10,} : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; } + + // Like i2 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : (a: string, b: number) => number +>(a, b) => { var z = a.charCodeAt(b); return z; } : (a: string, b: number) => number +>a : string +>b : number + + var z = a.charCodeAt(b); +>z : number +>a.charCodeAt(b) : number +>a.charCodeAt : (index: number) => number +>a : string +>charCodeAt : (index: number) => number +>b : number + + return z; +>z : number + + }, + commonPropertyDifferentType: 10, +>commonPropertyDifferentType : number + +}; +var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { +>arrayOrI11OrI21 : (I11 | I21)[] +>Array : T[] +>I11 : I11 +>I21 : I21 +>[i11, i21, i11 || i21, { // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", }, { // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, }] : (I11 | I21)[] +>i11 : I11 +>i21 : I21 +>i11 || i21 : I11 | I21 +>i11 : I11 +>i21 : I21 +>{ // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", } : { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: string; } + + // Like i1 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : (a: string, b: number) => string +>(a, b) => { var z = a.charAt(b); return z; } : (a: string, b: number) => string +>a : string +>b : number + + var z = a.charAt(b); +>z : string +>a.charAt(b) : string +>a.charAt : (pos: number) => string +>a : string +>charAt : (pos: number) => string +>b : number + + return z; +>z : string + + }, + commonPropertyDifferentType: "hello", +>commonPropertyDifferentType : string + + }, { +>{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, } : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; } + + // Like i2 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : (a: string, b: number) => number +>(a, b) => { var z = a.charCodeAt(b); return z; } : (a: string, b: number) => number +>a : string +>b : number + + var z = a.charCodeAt(b); +>z : number +>a.charCodeAt(b) : number +>a.charCodeAt : (index: number) => number +>a : string +>charCodeAt : (index: number) => number +>b : number + + return z; +>z : number + + }, + commonPropertyDifferentType: 10, +>commonPropertyDifferentType : number + + }]; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt new file mode 100644 index 00000000000..8be323f9af4 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt @@ -0,0 +1,130 @@ +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(14,5): error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: string; } | { prop: number; }'. + Type '{ prop: string | number; }' is not assignable to type '{ prop: number; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(20,5): error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; }'. + Type '{ prop: string | number; }' is not assignable to type '{ prop: number; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(21,5): error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; }'. + Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(25,5): error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. + Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; anotherP1: number; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(29,5): error TS2322: Type '{ prop: string | number; anotherP: string; anotherP1: number; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. + Type '{ prop: string | number; anotherP: string; anotherP1: number; }' is not assignable to type '{ prop: number; anotherP1: number; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(57,5): error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I11 | I21'. + Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I21'. + Types of property 'commonMethodDifferentReturnType' are incompatible. + Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. + + +==== tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts (6 errors) ==== + var str: string; + var num: number; + var strOrNumber: string | number = str || num; + var objStr: { prop: string }; + var objNum: { prop: number }; + var objStrOrNum1: { prop: string } | { prop: number } = objStr || objNum; + var objStrOrNum2: { prop: string | number } = objStr || objNum; + // Below is error because : + // Spec says: + // S is a union type and each constituent type of S is assignable to T. + // T is a union type and S is assignable to at least one constituent type of T. + // In case of objStrOrNum3, the S is not union Type but object Literal so we go to next step. + // Since T is union Type we only allow the assignment of either object with property of type string or object with property of type number but do not allow object with property of type string | number + var objStrOrNum3: { prop: string } | { prop: number } = { + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: string; } | { prop: number; }'. +!!! error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: number; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + prop: strOrNumber + }; + var objStrOrNum4: { prop: string | number } = { + prop: strOrNumber + }; + var objStrOrNum5: { prop: string; anotherP: string; } | { prop: number } = { prop: strOrNumber }; + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; }'. +!!! error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: number; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + var objStrOrNum6: { prop: string; anotherP: string; } | { prop: number } = { + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; }'. +!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + prop: strOrNumber, + anotherP: str + }; + var objStrOrNum7: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. +!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; anotherP1: number; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + prop: strOrNumber, + anotherP: str + }; + var objStrOrNum8: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ prop: string | number; anotherP: string; anotherP1: number; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. +!!! error TS2322: Type '{ prop: string | number; anotherP: string; anotherP1: number; }' is not assignable to type '{ prop: number; anotherP1: number; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + prop: strOrNumber, + anotherP: str, + anotherP1: num + }; + interface I11 { + commonMethodDifferentReturnType(a: string, b: number): string; + } + interface I21 { + commonMethodDifferentReturnType(a: string, b: number): number; + } + var i11: I11; + var i21: I21; + var i11Ori21: I11 | I21 = i11; + var i11Ori21: I11 | I21 = i21; + var i11Ori21: I11 | I21 = { // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, + }; + var i11Ori21: I11 | I21 = { // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, + }; + var strOrNumber: string | number; + var i11Ori21: I11 | I21 = { // Like i1 and i2 both + ~~~~~~~~ +!!! error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I11 | I21'. +!!! error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I21'. +!!! error TS2322: Types of property 'commonMethodDifferentReturnType' are incompatible. +!!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + commonMethodDifferentReturnType: (a, b) => strOrNumber, + }; \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js new file mode 100644 index 00000000000..dc8f07823b6 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js @@ -0,0 +1,115 @@ +//// [contextualTypeWithUnionTypeObjectLiteral.ts] +var str: string; +var num: number; +var strOrNumber: string | number = str || num; +var objStr: { prop: string }; +var objNum: { prop: number }; +var objStrOrNum1: { prop: string } | { prop: number } = objStr || objNum; +var objStrOrNum2: { prop: string | number } = objStr || objNum; +// Below is error because : +// Spec says: +// S is a union type and each constituent type of S is assignable to T. +// T is a union type and S is assignable to at least one constituent type of T. +// In case of objStrOrNum3, the S is not union Type but object Literal so we go to next step. +// Since T is union Type we only allow the assignment of either object with property of type string or object with property of type number but do not allow object with property of type string | number +var objStrOrNum3: { prop: string } | { prop: number } = { + prop: strOrNumber +}; +var objStrOrNum4: { prop: string | number } = { + prop: strOrNumber +}; +var objStrOrNum5: { prop: string; anotherP: string; } | { prop: number } = { prop: strOrNumber }; +var objStrOrNum6: { prop: string; anotherP: string; } | { prop: number } = { + prop: strOrNumber, + anotherP: str +}; +var objStrOrNum7: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { + prop: strOrNumber, + anotherP: str +}; +var objStrOrNum8: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { + prop: strOrNumber, + anotherP: str, + anotherP1: num +}; +interface I11 { + commonMethodDifferentReturnType(a: string, b: number): string; +} +interface I21 { + commonMethodDifferentReturnType(a: string, b: number): number; +} +var i11: I11; +var i21: I21; +var i11Ori21: I11 | I21 = i11; +var i11Ori21: I11 | I21 = i21; +var i11Ori21: I11 | I21 = { // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, +}; +var i11Ori21: I11 | I21 = { // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, +}; +var strOrNumber: string | number; +var i11Ori21: I11 | I21 = { // Like i1 and i2 both + commonMethodDifferentReturnType: (a, b) => strOrNumber, +}; + +//// [contextualTypeWithUnionTypeObjectLiteral.js] +var str; +var num; +var strOrNumber = str || num; +var objStr; +var objNum; +var objStrOrNum1 = objStr || objNum; +var objStrOrNum2 = objStr || objNum; +// Below is error because : +// Spec says: +// S is a union type and each constituent type of S is assignable to T. +// T is a union type and S is assignable to at least one constituent type of T. +// In case of objStrOrNum3, the S is not union Type but object Literal so we go to next step. +// Since T is union Type we only allow the assignment of either object with property of type string or object with property of type number but do not allow object with property of type string | number +var objStrOrNum3 = { + prop: strOrNumber +}; +var objStrOrNum4 = { + prop: strOrNumber +}; +var objStrOrNum5 = { prop: strOrNumber }; +var objStrOrNum6 = { + prop: strOrNumber, + anotherP: str +}; +var objStrOrNum7 = { + prop: strOrNumber, + anotherP: str +}; +var objStrOrNum8 = { + prop: strOrNumber, + anotherP: str, + anotherP1: num +}; +var i11; +var i21; +var i11Ori21 = i11; +var i11Ori21 = i21; +var i11Ori21 = { + commonMethodDifferentReturnType: function (a, b) { + var z = a.charAt(b); + return z; + } +}; +var i11Ori21 = { + commonMethodDifferentReturnType: function (a, b) { + var z = a.charCodeAt(b); + return z; + } +}; +var strOrNumber; +var i11Ori21 = { + commonMethodDifferentReturnType: function (a, b) { return strOrNumber; } +}; diff --git a/tests/baselines/reference/contextualTyping.errors.txt b/tests/baselines/reference/contextualTyping.errors.txt index 69bffcc5782..3dce1018e3e 100644 --- a/tests/baselines/reference/contextualTyping.errors.txt +++ b/tests/baselines/reference/contextualTyping.errors.txt @@ -1,4 +1,10 @@ -==== tests/cases/compiler/contextualTyping.ts (3 errors) ==== +tests/cases/compiler/contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient. +tests/cases/compiler/contextualTyping.ts(197,15): error TS2300: Duplicate identifier 'Point'. +tests/cases/compiler/contextualTyping.ts(207,10): error TS2300: Duplicate identifier 'Point'. +tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'. + + +==== tests/cases/compiler/contextualTyping.ts (4 errors) ==== // DEFAULT INTERFACES interface IFoo { n: number; @@ -189,7 +195,7 @@ // contextually typing function declarations declare function EF1(a:number, b:number):number; ~~~ -!!! Overload signatures must all be ambient or non-ambient. +!!! error TS2384: Overload signatures must all be ambient or non-ambient. function EF1(a,b) { return a+b; } @@ -198,6 +204,8 @@ // contextually typing from ambient class declarations declare class Point + ~~~~~ +!!! error TS2300: Duplicate identifier 'Point'. { constructor(x: number, y: number); x: number; @@ -209,7 +217,7 @@ function Point(x, y) { ~~~~~ -!!! Duplicate identifier 'Point'. +!!! error TS2300: Duplicate identifier 'Point'. this.x = x; this.y = y; @@ -234,5 +242,5 @@ interface B extends A { } var x: B = { }; ~ -!!! Type '{}' is not assignable to type 'B':\n Property 'x' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping11.errors.txt b/tests/baselines/reference/contextualTyping11.errors.txt index b6e8970c764..a7879725814 100644 --- a/tests/baselines/reference/contextualTyping11.errors.txt +++ b/tests/baselines/reference/contextualTyping11.errors.txt @@ -1,6 +1,11 @@ +tests/cases/compiler/contextualTyping11.ts(1,13): error TS2322: Type 'foo[]' is not assignable to type '{ id: number; }[]'. + Type 'foo' is not assignable to type '{ id: number; }'. + Property 'id' is missing in type 'foo'. + + ==== tests/cases/compiler/contextualTyping11.ts (1 errors) ==== class foo { public bar:{id:number;}[] = [({})]; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Type 'foo[]' is not assignable to type '{ id: number; }[]': -!!! Type 'foo' is not assignable to type '{ id: number; }': -!!! Property 'id' is missing in type 'foo'. \ No newline at end of file +!!! error TS2322: Type 'foo[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type 'foo' is not assignable to type '{ id: number; }'. +!!! error TS2322: Property 'id' is missing in type 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping21.errors.txt b/tests/baselines/reference/contextualTyping21.errors.txt index 12f7d53db8f..d40192c6240 100644 --- a/tests/baselines/reference/contextualTyping21.errors.txt +++ b/tests/baselines/reference/contextualTyping21.errors.txt @@ -1,6 +1,13 @@ +tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. + Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. + Type 'number' is not assignable to type '{ id: number; }'. + Property 'id' is missing in type 'Number'. + + ==== tests/cases/compiler/contextualTyping21.ts (1 errors) ==== var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1]; ~~~ -!!! Type '{}[]' is not assignable to type '{ id: number; }[]': -!!! Type '{}' is not assignable to type '{ id: number; }': -!!! Property 'id' is missing in type '{}'. \ No newline at end of file +!!! error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'. +!!! error TS2322: Property 'id' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping24.errors.txt b/tests/baselines/reference/contextualTyping24.errors.txt index 5c5a54d280b..a172600e1c5 100644 --- a/tests/baselines/reference/contextualTyping24.errors.txt +++ b/tests/baselines/reference/contextualTyping24.errors.txt @@ -1,6 +1,11 @@ +tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. + Types of parameters 'a' and 'a' are incompatible. + Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. + + ==== tests/cases/compiler/contextualTyping24.ts (1 errors) ==== var foo:(a:{():number; (i:number):number; })=>number; foo = function(a:string){return 5}; ~~~ -!!! Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number': -!!! Types of parameters 'a' and 'a' are incompatible: -!!! Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file +!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. +!!! error TS2322: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping30.errors.txt b/tests/baselines/reference/contextualTyping30.errors.txt index 259f59faac7..eda30769ac8 100644 --- a/tests/baselines/reference/contextualTyping30.errors.txt +++ b/tests/baselines/reference/contextualTyping30.errors.txt @@ -1,5 +1,11 @@ +tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/contextualTyping30.ts (1 errors) ==== function foo(param:number[]){}; foo([1, "a"]); ~~~~~~~~ -!!! Argument of type '{}[]' is not assignable to parameter of type 'number[]'. -!!! Type '{}' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. +!!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping32.types b/tests/baselines/reference/contextualTyping32.types index a9d41405b93..c273be967e3 100644 --- a/tests/baselines/reference/contextualTyping32.types +++ b/tests/baselines/reference/contextualTyping32.types @@ -5,7 +5,7 @@ function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){ret >i : number >foo([function(){return 1;}, function(){return 4}]) : void >foo : (param: { (): number; (i: number): number; }[]) => void ->[function(){return 1;}, function(){return 4}] : { (): number; (i: number): number; }[] +>[function(){return 1;}, function(){return 4}] : (() => number)[] >function(){return 1;} : () => number >function(){return 4} : () => number diff --git a/tests/baselines/reference/contextualTyping33.errors.txt b/tests/baselines/reference/contextualTyping33.errors.txt index adf233b4934..4ed0787bde3 100644 --- a/tests/baselines/reference/contextualTyping33.errors.txt +++ b/tests/baselines/reference/contextualTyping33.errors.txt @@ -1,5 +1,11 @@ +tests/cases/compiler/contextualTyping33.ts(1,66): error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. + Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'. + Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. + + ==== tests/cases/compiler/contextualTyping33.ts (1 errors) ==== function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '{}[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. -!!! Type '{}' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file +!!! error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. +!!! error TS2345: Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'. +!!! error TS2345: Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping39.errors.txt b/tests/baselines/reference/contextualTyping39.errors.txt index 10be2415329..e43624fbead 100644 --- a/tests/baselines/reference/contextualTyping39.errors.txt +++ b/tests/baselines/reference/contextualTyping39.errors.txt @@ -1,5 +1,9 @@ +tests/cases/compiler/contextualTyping39.ts(1,11): error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/contextualTyping39.ts (1 errors) ==== var foo = <{ (): number; }> function() { return "err"; }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Neither type '() => string' nor type '() => number' is assignable to the other: -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping41.errors.txt b/tests/baselines/reference/contextualTyping41.errors.txt index 6e95b0092ca..1ed6da1b782 100644 --- a/tests/baselines/reference/contextualTyping41.errors.txt +++ b/tests/baselines/reference/contextualTyping41.errors.txt @@ -1,5 +1,9 @@ +tests/cases/compiler/contextualTyping41.ts(1,11): error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/contextualTyping41.ts (1 errors) ==== var foo = <{():number; (i:number):number; }> (function(){return "err";}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other: -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping5.errors.txt b/tests/baselines/reference/contextualTyping5.errors.txt index b72968af35c..5105f67190c 100644 --- a/tests/baselines/reference/contextualTyping5.errors.txt +++ b/tests/baselines/reference/contextualTyping5.errors.txt @@ -1,5 +1,9 @@ +tests/cases/compiler/contextualTyping5.ts(1,13): error TS2322: Type '{}' is not assignable to type '{ id: number; }'. + Property 'id' is missing in type '{}'. + + ==== tests/cases/compiler/contextualTyping5.ts (1 errors) ==== class foo { public bar:{id:number;} = { }; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Type '{}' is not assignable to type '{ id: number; }': -!!! Property 'id' is missing in type '{}'. \ No newline at end of file +!!! error TS2322: Type '{}' is not assignable to type '{ id: number; }'. +!!! error TS2322: Property 'id' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.types b/tests/baselines/reference/contextualTypingArrayOfLambdas.types index f3bb8bab70f..d3e5b9942e3 100644 --- a/tests/baselines/reference/contextualTypingArrayOfLambdas.types +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.types @@ -23,8 +23,8 @@ class C extends A { } var xs = [(x: A) => { }, (x: B) => { }, (x: C) => { }]; ->xs : { (x: A): void; }[] ->[(x: A) => { }, (x: B) => { }, (x: C) => { }] : { (x: A): void; }[] +>xs : ((x: A) => void)[] +>[(x: A) => { }, (x: B) => { }, (x: C) => { }] : ((x: A) => void)[] >(x: A) => { } : (x: A) => void >x : A >A : A diff --git a/tests/baselines/reference/contextualTypingOfAccessors.errors.txt b/tests/baselines/reference/contextualTypingOfAccessors.errors.txt index 93ae5f85865..8d5b732d5f7 100644 --- a/tests/baselines/reference/contextualTypingOfAccessors.errors.txt +++ b/tests/baselines/reference/contextualTypingOfAccessors.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/contextualTypingOfAccessors.ts(8,8): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/contextualTypingOfAccessors.ts(11,8): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/contextualTypingOfAccessors.ts (2 errors) ==== // not contextually typing accessors @@ -8,11 +12,11 @@ x = { get foo() { ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return (n)=>n }, set foo(x) {} ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt index eff83efa960..26b06abf782 100644 --- a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Type '(number | Date)[]' is not assignable to type 'I'. + Index signatures are incompatible. + Type 'number | Date' is not assignable to type 'Date'. + Type 'number' is not assignable to type 'Date'. + Property 'toDateString' is missing in type 'Number'. + + ==== tests/cases/compiler/contextualTypingOfArrayLiterals1.ts (1 errors) ==== interface I { [x: number]: Date; @@ -5,10 +12,11 @@ var x3: I = [new Date(), 1]; ~~ -!!! Type '{}[]' is not assignable to type 'I': -!!! Index signatures are incompatible: -!!! Type '{}' is not assignable to type 'Date': -!!! Property 'toDateString' is missing in type '{}'. +!!! error TS2322: Type '(number | Date)[]' is not assignable to type 'I'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'number | Date' is not assignable to type 'Date'. +!!! error TS2322: Type 'number' is not assignable to type 'Date'. +!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var r2 = x3[1]; r2.getDate(); \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.types b/tests/baselines/reference/contextualTypingOfConditionalExpression.types index 6c6f9b04457..2cd2b671b40 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.types +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.types @@ -2,7 +2,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) => void +>true ? (a) => a.toExponential() : (b) => b.toFixed() : (a: number) => string >(a) => a.toExponential() : (a: number) => string >a : number >a.toExponential() : string @@ -41,7 +41,7 @@ var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; >x2 : (a: A) => void >a : A >A : A ->true ? (a) => a.foo : (b) => b.foo : (a: A) => void +>true ? (a) => a.foo : (b) => b.foo : (a: A) => number >(a) => a.foo : (a: A) => number >a : A >a.foo : number diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt index 29ca48f0c28..08fe22c08e0 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt @@ -1,4 +1,11 @@ -==== tests/cases/compiler/contextualTypingOfConditionalExpression2.ts (2 errors) ==== +tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. + Type '(b: number) => void' is not assignable to type '(a: A) => void'. + Types of parameters 'b' and 'a' are incompatible. + Type 'number' is not assignable to type 'A'. + Property 'foo' is missing in type 'Number'. + + +==== tests/cases/compiler/contextualTypingOfConditionalExpression2.ts (1 errors) ==== class A { foo: number; } @@ -11,7 +18,9 @@ var x2: (a: A) => void = true ? (a: C) => a.foo : (b: number) => { }; ~~ -!!! Type '{}' is not assignable to type '(a: A) => void'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! No best common type exists between '(a: A) => void', '(a: C) => number', and '(b: number) => void'. +!!! error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. +!!! error TS2322: Type '(b: number) => void' is not assignable to type '(a: A) => void'. +!!! error TS2322: Types of parameters 'b' and 'a' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'A'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt index 2a768d452bf..f7bac878950 100644 --- a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(16,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. +tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(17,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. + + ==== tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts (2 errors) ==== interface Collection { length: number; @@ -16,8 +20,8 @@ var f = (x: number) => { return x.toFixed() }; var r5 = _.forEach(c2, f); ~ -!!! Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. +!!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. var r6 = _.forEach(c2, (x) => { return x.toFixed() }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. +!!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.errors.txt b/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.errors.txt index 4f04803d0ad..11ff1126d67 100644 --- a/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.errors.txt +++ b/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/contextualTypingOfLambdaReturnExpression.ts(5,16): error TS2339: Property 'length' does not exist on type 'number'. +tests/cases/compiler/contextualTypingOfLambdaReturnExpression.ts(6,18): error TS2339: Property 'length' does not exist on type 'number'. + + ==== tests/cases/compiler/contextualTypingOfLambdaReturnExpression.ts (2 errors) ==== function callb(lam: (l: number) => void); function callb(lam: (n: string) => void); @@ -5,7 +9,7 @@ callb((a) => a.length); // Ok, we choose the second overload because the first one gave us an error when trying to resolve the lambda return type ~~~~~~ -!!! Property 'length' does not exist on type 'number'. +!!! error TS2339: Property 'length' does not exist on type 'number'. callb((a) => { a.length; }); // Error, we picked the first overload and errored when type checking the lambda body ~~~~~~ -!!! Property 'length' does not exist on type 'number'. \ No newline at end of file +!!! error TS2339: Property 'length' does not exist on type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt index 2e3633b4d64..b388d1b0e4a 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt @@ -1,11 +1,16 @@ +tests/cases/compiler/contextualTypingOfObjectLiterals.ts(4,1): error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. + Index signature is missing in type '{ x: string; }'. +tests/cases/compiler/contextualTypingOfObjectLiterals.ts(10,3): error TS2345: Argument of type '{ x: string; }' is not assignable to parameter of type '{ [x: string]: string; }'. + + ==== tests/cases/compiler/contextualTypingOfObjectLiterals.ts (2 errors) ==== var obj1: { [x: string]: string; }; var obj2 = {x: ""}; obj1 = {}; // Ok obj1 = obj2; // Error - indexer doesn't match ~~~~ -!!! Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }': -!!! Index signature is missing in type '{ x: string; }'. +!!! error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signature is missing in type '{ x: string; }'. function f(x: { [s: string]: string }) { } @@ -13,4 +18,4 @@ f(obj1); // Ok f(obj2); // Error - indexer doesn't match ~~~~ -!!! Argument of type '{ x: string; }' is not assignable to parameter of type '{ [x: string]: string; }'. \ No newline at end of file +!!! error TS2345: Argument of type '{ x: string; }' is not assignable to parameter of type '{ [x: string]: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals2.errors.txt b/tests/baselines/reference/contextualTypingOfObjectLiterals2.errors.txt index a91abdb2954..27ce89c4714 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals2.errors.txt +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/contextualTypingOfObjectLiterals2.ts(5,18): error TS2339: Property 'hmm' does not exist on type 'string'. + + ==== tests/cases/compiler/contextualTypingOfObjectLiterals2.ts (1 errors) ==== interface Foo { foo: (t: string) => string; @@ -5,4 +8,4 @@ function f2(args: Foo) { } f2({ foo: s => s.hmm }) // 's' should be 'string', so this should be an error ~~~ -!!! Property 'hmm' does not exist on type 'string'. \ No newline at end of file +!!! error TS2339: Property 'hmm' does not exist on type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt index e9de74b27ec..b668468eac3 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt @@ -1,6 +1,14 @@ -==== tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts (1 errors) ==== +tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(2,22): error TS2339: Property 'foo' does not exist on type 'string'. +tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,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'. + + +==== tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts (2 errors) ==== var f10: (x: T, b: () => (a: T) => void, y: T) => T; - f10('', () => a => a.foo, ''); // a is string, fixed by first parameter + f10('', () => a => a.foo, ''); // a is string ~~~ -!!! Property 'foo' does not exist on type 'string'. - var r9 = f10('', () => (a => a.foo), 1); // now a should be any \ No newline at end of file +!!! error TS2339: Property 'foo' does not exist on type 'string'. + var r9 = f10('', () => (a => a.foo), 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 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js index cf7274db8a0..55f7580b3f8 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js @@ -1,9 +1,9 @@ //// [contextualTypingWithFixedTypeParameters1.ts] var f10: (x: T, b: () => (a: T) => void, y: T) => T; -f10('', () => a => a.foo, ''); // a is string, fixed by first parameter -var r9 = f10('', () => (a => a.foo), 1); // now a should be any +f10('', () => a => a.foo, ''); // a is string +var r9 = f10('', () => (a => a.foo), 1); // error //// [contextualTypingWithFixedTypeParameters1.js] var f10; -f10('', function () { return function (a) { return a.foo; }; }, ''); // a is string, fixed by first parameter -var r9 = f10('', function () { return (function (a) { return a.foo; }); }, 1); // now a should be any +f10('', function () { return function (a) { return a.foo; }; }, ''); // a is string +var r9 = f10('', function () { return (function (a) { return a.foo; }); }, 1); // error diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.types b/tests/baselines/reference/contextuallyTypingOrOperator.types index ee1ac4b0bba..47b78f5691d 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator.types @@ -3,7 +3,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >v : { a: (_: string) => number; } >a : (_: string) => number >_ : string ->{ a: s => s.length } || { a: s => 1 } : { a: (_: string) => number; } +>{ a: s => s.length } || { a: s => 1 } : { a: (s: string) => number; } >{ a: s => s.length } : { a: (s: string) => number; } >a : (s: string) => number >s => s.length : (s: string) => number @@ -17,10 +17,10 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >s : string var v2 = (s: string) => s.length || function (s) { s.length }; ->v2 : (s: string) => {} ->(s: string) => s.length || function (s) { s.length } : (s: string) => {} +>v2 : (s: string) => number | ((s: any) => void) +>(s: string) => s.length || function (s) { s.length } : (s: string) => number | ((s: any) => void) >s : string ->s.length || function (s) { s.length } : {} +>s.length || function (s) { s.length } : number | ((s: any) => void) >s.length : number >s : string >length : number @@ -31,10 +31,10 @@ var v2 = (s: string) => s.length || function (s) { s.length }; >length : any var v3 = (s: string) => s.length || function (s: number) { return 1 }; ->v3 : (s: string) => {} ->(s: string) => s.length || function (s: number) { return 1 } : (s: string) => {} +>v3 : (s: string) => number | ((s: number) => number) +>(s: string) => s.length || function (s: number) { return 1 } : (s: string) => number | ((s: number) => number) >s : string ->s.length || function (s: number) { return 1 } : {} +>s.length || function (s: number) { return 1 } : number | ((s: number) => number) >s.length : number >s : string >length : number @@ -42,10 +42,10 @@ var v3 = (s: string) => s.length || function (s: number) { return 1 }; >s : number var v4 = (s: number) => 1 || function (s: string) { return s.length }; ->v4 : (s: number) => {} ->(s: number) => 1 || function (s: string) { return s.length } : (s: number) => {} +>v4 : (s: number) => number | ((s: string) => number) +>(s: number) => 1 || function (s: string) { return s.length } : (s: number) => number | ((s: string) => number) >s : number ->1 || function (s: string) { return s.length } : {} +>1 || function (s: string) { return s.length } : number | ((s: string) => number) >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 57c9992436d..65ed442d5e9 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator2.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.types @@ -3,7 +3,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >v : { a: (_: string) => number; } >a : (_: string) => number >_ : string ->{ a: s => s.length } || { a: s => 1 } : { a: (_: string) => number; } +>{ a: s => s.length } || { a: s => 1 } : { a: (s: string) => number; } >{ a: s => s.length } : { a: (s: string) => number; } >a : (s: string) => number >s => s.length : (s: string) => number @@ -17,10 +17,10 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >s : string var v2 = (s: string) => s.length || function (s) { s.aaa }; ->v2 : (s: string) => {} ->(s: string) => s.length || function (s) { s.aaa } : (s: string) => {} +>v2 : (s: string) => number | ((s: any) => void) +>(s: string) => s.length || function (s) { s.aaa } : (s: string) => number | ((s: any) => void) >s : string ->s.length || function (s) { s.aaa } : {} +>s.length || function (s) { s.aaa } : number | ((s: any) => void) >s.length : number >s : string >length : number diff --git a/tests/baselines/reference/contextuallyTypingOrOperator3.errors.txt b/tests/baselines/reference/contextuallyTypingOrOperator3.errors.txt index 8c22771ad8f..ca7385b9c29 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator3.errors.txt +++ b/tests/baselines/reference/contextuallyTypingOrOperator3.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/contextuallyTypingOrOperator3.ts(1,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/contextuallyTypingOrOperator3.ts (1 errors) ==== function foo(u: U) { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var x3: U = u || u; } \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt b/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt new file mode 100644 index 00000000000..b64c255c867 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/contextuallyTypingRestParameters.ts(3,9): error TS2322: Type 'string[]' is not assignable to type 'string'. +tests/cases/compiler/contextuallyTypingRestParameters.ts(5,9): error TS2322: Type 'string[]' is not assignable to type 'string'. + + +==== tests/cases/compiler/contextuallyTypingRestParameters.ts (2 errors) ==== + var x: (...y: string[]) => void = function (.../*3*/y) { + var t = y; + var x2: string = t; // This should be error + ~~ +!!! error TS2322: Type 'string[]' is not assignable to type 'string'. + var x3: string[] = t; // No error + var y2: string = y; // This should be error + ~~ +!!! error TS2322: Type 'string[]' is not assignable to type 'string'. + var y3: string[] = y; // No error + }; \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypingRestParameters.js b/tests/baselines/reference/contextuallyTypingRestParameters.js new file mode 100644 index 00000000000..17561f5d7fc --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingRestParameters.js @@ -0,0 +1,21 @@ +//// [contextuallyTypingRestParameters.ts] +var x: (...y: string[]) => void = function (.../*3*/y) { + var t = y; + var x2: string = t; // This should be error + var x3: string[] = t; // No error + var y2: string = y; // This should be error + var y3: string[] = y; // No error +}; + +//// [contextuallyTypingRestParameters.js] +var x = function () { + var y = []; + for (var _i = 0; _i < arguments.length; _i++) { + y[_i - 0] = arguments[_i]; + } + var t = y; + var x2 = t; // This should be error + var x3 = t; // No error + var y2 = y; // This should be error + var y3 = y; // No error +}; diff --git a/tests/baselines/reference/continueInIterationStatement4.errors.txt b/tests/baselines/reference/continueInIterationStatement4.errors.txt index c0f4388cf79..bbc20570547 100644 --- a/tests/baselines/reference/continueInIterationStatement4.errors.txt +++ b/tests/baselines/reference/continueInIterationStatement4.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/continueInIterationStatement4.ts(1,15): error TS2304: Cannot find name 'something'. + + ==== tests/cases/compiler/continueInIterationStatement4.ts (1 errors) ==== for (var i in something) { ~~~~~~~~~ -!!! Cannot find name 'something'. +!!! error TS2304: Cannot find name 'something'. continue; } \ No newline at end of file diff --git a/tests/baselines/reference/continueNotInIterationStatement1.errors.txt b/tests/baselines/reference/continueNotInIterationStatement1.errors.txt index 5f7d543a0aa..8643b4134e0 100644 --- a/tests/baselines/reference/continueNotInIterationStatement1.errors.txt +++ b/tests/baselines/reference/continueNotInIterationStatement1.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/continueNotInIterationStatement1.ts(1,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. + + ==== tests/cases/compiler/continueNotInIterationStatement1.ts (1 errors) ==== continue; ~~~~~~~~~ -!!! A 'continue' statement can only be used within an enclosing iteration statement. \ No newline at end of file +!!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. \ No newline at end of file diff --git a/tests/baselines/reference/continueNotInIterationStatement2.errors.txt b/tests/baselines/reference/continueNotInIterationStatement2.errors.txt index 0bfc41d7f72..f294be84b09 100644 --- a/tests/baselines/reference/continueNotInIterationStatement2.errors.txt +++ b/tests/baselines/reference/continueNotInIterationStatement2.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/continueNotInIterationStatement2.ts(3,5): error TS1107: Jump target cannot cross function boundary. + + ==== tests/cases/compiler/continueNotInIterationStatement2.ts (1 errors) ==== while (true) { function f() { continue; ~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } \ No newline at end of file diff --git a/tests/baselines/reference/continueNotInIterationStatement3.errors.txt b/tests/baselines/reference/continueNotInIterationStatement3.errors.txt index d8627b4fc3a..5ef40d2f62a 100644 --- a/tests/baselines/reference/continueNotInIterationStatement3.errors.txt +++ b/tests/baselines/reference/continueNotInIterationStatement3.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/continueNotInIterationStatement3.ts(3,5): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. + + ==== tests/cases/compiler/continueNotInIterationStatement3.ts (1 errors) ==== switch (0) { default: continue; ~~~~~~~~~ -!!! A 'continue' statement can only be used within an enclosing iteration statement. +!!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. } \ No newline at end of file diff --git a/tests/baselines/reference/continueNotInIterationStatement4.errors.txt b/tests/baselines/reference/continueNotInIterationStatement4.errors.txt index 91e7b26b578..1c80f7057b8 100644 --- a/tests/baselines/reference/continueNotInIterationStatement4.errors.txt +++ b/tests/baselines/reference/continueNotInIterationStatement4.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/continueNotInIterationStatement4.ts(4,5): error TS1107: Jump target cannot cross function boundary. + + ==== tests/cases/compiler/continueNotInIterationStatement4.ts (1 errors) ==== TWO: while (true){ var x = () => { continue TWO; ~~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget1.errors.txt b/tests/baselines/reference/continueTarget1.errors.txt index 1b93d9fc707..7b1f40e02f0 100644 --- a/tests/baselines/reference/continueTarget1.errors.txt +++ b/tests/baselines/reference/continueTarget1.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/continueTarget1.ts(2,3): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. + + ==== tests/cases/compiler/continueTarget1.ts (1 errors) ==== target: continue target; ~~~~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. \ No newline at end of file +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget5.errors.txt b/tests/baselines/reference/continueTarget5.errors.txt index aa156707aa5..401c5874ee0 100644 --- a/tests/baselines/reference/continueTarget5.errors.txt +++ b/tests/baselines/reference/continueTarget5.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/continueTarget5.ts(5,7): error TS1107: Jump target cannot cross function boundary. + + ==== tests/cases/compiler/continueTarget5.ts (1 errors) ==== target: while (true) { @@ -5,7 +8,7 @@ while (true) { continue target; ~~~~~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } } \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget6.errors.txt b/tests/baselines/reference/continueTarget6.errors.txt index 2177e50523d..2220467abcb 100644 --- a/tests/baselines/reference/continueTarget6.errors.txt +++ b/tests/baselines/reference/continueTarget6.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/continueTarget6.ts(2,3): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. + + ==== tests/cases/compiler/continueTarget6.ts (1 errors) ==== while (true) { continue target; ~~~~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. } \ No newline at end of file diff --git a/tests/baselines/reference/copyrightWithNewLine1.errors.txt b/tests/baselines/reference/copyrightWithNewLine1.errors.txt index a389197bf39..680d783a1d9 100644 --- a/tests/baselines/reference/copyrightWithNewLine1.errors.txt +++ b/tests/baselines/reference/copyrightWithNewLine1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/copyrightWithNewLine1.ts(5,24): error TS2307: Cannot find external module './greeter'. +tests/cases/compiler/copyrightWithNewLine1.ts(6,10): error TS2304: Cannot find name 'document'. + + ==== tests/cases/compiler/copyrightWithNewLine1.ts (2 errors) ==== /***************************** * (c) Copyright - Important @@ -5,10 +9,10 @@ import model = require("./greeter") ~~~~~~~~~~~ -!!! Cannot find external module './greeter'. +!!! error TS2307: Cannot find external module './greeter'. var el = document.getElementById('content'); ~~~~~~~~ -!!! Cannot find name 'document'. +!!! error TS2304: Cannot find name 'document'. var greeter = new model.Greeter(el); /** things */ greeter.start(); \ No newline at end of file diff --git a/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt b/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt index 429764799e2..a4f792f2dae 100644 --- a/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt +++ b/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt @@ -1,13 +1,17 @@ +tests/cases/compiler/copyrightWithoutNewLine1.ts(4,24): error TS2307: Cannot find external module './greeter'. +tests/cases/compiler/copyrightWithoutNewLine1.ts(5,10): error TS2304: Cannot find name 'document'. + + ==== tests/cases/compiler/copyrightWithoutNewLine1.ts (2 errors) ==== /***************************** * (c) Copyright - Important ****************************/ import model = require("./greeter") ~~~~~~~~~~~ -!!! Cannot find external module './greeter'. +!!! error TS2307: Cannot find external module './greeter'. var el = document.getElementById('content'); ~~~~~~~~ -!!! Cannot find name 'document'. +!!! error TS2304: Cannot find name 'document'. var greeter = new model.Greeter(el); /** things */ greeter.start(); \ No newline at end of file diff --git a/tests/baselines/reference/couldNotSelectGenericOverload.errors.txt b/tests/baselines/reference/couldNotSelectGenericOverload.errors.txt index 8a813a1b432..bafa2bc4237 100644 --- a/tests/baselines/reference/couldNotSelectGenericOverload.errors.txt +++ b/tests/baselines/reference/couldNotSelectGenericOverload.errors.txt @@ -1,13 +1,17 @@ +tests/cases/compiler/couldNotSelectGenericOverload.ts(3,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/couldNotSelectGenericOverload.ts(7,11): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/couldNotSelectGenericOverload.ts (2 errors) ==== function makeArray(items: T[]): T[] { return items; } var b = [1, ""]; var b1G = makeArray(1, ""); // any, no error ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var b2G = makeArray(b); // any[] function makeArray2(items: any[]): any[] { return items; } var b3G = makeArray2(1, ""); // error ~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt index 3659bab73e8..717d76309a5 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(5,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(9,5): error TS2322: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D'. + Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. + + ==== tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts (2 errors) ==== class C { private x = 1; @@ -5,12 +10,12 @@ class D extends C { } function foo(x: "hi", items: string[]): typeof foo; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(x: string, items: string[]): typeof foo { return null; } var a: D = foo("hi", []); ~ -!!! Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D': -!!! Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. +!!! error TS2322: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D'. +!!! error TS2322: Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. \ No newline at end of file diff --git a/tests/baselines/reference/crashIntypeCheckInvocationExpression.errors.txt b/tests/baselines/reference/crashIntypeCheckInvocationExpression.errors.txt index 46693ee5726..a1f5afbde13 100644 --- a/tests/baselines/reference/crashIntypeCheckInvocationExpression.errors.txt +++ b/tests/baselines/reference/crashIntypeCheckInvocationExpression.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/crashIntypeCheckInvocationExpression.ts(6,28): error TS2304: Cannot find name 'task'. +tests/cases/compiler/crashIntypeCheckInvocationExpression.ts(8,18): error TS2304: Cannot find name 'path'. +tests/cases/compiler/crashIntypeCheckInvocationExpression.ts(9,19): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/compiler/crashIntypeCheckInvocationExpression.ts(10,50): error TS2304: Cannot find name 'moduleType'. + + ==== tests/cases/compiler/crashIntypeCheckInvocationExpression.ts (4 errors) ==== var nake; function doCompile(fileset: P0, moduleType: P1) { @@ -6,16 +12,16 @@ } export var compileServer = task(() => { ~~~~ -!!! Cannot find name 'task'. +!!! error TS2304: Cannot find name 'task'. var folder = path.join(), ~~~~ -!!! Cannot find name 'path'. +!!! error TS2304: Cannot find name 'path'. fileset = nake.fileSetSync(folder) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. return doCompile(fileset, moduleType); ~~~~~~~~~~ -!!! Cannot find name 'moduleType'. +!!! error TS2304: Cannot find name 'moduleType'. }); \ No newline at end of file diff --git a/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.errors.txt b/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.errors.txt index 3399c75914c..a1a129795a4 100644 --- a/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.errors.txt +++ b/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/crashIntypeCheckObjectCreationExpression.ts(3,45): error TS2304: Cannot find name 'X'. + + ==== tests/cases/compiler/crashIntypeCheckObjectCreationExpression.ts (1 errors) ==== export class BuildWorkspaceService { public injectRequestService(service: P0) { this.injectBuildService(new X(service)); ~ -!!! Cannot find name 'X'. +!!! error TS2304: Cannot find name 'X'. } public injectBuildService(service: P0) { } diff --git a/tests/baselines/reference/crashOnMethodSignatures.errors.txt b/tests/baselines/reference/crashOnMethodSignatures.errors.txt index 014700b8135..1970d4270d4 100644 --- a/tests/baselines/reference/crashOnMethodSignatures.errors.txt +++ b/tests/baselines/reference/crashOnMethodSignatures.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/crashOnMethodSignatures.ts(2,5): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/crashOnMethodSignatures.ts (1 errors) ==== class A { a(completed: () => any): void; ~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/crashRegressionTest.errors.txt b/tests/baselines/reference/crashRegressionTest.errors.txt index a08d1181397..316f796067a 100644 --- a/tests/baselines/reference/crashRegressionTest.errors.txt +++ b/tests/baselines/reference/crashRegressionTest.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/crashRegressionTest.ts(16,56): error TS2339: Property '_name' does not exist on type 'StringTemplate'. + + ==== tests/cases/compiler/crashRegressionTest.ts (1 errors) ==== module MsPortal.Util.TemplateEngine { "use strict"; @@ -16,7 +19,7 @@ public text(value?: string): any { this._templateStorage.templateSources[this._name] = value; ~~~~~ -!!! Property '_name' does not exist on type 'StringTemplate'. +!!! error TS2339: Property '_name' does not exist on type 'StringTemplate'. } } diff --git a/tests/baselines/reference/createArray.errors.txt b/tests/baselines/reference/createArray.errors.txt index 41426d307fa..2e2b4567567 100644 --- a/tests/baselines/reference/createArray.errors.txt +++ b/tests/baselines/reference/createArray.errors.txt @@ -1,26 +1,35 @@ +tests/cases/compiler/createArray.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(6,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(7,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(8,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(1,12): error TS2304: Cannot find name 'number'. +tests/cases/compiler/createArray.ts(7,12): error TS2304: Cannot find name 'boolean'. +tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'string'. + + ==== tests/cases/compiler/createArray.ts (7 errors) ==== var na=new number[]; - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ -!!! Cannot find name 'number'. +!!! error TS2304: Cannot find name 'number'. class C { } new C[]; - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var ba=new boolean[]; - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~~ -!!! Cannot find name 'boolean'. +!!! error TS2304: Cannot find name 'boolean'. var sa=new string[]; - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ -!!! Cannot find name 'string'. +!!! error TS2304: Cannot find name 'string'. function f(s:string):number { return 0; } if (ba[14]) { diff --git a/tests/baselines/reference/customEventDetail.errors.txt b/tests/baselines/reference/customEventDetail.errors.txt index 7cddf40e6ff..f243dc64c34 100644 --- a/tests/baselines/reference/customEventDetail.errors.txt +++ b/tests/baselines/reference/customEventDetail.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/customEventDetail.ts(1,8): error TS2304: Cannot find name 'CustomEvent'. + + ==== tests/cases/compiler/customEventDetail.ts (1 errors) ==== var x: CustomEvent; ~~~~~~~~~~~ -!!! Cannot find name 'CustomEvent'. +!!! error TS2304: Cannot find name 'CustomEvent'. // valid since detail is any x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }); diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js new file mode 100644 index 00000000000..30ba24ed405 --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/declFileAliasUseBeforeDeclaration.ts] //// + +//// [declFileAliasUseBeforeDeclaration_foo.ts] + +export class Foo { } + +//// [declFileAliasUseBeforeDeclaration_test.ts] +export function bar(a: foo.Foo) { } +import foo = require("declFileAliasUseBeforeDeclaration_foo"); + +//// [declFileAliasUseBeforeDeclaration_foo.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +exports.Foo = Foo; +//// [declFileAliasUseBeforeDeclaration_test.js] +function bar(a) { +} +exports.bar = bar; + + +//// [declFileAliasUseBeforeDeclaration_foo.d.ts] +export declare class Foo { +} +//// [declFileAliasUseBeforeDeclaration_test.d.ts] +export declare function bar(a: foo.Foo): void; +import foo = require("declFileAliasUseBeforeDeclaration_foo"); diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types new file mode 100644 index 00000000000..800df4ada49 --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types @@ -0,0 +1,15 @@ +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration_test.ts === +export function bar(a: foo.Foo) { } +>bar : (a: foo.Foo) => void +>a : foo.Foo +>foo : unknown +>Foo : foo.Foo + +import foo = require("declFileAliasUseBeforeDeclaration_foo"); +>foo : typeof foo + +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration_foo.ts === + +export class Foo { } +>Foo : Foo + diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.js b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.js new file mode 100644 index 00000000000..905a298bd32 --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.js @@ -0,0 +1,25 @@ +//// [declFileAliasUseBeforeDeclaration2.ts] + +declare module "test" { + module A { + class C { + } + } + class B extends E { + } + import E = A.C; +} + +//// [declFileAliasUseBeforeDeclaration2.js] + + +//// [declFileAliasUseBeforeDeclaration2.d.ts] +declare module "test" { + module A { + class C { + } + } + class B extends E { + } + import E = A.C; +} diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.types b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.types new file mode 100644 index 00000000000..362dd031e09 --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration2.ts === + +declare module "test" { + module A { +>A : typeof A + + class C { +>C : C + } + } + class B extends E { +>B : B +>E : E + } + import E = A.C; +>E : typeof E +>A : typeof A +>C : E +} diff --git a/tests/baselines/reference/declFileForInterfaceWithRestParams.js b/tests/baselines/reference/declFileForInterfaceWithRestParams.js index b2da71ba208..8979f7df6da 100644 --- a/tests/baselines/reference/declFileForInterfaceWithRestParams.js +++ b/tests/baselines/reference/declFileForInterfaceWithRestParams.js @@ -11,7 +11,7 @@ interface I { //// [declFileForInterfaceWithRestParams.d.ts] interface I { - foo(...x: any[]): any[]; - foo2(a: number, ...x: any[]): any[]; - foo3(b: string, ...x: string[]): string[]; + foo(...x: any[]): typeof x; + foo2(a: number, ...x: any[]): typeof x; + foo3(b: string, ...x: string[]): typeof x; } diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index ef8d6d453af..3c8120e8db9 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -120,9 +120,9 @@ export declare module C { class B { } function F(x: T): A; - function F2(x: T): A; - function F3(x: T): A[]; - function F4>(x: T): A[]; + function F2(x: T): C.A; + function F3(x: T): C.A[]; + function F4>(x: T): Array>; function F5(): T; function F6>(x: T): T; class D { diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index 0e0381cd87d..db1399e64d3 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -97,16 +97,16 @@ declare module templa.mvc { } } declare module templa.mvc { - interface IController { + interface IController { } } declare module templa.mvc { - class AbstractController implements IController { + class AbstractController implements mvc.IController { } } declare module templa.mvc.composite { - interface ICompositeControllerModel extends IModel { - getControllers(): IController[]; + interface ICompositeControllerModel extends mvc.IModel { + getControllers(): mvc.IController[]; } } declare module templa.dom.mvc { @@ -119,7 +119,7 @@ declare module templa.dom.mvc { } } declare module templa.dom.mvc.composite { - class AbstractCompositeElementController extends AbstractElementController { + class AbstractCompositeElementController extends templa.dom.mvc.AbstractElementController { _controllers: templa.mvc.IController[]; constructor(); } diff --git a/tests/baselines/reference/declFileGenericType2.types b/tests/baselines/reference/declFileGenericType2.types index a6b6546326c..f9345b5ff11 100644 --- a/tests/baselines/reference/declFileGenericType2.types +++ b/tests/baselines/reference/declFileGenericType2.types @@ -131,11 +131,11 @@ module templa.dom.mvc.composite { >super : typeof AbstractElementController this._controllers = []; ->this._controllers = [] : templa.mvc.IController[] +>this._controllers = [] : undefined[] >this._controllers : templa.mvc.IController[] >this : AbstractCompositeElementController >_controllers : templa.mvc.IController[] ->[] : templa.mvc.IController[] +>[] : undefined[] } } } diff --git a/tests/baselines/reference/declFileObjectLiteralWithAccessors.errors.txt b/tests/baselines/reference/declFileObjectLiteralWithAccessors.errors.txt index bb0e82e470b..4c0093a5438 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithAccessors.errors.txt +++ b/tests/baselines/reference/declFileObjectLiteralWithAccessors.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/declFileObjectLiteralWithAccessors.ts(5,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/declFileObjectLiteralWithAccessors.ts(6,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/declFileObjectLiteralWithAccessors.ts (2 errors) ==== function /*1*/makePoint(x: number) { @@ -5,10 +9,10 @@ b: 10, get x() { return x; }, ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. set x(a: number) { this.b = a; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. }; }; var /*4*/point = makePoint(2); diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.errors.txt b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.errors.txt index 17d42cfbbb1..961442c23d0 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.errors.txt +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts(4,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts (1 errors) ==== function /*1*/makePoint(x: number) { return { get x() { return x; }, ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. }; }; var /*4*/point = makePoint(2); diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt index 5499492feae..7680a8d14dc 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts(5,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts (1 errors) ==== function /*1*/makePoint(x: number) { @@ -5,7 +8,7 @@ b: 10, set x(a: number) { this.b = a; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. }; }; var /*3*/point = makePoint(2); diff --git a/tests/baselines/reference/declFilePrivateMethodOverloads.js b/tests/baselines/reference/declFilePrivateMethodOverloads.js new file mode 100644 index 00000000000..d6b2320b904 --- /dev/null +++ b/tests/baselines/reference/declFilePrivateMethodOverloads.js @@ -0,0 +1,54 @@ +//// [declFilePrivateMethodOverloads.ts] + +interface IContext { + someMethod(); +} +class c1 { + private _forEachBindingContext(bindingContext: IContext, fn: (bindingContext: IContext) => void); + private _forEachBindingContext(bindingContextArray: Array, fn: (bindingContext: IContext) => void); + private _forEachBindingContext(context, fn: (bindingContext: IContext) => void): void { + // Function here + } + + private overloadWithArityDifference(bindingContext: IContext); + private overloadWithArityDifference(bindingContextArray: Array, fn: (bindingContext: IContext) => void); + private overloadWithArityDifference(context): void { + // Function here + } +} +declare class c2 { + private overload1(context, fn); + + private overload2(context); + private overload2(context, fn); +} + +//// [declFilePrivateMethodOverloads.js] +var c1 = (function () { + function c1() { + } + c1.prototype._forEachBindingContext = function (context, fn) { + // Function here + }; + c1.prototype.overloadWithArityDifference = function (context) { + // Function here + }; + return c1; +})(); + + +//// [declFilePrivateMethodOverloads.d.ts] +interface IContext { + someMethod(): any; +} +declare class c1 { + private _forEachBindingContext(bindingContext, fn); + private _forEachBindingContext(bindingContextArray, fn); + private overloadWithArityDifference(bindingContext); + private overloadWithArityDifference(bindingContextArray, fn); +} +declare class c2 { + private overload1(context, fn); + private overload2(context); + private overload2(context, fn); +} diff --git a/tests/baselines/reference/declFilePrivateMethodOverloads.types b/tests/baselines/reference/declFilePrivateMethodOverloads.types new file mode 100644 index 00000000000..9989fea31f0 --- /dev/null +++ b/tests/baselines/reference/declFilePrivateMethodOverloads.types @@ -0,0 +1,76 @@ +=== tests/cases/compiler/declFilePrivateMethodOverloads.ts === + +interface IContext { +>IContext : IContext + + someMethod(); +>someMethod : () => any +} +class c1 { +>c1 : c1 + + private _forEachBindingContext(bindingContext: IContext, fn: (bindingContext: IContext) => void); +>_forEachBindingContext : { (bindingContext: IContext, fn: (bindingContext: IContext) => void): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>bindingContext : IContext +>IContext : IContext +>fn : (bindingContext: IContext) => void +>bindingContext : IContext +>IContext : IContext + + private _forEachBindingContext(bindingContextArray: Array, fn: (bindingContext: IContext) => void); +>_forEachBindingContext : { (bindingContext: IContext, fn: (bindingContext: IContext) => void): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>bindingContextArray : IContext[] +>Array : T[] +>IContext : IContext +>fn : (bindingContext: IContext) => void +>bindingContext : IContext +>IContext : IContext + + private _forEachBindingContext(context, fn: (bindingContext: IContext) => void): void { +>_forEachBindingContext : { (bindingContext: IContext, fn: (bindingContext: IContext) => void): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>context : any +>fn : (bindingContext: IContext) => void +>bindingContext : IContext +>IContext : IContext + + // Function here + } + + private overloadWithArityDifference(bindingContext: IContext); +>overloadWithArityDifference : { (bindingContext: IContext): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>bindingContext : IContext +>IContext : IContext + + private overloadWithArityDifference(bindingContextArray: Array, fn: (bindingContext: IContext) => void); +>overloadWithArityDifference : { (bindingContext: IContext): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>bindingContextArray : IContext[] +>Array : T[] +>IContext : IContext +>fn : (bindingContext: IContext) => void +>bindingContext : IContext +>IContext : IContext + + private overloadWithArityDifference(context): void { +>overloadWithArityDifference : { (bindingContext: IContext): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>context : any + + // Function here + } +} +declare class c2 { +>c2 : c2 + + private overload1(context, fn); +>overload1 : (context: any, fn: any) => any +>context : any +>fn : any + + private overload2(context); +>overload2 : { (context: any): any; (context: any, fn: any): any; } +>context : any + + private overload2(context, fn); +>overload2 : { (context: any): any; (context: any, fn: any): any; } +>context : any +>fn : any +} diff --git a/tests/baselines/reference/declFilePrivateStatic.errors.txt b/tests/baselines/reference/declFilePrivateStatic.errors.txt index 14d69a0653b..4e1da34b979 100644 --- a/tests/baselines/reference/declFilePrivateStatic.errors.txt +++ b/tests/baselines/reference/declFilePrivateStatic.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/declFilePrivateStatic.ts(9,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/declFilePrivateStatic.ts(10,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/declFilePrivateStatic.ts(12,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/declFilePrivateStatic.ts(13,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/declFilePrivateStatic.ts (4 errors) ==== class C { @@ -9,15 +15,15 @@ private static get c() { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static get d() { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. private static set e(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static set f(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/declFileRegressionTests.types b/tests/baselines/reference/declFileRegressionTests.types index f230d93f0dd..8d058769c0a 100644 --- a/tests/baselines/reference/declFileRegressionTests.types +++ b/tests/baselines/reference/declFileRegressionTests.types @@ -4,7 +4,7 @@ var n = { w: null, x: '', y: () => { }, z: 32 }; >n : { w: any; x: string; y: () => void; z: number; } >{ w: null, x: '', y: () => { }, z: 32 } : { w: null; x: string; y: () => void; z: number; } ->w : any +>w : null >x : string >y : () => void >() => { } : () => void diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js index 5ff631c6aad..2d071c80de9 100644 --- a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js @@ -32,8 +32,12 @@ var f6 = function () { //// [declFileRestParametersOfFunctionAndFunctionType.d.ts] declare function f1(...args: any[]): void; -declare function f2(x: (...args: any[]) => void): void; -declare function f3(x: (...args: any[]) => void): void; -declare function f4 void>(): void; -declare function f5 void>(): void; +declare function f2(x: (...args) => void): void; +declare function f3(x: { + (...args): void; +}): void; +declare function f4 void>(): void; +declare function f5(): void; declare var f6: () => any[]; diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.js b/tests/baselines/reference/declFileTypeAnnotationArrayType.js new file mode 100644 index 00000000000..0a9d04d6bc7 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.js @@ -0,0 +1,137 @@ +//// [declFileTypeAnnotationArrayType.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): c[] { + return [new c()]; +} +function foo2() { + return [new c()]; +} + +// Qualified name +function foo3(): m.c[] { + return [new m.c()]; +} +function foo4() { + return m.c; +} + +// Just the name with type arguments +function foo5(): g[] { + return [new g()]; +} +function foo6() { + return [new g()]; +} + +// Qualified name with type arguments +function foo7(): m.g[] { + return [new m.g()]; +} +function foo8() { + return [new m.g()]; +} + +// Array of function types +function foo9(): (()=>c)[] { + return [() => new c()]; +} +function foo10() { + return [() => new c()]; +} + +//// [declFileTypeAnnotationArrayType.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +function foo() { + return [new c()]; +} +function foo2() { + return [new c()]; +} +// Qualified name +function foo3() { + return [new m.c()]; +} +function foo4() { + return m.c; +} +// Just the name with type arguments +function foo5() { + return [new g()]; +} +function foo6() { + return [new g()]; +} +// Qualified name with type arguments +function foo7() { + return [new m.g()]; +} +function foo8() { + return [new m.g()]; +} +// Array of function types +function foo9() { + return [function () { return new c(); }]; +} +function foo10() { + return [function () { return new c(); }]; +} + + +//// [declFileTypeAnnotationArrayType.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare function foo(): c[]; +declare function foo2(): c[]; +declare function foo3(): m.c[]; +declare function foo4(): typeof m.c; +declare function foo5(): g[]; +declare function foo6(): g[]; +declare function foo7(): m.g[]; +declare function foo8(): m.g[]; +declare function foo9(): (() => c)[]; +declare function foo10(): (() => c)[]; diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.types b/tests/baselines/reference/declFileTypeAnnotationArrayType.types new file mode 100644 index 00000000000..860d13af47c --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.types @@ -0,0 +1,125 @@ +=== tests/cases/compiler/declFileTypeAnnotationArrayType.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +function foo(): c[] { +>foo : () => c[] +>c : c + + return [new c()]; +>[new c()] : c[] +>new c() : c +>c : typeof c +} +function foo2() { +>foo2 : () => c[] + + return [new c()]; +>[new c()] : c[] +>new c() : c +>c : typeof c +} + +// Qualified name +function foo3(): m.c[] { +>foo3 : () => m.c[] +>m : unknown +>c : m.c + + return [new m.c()]; +>[new m.c()] : m.c[] +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} +function foo4() { +>foo4 : () => typeof m.c + + return m.c; +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} + +// Just the name with type arguments +function foo5(): g[] { +>foo5 : () => g[] +>g : g + + return [new g()]; +>[new g()] : g[] +>new g() : g +>g : typeof g +} +function foo6() { +>foo6 : () => g[] + + return [new g()]; +>[new g()] : g[] +>new g() : g +>g : typeof g +} + +// Qualified name with type arguments +function foo7(): m.g[] { +>foo7 : () => m.g[] +>m : unknown +>g : m.g + + return [new m.g()]; +>[new m.g()] : m.g[] +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} +function foo8() { +>foo8 : () => m.g[] + + return [new m.g()]; +>[new m.g()] : m.g[] +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} + +// Array of function types +function foo9(): (()=>c)[] { +>foo9 : () => (() => c)[] +>c : c + + return [() => new c()]; +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c +} +function foo10() { +>foo10 : () => (() => c)[] + + return [() => new c()]; +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c +} diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.js b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.js new file mode 100644 index 00000000000..fc877ab4b32 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.js @@ -0,0 +1,91 @@ +//// [declFileTypeAnnotationBuiltInType.ts] + +// string +function foo(): string { + return ""; +} +function foo2() { + return ""; +} + +// number +function foo3(): number { + return 10; +} +function foo4() { + return 10; +} + +// boolean +function foo5(): boolean { + return true; +} +function foo6() { + return false; +} + +// void +function foo7(): void { + return; +} +function foo8() { + return; +} + +// any +function foo9(): any { + return undefined; +} +function foo10() { + return undefined; +} + +//// [declFileTypeAnnotationBuiltInType.js] +// string +function foo() { + return ""; +} +function foo2() { + return ""; +} +// number +function foo3() { + return 10; +} +function foo4() { + return 10; +} +// boolean +function foo5() { + return true; +} +function foo6() { + return false; +} +// void +function foo7() { + return; +} +function foo8() { + return; +} +// any +function foo9() { + return undefined; +} +function foo10() { + return undefined; +} + + +//// [declFileTypeAnnotationBuiltInType.d.ts] +declare function foo(): string; +declare function foo2(): string; +declare function foo3(): number; +declare function foo4(): number; +declare function foo5(): boolean; +declare function foo6(): boolean; +declare function foo7(): void; +declare function foo8(): void; +declare function foo9(): any; +declare function foo10(): any; diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types new file mode 100644 index 00000000000..ce4f5654a89 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts === + +// string +function foo(): string { +>foo : () => string + + return ""; +} +function foo2() { +>foo2 : () => string + + return ""; +} + +// number +function foo3(): number { +>foo3 : () => number + + return 10; +} +function foo4() { +>foo4 : () => number + + return 10; +} + +// boolean +function foo5(): boolean { +>foo5 : () => boolean + + return true; +} +function foo6() { +>foo6 : () => boolean + + return false; +} + +// void +function foo7(): void { +>foo7 : () => void + + return; +} +function foo8() { +>foo8 : () => void + + return; +} + +// any +function foo9(): any { +>foo9 : () => any + + return undefined; +>undefined : undefined +} +function foo10() { +>foo10 : () => any + + return undefined; +>undefined : undefined +} diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.js b/tests/baselines/reference/declFileTypeAnnotationParenType.js new file mode 100644 index 00000000000..c61517c7339 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.js @@ -0,0 +1,32 @@ +//// [declFileTypeAnnotationParenType.ts] + +class c { + private p: string; +} + +var x: (() => c)[] = [() => new c()]; +var y = [() => new c()]; + +var k: (() => c) | string = (() => new c()) || ""; +var l = (() => new c()) || ""; + +//// [declFileTypeAnnotationParenType.js] +var c = (function () { + function c() { + } + return c; +})(); +var x = [function () { return new c(); }]; +var y = [function () { return new c(); }]; +var k = (function () { return new c(); }) || ""; +var l = (function () { return new c(); }) || ""; + + +//// [declFileTypeAnnotationParenType.d.ts] +declare class c { + private p; +} +declare var x: (() => c)[]; +declare var y: (() => c)[]; +declare var k: (() => c) | string; +declare var l: string | (() => c); diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.types b/tests/baselines/reference/declFileTypeAnnotationParenType.types new file mode 100644 index 00000000000..c904f1b3e5a --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.types @@ -0,0 +1,41 @@ +=== tests/cases/compiler/declFileTypeAnnotationParenType.ts === + +class c { +>c : c + + private p: string; +>p : string +} + +var x: (() => c)[] = [() => new c()]; +>x : (() => c)[] +>c : c +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c + +var y = [() => new c()]; +>y : (() => c)[] +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof 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 +>c : typeof c + +var l = (() => new c()) || ""; +>l : string | (() => c) +>(() => new c()) || "" : string | (() => c) +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.js b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.js new file mode 100644 index 00000000000..faa76cc869c --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.js @@ -0,0 +1,26 @@ +//// [declFileTypeAnnotationStringLiteral.ts] + +function foo(a: "hello"): number; +function foo(a: "name"): string; +function foo(a: string): string | number; +function foo(a: string): string | number { + if (a === "hello") { + return a.length; + } + + return a; +} + +//// [declFileTypeAnnotationStringLiteral.js] +function foo(a) { + if (a === "hello") { + return a.length; + } + return a; +} + + +//// [declFileTypeAnnotationStringLiteral.d.ts] +declare function foo(a: "hello"): number; +declare function foo(a: "name"): string; +declare function foo(a: string): string | number; diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types new file mode 100644 index 00000000000..d50d95f988b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types @@ -0,0 +1,31 @@ +=== tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts === + +function foo(a: "hello"): number; +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : "hello" + +function foo(a: "name"): string; +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : "name" + +function foo(a: string): string | number; +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : string + +function foo(a: string): string | number { +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : string + + if (a === "hello") { +>a === "hello" : boolean +>a : string + + return a.length; +>a.length : number +>a : string +>length : number + } + + return a; +>a : string +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.js b/tests/baselines/reference/declFileTypeAnnotationTupleType.js new file mode 100644 index 00000000000..91d44c2b07f --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.js @@ -0,0 +1,68 @@ +//// [declFileTypeAnnotationTupleType.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +var k: [c, m.c] = [new c(), new m.c()]; +var l = k; + +var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; +var y = x; + +//// [declFileTypeAnnotationTupleType.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +var k = [new c(), new m.c()]; +var l = k; +var x = [new g(), new m.g(), function () { return new c(); }]; +var y = x; + + +//// [declFileTypeAnnotationTupleType.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare var k: [c, m.c]; +declare var l: [c, m.c]; +declare var x: [g, m.g, () => c]; +declare var y: [g, m.g, () => c]; diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.types b/tests/baselines/reference/declFileTypeAnnotationTupleType.types new file mode 100644 index 00000000000..88cf5a0c743 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.types @@ -0,0 +1,60 @@ +=== tests/cases/compiler/declFileTypeAnnotationTupleType.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +var k: [c, m.c] = [new c(), new m.c()]; +>k : [c, m.c] +>c : c +>m : unknown +>c : m.c +>[new c(), new m.c()] : [c, m.c] +>new c() : c +>c : typeof c +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c + +var l = k; +>l : [c, m.c] +>k : [c, m.c] + +var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; +>x : [g, m.g, () => c] +>g : g +>m : unknown +>g : m.g +>c : c +>[new g(), new m.g(), () => new c()] : [g, m.g, () => c] +>new g() : g +>g : typeof g +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +>() => new c() : () => c +>new c() : c +>c : typeof c + +var y = x; +>y : [g, m.g, () => c] +>x : [g, m.g, () => c] + diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js new file mode 100644 index 00000000000..494603e286a --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js @@ -0,0 +1,93 @@ +//// [declFileTypeAnnotationTypeAlias.ts] + +module M { + export type Value = string | number | boolean; + export var x: Value; + + export class c { + } + + export type C = c; + + export module m { + export class c { + } + } + + export type MC = m.c; + + export type fc = () => c; +} + +interface Window { + someMethod(); +} + +module M { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; + } +} + +//// [declFileTypeAnnotationTypeAlias.js] +var M; +(function (M) { + M.x; + var c = (function () { + function c() { + } + return c; + })(); + M.c = c; + var m; + (function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + })(m = M.m || (M.m = {})); +})(M || (M = {})); +var M; +(function (M) { + var N; + (function (N) { + var Window = (function () { + function Window() { + } + return Window; + })(); + N.Window = Window; + N.p; + })(N = M.N || (M.N = {})); +})(M || (M = {})); + + +//// [declFileTypeAnnotationTypeAlias.d.ts] +declare module M { + type Value = string | number | boolean; + var x: Value; + class c { + } + type C = c; + module m { + class c { + } + } + type MC = m.c; + type fc = () => c; +} +interface Window { + someMethod(): any; +} +declare module M { + type W = Window | string; + module N { + class Window { + } + var p: W; + } +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types new file mode 100644 index 00000000000..aa475068bf0 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts === + +module M { +>M : typeof M + + export type Value = string | number | boolean; +>Value : string | number | boolean + + export var x: Value; +>x : string | number | boolean +>Value : string | number | boolean + + export class c { +>c : c + } + + export type C = c; +>C : c +>c : c + + export module m { +>m : typeof m + + export class c { +>c : c + } + } + + export type MC = m.c; +>MC : m.c +>m : unknown +>c : m.c + + export type fc = () => c; +>fc : () => c +>c : c +} + +interface Window { +>Window : Window + + someMethod(); +>someMethod : () => any +} + +module M { +>M : typeof M + + export type W = Window | string; +>W : string | Window +>Window : Window + + export module N { +>N : typeof N + + export class Window { } +>Window : Window + + export var p: W; +>p : string | Window +>W : string | Window + } +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js new file mode 100644 index 00000000000..5e4a8ea714b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js @@ -0,0 +1,92 @@ +//// [declFileTypeAnnotationTypeLiteral.ts] + +class c { +} +class g { +} +module m { + export class c { + } +} + +// Object literal with everything +var x: { + // Call signatures + (a: number): c; + (a: string): g; + + // Construct signatures + new (a: number): c; + new (a: string): m.c; + + // Indexers + [n: number]: c; + [n: string]: c; + + // Properties + a: c; + b: g; + + // methods + m1(): g; + m2(a: string, b?: number, ...c: c[]): string; +}; + + +// Function type +var y: (a: string) => string; + +// constructor type +var z: new (a: string) => m.c; + +//// [declFileTypeAnnotationTypeLiteral.js] +var c = (function () { + function c() { + } + return c; +})(); +var g = (function () { + function g() { + } + return g; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; +})(m || (m = {})); +// Object literal with everything +var x; +// Function type +var y; +// constructor type +var z; + + +//// [declFileTypeAnnotationTypeLiteral.d.ts] +declare class c { +} +declare class g { +} +declare module m { + class c { + } +} +declare var x: { + (a: number): c; + (a: string): g; + new (a: number): c; + new (a: string): m.c; + [n: number]: c; + [n: string]: c; + a: c; + b: g; + m1(): g; + m2(a: string, b?: number, ...c: c[]): string; +}; +declare var y: (a: string) => string; +declare var z: new (a: string) => m.c; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types new file mode 100644 index 00000000000..432ee1506fa --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types @@ -0,0 +1,85 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts === + +class c { +>c : c +} +class g { +>g : g +>T : T +} +module m { +>m : typeof m + + export class c { +>c : c + } +} + +// Object literal with everything +var x: { +>x : { (a: number): c; (a: string): g; new (a: number): c; new (a: string): m.c; [x: string]: c; [x: number]: c; a: c; b: g; m1(): g; m2(a: string, b?: number, ...c: c[]): string; } + + // Call signatures + (a: number): c; +>a : number +>c : c + + (a: string): g; +>a : string +>g : g + + // Construct signatures + new (a: number): c; +>a : number +>c : c + + new (a: string): m.c; +>a : string +>m : unknown +>c : m.c + + // Indexers + [n: number]: c; +>n : number +>c : c + + [n: string]: c; +>n : string +>c : c + + // Properties + a: c; +>a : c +>c : c + + b: g; +>b : g +>g : g + + // methods + m1(): g; +>m1 : () => g +>g : g + + m2(a: string, b?: number, ...c: c[]): string; +>m2 : (a: string, b?: number, ...c: c[]) => string +>a : string +>b : number +>c : c[] +>c : c + +}; + + +// Function type +var y: (a: string) => string; +>y : (a: string) => string +>a : string + +// constructor type +var z: new (a: string) => m.c; +>z : new (a: string) => m.c +>a : string +>m : unknown +>c : m.c + diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js new file mode 100644 index 00000000000..28443bc04ad --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js @@ -0,0 +1,120 @@ +//// [declFileTypeAnnotationTypeQuery.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): typeof c { + return c; +} +function foo2() { + return c; +} + +// Qualified name +function foo3(): typeof m.c { + return m.c; +} +function foo4() { + return m.c; +} + +// Just the name with type arguments +function foo5(): typeof g { + return g; +} +function foo6() { + return g; +} + +// Qualified name with type arguments +function foo7(): typeof m.g { + return m.g +} +function foo8() { + return m.g +} + +//// [declFileTypeAnnotationTypeQuery.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +function foo() { + return c; +} +function foo2() { + return c; +} +// Qualified name +function foo3() { + return m.c; +} +function foo4() { + return m.c; +} +// Just the name with type arguments +function foo5() { + return g; +} +function foo6() { + return g; +} +// Qualified name with type arguments +function foo7() { + return m.g; +} +function foo8() { + return m.g; +} + + +//// [declFileTypeAnnotationTypeQuery.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare function foo(): typeof c; +declare function foo2(): typeof c; +declare function foo3(): typeof m.c; +declare function foo4(): typeof m.c; +declare function foo5(): typeof g; +declare function foo6(): typeof g; +declare function foo7(): typeof m.g; +declare function foo8(): typeof m.g; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types new file mode 100644 index 00000000000..c7b5c421de1 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types @@ -0,0 +1,90 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +function foo(): typeof c { +>foo : () => typeof c +>c : typeof c + + return c; +>c : typeof c +} +function foo2() { +>foo2 : () => typeof c + + return c; +>c : typeof c +} + +// Qualified name +function foo3(): typeof m.c { +>foo3 : () => typeof m.c +>m : typeof m +>c : typeof m.c + + return m.c; +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} +function foo4() { +>foo4 : () => typeof m.c + + return m.c; +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} + +// Just the name with type arguments +function foo5(): typeof g { +>foo5 : () => typeof g +>g : typeof g + + return g; +>g : typeof g +} +function foo6() { +>foo6 : () => typeof g + + return g; +>g : typeof g +} + +// Qualified name with type arguments +function foo7(): typeof m.g { +>foo7 : () => typeof m.g +>m : typeof m +>g : typeof m.g + + return m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} +function foo8() { +>foo8 : () => typeof m.g + + return m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.js b/tests/baselines/reference/declFileTypeAnnotationTypeReference.js new file mode 100644 index 00000000000..3818f38d2c1 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.js @@ -0,0 +1,120 @@ +//// [declFileTypeAnnotationTypeReference.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): c { + return new c(); +} +function foo2() { + return new c(); +} + +// Qualified name +function foo3(): m.c { + return new m.c(); +} +function foo4() { + return new m.c(); +} + +// Just the name with type arguments +function foo5(): g { + return new g(); +} +function foo6() { + return new g(); +} + +// Qualified name with type arguments +function foo7(): m.g { + return new m.g(); +} +function foo8() { + return new m.g(); +} + +//// [declFileTypeAnnotationTypeReference.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +function foo() { + return new c(); +} +function foo2() { + return new c(); +} +// Qualified name +function foo3() { + return new m.c(); +} +function foo4() { + return new m.c(); +} +// Just the name with type arguments +function foo5() { + return new g(); +} +function foo6() { + return new g(); +} +// Qualified name with type arguments +function foo7() { + return new m.g(); +} +function foo8() { + return new m.g(); +} + + +//// [declFileTypeAnnotationTypeReference.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare function foo(): c; +declare function foo2(): c; +declare function foo3(): m.c; +declare function foo4(): m.c; +declare function foo5(): g; +declare function foo6(): g; +declare function foo7(): m.g; +declare function foo8(): m.g; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.types b/tests/baselines/reference/declFileTypeAnnotationTypeReference.types new file mode 100644 index 00000000000..765c86c3415 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.types @@ -0,0 +1,98 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeReference.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +function foo(): c { +>foo : () => c +>c : c + + return new c(); +>new c() : c +>c : typeof c +} +function foo2() { +>foo2 : () => c + + return new c(); +>new c() : c +>c : typeof c +} + +// Qualified name +function foo3(): m.c { +>foo3 : () => m.c +>m : unknown +>c : m.c + + return new m.c(); +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} +function foo4() { +>foo4 : () => m.c + + return new m.c(); +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} + +// Just the name with type arguments +function foo5(): g { +>foo5 : () => g +>g : g + + return new g(); +>new g() : g +>g : typeof g +} +function foo6() { +>foo6 : () => g + + return new g(); +>new g() : g +>g : typeof g +} + +// Qualified name with type arguments +function foo7(): m.g { +>foo7 : () => m.g +>m : unknown +>g : m.g + + return new m.g(); +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} +function foo8() { +>foo8 : () => m.g + + return new m.g(); +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.js b/tests/baselines/reference/declFileTypeAnnotationUnionType.js new file mode 100644 index 00000000000..0a8e256ef28 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.js @@ -0,0 +1,76 @@ +//// [declFileTypeAnnotationUnionType.ts] + +class c { + private p: string; +} +module m { + export class c { + private q: string; + } + export class g { + private r: string; + } +} +class g { + private s: string; +} + +// Just the name +var k: c | m.c = new c() || new m.c(); +var l = new c() || new m.c(); + +var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); +var y = new g() || new m.g() || (() => new c()); + +//// [declFileTypeAnnotationUnionType.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +var k = new c() || new m.c(); +var l = new c() || new m.c(); +var x = new g() || new m.g() || (function () { return new c(); }); +var y = new g() || new m.g() || (function () { return new c(); }); + + +//// [declFileTypeAnnotationUnionType.d.ts] +declare class c { + private p; +} +declare module m { + class c { + private q; + } + class g { + private r; + } +} +declare class g { + private s; +} +declare var k: c | m.c; +declare var l: c | m.c; +declare var x: g | m.g | (() => c); +declare var y: g | m.g | (() => c); diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.types b/tests/baselines/reference/declFileTypeAnnotationUnionType.types new file mode 100644 index 00000000000..1dce3690bf8 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.types @@ -0,0 +1,91 @@ +=== tests/cases/compiler/declFileTypeAnnotationUnionType.ts === + +class c { +>c : c + + private p: string; +>p : string +} +module m { +>m : typeof m + + export class c { +>c : c + + private q: string; +>q : string + } + export class g { +>g : g +>T : T + + private r: string; +>r : string + } +} +class g { +>g : g +>T : T + + private s: string; +>s : string +} + +// Just the name +var k: c | m.c = new c() || new m.c(); +>k : c | m.c +>c : c +>m : unknown +>c : m.c +>new c() || new m.c() : c | m.c +>new c() : c +>c : typeof c +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c + +var l = new c() || new m.c(); +>l : c | m.c +>new c() || new m.c() : c | m.c +>new c() : c +>c : typeof c +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c + +var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); +>x : g | m.g | (() => c) +>g : g +>m : unknown +>g : m.g +>c : c +>new g() || new m.g() || (() => new c()) : g | m.g | (() => c) +>new g() || new m.g() : g | m.g +>new g() : g +>g : typeof g +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + +var y = new g() || new m.g() || (() => new c()); +>y : g | m.g | (() => c) +>new g() || new m.g() || (() => new c()) : g | m.g | (() => c) +>new g() || new m.g() : g | m.g +>new g() : g +>g : typeof g +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt new file mode 100644 index 00000000000..b6130864d8b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt @@ -0,0 +1,133 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(16,21): error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(21,13): error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(26,25): error TS4037: Parameter 'foo3' of public property setter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(33,25): error TS4037: Parameter 'foo4' of public property setter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(37,21): error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(72,23): error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(77,13): error TS4042: Return type of public property getter from exported class has or is using name 'm2.public2' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(82,27): error TS4037: Parameter 'foo113' of public property setter from exported class has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(89,27): error TS4037: Parameter 'foo114' of public property setter from exported class has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(93,23): error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts (10 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + module m2 { + export class public2 { + } + } + + export class c { + // getter with annotation + get foo1(): private1 { + ~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. + return; + } + + // getter without annotation + get foo2() { + ~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. + return new private1(); + } + + // setter with annotation + set foo3(param: private1) { + ~~~~~~~~ +!!! error TS4037: Parameter 'foo3' of public property setter from exported class has or is using private name 'private1'. + } + + // Both - getter without annotation, setter with annotation + get foo4() { + return new private1(); + } + set foo4(param: private1) { + ~~~~~~~~ +!!! error TS4037: Parameter 'foo4' of public property setter from exported class has or is using private name 'private1'. + } + + // Both - with annotation + get foo5(): private1 { + ~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. + return; + } + set foo5(param: private1) { + } + + // getter with annotation + get foo11(): public1 { + return; + } + + // getter without annotation + get foo12() { + return new public1(); + } + + // setter with annotation + set foo13(param: public1) { + } + + // Both - getter without annotation, setter with annotation + get foo14() { + return new public1(); + } + set foo14(param: public1) { + } + + // Both - with annotation + get foo15(): public1 { + return; + } + set foo15(param: public1) { + } + + // getter with annotation + get foo111(): m2.public2 { + ~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. + return; + } + + // getter without annotation + get foo112() { + ~~~~~~ +!!! error TS4042: Return type of public property getter from exported class has or is using name 'm2.public2' from private module 'm2'. + return new m2.public2(); + } + + // setter with annotation + set foo113(param: m2.public2) { + ~~ +!!! error TS4037: Parameter 'foo113' of public property setter from exported class has or is using private name 'm2'. + } + + // Both - getter without annotation, setter with annotation + get foo114() { + return new m2.public2(); + } + set foo114(param: m2.public2) { + ~~ +!!! error TS4037: Parameter 'foo114' of public property setter from exported class has or is using private name 'm2'. + } + + // Both - with annotation + get foo115(): m2.public2 { + ~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. + return; + } + set foo115(param: m2.public2) { + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js new file mode 100644 index 00000000000..f7dc7a18260 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js @@ -0,0 +1,261 @@ +//// [declFileTypeAnnotationVisibilityErrorAccessors.ts] + +module m { + class private1 { + } + + export class public1 { + } + + module m2 { + export class public2 { + } + } + + export class c { + // getter with annotation + get foo1(): private1 { + return; + } + + // getter without annotation + get foo2() { + return new private1(); + } + + // setter with annotation + set foo3(param: private1) { + } + + // Both - getter without annotation, setter with annotation + get foo4() { + return new private1(); + } + set foo4(param: private1) { + } + + // Both - with annotation + get foo5(): private1 { + return; + } + set foo5(param: private1) { + } + + // getter with annotation + get foo11(): public1 { + return; + } + + // getter without annotation + get foo12() { + return new public1(); + } + + // setter with annotation + set foo13(param: public1) { + } + + // Both - getter without annotation, setter with annotation + get foo14() { + return new public1(); + } + set foo14(param: public1) { + } + + // Both - with annotation + get foo15(): public1 { + return; + } + set foo15(param: public1) { + } + + // getter with annotation + get foo111(): m2.public2 { + return; + } + + // getter without annotation + get foo112() { + return new m2.public2(); + } + + // setter with annotation + set foo113(param: m2.public2) { + } + + // Both - getter without annotation, setter with annotation + get foo114() { + return new m2.public2(); + } + set foo114(param: m2.public2) { + } + + // Both - with annotation + get foo115(): m2.public2 { + return; + } + set foo115(param: m2.public2) { + } + } +} + + +//// [declFileTypeAnnotationVisibilityErrorAccessors.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + var c = (function () { + function c() { + } + Object.defineProperty(c.prototype, "foo1", { + // getter with annotation + get: function () { + return; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo2", { + // getter without annotation + get: function () { + return new private1(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo3", { + // setter with annotation + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo4", { + // Both - getter without annotation, setter with annotation + get: function () { + return new private1(); + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo5", { + // Both - with annotation + get: function () { + return; + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo11", { + // getter with annotation + get: function () { + return; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo12", { + // getter without annotation + get: function () { + return new public1(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo13", { + // setter with annotation + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo14", { + // Both - getter without annotation, setter with annotation + get: function () { + return new public1(); + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo15", { + // Both - with annotation + get: function () { + return; + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo111", { + // getter with annotation + get: function () { + return; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo112", { + // getter without annotation + get: function () { + return new m2.public2(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo113", { + // setter with annotation + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo114", { + // Both - getter without annotation, setter with annotation + get: function () { + return new m2.public2(); + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo115", { + // Both - with annotation + get: function () { + return; + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + return c; + })(); + m.c = c; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt new file mode 100644 index 00000000000..7dbe3617de9 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt @@ -0,0 +1,60 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(15,34): error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(17,26): error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(40,35): error TS4078: Parameter 'param' of exported function has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(42,28): error TS4077: Parameter 'param' of exported function has or is using name 'm2.public2' from private module 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts (4 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(param: private1) { + } + function foo2(param = new private1()) { + } + + export function foo3(param : private1) { + ~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. + } + export function foo4(param = new private1()) { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. + } + + function foo11(param: public1) { + } + function foo12(param = new public1()) { + } + + export function foo13(param: public1) { + } + export function foo14(param = new public1()) { + } + + module m2 { + export class public2 { + } + } + + function foo111(param: m2.public2) { + } + function foo112(param = new m2.public2()) { + } + + export function foo113(param: m2.public2) { + ~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'm2'. + } + export function foo114(param = new m2.public2()) { + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4077: Parameter 'param' of exported function has or is using name 'm2.public2' from private module 'm2'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js new file mode 100644 index 00000000000..4f66f0c8c7f --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js @@ -0,0 +1,108 @@ +//// [declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts] + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(param: private1) { + } + function foo2(param = new private1()) { + } + + export function foo3(param : private1) { + } + export function foo4(param = new private1()) { + } + + function foo11(param: public1) { + } + function foo12(param = new public1()) { + } + + export function foo13(param: public1) { + } + export function foo14(param = new public1()) { + } + + module m2 { + export class public2 { + } + } + + function foo111(param: m2.public2) { + } + function foo112(param = new m2.public2()) { + } + + export function foo113(param: m2.public2) { + } + export function foo114(param = new m2.public2()) { + } +} + + +//// [declFileTypeAnnotationVisibilityErrorParameterOfFunction.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + // Directly using names from this module + function foo1(param) { + } + function foo2(param) { + if (param === void 0) { param = new private1(); } + } + function foo3(param) { + } + m.foo3 = foo3; + function foo4(param) { + if (param === void 0) { param = new private1(); } + } + m.foo4 = foo4; + function foo11(param) { + } + function foo12(param) { + if (param === void 0) { param = new public1(); } + } + function foo13(param) { + } + m.foo13 = foo13; + function foo14(param) { + if (param === void 0) { param = new public1(); } + } + m.foo14 = foo14; + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + function foo111(param) { + } + function foo112(param) { + if (param === void 0) { param = new m2.public2(); } + } + function foo113(param) { + } + m.foo113 = foo113; + function foo114(param) { + if (param === void 0) { param = new m2.public2(); } + } + m.foo114 = foo114; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt new file mode 100644 index 00000000000..449af75bf61 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt @@ -0,0 +1,72 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(17,29): error TS4060: Return type of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(20,21): error TS4060: Return type of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(50,31): error TS4060: Return type of exported function has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(53,21): error TS4059: Return type of exported function has or is using name 'm2.public2' from private module 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts (4 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(): private1 { + return; + } + function foo2() { + return new private1(); + } + + export function foo3(): private1 { + ~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'private1'. + return; + } + export function foo4() { + ~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'private1'. + return new private1(); + } + + function foo11(): public1 { + return; + } + function foo12() { + return new public1(); + } + + export function foo13(): public1 { + return; + } + export function foo14() { + return new public1(); + } + + module m2 { + export class public2 { + } + } + + function foo111(): m2.public2 { + return; + } + function foo112() { + return new m2.public2(); + } + + export function foo113(): m2.public2 { + ~~ +!!! error TS4060: Return type of exported function has or is using private name 'm2'. + return; + } + export function foo114() { + ~~~~~~ +!!! error TS4059: Return type of exported function has or is using name 'm2.public2' from private module 'm2'. + return new m2.public2(); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js new file mode 100644 index 00000000000..e12d9ebca63 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js @@ -0,0 +1,126 @@ +//// [declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts] + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(): private1 { + return; + } + function foo2() { + return new private1(); + } + + export function foo3(): private1 { + return; + } + export function foo4() { + return new private1(); + } + + function foo11(): public1 { + return; + } + function foo12() { + return new public1(); + } + + export function foo13(): public1 { + return; + } + export function foo14() { + return new public1(); + } + + module m2 { + export class public2 { + } + } + + function foo111(): m2.public2 { + return; + } + function foo112() { + return new m2.public2(); + } + + export function foo113(): m2.public2 { + return; + } + export function foo114() { + return new m2.public2(); + } +} + + +//// [declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + // Directly using names from this module + function foo1() { + return; + } + function foo2() { + return new private1(); + } + function foo3() { + return; + } + m.foo3 = foo3; + function foo4() { + return new private1(); + } + m.foo4 = foo4; + function foo11() { + return; + } + function foo12() { + return new public1(); + } + function foo13() { + return; + } + m.foo13 = foo13; + function foo14() { + return new public1(); + } + m.foo14 = foo14; + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + function foo111() { + return; + } + function foo112() { + return new m2.public2(); + } + function foo113() { + return; + } + m.foo113 = foo113; + function foo114() { + return new m2.public2(); + } + m.foo114 = foo114; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt new file mode 100644 index 00000000000..a9fd72ae569 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt @@ -0,0 +1,56 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(10,23): error TS4025: Exported variable 'p' has or is using private name 'W'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(33,22): error TS4081: Exported type alias 't2' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(36,23): error TS4081: Exported type alias 't12' has or is using private name 'public1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(39,24): error TS4081: Exported type alias 't112' has or is using private name 'm3'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts (4 errors) ==== + + interface Window { + someMethod(); + } + + module M { + type W = Window | string; + export module N { + export class Window { } + export var p: W; // Should report error that W is private + ~ +!!! error TS4025: Exported variable 'p' has or is using private name 'W'. + } + } + + module M1 { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; // No error + } + } + + module M2 { + class private1 { + } + class public1 { + } + module m3 { + export class public1 { + } + } + + type t1 = private1; + export type t2 = private1; // error + ~~~~~~~~ +!!! error TS4081: Exported type alias 't2' has or is using private name 'private1'. + + type t11 = public1; + export type t12 = public1; + ~~~~~~~ +!!! error TS4081: Exported type alias 't12' has or is using private name 'public1'. + + type t111 = m3.public1; + export type t112 = m3.public1; // error + ~~ +!!! error TS4081: Exported type alias 't112' has or is using private name 'm3'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js new file mode 100644 index 00000000000..ec653c84dc9 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js @@ -0,0 +1,92 @@ +//// [declFileTypeAnnotationVisibilityErrorTypeAlias.ts] + +interface Window { + someMethod(); +} + +module M { + type W = Window | string; + export module N { + export class Window { } + export var p: W; // Should report error that W is private + } +} + +module M1 { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; // No error + } +} + +module M2 { + class private1 { + } + class public1 { + } + module m3 { + export class public1 { + } + } + + type t1 = private1; + export type t2 = private1; // error + + type t11 = public1; + export type t12 = public1; + + type t111 = m3.public1; + export type t112 = m3.public1; // error +} + + +//// [declFileTypeAnnotationVisibilityErrorTypeAlias.js] +var M; +(function (M) { + var N; + (function (N) { + var Window = (function () { + function Window() { + } + return Window; + })(); + N.Window = Window; + N.p; // Should report error that W is private + })(N = M.N || (M.N = {})); +})(M || (M = {})); +var M1; +(function (M1) { + var N; + (function (N) { + var Window = (function () { + function Window() { + } + return Window; + })(); + N.Window = Window; + N.p; // No error + })(N = M1.N || (M1.N = {})); +})(M1 || (M1 = {})); +var M2; +(function (M2) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + var m3; + (function (m3) { + var public1 = (function () { + function public1() { + } + return public1; + })(); + m3.public1 = public1; + })(m3 || (m3 = {})); +})(M2 || (M2 = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt new file mode 100644 index 00000000000..8cba0d12464 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt @@ -0,0 +1,91 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(11,12): error TS4025: Exported variable 'x' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(12,12): error TS4025: Exported variable 'x' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(13,13): error TS4025: Exported variable 'x' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(14,19): error TS4025: Exported variable 'x' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(15,22): error TS4025: Exported variable 'x' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(16,22): error TS4025: Exported variable 'x' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(18,16): error TS4024: Exported variable 'x2' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(18,16): error TS4025: Exported variable 'x2' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(25,16): error TS4024: Exported variable 'x3' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(25,16): error TS4025: Exported variable 'x3' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(28,23): error TS4025: Exported variable 'y' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(28,36): error TS4025: Exported variable 'y' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(29,16): error TS4024: Exported variable 'y2' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(29,16): error TS4025: Exported variable 'y2' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(32,27): error TS4025: Exported variable 'z' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(32,40): error TS4025: Exported variable 'z' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(33,16): error TS4024: Exported variable 'z2' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(33,16): error TS4025: Exported variable 'z2' has or is using private name 'private1'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts (18 errors) ==== + + module m { + class private1 { + } + module m2 { + export class public1 { + } + } + + export var x: { + x: private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'private1'. + y: m2.public1; + ~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'm2'. + (): m2.public1[]; + ~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'm2'. + method(): private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'private1'. + [n: number]: private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'private1'. + [s: string]: m2.public1; + ~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'm2'. + }; + export var x2 = { + ~~ +!!! error TS4024: Exported variable 'x2' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'x2' has or is using private name 'private1'. + x: new private1(), + y: new m2.public1(), + method() { + return new private1(); + } + }; + export var x3 = x; + ~~ +!!! error TS4024: Exported variable 'x3' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'x3' has or is using private name 'private1'. + + // Function type + export var y: (a: private1) => m2.public1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'y' has or is using private name 'private1'. + ~~ +!!! error TS4025: Exported variable 'y' has or is using private name 'm2'. + export var y2 = y; + ~~ +!!! error TS4024: Exported variable 'y2' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'y2' has or is using private name 'private1'. + + // constructor type + export var z: new (a: private1) => m2.public1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'z' has or is using private name 'private1'. + ~~ +!!! error TS4025: Exported variable 'z' has or is using private name 'm2'. + export var z2 = z; + ~~ +!!! error TS4024: Exported variable 'z2' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'z2' has or is using private name 'private1'. + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js new file mode 100644 index 00000000000..f6bd1689e60 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js @@ -0,0 +1,69 @@ +//// [declFileTypeAnnotationVisibilityErrorTypeLiteral.ts] + +module m { + class private1 { + } + module m2 { + export class public1 { + } + } + + export var x: { + x: private1; + y: m2.public1; + (): m2.public1[]; + method(): private1; + [n: number]: private1; + [s: string]: m2.public1; + }; + export var x2 = { + x: new private1(), + y: new m2.public1(), + method() { + return new private1(); + } + }; + export var x3 = x; + + // Function type + export var y: (a: private1) => m2.public1; + export var y2 = y; + + // constructor type + export var z: new (a: private1) => m2.public1; + export var z2 = z; +} + +//// [declFileTypeAnnotationVisibilityErrorTypeLiteral.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var m2; + (function (m2) { + var public1 = (function () { + function public1() { + } + return public1; + })(); + m2.public1 = public1; + })(m2 || (m2 = {})); + m.x; + m.x2 = { + x: new private1(), + y: new m2.public1(), + method: function () { + return new private1(); + } + }; + m.x3 = m.x; + // Function type + m.y; + m.y2 = m.y; + // constructor type + m.z; + m.z2 = m.z; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt new file mode 100644 index 00000000000..33771b85dd4 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt @@ -0,0 +1,48 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(13,19): error TS4025: Exported variable 'k' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(14,16): error TS4025: Exported variable 'l' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(30,20): error TS4025: Exported variable 'k3' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(31,16): error TS4024: Exported variable 'l3' has or is using name 'm2.public2' from private module 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts (4 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + var x: private1; + var y = new private1(); + + export var k: private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'k' has or is using private name 'private1'. + export var l = new private1(); + ~ +!!! error TS4025: Exported variable 'l' has or is using private name 'private1'. + + var x2: public1; + var y2 = new public1(); + + export var k2: public1; + export var l2 = new public1(); + + module m2 { + export class public2 { + } + } + + var x3: m2.public2; + var y3 = new m2.public2(); + + export var k3: m2.public2; + ~~ +!!! error TS4025: Exported variable 'k3' has or is using private name 'm2'. + export var l3 = new m2.public2(); + ~~ +!!! error TS4024: Exported variable 'l3' has or is using name 'm2.public2' from private module 'm2'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js new file mode 100644 index 00000000000..a097ac159db --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js @@ -0,0 +1,72 @@ +//// [declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts] + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + var x: private1; + var y = new private1(); + + export var k: private1; + export var l = new private1(); + + var x2: public1; + var y2 = new public1(); + + export var k2: public1; + export var l2 = new public1(); + + module m2 { + export class public2 { + } + } + + var x3: m2.public2; + var y3 = new m2.public2(); + + export var k3: m2.public2; + export var l3 = new m2.public2(); +} + + +//// [declFileTypeAnnotationVisibilityErrorVariableDeclaration.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + // Directly using names from this module + var x; + var y = new private1(); + m.k; + m.l = new private1(); + var x2; + var y2 = new public1(); + m.k2; + m.l2 = new public1(); + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + var x3; + var y3 = new m2.public2(); + m.k3; + m.l3 = new m2.public2(); +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeofFunction.js b/tests/baselines/reference/declFileTypeofFunction.js index ea876e6dad8..2af519f411d 100644 --- a/tests/baselines/reference/declFileTypeofFunction.js +++ b/tests/baselines/reference/declFileTypeofFunction.js @@ -68,7 +68,7 @@ declare function f(n: typeof f): string; declare function f(n: typeof g): string; declare function g(n: typeof g): number; declare function g(n: typeof f): number; -declare var b: () => any; +declare var b: () => typeof b; declare function b1(): typeof b1; declare function foo(): typeof foo; declare var foo1: typeof foo; diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index 0bcbf2fff68..7da7dd8716a 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -78,7 +78,7 @@ declare module X.Y.base { } } declare module X.Y.base.Z { - class W extends base.W { + class W extends X.Y.base.W { value: boolean; } } diff --git a/tests/baselines/reference/declInput-2.errors.txt b/tests/baselines/reference/declInput-2.errors.txt index a987b7ac179..f151f3e7122 100644 --- a/tests/baselines/reference/declInput-2.errors.txt +++ b/tests/baselines/reference/declInput-2.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/declInput-2.ts(10,21): error TS4031: Public property 'm22' of exported class has or is using private name 'C'. +tests/cases/compiler/declInput-2.ts(13,21): error TS4031: Public property 'm25' of exported class has or is using private name 'I2'. +tests/cases/compiler/declInput-2.ts(16,24): error TS4055: Return type of public method from exported class has or is using private name 'I2'. +tests/cases/compiler/declInput-2.ts(18,23): error TS4073: Parameter 'i' of public method from exported class has or is using private name 'I2'. +tests/cases/compiler/declInput-2.ts(19,21): error TS4055: Return type of public method from exported class has or is using private name 'C'. + + ==== tests/cases/compiler/declInput-2.ts (5 errors) ==== module M { class C { } @@ -9,24 +16,24 @@ public m1: number; public m2: string; public m22: C; // don't generate - ~~~~~~~~~~~~~~ -!!! Public property 'm22' of exported class has or is using private name 'C'. + ~ +!!! error TS4031: Public property 'm22' of exported class has or is using private name 'C'. public m23: E; public m24: I1; public m25: I2; // don't generate - ~~~~~~~~~~~~~~~ -!!! Public property 'm25' of exported class has or is using private name 'I2'. + ~~ +!!! error TS4031: Public property 'm25' of exported class has or is using private name 'I2'. public m232(): E { return null;} public m242(): I1 { return null; } public m252(): I2 { return null; } // don't generate - ~~~~ -!!! Return type of public method from exported class has or is using private name 'I2'. + ~~ +!!! error TS4055: Return type of public method from exported class has or is using private name 'I2'. public m26(i:I1) {} public m262(i:I2) {} - ~~~~ -!!! Parameter 'i' of public method from exported class has or is using private name 'I2'. + ~~ +!!! error TS4073: Parameter 'i' of public method from exported class has or is using private name 'I2'. public m3():C { return new C(); } - ~~ -!!! Return type of public method from exported class has or is using private name 'C'. + ~ +!!! error TS4055: Return type of public method from exported class has or is using private name 'C'. } } \ No newline at end of file diff --git a/tests/baselines/reference/declInput.errors.txt b/tests/baselines/reference/declInput.errors.txt index c2d4c37e9e6..8ec341ce15b 100644 --- a/tests/baselines/reference/declInput.errors.txt +++ b/tests/baselines/reference/declInput.errors.txt @@ -1,11 +1,17 @@ -==== tests/cases/compiler/declInput.ts (1 errors) ==== +tests/cases/compiler/declInput.ts(1,11): error TS2300: Duplicate identifier 'bar'. +tests/cases/compiler/declInput.ts(5,7): error TS2300: Duplicate identifier 'bar'. + + +==== tests/cases/compiler/declInput.ts (2 errors) ==== interface bar { + ~~~ +!!! error TS2300: Duplicate identifier 'bar'. } class bar { ~~~ -!!! Duplicate identifier 'bar'. +!!! error TS2300: Duplicate identifier 'bar'. public f() { return ''; } public g() { return {a: null, b: undefined, c: void 4 }; } public h(x = 4, y = null, z = '') { x++; } diff --git a/tests/baselines/reference/declInput3.types b/tests/baselines/reference/declInput3.types index 4147396b26d..df69422f55b 100644 --- a/tests/baselines/reference/declInput3.types +++ b/tests/baselines/reference/declInput3.types @@ -16,9 +16,9 @@ class bar { >a : bar >null : bar >bar : bar ->b : any +>b : undefined >undefined : undefined ->c : any +>c : undefined >void 4 : undefined public h(x = 4, y = null, z = '') { x++; } diff --git a/tests/baselines/reference/declarationEmit_invalidReference2.errors.txt b/tests/baselines/reference/declarationEmit_invalidReference2.errors.txt index 91368320ba3..1f3960a87ab 100644 --- a/tests/baselines/reference/declarationEmit_invalidReference2.errors.txt +++ b/tests/baselines/reference/declarationEmit_invalidReference2.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/declarationEmit_invalidReference2.ts(1,1): error TS6053: File 'tests/cases/compiler/invalid.ts' not found. + + ==== tests/cases/compiler/declarationEmit_invalidReference2.ts (1 errors) ==== /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! File 'invalid.ts' not found. +!!! error TS6053: File 'invalid.ts' not found. var x = 0; \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.js b/tests/baselines/reference/declarationEmit_nameConflicts.js index ab2e5fce42a..161224659f1 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts.js @@ -184,7 +184,7 @@ export declare module M.Q { interface I { } } - interface b extends M.C { + interface b extends M.b { } interface I extends M.c.I { } diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.js b/tests/baselines/reference/declarationEmit_protectedMembers.js new file mode 100644 index 00000000000..dc8506b220b --- /dev/null +++ b/tests/baselines/reference/declarationEmit_protectedMembers.js @@ -0,0 +1,164 @@ +//// [declarationEmit_protectedMembers.ts] + +// Class with protected members +class C1 { + protected x: number; + + protected f() { + return this.x; + } + + protected set accessor(a: number) { } + protected get accessor() { return 0; } + + protected static sx: number; + + protected static sf() { + return this.sx; + } + + protected static set staticSetter(a: number) { } + protected static get staticGetter() { return 0; } +} + +// Derived class overriding protected members +class C2 extends C1 { + protected f() { + return super.f() + this.x; + } + protected static sf() { + return super.sf() + this.sx; + } +} + +// Derived class making protected members public +class C3 extends C2 { + x: number; + static sx: number; + f() { + return super.f(); + } + static sf() { + return super.sf(); + } + + static get staticGetter() { return 1; } +} + +// Protected properties in constructors +class C4 { + constructor(protected a: number, protected b) { } +} + +//// [declarationEmit_protectedMembers.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +// Class with protected members +var C1 = (function () { + function C1() { + } + C1.prototype.f = function () { + return this.x; + }; + Object.defineProperty(C1.prototype, "accessor", { + get: function () { + return 0; + }, + set: function (a) { + }, + enumerable: true, + configurable: true + }); + C1.sf = function () { + return this.sx; + }; + Object.defineProperty(C1, "staticSetter", { + set: function (a) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(C1, "staticGetter", { + get: function () { + return 0; + }, + enumerable: true, + configurable: true + }); + return C1; +})(); +// Derived class overriding protected members +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + C2.prototype.f = function () { + return _super.prototype.f.call(this) + this.x; + }; + C2.sf = function () { + return _super.sf.call(this) + this.sx; + }; + return C2; +})(C1); +// Derived class making protected members public +var C3 = (function (_super) { + __extends(C3, _super); + function C3() { + _super.apply(this, arguments); + } + C3.prototype.f = function () { + return _super.prototype.f.call(this); + }; + C3.sf = function () { + return _super.sf.call(this); + }; + Object.defineProperty(C3, "staticGetter", { + get: function () { + return 1; + }, + enumerable: true, + configurable: true + }); + return C3; +})(C2); +// Protected properties in constructors +var C4 = (function () { + function C4(a, b) { + this.a = a; + this.b = b; + } + return C4; +})(); + + +//// [declarationEmit_protectedMembers.d.ts] +declare class C1 { + protected x: number; + protected f(): number; + protected accessor: number; + protected static sx: number; + protected static sf(): number; + protected static staticSetter: number; + protected static staticGetter: number; +} +declare class C2 extends C1 { + protected f(): number; + protected static sf(): number; +} +declare class C3 extends C2 { + x: number; + static sx: number; + f(): number; + static sf(): number; + static staticGetter: number; +} +declare class C4 { + protected a: number; + protected b: any; + constructor(a: number, b: any); +} diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.types b/tests/baselines/reference/declarationEmit_protectedMembers.types new file mode 100644 index 00000000000..28217b0c070 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_protectedMembers.types @@ -0,0 +1,120 @@ +=== tests/cases/compiler/declarationEmit_protectedMembers.ts === + +// Class with protected members +class C1 { +>C1 : C1 + + protected x: number; +>x : number + + protected f() { +>f : () => number + + return this.x; +>this.x : number +>this : C1 +>x : number + } + + protected set accessor(a: number) { } +>accessor : number +>a : number + + protected get accessor() { return 0; } +>accessor : number + + protected static sx: number; +>sx : number + + protected static sf() { +>sf : () => number + + return this.sx; +>this.sx : number +>this : typeof C1 +>sx : number + } + + protected static set staticSetter(a: number) { } +>staticSetter : number +>a : number + + protected static get staticGetter() { return 0; } +>staticGetter : number +} + +// Derived class overriding protected members +class C2 extends C1 { +>C2 : C2 +>C1 : C1 + + protected f() { +>f : () => number + + return super.f() + this.x; +>super.f() + this.x : number +>super.f() : number +>super.f : () => number +>super : C1 +>f : () => number +>this.x : number +>this : C2 +>x : number + } + protected static sf() { +>sf : () => number + + return super.sf() + this.sx; +>super.sf() + this.sx : number +>super.sf() : number +>super.sf : () => number +>super : typeof C1 +>sf : () => number +>this.sx : number +>this : typeof C2 +>sx : number + } +} + +// Derived class making protected members public +class C3 extends C2 { +>C3 : C3 +>C2 : C2 + + x: number; +>x : number + + static sx: number; +>sx : number + + f() { +>f : () => number + + return super.f(); +>super.f() : number +>super.f : () => number +>super : C2 +>f : () => number + } + static sf() { +>sf : () => number + + return super.sf(); +>super.sf() : number +>super.sf : () => number +>super : typeof C2 +>sf : () => number + } + + static get staticGetter() { return 1; } +>staticGetter : number +} + +// Protected properties in constructors +class C4 { +>C4 : C4 + + constructor(protected a: number, protected b) { } +>a : number +>b : any +} diff --git a/tests/baselines/reference/declareAlreadySeen.errors.txt b/tests/baselines/reference/declareAlreadySeen.errors.txt index 0c765edf9dd..d606b571478 100644 --- a/tests/baselines/reference/declareAlreadySeen.errors.txt +++ b/tests/baselines/reference/declareAlreadySeen.errors.txt @@ -1,17 +1,23 @@ +tests/cases/compiler/declareAlreadySeen.ts(2,13): error TS1030: 'declare' modifier already seen. +tests/cases/compiler/declareAlreadySeen.ts(3,13): error TS1030: 'declare' modifier already seen. +tests/cases/compiler/declareAlreadySeen.ts(5,13): error TS1030: 'declare' modifier already seen. +tests/cases/compiler/declareAlreadySeen.ts(7,13): error TS1030: 'declare' modifier already seen. + + ==== tests/cases/compiler/declareAlreadySeen.ts (4 errors) ==== module M { declare declare var x; ~~~~~~~ -!!! 'declare' modifier already seen. +!!! error TS1030: 'declare' modifier already seen. declare declare function f(); ~~~~~~~ -!!! 'declare' modifier already seen. +!!! error TS1030: 'declare' modifier already seen. declare declare module N { } ~~~~~~~ -!!! 'declare' modifier already seen. +!!! error TS1030: 'declare' modifier already seen. declare declare class C { } ~~~~~~~ -!!! 'declare' modifier already seen. +!!! error TS1030: 'declare' modifier already seen. } \ No newline at end of file diff --git a/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt b/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt index 8fc743d97fe..d6944e0e033 100644 --- a/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt +++ b/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/declareClassInterfaceImplementation.ts(5,15): error TS2420: Class 'Buffer' incorrectly implements interface 'IBuffer'. + Index signature is missing in type 'Buffer'. + + ==== tests/cases/compiler/declareClassInterfaceImplementation.ts (1 errors) ==== interface IBuffer { [index: number]: number; @@ -5,8 +9,8 @@ declare class Buffer implements IBuffer { ~~~~~~ -!!! Class 'Buffer' incorrectly implements interface 'IBuffer': -!!! Index signature is missing in type 'Buffer'. +!!! error TS2420: Class 'Buffer' incorrectly implements interface 'IBuffer'. +!!! error TS2420: Index signature is missing in type 'Buffer'. } \ No newline at end of file diff --git a/tests/baselines/reference/decrementAndIncrementOperators.errors.txt b/tests/baselines/reference/decrementAndIncrementOperators.errors.txt index 27c6c19ed1f..ec58db836a6 100644 --- a/tests/baselines/reference/decrementAndIncrementOperators.errors.txt +++ b/tests/baselines/reference/decrementAndIncrementOperators.errors.txt @@ -1,52 +1,67 @@ +tests/cases/compiler/decrementAndIncrementOperators.ts(4,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(6,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(7,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(9,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(10,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(12,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(13,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(15,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(16,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(18,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(19,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(21,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/compiler/decrementAndIncrementOperators.ts(22,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + + ==== tests/cases/compiler/decrementAndIncrementOperators.ts (13 errors) ==== var x = 0; // errors 1 ++; ~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (1)++; ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (1)--; ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++(1); ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --(1); ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (1 + 2)++; ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (1 + 2)--; ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++(1 + 2); ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --(1 + 2); ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (x + x)++; ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. (x + x)--; ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++(x + x); ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --(x + x); ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. //OK x++; diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types index 1a4aea0d507..ab21dd9db5c 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types @@ -9,13 +9,13 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] ->["", ""] : any[] +>["", ""] : string[] var obj = {x:1,y:null}; >obj : { x: number; y: any; } >{x:1,y:null} : { x: number; y: null; } >x : number ->y : any +>y : null class A { >A : A diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt index 5bc5153a610..31213ce2fd4 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -1,3 +1,49 @@ +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(25,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(26,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(27,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(28,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(30,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(31,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(32,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(33,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(34,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(37,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(38,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(39,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(41,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(42,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(43,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(46,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(47,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(51,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(52,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(54,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(55,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,25): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,25): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,25): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(59,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(60,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(63,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(65,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(67,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(68,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(70,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(71,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(72,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + + ==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts (44 errors) ==== // -- operator on any type var ANY1; @@ -24,138 +70,138 @@ // any type var var ResultIsNumber1 = --ANY2; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber2 = --A; ~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber3 = --M; ~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber4 = --obj; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber5 = --obj1; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber6 = ANY2--; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber7 = A--; ~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber8 = M--; ~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber9 = obj--; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber10 = obj1--; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // any type literal var ResultIsNumber11 = --{}; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber12 = --null; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber13 = --undefined; ~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber14 = null--; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber15 = {}--; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber16 = undefined--; ~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // any type expressions var ResultIsNumber17 = --foo(); ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber18 = --A.foo(); ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber19 = --(null + undefined); ~~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber20 = --(null + null); ~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber21 = --(undefined + undefined); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber22 = --obj1.x; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber23 = --obj1.y; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber24 = foo()--; ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber25 = A.foo()--; ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber26 = (null + undefined)--; ~~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber27 = (null + null)--; ~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber28 = (undefined + undefined)--; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber29 = obj1.x--; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber30 = obj1.y--; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // miss assignment operators --ANY2; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ANY2--; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --ANY1--; ~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --ANY1++; ~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++ANY1--; ~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --ANY2[0]--; ~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --ANY2[0]++; ~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++ANY2[0]--; ~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..a0c30e9dc93 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,23): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,7): error TS2304: Cannot find name 'A'. + + +==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts (3 errors) ==== + // -- operator on enum type + + enum ENUM1 { A, B, "" }; + + // expression + var ResultIsNumber1 = --ENUM1["A"]; + var ResultIsNumber2 = ENUM1.A--; + ~~~~~~~ +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + + // miss assignment operator + --ENUM1["A"]; + + ENUM1[A]--; + ~~~~~~~~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + ~ +!!! error TS2304: Cannot find name 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.js b/tests/baselines/reference/decrementOperatorWithEnumType.js index 8c22fd18928..15247ea4225 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumType.js +++ b/tests/baselines/reference/decrementOperatorWithEnumType.js @@ -1,29 +1,29 @@ //// [decrementOperatorWithEnumType.ts] // -- operator on enum type -enum ENUM1 { 1, 2, "" }; +enum ENUM1 { A, B, "" }; // expression -var ResultIsNumber1 = --ENUM1[1]; -var ResultIsNumber2 = ENUM1[1]--; +var ResultIsNumber1 = --ENUM1["A"]; +var ResultIsNumber2 = ENUM1.A--; // miss assignment operator ---ENUM1[1]; +--ENUM1["A"]; -ENUM1[1]--; +ENUM1[A]--; //// [decrementOperatorWithEnumType.js] // -- operator on enum type var ENUM1; (function (ENUM1) { - ENUM1[ENUM1["1"] = 0] = "1"; - ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1["A"] = 0] = "A"; + ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; })(ENUM1 || (ENUM1 = {})); ; // expression -var ResultIsNumber1 = --ENUM1[1]; -var ResultIsNumber2 = ENUM1[1]--; +var ResultIsNumber1 = --0 /* "A" */; +var ResultIsNumber2 = 0 /* A */--; // miss assignment operator ---ENUM1[1]; -ENUM1[1]--; +--0 /* "A" */; +ENUM1[A]--; diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.types b/tests/baselines/reference/decrementOperatorWithEnumType.types deleted file mode 100644 index fc670ddc6f7..00000000000 --- a/tests/baselines/reference/decrementOperatorWithEnumType.types +++ /dev/null @@ -1,30 +0,0 @@ -=== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts === -// -- operator on enum type - -enum ENUM1 { 1, 2, "" }; ->ENUM1 : ENUM1 - -// expression -var ResultIsNumber1 = --ENUM1[1]; ->ResultIsNumber1 : number ->--ENUM1[1] : number ->ENUM1[1] : ENUM1 ->ENUM1 : typeof ENUM1 - -var ResultIsNumber2 = ENUM1[1]--; ->ResultIsNumber2 : number ->ENUM1[1]-- : number ->ENUM1[1] : ENUM1 ->ENUM1 : typeof ENUM1 - -// miss assignment operator ---ENUM1[1]; ->--ENUM1[1] : number ->ENUM1[1] : ENUM1 ->ENUM1 : typeof ENUM1 - -ENUM1[1]--; ->ENUM1[1]-- : number ->ENUM1[1] : ENUM1 ->ENUM1 : typeof ENUM1 - diff --git a/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt index de547e5b70b..079bb2a6b64 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt @@ -1,43 +1,61 @@ -==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts (10 errors) ==== +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(7,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(8,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(10,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(11,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(14,25): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(14,43): error TS2339: Property 'B' does not exist on type 'typeof ENUM'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(15,23): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(15,29): error TS2339: Property 'A' does not exist on type 'typeof ENUM'. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(18,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(19,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(21,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(22,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts (12 errors) ==== // -- operator on enum type enum ENUM { }; - enum ENUM1 { 1, 2, "" }; + enum ENUM1 { A, B, "" }; // enum type var var ResultIsNumber1 = --ENUM; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber2 = --ENUM1; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber3 = ENUM--; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber4 = ENUM1--; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // enum type expressions - var ResultIsNumber5 = --(ENUM[1] + ENUM[2]); - ~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. - var ResultIsNumber6 = (ENUM[1] + ENUM[2])--; - ~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber5 = --(ENUM["A"] + ENUM.B); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~ +!!! error TS2339: Property 'B' does not exist on type 'typeof ENUM'. + var ResultIsNumber6 = (ENUM.A + ENUM["B"])--; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + ~ +!!! error TS2339: Property 'A' does not exist on type 'typeof ENUM'. // miss assignment operator --ENUM; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --ENUM1; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ENUM--; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ENUM1--; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.js b/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.js index 410e3c144ef..66a1252cdd0 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.js +++ b/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.js @@ -2,7 +2,7 @@ // -- operator on enum type enum ENUM { }; -enum ENUM1 { 1, 2, "" }; +enum ENUM1 { A, B, "" }; // enum type var var ResultIsNumber1 = --ENUM; @@ -12,8 +12,8 @@ var ResultIsNumber3 = ENUM--; var ResultIsNumber4 = ENUM1--; // enum type expressions -var ResultIsNumber5 = --(ENUM[1] + ENUM[2]); -var ResultIsNumber6 = (ENUM[1] + ENUM[2])--; +var ResultIsNumber5 = --(ENUM["A"] + ENUM.B); +var ResultIsNumber6 = (ENUM.A + ENUM["B"])--; // miss assignment operator --ENUM; @@ -30,8 +30,8 @@ var ENUM; ; var ENUM1; (function (ENUM1) { - ENUM1[ENUM1["1"] = 0] = "1"; - ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1["A"] = 0] = "A"; + ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; })(ENUM1 || (ENUM1 = {})); ; @@ -41,8 +41,8 @@ var ResultIsNumber2 = --ENUM1; var ResultIsNumber3 = ENUM--; var ResultIsNumber4 = ENUM1--; // enum type expressions -var ResultIsNumber5 = --(ENUM[1] + ENUM[2]); -var ResultIsNumber6 = (ENUM[1] + ENUM[2])--; +var ResultIsNumber5 = --(ENUM["A"] + ENUM.B); +var ResultIsNumber6 = (ENUM.A + ENUM["B"])--; // miss assignment operator --ENUM; --ENUM1; diff --git a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt index ced764db19e..8df7e508099 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt @@ -1,3 +1,25 @@ +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(18,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(19,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(22,25): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(23,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(26,23): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(27,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(28,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(31,25): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(32,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(33,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(35,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(36,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(37,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(40,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(41,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(42,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(44,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(45,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts(46,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + + ==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts (20 errors) ==== // -- operator on number type var NUMBER: number; @@ -18,70 +40,70 @@ //number type var var ResultIsNumber1 = --NUMBER1; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber2 = NUMBER1--; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // number type literal var ResultIsNumber3 = --1; ~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber4 = --{ x: 1, y: 2}; ~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber5 = --{ x: 1, y: (n: number) => { return n; } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber6 = 1--; ~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber7 = { x: 1, y: 2 }--; ~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber8 = { x: 1, y: (n: number) => { return n; } }--; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // number type expressions var ResultIsNumber9 = --foo(); ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber10 = --A.foo(); ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber11 = --(NUMBER + NUMBER); ~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber12 = foo()--; ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber13 = A.foo()--; ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber14 = (NUMBER + NUMBER)--; ~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. // miss assignment operator --1; ~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --NUMBER1; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --foo(); ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. 1--; ~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. NUMBER1--; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. foo()--; ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt index 3f986e98e10..cef6decd4ad 100644 --- a/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt @@ -1,3 +1,34 @@ +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(17,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(19,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(22,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(23,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(26,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(27,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(28,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(31,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(32,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(33,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(34,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(36,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(37,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(38,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(39,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(42,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(43,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(44,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(45,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(46,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(47,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(49,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(50,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(51,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(52,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(53,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(54,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(54,11): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + + ==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts (29 errors) ==== // -- operator on boolean type var BOOLEAN: boolean; @@ -17,97 +48,97 @@ // boolean type var var ResultIsNumber1 = --BOOLEAN; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber2 = BOOLEAN--; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // boolean type literal var ResultIsNumber3 = --true; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber4 = --{ x: true, y: false }; ~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber5 = --{ x: true, y: (n: boolean) => { return n; } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber6 = true--; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber7 = { x: true, y: false }--; ~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }--; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // boolean type expressions var ResultIsNumber9 = --objA.a; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber10 = --M.n; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber11 = --foo(); ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber12 = --A.foo(); ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber13 = foo()--; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber14 = A.foo()--; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber15 = objA.a--; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber16 = M.n--; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // miss assignment operators --true; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --BOOLEAN; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --foo(); ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --objA.a; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --M.n; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --objA.a, M.n; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. true--; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. BOOLEAN--; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. foo()--; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. objA.a--; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. M.n--; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. objA.a--, M.n--; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt index 9ec8deb2081..7169155158c 100644 --- a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt @@ -1,3 +1,44 @@ +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(18,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(19,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(21,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(22,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(25,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(26,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(27,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(29,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(30,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(31,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(34,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(35,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(36,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(37,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(38,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(39,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(41,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(42,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(43,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(44,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(45,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(46,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(49,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(50,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(51,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(52,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(53,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(54,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(55,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(56,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(58,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(59,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(60,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(61,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(62,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(63,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(64,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(65,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts(65,11): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + + ==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts (39 errors) ==== // -- operator on string type var STRING: string; @@ -18,127 +59,127 @@ // string type var var ResultIsNumber1 = --STRING; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber2 = --STRING1; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber3 = STRING--; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber4 = STRING1--; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // string type literal var ResultIsNumber5 = --""; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber6 = --{ x: "", y: "" }; ~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber7 = --{ x: "", y: (s: string) => { return s; } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber8 = ""--; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber9 = { x: "", y: "" }--; ~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }--; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // string type expressions var ResultIsNumber11 = --objA.a; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber12 = --M.n; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber13 = --STRING1[0]; ~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber14 = --foo(); ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber15 = --A.foo(); ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber16 = --(STRING + STRING); ~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber17 = objA.a--; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber18 = M.n--; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber19 = STRING1[0]--; ~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber20 = foo()--; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber21 = A.foo()--; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber22 = (STRING + STRING)--; ~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // miss assignment operators --""; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --STRING; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --STRING1; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --STRING1[0]; ~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --foo(); ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --objA.a; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --M.n; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --objA.a, M.n; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ""--; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. STRING--; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. STRING1--; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. STRING1[0]--; ~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. foo()--; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. objA.a--; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. M.n--; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. objA.a--, M.n--; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt index 7fb00da2b40..156fdcc4c7a 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt @@ -1,38 +1,48 @@ +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(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(11,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(14,51): error TS2352: Neither type 'string' nor type 'number' is assignable to the other. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(20,62): error TS2352: Neither type 'string' nor type 'number' is assignable to the other. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: Cannot find name 'T'. + + ==== tests/cases/compiler/defaultArgsInFunctionExpressions.ts (8 errors) ==== var f = function (a = 3) { return a; }; // Type should be (a?: number) => number var n: number = f(4); n = f(); var s: string = f(''); ~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. s = f(); ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. // 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; ~~~~~~~~~~~~~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. s = f2(''); s = f2(); n = f2(); ~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. // Contextually type the default arg with the type annotation var f3 = function (a: (s: string) => any = (s) => s) { }; ~~~~~~~~~ -!!! Neither type 'string' nor type 'number' is assignable to the other. +!!! error TS2352: Neither type 'string' nor type 'number' is assignable to the other. // Type check using the function's contextual type var f4: (a: number) => void = function (a = "") { }; ~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' 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) { }; ~~~~~~~~~ -!!! Neither type 'string' nor type 'number' is assignable to the other. +!!! error TS2352: Neither type 'string' nor type 'number' is assignable to the other. // Instantiated module module T { } @@ -42,7 +52,7 @@ var f6 = (t = T) => { }; ~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. var f7 = (t = U) => { return t; }; f7().x; \ No newline at end of file diff --git a/tests/baselines/reference/defaultArgsInOverloads.errors.txt b/tests/baselines/reference/defaultArgsInOverloads.errors.txt index 93f88560520..600c642c1f3 100644 --- a/tests/baselines/reference/defaultArgsInOverloads.errors.txt +++ b/tests/baselines/reference/defaultArgsInOverloads.errors.txt @@ -1,20 +1,27 @@ +tests/cases/compiler/defaultArgsInOverloads.ts(2,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/compiler/defaultArgsInOverloads.ts(7,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/compiler/defaultArgsInOverloads.ts(10,13): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/compiler/defaultArgsInOverloads.ts(16,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/compiler/defaultArgsInOverloads.ts(19,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + + ==== tests/cases/compiler/defaultArgsInOverloads.ts (5 errors) ==== function fun(a: string); function fun(a = 3); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. function fun(a = null) { } class C { fun(a: string); fun(a = 3); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. fun(a = null) { } static fun(a: string); static fun(a = 3); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. static fun(a = null) { } } @@ -22,9 +29,9 @@ fun(a: string); fun(a = 3); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. } var f: (a = 3) => number; ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. \ No newline at end of file +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. \ No newline at end of file diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt index df98b965347..5000ae05cc3 100644 --- a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt @@ -1,26 +1,29 @@ +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'. + + ==== tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts (3 errors) ==== - var obj1: {}; - obj1.length; ~~~~~~ -!!! Property 'length' does not exist on type '{}'. - - +!!! error TS2339: Property 'length' does not exist on type '{}'. var obj2: Object; - obj2.length; ~~~~~~ -!!! Property 'length' does not exist on type 'Object'. - - +!!! error TS2339: Property 'length' does not exist on type 'Object'. function concat(x: T, y: T): T { return null; } + 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'. + var elementCount = result.length; - var result = concat(1, ""); + function concat2(x: T, y: U) { return null; } + var result2 = concat2(1, ""); // result2 will be number|string + var elementCount2 = result.length; - var elementCount = result.length; // would like to get an error by now - ~~~~~~ -!!! Property 'length' does not exist on type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js index 59935cc53af..98e135cc712 100644 --- a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js @@ -1,22 +1,18 @@ //// [defaultBestCommonTypesHaveDecls.ts] - var obj1: {}; - obj1.length; - - var obj2: Object; - obj2.length; - - function concat(x: T, y: T): T { return null; } +var result = concat(1, ""); // error +var elementCount = result.length; -var result = concat(1, ""); +function concat2(x: T, y: U) { return null; } +var result2 = concat2(1, ""); // result2 will be number|string +var elementCount2 = result.length; -var elementCount = result.length; // would like to get an error by now //// [defaultBestCommonTypesHaveDecls.js] @@ -27,5 +23,10 @@ obj2.length; function concat(x, y) { return null; } -var result = concat(1, ""); -var elementCount = result.length; // would like to get an error by now +var result = concat(1, ""); // error +var elementCount = result.length; +function concat2(x, y) { + return null; +} +var result2 = concat2(1, ""); // result2 will be number|string +var elementCount2 = result.length; diff --git a/tests/baselines/reference/defaultValueInConstructorOverload1.errors.txt b/tests/baselines/reference/defaultValueInConstructorOverload1.errors.txt index c762d0919d9..1b399ef79fd 100644 --- a/tests/baselines/reference/defaultValueInConstructorOverload1.errors.txt +++ b/tests/baselines/reference/defaultValueInConstructorOverload1.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/defaultValueInConstructorOverload1.ts(2,17): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + + ==== tests/cases/compiler/defaultValueInConstructorOverload1.ts (1 errors) ==== class C { constructor(x = ''); ~~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. constructor(x = '') { } } \ No newline at end of file diff --git a/tests/baselines/reference/defaultValueInFunctionOverload1.errors.txt b/tests/baselines/reference/defaultValueInFunctionOverload1.errors.txt index 283e287e9da..2bb41299e38 100644 --- a/tests/baselines/reference/defaultValueInFunctionOverload1.errors.txt +++ b/tests/baselines/reference/defaultValueInFunctionOverload1.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/defaultValueInFunctionOverload1.ts(1,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + + ==== tests/cases/compiler/defaultValueInFunctionOverload1.ts (1 errors) ==== function foo(x: string = ''); ~~~~~~~~~~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. function foo(x = '') { } \ No newline at end of file diff --git a/tests/baselines/reference/defaultValueInFunctionTypes.errors.txt b/tests/baselines/reference/defaultValueInFunctionTypes.errors.txt index 22a0c718c7c..01a807b3e7d 100644 --- a/tests/baselines/reference/defaultValueInFunctionTypes.errors.txt +++ b/tests/baselines/reference/defaultValueInFunctionTypes.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/defaultValueInFunctionTypes.ts(1,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + + ==== tests/cases/compiler/defaultValueInFunctionTypes.ts (1 errors) ==== var x: (a: number = 1) => number; ~~~~~~~~~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. var y = <(a : string = "") => any>(undefined) \ No newline at end of file diff --git a/tests/baselines/reference/deleteOperator1.errors.txt b/tests/baselines/reference/deleteOperator1.errors.txt index 7a80456b21e..964bdec9ea2 100644 --- a/tests/baselines/reference/deleteOperator1.errors.txt +++ b/tests/baselines/reference/deleteOperator1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/deleteOperator1.ts(4,5): error TS2322: Type 'boolean' is not assignable to type 'number'. + + ==== tests/cases/compiler/deleteOperator1.ts (1 errors) ==== var a; var x: boolean = delete a; var y: any = delete a; var z: number = delete a; ~ -!!! Type 'boolean' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/deleteOperatorInStrictMode.errors.txt b/tests/baselines/reference/deleteOperatorInStrictMode.errors.txt new file mode 100644 index 00000000000..5952d8b8296 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorInStrictMode.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/deleteOperatorInStrictMode.ts(3,8): error TS1102: 'delete' cannot be called on an identifier in strict mode. + + +==== tests/cases/compiler/deleteOperatorInStrictMode.ts (1 errors) ==== + "use strict" + var a; + delete a; + ~ +!!! error TS1102: 'delete' cannot be called on an identifier in strict mode. \ No newline at end of file diff --git a/tests/baselines/reference/deleteOperatorInvalidOperations.errors.txt b/tests/baselines/reference/deleteOperatorInvalidOperations.errors.txt index 89980ef9bc0..5f7c6d70450 100644 --- a/tests/baselines/reference/deleteOperatorInvalidOperations.errors.txt +++ b/tests/baselines/reference/deleteOperatorInvalidOperations.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts(5,20): error TS1005: ',' expected. +tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts(5,27): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts(8,23): error TS1109: Expression expected. + + ==== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts (3 errors) ==== // Unary operator delete var ANY; @@ -5,14 +10,14 @@ // operand before delete operator var BOOLEAN1 = ANY delete ; //expect error ~~~~~~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~ -!!! Expression expected. +!!! error TS1109: Expression expected. // miss an operand var BOOLEAN2 = delete ; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. // delete global variable s class testADelx { diff --git a/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt index 18382a6f453..73ddab1a33c 100644 --- a/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(45,33): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(46,33): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts(47,33): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. + + ==== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts (3 errors) ==== // delete operator on any type @@ -45,13 +50,13 @@ var ResultIsBoolean16 = delete (ANY + ANY1); var ResultIsBoolean17 = delete (null + undefined); ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsBoolean18 = delete (null + null); ~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsBoolean19 = delete (undefined + undefined); ~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. // multiple delete operators var ResultIsBoolean20 = delete delete ANY; diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.js b/tests/baselines/reference/deleteOperatorWithEnumType.js index d7fd9c95ee8..b87ab8298a7 100644 --- a/tests/baselines/reference/deleteOperatorWithEnumType.js +++ b/tests/baselines/reference/deleteOperatorWithEnumType.js @@ -2,24 +2,24 @@ // delete operator on enum type enum ENUM { }; -enum ENUM1 { 1, 2, "" }; +enum ENUM1 { A, B, "" }; // enum type var var ResultIsBoolean1 = delete ENUM; var ResultIsBoolean2 = delete ENUM1; // enum type expressions -var ResultIsBoolean3 = delete ENUM1[0]; -var ResultIsBoolean4 = delete (ENUM[0] + ENUM1[1]); +var ResultIsBoolean3 = delete ENUM1["A"]; +var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); // multiple delete operators var ResultIsBoolean5 = delete delete ENUM; -var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1[1]); +var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]); // miss assignment operators delete ENUM; delete ENUM1; -delete ENUM1[1]; +delete ENUM1.B; delete ENUM, ENUM1; //// [deleteOperatorWithEnumType.js] @@ -30,8 +30,8 @@ var ENUM; ; var ENUM1; (function (ENUM1) { - ENUM1[ENUM1["1"] = 0] = "1"; - ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1["A"] = 0] = "A"; + ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; })(ENUM1 || (ENUM1 = {})); ; @@ -39,13 +39,13 @@ var ENUM1; var ResultIsBoolean1 = delete ENUM; var ResultIsBoolean2 = delete ENUM1; // enum type expressions -var ResultIsBoolean3 = delete ENUM1[0]; -var ResultIsBoolean4 = delete (ENUM[0] + ENUM1[1]); +var ResultIsBoolean3 = delete 0 /* "A" */; +var ResultIsBoolean4 = delete (ENUM[0] + 1 /* "B" */); // multiple delete operators var ResultIsBoolean5 = delete delete ENUM; -var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1[1]); +var ResultIsBoolean6 = delete delete delete (ENUM[0] + 1 /* "B" */); // miss assignment operators delete ENUM; delete ENUM1; -delete ENUM1[1]; +delete 1 /* B */; delete ENUM, ENUM1; diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.types b/tests/baselines/reference/deleteOperatorWithEnumType.types index d356693616f..e436ac3373f 100644 --- a/tests/baselines/reference/deleteOperatorWithEnumType.types +++ b/tests/baselines/reference/deleteOperatorWithEnumType.types @@ -4,8 +4,10 @@ enum ENUM { }; >ENUM : ENUM -enum ENUM1 { 1, 2, "" }; +enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 +>A : ENUM1 +>B : ENUM1 // enum type var var ResultIsBoolean1 = delete ENUM; @@ -19,20 +21,20 @@ var ResultIsBoolean2 = delete ENUM1; >ENUM1 : typeof ENUM1 // enum type expressions -var ResultIsBoolean3 = delete ENUM1[0]; +var ResultIsBoolean3 = delete ENUM1["A"]; >ResultIsBoolean3 : boolean ->delete ENUM1[0] : boolean ->ENUM1[0] : string +>delete ENUM1["A"] : boolean +>ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 -var ResultIsBoolean4 = delete (ENUM[0] + ENUM1[1]); +var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); >ResultIsBoolean4 : boolean ->delete (ENUM[0] + ENUM1[1]) : boolean ->(ENUM[0] + ENUM1[1]) : string ->ENUM[0] + ENUM1[1] : string +>delete (ENUM[0] + ENUM1["B"]) : boolean +>(ENUM[0] + ENUM1["B"]) : string +>ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM ->ENUM1[1] : ENUM1 +>ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 // multiple delete operators @@ -42,16 +44,16 @@ var ResultIsBoolean5 = delete delete ENUM; >delete ENUM : boolean >ENUM : typeof ENUM -var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1[1]); +var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]); >ResultIsBoolean6 : boolean ->delete delete delete (ENUM[0] + ENUM1[1]) : boolean ->delete delete (ENUM[0] + ENUM1[1]) : boolean ->delete (ENUM[0] + ENUM1[1]) : boolean ->(ENUM[0] + ENUM1[1]) : string ->ENUM[0] + ENUM1[1] : string +>delete delete delete (ENUM[0] + ENUM1["B"]) : boolean +>delete delete (ENUM[0] + ENUM1["B"]) : boolean +>delete (ENUM[0] + ENUM1["B"]) : boolean +>(ENUM[0] + ENUM1["B"]) : string +>ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM ->ENUM1[1] : ENUM1 +>ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 // miss assignment operators @@ -63,10 +65,11 @@ delete ENUM1; >delete ENUM1 : boolean >ENUM1 : typeof ENUM1 -delete ENUM1[1]; ->delete ENUM1[1] : boolean ->ENUM1[1] : ENUM1 +delete ENUM1.B; +>delete ENUM1.B : boolean +>ENUM1.B : ENUM1 >ENUM1 : typeof ENUM1 +>B : ENUM1 delete ENUM, ENUM1; >delete ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.errors.txt b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.errors.txt index 363892227ff..40610b5b838 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.errors.txt +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.errors.txt @@ -1,3 +1,10 @@ +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassConstructorWithoutSuperCall.ts(8,5): error TS2377: Constructors for derived classes must contain a 'super' call. +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassConstructorWithoutSuperCall.ts(17,5): error TS2377: Constructors for derived classes must contain a 'super' call. +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassConstructorWithoutSuperCall.ts(18,24): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassConstructorWithoutSuperCall.ts(23,5): error TS2377: Constructors for derived classes must contain a 'super' call. +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassConstructorWithoutSuperCall.ts(24,31): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors + + ==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassConstructorWithoutSuperCall.ts (5 errors) ==== // derived class constructors must contain a super call @@ -10,7 +17,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! Constructors for derived classes must contain a 'super' call. +!!! error TS2377: Constructors for derived classes must contain a 'super' call. } class Base2 { @@ -23,10 +30,10 @@ var r2 = () => super(); // error for misplaced super call (nested function) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } ~~~~~ -!!! Constructors for derived classes must contain a 'super' call. +!!! error TS2377: Constructors for derived classes must contain a 'super' call. } class Derived3 extends Base2 { @@ -35,10 +42,10 @@ var r = function () { super() } // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } ~~~~~ -!!! Constructors for derived classes must contain a 'super' call. +!!! error TS2377: Constructors for derived classes must contain a 'super' call. } class Derived4 extends Base2 { diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt index 35b6ca92c18..f8e237a83ce 100644 --- a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt @@ -1,25 +1,33 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(10,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Types of property 'x' are incompatible. + Type '() => number' is not assignable to type 'number'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(11,5): error TS2426: Class 'Base' defines instance member accessor 'x', but extended class 'Derived' defines it as instance member function. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts (4 errors) ==== class Base { get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 1; } set x(v) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } // error class Derived extends Base { ~~~~~~~ -!!! Class 'Derived' incorrectly extends base class 'Base': -!!! Types of property 'x' are incompatible: -!!! Type '() => number' is not assignable to type 'number'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type '() => number' is not assignable to type 'number'. x() { ~ -!!! Class 'Base' defines instance member accessor 'x', but extended class 'Derived' defines it as instance member function. +!!! error TS2426: Class 'Base' defines instance member accessor 'x', but extended class 'Derived' defines it as instance member function. return 1; } } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassIncludesInheritedMembers.errors.txt b/tests/baselines/reference/derivedClassIncludesInheritedMembers.errors.txt index 307aad8dd2e..f8e52d3e575 100644 --- a/tests/baselines/reference/derivedClassIncludesInheritedMembers.errors.txt +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.errors.txt @@ -1,22 +1,28 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassIncludesInheritedMembers.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassIncludesInheritedMembers.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassIncludesInheritedMembers.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassIncludesInheritedMembers.ts(10,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassIncludesInheritedMembers.ts (4 errors) ==== class Base { a: string; b() { } get c() { return ''; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. set c(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static r: string; static s() { } static get t() { return ''; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static set t(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. constructor(x) { } } diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt index 3eb2f197ca0..dd5a75362d1 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts(8,7): error TS2415: Class 'DerivedClass' incorrectly extends base class 'BaseClass'. + Types have separate declarations of a private property '_init'. + + ==== tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts (1 errors) ==== class BaseClass { constructor() { @@ -8,8 +12,8 @@ } class DerivedClass extends BaseClass { ~~~~~~~~~~~~ -!!! Class 'DerivedClass' incorrectly extends base class 'BaseClass': -!!! Private property '_init' cannot be reimplemented. +!!! error TS2415: Class 'DerivedClass' incorrectly extends base class 'BaseClass'. +!!! error TS2415: Types have separate declarations of a private property '_init'. constructor() { super(); } diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt b/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt index c6d8f230589..400d7d0d346 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(5,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Types have separate declarations of a private property 'x'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(13,7): error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. + Types have separate declarations of a private property 'y'. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts (2 errors) ==== class Base { private x: { foo: string }; @@ -5,8 +11,8 @@ class Derived extends Base { ~~~~~~~ -!!! Class 'Derived' incorrectly extends base class 'Base': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types have separate declarations of a private property 'x'. private x: { foo: string; bar: string; }; // error } @@ -16,7 +22,7 @@ class Derived2 extends Base2 { ~~~~~~~~ -!!! Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': -!!! Private property 'y' cannot be reimplemented. +!!! error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. +!!! error TS2417: Types have separate declarations of a private property 'y'. private static y: { foo: string; bar: string; }; // error } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js new file mode 100644 index 00000000000..8c8b6a13c7e --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -0,0 +1,103 @@ +//// [derivedClassOverridesProtectedMembers.ts] + +var x: { foo: string; } +var y: { foo: string; bar: string; } + +class Base { + protected a: typeof x; + protected b(a: typeof x) { } + protected get c() { return x; } + protected set c(v: typeof x) { } + protected d: (a: typeof x) => void; + + protected static r: typeof x; + protected static s(a: typeof x) { } + protected static get t() { return x; } + protected static set t(v: typeof x) { } + protected static u: (a: typeof x) => void; + + constructor(a: typeof x) { } +} + +class Derived extends Base { + protected a: typeof y; + protected b(a: typeof y) { } + protected get c() { return y; } + protected set c(v: typeof y) { } + protected d: (a: typeof y) => void; + + protected static r: typeof y; + protected static s(a: typeof y) { } + protected static get t() { return y; } + protected static set t(a: typeof y) { } + protected static u: (a: typeof y) => void; + + constructor(a: typeof y) { super(x) } +} + + +//// [derivedClassOverridesProtectedMembers.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var x; +var y; +var Base = (function () { + function Base(a) { + } + Base.prototype.b = function (a) { + }; + Object.defineProperty(Base.prototype, "c", { + get: function () { + return x; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + Base.s = function (a) { + }; + Object.defineProperty(Base, "t", { + get: function () { + return x; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived(a) { + _super.call(this, x); + } + Derived.prototype.b = function (a) { + }; + Object.defineProperty(Derived.prototype, "c", { + get: function () { + return y; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + Derived.s = function (a) { + }; + Object.defineProperty(Derived, "t", { + get: function () { + return y; + }, + set: function (a) { + }, + enumerable: true, + configurable: true + }); + return Derived; +})(Base); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.types b/tests/baselines/reference/derivedClassOverridesProtectedMembers.types new file mode 100644 index 00000000000..2695cbabe34 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.types @@ -0,0 +1,123 @@ +=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers.ts === + +var x: { foo: string; } +>x : { foo: string; } +>foo : string + +var y: { foo: string; bar: string; } +>y : { foo: string; bar: string; } +>foo : string +>bar : string + +class Base { +>Base : Base + + protected a: typeof x; +>a : { foo: string; } +>x : { foo: string; } + + protected b(a: typeof x) { } +>b : (a: { foo: string; }) => void +>a : { foo: string; } +>x : { foo: string; } + + protected get c() { return x; } +>c : { foo: string; } +>x : { foo: string; } + + protected set c(v: typeof x) { } +>c : { foo: string; } +>v : { foo: string; } +>x : { foo: string; } + + protected d: (a: typeof x) => void; +>d : (a: { foo: string; }) => void +>a : { foo: string; } +>x : { foo: string; } + + protected static r: typeof x; +>r : { foo: string; } +>x : { foo: string; } + + protected static s(a: typeof x) { } +>s : (a: { foo: string; }) => void +>a : { foo: string; } +>x : { foo: string; } + + protected static get t() { return x; } +>t : { foo: string; } +>x : { foo: string; } + + protected static set t(v: typeof x) { } +>t : { foo: string; } +>v : { foo: string; } +>x : { foo: string; } + + protected static u: (a: typeof x) => void; +>u : (a: { foo: string; }) => void +>a : { foo: string; } +>x : { foo: string; } + + constructor(a: typeof x) { } +>a : { foo: string; } +>x : { foo: string; } +} + +class Derived extends Base { +>Derived : Derived +>Base : Base + + protected a: typeof y; +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + protected b(a: typeof y) { } +>b : (a: { foo: string; bar: string; }) => void +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + protected get c() { return y; } +>c : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + protected set c(v: typeof y) { } +>c : { foo: string; bar: string; } +>v : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + protected d: (a: typeof y) => void; +>d : (a: { foo: string; bar: string; }) => void +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + protected static r: typeof y; +>r : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + protected static s(a: typeof y) { } +>s : (a: { foo: string; bar: string; }) => void +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + protected static get t() { return y; } +>t : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + protected static set t(a: typeof y) { } +>t : { foo: string; bar: string; } +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + protected static u: (a: typeof y) => void; +>u : (a: { foo: string; bar: string; }) => void +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + constructor(a: typeof y) { super(x) } +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } +>super(x) : void +>super : typeof Base +>x : { foo: string; } +} + diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js new file mode 100644 index 00000000000..55bfd0e924d --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -0,0 +1,157 @@ +//// [derivedClassOverridesProtectedMembers2.ts] +var x: { foo: string; } +var y: { foo: string; bar: string; } + +class Base { + protected a: typeof x; + protected b(a: typeof x) { } + protected get c() { return x; } + protected set c(v: typeof x) { } + protected d: (a: typeof x) => void ; + + protected static r: typeof x; + protected static s(a: typeof x) { } + protected static get t() { return x; } + protected static set t(v: typeof x) { } + protected static u: (a: typeof x) => void ; + +constructor(a: typeof x) { } +} + +// Increase visibility of all protected members to public +class Derived extends Base { + a: typeof y; + b(a: typeof y) { } + get c() { return y; } + set c(v: typeof y) { } + d: (a: typeof y) => void; + + static r: typeof y; + static s(a: typeof y) { } + static get t() { return y; } + static set t(a: typeof y) { } + static u: (a: typeof y) => void; + + constructor(a: typeof y) { super(a); } +} + +var d: Derived = new Derived(y); +var r1 = d.a; +var r2 = d.b(y); +var r3 = d.c; +var r3a = d.d; +d.c = y; +var r4 = Derived.r; +var r5 = Derived.s(y); +var r6 = Derived.t; +var r6a = Derived.u; +Derived.t = y; + +class Base2 { + [i: string]: Object; + [i: number]: typeof x; +} + +class Derived2 extends Base2 { + [i: string]: typeof x; + [i: number]: typeof y; +} + +var d2: Derived2; +var r7 = d2['']; +var r8 = d2[1]; + + + +//// [derivedClassOverridesProtectedMembers2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var x; +var y; +var Base = (function () { + function Base(a) { + } + Base.prototype.b = function (a) { + }; + Object.defineProperty(Base.prototype, "c", { + get: function () { + return x; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + Base.s = function (a) { + }; + Object.defineProperty(Base, "t", { + get: function () { + return x; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return Base; +})(); +// Increase visibility of all protected members to public +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived(a) { + _super.call(this, a); + } + Derived.prototype.b = function (a) { + }; + Object.defineProperty(Derived.prototype, "c", { + get: function () { + return y; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + Derived.s = function (a) { + }; + Object.defineProperty(Derived, "t", { + get: function () { + return y; + }, + set: function (a) { + }, + enumerable: true, + configurable: true + }); + return Derived; +})(Base); +var d = new Derived(y); +var r1 = d.a; +var r2 = d.b(y); +var r3 = d.c; +var r3a = d.d; +d.c = y; +var r4 = Derived.r; +var r5 = Derived.s(y); +var r6 = Derived.t; +var r6a = Derived.u; +Derived.t = y; +var Base2 = (function () { + function Base2() { + } + return Base2; +})(); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base2); +var d2; +var r7 = d2['']; +var r8 = d2[1]; diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types new file mode 100644 index 00000000000..3b6eb55256e --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types @@ -0,0 +1,236 @@ +=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers2.ts === +var x: { foo: string; } +>x : { foo: string; } +>foo : string + +var y: { foo: string; bar: string; } +>y : { foo: string; bar: string; } +>foo : string +>bar : string + +class Base { +>Base : Base + + protected a: typeof x; +>a : { foo: string; } +>x : { foo: string; } + + protected b(a: typeof x) { } +>b : (a: { foo: string; }) => void +>a : { foo: string; } +>x : { foo: string; } + + protected get c() { return x; } +>c : { foo: string; } +>x : { foo: string; } + + protected set c(v: typeof x) { } +>c : { foo: string; } +>v : { foo: string; } +>x : { foo: string; } + + protected d: (a: typeof x) => void ; +>d : (a: { foo: string; }) => void +>a : { foo: string; } +>x : { foo: string; } + + protected static r: typeof x; +>r : { foo: string; } +>x : { foo: string; } + + protected static s(a: typeof x) { } +>s : (a: { foo: string; }) => void +>a : { foo: string; } +>x : { foo: string; } + + protected static get t() { return x; } +>t : { foo: string; } +>x : { foo: string; } + + protected static set t(v: typeof x) { } +>t : { foo: string; } +>v : { foo: string; } +>x : { foo: string; } + + protected static u: (a: typeof x) => void ; +>u : (a: { foo: string; }) => void +>a : { foo: string; } +>x : { foo: string; } + +constructor(a: typeof x) { } +>a : { foo: string; } +>x : { foo: string; } +} + +// Increase visibility of all protected members to public +class Derived extends Base { +>Derived : Derived +>Base : Base + + a: typeof y; +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + b(a: typeof y) { } +>b : (a: { foo: string; bar: string; }) => void +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + get c() { return y; } +>c : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + set c(v: typeof y) { } +>c : { foo: string; bar: string; } +>v : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + d: (a: typeof y) => void; +>d : (a: { foo: string; bar: string; }) => void +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + static r: typeof y; +>r : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + static s(a: typeof y) { } +>s : (a: { foo: string; bar: string; }) => void +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + static get t() { return y; } +>t : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + static set t(a: typeof y) { } +>t : { foo: string; bar: string; } +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + static u: (a: typeof y) => void; +>u : (a: { foo: string; bar: string; }) => void +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + + constructor(a: typeof y) { super(a); } +>a : { foo: string; bar: string; } +>y : { foo: string; bar: string; } +>super(a) : void +>super : typeof Base +>a : { foo: string; bar: string; } +} + +var d: Derived = new Derived(y); +>d : Derived +>Derived : Derived +>new Derived(y) : Derived +>Derived : typeof Derived +>y : { foo: string; bar: string; } + +var r1 = d.a; +>r1 : { foo: string; bar: string; } +>d.a : { foo: string; bar: string; } +>d : Derived +>a : { foo: string; bar: string; } + +var r2 = d.b(y); +>r2 : void +>d.b(y) : void +>d.b : (a: { foo: string; bar: string; }) => void +>d : Derived +>b : (a: { foo: string; bar: string; }) => void +>y : { foo: string; bar: string; } + +var r3 = d.c; +>r3 : { foo: string; bar: string; } +>d.c : { foo: string; bar: string; } +>d : Derived +>c : { foo: string; bar: string; } + +var r3a = d.d; +>r3a : (a: { foo: string; bar: string; }) => void +>d.d : (a: { foo: string; bar: string; }) => void +>d : Derived +>d : (a: { foo: string; bar: string; }) => void + +d.c = y; +>d.c = y : { foo: string; bar: string; } +>d.c : { foo: string; bar: string; } +>d : Derived +>c : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + +var r4 = Derived.r; +>r4 : { foo: string; bar: string; } +>Derived.r : { foo: string; bar: string; } +>Derived : typeof Derived +>r : { foo: string; bar: string; } + +var r5 = Derived.s(y); +>r5 : void +>Derived.s(y) : void +>Derived.s : (a: { foo: string; bar: string; }) => void +>Derived : typeof Derived +>s : (a: { foo: string; bar: string; }) => void +>y : { foo: string; bar: string; } + +var r6 = Derived.t; +>r6 : { foo: string; bar: string; } +>Derived.t : { foo: string; bar: string; } +>Derived : typeof Derived +>t : { foo: string; bar: string; } + +var r6a = Derived.u; +>r6a : (a: { foo: string; bar: string; }) => void +>Derived.u : (a: { foo: string; bar: string; }) => void +>Derived : typeof Derived +>u : (a: { foo: string; bar: string; }) => void + +Derived.t = y; +>Derived.t = y : { foo: string; bar: string; } +>Derived.t : { foo: string; bar: string; } +>Derived : typeof Derived +>t : { foo: string; bar: string; } +>y : { foo: string; bar: string; } + +class Base2 { +>Base2 : Base2 + + [i: string]: Object; +>i : string +>Object : Object + + [i: number]: typeof x; +>i : number +>x : { foo: string; } +} + +class Derived2 extends Base2 { +>Derived2 : Derived2 +>Base2 : Base2 + + [i: string]: typeof x; +>i : string +>x : { foo: string; } + + [i: number]: typeof y; +>i : number +>y : { foo: string; bar: string; } +} + +var d2: Derived2; +>d2 : Derived2 +>Derived2 : Derived2 + +var r7 = d2['']; +>r7 : { foo: string; } +>d2[''] : { foo: string; } +>d2 : Derived2 + +var r8 = d2[1]; +>r8 : { foo: string; bar: string; } +>d2[1] : { foo: string; bar: string; } +>d2 : Derived2 + + diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt new file mode 100644 index 00000000000..a9762ce03ec --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt @@ -0,0 +1,124 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(23,7): error TS2415: Class 'Derived1' incorrectly extends base class 'Base'. + Property 'a' is protected in type 'Derived1' but public in type 'Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(28,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Base'. + Property 'b' is protected in type 'Derived2' but public in type 'Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(33,7): error TS2415: Class 'Derived3' incorrectly extends base class 'Base'. + Property 'c' is protected in type 'Derived3' but public in type 'Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(38,7): error TS2415: Class 'Derived4' incorrectly extends base class 'Base'. + Property 'c' is protected in type 'Derived4' but public in type 'Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(43,7): error TS2415: Class 'Derived5' incorrectly extends base class 'Base'. + Property 'd' is protected in type 'Derived5' but public in type 'Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(48,7): error TS2417: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base'. + Property 'r' is protected in type 'typeof Derived6' but public in type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(53,7): error TS2417: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base'. + Property 's' is protected in type 'typeof Derived7' but public in type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(58,7): error TS2417: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base'. + Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(63,7): error TS2417: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base'. + Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(68,7): error TS2417: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base'. + Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'. + + +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts (10 errors) ==== + + var x: { foo: string; } + var y: { foo: string; bar: string; } + + class Base { + a: typeof x; + b(a: typeof x) { } + get c() { return x; } + set c(v: typeof x) { } + d: (a: typeof x) => void; + + static r: typeof x; + static s(a: typeof x) { } + static get t() { return x; } + static set t(v: typeof x) { } + static u: (a: typeof x) => void; + + constructor(a: typeof x) {} + } + + // Errors + // decrease visibility of all public members to protected + class Derived1 extends Base { + ~~~~~~~~ +!!! error TS2415: Class 'Derived1' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'a' is protected in type 'Derived1' but public in type 'Base'. + protected a: typeof x; + constructor(a: typeof x) { super(a); } + } + + class Derived2 extends Base { + ~~~~~~~~ +!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'b' is protected in type 'Derived2' but public in type 'Base'. + protected b(a: typeof x) { } + constructor(a: typeof x) { super(a); } + } + + class Derived3 extends Base { + ~~~~~~~~ +!!! error TS2415: Class 'Derived3' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'c' is protected in type 'Derived3' but public in type 'Base'. + protected get c() { return x; } + constructor(a: typeof x) { super(a); } + } + + class Derived4 extends Base { + ~~~~~~~~ +!!! error TS2415: Class 'Derived4' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'c' is protected in type 'Derived4' but public in type 'Base'. + protected set c(v: typeof x) { } + constructor(a: typeof x) { super(a); } + } + + class Derived5 extends Base { + ~~~~~~~~ +!!! error TS2415: Class 'Derived5' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'd' is protected in type 'Derived5' but public in type 'Base'. + protected d: (a: typeof x) => void ; + constructor(a: typeof x) { super(a); } + } + + class Derived6 extends Base { + ~~~~~~~~ +!!! error TS2417: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'r' is protected in type 'typeof Derived6' but public in type 'typeof Base'. + protected static r: typeof x; + constructor(a: typeof x) { super(a); } + } + + class Derived7 extends Base { + ~~~~~~~~ +!!! error TS2417: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 's' is protected in type 'typeof Derived7' but public in type 'typeof Base'. + protected static s(a: typeof x) { } + constructor(a: typeof x) { super(a); } + } + + class Derived8 extends Base { + ~~~~~~~~ +!!! error TS2417: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'. + protected static get t() { return x; } + constructor(a: typeof x) { super(a); } + } + + class Derived9 extends Base { + ~~~~~~~~ +!!! error TS2417: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'. + protected static set t(v: typeof x) { } + constructor(a: typeof x) { super(a); } + } + + class Derived10 extends Base { + ~~~~~~~~~ +!!! error TS2417: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'. + protected static u: (a: typeof x) => void ; + constructor(a: typeof x) { super(a); } + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js new file mode 100644 index 00000000000..0a228a04f71 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -0,0 +1,211 @@ +//// [derivedClassOverridesProtectedMembers3.ts] + +var x: { foo: string; } +var y: { foo: string; bar: string; } + +class Base { + a: typeof x; + b(a: typeof x) { } + get c() { return x; } + set c(v: typeof x) { } + d: (a: typeof x) => void; + + static r: typeof x; + static s(a: typeof x) { } + static get t() { return x; } + static set t(v: typeof x) { } + static u: (a: typeof x) => void; + + constructor(a: typeof x) {} +} + +// Errors +// decrease visibility of all public members to protected +class Derived1 extends Base { + protected a: typeof x; + constructor(a: typeof x) { super(a); } +} + +class Derived2 extends Base { + protected b(a: typeof x) { } + constructor(a: typeof x) { super(a); } +} + +class Derived3 extends Base { + protected get c() { return x; } + constructor(a: typeof x) { super(a); } +} + +class Derived4 extends Base { + protected set c(v: typeof x) { } + constructor(a: typeof x) { super(a); } +} + +class Derived5 extends Base { + protected d: (a: typeof x) => void ; + constructor(a: typeof x) { super(a); } +} + +class Derived6 extends Base { + protected static r: typeof x; + constructor(a: typeof x) { super(a); } +} + +class Derived7 extends Base { + protected static s(a: typeof x) { } + constructor(a: typeof x) { super(a); } +} + +class Derived8 extends Base { + protected static get t() { return x; } + constructor(a: typeof x) { super(a); } +} + +class Derived9 extends Base { + protected static set t(v: typeof x) { } + constructor(a: typeof x) { super(a); } +} + +class Derived10 extends Base { + protected static u: (a: typeof x) => void ; + constructor(a: typeof x) { super(a); } +} + +//// [derivedClassOverridesProtectedMembers3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var x; +var y; +var Base = (function () { + function Base(a) { + } + Base.prototype.b = function (a) { + }; + Object.defineProperty(Base.prototype, "c", { + get: function () { + return x; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + Base.s = function (a) { + }; + Object.defineProperty(Base, "t", { + get: function () { + return x; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return Base; +})(); +// Errors +// decrease visibility of all public members to protected +var Derived1 = (function (_super) { + __extends(Derived1, _super); + function Derived1(a) { + _super.call(this, a); + } + return Derived1; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2(a) { + _super.call(this, a); + } + Derived2.prototype.b = function (a) { + }; + return Derived2; +})(Base); +var Derived3 = (function (_super) { + __extends(Derived3, _super); + function Derived3(a) { + _super.call(this, a); + } + Object.defineProperty(Derived3.prototype, "c", { + get: function () { + return x; + }, + enumerable: true, + configurable: true + }); + return Derived3; +})(Base); +var Derived4 = (function (_super) { + __extends(Derived4, _super); + function Derived4(a) { + _super.call(this, a); + } + Object.defineProperty(Derived4.prototype, "c", { + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return Derived4; +})(Base); +var Derived5 = (function (_super) { + __extends(Derived5, _super); + function Derived5(a) { + _super.call(this, a); + } + return Derived5; +})(Base); +var Derived6 = (function (_super) { + __extends(Derived6, _super); + function Derived6(a) { + _super.call(this, a); + } + return Derived6; +})(Base); +var Derived7 = (function (_super) { + __extends(Derived7, _super); + function Derived7(a) { + _super.call(this, a); + } + Derived7.s = function (a) { + }; + return Derived7; +})(Base); +var Derived8 = (function (_super) { + __extends(Derived8, _super); + function Derived8(a) { + _super.call(this, a); + } + Object.defineProperty(Derived8, "t", { + get: function () { + return x; + }, + enumerable: true, + configurable: true + }); + return Derived8; +})(Base); +var Derived9 = (function (_super) { + __extends(Derived9, _super); + function Derived9(a) { + _super.call(this, a); + } + Object.defineProperty(Derived9, "t", { + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return Derived9; +})(Base); +var Derived10 = (function (_super) { + __extends(Derived10, _super); + function Derived10(a) { + _super.call(this, a); + } + return Derived10; +})(Base); diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt new file mode 100644 index 00000000000..064e2e8d43c --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers4.ts(12,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Derived1'. + Property 'a' is protected in type 'Derived2' but public in type 'Derived1'. + + +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers4.ts (1 errors) ==== + var x: { foo: string; } + var y: { foo: string; bar: string; } + + class Base { + protected a: typeof x; + } + + class Derived1 extends Base { + public a: typeof x; + } + + class Derived2 extends Derived1 { + ~~~~~~~~ +!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Derived1'. +!!! error TS2415: Property 'a' is protected in type 'Derived2' but public in type 'Derived1'. + protected a: typeof x; // Error, parent was public + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js new file mode 100644 index 00000000000..e1d5b766b82 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js @@ -0,0 +1,44 @@ +//// [derivedClassOverridesProtectedMembers4.ts] +var x: { foo: string; } +var y: { foo: string; bar: string; } + +class Base { + protected a: typeof x; +} + +class Derived1 extends Base { + public a: typeof x; +} + +class Derived2 extends Derived1 { + protected a: typeof x; // Error, parent was public +} + +//// [derivedClassOverridesProtectedMembers4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var x; +var y; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived1 = (function (_super) { + __extends(Derived1, _super); + function Derived1() { + _super.apply(this, arguments); + } + return Derived1; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived1); diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.errors.txt b/tests/baselines/reference/derivedClassOverridesPublicMembers.errors.txt index efd8f968ea3..9292ff64411 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPublicMembers.ts(7,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPublicMembers.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPublicMembers.ts(13,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPublicMembers.ts(14,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPublicMembers.ts(23,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPublicMembers.ts(24,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPublicMembers.ts(29,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPublicMembers.ts(30,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPublicMembers.ts (8 errors) ==== var x: { foo: string; } var y: { foo: string; bar: string; } @@ -7,20 +17,20 @@ b(a: typeof x) { } get c() { return x; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. set c(v: typeof x) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. d: (a: typeof x) => void; static r: typeof x; static s(a: typeof x) { } static get t() { return x; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static set t(v: typeof x) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static u: (a: typeof x) => void; constructor(a: typeof x) { } @@ -31,20 +41,20 @@ b(a: typeof y) { } get c() { return y; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. set c(v: typeof y) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. d: (a: typeof y) => void; static r: typeof y; static s(a: typeof y) { } static get t() { return y; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static set t(a: typeof y) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static u: (a: typeof y) => void; constructor(a: typeof y) { super(x) } diff --git a/tests/baselines/reference/derivedClassParameterProperties.errors.txt b/tests/baselines/reference/derivedClassParameterProperties.errors.txt index cd7d774b30c..0dba0d24cb0 100644 --- a/tests/baselines/reference/derivedClassParameterProperties.errors.txt +++ b/tests/baselines/reference/derivedClassParameterProperties.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(15,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(30,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(56,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts(79,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. + + ==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts (4 errors) ==== // ordering of super calls in derived constructors matters depending on other class contents @@ -21,7 +27,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. } class Derived3 extends Base { @@ -41,7 +47,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. } class Derived5 extends Base { @@ -74,7 +80,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. } class Derived8 extends Base { @@ -103,7 +109,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. +!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. } class Derived10 extends Base2 { diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt index 6c2625223c2..ca589fb13ed 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt @@ -1,4 +1,16 @@ -==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts (14 errors) ==== +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,8): error TS1110: Type expected. +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,15): error TS1110: Type expected. +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,8): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(10,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(13,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(17,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,15): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(22,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(25,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(29,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors + + +==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts (10 errors) ==== // error to use super calls outside a constructor class Base { @@ -8,53 +20,45 @@ class Derived extends Base { a: super(); ~~~~~ -!!! Type expected. +!!! error TS1110: Type expected. ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors b() { super(); ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } get C() { - ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors return 1; } set C(v) { - ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } static a: super(); ~~~~~ -!!! Type expected. +!!! error TS1110: Type expected. ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors static b() { super(); ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } static get C() { - ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors return 1; } static set C(v) { - ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.errors.txt b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.errors.txt index 86a6a4d37e4..ef43d1d6f52 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.errors.txt +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsWithThisArg.ts(14,15): error TS2332: 'this' cannot be referenced in current location. +tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsWithThisArg.ts(20,21): error TS2332: 'this' cannot be referenced in current location. + + ==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsWithThisArg.ts (2 errors) ==== class Base { x: string; @@ -14,7 +18,7 @@ constructor(public a: string) { super(this); // error ~~~~ -!!! 'this' cannot be referenced in current location. +!!! error TS2332: 'this' cannot be referenced in current location. } } @@ -22,7 +26,7 @@ constructor(public a: string) { super(() => this); // error ~~~~ -!!! 'this' cannot be referenced in current location. +!!! error TS2332: 'this' cannot be referenced in current location. } } diff --git a/tests/baselines/reference/derivedClassTransitivity.errors.txt b/tests/baselines/reference/derivedClassTransitivity.errors.txt index c5e60abe5d4..c6b620beb18 100644 --- a/tests/baselines/reference/derivedClassTransitivity.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity.errors.txt @@ -1,3 +1,10 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x?: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts (1 errors) ==== // subclassing is not transitive when you can remove required parameters and add optional parameters @@ -18,10 +25,10 @@ var e: E; c = e; ~ -!!! Type 'E' is not assignable to type 'C': -!!! Types of property 'foo' are incompatible: -!!! Type '(x?: string) => void' is not assignable to type '(x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1); var r2 = e.foo(''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity2.errors.txt b/tests/baselines/reference/derivedClassTransitivity2.errors.txt index b2b3fca8979..a8d2003c876 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity2.errors.txt @@ -1,3 +1,10 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. + Types of parameters 'y' and 'y' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts (1 errors) ==== // subclassing is not transitive when you can remove required parameters and add optional parameters @@ -18,10 +25,10 @@ var e: E; c = e; ~ -!!! Type 'E' is not assignable to type 'C': -!!! Types of property 'foo' are incompatible: -!!! Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1, 1); var r2 = e.foo(1, ''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity3.errors.txt b/tests/baselines/reference/derivedClassTransitivity3.errors.txt index 8013f894b30..9d301255dfd 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity3.errors.txt @@ -1,3 +1,10 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. + Types of parameters 'y' and 'y' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts (1 errors) ==== // subclassing is not transitive when you can remove required parameters and add optional parameters @@ -18,10 +25,10 @@ var e: E; c = e; ~ -!!! Type 'E' is not assignable to type 'C': -!!! Types of property 'foo' are incompatible: -!!! Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void': -!!! Types of parameters 'y' and 'y' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r = c.foo('', ''); var r2 = e.foo('', 1); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity4.errors.txt b/tests/baselines/reference/derivedClassTransitivity4.errors.txt new file mode 100644 index 00000000000..c1a80e0a1d7 --- /dev/null +++ b/tests/baselines/reference/derivedClassTransitivity4.errors.txt @@ -0,0 +1,37 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x?: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(19,9): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. + + +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts (2 errors) ==== + // subclassing is not transitive when you can remove required parameters and add optional parameters on protected members + + class C { + protected foo(x: number) { } + } + + class D extends C { + protected foo() { } // ok to drop parameters + } + + class E extends D { + public foo(x?: string) { } // ok to add optional parameters + } + + var c: C; + var d: D; + var e: E; + c = e; + ~ +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + var r = c.foo(1); + ~~~~~ +!!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. + var r2 = e.foo(''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity4.js b/tests/baselines/reference/derivedClassTransitivity4.js new file mode 100644 index 00000000000..5249c6aad2e --- /dev/null +++ b/tests/baselines/reference/derivedClassTransitivity4.js @@ -0,0 +1,61 @@ +//// [derivedClassTransitivity4.ts] +// subclassing is not transitive when you can remove required parameters and add optional parameters on protected members + +class C { + protected foo(x: number) { } +} + +class D extends C { + protected foo() { } // ok to drop parameters +} + +class E extends D { + public foo(x?: string) { } // ok to add optional parameters +} + +var c: C; +var d: D; +var e: E; +c = e; +var r = c.foo(1); +var r2 = e.foo(''); + +//// [derivedClassTransitivity4.js] +// subclassing is not transitive when you can remove required parameters and add optional parameters on protected members +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.prototype.foo = function () { + }; // ok to drop parameters + return D; +})(C); +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + E.prototype.foo = function (x) { + }; // ok to add optional parameters + return E; +})(D); +var c; +var d; +var e; +c = e; +var r = c.foo(1); +var r2 = e.foo(''); diff --git a/tests/baselines/reference/derivedClassWithAny.errors.txt b/tests/baselines/reference/derivedClassWithAny.errors.txt index ca961b5e1bb..aa91979706b 100644 --- a/tests/baselines/reference/derivedClassWithAny.errors.txt +++ b/tests/baselines/reference/derivedClassWithAny.errors.txt @@ -1,9 +1,20 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(19,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(27,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(38,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(44,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(57,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts (7 errors) ==== class C { x: number; get X(): number { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. foo(): number { return 1; } @@ -11,7 +22,7 @@ static y: number; static get Y(): number { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 1; } static bar(): number { @@ -23,7 +34,7 @@ x: any; get X(): any { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null; } foo(): any { @@ -33,7 +44,7 @@ static y: any; static get Y(): any { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null; } static bar(): any { @@ -46,7 +57,7 @@ x: string; get X(): string{ return ''; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. foo(): string { return ''; } @@ -54,7 +65,7 @@ static y: string; static get Y(): string { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return ''; } static bar(): string { @@ -69,8 +80,8 @@ c = d; c = e; ~ -!!! Type 'E' is not assignable to type 'C': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(); // e.foo would return string \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt new file mode 100644 index 00000000000..60054fa47dc --- /dev/null +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt @@ -0,0 +1,30 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingProtectedInstance.ts(13,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Property 'x' is private in type 'Derived' but not in type 'Base'. + + +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingProtectedInstance.ts (1 errors) ==== + + class Base { + protected x: string; + protected fn(): string { + return ''; + } + + protected get a() { return 1; } + protected set a(v) { } + } + + // error, not a subtype + class Derived extends Base { + ~~~~~~~ +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'x' is private in type 'Derived' but not in type 'Base'. + private x: string; + private fn(): string { + return ''; + } + + private get a() { return 1; } + private set a(v) { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js new file mode 100644 index 00000000000..f802a225088 --- /dev/null +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js @@ -0,0 +1,68 @@ +//// [derivedClassWithPrivateInstanceShadowingProtectedInstance.ts] + +class Base { + protected x: string; + protected fn(): string { + return ''; + } + + protected get a() { return 1; } + protected set a(v) { } +} + +// error, not a subtype +class Derived extends Base { + private x: string; + private fn(): string { + return ''; + } + + private get a() { return 1; } + private set a(v) { } +} + + +//// [derivedClassWithPrivateInstanceShadowingProtectedInstance.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + Base.prototype.fn = function () { + return ''; + }; + Object.defineProperty(Base.prototype, "a", { + get: function () { + return 1; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return Base; +})(); +// error, not a subtype +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + Derived.prototype.fn = function () { + return ''; + }; + Object.defineProperty(Derived.prototype, "a", { + get: function () { + return 1; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return Derived; +})(Base); diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt index c467c553096..bbe47bb9544 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt @@ -1,3 +1,19 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(18,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(19,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(12,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Property 'x' is private in type 'Derived' but not in type 'Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(22,14): error TS2339: Property 'x' does not exist on type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(23,18): error TS2339: Property 'x' does not exist on type 'typeof Derived'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(25,15): error TS2339: Property 'fn' does not exist on type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(26,18): error TS2339: Property 'fn' does not exist on type 'typeof Derived'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(28,15): error TS2339: Property 'a' does not exist on type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(29,6): error TS2339: Property 'a' does not exist on type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(31,18): error TS2339: Property 'a' does not exist on type 'typeof Derived'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(32,9): error TS2339: Property 'a' does not exist on type 'typeof Derived'. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts (13 errors) ==== class Base { public x: string; @@ -7,17 +23,17 @@ public get a() { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set a(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } // error, not a subtype class Derived extends Base { ~~~~~~~ -!!! Class 'Derived' incorrectly extends base class 'Base': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'x' is private in type 'Derived' but not in type 'Base'. private x: string; private fn(): string { return ''; @@ -25,36 +41,36 @@ private get a() { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. private set a(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } var r = Base.x; // ok ~ -!!! Property 'x' does not exist on type 'typeof Base'. +!!! error TS2339: Property 'x' does not exist on type 'typeof Base'. var r2 = Derived.x; // error ~ -!!! Property 'x' does not exist on type 'typeof Derived'. +!!! error TS2339: Property 'x' does not exist on type 'typeof Derived'. var r3 = Base.fn(); // ok ~~ -!!! Property 'fn' does not exist on type 'typeof Base'. +!!! error TS2339: Property 'fn' does not exist on type 'typeof Base'. var r4 = Derived.fn(); // error ~~ -!!! Property 'fn' does not exist on type 'typeof Derived'. +!!! error TS2339: Property 'fn' does not exist on type 'typeof Derived'. var r5 = Base.a; // ok ~ -!!! Property 'a' does not exist on type 'typeof Base'. +!!! error TS2339: Property 'a' does not exist on type 'typeof Base'. Base.a = 2; // ok ~ -!!! Property 'a' does not exist on type 'typeof Base'. +!!! error TS2339: Property 'a' does not exist on type 'typeof Base'. var r6 = Derived.a; // error ~ -!!! Property 'a' does not exist on type 'typeof Derived'. +!!! error TS2339: Property 'a' does not exist on type 'typeof Derived'. Derived.a = 2; // error ~ -!!! Property 'a' does not exist on type 'typeof Derived'. \ No newline at end of file +!!! error TS2339: Property 'a' does not exist on type 'typeof Derived'. \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt new file mode 100644 index 00000000000..2697585cb20 --- /dev/null +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt @@ -0,0 +1,29 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingProtectedStatic.ts(13,7): error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. + Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. + + +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingProtectedStatic.ts (1 errors) ==== + + class Base { + protected static x: string; + protected static fn(): string { + return ''; + } + + protected static get a() { return 1; } + protected static set a(v) { } + } + + // should be error + class Derived extends Base { + ~~~~~~~ +!!! error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. + private static x: string; + private static fn(): string { + return ''; + } + + private static get a() { return 1; } + private static set a(v) { } + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js new file mode 100644 index 00000000000..558e2309757 --- /dev/null +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js @@ -0,0 +1,67 @@ +//// [derivedClassWithPrivateStaticShadowingProtectedStatic.ts] + +class Base { + protected static x: string; + protected static fn(): string { + return ''; + } + + protected static get a() { return 1; } + protected static set a(v) { } +} + +// should be error +class Derived extends Base { + private static x: string; + private static fn(): string { + return ''; + } + + private static get a() { return 1; } + private static set a(v) { } +} + +//// [derivedClassWithPrivateStaticShadowingProtectedStatic.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + Base.fn = function () { + return ''; + }; + Object.defineProperty(Base, "a", { + get: function () { + return 1; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return Base; +})(); +// should be error +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + Derived.fn = function () { + return ''; + }; + Object.defineProperty(Derived, "a", { + get: function () { + return 1; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return Derived; +})(Base); diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt index 9d5ee129541..cfdf1381282 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt @@ -1,3 +1,15 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(7,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(8,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(19,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(20,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(13,7): error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. + Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(24,10): error TS2341: Property 'x' is private and only accessible within class 'Derived'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(27,10): error TS2341: Property 'fn' is private and only accessible within class 'Derived'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(32,10): error TS2341: Property 'a' is private and only accessible within class 'Derived'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(33,1): error TS2341: Property 'a' is private and only accessible within class 'Derived'. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts (9 errors) ==== class Base { public static x: string; @@ -7,18 +19,18 @@ public static get a() { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public static set a(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } // BUG 847404 // should be error class Derived extends Base { ~~~~~~~ -!!! Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. private static x: string; private static fn(): string { return ''; @@ -26,28 +38,28 @@ private static get a() { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. private static set a(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } var r = Base.x; // ok var r2 = Derived.x; // error ~~~~~~~~~ -!!! Property 'Derived.x' is inaccessible. +!!! error TS2341: Property 'x' is private and only accessible within class 'Derived'. var r3 = Base.fn(); // ok var r4 = Derived.fn(); // error ~~~~~~~~~~ -!!! Property 'Derived.fn' is inaccessible. +!!! error TS2341: Property 'fn' is private and only accessible within class 'Derived'. var r5 = Base.a; // ok Base.a = 2; // ok var r6 = Derived.a; // error ~~~~~~~~~ -!!! Property 'Derived.a' is inaccessible. +!!! error TS2341: Property 'a' is private and only accessible within class 'Derived'. Derived.a = 2; // error ~~~~~~~~~ -!!! Property 'Derived.a' is inaccessible. \ No newline at end of file +!!! error TS2341: Property 'a' is private and only accessible within class 'Derived'. \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.errors.txt b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.errors.txt index 2d453788701..75720d86404 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.errors.txt +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts(11,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts(24,9): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts (2 errors) ==== class Base { a = 1; @@ -11,7 +15,7 @@ var r = new Derived(); // error ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r2 = new Derived(1); class Base2 { @@ -26,5 +30,5 @@ var d = new D(); // error ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var d2 = new D(new Date()); // ok \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.errors.txt b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.errors.txt index 62dc521d94a..b699fb7c89e 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.errors.txt +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts(13,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts(30,9): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts (2 errors) ==== class Base { a = 1; @@ -13,7 +17,7 @@ var r = new Derived(); // error ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r2 = new Derived(1); var r3 = new Derived(1, 2); var r4 = new Derived(1, 2, 3); @@ -32,7 +36,7 @@ var d = new D(); // error ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var d2 = new D(new Date()); // ok var d3 = new D(new Date(), new Date()); var d4 = new D(new Date(), new Date(), new Date()); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.errors.txt b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.errors.txt index 5e524399caa..6b9619cdac6 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.errors.txt +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(22,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(44,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts(45,10): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts (4 errors) ==== // automatic constructors with a class hieararchy of depth > 2 @@ -21,10 +27,10 @@ var r = new Derived(); // error ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r2 = new Derived2(1); // error ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r3 = new Derived('', ''); class Base2 { @@ -48,8 +54,8 @@ var d = new D2(); // error ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var d2 = new D2(new Date()); // error ~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var d3 = new D2(new Date(), new Date()); // ok \ No newline at end of file diff --git a/tests/baselines/reference/derivedGenericClassWithAny.errors.txt b/tests/baselines/reference/derivedGenericClassWithAny.errors.txt index 8464f8b3d0b..ab28ccc9c8d 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.errors.txt +++ b/tests/baselines/reference/derivedGenericClassWithAny.errors.txt @@ -1,9 +1,20 @@ +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(19,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,25): error TS2322: Type 'string' is not assignable to type 'T'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(32,16): error TS2322: Type 'string' is not assignable to type 'T'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(41,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts (7 errors) ==== class C { x: T; get X(): T { return null; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. foo(): T { return null; } @@ -13,7 +24,7 @@ x: any; get X(): any { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null; } foo(): any { @@ -23,7 +34,7 @@ static y: any; static get Y(): any { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null; } static bar(): any { @@ -36,13 +47,13 @@ x: T; get X(): T { return ''; } // error ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type 'string' is not assignable to type 'T'. foo(): T { return ''; // error ~~ -!!! Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type 'string' is not assignable to type 'T'. } } @@ -53,7 +64,7 @@ c = d; c = e; ~ -!!! Type 'E' is not assignable to type 'C': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(); // e.foo would return string \ No newline at end of file diff --git a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt index cdde532333b..ae8fbe2ff5d 100644 --- a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt +++ b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. + Types of property 'x' are incompatible. + Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. + + ==== tests/cases/compiler/derivedInterfaceCallSignature.ts (1 errors) ==== interface D3SvgPath { (data: any, index?: number): string; @@ -11,9 +16,9 @@ interface D3SvgArea extends D3SvgPath { ~~~~~~~~~ -!!! Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath': -!!! Types of property 'x' are incompatible: -!!! Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. +!!! error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. x(x: (data: any, index?: number) => number): D3SvgArea; y(y: (data: any, index?: number) => number): D3SvgArea; y0(): (data: any, index?: number) => number; diff --git a/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt b/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt index 444ee245377..7212121e106 100644 --- a/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt +++ b/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt @@ -1,4 +1,15 @@ -==== tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts (8 errors) ==== +tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(7,5): error TS2411: Property '1' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. +tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(7,5): error TS2412: Property '1' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. +tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(11,5): error TS2411: Property ''1'' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. +tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(11,5): error TS2412: Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. +tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(15,5): error TS2411: Property 'foo' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. +tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(19,5): error TS2411: Property 'foo' of type '() => { x: number; }' is not assignable to string index type '{ x: number; }'. +tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(24,5): error TS2300: Duplicate identifier '1'. +tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(24,5): error TS2412: Property '1' of type '{ x: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. +tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(28,5): error TS2300: Duplicate identifier ''1''. + + +==== tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts (9 errors) ==== interface Base { [x: number]: { x: number; y: number; }; [x: string]: { x: number; } @@ -7,40 +18,42 @@ interface Derived extends Base { 1: { y: number } // error ~~~~~~~~~~~~~~~~ -!!! Property '1' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. +!!! error TS2411: Property '1' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. ~~~~~~~~~~~~~~~~ -!!! Property '1' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. +!!! error TS2412: Property '1' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. } interface Derived2 extends Base { '1': { y: number } // error ~~~~~~~~~~~~~~~~~~ -!!! Property ''1'' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. +!!! error TS2411: Property ''1'' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. ~~~~~~~~~~~~~~~~~~ -!!! Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. +!!! error TS2412: Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. } interface Derived3 extends Base { foo: { y: number } // error ~~~~~~~~~~~~~~~~~~ -!!! Property 'foo' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. +!!! error TS2411: Property 'foo' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. } interface Derived4 extends Base { foo(): { x: number } // error ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'foo' of type '() => { x: number; }' is not assignable to string index type '{ x: number; }'. +!!! error TS2411: Property 'foo' of type '() => { x: number; }' is not assignable to string index type '{ x: number; }'. } // satisifies string indexer but not numeric indexer interface Derived5 extends Base { 1: { x: number } // error + ~ +!!! error TS2300: Duplicate identifier '1'. ~~~~~~~~~~~~~~~~ -!!! Property '1' of type '{ x: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. +!!! error TS2412: Property '1' of type '{ x: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. } interface Derived5 extends Base { '1': { x: number } // error ~~~ -!!! Duplicate identifier ''1''. +!!! error TS2300: Duplicate identifier ''1''. } \ No newline at end of file diff --git a/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt index cf63d1a7198..3410867f818 100644 --- a/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt +++ b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts(13,1): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts (1 errors) ==== interface MyInterface { myMethod(...myList: any[]); @@ -13,4 +16,4 @@ var y: MyClass = new MyClass(); y.myMethod(); // error ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.types b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.types index 9821ff91123..36b85d7950c 100644 --- a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.types +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.types @@ -49,7 +49,7 @@ b = d2; var r: Base[] = [d1, d2]; >r : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived | Derived2)[] >d1 : Derived >d2 : Derived2 diff --git a/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt b/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt index 9247d98d03d..71fe36660c4 100644 --- a/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt +++ b/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(21,11): error TS2430: Interface 'F' incorrectly extends interface 'E'. + Index signatures are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(29,11): error TS2430: Interface 'H' incorrectly extends interface 'G'. + Index signatures are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/derivedTypeIncompatibleSignatures.ts (2 errors) ==== interface A { (a: string): string; @@ -21,9 +29,9 @@ interface F extends E { ~ -!!! Interface 'F' incorrectly extends interface 'E': -!!! Index signatures are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'F' incorrectly extends interface 'E'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. [a: string]: number; // Number is not a subtype of string. Should error. } @@ -33,8 +41,8 @@ interface H extends G { ~ -!!! Interface 'H' incorrectly extends interface 'G': -!!! Index signatures are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'H' incorrectly extends interface 'G'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. [a: number]: number; // Should error for the same reason } \ No newline at end of file diff --git a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.errors.txt b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.errors.txt index 72b6e60b05f..b1e9ac1b8b4 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.errors.txt +++ b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/detachedCommentAtStartOfFunctionBody1.ts(6,37): error TS2339: Property 'name' does not exist on type 'TestFile'. + + ==== tests/cases/compiler/detachedCommentAtStartOfFunctionBody1.ts (1 errors) ==== class TestFile { foo(message: string): () => string { @@ -6,6 +9,6 @@ /// return () => message + this.name; ~~~~ -!!! Property 'name' does not exist on type 'TestFile'. +!!! error TS2339: Property 'name' does not exist on type 'TestFile'. } } \ No newline at end of file diff --git a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.errors.txt b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.errors.txt index 1afac3232e3..fd243e5d8ed 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.errors.txt +++ b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/detachedCommentAtStartOfFunctionBody2.ts(7,37): error TS2339: Property 'name' does not exist on type 'TestFile'. + + ==== tests/cases/compiler/detachedCommentAtStartOfFunctionBody2.ts (1 errors) ==== class TestFile { foo(message: string): () => string { @@ -7,6 +10,6 @@ return () => message + this.name; ~~~~ -!!! Property 'name' does not exist on type 'TestFile'. +!!! error TS2339: Property 'name' does not exist on type 'TestFile'. } } \ No newline at end of file diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt new file mode 100644 index 00000000000..b9890e925c4 --- /dev/null +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt @@ -0,0 +1,72 @@ +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(4,6): error TS2456: Type alias 'T0' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(6,6): error TS2456: Type alias 'T0_2' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(11,6): error TS2456: Type alias 'T1' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(14,6): error TS2456: Type alias 'T2' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(16,6): error TS2456: Type alias 'T2_1' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(19,6): error TS2456: Type alias 'T3' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(22,6): error TS2456: Type alias 'T4' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(26,6): error TS2456: Type alias 'T5' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(30,6): error TS2456: Type alias 'T7' circularly references itself. + + +==== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts (9 errors) ==== + // It is an error for the type specified in a type alias to depend on that type alias + + // A type alias directly depends on the type it aliases. + type T0 = T0 + ~~ +!!! error TS2456: Type alias 'T0' circularly references itself. + type T0_1 = T0_2 + type T0_2 = T0_3 + ~~~~ +!!! error TS2456: Type alias 'T0_2' circularly references itself. + type T0_3 = T0_1 + + // A type reference directly depends on the referenced type and each of the type arguments, if any. + interface I {} + type T1 = I + ~~ +!!! error TS2456: Type alias 'T1' circularly references itself. + + // A union type directly depends on each of the constituent types. + type T2 = T2 | string + ~~ +!!! error TS2456: Type alias 'T2' circularly references itself. + class C {} + type T2_1 = T2_1[] | number + ~~~~ +!!! error TS2456: Type alias 'T2_1' circularly references itself. + + // An array type directly depends on its element type. + type T3 = T3[] + ~~ +!!! error TS2456: Type alias 'T3' circularly references itself. + + // A tuple type directly depends on each of its element types. + type T4 = [number, T4] + ~~ +!!! error TS2456: Type alias 'T4' circularly references itself. + + // A type query directly depends on the type of the referenced entity. + var x: T5[] = [] + type T5 = typeof x + ~~ +!!! error TS2456: Type alias 'T5' circularly references itself. + + class C1 {} + type T6 = T7 | number + type T7 = typeof yy + ~~ +!!! error TS2456: Type alias 'T7' circularly references itself. + var yy: [string, T8[]]; + type T8 = C + + // legal cases + type T9 = () => T9 + type T10 = { x: T10 } | { new(v: T10): string } + type T11 = T12[] + type T12 = [T13, string] + type T13 = typeof zz + var zz: { x: T11 } + + \ No newline at end of file diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.js b/tests/baselines/reference/directDependenceBetweenTypeAliases.js new file mode 100644 index 00000000000..370e33483fc --- /dev/null +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.js @@ -0,0 +1,60 @@ +//// [directDependenceBetweenTypeAliases.ts] +// It is an error for the type specified in a type alias to depend on that type alias + +// A type alias directly depends on the type it aliases. +type T0 = T0 +type T0_1 = T0_2 +type T0_2 = T0_3 +type T0_3 = T0_1 + +// A type reference directly depends on the referenced type and each of the type arguments, if any. +interface I {} +type T1 = I + +// A union type directly depends on each of the constituent types. +type T2 = T2 | string +class C {} +type T2_1 = T2_1[] | number + +// An array type directly depends on its element type. +type T3 = T3[] + +// A tuple type directly depends on each of its element types. +type T4 = [number, T4] + +// A type query directly depends on the type of the referenced entity. +var x: T5[] = [] +type T5 = typeof x + +class C1 {} +type T6 = T7 | number +type T7 = typeof yy +var yy: [string, T8[]]; +type T8 = C + +// legal cases +type T9 = () => T9 +type T10 = { x: T10 } | { new(v: T10): string } +type T11 = T12[] +type T12 = [T13, string] +type T13 = typeof zz +var zz: { x: T11 } + + + +//// [directDependenceBetweenTypeAliases.js] +// It is an error for the type specified in a type alias to depend on that type alias +var C = (function () { + function C() { + } + return C; +})(); +// A type query directly depends on the type of the referenced entity. +var x = []; +var C1 = (function () { + function C1() { + } + return C1; +})(); +var yy; +var zz; diff --git a/tests/baselines/reference/directReferenceToNull.errors.txt b/tests/baselines/reference/directReferenceToNull.errors.txt index 23a280fc2ed..a39f7b76d2f 100644 --- a/tests/baselines/reference/directReferenceToNull.errors.txt +++ b/tests/baselines/reference/directReferenceToNull.errors.txt @@ -1,4 +1,7 @@ +tests/cases/conformance/types/primitives/null/directReferenceToNull.ts(1,8): error TS2304: Cannot find name 'Null'. + + ==== tests/cases/conformance/types/primitives/null/directReferenceToNull.ts (1 errors) ==== var x: Null; ~~~~ -!!! Cannot find name 'Null'. \ No newline at end of file +!!! error TS2304: Cannot find name 'Null'. \ No newline at end of file diff --git a/tests/baselines/reference/directReferenceToUndefined.errors.txt b/tests/baselines/reference/directReferenceToUndefined.errors.txt index 1534b27e02c..12465a01bdf 100644 --- a/tests/baselines/reference/directReferenceToUndefined.errors.txt +++ b/tests/baselines/reference/directReferenceToUndefined.errors.txt @@ -1,5 +1,8 @@ +tests/cases/conformance/types/primitives/undefined/directReferenceToUndefined.ts(1,8): error TS2304: Cannot find name 'Undefined'. + + ==== tests/cases/conformance/types/primitives/undefined/directReferenceToUndefined.ts (1 errors) ==== var x: Undefined; ~~~~~~~~~ -!!! Cannot find name 'Undefined'. +!!! error TS2304: Cannot find name 'Undefined'. var y = undefined; \ No newline at end of file diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types index 24eafce8cde..cd8c03fd6a6 100644 --- a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types @@ -21,10 +21,10 @@ interface IIntervalTreeNode { var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // was error here because best common type is {} >test : IIntervalTreeNode[] >IIntervalTreeNode : IIntervalTreeNode ->[{ interval: { begin: 0 }, children: null }] : IIntervalTreeNode[] +>[{ interval: { begin: 0 }, children: null }] : { interval: { begin: number; }; children: null; }[] >{ interval: { begin: 0 }, children: null } : { interval: { begin: number; }; children: null; } >interval : { begin: number; } >{ begin: 0 } : { begin: number; } >begin : number ->children : any +>children : null diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index fdf27296612..5f6f15791f6 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -1,16 +1,18 @@ -==== tests/cases/compiler/dontShowCompilerGeneratedMembers.ts (5 errors) ==== +tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1139: Type parameter declaration expected. +tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Expression expected. +tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. + Property 'x' is missing in type 'Number'. + + +==== tests/cases/compiler/dontShowCompilerGeneratedMembers.ts (3 errors) ==== var f: { ~ -!!! Type 'number' is not assignable to type '{ <>(): any; x: number; }': -!!! Property 'x' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. +!!! error TS2322: Property 'x' is missing in type 'Number'. x: number; <- - ~ -!!! Type parameter list cannot be empty. ~ -!!! '(' expected. - ~ -!!! Type parameter declaration expected. +!!! error TS1139: Type parameter declaration expected. }; ~ -!!! Expression expected. \ No newline at end of file +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/dottedModuleName.errors.txt b/tests/baselines/reference/dottedModuleName.errors.txt index 7308aa980f7..0b8c3a5c422 100644 --- a/tests/baselines/reference/dottedModuleName.errors.txt +++ b/tests/baselines/reference/dottedModuleName.errors.txt @@ -1,13 +1,18 @@ +tests/cases/compiler/dottedModuleName.ts(3,29): error TS1144: Block or ';' expected. +tests/cases/compiler/dottedModuleName.ts(3,18): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/dottedModuleName.ts(3,33): error TS2304: Cannot find name 'x'. + + ==== tests/cases/compiler/dottedModuleName.ts (3 errors) ==== module M { export module N { export function f(x:number)=>2*x; ~~ -!!! Block or ';' expected. +!!! error TS1144: Block or ';' expected. ~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. export module X.Y.Z { export var v2=f(v); } diff --git a/tests/baselines/reference/duplicateClassElements.errors.txt b/tests/baselines/reference/duplicateClassElements.errors.txt index 7822af473ec..004e68314fd 100644 --- a/tests/baselines/reference/duplicateClassElements.errors.txt +++ b/tests/baselines/reference/duplicateClassElements.errors.txt @@ -1,82 +1,125 @@ -==== tests/cases/compiler/duplicateClassElements.ts (18 errors) ==== +tests/cases/compiler/duplicateClassElements.ts(9,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(18,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(23,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(29,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(32,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(36,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(39,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/duplicateClassElements.ts(2,12): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/duplicateClassElements.ts(3,12): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/duplicateClassElements.ts(4,12): error TS2393: Duplicate function implementation. +tests/cases/compiler/duplicateClassElements.ts(6,12): error TS2393: Duplicate function implementation. +tests/cases/compiler/duplicateClassElements.ts(8,12): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateClassElements.ts(9,9): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateClassElements.ts(12,9): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateClassElements.ts(21,12): error TS2300: Duplicate identifier 'z'. +tests/cases/compiler/duplicateClassElements.ts(23,9): error TS2300: Duplicate identifier 'z'. +tests/cases/compiler/duplicateClassElements.ts(26,9): error TS2300: Duplicate identifier 'z'. +tests/cases/compiler/duplicateClassElements.ts(29,9): error TS2300: Duplicate identifier 'x2'. +tests/cases/compiler/duplicateClassElements.ts(32,9): error TS2300: Duplicate identifier 'x2'. +tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2300: Duplicate identifier 'x2'. +tests/cases/compiler/duplicateClassElements.ts(36,9): error TS2300: Duplicate identifier 'z2'. +tests/cases/compiler/duplicateClassElements.ts(39,9): error TS2300: Duplicate identifier 'z2'. +tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate identifier 'z2'. + + +==== tests/cases/compiler/duplicateClassElements.ts (26 errors) ==== class a { public a; + ~ +!!! error TS2300: Duplicate identifier 'a'. public a; ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. public b() { + ~ +!!! error TS2393: Duplicate function implementation. } public b() { - ~~~~~~~~~~~~ + ~ +!!! error TS2393: Duplicate function implementation. } - ~~~~~ -!!! Duplicate function implementation. public x; + ~ +!!! error TS2300: Duplicate identifier 'x'. get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. return 10; } set x(_x: number) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } get y() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "Hello"; } set y(_y: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } public z() { + ~ +!!! error TS2300: Duplicate identifier 'z'. } get z() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Duplicate identifier 'z'. +!!! error TS2300: Duplicate identifier 'z'. return "Hello"; } set z(_y: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Duplicate identifier 'z'. +!!! error TS2300: Duplicate identifier 'z'. } get x2() { ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~ +!!! error TS2300: Duplicate identifier 'x2'. return 10; } set x2(_x: number) { ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~ +!!! error TS2300: Duplicate identifier 'x2'. } public x2; ~~ -!!! Duplicate identifier 'x2'. +!!! error TS2300: Duplicate identifier 'x2'. get z2() { ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~ +!!! error TS2300: Duplicate identifier 'z2'. return "Hello"; } set z2(_y: string) { ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~ +!!! error TS2300: Duplicate identifier 'z2'. } public z2() { ~~ -!!! Duplicate identifier 'z2'. +!!! error TS2300: Duplicate identifier 'z2'. } } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateExportAssignments.errors.txt b/tests/baselines/reference/duplicateExportAssignments.errors.txt index ebaba363076..0052391f62c 100644 --- a/tests/baselines/reference/duplicateExportAssignments.errors.txt +++ b/tests/baselines/reference/duplicateExportAssignments.errors.txt @@ -1,24 +1,38 @@ +tests/cases/conformance/externalModules/foo1.ts(3,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo1.ts(3,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/conformance/externalModules/foo1.ts(4,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/conformance/externalModules/foo2.ts(3,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/conformance/externalModules/foo2.ts(4,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/conformance/externalModules/foo3.ts(7,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/conformance/externalModules/foo3.ts(8,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/conformance/externalModules/foo4.ts(1,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/conformance/externalModules/foo4.ts(8,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/conformance/externalModules/foo5.ts(4,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/conformance/externalModules/foo5.ts(5,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2308: A module cannot have more than one export assignment. + + ==== tests/cases/conformance/externalModules/foo1.ts (3 errors) ==== var x = 10; var y = 20; export = x; ~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. export = y; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. ==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ==== var x = 10; class y {}; export = x; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. export = y; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. ==== tests/cases/conformance/externalModules/foo3.ts (2 errors) ==== module x { @@ -29,15 +43,15 @@ } export = x; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. export = y; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. ==== tests/cases/conformance/externalModules/foo4.ts (2 errors) ==== export = x; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. function x(){ return 42; } @@ -46,7 +60,7 @@ } export = y; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. ==== tests/cases/conformance/externalModules/foo5.ts (3 errors) ==== var x = 5; @@ -54,11 +68,11 @@ var z = {}; export = x; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. export = y; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. export = z; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt b/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt index f20e5d626eb..d8065df27c8 100644 --- a/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt +++ b/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt @@ -1,26 +1,41 @@ -==== tests/cases/compiler/duplicateIdentifierInCatchBlock.ts (4 errors) ==== +tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(1,5): error TS2300: Duplicate identifier 'v'. +tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(3,14): error TS2300: Duplicate identifier 'v'. +tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(6,10): error TS2300: Duplicate identifier 'w'. +tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(8,9): error TS2300: Duplicate identifier 'w'. +tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(12,9): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(13,14): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'number'. + + +==== tests/cases/compiler/duplicateIdentifierInCatchBlock.ts (7 errors) ==== var v; + ~ +!!! error TS2300: Duplicate identifier 'v'. try { } catch (e) { function v() { } ~ -!!! Duplicate identifier 'v'. +!!! error TS2300: Duplicate identifier 'v'. } function w() { } + ~ +!!! error TS2300: Duplicate identifier 'w'. try { } catch (e) { var w; ~ -!!! Duplicate identifier 'w'. +!!! error TS2300: Duplicate identifier 'w'. } try { } catch (e) { var x; + ~ +!!! error TS2300: Duplicate identifier 'x'. function x() { } // error ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. function e() { } // error var p: string; var p: number; // error ~ -!!! Subsequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'number'. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt index fee03fe7807..6c80d13b2f4 100644 --- a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt +++ b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt @@ -1,20 +1,32 @@ -==== tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts (3 errors) ==== +tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(2,22): error TS2300: Duplicate identifier 'I'. +tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(5,18): error TS2300: Duplicate identifier 'I'. +tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(9,21): error TS2300: Duplicate identifier 'f'. +tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(12,18): error TS2300: Duplicate identifier 'f'. +tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(37,12): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(41,16): error TS2300: Duplicate identifier 'x'. + + +==== tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts (6 errors) ==== module M { export interface I { } + ~ +!!! error TS2300: Duplicate identifier 'I'. } module M { export class I { } // error ~ -!!! Duplicate identifier 'I'. +!!! error TS2300: Duplicate identifier 'I'. } module M { export function f() { } + ~ +!!! error TS2300: Duplicate identifier 'f'. } module M { export class f { } // error ~ -!!! Duplicate identifier 'f'. +!!! error TS2300: Duplicate identifier 'f'. } module M { @@ -40,12 +52,14 @@ class Foo { static x: number; + ~ +!!! error TS2300: Duplicate identifier 'x'. } module Foo { export var x: number; // error for redeclaring var in a different parent ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } module N { diff --git a/tests/baselines/reference/duplicateInterfaceMembers1.errors.txt b/tests/baselines/reference/duplicateInterfaceMembers1.errors.txt index be2e3d0e6bb..674d4f601e6 100644 --- a/tests/baselines/reference/duplicateInterfaceMembers1.errors.txt +++ b/tests/baselines/reference/duplicateInterfaceMembers1.errors.txt @@ -1,8 +1,14 @@ -==== tests/cases/compiler/duplicateInterfaceMembers1.ts (1 errors) ==== +tests/cases/compiler/duplicateInterfaceMembers1.ts(2,4): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicateInterfaceMembers1.ts(3,4): error TS2300: Duplicate identifier 'x'. + + +==== tests/cases/compiler/duplicateInterfaceMembers1.ts (2 errors) ==== interface Bar { x: number; + ~ +!!! error TS2300: Duplicate identifier 'x'. x: number; ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel1.errors.txt b/tests/baselines/reference/duplicateLabel1.errors.txt index 7503b9b278f..b34f1f771e0 100644 --- a/tests/baselines/reference/duplicateLabel1.errors.txt +++ b/tests/baselines/reference/duplicateLabel1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/duplicateLabel1.ts(2,1): error TS1114: Duplicate label 'target' + + ==== tests/cases/compiler/duplicateLabel1.ts (1 errors) ==== target: target: ~~~~~~ -!!! Duplicate label 'target' +!!! error TS1114: Duplicate label 'target' while (true) { } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel2.errors.txt b/tests/baselines/reference/duplicateLabel2.errors.txt index da40c01d528..307596cf4e8 100644 --- a/tests/baselines/reference/duplicateLabel2.errors.txt +++ b/tests/baselines/reference/duplicateLabel2.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/duplicateLabel2.ts(3,3): error TS1114: Duplicate label 'target' + + ==== tests/cases/compiler/duplicateLabel2.ts (1 errors) ==== target: while (true) { target: ~~~~~~ -!!! Duplicate label 'target' +!!! error TS1114: Duplicate label 'target' while (true) { } } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLocalVariable1.errors.txt b/tests/baselines/reference/duplicateLocalVariable1.errors.txt index 3bddf320db1..e4217d4d411 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable1.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/duplicateLocalVariable1.ts(185,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. + + ==== tests/cases/compiler/duplicateLocalVariable1.ts (1 errors) ==== //import FileManager = require('filemanager'); @@ -185,7 +188,7 @@ var bytes = []; for (var i = 0; i < 14; i++) { ~ -!!! Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. bytes.push(fb.readByte()); } var expected = [0xEF, 0xBB, 0xBF, 0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]; diff --git a/tests/baselines/reference/duplicateLocalVariable2.errors.txt b/tests/baselines/reference/duplicateLocalVariable2.errors.txt index d176a826082..0fbe0018bf8 100644 --- a/tests/baselines/reference/duplicateLocalVariable2.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. + + ==== tests/cases/compiler/duplicateLocalVariable2.ts (1 errors) ==== export class TestCase { constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) { @@ -27,7 +30,7 @@ var bytes = []; for (var i = 0; i < 14; i++) { ~ -!!! Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. bytes.push(fb.readByte()); } var expected = [0xEF]; diff --git a/tests/baselines/reference/duplicateLocalVariable3.errors.txt b/tests/baselines/reference/duplicateLocalVariable3.errors.txt index b99d0772292..5dda5872da0 100644 --- a/tests/baselines/reference/duplicateLocalVariable3.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable3.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'. + + ==== tests/cases/compiler/duplicateLocalVariable3.ts (1 errors) ==== var x = 1; var x = 2; @@ -11,5 +14,5 @@ var z = 3; var z = ""; ~ -!!! Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLocalVariable4.errors.txt b/tests/baselines/reference/duplicateLocalVariable4.errors.txt index 6038986971f..3209c23e39e 100644 --- a/tests/baselines/reference/duplicateLocalVariable4.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable4.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/duplicateLocalVariable4.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'. + + ==== tests/cases/compiler/duplicateLocalVariable4.ts (1 errors) ==== enum E{ a @@ -6,4 +9,4 @@ var x = E; var x = E.a; ~ -!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateNumericIndexers.errors.txt b/tests/baselines/reference/duplicateNumericIndexers.errors.txt index 74438877558..c4c7883021a 100644 --- a/tests/baselines/reference/duplicateNumericIndexers.errors.txt +++ b/tests/baselines/reference/duplicateNumericIndexers.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/types/members/duplicateNumericIndexers.ts(5,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/members/duplicateNumericIndexers.ts(9,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/members/duplicateNumericIndexers.ts(10,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/members/duplicateNumericIndexers.ts(14,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/members/duplicateNumericIndexers.ts(15,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/members/duplicateNumericIndexers.ts(20,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/members/duplicateNumericIndexers.ts(25,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/members/duplicateNumericIndexers.ts(30,5): error TS2375: Duplicate number index signature. + + ==== tests/cases/conformance/types/members/duplicateNumericIndexers.ts (8 errors) ==== // it is an error to have duplicate index signatures of the same kind in a type @@ -5,46 +15,46 @@ [x: number]: string; [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } interface String { [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } interface Array { [x: number]: T; ~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. [x: number]: T; ~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } class C { [x: number]: string; [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } interface I { [x: number]: string; [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } var a: { [x: number]: string; [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt b/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt index 51e9bae840b..05dfdc82404 100644 --- a/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt +++ b/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt @@ -1,20 +1,36 @@ -==== tests/cases/compiler/duplicateObjectLiteralProperty.ts (9 errors) ==== +tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS1118: An object literal cannot have multiple get/set accessors with the same name. +tests/cases/compiler/duplicateObjectLiteralProperty.ts(2,5): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/duplicateObjectLiteralProperty.ts(4,5): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/duplicateObjectLiteralProperty.ts(5,5): error TS2300: Duplicate identifier '\u0061'. +tests/cases/compiler/duplicateObjectLiteralProperty.ts(6,5): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/duplicateObjectLiteralProperty.ts(7,9): error TS2300: Duplicate identifier 'c'. +tests/cases/compiler/duplicateObjectLiteralProperty.ts(8,9): error TS2300: Duplicate identifier '"c"'. +tests/cases/compiler/duplicateObjectLiteralProperty.ts(14,9): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/duplicateObjectLiteralProperty.ts(15,9): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS2300: Duplicate identifier 'a'. + + +==== tests/cases/compiler/duplicateObjectLiteralProperty.ts (10 errors) ==== var x = { a: 1, + ~ +!!! error TS2300: Duplicate identifier 'a'. b: true, // OK a: 56, // Duplicate ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. \u0061: "ss", // Duplicate ~~~~~~ -!!! Duplicate identifier '\u0061'. +!!! error TS2300: Duplicate identifier '\u0061'. a: { ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. c: 1, + ~ +!!! error TS2300: Duplicate identifier 'c'. "c": 56, // Duplicate ~~~ -!!! Duplicate identifier '"c"'. +!!! error TS2300: Duplicate identifier '"c"'. } }; @@ -22,16 +38,14 @@ var y = { get a() { return 0; }, ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS2300: Duplicate identifier 'a'. set a(v: number) { }, ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS2300: Duplicate identifier 'a'. get a() { return 0; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1118: An object literal cannot have multiple get/set accessors with the same name. ~ -!!! An object literal cannot have multiple get/set accessors with the same name. - ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. }; \ No newline at end of file diff --git a/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt b/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt index e184b7761ea..6ae8518677d 100644 --- a/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt +++ b/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt @@ -1,10 +1,17 @@ -==== tests/cases/compiler/duplicatePropertiesInStrictMode.ts (2 errors) ==== +tests/cases/compiler/duplicatePropertiesInStrictMode.ts(4,3): error TS1117: An object literal cannot have multiple properties with the same name in strict mode. +tests/cases/compiler/duplicatePropertiesInStrictMode.ts(3,3): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/duplicatePropertiesInStrictMode.ts(4,3): error TS2300: Duplicate identifier 'x'. + + +==== tests/cases/compiler/duplicatePropertiesInStrictMode.ts (3 errors) ==== "use strict"; var x = { x: 1, + ~ +!!! error TS2300: Duplicate identifier 'x'. x: 2 ~ -!!! An object literal cannot have multiple properties with the same name in strict mode. +!!! error TS1117: An object literal cannot have multiple properties with the same name in strict mode. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicatePropertyNames.errors.txt b/tests/baselines/reference/duplicatePropertyNames.errors.txt index 6e9f95e0c42..108a88d1451 100644 --- a/tests/baselines/reference/duplicatePropertyNames.errors.txt +++ b/tests/baselines/reference/duplicatePropertyNames.errors.txt @@ -1,11 +1,35 @@ -==== tests/cases/conformance/types/members/duplicatePropertyNames.ts (10 errors) ==== +tests/cases/conformance/types/members/duplicatePropertyNames.ts(4,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(5,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(14,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(15,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(19,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(20,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(22,5): error TS2393: Duplicate function implementation. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(23,5): error TS2393: Duplicate function implementation. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(25,5): error TS2300: Duplicate identifier 'baz'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(26,5): error TS2300: Duplicate identifier 'baz'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(30,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(31,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(35,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(36,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(38,5): error TS2300: Duplicate identifier 'bar'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(39,5): error TS2300: Duplicate identifier 'bar'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(43,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(44,5): error TS2300: Duplicate identifier 'foo'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(45,5): error TS2300: Duplicate identifier 'bar'. +tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2300: Duplicate identifier 'bar'. + + +==== tests/cases/conformance/types/members/duplicatePropertyNames.ts (20 errors) ==== // duplicate property names are an error in all types interface Number { foo: string; + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. foo: string; ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. } interface String { @@ -15,55 +39,73 @@ interface Array { foo: T; + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. foo: T; ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. } class C { foo: string; + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. foo: string; ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. bar(x) { } + ~~~ +!!! error TS2393: Duplicate function implementation. bar(x) { } - ~~~~~~~~~~ -!!! Duplicate function implementation. + ~~~ +!!! error TS2393: Duplicate function implementation. - baz = () => { } baz = () => { } ~~~ -!!! Duplicate identifier 'baz'. +!!! error TS2300: Duplicate identifier 'baz'. + baz = () => { } + ~~~ +!!! error TS2300: Duplicate identifier 'baz'. } interface I { foo: string; + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. foo: string; ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. } var a: { foo: string; + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. foo: string; ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. bar: () => {}; + ~~~ +!!! error TS2300: Duplicate identifier 'bar'. bar: () => {}; ~~~ -!!! Duplicate identifier 'bar'. +!!! error TS2300: Duplicate identifier 'bar'. } var b = { foo: '', + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. foo: '', ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. bar: () => { }, + ~~~ +!!! error TS2300: Duplicate identifier 'bar'. bar: () => { } ~~~ -!!! Duplicate identifier 'bar'. +!!! error TS2300: Duplicate identifier 'bar'. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateStringIndexers.errors.txt b/tests/baselines/reference/duplicateStringIndexers.errors.txt index f4cfe243bd3..9eebe6f7892 100644 --- a/tests/baselines/reference/duplicateStringIndexers.errors.txt +++ b/tests/baselines/reference/duplicateStringIndexers.errors.txt @@ -1,3 +1,11 @@ +tests/cases/conformance/types/members/duplicateStringIndexers.ts(6,9): error TS2374: Duplicate string index signature. +tests/cases/conformance/types/members/duplicateStringIndexers.ts(11,9): error TS2374: Duplicate string index signature. +tests/cases/conformance/types/members/duplicateStringIndexers.ts(16,9): error TS2374: Duplicate string index signature. +tests/cases/conformance/types/members/duplicateStringIndexers.ts(21,9): error TS2374: Duplicate string index signature. +tests/cases/conformance/types/members/duplicateStringIndexers.ts(26,9): error TS2374: Duplicate string index signature. +tests/cases/conformance/types/members/duplicateStringIndexers.ts(31,9): error TS2374: Duplicate string index signature. + + ==== tests/cases/conformance/types/members/duplicateStringIndexers.ts (6 errors) ==== // it is an error to have duplicate index signatures of the same kind in a type @@ -6,42 +14,42 @@ [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } interface String { [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } interface Array { [x: string]: T; [x: string]: T; ~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } class C { [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } interface I { [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } var a: { [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateStringNamedProperty1.errors.txt b/tests/baselines/reference/duplicateStringNamedProperty1.errors.txt index 9fdd6668807..7d6c5d6bafc 100644 --- a/tests/baselines/reference/duplicateStringNamedProperty1.errors.txt +++ b/tests/baselines/reference/duplicateStringNamedProperty1.errors.txt @@ -1,7 +1,13 @@ -==== tests/cases/compiler/duplicateStringNamedProperty1.ts (1 errors) ==== +tests/cases/compiler/duplicateStringNamedProperty1.ts(2,5): error TS2300: Duplicate identifier '"artist"'. +tests/cases/compiler/duplicateStringNamedProperty1.ts(3,5): error TS2300: Duplicate identifier 'artist'. + + +==== tests/cases/compiler/duplicateStringNamedProperty1.ts (2 errors) ==== export interface Album { "artist": string; + ~~~~~~~~ +!!! error TS2300: Duplicate identifier '"artist"'. artist: string; ~~~~~~ -!!! Duplicate identifier 'artist'. +!!! error TS2300: Duplicate identifier 'artist'. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt b/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt index a42b1c0b8b1..768e6111b73 100644 --- a/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt +++ b/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt @@ -1,3 +1,23 @@ +tests/cases/compiler/duplicateSymbolsExportMatching.ts(24,15): error TS2395: Individual declarations in merged declaration I must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(25,22): error TS2395: Individual declarations in merged declaration I must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(26,22): error TS2395: Individual declarations in merged declaration E must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(27,15): error TS2395: Individual declarations in merged declaration E must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(32,12): error TS2395: Individual declarations in merged declaration inst must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(35,19): error TS2395: Individual declarations in merged declaration inst must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(42,9): error TS2395: Individual declarations in merged declaration v must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(43,16): error TS2395: Individual declarations in merged declaration v must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(44,9): error TS2395: Individual declarations in merged declaration w must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(45,16): error TS2395: Individual declarations in merged declaration w must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(49,12): error TS2395: Individual declarations in merged declaration F must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(49,12): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/duplicateSymbolsExportMatching.ts(52,21): error TS2395: Individual declarations in merged declaration F must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(56,11): error TS2395: Individual declarations in merged declaration C must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(57,12): error TS2395: Individual declarations in merged declaration C must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(58,19): error TS2395: Individual declarations in merged declaration C must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(64,11): error TS2395: Individual declarations in merged declaration D must be all exported or all local. +tests/cases/compiler/duplicateSymbolsExportMatching.ts(65,18): error TS2395: Individual declarations in merged declaration D must be all exported or all local. + + ==== tests/cases/compiler/duplicateSymbolsExportMatching.ts (18 errors) ==== module M { export interface E { } @@ -24,28 +44,28 @@ module N2 { interface I { } ~ -!!! Individual declarations in merged declaration I must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration I must be all exported or all local. export interface I { } // error ~ -!!! Individual declarations in merged declaration I must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration I must be all exported or all local. export interface E { } ~ -!!! Individual declarations in merged declaration E must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration E must be all exported or all local. interface E { } // error ~ -!!! Individual declarations in merged declaration E must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration E must be all exported or all local. } // Should report error only once for instantiated module module M { module inst { ~~~~ -!!! Individual declarations in merged declaration inst must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration inst must be all exported or all local. var t; } export module inst { // one error ~~~~ -!!! Individual declarations in merged declaration inst must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration inst must be all exported or all local. var t; } } @@ -54,41 +74,41 @@ module M2 { var v: string; ~ -!!! Individual declarations in merged declaration v must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration v must be all exported or all local. export var v: string; // one error (visibility) ~ -!!! Individual declarations in merged declaration v must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration v must be all exported or all local. var w: number; ~ -!!! Individual declarations in merged declaration w must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration w must be all exported or all local. export var w: string; // two errors (visibility and type mismatch) ~ -!!! Individual declarations in merged declaration w must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration w must be all exported or all local. } module M { module F { ~ -!!! Individual declarations in merged declaration F must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration F must be all exported or all local. ~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged var t; } export function F() { } // Only one error for duplicate identifier (don't consider visibility) ~ -!!! Individual declarations in merged declaration F must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration F must be all exported or all local. } module M { class C { } ~ -!!! Individual declarations in merged declaration C must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration C must be all exported or all local. module C { } ~ -!!! Individual declarations in merged declaration C must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration C must be all exported or all local. export module C { // Two visibility errors (one for the clodule symbol, and one for the merged container symbol) ~ -!!! Individual declarations in merged declaration C must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration C must be all exported or all local. var t; } } @@ -96,7 +116,7 @@ // Top level interface D { } ~ -!!! Individual declarations in merged declaration D must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration D must be all exported or all local. export interface D { } ~ -!!! Individual declarations in merged declaration D must be all exported or all local. \ No newline at end of file +!!! error TS2395: Individual declarations in merged declaration D must be all exported or all local. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateTypeParameters1.errors.txt b/tests/baselines/reference/duplicateTypeParameters1.errors.txt index 798411f6b6d..ad9edcfaa34 100644 --- a/tests/baselines/reference/duplicateTypeParameters1.errors.txt +++ b/tests/baselines/reference/duplicateTypeParameters1.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/duplicateTypeParameters1.ts(1,15): error TS2300: Duplicate identifier 'X'. + + ==== tests/cases/compiler/duplicateTypeParameters1.ts (1 errors) ==== function A() { } ~ -!!! Duplicate identifier 'X'. +!!! error TS2300: Duplicate identifier 'X'. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateTypeParameters2.errors.txt b/tests/baselines/reference/duplicateTypeParameters2.errors.txt index 52c6b799e9e..a509497a0c5 100644 --- a/tests/baselines/reference/duplicateTypeParameters2.errors.txt +++ b/tests/baselines/reference/duplicateTypeParameters2.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/duplicateTypeParameters2.ts(4,26): error TS2300: Duplicate identifier 'T'. + + ==== tests/cases/compiler/duplicateTypeParameters2.ts (1 errors) ==== class A { public foo() { } } class B { public bar() { } } interface I {} ~ -!!! Duplicate identifier 'T'. \ No newline at end of file +!!! error TS2300: Duplicate identifier 'T'. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateTypeParameters3.errors.txt b/tests/baselines/reference/duplicateTypeParameters3.errors.txt index 88bbf127abb..9ff7d621948 100644 --- a/tests/baselines/reference/duplicateTypeParameters3.errors.txt +++ b/tests/baselines/reference/duplicateTypeParameters3.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/duplicateTypeParameters3.ts(2,14): error TS2300: Duplicate identifier 'A'. + + ==== tests/cases/compiler/duplicateTypeParameters3.ts (1 errors) ==== interface X { x: () => () => void; ~ -!!! Duplicate identifier 'A'. +!!! error TS2300: Duplicate identifier 'A'. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVarAndImport2.errors.txt b/tests/baselines/reference/duplicateVarAndImport2.errors.txt index b6f52fc23cb..192b16eaab9 100644 --- a/tests/baselines/reference/duplicateVarAndImport2.errors.txt +++ b/tests/baselines/reference/duplicateVarAndImport2.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/duplicateVarAndImport2.ts(4,1): error TS2440: Import declaration conflicts with local declaration of 'a' + + ==== tests/cases/compiler/duplicateVarAndImport2.ts (1 errors) ==== // error since module is instantiated var a; module M { export var x = 1; } import a = M; ~~~~~~~~~~~~~ -!!! Import declaration conflicts with local declaration of 'a' \ No newline at end of file +!!! error TS2440: Import declaration conflicts with local declaration of 'a' \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVariablesWithAny.errors.txt b/tests/baselines/reference/duplicateVariablesWithAny.errors.txt index 0cfc4b1a720..787e118ca37 100644 --- a/tests/baselines/reference/duplicateVariablesWithAny.errors.txt +++ b/tests/baselines/reference/duplicateVariablesWithAny.errors.txt @@ -1,25 +1,31 @@ +tests/cases/compiler/duplicateVariablesWithAny.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. +tests/cases/compiler/duplicateVariablesWithAny.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. +tests/cases/compiler/duplicateVariablesWithAny.ts(10,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. +tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. + + ==== tests/cases/compiler/duplicateVariablesWithAny.ts (4 errors) ==== // They should have to be the same even when one of the types is 'any' var x: any; var x = 2; //error ~ -!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. var y = ""; var y; //error ~ -!!! Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. module N { var x: any; var x = 2; //error ~ -!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. var y = ""; var y; //error ~ -!!! Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. } var z: any; diff --git a/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt index 5f9d5727475..d4222483212 100644 --- a/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt +++ b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'boolean'. +tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'. +tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'. +tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'. + + ==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts (0 errors) ==== var x = 3; var y = ""; @@ -5,19 +11,19 @@ ==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts (1 errors) ==== var x = true; ~ -!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'boolean'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'boolean'. var z = 3; ==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts (3 errors) ==== var x = ""; ~ -!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'. var y = 3; ~ -!!! Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'. var z = false; ~ -!!! Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'. ==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_3.ts (0 errors) ==== var x = 0; diff --git a/tests/baselines/reference/elidingImportNames.js b/tests/baselines/reference/elidingImportNames.js new file mode 100644 index 00000000000..3c61789a1a7 --- /dev/null +++ b/tests/baselines/reference/elidingImportNames.js @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/elidingImportNames.ts] //// + +//// [elidingImportNames_test.ts] + +import a = require('elidingImportNames_main'); // alias used in typeof +var b = a; +var x: typeof a; +import a2 = require('elidingImportNames_main1'); // alias not used in typeof +var b2 = a2; + + +//// [elidingImportNames_main.ts] +export var main = 10; + +//// [elidingImportNames_main1.ts] +export var main = 10; + +//// [elidingImportNames_main.js] +exports.main = 10; +//// [elidingImportNames_main1.js] +exports.main = 10; +//// [elidingImportNames_test.js] +var a = require('elidingImportNames_main'); // alias used in typeof +var b = a; +var x; +var a2 = require('elidingImportNames_main1'); // alias not used in typeof +var b2 = a2; diff --git a/tests/baselines/reference/elidingImportNames.types b/tests/baselines/reference/elidingImportNames.types new file mode 100644 index 00000000000..ad93c72860b --- /dev/null +++ b/tests/baselines/reference/elidingImportNames.types @@ -0,0 +1,29 @@ +=== tests/cases/compiler/elidingImportNames_test.ts === + +import a = require('elidingImportNames_main'); // alias used in typeof +>a : typeof a + +var b = a; +>b : typeof a +>a : typeof a + +var x: typeof a; +>x : typeof a +>a : typeof a + +import a2 = require('elidingImportNames_main1'); // alias not used in typeof +>a2 : typeof a2 + +var b2 = a2; +>b2 : typeof a2 +>a2 : typeof a2 + + +=== tests/cases/compiler/elidingImportNames_main.ts === +export var main = 10; +>main : number + +=== tests/cases/compiler/elidingImportNames_main1.ts === +export var main = 10; +>main : number + diff --git a/tests/baselines/reference/emitThisInSuperMethodCall.errors.txt b/tests/baselines/reference/emitThisInSuperMethodCall.errors.txt index 0df438756cf..7fe090395e3 100644 --- a/tests/baselines/reference/emitThisInSuperMethodCall.errors.txt +++ b/tests/baselines/reference/emitThisInSuperMethodCall.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/emitThisInSuperMethodCall.ts(10,17): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class +tests/cases/compiler/emitThisInSuperMethodCall.ts(17,17): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class +tests/cases/compiler/emitThisInSuperMethodCall.ts(23,13): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class + + ==== tests/cases/compiler/emitThisInSuperMethodCall.ts (3 errors) ==== class User { sayHello() { @@ -10,7 +15,7 @@ function inner() { super.sayHello(); ~~~~~ -!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class +!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class } }; } @@ -19,7 +24,7 @@ () => { super.sayHello(); ~~~~~ -!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class +!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class } } } @@ -27,7 +32,7 @@ function inner() { super.sayHello(); ~~~~~ -!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class +!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class } } } diff --git a/tests/baselines/reference/emptyExpr.js b/tests/baselines/reference/emptyExpr.js index 36fd5ccee19..de3bddeba1e 100644 --- a/tests/baselines/reference/emptyExpr.js +++ b/tests/baselines/reference/emptyExpr.js @@ -2,4 +2,4 @@ [{},] //// [emptyExpr.js] -[{}, ]; +[{},]; diff --git a/tests/baselines/reference/emptyGenericParamList.errors.txt b/tests/baselines/reference/emptyGenericParamList.errors.txt index 841c41be084..361e5a2fc21 100644 --- a/tests/baselines/reference/emptyGenericParamList.errors.txt +++ b/tests/baselines/reference/emptyGenericParamList.errors.txt @@ -1,7 +1,11 @@ +tests/cases/compiler/emptyGenericParamList.ts(2,9): error TS1099: Type argument list cannot be empty. +tests/cases/compiler/emptyGenericParamList.ts(2,8): error TS2314: Generic type 'I' requires 1 type argument(s). + + ==== tests/cases/compiler/emptyGenericParamList.ts (2 errors) ==== class I {} var x: I<>; ~~ -!!! Type argument list cannot be empty. +!!! error TS1099: Type argument list cannot be empty. ~~~ -!!! Generic type 'I' requires 1 type argument(s). \ No newline at end of file +!!! error TS2314: Generic type 'I' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/emptyMemberAccess.errors.txt b/tests/baselines/reference/emptyMemberAccess.errors.txt index 19c24099d94..847e69e4b51 100644 --- a/tests/baselines/reference/emptyMemberAccess.errors.txt +++ b/tests/baselines/reference/emptyMemberAccess.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/emptyMemberAccess.ts(3,5): error TS1109: Expression expected. + + ==== tests/cases/compiler/emptyMemberAccess.ts (1 errors) ==== function getObj() { ().toString(); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. } \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentList.errors.txt b/tests/baselines/reference/emptyTypeArgumentList.errors.txt index e05930401f7..51efea14cb1 100644 --- a/tests/baselines/reference/emptyTypeArgumentList.errors.txt +++ b/tests/baselines/reference/emptyTypeArgumentList.errors.txt @@ -1,7 +1,11 @@ +tests/cases/compiler/emptyTypeArgumentList.ts(2,4): error TS1099: Type argument list cannot be empty. +tests/cases/compiler/emptyTypeArgumentList.ts(2,1): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/emptyTypeArgumentList.ts (2 errors) ==== function foo() { } foo<>(); ~~ -!!! Type argument list cannot be empty. +!!! error TS1099: Type argument list cannot be empty. ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt index aad58ddfdce..538d0abb264 100644 --- a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt +++ b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt @@ -1,7 +1,11 @@ +tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,8): error TS1099: Type argument list cannot be empty. +tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,1): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/emptyTypeArgumentListWithNew.ts (2 errors) ==== class foo { } new foo<>(); ~~ -!!! Type argument list cannot be empty. +!!! error TS1099: Type argument list cannot be empty. ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignability.errors.txt b/tests/baselines/reference/enumAssignability.errors.txt index 3a581b3cd1a..4a060ac3456 100644 --- a/tests/baselines/reference/enumAssignability.errors.txt +++ b/tests/baselines/reference/enumAssignability.errors.txt @@ -1,3 +1,33 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(9,1): error TS2322: Type 'F' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(10,1): error TS2322: Type 'E' is not assignable to type 'F'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(29,9): error TS2322: Type 'E' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(30,9): error TS2322: Type 'E' is not assignable to type 'boolean'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(31,9): error TS2322: Type 'E' is not assignable to type 'Date'. + Property 'toDateString' is missing in type 'Number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(33,9): error TS2322: Type 'E' is not assignable to type 'void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(36,9): error TS2322: Type 'E' is not assignable to type '() => {}'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2322: Type 'E' is not assignable to type 'Function'. + Property 'apply' is missing in type 'Number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(38,9): error TS2322: Type 'E' is not assignable to type '(x: number) => string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2322: Type 'E' is not assignable to type 'C'. + Property 'foo' is missing in type 'Number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2322: Type 'E' is not assignable to type 'I'. + Property 'foo' is missing in type 'Number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(41,9): error TS2322: Type 'E' is not assignable to type 'number[]'. + Property 'length' is missing in type 'Number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. + Property 'foo' is missing in type 'Number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2322: Type 'E' is not assignable to type '(x: T) => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String'. + Property 'charAt' is missing in type 'Number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(47,21): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(48,9): error TS2322: Type 'E' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(49,9): error TS2322: Type 'E' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(50,9): error TS2322: Type 'E' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(51,13): error TS2322: Type 'E' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(52,13): error TS2322: Type 'E' is not assignable to type 'B'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts (21 errors) ==== // enums assignable to number, any, Object, errors unless otherwise noted @@ -9,10 +39,10 @@ e = f; ~ -!!! Type 'F' is not assignable to type 'E'. +!!! error TS2322: Type 'F' is not assignable to type 'E'. f = e; ~ -!!! Type 'E' is not assignable to type 'F'. +!!! error TS2322: Type 'E' is not assignable to type 'F'. e = 1; // ok f = 1; // ok var x: number = e; // ok @@ -33,72 +63,72 @@ var b: number = e; // ok var c: string = e; ~ -!!! Type 'E' is not assignable to type 'string'. +!!! error TS2322: Type 'E' is not assignable to type 'string'. var d: boolean = e; ~ -!!! Type 'E' is not assignable to type 'boolean'. +!!! error TS2322: Type 'E' is not assignable to type 'boolean'. var ee: Date = e; ~~ -!!! Type 'E' is not assignable to type 'Date': -!!! Property 'toDateString' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'Date'. +!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var f: any = e; // ok var g: void = e; ~ -!!! Type 'E' is not assignable to type 'void'. +!!! error TS2322: Type 'E' is not assignable to type 'void'. var h: Object = e; var i: {} = e; var j: () => {} = e; ~ -!!! Type 'E' is not assignable to type '() => {}'. +!!! error TS2322: Type 'E' is not assignable to type '() => {}'. var k: Function = e; ~ -!!! Type 'E' is not assignable to type 'Function': -!!! Property 'apply' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'Function'. +!!! error TS2322: Property 'apply' is missing in type 'Number'. var l: (x: number) => string = e; ~ -!!! Type 'E' is not assignable to type '(x: number) => string'. +!!! error TS2322: Type 'E' is not assignable to type '(x: number) => string'. ac = e; ~~ -!!! Type 'E' is not assignable to type 'C': -!!! Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. ai = e; ~~ -!!! Type 'E' is not assignable to type 'I': -!!! Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'I'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. var m: number[] = e; ~ -!!! Type 'E' is not assignable to type 'number[]': -!!! Property 'length' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'number[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. var n: { foo: string } = e; ~ -!!! Type 'E' is not assignable to type '{ foo: string; }': -!!! Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. var o: (x: T) => T = e; ~ -!!! Type 'E' is not assignable to type '(x: T) => T'. +!!! error TS2322: Type 'E' is not assignable to type '(x: T) => T'. var p: Number = e; var q: String = e; ~ -!!! Type 'E' is not assignable to type 'String': -!!! Property 'charAt' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'String'. +!!! error TS2322: Property 'charAt' is missing in type 'Number'. function foo(x: T, y: U, z: V) { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = e; ~ -!!! Type 'E' is not assignable to type 'T'. +!!! error TS2322: Type 'E' is not assignable to type 'T'. y = e; ~ -!!! Type 'E' is not assignable to type 'U'. +!!! error TS2322: Type 'E' is not assignable to type 'U'. z = e; ~ -!!! Type 'E' is not assignable to type 'V'. +!!! error TS2322: Type 'E' is not assignable to type 'V'. var a: A = e; ~ -!!! Type 'E' is not assignable to type 'A'. +!!! error TS2322: Type 'E' is not assignable to type 'A'. var b: B = e; ~ -!!! Type 'E' is not assignable to type 'B'. +!!! error TS2322: Type 'E' is not assignable to type 'B'. } } \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt b/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt index de9232d72b1..e7c1297e1fd 100644 --- a/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(104,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(109,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts (2 errors) ==== // enum is only a subtype of number, no types are subtypes of enum, all of these except the first are errors @@ -104,11 +108,11 @@ var r4 = foo16(E.A); ~~ -!!! Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. declare function foo17(x: {}): {}; declare function foo17(x: E): E; var r4 = foo16(E.A); ~~ -!!! Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index 7e4c97231e9..3cddaf45966 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,3 +1,12 @@ +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'. + Property 'D' is missing in type 'Number'. +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'. + Property 'a' is missing in type 'Number'. +tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. + + ==== tests/cases/compiler/enumAssignmentCompat.ts (5 errors) ==== module W { export class D { } @@ -26,24 +35,24 @@ var y: typeof W = W; var z: number = W; // error ~ -!!! Type 'typeof W' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof W' is not assignable to type 'number'. var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! Type 'W' is not assignable to type 'typeof W': -!!! Property 'D' is missing in type 'Number'. +!!! error TS2322: Type 'W' is not assignable to type 'typeof W'. +!!! error TS2322: Property 'D' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ -!!! Type 'number' is not assignable to type 'typeof W'. +!!! error TS2322: Type 'number' is not assignable to type 'typeof W'. var e: typeof W.a = 4; var f: WStatic = W.a; // error ~ -!!! Type 'W' is not assignable to type 'WStatic': -!!! Property 'a' is missing in type 'Number'. +!!! error TS2322: Type 'W' is not assignable to type 'WStatic'. +!!! error TS2322: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ -!!! Type 'number' is not assignable to type 'WStatic'. +!!! error TS2322: Type 'number' 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 62d4ef0d04f..d87d6acf6a0 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,3 +1,12 @@ +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'. + Property 'a' is missing in type 'Number'. +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'. + Property 'a' is missing in type 'Number'. +tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. + + ==== tests/cases/compiler/enumAssignmentCompat2.ts (5 errors) ==== enum W { @@ -25,24 +34,24 @@ var y: typeof W = W; var z: number = W; // error ~ -!!! Type 'typeof W' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof W' is not assignable to type 'number'. var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! Type 'W' is not assignable to type 'typeof W': -!!! Property 'a' is missing in type 'Number'. +!!! error TS2322: Type 'W' is not assignable to type 'typeof W'. +!!! error TS2322: Property 'a' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ -!!! Type 'number' is not assignable to type 'typeof W'. +!!! error TS2322: Type 'number' is not assignable to type 'typeof W'. var e: typeof W.a = 4; var f: WStatic = W.a; // error ~ -!!! Type 'W' is not assignable to type 'WStatic': -!!! Property 'a' is missing in type 'Number'. +!!! error TS2322: Type 'W' is not assignable to type 'WStatic'. +!!! error TS2322: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ -!!! Type 'number' is not assignable to type 'WStatic'. +!!! error TS2322: Type 'number' is not assignable to type 'WStatic'. var h: W = 3; var i: W = W.a; i = W.a; diff --git a/tests/baselines/reference/enumBasics.types b/tests/baselines/reference/enumBasics.types index f775295891a..c0d7fb9bed1 100644 --- a/tests/baselines/reference/enumBasics.types +++ b/tests/baselines/reference/enumBasics.types @@ -157,8 +157,8 @@ enum E9 { // (refer to .js to validate) // Enum constant members are propagated var doNotPropagate = [ ->doNotPropagate : {}[] ->[ E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z] : {}[] +>doNotPropagate : (E3 | E4 | E7 | E8)[] +>[ E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z] : (E3 | E4 | E7 | E8)[] E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z >E8.B : E8 @@ -183,8 +183,8 @@ var doNotPropagate = [ ]; // Enum computed members are not propagated var doPropagate = [ ->doPropagate : {}[] ->[ E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C] : {}[] +>doPropagate : (E5 | E6 | E9)[] +>[ E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C] : (E5 | E6 | E9)[] E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C >E9.A : E9 diff --git a/tests/baselines/reference/enumBasics1.errors.txt b/tests/baselines/reference/enumBasics1.errors.txt index 6d9229341e2..fddca60bd99 100644 --- a/tests/baselines/reference/enumBasics1.errors.txt +++ b/tests/baselines/reference/enumBasics1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/enumBasics1.ts(26,5): error TS2339: Property 'A' does not exist on type 'E'. +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. + + ==== tests/cases/compiler/enumBasics1.ts (2 errors) ==== enum E { A = 1, @@ -26,7 +30,7 @@ */ E.A.A; // should error ~ -!!! Property 'A' does not exist on type 'E'. +!!! error TS2339: Property 'A' does not exist on type 'E'. enum E2 { @@ -37,6 +41,6 @@ enum E2 { // should error for continued autonumbering C, ~ -!!! In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +!!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. D, } \ No newline at end of file diff --git a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt index 7fb893354a9..e6859558f74 100644 --- a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt +++ b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt @@ -1,11 +1,15 @@ +tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,29): error TS1003: Identifier expected. +tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'. + + ==== tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts (2 errors) ==== enum Position { IgnoreRulesSpecific = 0, } var x = IgnoreRulesSpecific. + +!!! error TS1003: Identifier expected. ~~~~~~~~~~~~~~~~~~~ -!!! Cannot find name 'IgnoreRulesSpecific'. +!!! error TS2304: Cannot find name 'IgnoreRulesSpecific'. var y = Position.IgnoreRulesSpecific; - ~ -!!! ',' expected. \ No newline at end of file diff --git a/tests/baselines/reference/enumConstantMembers.errors.txt b/tests/baselines/reference/enumConstantMembers.errors.txt index ac77e2b7b4e..d425b7a6f4b 100644 --- a/tests/baselines/reference/enumConstantMembers.errors.txt +++ b/tests/baselines/reference/enumConstantMembers.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/enums/enumConstantMembers.ts(12,5): error TS1061: Enum member must have initializer. +tests/cases/conformance/enums/enumConstantMembers.ts(18,5): error TS1066: Ambient enum elements can only have integer literal initializers. + + ==== tests/cases/conformance/enums/enumConstantMembers.ts (2 errors) ==== // Constant members allow negatives, but not decimals. Also hex literals are allowed enum E1 { @@ -12,7 +16,7 @@ a = 0.1, b // Error because 0.1 is not a constant ~ -!!! Enum member must have initializer. +!!! error TS1061: Enum member must have initializer. } declare enum E4 { @@ -20,5 +24,5 @@ b = -1, c = 0.1 // Not a constant ~ -!!! Ambient enum elements can only have integer literal initializers. +!!! error TS1066: Ambient enum elements can only have integer literal initializers. } \ No newline at end of file diff --git a/tests/baselines/reference/enumErrors.errors.txt b/tests/baselines/reference/enumErrors.errors.txt index 69993d81099..ca13ceba4ae 100644 --- a/tests/baselines/reference/enumErrors.errors.txt +++ b/tests/baselines/reference/enumErrors.errors.txt @@ -1,23 +1,36 @@ +tests/cases/conformance/enums/enumErrors.ts(2,6): error TS2431: Enum name cannot be 'any' +tests/cases/conformance/enums/enumErrors.ts(3,6): error TS2431: Enum name cannot be 'number' +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(20,9): error TS2322: Type 'E9' is not assignable to type 'E10'. +tests/cases/conformance/enums/enumErrors.ts(21,9): error TS2322: Type 'E9' is not assignable to type 'E10'. +tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type 'string' 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'. + + ==== tests/cases/conformance/enums/enumErrors.ts (11 errors) ==== // Enum named with PredefinedTypes enum any { } ~~~ -!!! Enum name cannot be 'any' +!!! error TS2431: Enum name cannot be 'any' enum number { } ~~~~~~ -!!! Enum name cannot be 'number' +!!! error TS2431: Enum name cannot be 'number' enum string { } ~~~~~~ -!!! Enum name cannot be 'string' +!!! error TS2431: Enum name cannot be 'string' enum boolean { } ~~~~~~~ -!!! Enum name cannot be 'boolean' +!!! error TS2431: Enum name cannot be 'boolean' // Enum with computed member initializer of type Number enum E5 { C = new Number(30) ~~~~~~~~~~~~~~ -!!! Type 'Number' is not assignable to type 'E5'. +!!! error TS2322: Type 'Number' is not assignable to type 'E5'. } enum E9 { @@ -30,25 +43,25 @@ enum E10 { A = E9.A, ~~~~ -!!! Type 'E9' is not assignable to type 'E10'. +!!! error TS2322: Type 'E9' is not assignable to type 'E10'. B = E9.B ~~~~ -!!! Type 'E9' is not assignable to type 'E10'. +!!! error TS2322: Type 'E9' is not assignable to type 'E10'. } // Enum with computed member intializer of other types enum E11 { A = '', ~~ -!!! Type 'string' is not assignable to type 'E11'. +!!! error TS2322: Type 'string' is not assignable to type 'E11'. B = new Date(), ~~~~~~~~~~ -!!! Type 'Date' is not assignable to type 'E11'. +!!! error TS2322: Type 'Date' is not assignable to type 'E11'. C = window, ~~~~~~ -!!! Cannot find name 'window'. +!!! error TS2304: Cannot find name 'window'. D = {} ~~ -!!! Type '{}' is not assignable to type 'E11'. +!!! error TS2322: Type '{}' is not assignable to type 'E11'. } \ No newline at end of file diff --git a/tests/baselines/reference/enumGenericTypeClash.errors.txt b/tests/baselines/reference/enumGenericTypeClash.errors.txt index df7f1d77ed0..23007175e4c 100644 --- a/tests/baselines/reference/enumGenericTypeClash.errors.txt +++ b/tests/baselines/reference/enumGenericTypeClash.errors.txt @@ -1,6 +1,12 @@ -==== tests/cases/compiler/enumGenericTypeClash.ts (1 errors) ==== +tests/cases/compiler/enumGenericTypeClash.ts(1,7): error TS2300: Duplicate identifier 'X'. +tests/cases/compiler/enumGenericTypeClash.ts(2,6): error TS2300: Duplicate identifier 'X'. + + +==== tests/cases/compiler/enumGenericTypeClash.ts (2 errors) ==== class X { } + ~ +!!! error TS2300: Duplicate identifier 'X'. enum X { MyVal } ~ -!!! Duplicate identifier 'X'. +!!! error TS2300: Duplicate identifier 'X'. \ No newline at end of file diff --git a/tests/baselines/reference/enumIdenticalIdentifierValues.errors.txt b/tests/baselines/reference/enumIdenticalIdentifierValues.errors.txt deleted file mode 100644 index 0ddd45d5ed9..00000000000 --- a/tests/baselines/reference/enumIdenticalIdentifierValues.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/compiler/enumIdenticalIdentifierValues.ts (1 errors) ==== - enum Enum { - 1, - 1.0 - ~~~ -!!! Duplicate identifier '1.0'. - } \ No newline at end of file diff --git a/tests/baselines/reference/enumIdenticalIdentifierValues.js b/tests/baselines/reference/enumIdenticalIdentifierValues.js deleted file mode 100644 index 3f435ac6537..00000000000 --- a/tests/baselines/reference/enumIdenticalIdentifierValues.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [enumIdenticalIdentifierValues.ts] -enum Enum { - 1, - 1.0 -} - -//// [enumIdenticalIdentifierValues.js] -var Enum; -(function (Enum) { - Enum[Enum["1"] = 0] = "1"; - Enum[Enum["1"] = 1] = "1"; -})(Enum || (Enum = {})); diff --git a/tests/baselines/reference/enumIdentifierLiterals.errors.txt b/tests/baselines/reference/enumIdentifierLiterals.errors.txt new file mode 100644 index 00000000000..dbf8734ea73 --- /dev/null +++ b/tests/baselines/reference/enumIdentifierLiterals.errors.txt @@ -0,0 +1,22 @@ +tests/cases/compiler/enumIdentifierLiterals.ts(2,5): error TS2452: An enum member cannot have a numeric name. +tests/cases/compiler/enumIdentifierLiterals.ts(3,5): error TS2452: An enum member cannot have a numeric name. +tests/cases/compiler/enumIdentifierLiterals.ts(4,5): error TS2452: An enum member cannot have a numeric name. +tests/cases/compiler/enumIdentifierLiterals.ts(6,5): error TS2452: An enum member cannot have a numeric name. + + +==== tests/cases/compiler/enumIdentifierLiterals.ts (4 errors) ==== + enum Nums { + 1.0, + ~~~ +!!! error TS2452: An enum member cannot have a numeric name. + 11e-1, + ~~~~~ +!!! error TS2452: An enum member cannot have a numeric name. + 0.12e1, + ~~~~~~ +!!! error TS2452: An enum member cannot have a numeric name. + "13e-1", + 0xF00D + ~~~~~~ +!!! error TS2452: An enum member cannot have a numeric name. + } \ No newline at end of file diff --git a/tests/baselines/reference/enumIdentifierLiterals.types b/tests/baselines/reference/enumIdentifierLiterals.types deleted file mode 100644 index b259e57d1dd..00000000000 --- a/tests/baselines/reference/enumIdentifierLiterals.types +++ /dev/null @@ -1,10 +0,0 @@ -=== tests/cases/compiler/enumIdentifierLiterals.ts === -enum Nums { ->Nums : Nums - - 1.0, - 11e-1, - 0.12e1, - "13e-1", - 0xF00D -} diff --git a/tests/baselines/reference/enumInitializersWithExponents.errors.txt b/tests/baselines/reference/enumInitializersWithExponents.errors.txt index 60649475f78..c4338cdf78b 100644 --- a/tests/baselines/reference/enumInitializersWithExponents.errors.txt +++ b/tests/baselines/reference/enumInitializersWithExponents.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/enumInitializersWithExponents.ts(5,5): error TS1066: Ambient enum elements can only have integer literal initializers. +tests/cases/compiler/enumInitializersWithExponents.ts(6,5): error TS1066: Ambient enum elements can only have integer literal initializers. + + ==== tests/cases/compiler/enumInitializersWithExponents.ts (2 errors) ==== // Must be integer literals. declare enum E { @@ -5,10 +9,10 @@ b = 1e25, // ok c = 1e-3, // error ~ -!!! Ambient enum elements can only have integer literal initializers. +!!! error TS1066: Ambient enum elements can only have integer literal initializers. d = 1e-9, // error ~ -!!! Ambient enum elements can only have integer literal initializers. +!!! error TS1066: Ambient enum elements can only have integer literal initializers. e = 1e0, // ok f = 1e+25 // ok } \ No newline at end of file diff --git a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt index 28798c1e476..e5c341b34df 100644 --- a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt +++ b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt @@ -1,3 +1,22 @@ +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(18,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'string'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(24,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'boolean'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(30,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'Date'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(36,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'RegExp'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(42,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type '{ bar: number; }'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(48,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'number[]'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(54,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'I8'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(60,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'A'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(66,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'A2'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(72,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type '(x: any) => number'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(78,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type '(x: T) => T'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(85,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'E2'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(95,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'typeof f'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(105,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'typeof c'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(111,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'T'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(115,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(117,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'U'. + + ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts (17 errors) ==== // enums are only subtypes of number, any and no other types @@ -18,7 +37,7 @@ [x: string]: string; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'string'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'string'. } @@ -26,7 +45,7 @@ [x: string]: boolean; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'boolean'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'boolean'. } @@ -34,7 +53,7 @@ [x: string]: Date; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'Date'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'Date'. } @@ -42,7 +61,7 @@ [x: string]: RegExp; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'RegExp'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'RegExp'. } @@ -50,7 +69,7 @@ [x: string]: { bar: number }; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type '{ bar: number; }'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type '{ bar: number; }'. } @@ -58,7 +77,7 @@ [x: string]: number[]; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'number[]'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'number[]'. } @@ -66,7 +85,7 @@ [x: string]: I8; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'I8'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'I8'. } class A { foo: number; } @@ -74,7 +93,7 @@ [x: string]: A; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'A'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'A'. } class A2 { foo: T; } @@ -82,7 +101,7 @@ [x: string]: A2; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'A2'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'A2'. } @@ -90,7 +109,7 @@ [x: string]: (x) => number; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type '(x: any) => number'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type '(x: any) => number'. } @@ -98,7 +117,7 @@ [x: string]: (x: T) => T; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type '(x: T) => T'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type '(x: T) => T'. } @@ -107,7 +126,7 @@ [x: string]: E2; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'E2'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'E2'. } @@ -119,7 +138,7 @@ [x: string]: typeof f; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'typeof f'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'typeof f'. } @@ -131,7 +150,7 @@ [x: string]: typeof c; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'typeof c'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'typeof c'. } @@ -139,17 +158,17 @@ [x: string]: T; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'T'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'T'. } interface I18 { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: E; ~~~~~~~ -!!! Property 'foo' of type 'E' is not assignable to string index type 'U'. +!!! error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'U'. } diff --git a/tests/baselines/reference/enumMemberResolution.errors.txt b/tests/baselines/reference/enumMemberResolution.errors.txt index 71f6f8e45b5..f446c0d7909 100644 --- a/tests/baselines/reference/enumMemberResolution.errors.txt +++ b/tests/baselines/reference/enumMemberResolution.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/enumMemberResolution.ts(4,29): error TS1003: Identifier expected. +tests/cases/compiler/enumMemberResolution.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'. + + ==== tests/cases/compiler/enumMemberResolution.ts (2 errors) ==== enum Position2 { IgnoreRulesSpecific = 0 } var x = IgnoreRulesSpecific. // error + +!!! error TS1003: Identifier expected. ~~~~~~~~~~~~~~~~~~~ -!!! Cannot find name 'IgnoreRulesSpecific'. +!!! error TS2304: Cannot find name 'IgnoreRulesSpecific'. var y = 1; - ~ -!!! ',' expected. var z = Position2.IgnoreRulesSpecific; // no error \ No newline at end of file diff --git a/tests/baselines/reference/enumMergingErrors.errors.txt b/tests/baselines/reference/enumMergingErrors.errors.txt index 30cf6ef18cd..08f8d3a2716 100644 --- a/tests/baselines/reference/enumMergingErrors.errors.txt +++ b/tests/baselines/reference/enumMergingErrors.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/enums/enumMergingErrors.ts(26,22): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +tests/cases/conformance/enums/enumMergingErrors.ts(38,22): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. + + ==== tests/cases/conformance/enums/enumMergingErrors.ts (2 errors) ==== // Enum with constant, computed, constant members split across 3 declarations with the same root module module M { @@ -26,7 +30,7 @@ module M1 { export enum E1 { C } ~ -!!! In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +!!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. } @@ -40,7 +44,7 @@ module M2 { export enum E1 { C } ~ -!!! In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +!!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. } diff --git a/tests/baselines/reference/enumPropertyAccess.errors.txt b/tests/baselines/reference/enumPropertyAccess.errors.txt index 6a9886c0968..666e9297120 100644 --- a/tests/baselines/reference/enumPropertyAccess.errors.txt +++ b/tests/baselines/reference/enumPropertyAccess.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/enumPropertyAccess.ts(7,11): error TS2339: Property 'Green' does not exist on type 'Colors'. +tests/cases/compiler/enumPropertyAccess.ts(12,7): error TS2339: Property 'Green' does not exist on type 'B'. + + ==== tests/cases/compiler/enumPropertyAccess.ts (2 errors) ==== enum Colors { Red, @@ -7,13 +11,13 @@ var x = Colors.Red; // type of 'x' should be 'Colors' var p = x.Green; // error ~~~~~ -!!! Property 'Green' does not exist on type 'Colors'. +!!! error TS2339: Property 'Green' does not exist on type 'Colors'. x.toFixed(); // ok // Now with generics function fill(f: B) { f.Green; // error ~~~~~ -!!! Property 'Green' does not exist on type 'B'. +!!! error TS2339: Property 'Green' does not exist on type 'B'. f.toFixed(); // ok } \ No newline at end of file diff --git a/tests/baselines/reference/enumWithParenthesizedInitializer1.errors.txt b/tests/baselines/reference/enumWithParenthesizedInitializer1.errors.txt index 9279067d7fa..b1dca1d501e 100644 --- a/tests/baselines/reference/enumWithParenthesizedInitializer1.errors.txt +++ b/tests/baselines/reference/enumWithParenthesizedInitializer1.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/enumWithParenthesizedInitializer1.ts(3,1): error TS1005: ')' expected. + + ==== tests/cases/compiler/enumWithParenthesizedInitializer1.ts (1 errors) ==== enum E { e = -(3 } ~ -!!! ')' expected. \ No newline at end of file +!!! error TS1005: ')' expected. \ No newline at end of file diff --git a/tests/baselines/reference/enumWithPrimitiveName.errors.txt b/tests/baselines/reference/enumWithPrimitiveName.errors.txt index 6274cdcd43d..403c0855ebb 100644 --- a/tests/baselines/reference/enumWithPrimitiveName.errors.txt +++ b/tests/baselines/reference/enumWithPrimitiveName.errors.txt @@ -1,10 +1,15 @@ +tests/cases/compiler/enumWithPrimitiveName.ts(1,6): error TS2431: Enum name cannot be 'string' +tests/cases/compiler/enumWithPrimitiveName.ts(2,6): error TS2431: Enum name cannot be 'number' +tests/cases/compiler/enumWithPrimitiveName.ts(3,6): error TS2431: Enum name cannot be 'any' + + ==== tests/cases/compiler/enumWithPrimitiveName.ts (3 errors) ==== enum string { } ~~~~~~ -!!! Enum name cannot be 'string' +!!! error TS2431: Enum name cannot be 'string' enum number { } ~~~~~~ -!!! Enum name cannot be 'number' +!!! error TS2431: Enum name cannot be 'number' enum any { } ~~~ -!!! Enum name cannot be 'any' \ No newline at end of file +!!! error TS2431: Enum name cannot be 'any' \ No newline at end of file diff --git a/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.errors.txt b/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.errors.txt index 571bb6906e5..876c04a0322 100644 --- a/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.errors.txt +++ b/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/enumWithoutInitializerAfterComputedMember.ts(4,5): error TS1061: Enum member must have initializer. + + ==== tests/cases/compiler/enumWithoutInitializerAfterComputedMember.ts (1 errors) ==== enum E { a, b = a, c ~ -!!! Enum member must have initializer. +!!! error TS1061: Enum member must have initializer. } \ No newline at end of file diff --git a/tests/baselines/reference/enumsWithMultipleDeclarations1.errors.txt b/tests/baselines/reference/enumsWithMultipleDeclarations1.errors.txt index d2336e905c5..7c90dc4eda5 100644 --- a/tests/baselines/reference/enumsWithMultipleDeclarations1.errors.txt +++ b/tests/baselines/reference/enumsWithMultipleDeclarations1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/enumsWithMultipleDeclarations1.ts(6,3): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +tests/cases/compiler/enumsWithMultipleDeclarations1.ts(10,3): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. + + ==== tests/cases/compiler/enumsWithMultipleDeclarations1.ts (2 errors) ==== enum E { A @@ -6,11 +10,11 @@ enum E { B ~ -!!! In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +!!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. } enum E { C ~ -!!! In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +!!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. } \ No newline at end of file diff --git a/tests/baselines/reference/enumsWithMultipleDeclarations2.errors.txt b/tests/baselines/reference/enumsWithMultipleDeclarations2.errors.txt index ef7040dd946..c072809b5cb 100644 --- a/tests/baselines/reference/enumsWithMultipleDeclarations2.errors.txt +++ b/tests/baselines/reference/enumsWithMultipleDeclarations2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/enumsWithMultipleDeclarations2.ts(10,3): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. + + ==== tests/cases/compiler/enumsWithMultipleDeclarations2.ts (1 errors) ==== enum E { A @@ -10,5 +13,5 @@ enum E { C ~ -!!! In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +!!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. } \ No newline at end of file diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.errors.txt b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.errors.txt index 4a94b22ee76..f0976ba7398 100644 --- a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.errors.txt +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/errorForwardReferenceForwadingConstructor.ts(4,14): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/errorForwardReferenceForwadingConstructor.ts (1 errors) ==== // Error forward referencing derived class with forwarding constructor function f() { var d1 = new derived(); ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var d2 = new derived(4); } diff --git a/tests/baselines/reference/errorHandlingInInstanceOf.errors.txt b/tests/baselines/reference/errorHandlingInInstanceOf.errors.txt new file mode 100644 index 00000000000..e4db287fcdd --- /dev/null +++ b/tests/baselines/reference/errorHandlingInInstanceOf.errors.txt @@ -0,0 +1,15 @@ +tests/cases/compiler/errorHandlingInInstanceOf.ts(1,5): error TS2304: Cannot find name 'x'. +tests/cases/compiler/errorHandlingInInstanceOf.ts(5,18): error TS2304: Cannot find name 'UnknownType'. + + +==== tests/cases/compiler/errorHandlingInInstanceOf.ts (2 errors) ==== + if (x instanceof String) { + ~ +!!! error TS2304: Cannot find name 'x'. + } + + var y: any; + if (y instanceof UnknownType) { + ~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'UnknownType'. + } \ No newline at end of file diff --git a/tests/baselines/reference/errorHandlingInInstanceOf.js b/tests/baselines/reference/errorHandlingInInstanceOf.js new file mode 100644 index 00000000000..b98e2bf8a77 --- /dev/null +++ b/tests/baselines/reference/errorHandlingInInstanceOf.js @@ -0,0 +1,14 @@ +//// [errorHandlingInInstanceOf.ts] +if (x instanceof String) { +} + +var y: any; +if (y instanceof UnknownType) { +} + +//// [errorHandlingInInstanceOf.js] +if (x instanceof String) { +} +var y; +if (y instanceof UnknownType) { +} diff --git a/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt b/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt index a015fc902ab..f385d0afcb3 100644 --- a/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt +++ b/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/errorLocationForInterfaceExtension.ts(3,21): error TS2304: Cannot find name 'string'. + + ==== tests/cases/compiler/errorLocationForInterfaceExtension.ts (1 errors) ==== var n = ''; interface x extends string { } ~~~~~~ -!!! Cannot find name 'string'. +!!! error TS2304: Cannot find name 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt b/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt index 9b19634265d..04b80fb1104 100644 --- a/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt +++ b/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/errorMessageOnObjectLiteralType.ts(5,3): error TS2339: Property 'getOwnPropertyNamess' does not exist on type '{ a: string; b: number; }'. +tests/cases/compiler/errorMessageOnObjectLiteralType.ts(6,8): error TS2339: Property 'getOwnPropertyNamess' does not exist on type '{ (): any; (value: any): any; new (value?: any): Object; prototype: Object; getPrototypeOf(o: any): any; getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: any): any; freeze(o: any): any; preventExtensions(o: any): any; isSealed(o: any): boolean; isFrozen(o: any): boolean; isExtensible(o: any): boolean; keys(o: any): string[]; }'. + + ==== tests/cases/compiler/errorMessageOnObjectLiteralType.ts (2 errors) ==== var x: { a: string; @@ -5,7 +9,7 @@ }; x.getOwnPropertyNamess(); ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'getOwnPropertyNamess' does not exist on type '{ a: string; b: number; }'. +!!! error TS2339: Property 'getOwnPropertyNamess' does not exist on type '{ a: string; b: number; }'. Object.getOwnPropertyNamess(null); ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'getOwnPropertyNamess' does not exist on type '{ (): any; (value: any): any; new (value?: any): Object; prototype: Object; getPrototypeOf(o: any): any; getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: any): any; freeze(o: any): any; preventExtensions(o: any): any; isSealed(o: any): boolean; isFrozen(o: any): boolean; isExtensible(o: any): boolean; keys(o: any): string[]; }'. \ No newline at end of file +!!! error TS2339: Property 'getOwnPropertyNamess' does not exist on type '{ (): any; (value: any): any; new (value?: any): Object; prototype: Object; getPrototypeOf(o: any): any; getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: any): any; freeze(o: any): any; preventExtensions(o: any): any; isSealed(o: any): boolean; isFrozen(o: any): boolean; isExtensible(o: any): boolean; keys(o: any): string[]; }'. \ No newline at end of file diff --git a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt index 414fa7dc4c2..5b66a377307 100644 --- a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt @@ -1,9 +1,14 @@ +tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean'. + Type 'void' is not assignable to type 'boolean'. +tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + + ==== tests/cases/compiler/errorOnContextuallyTypedReturnType.ts (2 errors) ==== var n1: () => boolean = function () { }; // expect an error here ~~ -!!! Type '() => void' is not assignable to type '() => boolean': -!!! Type 'void' is not assignable to type 'boolean'. +!!! error TS2322: Type '() => void' is not assignable to type '() => boolean'. +!!! error TS2322: Type 'void' is not assignable to type 'boolean'. var n2: () => boolean = function ():boolean { }; // expect an error here ~~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. \ No newline at end of file diff --git a/tests/baselines/reference/errorSuperCalls.errors.txt b/tests/baselines/reference/errorSuperCalls.errors.txt index 7e85cc07ee7..82c0a4e8279 100644 --- a/tests/baselines/reference/errorSuperCalls.errors.txt +++ b/tests/baselines/reference/errorSuperCalls.errors.txt @@ -1,68 +1,76 @@ -==== tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts (20 errors) ==== +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,14): error TS1034: 'super' must be followed by an argument list or member access. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(4,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(9,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(14,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(18,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(22,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(26,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(30,16): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(34,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(38,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(58,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(62,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(67,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(71,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors + + +==== tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts (14 errors) ==== //super call in class constructor with no base type class NoBase { constructor() { super(); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } //super call in class member function with no base type fn() { super(); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } //super call in class accessor (get and set) with no base type get foo() { - ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. return null; } set foo(v) { - ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } //super call in class member initializer with no base type p = super(); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. //super call in static class member function with no base type static fn() { super(); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } //super call in static class member initializer with no base type static k = super(); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. //super call in static class accessor (get and set) with no base type static get q() { - ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. return null; } static set q(n) { - ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } } @@ -72,7 +80,7 @@ constructor() { super(); ~ -!!! 'super' must be followed by an argument list or member access. +!!! error TS1034: 'super' must be followed by an argument list or member access. super(); } } @@ -86,30 +94,26 @@ //super call in class member initializer of derived type t = super(); ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors fn() { //super call in class member function of derived type super(); ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } //super call in class accessor (get and set) of derived type get foo() { - ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors return null; } set foo(n) { - ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } } \ No newline at end of file diff --git a/tests/baselines/reference/errorSuperPropertyAccess.errors.txt b/tests/baselines/reference/errorSuperPropertyAccess.errors.txt index 9833e64eba5..e192e99b87f 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.errors.txt +++ b/tests/baselines/reference/errorSuperPropertyAccess.errors.txt @@ -1,3 +1,43 @@ +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(24,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(29,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(64,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(68,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(94,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(98,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(113,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(119,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(6,17): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(7,17): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(11,17): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(12,17): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(15,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(16,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(21,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(25,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(30,9): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(57,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(61,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(65,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(69,19): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(73,13): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(76,40): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(87,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(91,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(95,23): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(99,19): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(109,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(110,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(111,9): error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(114,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(115,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(116,9): error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(120,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(121,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(122,9): error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(127,16): error TS2335: 'super' can only be referenced in a derived class. +tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts(127,30): error TS2335: 'super' can only be referenced in a derived class. + + ==== tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts (38 errors) ==== //super property access in constructor of class with no base type //super property access in instance member function of class with no base type @@ -6,51 +46,51 @@ constructor() { var a = super.prototype; ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. var b = super.hasOwnProperty(''); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } fn() { var a = super.prototype; ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. var b = super.hasOwnProperty(''); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } m = super.prototype; ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. n = super.hasOwnProperty(''); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. //super static property access in static member function of class with no base type //super static property access in static member accessor(get and set) of class with no base type public static static1() { super.hasOwnProperty(''); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } public static get static2() { ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super.hasOwnProperty(''); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. return ''; } public static set static2(n) { ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super.hasOwnProperty(''); ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. } } @@ -79,40 +119,40 @@ super(); super.publicMember = 1; ~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword } fn() { var x = super.publicMember; ~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword } get a() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x = super.publicMember; ~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword return undefined; } set a(n) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. n = super.publicMember; ~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword } fn2() { function inner() { super.publicFunc(); ~~~~~ -!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class +!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class } var x = { test: function () { return super.publicFunc(); } ~~~~~ -!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class +!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class } } } @@ -125,29 +165,29 @@ super(); super.privateMember = 1; ~~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword } fn() { var x = super.privateMember; ~~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword } get a() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x = super.privateMember; ~~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword return undefined; } set a(n) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. n = super.privateMember; ~~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword } } @@ -159,47 +199,47 @@ static fn() { super.publicStaticMember = 3; ~~~~~~~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword super.privateStaticMember = 3; ~~~~~~~~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword super.privateStaticFunc(); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Property 'SomeBase.privateStaticFunc' is inaccessible. +!!! error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'. } static get a() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super.publicStaticMember = 3; ~~~~~~~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword super.privateStaticMember = 3; ~~~~~~~~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword super.privateStaticFunc(); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Property 'SomeBase.privateStaticFunc' is inaccessible. +!!! error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'. return ''; } static set a(n) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super.publicStaticMember = 3; ~~~~~~~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword super.privateStaticMember = 3; ~~~~~~~~~~~~~~~~~~~ -!!! Only public methods of the base class are accessible via the 'super' keyword +!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword super.privateStaticFunc(); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Property 'SomeBase.privateStaticFunc' is inaccessible. +!!! error TS2341: Property 'privateStaticFunc' is private and only accessible within class 'SomeBase'. } } // In object literal var obj = { n: super.wat, p: super.foo() }; ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. ~~~~~ -!!! 'super' can only be referenced in a derived class. +!!! error TS2335: 'super' can only be referenced in a derived class. \ No newline at end of file diff --git a/tests/baselines/reference/errorSupression1.errors.txt b/tests/baselines/reference/errorSupression1.errors.txt index f702ea6e643..206a78ebf45 100644 --- a/tests/baselines/reference/errorSupression1.errors.txt +++ b/tests/baselines/reference/errorSupression1.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/errorSupression1.ts(4,15): error TS2339: Property 'b' does not exist on type 'typeof Foo'. + + ==== tests/cases/compiler/errorSupression1.ts (1 errors) ==== class Foo { static bar() { return "x"; } } var baz = Foo.b; ~ -!!! Property 'b' does not exist on type 'typeof Foo'. +!!! error TS2339: Property 'b' does not exist on type 'typeof Foo'. // Foo.b won't bind. baz.concat("y"); diff --git a/tests/baselines/reference/errorTypesAsTypeArguments.errors.txt b/tests/baselines/reference/errorTypesAsTypeArguments.errors.txt index 90c3f43dc4e..44f95ca29e6 100644 --- a/tests/baselines/reference/errorTypesAsTypeArguments.errors.txt +++ b/tests/baselines/reference/errorTypesAsTypeArguments.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/errorTypesAsTypeArguments.ts(2,16): error TS2304: Cannot find name 'B'. +tests/cases/compiler/errorTypesAsTypeArguments.ts(2,25): error TS2304: Cannot find name 'C'. + + ==== tests/cases/compiler/errorTypesAsTypeArguments.ts (2 errors) ==== interface Foo { bar(baz: Foo): Foo; ~ -!!! Cannot find name 'B'. +!!! error TS2304: Cannot find name 'B'. ~ -!!! Cannot find name 'C'. +!!! error TS2304: Cannot find name 'C'. } \ No newline at end of file diff --git a/tests/baselines/reference/errorWithTruncatedType.errors.txt b/tests/baselines/reference/errorWithTruncatedType.errors.txt new file mode 100644 index 00000000000..f073f7c50a4 --- /dev/null +++ b/tests/baselines/reference/errorWithTruncatedType.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/errorWithTruncatedType.ts(11,5): error TS2322: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. + + +==== tests/cases/compiler/errorWithTruncatedType.ts (1 errors) ==== + + var x: { + propertyWithAnExceedinglyLongName1: string; + propertyWithAnExceedinglyLongName2: string; + propertyWithAnExceedinglyLongName3: string; + propertyWithAnExceedinglyLongName4: string; + propertyWithAnExceedinglyLongName5: string; + }; + + // String representation of type of 'x' should be truncated in error message + var s: string = x; + ~ +!!! error TS2322: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. + \ No newline at end of file diff --git a/tests/baselines/reference/errorWithTruncatedType.js b/tests/baselines/reference/errorWithTruncatedType.js new file mode 100644 index 00000000000..5fd45579a29 --- /dev/null +++ b/tests/baselines/reference/errorWithTruncatedType.js @@ -0,0 +1,18 @@ +//// [errorWithTruncatedType.ts] + +var x: { + propertyWithAnExceedinglyLongName1: string; + propertyWithAnExceedinglyLongName2: string; + propertyWithAnExceedinglyLongName3: string; + propertyWithAnExceedinglyLongName4: string; + propertyWithAnExceedinglyLongName5: string; +}; + +// String representation of type of 'x' should be truncated in error message +var s: string = x; + + +//// [errorWithTruncatedType.js] +var x; +// String representation of type of 'x' should be truncated in error message +var s = x; diff --git a/tests/baselines/reference/errorsInGenericTypeReference.errors.txt b/tests/baselines/reference/errorsInGenericTypeReference.errors.txt index 0dc6b5a0ab0..dcb5018f035 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.errors.txt +++ b/tests/baselines/reference/errorsInGenericTypeReference.errors.txt @@ -1,3 +1,27 @@ +tests/cases/compiler/errorsInGenericTypeReference.ts(25,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/errorsInGenericTypeReference.ts(12,17): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(18,31): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(23,29): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(24,36): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(25,27): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(26,24): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(31,36): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(35,36): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(39,17): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(43,33): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(45,41): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(48,27): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(52,25): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(57,35): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(61,39): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(66,22): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(66,38): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(67,27): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(68,24): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(68,40): error TS2304: Cannot find name 'V'. +tests/cases/compiler/errorsInGenericTypeReference.ts(69,24): error TS2304: Cannot find name 'V'. + + ==== tests/cases/compiler/errorsInGenericTypeReference.ts (22 errors) ==== interface IFoo { } @@ -12,7 +36,7 @@ var tc1 = new testClass1(); tc1.method<{ x: V }>(); // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. // in constructor type arguments @@ -20,98 +44,98 @@ } var tc2 = new testClass2<{ x: V }>(); // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. // in method return type annotation class testClass3 { testMethod1(): Foo<{ x: V }> { return null; } // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. static testMethod2(): Foo<{ x: V }> { return null } // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. set a(value: Foo<{ x: V }>) { } // error: could not find symbol V ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. property: Foo<{ x: V }>; // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. } // in function return type annotation function testFunction1(): Foo<{ x: V }> { return null; } // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. // in paramter types function testFunction2(p: Foo<{ x: V }>) { }// error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. // in var type annotation var f: Foo<{ x: V }>; // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. // in constraints class testClass4 { } // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. interface testClass5> { } // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. class testClass6 { method(): void { } // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. } interface testInterface1 { new (a: M); // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. } // in extends clause class testClass7 extends Foo<{ x: V }> { } // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. // in implements clause class testClass8 implements IFoo<{ x: V }> { } // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. // in signatures interface testInterface2 { new (a: Foo<{ x: V }>): Foo<{ x: V }>; //2x: error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. [x: string]: Foo<{ x: V }>; // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. method(a: Foo<{ x: V }>): Foo<{ x: V }>; //2x: error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. property: Foo<{ x: V }>; // error: could not find symbol V ~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. } \ No newline at end of file diff --git a/tests/baselines/reference/errorsOnImportedSymbol.errors.txt b/tests/baselines/reference/errorsOnImportedSymbol.errors.txt index 9261bab93fc..ec108d48881 100644 --- a/tests/baselines/reference/errorsOnImportedSymbol.errors.txt +++ b/tests/baselines/reference/errorsOnImportedSymbol.errors.txt @@ -1,11 +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 errors) ==== import Sammy = require("errorsOnImportedSymbol_0"); var x = new Sammy.Sammy(); ~~~~~ -!!! Cannot find name 'Sammy'. +!!! error TS2304: Cannot find name 'Sammy'. var y = Sammy.Sammy(); ~~~~~ -!!! Cannot find name 'Sammy'. +!!! error TS2304: Cannot find name 'Sammy'. ==== tests/cases/compiler/errorsOnImportedSymbol_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/es6-amd.js b/tests/baselines/reference/es6-amd.js new file mode 100644 index 00000000000..0cce3af0446 --- /dev/null +++ b/tests/baselines/reference/es6-amd.js @@ -0,0 +1,31 @@ +//// [es6-amd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es6-amd.js] +var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; +})(); +//# sourceMappingURL=es6-amd.js.map + +//// [es6-amd.d.ts] +declare class A { + constructor(); + B(): number; +} diff --git a/tests/baselines/reference/es6-amd.js.map b/tests/baselines/reference/es6-amd.js.map new file mode 100644 index 00000000000..7371ba578bd --- /dev/null +++ b/tests/baselines/reference/es6-amd.js.map @@ -0,0 +1,2 @@ +//// [es6-amd.js.map] +{"version":3,"file":"es6-amd.js","sourceRoot":"","sources":["es6-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es6-amd.sourcemap.txt b/tests/baselines/reference/es6-amd.sourcemap.txt new file mode 100644 index 00000000000..070a35703e1 --- /dev/null +++ b/tests/baselines/reference/es6-amd.sourcemap.txt @@ -0,0 +1,128 @@ +=================================================================== +JsFile: es6-amd.js +mapUrl: es6-amd.js.map +sourceRoot: +sources: es6-amd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es6-amd.js +sourceFile:es6-amd.ts +------------------------------------------------------------------- +>>>var A = (function () { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >class +3 > A +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0) +--- +>>> function A() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> + >{ + > +2 > +3 > A +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A) +3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > constructor () + > { + > + > +2 > } +1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=es6-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es6-amd.types b/tests/baselines/reference/es6-amd.types new file mode 100644 index 00000000000..62815911f7f --- /dev/null +++ b/tests/baselines/reference/es6-amd.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es6-amd.ts === + +class A +>A : A +{ + constructor () + { + + } + + public B() +>B : () => number + { + return 42; + } +} diff --git a/tests/baselines/reference/es6-declaration-amd.js b/tests/baselines/reference/es6-declaration-amd.js new file mode 100644 index 00000000000..471f96b223d --- /dev/null +++ b/tests/baselines/reference/es6-declaration-amd.js @@ -0,0 +1,31 @@ +//// [es6-declaration-amd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es6-declaration-amd.js] +var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; +})(); +//# sourceMappingURL=es6-declaration-amd.js.map + +//// [es6-declaration-amd.d.ts] +declare class A { + constructor(); + B(): number; +} diff --git a/tests/baselines/reference/es6-declaration-amd.js.map b/tests/baselines/reference/es6-declaration-amd.js.map new file mode 100644 index 00000000000..0987f9478e9 --- /dev/null +++ b/tests/baselines/reference/es6-declaration-amd.js.map @@ -0,0 +1,2 @@ +//// [es6-declaration-amd.js.map] +{"version":3,"file":"es6-declaration-amd.js","sourceRoot":"","sources":["es6-declaration-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es6-declaration-amd.sourcemap.txt b/tests/baselines/reference/es6-declaration-amd.sourcemap.txt new file mode 100644 index 00000000000..1fc0b5f05fe --- /dev/null +++ b/tests/baselines/reference/es6-declaration-amd.sourcemap.txt @@ -0,0 +1,128 @@ +=================================================================== +JsFile: es6-declaration-amd.js +mapUrl: es6-declaration-amd.js.map +sourceRoot: +sources: es6-declaration-amd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es6-declaration-amd.js +sourceFile:es6-declaration-amd.ts +------------------------------------------------------------------- +>>>var A = (function () { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >class +3 > A +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0) +--- +>>> function A() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> + >{ + > +2 > +3 > A +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A) +3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > constructor () + > { + > + > +2 > } +1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=es6-declaration-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es6-declaration-amd.types b/tests/baselines/reference/es6-declaration-amd.types new file mode 100644 index 00000000000..e275fc52439 --- /dev/null +++ b/tests/baselines/reference/es6-declaration-amd.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es6-declaration-amd.ts === + +class A +>A : A +{ + constructor () + { + + } + + public B() +>B : () => number + { + return 42; + } +} diff --git a/tests/baselines/reference/es6-sourcemap-amd.js b/tests/baselines/reference/es6-sourcemap-amd.js new file mode 100644 index 00000000000..805e56cf830 --- /dev/null +++ b/tests/baselines/reference/es6-sourcemap-amd.js @@ -0,0 +1,25 @@ +//// [es6-sourcemap-amd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es6-sourcemap-amd.js] +var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; +})(); +//# sourceMappingURL=es6-sourcemap-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es6-sourcemap-amd.js.map b/tests/baselines/reference/es6-sourcemap-amd.js.map new file mode 100644 index 00000000000..689f0447fa8 --- /dev/null +++ b/tests/baselines/reference/es6-sourcemap-amd.js.map @@ -0,0 +1,2 @@ +//// [es6-sourcemap-amd.js.map] +{"version":3,"file":"es6-sourcemap-amd.js","sourceRoot":"","sources":["es6-sourcemap-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt b/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt new file mode 100644 index 00000000000..09abb195987 --- /dev/null +++ b/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt @@ -0,0 +1,128 @@ +=================================================================== +JsFile: es6-sourcemap-amd.js +mapUrl: es6-sourcemap-amd.js.map +sourceRoot: +sources: es6-sourcemap-amd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es6-sourcemap-amd.js +sourceFile:es6-sourcemap-amd.ts +------------------------------------------------------------------- +>>>var A = (function () { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >class +3 > A +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0) +--- +>>> function A() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> + >{ + > +2 > +3 > A +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A) +3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > constructor () + > { + > + > +2 > } +1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=es6-sourcemap-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es6-sourcemap-amd.types b/tests/baselines/reference/es6-sourcemap-amd.types new file mode 100644 index 00000000000..661ab2e7cdd --- /dev/null +++ b/tests/baselines/reference/es6-sourcemap-amd.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es6-sourcemap-amd.ts === + +class A +>A : A +{ + constructor () + { + + } + + public B() +>B : () => number + { + return 42; + } +} diff --git a/tests/baselines/reference/es6ClassTest.errors.txt b/tests/baselines/reference/es6ClassTest.errors.txt index 717089ddeb9..4478fbe8156 100644 --- a/tests/baselines/reference/es6ClassTest.errors.txt +++ b/tests/baselines/reference/es6ClassTest.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/es6ClassTest.ts(25,44): error TS1015: Parameter cannot have question mark and initializer. + + ==== tests/cases/compiler/es6ClassTest.ts (1 errors) ==== class Bar { public goo: number; @@ -25,7 +28,7 @@ constructor(); constructor(x?, private y?:string, public z?=0) { ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. super(x); this.x = x; this.gar = 5; diff --git a/tests/baselines/reference/es6ClassTest2.errors.txt b/tests/baselines/reference/es6ClassTest2.errors.txt index 3e3fa2bbee6..bf87a809b77 100644 --- a/tests/baselines/reference/es6ClassTest2.errors.txt +++ b/tests/baselines/reference/es6ClassTest2.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/es6ClassTest2.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/es6ClassTest2.ts(35,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/es6ClassTest2.ts(17,1): error TS2304: Cannot find name 'console'. + + ==== tests/cases/compiler/es6ClassTest2.ts (3 errors) ==== class BasicMonster { constructor(public name: string, public health: number) { @@ -17,7 +22,7 @@ m1.health = 0; console.log((m5.isAlive).toString()); ~~~~~~~ -!!! Cannot find name 'console'. +!!! error TS2304: Cannot find name 'console'. class GetSetMonster { constructor(public name: string, private _health: number) { @@ -32,14 +37,14 @@ // defines one in an object literal. get isAlive() { ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return this._health > 0; } // Likewise, "set" can be used to define setters. set health(value: number) { ~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. if (value < 0) { throw new Error('Health must be non-negative.') } diff --git a/tests/baselines/reference/es6ClassTest3.errors.txt b/tests/baselines/reference/es6ClassTest3.errors.txt index d666351dc9a..5eb310f338d 100644 --- a/tests/baselines/reference/es6ClassTest3.errors.txt +++ b/tests/baselines/reference/es6ClassTest3.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/es6ClassTest3.ts(3,22): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/compiler/es6ClassTest3.ts(4,23): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + + ==== tests/cases/compiler/es6ClassTest3.ts (2 errors) ==== module M { class Visibility { public foo() { }; ~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. private bar() { }; ~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. private x: number; public y: number; public z: number; diff --git a/tests/baselines/reference/es6ClassTest9.errors.txt b/tests/baselines/reference/es6ClassTest9.errors.txt index 1b8be82fc9d..ae7d1ba92d5 100644 --- a/tests/baselines/reference/es6ClassTest9.errors.txt +++ b/tests/baselines/reference/es6ClassTest9.errors.txt @@ -1,10 +1,18 @@ -==== tests/cases/compiler/es6ClassTest9.ts (3 errors) ==== +tests/cases/compiler/es6ClassTest9.ts(1,18): error TS1005: '{' expected. +tests/cases/compiler/es6ClassTest9.ts(1,19): error TS1109: Expression expected. +tests/cases/compiler/es6ClassTest9.ts(1,15): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/es6ClassTest9.ts(2,10): error TS2300: Duplicate identifier 'foo'. + + +==== tests/cases/compiler/es6ClassTest9.ts (4 errors) ==== declare class foo(); ~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~ -!!! Expression expected. +!!! error TS1109: Expression expected. + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. function foo() {} ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/es6DeclOrdering.errors.txt b/tests/baselines/reference/es6DeclOrdering.errors.txt index 4d890d04238..fdcc796566a 100644 --- a/tests/baselines/reference/es6DeclOrdering.errors.txt +++ b/tests/baselines/reference/es6DeclOrdering.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/es6DeclOrdering.ts(6,20): error TS2339: Property '_store' does not exist on type 'Bar'. +tests/cases/compiler/es6DeclOrdering.ts(11,13): error TS2339: Property '_store' does not exist on type 'Bar'. + + ==== tests/cases/compiler/es6DeclOrdering.ts (2 errors) ==== class Bar { @@ -6,14 +10,14 @@ public foo() { return this._store.length; ~~~~~~ -!!! Property '_store' does not exist on type 'Bar'. +!!! error TS2339: Property '_store' does not exist on type 'Bar'. } constructor(store: string) { this._store = store; // this is an error for some reason? Unresolved symbol store ~~~~~~ -!!! Property '_store' does not exist on type 'Bar'. +!!! error TS2339: Property '_store' does not exist on type 'Bar'. } } diff --git a/tests/baselines/reference/es6MemberScoping.errors.txt b/tests/baselines/reference/es6MemberScoping.errors.txt index 37c8eeb0d20..07788a68648 100644 --- a/tests/baselines/reference/es6MemberScoping.errors.txt +++ b/tests/baselines/reference/es6MemberScoping.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/es6MemberScoping.ts(9,21): error TS2304: Cannot find name 'store'. + + ==== tests/cases/compiler/es6MemberScoping.ts (1 errors) ==== @@ -9,7 +12,7 @@ } public _store = store; // should be an error. ~~~~~ -!!! Cannot find name 'store'. +!!! error TS2304: Cannot find name 'store'. } class Foo2 { diff --git a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.js b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.js new file mode 100644 index 00000000000..e2a8471be0a --- /dev/null +++ b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.js @@ -0,0 +1,93 @@ +//// [escapedReservedCompilerNamedIdentifier.ts] +// double underscores +var __proto__ = 10; +var o = { + "__proto__": 0 +}; +var b = o["__proto__"]; +var o1 = { + __proto__: 0 +}; +var b1 = o1["__proto__"]; +// Triple underscores +var ___proto__ = 10; +var o2 = { + "___proto__": 0 +}; +var b2 = o2["___proto__"]; +var o3 = { + ___proto__: 0 +}; +var b3 = o3["___proto__"]; +// One underscore +var _proto__ = 10; +var o4 = { + "_proto__": 0 +}; +var b4 = o4["_proto__"]; +var o5 = { + _proto__: 0 +}; +var b5 = o5["_proto__"]; + +//// [escapedReservedCompilerNamedIdentifier.js] +// double underscores +var __proto__ = 10; +var o = { + "__proto__": 0 +}; +var b = o["__proto__"]; +var o1 = { + __proto__: 0 +}; +var b1 = o1["__proto__"]; +// Triple underscores +var ___proto__ = 10; +var o2 = { + "___proto__": 0 +}; +var b2 = o2["___proto__"]; +var o3 = { + ___proto__: 0 +}; +var b3 = o3["___proto__"]; +// One underscore +var _proto__ = 10; +var o4 = { + "_proto__": 0 +}; +var b4 = o4["_proto__"]; +var o5 = { + _proto__: 0 +}; +var b5 = o5["_proto__"]; + + +//// [escapedReservedCompilerNamedIdentifier.d.ts] +declare var __proto__: number; +declare var o: { + "__proto__": number; +}; +declare var b: number; +declare var o1: { + __proto__: number; +}; +declare var b1: number; +declare var ___proto__: number; +declare var o2: { + "___proto__": number; +}; +declare var b2: number; +declare var o3: { + ___proto__: number; +}; +declare var b3: number; +declare var _proto__: number; +declare var o4: { + "_proto__": number; +}; +declare var b4: number; +declare var o5: { + _proto__: number; +}; +declare var b5: number; diff --git a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types new file mode 100644 index 00000000000..f54c7b80757 --- /dev/null +++ b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types @@ -0,0 +1,85 @@ +=== tests/cases/compiler/escapedReservedCompilerNamedIdentifier.ts === +// double underscores +var __proto__ = 10; +>__proto__ : number + +var o = { +>o : { "__proto__": number; } +>{ "__proto__": 0} : { "__proto__": number; } + + "__proto__": 0 +}; +var b = o["__proto__"]; +>b : number +>o["__proto__"] : number +>o : { "__proto__": number; } + +var o1 = { +>o1 : { __proto__: number; } +>{ __proto__: 0} : { __proto__: number; } + + __proto__: 0 +>__proto__ : number + +}; +var b1 = o1["__proto__"]; +>b1 : number +>o1["__proto__"] : number +>o1 : { __proto__: number; } + +// Triple underscores +var ___proto__ = 10; +>___proto__ : number + +var o2 = { +>o2 : { "___proto__": number; } +>{ "___proto__": 0} : { "___proto__": number; } + + "___proto__": 0 +}; +var b2 = o2["___proto__"]; +>b2 : number +>o2["___proto__"] : number +>o2 : { "___proto__": number; } + +var o3 = { +>o3 : { ___proto__: number; } +>{ ___proto__: 0} : { ___proto__: number; } + + ___proto__: 0 +>___proto__ : number + +}; +var b3 = o3["___proto__"]; +>b3 : number +>o3["___proto__"] : number +>o3 : { ___proto__: number; } + +// One underscore +var _proto__ = 10; +>_proto__ : number + +var o4 = { +>o4 : { "_proto__": number; } +>{ "_proto__": 0} : { "_proto__": number; } + + "_proto__": 0 +}; +var b4 = o4["_proto__"]; +>b4 : number +>o4["_proto__"] : number +>o4 : { "_proto__": number; } + +var o5 = { +>o5 : { _proto__: number; } +>{ _proto__: 0} : { _proto__: number; } + + _proto__: 0 +>_proto__ : number + +}; +var b5 = o5["_proto__"]; +>b5 : number +>o5["_proto__"] : number +>o5 : { _proto__: number; } + diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 8ff1f410b37..4ebb93b10a7 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -1,3 +1,38 @@ +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'. + Property 'toDateString' is missing in type 'Number'. +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(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'. + Property 'id' is missing in type 'D<{}>'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(42,5): error TS2322: Type 'C' is not assignable to type 'D'. + Property 'source' is missing in type 'C'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,5): error TS2322: Type '{ id: string; }' is not assignable to type 'I'. + Types of property 'id' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(44,5): error TS2322: Type 'C' is not assignable to type '{ id: string; }'. + Types of property 'id' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(46,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(47,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(50,5): error TS2322: Type 'typeof N' is not assignable to type 'typeof M'. + Types of property 'A' are incompatible. + Type 'typeof A' is not assignable to type 'typeof A'. + Type 'A' is not assignable to type 'A'. + Property 'name' is missing in type 'A'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2322: Type 'A' is not assignable to type 'A'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. + Type 'boolean' is not assignable to type 'string'. + + ==== tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts (15 errors) ==== interface I { id: number; @@ -34,71 +69,70 @@ var aNumber: number = 'this is a string'; ~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var aString: string = 9.9; ~~~~~~~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var aDate: Date = 9.9; ~~~~~ -!!! Type 'number' is not assignable to type 'Date': -!!! Property 'toDateString' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'Date'. +!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var aVoid: void = 9.9; ~~~~~ -!!! Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. var anInterface: I = new D(); ~~~~~~~~~~~ -!!! Type 'D<{}>' is not assignable to type 'I': -!!! Property 'id' is missing in type 'D<{}>'. +!!! error TS2322: Type 'D<{}>' is not assignable to type 'I'. +!!! error TS2322: Property 'id' is missing in type 'D<{}>'. var aClass: C = new D(); ~~~~~~ -!!! Type 'D<{}>' is not assignable to type 'C': -!!! Property 'id' is missing in type 'D<{}>'. +!!! error TS2322: Type 'D<{}>' is not assignable to type 'C'. +!!! error TS2322: Property 'id' is missing in type 'D<{}>'. var aGenericClass: D = new C(); ~~~~~~~~~~~~~ -!!! Type 'C' is not assignable to type 'D': -!!! Property 'source' is missing in type 'C'. +!!! error TS2322: Type 'C' is not assignable to type 'D'. +!!! error TS2322: Property 'source' is missing in type 'C'. var anObjectLiteral: I = { id: 'a string' }; ~~~~~~~~~~~~~~~ -!!! Type '{ id: string; }' is not assignable to type 'I': -!!! Types of property 'id' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ id: string; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'id' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var anOtherObjectLiteral: { id: string } = new C(); ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'C' is not assignable to type '{ id: string; }': -!!! Types of property 'id' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type '{ id: string; }'. +!!! error TS2322: Types of property 'id' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var aFunction: typeof F = F2; ~~~~~~~~~ -!!! Type '(x: number) => boolean' is not assignable to type '(x: string) => number': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var anOtherFunction: (x: string) => number = F2; ~~~~~~~~~~~~~~~ -!!! Type '(x: number) => boolean' is not assignable to type '(x: string) => number': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var aLambda: typeof F = (x) => 'a string'; ~~~~~~~ -!!! Type '(x: string) => string' is not assignable to type '(x: string) => number': -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var aModule: typeof M = N; ~~~~~~~ -!!! Type 'typeof N' is not assignable to type 'typeof M': -!!! Types of property 'A' are incompatible: -!!! Type 'typeof A' is not assignable to type 'typeof A': -!!! Type 'A' is not assignable to type 'A': -!!! Property 'name' is missing in type 'A'. +!!! error TS2322: Type 'typeof N' is not assignable to type 'typeof M'. +!!! error TS2322: Types of property 'A' are incompatible. +!!! error TS2322: Type 'typeof A' is not assignable to type 'typeof A'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. +!!! error TS2322: Property 'name' is missing in type 'A'. var aClassInModule: M.A = new N.A(); ~~~~~~~~~~~~~~ -!!! Type 'A' is not assignable to type 'A': -!!! Property 'name' is missing in type 'A'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. var aFunctionInModule: typeof M.F2 = F2; ~~~~~~~~~~~~~~~~~ -!!! Type '(x: number) => boolean' is not assignable to type '(x: number) => string': -!!! Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/exportAlreadySeen.errors.txt b/tests/baselines/reference/exportAlreadySeen.errors.txt index b80498feb5e..707b34c8d25 100644 --- a/tests/baselines/reference/exportAlreadySeen.errors.txt +++ b/tests/baselines/reference/exportAlreadySeen.errors.txt @@ -1,40 +1,40 @@ -==== tests/cases/compiler/exportAlreadySeen.ts (10 errors) ==== +tests/cases/compiler/exportAlreadySeen.ts(2,12): error TS1030: 'export' modifier already seen. +tests/cases/compiler/exportAlreadySeen.ts(3,12): error TS1030: 'export' modifier already seen. +tests/cases/compiler/exportAlreadySeen.ts(5,12): error TS1030: 'export' modifier already seen. +tests/cases/compiler/exportAlreadySeen.ts(12,12): error TS1030: 'export' modifier already seen. +tests/cases/compiler/exportAlreadySeen.ts(13,12): error TS1030: 'export' modifier already seen. +tests/cases/compiler/exportAlreadySeen.ts(15,12): error TS1030: 'export' modifier already seen. + + +==== tests/cases/compiler/exportAlreadySeen.ts (6 errors) ==== module M { export export var x = 1; ~~~~~~ -!!! 'export' modifier already seen. +!!! error TS1030: 'export' modifier already seen. export export function f() { } ~~~~~~ -!!! 'export' modifier already seen. +!!! error TS1030: 'export' modifier already seen. export export module N { ~~~~~~ -!!! 'export' modifier already seen. +!!! error TS1030: 'export' modifier already seen. export export class C { } - ~~~~~~ -!!! 'export' modifier already seen. export export interface I { } - ~~~~~~ -!!! 'export' modifier already seen. } } declare module A { export export var x; ~~~~~~ -!!! 'export' modifier already seen. +!!! error TS1030: 'export' modifier already seen. export export function f() ~~~~~~ -!!! 'export' modifier already seen. +!!! error TS1030: 'export' modifier already seen. export export module N { ~~~~~~ -!!! 'export' modifier already seen. +!!! error TS1030: 'export' modifier already seen. export export class C { } - ~~~~~~ -!!! 'export' modifier already seen. export export interface I { } - ~~~~~~ -!!! 'export' modifier already seen. } } \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignClassAndModule.types b/tests/baselines/reference/exportAssignClassAndModule.types index 0118e6fa812..dc4a19f345c 100644 --- a/tests/baselines/reference/exportAssignClassAndModule.types +++ b/tests/baselines/reference/exportAssignClassAndModule.types @@ -5,7 +5,7 @@ import Foo = require('exportAssignClassAndModule_0'); var z: Foo.Bar; >z : Foo.Bar ->Foo : Foo +>Foo : unknown >Bar : Foo.Bar var zz: Foo; @@ -23,7 +23,7 @@ class Foo { x: Foo.Bar; >x : Foo.Bar ->Foo : Foo +>Foo : unknown >Bar : Foo.Bar } module Foo { diff --git a/tests/baselines/reference/exportAssignDottedName.errors.txt b/tests/baselines/reference/exportAssignDottedName.errors.txt index 7faf84e114a..264e32c9cad 100644 --- a/tests/baselines/reference/exportAssignDottedName.errors.txt +++ b/tests/baselines/reference/exportAssignDottedName.errors.txt @@ -1,10 +1,15 @@ +tests/cases/conformance/externalModules/foo1.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo2.ts(2,14): error TS1005: ';' expected. +tests/cases/conformance/externalModules/foo2.ts(2,15): error TS2304: Cannot find name 'x'. + + ==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ==== import foo1 = require('./foo1'); export = foo1.x; // Error, export assignment must be identifier only ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. ==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ==== export function x(){ @@ -13,5 +18,5 @@ ~~~~~~~~~~~~~ } ~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt b/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt index b1e124896e7..8aa25aee2ad 100644 --- a/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt +++ b/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/externalModules/foo1.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/conformance/externalModules/foo3.ts (0 errors) ==== import foo2 = require('./foo2'); var x = foo2(); // should be boolean @@ -8,7 +11,7 @@ ~~~~~~~~~~~~~ } ~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== import foo1 = require('./foo1'); diff --git a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt index 7487d9547c1..31ca1be2011 100644 --- a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt +++ b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt @@ -1,25 +1,36 @@ +tests/cases/conformance/externalModules/foo1.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/externalModules/foo1.ts(2,10): error TS1003: Identifier expected. +tests/cases/conformance/externalModules/foo2.ts(1,10): error TS1003: Identifier expected. +tests/cases/conformance/externalModules/foo3.ts(1,10): error TS1003: Identifier expected. +tests/cases/conformance/externalModules/foo4.ts(1,10): error TS1003: Identifier expected. +tests/cases/conformance/externalModules/foo6.ts(1,10): error TS1003: Identifier expected. +tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression expected. +tests/cases/conformance/externalModules/foo7.ts(1,15): error TS1005: ';' expected. +tests/cases/conformance/externalModules/foo8.ts(1,10): error TS1003: Identifier expected. + + ==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ==== var x = 10; export = typeof x; // Error ~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ~~~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ==== tests/cases/conformance/externalModules/foo2.ts (1 errors) ==== export = "sausages"; // Error ~~~~~~~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ==== tests/cases/conformance/externalModules/foo3.ts (1 errors) ==== export = class Foo3 {}; // Error ~~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ==== tests/cases/conformance/externalModules/foo4.ts (1 errors) ==== export = true; // Error ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ==== tests/cases/conformance/externalModules/foo5.ts (0 errors) ==== export = undefined; // Valid. undefined is an identifier in JavaScript/TypeScript @@ -27,18 +38,18 @@ ==== tests/cases/conformance/externalModules/foo6.ts (2 errors) ==== export = void; // Error ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ==== tests/cases/conformance/externalModules/foo7.ts (1 errors) ==== export = Date || String; // Error ~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ==== tests/cases/conformance/externalModules/foo8.ts (1 errors) ==== export = null; // Error ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignTypes.errors.txt b/tests/baselines/reference/exportAssignTypes.errors.txt index c4dca71333f..c35e7c0b8f6 100644 --- a/tests/baselines/reference/exportAssignTypes.errors.txt +++ b/tests/baselines/reference/exportAssignTypes.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/externalModules/expString.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/conformance/externalModules/consumer.ts (0 errors) ==== import iString = require('./expString'); var v1: string = iString; @@ -24,7 +27,7 @@ var x = "test"; export = x; ~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/expNumber.ts (0 errors) ==== var x = 42; diff --git a/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt b/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt index ecae497202e..bb228caa0c9 100644 --- a/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt +++ b/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/externalModules/exportAssignmentAndDeclaration.ts(10,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + ==== tests/cases/conformance/externalModules/exportAssignmentAndDeclaration.ts (1 errors) ==== export enum E1 { A,B,C @@ -10,4 +13,4 @@ // Invalid, as there is already an exported member. export = C1; ~~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. \ No newline at end of file +!!! 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/exportAssignmentConstrainedGenericType.errors.txt b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt index 9b933cc439d..cf63c48925f 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt @@ -1,8 +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 (1 errors) ==== import foo = require("./foo_0"); var x = new foo(true); // Should error ~~~~ -!!! Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'. +!!! error TS2345: Argument of type 'boolean' 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/exportAssignmentOfDeclaredExternalModule.errors.txt b/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.errors.txt index 74518bb9c3c..f6736e468f0 100644 --- a/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.errors.txt +++ b/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.errors.txt @@ -1,12 +1,16 @@ +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 (2 errors) ==== /// import Sammy = require('exportAssignmentOfDeclaredExternalModule_0'); var x = new Sammy(); // error to use as constructor as there is not constructor symbol ~~~~~ -!!! Cannot find name 'Sammy'. +!!! error TS2304: Cannot find name 'Sammy'. var y = Sammy(); // error to use interface name as call target ~~~~~ -!!! Cannot find name 'Sammy'. +!!! error TS2304: Cannot find name 'Sammy'. 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/exportAssignmentWithDeclareAndExportModifiers.errors.txt b/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt index 2dd71ce0d07..f8dc0114593 100644 --- a/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt @@ -1,7 +1,8 @@ -==== tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts (2 errors) ==== +tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts(2,1): error TS1120: An export assignment cannot have modifiers. + + +==== tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts (1 errors) ==== var x; export declare export = x; - ~~~~~~~~~~~~~~ -!!! An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file + ~~~~~~ +!!! error TS1120: An export assignment cannot have modifiers. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt b/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt index 27b202ce0c8..2f9d8d801af 100644 --- a/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt @@ -1,7 +1,8 @@ -==== tests/cases/compiler/exportAssignmentWithDeclareModifier.ts (2 errors) ==== +tests/cases/compiler/exportAssignmentWithDeclareModifier.ts(2,1): error TS1120: An export assignment cannot have modifiers. + + +==== tests/cases/compiler/exportAssignmentWithDeclareModifier.ts (1 errors) ==== var x; declare export = x; ~~~~~~~ -!!! An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file +!!! error TS1120: An export assignment cannot have modifiers. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt b/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt index dc3d6cb4cc5..275f4b0ba1f 100644 --- a/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt @@ -1,7 +1,8 @@ -==== tests/cases/compiler/exportAssignmentWithExportModifier.ts (2 errors) ==== +tests/cases/compiler/exportAssignmentWithExportModifier.ts(2,1): error TS1120: An export assignment cannot have modifiers. + + +==== tests/cases/compiler/exportAssignmentWithExportModifier.ts (1 errors) ==== var x; export export = x; ~~~~~~ -!!! An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file +!!! error TS1120: An export assignment cannot have modifiers. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithExports.errors.txt b/tests/baselines/reference/exportAssignmentWithExports.errors.txt index 7ddda9db538..d47cbae3221 100644 --- a/tests/baselines/reference/exportAssignmentWithExports.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithExports.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/exportAssignmentWithExports.ts(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + ==== tests/cases/compiler/exportAssignmentWithExports.ts (1 errors) ==== export class C { } class D { } export = D; ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. \ No newline at end of file +!!! 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/exportAssignmentWithoutIdentifier1.errors.txt b/tests/baselines/reference/exportAssignmentWithoutIdentifier1.errors.txt index 396d932e358..ff21d304e40 100644 --- a/tests/baselines/reference/exportAssignmentWithoutIdentifier1.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithoutIdentifier1.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts(7,10): error TS1003: Identifier expected. + + ==== tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts (1 errors) ==== function Greeter() { //... @@ -7,5 +10,5 @@ } export = new Greeter(); ~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/exportDeclareClass1.errors.txt b/tests/baselines/reference/exportDeclareClass1.errors.txt index 6ee2bc0e090..c93dc5d0b01 100644 --- a/tests/baselines/reference/exportDeclareClass1.errors.txt +++ b/tests/baselines/reference/exportDeclareClass1.errors.txt @@ -1,15 +1,15 @@ -==== tests/cases/compiler/exportDeclareClass1.ts (4 errors) ==== +tests/cases/compiler/exportDeclareClass1.ts(2,24): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/compiler/exportDeclareClass1.ts(3,34): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + + +==== tests/cases/compiler/exportDeclareClass1.ts (2 errors) ==== export declare class eaC { static tF() { }; - ~ -!!! A function implementation cannot be declared in an ambient context. ~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. static tsF(param:any) { }; - ~ -!!! A function implementation cannot be declared in an ambient context. ~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. }; export declare class eaC2 { diff --git a/tests/baselines/reference/exportDeclaredModule.errors.txt b/tests/baselines/reference/exportDeclaredModule.errors.txt index ffa54e92dcf..265061fe2f4 100644 --- a/tests/baselines/reference/exportDeclaredModule.errors.txt +++ b/tests/baselines/reference/exportDeclaredModule.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/externalModules/foo1.ts(6,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== import foo1 = require('./foo1'); var x: number = foo1.b(); @@ -9,5 +12,5 @@ } export = M1; ~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/exportEqualErrorType.errors.txt b/tests/baselines/reference/exportEqualErrorType.errors.txt index 1023e9eff25..db96a9dc523 100644 --- a/tests/baselines/reference/exportEqualErrorType.errors.txt +++ b/tests/baselines/reference/exportEqualErrorType.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/exportEqualErrorType_1.ts(3,23): error TS2339: Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. + + ==== tests/cases/compiler/exportEqualErrorType_1.ts (1 errors) ==== /// import connect = require('exportEqualErrorType_0'); connect().use(connect.static('foo')); // Error 1 The property 'static' does not exist on value of type ''. ~~~~~~ -!!! Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. +!!! error TS2339: Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. ==== tests/cases/compiler/exportEqualErrorType_0.ts (0 errors) ==== module server { diff --git a/tests/baselines/reference/exportEqualMemberMissing.errors.txt b/tests/baselines/reference/exportEqualMemberMissing.errors.txt index da061bc303e..3e6e7a35a12 100644 --- a/tests/baselines/reference/exportEqualMemberMissing.errors.txt +++ b/tests/baselines/reference/exportEqualMemberMissing.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/exportEqualMemberMissing_1.ts(3,23): error TS2339: Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. + + ==== tests/cases/compiler/exportEqualMemberMissing_1.ts (1 errors) ==== /// import connect = require('exportEqualMemberMissing_0'); connect().use(connect.static('foo')); // Error 1 The property 'static' does not exist on value of type ''. ~~~~~~ -!!! Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. +!!! error TS2339: Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. ==== tests/cases/compiler/exportEqualMemberMissing_0.ts (0 errors) ==== module server { diff --git a/tests/baselines/reference/exportEqualNamespaces.types b/tests/baselines/reference/exportEqualNamespaces.types index 57ed5742b2a..5d3afc2731a 100644 --- a/tests/baselines/reference/exportEqualNamespaces.types +++ b/tests/baselines/reference/exportEqualNamespaces.types @@ -11,7 +11,7 @@ interface server { >server : server (): server.Server; ->server : server +>server : unknown >Server : server.Server startTime: Date; diff --git a/tests/baselines/reference/exportNonVisibleType.errors.txt b/tests/baselines/reference/exportNonVisibleType.errors.txt index 7f615efc615..0eb73b2b04e 100644 --- a/tests/baselines/reference/exportNonVisibleType.errors.txt +++ b/tests/baselines/reference/exportNonVisibleType.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/externalModules/foo1.ts(7,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ==== interface I1 { a: string; @@ -7,7 +10,7 @@ var x: I1 = {a: "test", b: 42}; export = x; // Should fail, I1 not exported. ~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== diff --git a/tests/baselines/reference/exportSameNameFuncVar.errors.txt b/tests/baselines/reference/exportSameNameFuncVar.errors.txt index 44d0c5446bd..a06457e88ae 100644 --- a/tests/baselines/reference/exportSameNameFuncVar.errors.txt +++ b/tests/baselines/reference/exportSameNameFuncVar.errors.txt @@ -1,6 +1,12 @@ -==== tests/cases/compiler/exportSameNameFuncVar.ts (1 errors) ==== +tests/cases/compiler/exportSameNameFuncVar.ts(1,12): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/exportSameNameFuncVar.ts(2,17): error TS2300: Duplicate identifier 'a'. + + +==== tests/cases/compiler/exportSameNameFuncVar.ts (2 errors) ==== export var a = 10; + ~ +!!! error TS2300: Duplicate identifier 'a'. export function a() { ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. } \ No newline at end of file diff --git a/tests/baselines/reference/exportingContainingVisibleType.errors.txt b/tests/baselines/reference/exportingContainingVisibleType.errors.txt index 8649494ddb4..83f722b97da 100644 --- a/tests/baselines/reference/exportingContainingVisibleType.errors.txt +++ b/tests/baselines/reference/exportingContainingVisibleType.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/exportingContainingVisibleType.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/exportingContainingVisibleType.ts (1 errors) ==== class Foo { public get foo() { ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var i: Foo; return i; // Should be fine (previous bug report visibility error). diff --git a/tests/baselines/reference/expr.errors.txt b/tests/baselines/reference/expr.errors.txt index 5b233d8a2da..41d15a0835b 100644 --- a/tests/baselines/reference/expr.errors.txt +++ b/tests/baselines/reference/expr.errors.txt @@ -1,3 +1,74 @@ +tests/cases/compiler/expr.ts(87,5): error TS2365: Operator '==' cannot be applied to types 'number' and 'string'. +tests/cases/compiler/expr.ts(88,5): error TS2365: Operator '==' cannot be applied to types 'number' and 'boolean'. +tests/cases/compiler/expr.ts(94,5): error TS2365: Operator '==' cannot be applied to types 'string' and 'number'. +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(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(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(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. +tests/cases/compiler/expr.ts(178,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(182,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(183,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(184,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(184,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(185,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(185,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(186,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(186,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(187,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(190,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(191,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(192,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(196,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(197,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(197,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(198,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(198,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(199,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(200,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(200,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(201,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(204,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(205,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(207,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(211,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(212,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(213,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(217,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(218,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(219,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(219,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(220,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(220,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(221,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(221,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(222,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(225,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(226,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(227,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(231,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(232,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(232,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(233,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(233,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(234,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(235,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(235,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(236,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/expr.ts(239,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(240,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(242,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 (69 errors) ==== interface I { } @@ -87,10 +158,10 @@ n==a; n==s; ~~~~ -!!! Operator '==' cannot be applied to types 'number' and 'string'. +!!! error TS2365: Operator '==' cannot be applied to types 'number' and 'string'. n==b; ~~~~ -!!! Operator '==' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '==' cannot be applied to types 'number' and 'boolean'. n==i; n==n; n==e; @@ -98,15 +169,15 @@ s==a; s==n; ~~~~ -!!! Operator '==' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'number'. s==b; ~~~~ -!!! Operator '==' cannot be applied to types 'string' and 'boolean'. +!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'boolean'. s==i; s==s; s==e; ~~~~ -!!! Operator '==' cannot be applied to types 'string' and 'E'. +!!! error TS2365: Operator '==' cannot be applied to types 'string' and 'E'. a==n; a==s; @@ -125,10 +196,10 @@ e==n; e==s; ~~~~ -!!! Operator '==' cannot be applied to types 'E' and 'string'. +!!! error TS2365: Operator '==' cannot be applied to types 'E' and 'string'. e==b; ~~~~ -!!! Operator '==' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '==' cannot be applied to types 'E' and 'boolean'. e==a; e==i; e==e; @@ -156,10 +227,10 @@ n+s; n+b; ~~~ -!!! Operator '+' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. n+i; ~~~ -!!! Operator '+' cannot be applied to types 'number' and 'I'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'I'. n+n; n+e; @@ -179,206 +250,206 @@ i+n; ~~~ -!!! Operator '+' cannot be applied to types 'I' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'I' and 'number'. i+s; i+b; ~~~ -!!! Operator '+' cannot be applied to types 'I' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'I' and 'boolean'. i+a; i+i; ~~~ -!!! Operator '+' cannot be applied to types 'I' and 'I'. +!!! error TS2365: Operator '+' cannot be applied to types 'I' and 'I'. i+e; ~~~ -!!! Operator '+' cannot be applied to types 'I' and 'E'. +!!! error TS2365: Operator '+' cannot be applied to types 'I' and 'E'. e+n; e+s; e+b; ~~~ -!!! Operator '+' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'boolean'. e+a; e+i; ~~~ -!!! Operator '+' cannot be applied to types 'E' and 'I'. +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'I'. e+e; n^a; n^s; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. n^b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. n^i; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. n^n; n^e; s^a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. s^n; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. s^b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. s^i; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. s^s; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. s^e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. a^n; a^s; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. a^b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. a^i; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. a^a; a^e; i^n; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. i^s; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. i^b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. i^a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. i^i; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. i^e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. e^n; e^s; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. e^b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. e^a; e^i; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. e^e; n-a; n-s; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. n-b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. n-i; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. n-n; n-e; s-a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. s-n; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. s-b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. s-i; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. s-s; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. s-e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. a-n; a-s; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. a-b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. a-i; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. a-a; a-e; i-n; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. i-s; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. i-b; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. i-a; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. i-i; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. i-e; ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. e-n; e-s; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. e-b; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. e-a; e-i; ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. e-e; } \ No newline at end of file diff --git a/tests/baselines/reference/extBaseClass2.errors.txt b/tests/baselines/reference/extBaseClass2.errors.txt index 79e8525a8f3..5e49a2dbc47 100644 --- a/tests/baselines/reference/extBaseClass2.errors.txt +++ b/tests/baselines/reference/extBaseClass2.errors.txt @@ -1,15 +1,19 @@ +tests/cases/compiler/extBaseClass2.ts(2,29): error TS2305: Module 'M' has no exported member 'B'. +tests/cases/compiler/extBaseClass2.ts(7,29): error TS2304: Cannot find name 'B'. + + ==== tests/cases/compiler/extBaseClass2.ts (2 errors) ==== module N { export class C4 extends M.B { ~~~ -!!! Module 'M' has no exported member 'B'. +!!! error TS2305: Module 'M' has no exported member 'B'. } } module M { export class C5 extends B { ~ -!!! Cannot find name 'B'. +!!! error TS2304: Cannot find name 'B'. } } \ No newline at end of file diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt index 7b1fde446f8..a44c95377dc 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(7,7): error TS2420: Class 'D' incorrectly implements interface 'C'. + Types of property 'bar' are incompatible. + Type '() => string' is not assignable to type '() => number'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(12,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/extendAndImplementTheSameBaseType2.ts (3 errors) ==== class C { foo: number @@ -7,20 +15,20 @@ } class D extends C implements C { ~ -!!! Class 'D' incorrectly implements interface 'C': -!!! Types of property 'bar' are incompatible: -!!! Type '() => string' is not assignable to type '() => number': -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'D' incorrectly implements interface 'C'. +!!! error TS2420: Types of property 'bar' are incompatible. +!!! error TS2420: Type '() => string' is not assignable to type '() => number'. +!!! error TS2420: Type 'string' is not assignable to type 'number'. baz() { } } var d: D = new D(); var r: string = d.foo; ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r2: number = d.foo; var r3: string = d.bar(); var r4: number = d.bar(); ~~ -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/extendArray.errors.txt b/tests/baselines/reference/extendArray.errors.txt index d9524acebcb..824752820cb 100644 --- a/tests/baselines/reference/extendArray.errors.txt +++ b/tests/baselines/reference/extendArray.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/extendArray.ts(7,19): error TS2304: Cannot find name '_element'. +tests/cases/compiler/extendArray.ts(7,32): error TS2304: Cannot find name '_element'. + + ==== tests/cases/compiler/extendArray.ts (2 errors) ==== var a = [1,2]; a.forEach(function (v,i,a) {}); @@ -7,9 +11,9 @@ interface Array { collect(fn:(e:_element) => _element[]) : any[]; ~~~~~~~~ -!!! Cannot find name '_element'. +!!! error TS2304: Cannot find name '_element'. ~~~~~~~~ -!!! Cannot find name '_element'. +!!! error TS2304: Cannot find name '_element'. } } diff --git a/tests/baselines/reference/extendGenericArray.errors.txt b/tests/baselines/reference/extendGenericArray.errors.txt index 19c93b7edc0..a524d522190 100644 --- a/tests/baselines/reference/extendGenericArray.errors.txt +++ b/tests/baselines/reference/extendGenericArray.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/extendGenericArray.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/extendGenericArray.ts (1 errors) ==== interface Array { foo(): T; @@ -6,4 +9,4 @@ var arr: string[] = []; var x: number = arr.foo(); ~ -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/extendGenericArray2.errors.txt b/tests/baselines/reference/extendGenericArray2.errors.txt index 23ca38cd7a7..169020fc1b2 100644 --- a/tests/baselines/reference/extendGenericArray2.errors.txt +++ b/tests/baselines/reference/extendGenericArray2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/extendGenericArray2.ts(8,5): error TS2322: Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/extendGenericArray2.ts (1 errors) ==== interface IFoo { x: T; @@ -8,4 +11,4 @@ var arr: string[] = []; var y: number = arr.x; ~ -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/extendNonClassSymbol1.errors.txt b/tests/baselines/reference/extendNonClassSymbol1.errors.txt index 730427f529d..587ac3a5f04 100644 --- a/tests/baselines/reference/extendNonClassSymbol1.errors.txt +++ b/tests/baselines/reference/extendNonClassSymbol1.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/extendNonClassSymbol1.ts(3,17): error TS2304: Cannot find name 'x'. + + ==== tests/cases/compiler/extendNonClassSymbol1.ts (1 errors) ==== class A { foo() { } } var x = A; class C extends x { } // error, could not find symbol xs ~ -!!! Cannot find name 'x'. \ No newline at end of file +!!! error TS2304: Cannot find name 'x'. \ No newline at end of file diff --git a/tests/baselines/reference/extendNonClassSymbol2.errors.txt b/tests/baselines/reference/extendNonClassSymbol2.errors.txt index 69328a3a713..1b54474ac39 100644 --- a/tests/baselines/reference/extendNonClassSymbol2.errors.txt +++ b/tests/baselines/reference/extendNonClassSymbol2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/extendNonClassSymbol2.ts(5,17): error TS2304: Cannot find name 'Foo'. + + ==== tests/cases/compiler/extendNonClassSymbol2.ts (1 errors) ==== function Foo() { this.x = 1; @@ -5,4 +8,4 @@ var x = new Foo(); // legal, considered a constructor function class C extends Foo {} // error, could not find symbol Foo ~~~ -!!! Cannot find name 'Foo'. \ No newline at end of file +!!! error TS2304: Cannot find name 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/extendedInterfacesWithDuplicateTypeParameters.errors.txt b/tests/baselines/reference/extendedInterfacesWithDuplicateTypeParameters.errors.txt index 5cabc36a6b8..7d7fea1b2c6 100644 --- a/tests/baselines/reference/extendedInterfacesWithDuplicateTypeParameters.errors.txt +++ b/tests/baselines/reference/extendedInterfacesWithDuplicateTypeParameters.errors.txt @@ -1,7 +1,12 @@ +tests/cases/compiler/extendedInterfacesWithDuplicateTypeParameters.ts(1,42): error TS2300: Duplicate identifier 'A'. +tests/cases/compiler/extendedInterfacesWithDuplicateTypeParameters.ts(9,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/extendedInterfacesWithDuplicateTypeParameters.ts(9,38): error TS2300: Duplicate identifier 'C'. + + ==== tests/cases/compiler/extendedInterfacesWithDuplicateTypeParameters.ts (3 errors) ==== interface InterfaceWithMultipleTypars { // should error ~ -!!! Duplicate identifier 'A'. +!!! error TS2300: Duplicate identifier 'A'. bar(): void; } @@ -11,8 +16,8 @@ interface InterfaceWithSomeTypars { // should error ~~~~~~~~~~~~~~~~~~~~~~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. ~ -!!! Duplicate identifier 'C'. +!!! error TS2300: Duplicate identifier 'C'. bar2(): void; } \ No newline at end of file diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types index fefa692b509..991d324e822 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types @@ -25,7 +25,7 @@ var moduleMap: { [key: string]: IHasVisualizationModel } = { >moduleMap : { [x: string]: IHasVisualizationModel; } >key : string >IHasVisualizationModel : IHasVisualizationModel ->{ "moduleA": moduleA, "moduleB": moduleB} : { [x: string]: IHasVisualizationModel; "moduleA": typeof moduleA; "moduleB": typeof moduleB; } +>{ "moduleA": moduleA, "moduleB": moduleB} : { [x: string]: typeof moduleA; "moduleA": typeof moduleA; "moduleB": typeof moduleB; } "moduleA": moduleA, >moduleA : typeof moduleA diff --git a/tests/baselines/reference/extendsClauseAlreadySeen.errors.txt b/tests/baselines/reference/extendsClauseAlreadySeen.errors.txt index f24e3bbc9f4..b2df83aeb0f 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen.errors.txt +++ b/tests/baselines/reference/extendsClauseAlreadySeen.errors.txt @@ -1,15 +1,21 @@ +tests/cases/compiler/extendsClauseAlreadySeen.ts(4,19): error TS1005: '{' expected. +tests/cases/compiler/extendsClauseAlreadySeen.ts(4,29): error TS1005: ';' expected. +tests/cases/compiler/extendsClauseAlreadySeen.ts(5,11): error TS1005: ';' expected. +tests/cases/compiler/extendsClauseAlreadySeen.ts(5,5): error TS2304: Cannot find name 'baz'. + + ==== tests/cases/compiler/extendsClauseAlreadySeen.ts (4 errors) ==== class C { } class D extends C extends C { ~~~~~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. baz() { } ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~ -!!! Cannot find name 'baz'. +!!! error TS2304: Cannot find name 'baz'. } \ No newline at end of file diff --git a/tests/baselines/reference/extendsClauseAlreadySeen2.errors.txt b/tests/baselines/reference/extendsClauseAlreadySeen2.errors.txt index 9e5c02a4255..45971dc62f3 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen2.errors.txt +++ b/tests/baselines/reference/extendsClauseAlreadySeen2.errors.txt @@ -1,15 +1,20 @@ +tests/cases/compiler/extendsClauseAlreadySeen2.ts(4,30): error TS1005: '{' expected. +tests/cases/compiler/extendsClauseAlreadySeen2.ts(4,38): error TS2365: Operator '>' cannot be applied to types 'boolean' and '{ baz: () => void; }'. +tests/cases/compiler/extendsClauseAlreadySeen2.ts(4,40): error TS2304: Cannot find name 'string'. + + ==== tests/cases/compiler/extendsClauseAlreadySeen2.ts (3 errors) ==== class C { } class D extends C extends C { ~~~~~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~~~~~~~~~~~ ~~~~~~ -!!! Cannot find name 'string'. +!!! error TS2304: Cannot find name 'string'. baz() { } ~~~~~~~~~~~~~ } ~ -!!! Operator '>' cannot be applied to types 'boolean' and '{ baz: () => void; }'. \ No newline at end of file +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '{ baz: () => void; }'. \ No newline at end of file diff --git a/tests/baselines/reference/extension.errors.txt b/tests/baselines/reference/extension.errors.txt index 1a5a8f1f01d..e55f15f4381 100644 --- a/tests/baselines/reference/extension.errors.txt +++ b/tests/baselines/reference/extension.errors.txt @@ -1,4 +1,12 @@ -==== tests/cases/compiler/extension.ts (5 errors) ==== +tests/cases/compiler/extension.ts(16,5): error TS1128: Declaration or statement expected. +tests/cases/compiler/extension.ts(16,22): error TS1005: ';' expected. +tests/cases/compiler/extension.ts(10,18): error TS2300: Duplicate identifier 'C'. +tests/cases/compiler/extension.ts(16,12): error TS2304: Cannot find name 'extension'. +tests/cases/compiler/extension.ts(16,28): error TS2300: Duplicate identifier 'C'. +tests/cases/compiler/extension.ts(22,3): error TS2339: Property 'pe' does not exist on type 'C'. + + +==== tests/cases/compiler/extension.ts (6 errors) ==== interface I { x; } @@ -9,6 +17,8 @@ declare module M { export class C { + ~ +!!! error TS2300: Duplicate identifier 'C'. public p:number; } } @@ -16,13 +26,13 @@ declare module M { export extension class C { ~~~~~~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. ~~~~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~~~~ -!!! Cannot find name 'extension'. +!!! error TS2304: Cannot find name 'extension'. ~ -!!! Duplicate identifier 'C'. +!!! error TS2300: Duplicate identifier 'C'. public pe:string; } } @@ -30,7 +40,7 @@ var c=new M.C(); c.pe; ~~ -!!! Property 'pe' does not exist on type 'C'. +!!! error TS2339: Property 'pe' does not exist on type 'C'. c.p; var i:I; i.x; diff --git a/tests/baselines/reference/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index 613f6d9f8d7..49b1598f06e 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -1,24 +1,39 @@ +tests/cases/compiler/externModule.ts(1,9): error TS1005: ';' expected. +tests/cases/compiler/externModule.ts(1,16): error TS1005: ';' expected. +tests/cases/compiler/externModule.ts(2,5): error TS1129: Statement expected. +tests/cases/compiler/externModule.ts(2,18): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/externModule.ts(30,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/externModule.ts(1,1): error TS2304: Cannot find name 'declare'. +tests/cases/compiler/externModule.ts(1,9): error TS2304: Cannot find name 'module'. +tests/cases/compiler/externModule.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/externModule.ts(4,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/externModule.ts(18,6): error TS2390: Constructor implementation is missing. +tests/cases/compiler/externModule.ts(20,13): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/externModule.ts(26,13): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/externModule.ts(28,13): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/externModule.ts (13 errors) ==== declare module { ~~~~~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~~ -!!! Cannot find name 'declare'. +!!! error TS2304: Cannot find name 'declare'. ~~~~~~ -!!! Cannot find name 'module'. +!!! error TS2304: Cannot find name 'module'. export class XDate { ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. ~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. public getDay():number; ~~~~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. public getXDate():number; ~~~~~~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. // etc. // Called as a function @@ -34,11 +49,11 @@ constructor(value: number); constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation is missing. +!!! error TS2390: Constructor implementation is missing. static parse(string: string): number; ~~~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. static UTC(year: number, month: number): number; static UTC(year: number, month: number, date: number): number; static UTC(year: number, month: number, date: number, hours: number): number; @@ -46,15 +61,15 @@ static UTC(year: number, month: number, date: number, hours: number, minutes: number, seconds: number): number; static UTC(year: number, month: number, date: number, hours: number, minutes: number, seconds: number, ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. ms: number): number; static now(): number; ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. var d=new XDate(); d.getDay(); diff --git a/tests/baselines/reference/externSemantics.errors.txt b/tests/baselines/reference/externSemantics.errors.txt index 2732c28d1ce..b58e2a4950c 100644 --- a/tests/baselines/reference/externSemantics.errors.txt +++ b/tests/baselines/reference/externSemantics.errors.txt @@ -1,9 +1,13 @@ +tests/cases/compiler/externSemantics.ts(1,14): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/compiler/externSemantics.ts(3,21): error TS1039: Initializers are not allowed in ambient contexts. + + ==== tests/cases/compiler/externSemantics.ts (2 errors) ==== declare var x=10; ~ -!!! Initializers are not allowed in ambient contexts. +!!! error TS1039: Initializers are not allowed in ambient contexts. declare var v; declare var y:number=3; ~ -!!! Initializers are not allowed in ambient contexts. +!!! error TS1039: Initializers are not allowed in ambient contexts. \ No newline at end of file diff --git a/tests/baselines/reference/externSyntax.errors.txt b/tests/baselines/reference/externSyntax.errors.txt index 791df1b7e0e..099c9fa3a99 100644 --- a/tests/baselines/reference/externSyntax.errors.txt +++ b/tests/baselines/reference/externSyntax.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/externSyntax.ts(8,20): error TS1037: A function implementation cannot be declared in an ambient context. + + ==== tests/cases/compiler/externSyntax.ts (1 errors) ==== declare var v; declare module M { @@ -8,7 +11,7 @@ public f(); public g() { } // error body ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. } } diff --git a/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt b/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt index 651f1a2f945..c8712b20864 100644 --- a/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt +++ b/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/externalModuleExportingGenericClass_file1.ts(2,8): error TS2314: Generic type 'C' requires 1 type argument(s). + + ==== tests/cases/compiler/externalModuleExportingGenericClass_file1.ts (1 errors) ==== import a = require('externalModuleExportingGenericClass_file0'); var v: a; // this should report error ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var v2: any = (new a()).foo; var v3: number = (new a()).foo; diff --git a/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.errors.txt b/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.errors.txt index f2dca2d5f44..588183c6283 100644 --- a/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.errors.txt +++ b/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/externalModuleRefernceResolutionOrderInImportDeclaration_file3.ts(3,7): error TS2339: Property 'foo' does not exist on type 'typeof "externalModuleRefernceResolutionOrderInImportDeclaration_file1"'. + + ==== tests/cases/compiler/externalModuleRefernceResolutionOrderInImportDeclaration_file3.ts (1 errors) ==== /// import file1 = require('externalModuleRefernceResolutionOrderInImportDeclaration_file1'); file1.foo(); ~~~ -!!! Property 'foo' does not exist on type 'typeof "externalModuleRefernceResolutionOrderInImportDeclaration_file1"'. +!!! error TS2339: Property 'foo' does not exist on type 'typeof "externalModuleRefernceResolutionOrderInImportDeclaration_file1"'. file1.bar(); diff --git a/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt index e10855a94ea..f061276aa1a 100644 --- a/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt +++ b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts(3,17): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts (1 errors) ==== // Not on line 0 because we want to verify the error is placed in the appropriate location. export module M { ~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. } \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt b/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt index 132e369a643..c3ad9b9c159 100644 --- a/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt @@ -1,49 +1,69 @@ +tests/cases/compiler/fatarrowfunctionsErrors.ts(2,8): error TS1005: ',' expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(2,18): error TS1005: ':' expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(2,19): error TS1005: ',' expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(2,20): error TS1128: Declaration or statement expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(2,21): error TS1128: Declaration or statement expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(5,10): error TS1005: ',' expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(5,18): error TS1005: ';' expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(9,19): error TS1005: '=>' expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(10,27): error TS1005: '=>' expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(11,21): error TS1005: '=>' expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(12,23): error TS1005: '=>' expected. +tests/cases/compiler/fatarrowfunctionsErrors.ts(1,1): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/fatarrowfunctionsErrors.ts(2,1): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/fatarrowfunctionsErrors.ts(3,1): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/fatarrowfunctionsErrors.ts(4,1): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/fatarrowfunctionsErrors.ts(5,9): error TS2304: Cannot find name 'x'. +tests/cases/compiler/fatarrowfunctionsErrors.ts(5,21): error TS2304: Cannot find name 'x'. +tests/cases/compiler/fatarrowfunctionsErrors.ts(5,23): error TS2304: Cannot find name 'x'. + + ==== tests/cases/compiler/fatarrowfunctionsErrors.ts (18 errors) ==== foo((...Far:any[])=>{return 0;}) ~~~ -!!! Cannot find name 'foo'. +!!! error TS2304: Cannot find name 'foo'. foo((1)=>{return 0;}); ~~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~ -!!! ':' expected. +!!! error TS1005: ':' expected. ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. ~~~ -!!! Cannot find name 'foo'. +!!! error TS2304: Cannot find name 'foo'. foo((x?)=>{return x;}) ~~~ -!!! Cannot find name 'foo'. +!!! error TS2304: Cannot find name 'foo'. foo((x=0)=>{return x;}) ~~~ -!!! Cannot find name 'foo'. +!!! error TS2304: Cannot find name 'foo'. var y = x:number => x*x; ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. false? (() => null): null; // missing fatarrow var x1 = () :void {}; ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. var x2 = (a:number) :void {}; ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. var x3 = (a:number) {}; ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. var x4= (...a: any[]) { }; ~ -!!! '=>' expected. \ No newline at end of file +!!! error TS1005: '=>' expected. \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt index a73ec1dd734..db0721c62af 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt @@ -1,4 +1,8 @@ -==== tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts (9 errors) ==== +tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(88,23): error TS1005: ';' expected. +tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(88,38): error TS1005: ';' expected. + + +==== tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts (2 errors) ==== // valid // no params @@ -59,8 +63,6 @@ false ? (arg: number) => 45 : null; false ? (arg?: number) => 46 : null; false ? (arg?: number = 0) => 47 : null; - ~~~ -!!! Parameter cannot have question mark and initializer. false ? (...arg: number[]) => 48 : null; // in ternary exression within paren @@ -71,8 +73,6 @@ false ? ((arg: number) => 55) : null; false ? ((arg?: number) => 56) : null; false ? ((arg?: number = 0) => 57) : null; - ~~~ -!!! Parameter cannot have question mark and initializer. false ? ((...arg: number[]) => 58) : null; // ternary exression's else clause @@ -83,8 +83,6 @@ false ? null : (arg: number) => 65; false ? null : (arg?: number) => 66; false ? null : (arg?: number = 0) => 67; - ~~~ -!!! Parameter cannot have question mark and initializer. false ? null : (...arg: number[]) => 68; @@ -94,9 +92,9 @@ //multiple levels (a?) => { return a; } ? (b)=>(c)=>81 : (c)=>(d)=>82; ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. // In Expressions @@ -115,10 +113,6 @@ ((arg:number) => 0) + '' + ((arg:number) => 104); ((arg:number = 1) => 0) + '' + ((arg:number = 2) => 105); ((arg?:number = 1) => 0) + '' + ((arg?:number = 2) => 106); - ~~~ -!!! Parameter cannot have question mark and initializer. - ~~~ -!!! Parameter cannot have question mark and initializer. ((...arg:number[]) => 0) + '' + ((...arg:number[]) => 107); ((arg1, arg2?) => 0) + '' + ((arg1,arg2?) => 108); ((arg1, ...arg2:number[]) => 0) + '' + ((arg1, ...arg2:number[]) => 108); @@ -139,12 +133,8 @@ (a: number = 0) => 116, (a = 0) => 117, (a?: number = 0) => 118, - ~ -!!! Parameter cannot have question mark and initializer. (...a: number[]) => 119, (a, b? = 0, ...c: number[]) => 120, - ~ -!!! Parameter cannot have question mark and initializer. (a) => (b) => (c) => 121, false? (a) => 0 : (b) => 122 ); \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt index fd103a3dea2..309e731e54f 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt @@ -1,19 +1,22 @@ -==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts (5 errors) ==== +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(1,9): error TS1016: A required parameter cannot follow an optional parameter. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(2,5): error TS1047: A rest parameter cannot be optional. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(4,5): error TS1048: A rest parameter cannot have an initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(7,12): error TS1016: A required parameter cannot follow an optional parameter. + + +==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts (4 errors) ==== (arg1?, arg2) => 101; ~~~~ -!!! A required parameter cannot follow an optional parameter. +!!! error TS1016: A required parameter cannot follow an optional parameter. (...arg?) => 102; ~~~ -!!! A rest parameter cannot be optional. +!!! error TS1047: A rest parameter cannot be optional. (...arg) => 103; (...arg:number [] = []) => 104; ~~~ -!!! A rest parameter cannot have an initializer. - (...) => 105; - ~ -!!! Identifier expected. +!!! error TS1048: A rest parameter cannot have an initializer. // Non optional parameter following an optional one (arg1 = 1, arg2) => 1; ~~~~ -!!! A required parameter cannot follow an optional parameter. \ No newline at end of file +!!! error TS1016: A required parameter cannot follow an optional parameter. \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt index daaa90c3ca4..ce237236ca7 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt @@ -1,39 +1,58 @@ +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,23): error TS1005: ';' expected. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,23): error TS1005: ';' expected. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,17): error TS1005: ';' expected. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,12): error TS2304: Cannot find name 'a'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,16): error TS2304: Cannot find name 'b'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,19): error TS2304: Cannot find name 'c'. +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,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'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,26): error TS2304: Cannot find name 'a'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,28): error TS2304: Cannot find name 'b'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,30): error TS2304: Cannot find name 'c'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,13): error TS2304: Cannot find name 'a'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304: Cannot find name 'a'. + + ==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts (17 errors) ==== var tt1 = (a, (b, c)) => a+b+c; ~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Cannot find name 'a'. +!!! error TS2304: Cannot find name 'a'. ~ -!!! Cannot find name 'b'. +!!! error TS2304: Cannot find name 'b'. ~ -!!! Cannot find name 'c'. +!!! error TS2304: Cannot find name 'c'. ~ -!!! Cannot find name 'a'. +!!! error TS2304: Cannot find name 'a'. ~ -!!! Cannot find name 'b'. +!!! error TS2304: Cannot find name 'b'. ~ -!!! Cannot find name 'c'. +!!! error TS2304: Cannot find name 'c'. var tt2 = ((a), b, c) => a+b+c; ~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Cannot find name 'a'. +!!! error TS2304: Cannot find name 'a'. ~ -!!! Cannot find name 'b'. +!!! error TS2304: Cannot find name 'b'. ~ -!!! Cannot find name 'c'. +!!! error TS2304: Cannot find name 'c'. ~ -!!! Cannot find name 'a'. +!!! error TS2304: Cannot find name 'a'. ~ -!!! Cannot find name 'b'. +!!! error TS2304: Cannot find name 'b'. ~ -!!! Cannot find name 'c'. +!!! error TS2304: Cannot find name 'c'. var tt3 = ((a)) => a; ~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Cannot find name 'a'. +!!! error TS2304: Cannot find name 'a'. ~ -!!! Cannot find name 'a'. \ No newline at end of file +!!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors3.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors3.errors.txt new file mode 100644 index 00000000000..631ccc2e221 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors3.errors.txt @@ -0,0 +1,8 @@ +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors3.ts(1,5): error TS1003: Identifier expected. + + +==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors3.ts (1 errors) ==== + (...) => 105; + ~ +!!! error TS1003: Identifier expected. + \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.errors.txt new file mode 100644 index 00000000000..8de0eb92a02 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.errors.txt @@ -0,0 +1,49 @@ +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(1,14): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(2,15): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(3,21): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(4,7): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(4,39): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(17,10): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(19,13): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(6,5): error TS2304: Cannot find name 'foo'. + + +==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts (8 errors) ==== + false ? (arg?: number = 0) => 47 : null; + ~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. + false ? ((arg?: number = 0) => 57) : null; + ~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. + false ? null : (arg?: number = 0) => 67; + ~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. + ((arg?:number = 1) => 0) + '' + ((arg?:number = 2) => 106); + ~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. + ~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. + + foo( + ~~~ +!!! error TS2304: Cannot find name 'foo'. + (a) => 110, + ((a) => 111), + (a) => { + return 112; + }, + (a? ) => 113, + (a, b? ) => 114, + (a: number) => 115, + (a: number = 0) => 116, + (a = 0) => 117, + (a?: number = 0) => 118, + ~ +!!! error TS1015: Parameter cannot have question mark and initializer. + (...a: number[]) => 119, + (a, b? = 0, ...c: number[]) => 120, + ~ +!!! error TS1015: Parameter cannot have question mark and initializer. + (a) => (b) => (c) => 121, + false? (a) => 0 : (b) => 122 + ); \ No newline at end of file diff --git a/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt b/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt index 40d00c1cff7..dd2374f2447 100644 --- a/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt +++ b/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt @@ -1,9 +1,16 @@ -==== tests/cases/compiler/fieldAndGetterWithSameName.ts (2 errors) ==== +tests/cases/compiler/fieldAndGetterWithSameName.ts(3,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/fieldAndGetterWithSameName.ts(2,5): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/fieldAndGetterWithSameName.ts(3,7): error TS2300: Duplicate identifier 'x'. + + +==== tests/cases/compiler/fieldAndGetterWithSameName.ts (3 errors) ==== export class C { x: number; + ~ +!!! error TS2300: Duplicate identifier 'x'. get x(): number { return 1; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } \ No newline at end of file diff --git a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt new file mode 100644 index 00000000000..3666c89a0ed --- /dev/null +++ b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt @@ -0,0 +1,10 @@ +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'. + + +==== tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts (1 errors) ==== + function bar(item1: T, item2: T) { } + 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 diff --git a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types deleted file mode 100644 index 95214571df9..00000000000 --- a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts === -function bar(item1: T, item2: T) { } ->bar : (item1: T, item2: T) => void ->T : T ->item1 : T ->T : T ->item2 : T ->T : T - -bar(1, ""); // Should be ok ->bar(1, "") : void ->bar : (item1: T, item2: T) => void - diff --git a/tests/baselines/reference/for-inStatements.errors.txt b/tests/baselines/reference/for-inStatements.errors.txt index e90e3dea3d2..7e20b8ca316 100644 --- a/tests/baselines/reference/for-inStatements.errors.txt +++ b/tests/baselines/reference/for-inStatements.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + + ==== tests/cases/conformance/statements/for-inStatements/for-inStatements.ts (1 errors) ==== var aString: string; for (aString in {}) { } @@ -79,5 +82,5 @@ for (var x in Color) { } for (var x in Color.Blue) { } ~~~~~~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. \ No newline at end of file diff --git a/tests/baselines/reference/for-inStatementsInvalid.errors.txt b/tests/baselines/reference/for-inStatementsInvalid.errors.txt index 4b4fff8c51c..67e536a3069 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.errors.txt +++ b/tests/baselines/reference/for-inStatementsInvalid.errors.txt @@ -1,48 +1,66 @@ +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(2,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(5,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(8,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(10,10): error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(13,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(17,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(18,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(19,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(20,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(21,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(22,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(29,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(38,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(46,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(51,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(62,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + + ==== tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts (16 errors) ==== var aNumber: number; for (aNumber in {}) { } ~~~~~~~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. var aBoolean: boolean; for (aBoolean in {}) { } ~~~~~~~~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. var aRegExp: RegExp; for (aRegExp in {}) { } ~~~~~~~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. for (var idx : number in {}) { } ~~~ -!!! The left-hand side of a 'for...in' statement cannot use a type annotation. +!!! error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation. function fn(): void { } for (var x in fn()) { } ~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. var c : string, d:string, e; for (var x in c || d) { } ~~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. for (var x in e ? c : d) { } ~~~~~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. for (var x in 42 ? c : d) { } ~~~~~~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. for (var x in '' ? c : d) { } ~~~~~~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. for (var x in 42 ? d[x] : c[x]) { } ~~~~~~~~~~~~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. for (var x in c[23]) { } ~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. for (var x in ((x: T) => x)) { } for (var x in function (x: string, y: number) { return x + y }) { } @@ -51,7 +69,7 @@ biz() : number{ for (var x in this.biz()) { } ~~~~~~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. for (var x in this.biz) { } for (var x in this) { } return null; @@ -62,7 +80,7 @@ for (var x in this.baz) { } for (var x in this.baz()) { } ~~~~~~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. return null; } @@ -72,14 +90,14 @@ boz() { for (var x in this.biz()) { } ~~~~~~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. for (var x in this.biz) { } for (var x in this) { } for (var x in super.biz) { } for (var x in super.biz()) { } ~~~~~~~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. return null; } } @@ -92,5 +110,5 @@ for (var x in i[42]) { } ~~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. \ No newline at end of file diff --git a/tests/baselines/reference/for.errors.txt b/tests/baselines/reference/for.errors.txt index 8df068271a2..41ed5765c9a 100644 --- a/tests/baselines/reference/for.errors.txt +++ b/tests/baselines/reference/for.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/for.ts(29,6): error TS1109: Expression expected. + + ==== tests/cases/compiler/for.ts (1 errors) ==== for (var i = 0; i < 10; i++) { // ok var x1 = i; @@ -29,5 +32,5 @@ for () { // error ~ -!!! Expression expected. +!!! error TS1109: Expression expected. } \ No newline at end of file diff --git a/tests/baselines/reference/forIn.errors.txt b/tests/baselines/reference/forIn.errors.txt index 51a3b220359..ccc1423f1aa 100644 --- a/tests/baselines/reference/forIn.errors.txt +++ b/tests/baselines/reference/forIn.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/forIn.ts(2,10): error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation. +tests/cases/compiler/forIn.ts(20,4): error TS2304: Cannot find name 'k'. + + ==== tests/cases/compiler/forIn.ts (2 errors) ==== var arr = null; for (var i:number in arr) { // error ~ -!!! The left-hand side of a 'for...in' statement cannot use a type annotation. +!!! error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation. var x1 = arr[i]; var y1 = arr[i]; } @@ -22,5 +26,5 @@ // error in the body k[l] = 1; ~ -!!! Cannot find name 'k'. +!!! error TS2304: Cannot find name 'k'. } \ No newline at end of file diff --git a/tests/baselines/reference/forIn2.errors.txt b/tests/baselines/reference/forIn2.errors.txt index c1dbfa2da9b..f6a0b34e3e6 100644 --- a/tests/baselines/reference/forIn2.errors.txt +++ b/tests/baselines/reference/forIn2.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/forIn2.ts(1,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + + ==== tests/cases/compiler/forIn2.ts (1 errors) ==== for (var i in 1) { ~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. } \ No newline at end of file diff --git a/tests/baselines/reference/forInStatement2.errors.txt b/tests/baselines/reference/forInStatement2.errors.txt index ef064280a7e..575936eab5e 100644 --- a/tests/baselines/reference/forInStatement2.errors.txt +++ b/tests/baselines/reference/forInStatement2.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/forInStatement2.ts(2,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + + ==== tests/cases/compiler/forInStatement2.ts (1 errors) ==== var expr: number; for (var a in expr) { ~~~~ -!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. } \ No newline at end of file diff --git a/tests/baselines/reference/forInStatement4.errors.txt b/tests/baselines/reference/forInStatement4.errors.txt index b228fb93c89..816f706c77c 100644 --- a/tests/baselines/reference/forInStatement4.errors.txt +++ b/tests/baselines/reference/forInStatement4.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/forInStatement4.ts(2,10): error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation. + + ==== tests/cases/compiler/forInStatement4.ts (1 errors) ==== var expr: any; for (var a: number in expr) { ~ -!!! The left-hand side of a 'for...in' statement cannot use a type annotation. +!!! error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation. } \ No newline at end of file diff --git a/tests/baselines/reference/forInStatement7.errors.txt b/tests/baselines/reference/forInStatement7.errors.txt index 432fe82237f..6f8e18c40ab 100644 --- a/tests/baselines/reference/forInStatement7.errors.txt +++ b/tests/baselines/reference/forInStatement7.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/forInStatement7.ts(3,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. + + ==== tests/cases/compiler/forInStatement7.ts (1 errors) ==== var a: number; var expr: any; for (a in expr) { ~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. +!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. } \ No newline at end of file diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt index 17f50e3ff10..53ecb88363d 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt @@ -1,3 +1,17 @@ +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(32,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(33,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(34,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(35,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(36,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(39,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(40,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(43,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(46,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(47,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D)[]'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(50,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. +tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(53,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. + + ==== tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts (12 errors) ==== interface I { id: number; @@ -32,47 +46,47 @@ for( var a: any;;){} for( var a = 1;;){} ~ -!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. for( var a = 'a string';;){} ~ -!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. for( var a = new C();;){} ~ -!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. for( var a = new D();;){} ~ -!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. for( var a = M;;){} ~ -!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. for( var b: I;;){} for( var b = new C();;){} ~ -!!! Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. for( var b = new C2();;){} ~ -!!! Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. for(var f = F;;){} for( var f = (x: number) => '';;){} ~ -!!! Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. for(var arr: string[];;){} for( var arr = [1, 2, 3, 4];;){} ~~~ -!!! Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. for( var arr = [new C(), new C2(), new D()];;){} ~~~ -!!! Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '{}[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D)[]'. for(var arr2 = [new D()];;){} for( var arr2 = new Array>();;){} ~~~~ -!!! Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. for(var m: typeof M;;){} for( var m = M.A;;){} ~ -!!! Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.types b/tests/baselines/reference/forStatementsMultipleValidDecl.types index f894eef1404..c2458a306c7 100644 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.types +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.types @@ -39,7 +39,7 @@ for (var p: Point = { x: 0, y: undefined }; ;) { } >Point : Point >{ x: 0, y: undefined } : { x: number; y: undefined; } >x : number ->y : any +>y : undefined >undefined : undefined for (var p = { x: 1, y: undefined }; ;) { } @@ -65,7 +65,7 @@ for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } >y : number >{ x: 0, y: undefined } : { x: number; y: undefined; } >x : number ->y : any +>y : undefined >undefined : undefined for (var p: typeof p; ;) { } @@ -109,11 +109,11 @@ for (var a = ['a', 'b']; ;) { } for (var a = []; ;) { } >a : string[] >[] : string[] ->[] : string[] +>[] : undefined[] for (var a: string[] = []; ;) { } >a : string[] ->[] : string[] +>[] : undefined[] for (var a = new Array(); ;) { } >a : string[] diff --git a/tests/baselines/reference/forgottenNew.errors.txt b/tests/baselines/reference/forgottenNew.errors.txt index ba44223819c..56e5d2bfd24 100644 --- a/tests/baselines/reference/forgottenNew.errors.txt +++ b/tests/baselines/reference/forgottenNew.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/expressions/functionCalls/forgottenNew.ts(5,14): error TS2348: Value of type 'typeof NullLogger' is not callable. Did you mean to include 'new'? + + ==== tests/cases/conformance/expressions/functionCalls/forgottenNew.ts (1 errors) ==== module Tools { export class NullLogger { } @@ -5,4 +8,4 @@ var logger = Tools.NullLogger(); ~~~~~~~~~~~~~~~~~~ -!!! Value of type 'typeof NullLogger' is not callable. Did you mean to include 'new'? \ No newline at end of file +!!! error TS2348: Value of type 'typeof NullLogger' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/funClodule.errors.txt b/tests/baselines/reference/funClodule.errors.txt index e4d72d3fc0d..72a9ed0db51 100644 --- a/tests/baselines/reference/funClodule.errors.txt +++ b/tests/baselines/reference/funClodule.errors.txt @@ -1,26 +1,49 @@ -==== tests/cases/compiler/funClodule.ts (3 errors) ==== +tests/cases/compiler/funClodule.ts(1,18): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/funClodule.ts(2,16): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/funClodule.ts(5,15): error TS2300: Duplicate identifier 'foo'. +tests/cases/compiler/funClodule.ts(8,15): error TS2300: Duplicate identifier 'foo2'. +tests/cases/compiler/funClodule.ts(9,16): error TS2300: Duplicate identifier 'foo2'. +tests/cases/compiler/funClodule.ts(12,18): error TS2300: Duplicate identifier 'foo2'. +tests/cases/compiler/funClodule.ts(15,10): error TS2300: Duplicate identifier 'foo3'. +tests/cases/compiler/funClodule.ts(16,8): error TS2300: Duplicate identifier 'foo3'. +tests/cases/compiler/funClodule.ts(19,7): error TS2300: Duplicate identifier 'foo3'. + + +==== tests/cases/compiler/funClodule.ts (9 errors) ==== declare function foo(); + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. declare module foo { + ~~~ +!!! error TS2300: Duplicate identifier 'foo'. export function x(): any; } declare class foo { } // Should error ~~~ -!!! Duplicate identifier 'foo'. +!!! error TS2300: Duplicate identifier 'foo'. declare class foo2 { } + ~~~~ +!!! error TS2300: Duplicate identifier 'foo2'. declare module foo2 { + ~~~~ +!!! error TS2300: Duplicate identifier 'foo2'. export function x(): any; } declare function foo2(); // Should error ~~~~ -!!! Duplicate identifier 'foo2'. +!!! error TS2300: Duplicate identifier 'foo2'. function foo3() { } + ~~~~ +!!! error TS2300: Duplicate identifier 'foo3'. module foo3 { + ~~~~ +!!! error TS2300: Duplicate identifier 'foo3'. export function x(): any { } } class foo3 { } // Should error ~~~~ -!!! Duplicate identifier 'foo3'. \ No newline at end of file +!!! error TS2300: Duplicate identifier 'foo3'. \ No newline at end of file diff --git a/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.errors.txt b/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.errors.txt index 58936d29dbb..72f24af0c63 100644 --- a/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.errors.txt +++ b/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/functionAndInterfaceWithSeparateErrors.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. +tests/cases/compiler/functionAndInterfaceWithSeparateErrors.ts(6,5): error TS2411: Property 'prop' of type 'number' is not assignable to string index type 'string'. + + ==== tests/cases/compiler/functionAndInterfaceWithSeparateErrors.ts (2 errors) ==== function Foo(s: string); ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function Foo(n: number) { } interface Foo { [s: string]: string; prop: number; ~~~~~~~~~~~~~ -!!! Property 'prop' of type 'number' is not assignable to string index type 'string'. +!!! error TS2411: Property 'prop' of type 'number' is not assignable to string index type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt b/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt index 4eda4b8136c..640844064c4 100644 --- a/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt +++ b/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt @@ -1,11 +1,18 @@ -==== tests/cases/compiler/functionAndPropertyNameConflict.ts (2 errors) ==== +tests/cases/compiler/functionAndPropertyNameConflict.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/functionAndPropertyNameConflict.ts(2,12): error TS2300: Duplicate identifier 'aaaaa'. +tests/cases/compiler/functionAndPropertyNameConflict.ts(3,16): error TS2300: Duplicate identifier 'aaaaa'. + + +==== tests/cases/compiler/functionAndPropertyNameConflict.ts (3 errors) ==== class C65 { public aaaaa() { } + ~~~~~ +!!! error TS2300: Duplicate identifier 'aaaaa'. public get aaaaa() { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~ -!!! Duplicate identifier 'aaaaa'. +!!! error TS2300: Duplicate identifier 'aaaaa'. return 1; } } \ No newline at end of file diff --git a/tests/baselines/reference/functionArgShadowing.errors.txt b/tests/baselines/reference/functionArgShadowing.errors.txt index f1583f4185e..93022178452 100644 --- a/tests/baselines/reference/functionArgShadowing.errors.txt +++ b/tests/baselines/reference/functionArgShadowing.errors.txt @@ -1,20 +1,25 @@ +tests/cases/compiler/functionArgShadowing.ts(4,8): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'A', but here has type 'B'. +tests/cases/compiler/functionArgShadowing.ts(5,8): error TS2339: Property 'bar' does not exist on type 'A'. +tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'number', but here has type 'string'. + + ==== tests/cases/compiler/functionArgShadowing.ts (3 errors) ==== class A { foo() { } } class B { bar() { } } function foo(x: A) { var x: B = new B(); ~ -!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'A', but here has type 'B'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'A', but here has type 'B'. x.bar(); // the property bar does not exist on a value of type A ~~~ -!!! Property 'bar' does not exist on type 'A'. +!!! error TS2339: Property 'bar' does not exist on type 'A'. } class C { constructor(public p: number) { var p: string; ~ -!!! Subsequent variable declarations must have the same type. Variable 'p' must be of type 'number', but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'number', but here has type 'string'. var n: number = p; } diff --git a/tests/baselines/reference/functionAssignment.errors.txt b/tests/baselines/reference/functionAssignment.errors.txt index 76981e98885..19fd0897f98 100644 --- a/tests/baselines/reference/functionAssignment.errors.txt +++ b/tests/baselines/reference/functionAssignment.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/functionAssignment.ts(22,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/functionAssignment.ts(34,17): error TS2339: Property 'length' does not exist on type 'number'. + + ==== tests/cases/compiler/functionAssignment.ts (2 errors) ==== function f(n: Function) { } f(function () { }); @@ -22,7 +26,7 @@ var n = ''; n = 4; ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. }); function f3(a: { a: number; b: number; }) { } @@ -36,7 +40,7 @@ callb((a) =>{ a.length; }); ~~~~~~ -!!! Property 'length' does not exist on type 'number'. +!!! error TS2339: Property 'length' does not exist on type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall10.errors.txt b/tests/baselines/reference/functionCall10.errors.txt index 5ae80cff0e8..8352fc70a58 100644 --- a/tests/baselines/reference/functionCall10.errors.txt +++ b/tests/baselines/reference/functionCall10.errors.txt @@ -1,11 +1,15 @@ +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 (2 errors) ==== function foo(...a:number[]){}; foo(0, 1); foo('foo'); ~~~~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. foo(); foo(1, 'bar'); ~~~~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' 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 91593adb4e5..a1790974bbb 100644 --- a/tests/baselines/reference/functionCall11.errors.txt +++ b/tests/baselines/reference/functionCall11.errors.txt @@ -1,14 +1,19 @@ +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(6,1): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/functionCall11.ts (3 errors) ==== function foo(a:string, b?:number){} foo('foo', 1); foo('foo'); foo(); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 1, 'bar'); ~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall12.errors.txt b/tests/baselines/reference/functionCall12.errors.txt index 1a89772d74e..eabe1131ec1 100644 --- a/tests/baselines/reference/functionCall12.errors.txt +++ b/tests/baselines/reference/functionCall12.errors.txt @@ -1,15 +1,20 @@ +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 (3 errors) ==== function foo(a:string, b?:number, c?:string){} foo('foo', 1); foo('foo'); foo(); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 1, 'bar'); foo('foo', 1, 3); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' 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 72a06c77c94..31c05915aab 100644 --- a/tests/baselines/reference/functionCall13.errors.txt +++ b/tests/baselines/reference/functionCall13.errors.txt @@ -1,12 +1,16 @@ +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 (2 errors) ==== function foo(a:string, ...b:number[]){} foo('foo', 1); foo('foo'); foo(); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' 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 adfd2530532..3b671d0252b 100644 --- a/tests/baselines/reference/functionCall14.errors.txt +++ b/tests/baselines/reference/functionCall14.errors.txt @@ -1,3 +1,6 @@ +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 (1 errors) ==== function foo(a?:string, ...b:number[]){} foo('foo', 1); @@ -5,6 +8,6 @@ foo(); foo(1, 'bar'); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 1, 3); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall15.errors.txt b/tests/baselines/reference/functionCall15.errors.txt index cb009fc63ab..4b6acf34e14 100644 --- a/tests/baselines/reference/functionCall15.errors.txt +++ b/tests/baselines/reference/functionCall15.errors.txt @@ -1,4 +1,10 @@ -==== tests/cases/compiler/functionCall15.ts (1 errors) ==== +tests/cases/compiler/functionCall15.ts(1,25): error TS2300: Duplicate identifier 'b'. +tests/cases/compiler/functionCall15.ts(1,39): error TS2300: Duplicate identifier 'b'. + + +==== tests/cases/compiler/functionCall15.ts (2 errors) ==== function foo(a?:string, b?:number, ...b:number[]){} + ~ +!!! error TS2300: Duplicate identifier 'b'. ~ -!!! Duplicate identifier 'b'. \ No newline at end of file +!!! error TS2300: Duplicate identifier 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall16.errors.txt b/tests/baselines/reference/functionCall16.errors.txt index f29d90f56c2..eb71df23eca 100644 --- a/tests/baselines/reference/functionCall16.errors.txt +++ b/tests/baselines/reference/functionCall16.errors.txt @@ -1,15 +1,20 @@ +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(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 (3 errors) ==== function foo(a:string, b?:string, ...c:number[]){} foo('foo', 1); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo'); foo('foo', 'bar'); foo(); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' 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 f6280586cb2..09f36c22cfb 100644 --- a/tests/baselines/reference/functionCall17.errors.txt +++ b/tests/baselines/reference/functionCall17.errors.txt @@ -1,17 +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(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 (4 errors) ==== function foo(a:string, b?:string, c?:number, ...d:number[]){} foo('foo', 1); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo'); foo(); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 1, 3); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' 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/functionCall3.types b/tests/baselines/reference/functionCall3.types index a9b8e46069c..ea47de3e6d9 100644 --- a/tests/baselines/reference/functionCall3.types +++ b/tests/baselines/reference/functionCall3.types @@ -1,7 +1,7 @@ === tests/cases/compiler/functionCall3.ts === function foo():any[]{return [1];} >foo : () => any[] ->[1] : any[] +>[1] : number[] var x = foo(); >x : any[] diff --git a/tests/baselines/reference/functionCall6.errors.txt b/tests/baselines/reference/functionCall6.errors.txt index c871e15d30a..4da265ea5e2 100644 --- a/tests/baselines/reference/functionCall6.errors.txt +++ b/tests/baselines/reference/functionCall6.errors.txt @@ -1,13 +1,18 @@ +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(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. + + ==== tests/cases/compiler/functionCall6.ts (3 errors) ==== function foo(a:string){}; foo('bar'); foo(2); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 'bar'); ~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. foo(); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall7.errors.txt b/tests/baselines/reference/functionCall7.errors.txt index d41add08dd3..576ea9c266e 100644 --- a/tests/baselines/reference/functionCall7.errors.txt +++ b/tests/baselines/reference/functionCall7.errors.txt @@ -1,3 +1,8 @@ +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(7,1): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/functionCall7.ts (3 errors) ==== module m1 { export class c1 { public a; }} function foo(a:m1.c1){ a.a = 1; }; @@ -5,11 +10,11 @@ foo(myC); foo(myC, myC); ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. foo(4); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'c1'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. foo(); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall8.errors.txt b/tests/baselines/reference/functionCall8.errors.txt index 85eee804724..0e5479c8cfd 100644 --- a/tests/baselines/reference/functionCall8.errors.txt +++ b/tests/baselines/reference/functionCall8.errors.txt @@ -1,11 +1,15 @@ +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 (2 errors) ==== function foo(a?:string){} foo('foo'); foo('foo', 'bar'); ~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. foo(4); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' 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 5feb59f77c6..d9d00593414 100644 --- a/tests/baselines/reference/functionCall9.errors.txt +++ b/tests/baselines/reference/functionCall9.errors.txt @@ -1,11 +1,15 @@ +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(5,1): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/functionCall9.ts (2 errors) ==== function foo(a?:string, b?:number){}; foo('foo', 1); foo('foo'); foo('foo','bar'); ~~~~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. foo('foo', 1, 'bar'); ~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. foo(); \ No newline at end of file diff --git a/tests/baselines/reference/functionCalls.errors.txt b/tests/baselines/reference/functionCalls.errors.txt index 3aa587c70a3..dc1417cdc98 100644 --- a/tests/baselines/reference/functionCalls.errors.txt +++ b/tests/baselines/reference/functionCalls.errors.txt @@ -1,3 +1,14 @@ +tests/cases/conformance/expressions/functionCalls/functionCalls.ts(9,1): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/expressions/functionCalls/functionCalls.ts(10,1): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/expressions/functionCalls/functionCalls.ts(11,1): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/expressions/functionCalls/functionCalls.ts(26,1): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/expressions/functionCalls/functionCalls.ts(27,1): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/expressions/functionCalls/functionCalls.ts(28,1): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/expressions/functionCalls/functionCalls.ts(33,1): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/expressions/functionCalls/functionCalls.ts(34,1): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/expressions/functionCalls/functionCalls.ts(35,1): error TS2347: Untyped function calls may not accept type arguments. + + ==== tests/cases/conformance/expressions/functionCalls/functionCalls.ts (9 errors) ==== // Invoke function call on value of type 'any' with no type arguments @@ -9,13 +20,13 @@ // These should be errors anyVar('hello'); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. anyVar(); ~~~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. anyVar(undefined); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. // Invoke function call on value of a subtype of Function with no call signatures with no type arguments @@ -32,24 +43,24 @@ // These should be errors subFunc(0); ~~~~~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. subFunc(''); ~~~~~~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. subFunc(); ~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. // Invoke function call on value of type Function with no call signatures with type arguments // These should be errors var func: Function; func(0); ~~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. func(''); ~~~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. func(); ~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. +!!! error TS2347: Untyped function calls may not accept type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 3fb2b84fed5..4af5c01c505 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -1,3 +1,19 @@ +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(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'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(24,15): error TS2345: Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(25,15): error TS2345: Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(26,15): error TS2345: Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(28,16): error TS2345: Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(29,16): error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(30,16): error TS2345: Argument of type 'new (x: T) => T' is not assignable to parameter of type '(x: string) => string'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(34,16): error TS2345: Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(36,38): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(37,10): error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(38,10): error TS2345: Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. + + ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts (14 errors) ==== // satisfaction of a constraint to Function, all of these invocations are errors unless otherwise noted @@ -5,13 +21,13 @@ foo(1); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'Function'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Function'. foo(() => { }, 1); ~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, () => { }); ~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. function foo2 string>(x: T): T { return x; } @@ -29,41 +45,41 @@ var r = foo2(new Function()); ~~~~~~~~~~~~~~ -!!! Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'. var r2 = foo2((x: string[]) => x); ~~~~~~~~~~~~~~~~~~ -!!! Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'. var r6 = foo2(C); ~ -!!! Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'. var r7 = foo2(b); ~ -!!! Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'. var r8 = foo2((x: U) => x); // no error expected var r11 = foo2((x: U, y: V) => x); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. var r13 = foo2(C2); ~~ -!!! Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. var r14 = foo2(b2); ~~ -!!! Argument of type 'new (x: T) => T' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Argument of type 'new (x: T) => T' is not assignable to parameter of type '(x: string) => string'. interface F2 extends Function { foo: string; } var f2: F2; var r16 = foo2(f2); ~~ -!!! Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'. function fff(x: T, y: U) { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo2(x); ~ -!!! Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. foo2(y); ~ -!!! Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. } \ No newline at end of file diff --git a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js index 37bcf84669c..a959e52bdae 100644 --- a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js +++ b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js @@ -12,5 +12,5 @@ function foo(args) { //// [functionDeclarationWithArgumentOfTypeFunctionTypeArray.d.ts] declare function foo(args: { - (x: any): number; + (x): number; }[]): number; diff --git a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.types b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.types index af751fbb0e9..a1d32a2a405 100644 --- a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.types +++ b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.types @@ -1,12 +1,12 @@ === tests/cases/compiler/functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts === function foo(args: { (x): number }[]) { ->foo : (args: { (x: any): number; }[]) => number ->args : { (x: any): number; }[] +>foo : (args: ((x: any) => number)[]) => number +>args : ((x: any) => number)[] >x : any return args.length; >args.length : number ->args : { (x: any): number; }[] +>args : ((x: any) => number)[] >length : number } diff --git a/tests/baselines/reference/functionExpressionInWithBlock.errors.txt b/tests/baselines/reference/functionExpressionInWithBlock.errors.txt index 6a0947e95b2..eabb8af49f9 100644 --- a/tests/baselines/reference/functionExpressionInWithBlock.errors.txt +++ b/tests/baselines/reference/functionExpressionInWithBlock.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/functionExpressionInWithBlock.ts(2,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. + + ==== tests/cases/compiler/functionExpressionInWithBlock.ts (1 errors) ==== function x() { with({}) { ~~ -!!! All symbols within a 'with' block will be resolved to 'any'. +!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. function f() { () => this; } diff --git a/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt b/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt index e8f34d5d556..74b4c171a57 100644 --- a/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt +++ b/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt @@ -1,9 +1,13 @@ +tests/cases/compiler/functionExpressionShadowedByParams.ts(3,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/functionExpressionShadowedByParams.ts(10,9): error TS2339: Property 'apply' does not exist on type 'number'. + + ==== tests/cases/compiler/functionExpressionShadowedByParams.ts (2 errors) ==== function b1(b1: number) { b1.toPrecision(2); // should not error b1(12); // should error ~~~~~~ -!!! Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. } @@ -12,7 +16,7 @@ b.toPrecision(2); // should not error b.apply(null, null); // should error ~~~~~ -!!! Property 'apply' does not exist on type 'number'. +!!! error TS2339: Property 'apply' does not exist on type 'number'. } }; \ No newline at end of file diff --git a/tests/baselines/reference/functionImplementationErrors.errors.txt b/tests/baselines/reference/functionImplementationErrors.errors.txt index 5c2d678840e..fbae17a609d 100644 --- a/tests/baselines/reference/functionImplementationErrors.errors.txt +++ b/tests/baselines/reference/functionImplementationErrors.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/functions/functionImplementationErrors.ts(2,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(6,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(10,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(16,10): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/functions/functionImplementationErrors.ts(25,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/conformance/functions/functionImplementationErrors.ts(30,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. +tests/cases/conformance/functions/functionImplementationErrors.ts(35,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. +tests/cases/conformance/functions/functionImplementationErrors.ts(40,28): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + + ==== tests/cases/conformance/functions/functionImplementationErrors.ts (8 errors) ==== // FunctionExpression with no return type annotation with multiple return statements with unrelated types var f1 = function () { @@ -8,7 +18,7 @@ ~~~~~~~~~~~~~ }; ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. var f2 = function x() { ~~~~~~~~~~~~~~ return ''; @@ -17,7 +27,7 @@ ~~~~~~~~~~~~~ }; ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. var f3 = () => { ~~~~~~~ return ''; @@ -26,7 +36,7 @@ ~~~~~~~~~~~~~ }; ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. // FunctionExpression with no return type annotation with return branch of number[] and other of string[] var f4 = function () { @@ -43,33 +53,33 @@ ~~~~~ } ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. // Function implemetnation with non -void return type annotation with no return function f5(): number { ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. } var m; // Function signature with parameter initializer referencing in scope local variable function f6(n = m) { ~ -!!! Initializer of parameter 'n' cannot reference identifier 'm' declared after it. +!!! error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. var m = 4; } // Function signature with initializer referencing other parameter to the right function f7(n = m, m?) { ~ -!!! Initializer of parameter 'n' cannot reference identifier 'm' declared after it. +!!! error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. } // FunctionExpression with non -void return type annotation with a throw, no return, and other code // Should be error but isn't undefined === function (): number { ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. throw undefined; var x = 4; }; diff --git a/tests/baselines/reference/functionImplementations.types b/tests/baselines/reference/functionImplementations.types index fe03fa58d98..29fe7c0e39c 100644 --- a/tests/baselines/reference/functionImplementations.types +++ b/tests/baselines/reference/functionImplementations.types @@ -253,8 +253,8 @@ function opt2(n = { x: null, y: undefined }) { >opt2 : (n?: { x: any; y: any; }) => void >n : { x: any; y: any; } >{ x: null, y: undefined } : { x: null; y: undefined; } ->x : any ->y : any +>x : null +>y : undefined >undefined : undefined var m = n; diff --git a/tests/baselines/reference/functionNameConflicts.errors.txt b/tests/baselines/reference/functionNameConflicts.errors.txt index 0442a51324b..86fa348d817 100644 --- a/tests/baselines/reference/functionNameConflicts.errors.txt +++ b/tests/baselines/reference/functionNameConflicts.errors.txt @@ -1,40 +1,63 @@ -==== tests/cases/conformance/functions/functionNameConflicts.ts (6 errors) ==== +tests/cases/conformance/functions/functionNameConflicts.ts(5,14): error TS2300: Duplicate identifier 'fn1'. +tests/cases/conformance/functions/functionNameConflicts.ts(6,9): error TS2300: Duplicate identifier 'fn1'. +tests/cases/conformance/functions/functionNameConflicts.ts(8,9): error TS2300: Duplicate identifier 'fn2'. +tests/cases/conformance/functions/functionNameConflicts.ts(9,14): error TS2300: Duplicate identifier 'fn2'. +tests/cases/conformance/functions/functionNameConflicts.ts(12,10): error TS2300: Duplicate identifier 'fn3'. +tests/cases/conformance/functions/functionNameConflicts.ts(13,5): error TS2300: Duplicate identifier 'fn3'. +tests/cases/conformance/functions/functionNameConflicts.ts(16,9): error TS2300: Duplicate identifier 'fn4'. +tests/cases/conformance/functions/functionNameConflicts.ts(17,14): error TS2300: Duplicate identifier 'fn4'. +tests/cases/conformance/functions/functionNameConflicts.ts(19,14): error TS2300: Duplicate identifier 'fn5'. +tests/cases/conformance/functions/functionNameConflicts.ts(20,9): error TS2300: Duplicate identifier 'fn5'. +tests/cases/conformance/functions/functionNameConflicts.ts(24,10): error TS2389: Function implementation name must be 'over'. + + +==== tests/cases/conformance/functions/functionNameConflicts.ts (11 errors) ==== //Function and variable of the same name in same declaration space //Function overload with different name from implementation signature module M { function fn1() { } + ~~~ +!!! error TS2300: Duplicate identifier 'fn1'. var fn1; ~~~ -!!! Duplicate identifier 'fn1'. +!!! error TS2300: Duplicate identifier 'fn1'. var fn2; + ~~~ +!!! error TS2300: Duplicate identifier 'fn2'. function fn2() { } ~~~ -!!! Duplicate identifier 'fn2'. +!!! error TS2300: Duplicate identifier 'fn2'. } function fn3() { } + ~~~ +!!! error TS2300: Duplicate identifier 'fn3'. var fn3; ~~~ -!!! Duplicate identifier 'fn3'. +!!! error TS2300: Duplicate identifier 'fn3'. function func() { var fn4; + ~~~ +!!! error TS2300: Duplicate identifier 'fn4'. function fn4() { } ~~~ -!!! Duplicate identifier 'fn4'. +!!! error TS2300: Duplicate identifier 'fn4'. function fn5() { } + ~~~ +!!! error TS2300: Duplicate identifier 'fn5'. var fn5; ~~~ -!!! Duplicate identifier 'fn5'. +!!! error TS2300: Duplicate identifier 'fn5'. } function over(); function overrr() { ~~~~~~ -!!! Function implementation name must be 'over'. +!!! error TS2389: Function implementation name must be 'over'. } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadAmbiguity1.errors.txt b/tests/baselines/reference/functionOverloadAmbiguity1.errors.txt index 7c9eb9482df..75fc140bc68 100644 --- a/tests/baselines/reference/functionOverloadAmbiguity1.errors.txt +++ b/tests/baselines/reference/functionOverloadAmbiguity1.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/functionOverloadAmbiguity1.ts(4,18): error TS2339: Property 'length' does not exist on type 'number'. + + ==== tests/cases/compiler/functionOverloadAmbiguity1.ts (1 errors) ==== function callb(lam: (l: number) => void ); function callb(lam: (n: string) => void ); function callb(a) { } callb((a) => { a.length; } ); // error, chose first overload ~~~~~~ -!!! Property 'length' does not exist on type 'number'. +!!! error TS2339: Property 'length' does not exist on type 'number'. function callb2(lam: (n: string) => void ); function callb2(lam: (l: number) => void ); diff --git a/tests/baselines/reference/functionOverloadErrors.errors.txt b/tests/baselines/reference/functionOverloadErrors.errors.txt index c2fcff7a943..bc4fea0a98b 100644 --- a/tests/baselines/reference/functionOverloadErrors.errors.txt +++ b/tests/baselines/reference/functionOverloadErrors.errors.txt @@ -1,8 +1,24 @@ +tests/cases/conformance/functions/functionOverloadErrors.ts(2,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/conformance/functions/functionOverloadErrors.ts(44,25): error TS2304: Cannot find name 'Window'. +tests/cases/conformance/functions/functionOverloadErrors.ts(50,25): error TS2304: Cannot find name 'Window'. +tests/cases/conformance/functions/functionOverloadErrors.ts(51,32): error TS2304: Cannot find name 'window'. +tests/cases/conformance/functions/functionOverloadErrors.ts(65,13): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/functions/functionOverloadErrors.ts(68,13): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/functions/functionOverloadErrors.ts(75,21): error TS2383: Overload signatures must all be exported or not exported. +tests/cases/conformance/functions/functionOverloadErrors.ts(79,14): error TS2383: Overload signatures must all be exported or not exported. +tests/cases/conformance/functions/functionOverloadErrors.ts(85,18): error TS2384: Overload signatures must all be ambient or non-ambient. +tests/cases/conformance/functions/functionOverloadErrors.ts(90,18): error TS2384: Overload signatures must all be ambient or non-ambient. +tests/cases/conformance/functions/functionOverloadErrors.ts(94,1): error TS2394: Overload signature is not compatible with function implementation. +tests/cases/conformance/functions/functionOverloadErrors.ts(99,1): error TS2394: Overload signature is not compatible with function implementation. +tests/cases/conformance/functions/functionOverloadErrors.ts(103,1): error TS2394: Overload signature is not compatible with function implementation. +tests/cases/conformance/functions/functionOverloadErrors.ts(116,19): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + + ==== tests/cases/conformance/functions/functionOverloadErrors.ts (14 errors) ==== //Function overload signature with initializer function fn1(x = 3); ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. function fn1() { } //Multiple function overload signatures that are identical @@ -46,7 +62,7 @@ //Function overloads that differ only by type parameter constraints function fn10(); ~~~~~~ -!!! Cannot find name 'Window'. +!!! error TS2304: Cannot find name 'Window'. function fn10(); function fn10() { } // (actually OK) @@ -54,10 +70,10 @@ //Function overloads that differ only by type parameter constraints where constraints are structually identical function fn11(); ~~~~~~ -!!! Cannot find name 'Window'. +!!! error TS2304: Cannot find name 'Window'. function fn11(); ~~~~~~ -!!! Cannot find name 'window'. +!!! error TS2304: Cannot find name 'window'. function fn11() { } //Function overloads that differ only by type parameter constraints where constraints include infinitely recursive type reference @@ -73,12 +89,12 @@ public f(); private f(s: string); ~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. f() { } private g(s: string); ~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. public g(); g() { } } @@ -87,13 +103,13 @@ module M { export function fn1(); ~~~ -!!! Overload signatures must all be exported or not exported. +!!! error TS2383: Overload signatures must all be exported or not exported. function fn1(n: string); function fn1() { } function fn2(n: string); ~~~ -!!! Overload signatures must all be exported or not exported. +!!! error TS2383: Overload signatures must all be exported or not exported. export function fn2(); export function fn2() { } } @@ -101,33 +117,33 @@ //Function overloads with differing ambience declare function dfn1(); ~~~~ -!!! Overload signatures must all be ambient or non-ambient. +!!! error TS2384: Overload signatures must all be ambient or non-ambient. function dfn1(s: string); function dfn1() { } function dfn2(); declare function dfn2(s: string); ~~~~ -!!! Overload signatures must all be ambient or non-ambient. +!!! error TS2384: Overload signatures must all be ambient or non-ambient. function dfn2() { } //Function overloads with fewer params than implementation signature function fewerParams(); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function fewerParams(n: string) { } //Function implementation whose parameter types are not assignable to all corresponding overload signature parameters function fn13(n: string); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function fn13(n: number) { } //Function overloads where return types are not all subtype of implementation return type function fn14(n: string): string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function fn14() { return 3; } @@ -142,6 +158,6 @@ //Function overloads which use initializer expressions function initExpr(n = 13); ~~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. function initExpr() { } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadErrorsSyntax.errors.txt b/tests/baselines/reference/functionOverloadErrorsSyntax.errors.txt index 81f7a63b967..98e7f4cd714 100644 --- a/tests/baselines/reference/functionOverloadErrorsSyntax.errors.txt +++ b/tests/baselines/reference/functionOverloadErrorsSyntax.errors.txt @@ -1,18 +1,23 @@ +tests/cases/conformance/functions/functionOverloadErrorsSyntax.ts(2,27): error TS1016: A required parameter cannot follow an optional parameter. +tests/cases/conformance/functions/functionOverloadErrorsSyntax.ts(5,38): error TS1016: A required parameter cannot follow an optional parameter. +tests/cases/conformance/functions/functionOverloadErrorsSyntax.ts(9,28): error TS1014: A rest parameter must be last in a parameter list. + + ==== tests/cases/conformance/functions/functionOverloadErrorsSyntax.ts (3 errors) ==== //Function overload signature with optional parameter followed by non-optional parameter function fn4a(x?: number, y: string); ~ -!!! A required parameter cannot follow an optional parameter. +!!! error TS1016: A required parameter cannot follow an optional parameter. function fn4a() { } function fn4b(n: string, x?: number, y: string); ~ -!!! A required parameter cannot follow an optional parameter. +!!! error TS1016: A required parameter cannot follow an optional parameter. function fn4b() { } //Function overload signature with rest param followed by non-optional parameter function fn5(x: string, ...y: any[], z: string); ~ -!!! A rest parameter must be last in a parameter list. +!!! error TS1014: A rest parameter must be last in a parameter list. function fn5() { } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt b/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt index 427595d1e05..d1d02f63ccf 100644 --- a/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt +++ b/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/functionOverloadImplementationOfWrongName.ts(3,10): error TS2389: Function implementation name must be 'foo'. + + ==== tests/cases/compiler/functionOverloadImplementationOfWrongName.ts (1 errors) ==== function foo(x); function foo(x, y); function bar() { } ~~~ -!!! Function implementation name must be 'foo'. \ No newline at end of file +!!! error TS2389: Function implementation name must be 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt b/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt index c656065b375..07826696854 100644 --- a/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt +++ b/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/functionOverloadImplementationOfWrongName2.ts(2,10): error TS2389: Function implementation name must be 'foo'. +tests/cases/compiler/functionOverloadImplementationOfWrongName2.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/functionOverloadImplementationOfWrongName2.ts (2 errors) ==== function foo(x); function bar() { } ~~~ -!!! Function implementation name must be 'foo'. +!!! error TS2389: Function implementation name must be 'foo'. function foo(x, y); ~~~ -!!! Function implementation is missing or not immediately following the declaration. \ No newline at end of file +!!! error TS2391: Function implementation is missing or not immediately following the declaration. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads.errors.txt b/tests/baselines/reference/functionOverloads.errors.txt index 1b2e20e5a8d..bd3bab3388b 100644 --- a/tests/baselines/reference/functionOverloads.errors.txt +++ b/tests/baselines/reference/functionOverloads.errors.txt @@ -1,7 +1,10 @@ +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 (1 errors) ==== function foo(): string; function foo(bar: string): number; function foo(bar?: string): any { return "" }; var x = foo(5); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads1.errors.txt b/tests/baselines/reference/functionOverloads1.errors.txt index 610363c772f..1f920c0ecf1 100644 --- a/tests/baselines/reference/functionOverloads1.errors.txt +++ b/tests/baselines/reference/functionOverloads1.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/functionOverloads1.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/functionOverloads1.ts (1 errors) ==== function foo(); ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. 1+1; function foo():string { return "a" } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads11.errors.txt b/tests/baselines/reference/functionOverloads11.errors.txt index a3a8393ec78..18155cbe69f 100644 --- a/tests/baselines/reference/functionOverloads11.errors.txt +++ b/tests/baselines/reference/functionOverloads11.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/functionOverloads11.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. + + ==== tests/cases/compiler/functionOverloads11.ts (1 errors) ==== function foo():number; ~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function foo():string { return "" } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads17.errors.txt b/tests/baselines/reference/functionOverloads17.errors.txt index 434cacaeac1..44565702632 100644 --- a/tests/baselines/reference/functionOverloads17.errors.txt +++ b/tests/baselines/reference/functionOverloads17.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/functionOverloads17.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. + + ==== tests/cases/compiler/functionOverloads17.ts (1 errors) ==== function foo():{a:number;} ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function foo():{a:string;} { return {a:""} } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads18.errors.txt b/tests/baselines/reference/functionOverloads18.errors.txt index 9db680de2e2..384c1e3fa8f 100644 --- a/tests/baselines/reference/functionOverloads18.errors.txt +++ b/tests/baselines/reference/functionOverloads18.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/functionOverloads18.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. + + ==== tests/cases/compiler/functionOverloads18.ts (1 errors) ==== function foo(bar:{a:number;}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function foo(bar:{a:string;}) { return {a:""} } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads19.errors.txt b/tests/baselines/reference/functionOverloads19.errors.txt index 807a3383c86..4c6935493e9 100644 --- a/tests/baselines/reference/functionOverloads19.errors.txt +++ b/tests/baselines/reference/functionOverloads19.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/functionOverloads19.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. + + ==== tests/cases/compiler/functionOverloads19.ts (1 errors) ==== function foo(bar:{b:string;}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function foo(bar:{a:string;}); function foo(bar:{a:any;}) { return {a:""} } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index c0023ab9dcd..85a4a882487 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,7 +1,10 @@ +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 (1 errors) ==== function foo(bar: string): string; function foo(bar: number): number; function foo(bar: any): any { return bar }; var x = foo(true); ~~~~ -!!! Argument of type 'boolean' is not assignable to parameter of type 'number'. \ No newline at end of file +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads20.errors.txt b/tests/baselines/reference/functionOverloads20.errors.txt index 106dde569a8..2a51afefe0c 100644 --- a/tests/baselines/reference/functionOverloads20.errors.txt +++ b/tests/baselines/reference/functionOverloads20.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/functionOverloads20.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. + + ==== tests/cases/compiler/functionOverloads20.ts (1 errors) ==== function foo(bar:{a:number;}): number; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function foo(bar:{a:string;}): string; function foo(bar:{a:any;}): string {return ""} \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads22.errors.txt b/tests/baselines/reference/functionOverloads22.errors.txt index e091094f01e..bc075e0c3ef 100644 --- a/tests/baselines/reference/functionOverloads22.errors.txt +++ b/tests/baselines/reference/functionOverloads22.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/functionOverloads22.ts(2,1): error TS2394: Overload signature is not compatible with function implementation. + + ==== tests/cases/compiler/functionOverloads22.ts (1 errors) ==== function foo(bar:number):{a:number;}[]; function foo(bar:string):{a:number; b:string;}[]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function foo(bar:any):{a:any;b?:any;}[] { return [{a:""}] } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads27.errors.txt b/tests/baselines/reference/functionOverloads27.errors.txt index 35216e2fe42..a5d16935f2f 100644 --- a/tests/baselines/reference/functionOverloads27.errors.txt +++ b/tests/baselines/reference/functionOverloads27.errors.txt @@ -1,8 +1,11 @@ +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 (1 errors) ==== function foo():string; function foo(bar:string):number; function foo(bar?:any):any{ return '' } var x = foo(5); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads29.errors.txt b/tests/baselines/reference/functionOverloads29.errors.txt index 510d9c4575f..763405e351b 100644 --- a/tests/baselines/reference/functionOverloads29.errors.txt +++ b/tests/baselines/reference/functionOverloads29.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/functionOverloads29.ts(4,9): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/functionOverloads29.ts (1 errors) ==== function foo(bar:string):string; function foo(bar:number):number; function foo(bar:any):any{ return bar } var x = foo(); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads3.errors.txt b/tests/baselines/reference/functionOverloads3.errors.txt index b153d81c109..1f02b0fbc47 100644 --- a/tests/baselines/reference/functionOverloads3.errors.txt +++ b/tests/baselines/reference/functionOverloads3.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/functionOverloads3.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/functionOverloads3.ts (1 errors) ==== function foo():string; ~~~ -!!! Function implementation is missing or not immediately following the declaration. \ No newline at end of file +!!! error TS2391: Function implementation is missing or not immediately following the declaration. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads34.errors.txt b/tests/baselines/reference/functionOverloads34.errors.txt index 6dc7b45c3d2..ccd771d2130 100644 --- a/tests/baselines/reference/functionOverloads34.errors.txt +++ b/tests/baselines/reference/functionOverloads34.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/functionOverloads34.ts(4,9): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/functionOverloads34.ts (1 errors) ==== function foo(bar:{a:number;}):string; function foo(bar:{a:boolean;}):number; function foo(bar:{a:any;}):any{ return bar } var x = foo(); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads37.errors.txt b/tests/baselines/reference/functionOverloads37.errors.txt index 0e93e7a459b..742e1bedb22 100644 --- a/tests/baselines/reference/functionOverloads37.errors.txt +++ b/tests/baselines/reference/functionOverloads37.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/functionOverloads37.ts(4,9): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/functionOverloads37.ts (1 errors) ==== function foo(bar:{a:number;}[]):string; function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo(); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads4.errors.txt b/tests/baselines/reference/functionOverloads4.errors.txt index 3ec1a19dd35..1e41fde6021 100644 --- a/tests/baselines/reference/functionOverloads4.errors.txt +++ b/tests/baselines/reference/functionOverloads4.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/functionOverloads4.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. + + ==== tests/cases/compiler/functionOverloads4.ts (1 errors) ==== function foo():number; ~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function foo():string { return "a" } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index 94e9ccc9ab2..f965a4eb9e1 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,11 +1,17 @@ +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; }'. + Types of property 'a' are incompatible. + Type 'string' is not assignable to type 'boolean'. + + ==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== function foo(bar:{a:number;}[]):string; function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); ~~~~~~~~~~~ -!!! Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! Type '{ a: string; }' is not assignable to type '{ a: boolean; }': -!!! Types of property 'a' are incompatible: -!!! Type 'string' is not assignable to type 'boolean'. +!!! 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: Types of property 'a' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index 5d84364f8d2..77f8149c822 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,10 +1,15 @@ +tests/cases/compiler/functionOverloads41.ts(4,13): error TS2345: Argument of type '{}[]' is not assignable to parameter of type '{ a: boolean; }[]'. + Type '{}' is not assignable to type '{ a: boolean; }'. + Property 'a' is missing in type '{}'. + + ==== tests/cases/compiler/functionOverloads41.ts (1 errors) ==== function foo(bar:{a:number;}[]):string; function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{}]); ~~~~ -!!! Argument of type '{}[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! Type '{}' is not assignable to type '{ a: boolean; }': -!!! Property 'a' is missing in type '{}'. +!!! error TS2345: Argument of type '{}[]' is not assignable to parameter of type '{ a: boolean; }[]'. +!!! error TS2345: Type '{}' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Property 'a' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads42.types b/tests/baselines/reference/functionOverloads42.types index dec6a041440..6641a28c87a 100644 --- a/tests/baselines/reference/functionOverloads42.types +++ b/tests/baselines/reference/functionOverloads42.types @@ -19,7 +19,7 @@ var x = foo([{a:'s'}]); >x : number >foo([{a:'s'}]) : number >foo : { (bar: { a: number; }[]): string; (bar: { a: any; }[]): number; } ->[{a:'s'}] : { a: any; }[] +>[{a:'s'}] : { a: string; }[] >{a:'s'} : { a: string; } >a : string diff --git a/tests/baselines/reference/functionOverloads5.errors.txt b/tests/baselines/reference/functionOverloads5.errors.txt index a73fb152a0e..60a74f103e0 100644 --- a/tests/baselines/reference/functionOverloads5.errors.txt +++ b/tests/baselines/reference/functionOverloads5.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/functionOverloads5.ts(2,10): error TS2385: Overload signatures must all be public, private or protected. + + ==== tests/cases/compiler/functionOverloads5.ts (1 errors) ==== class baz { public foo(); ~~~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. private foo(bar?:any){ } } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt b/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt index c5cfcb2ac73..8aab3d3e387 100644 --- a/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt +++ b/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/functionOverloadsOutOfOrder.ts(6,13): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/functionOverloadsOutOfOrder.ts(14,13): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/functionOverloadsOutOfOrder.ts (2 errors) ==== class d { private foo(n: number): string; @@ -6,7 +10,7 @@ } private foo(s: string): string; ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } class e { @@ -16,5 +20,5 @@ private foo(s: string): string; private foo(n: number): string; ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt index 7d7a66e42b1..86c4728dda2 100644 --- a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. + Types of parameters 'delimiter' and 'eventEmitter' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/functionSignatureAssignmentCompat1.ts (1 errors) ==== interface ParserFunc { (eventEmitter: number, buffer: string): void; @@ -10,7 +15,7 @@ var c: ParserFunc = parsers.raw; // ok! var d: ParserFunc = parsers.readline; // not ok ~ -!!! Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc': -!!! Types of parameters 'delimiter' and 'eventEmitter' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. +!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var e: ParserFunc = parsers.readline(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs2.types b/tests/baselines/reference/functionSubtypingOfVarArgs2.types index 2fef933594d..5e2b14ffc7a 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs2.types +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.types @@ -3,9 +3,9 @@ class EventBase { >EventBase : EventBase private _listeners: { (...args: any[]): void; }[] = []; ->_listeners : { (...args: any[]): void; }[] +>_listeners : ((...args: any[]) => void)[] >args : any[] ->[] : { (...args: any[]): void; }[] +>[] : undefined[] add(listener: (...args: any[]) => void): void { >add : (listener: (...args: any[]) => void) => void @@ -14,11 +14,11 @@ class EventBase { this._listeners.push(listener); >this._listeners.push(listener) : number ->this._listeners.push : (...items: { (...args: any[]): void; }[]) => number ->this._listeners : { (...args: any[]): void; }[] +>this._listeners.push : (...items: ((...args: any[]) => void)[]) => number +>this._listeners : ((...args: any[]) => void)[] >this : EventBase ->_listeners : { (...args: any[]): void; }[] ->push : (...items: { (...args: any[]): void; }[]) => number +>_listeners : ((...args: any[]) => void)[] +>push : (...items: ((...args: any[]) => void)[]) => number >listener : (...args: any[]) => void } } diff --git a/tests/baselines/reference/functionTypeArgumentArrayAssignment.errors.txt b/tests/baselines/reference/functionTypeArgumentArrayAssignment.errors.txt deleted file mode 100644 index d6c22626604..00000000000 --- a/tests/baselines/reference/functionTypeArgumentArrayAssignment.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -==== tests/cases/compiler/functionTypeArgumentArrayAssignment.ts (1 errors) ==== - interface Array { - foo: T; - length: number; - ~~~~~~ -!!! Duplicate identifier 'length'. - } - - function map() { - var ys: U[] = []; - } - \ No newline at end of file diff --git a/tests/baselines/reference/functionTypeArgumentArrayAssignment.js b/tests/baselines/reference/functionTypeArgumentArrayAssignment.js index 9569c4566d8..38188c3505a 100644 --- a/tests/baselines/reference/functionTypeArgumentArrayAssignment.js +++ b/tests/baselines/reference/functionTypeArgumentArrayAssignment.js @@ -1,15 +1,20 @@ //// [functionTypeArgumentArrayAssignment.ts] -interface Array { - foo: T; - length: number; -} +module test { + interface Array { + foo: T; + length: number; + } -function map() { -var ys: U[] = []; + function map() { + var ys: U[] = []; + } } //// [functionTypeArgumentArrayAssignment.js] -function map() { - var ys = []; -} +var test; +(function (test) { + function map() { + var ys = []; + } +})(test || (test = {})); diff --git a/tests/baselines/reference/functionTypeArgumentArrayAssignment.types b/tests/baselines/reference/functionTypeArgumentArrayAssignment.types new file mode 100644 index 00000000000..588dfd506ef --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArrayAssignment.types @@ -0,0 +1,27 @@ +=== tests/cases/compiler/functionTypeArgumentArrayAssignment.ts === +module test { +>test : typeof test + + interface Array { +>Array : Array +>T : T + + foo: T; +>foo : T +>T : T + + length: number; +>length : number + } + + function map() { +>map : () => void +>U : U + + var ys: U[] = []; +>ys : U[] +>U : U +>[] : undefined[] + } +} + diff --git a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt index a7c07b9de77..366e1732b29 100644 --- a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt +++ b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts(12,1): error TS2304: Cannot find name 'console'. + + ==== tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts (1 errors) ==== var f : { (x:T): T; @@ -12,5 +15,5 @@ console.log(s); ~~~~~~~ -!!! Cannot find name 'console'. +!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/functionTypesLackingReturnTypes.errors.txt b/tests/baselines/reference/functionTypesLackingReturnTypes.errors.txt new file mode 100644 index 00000000000..84ec6ff1ba5 --- /dev/null +++ b/tests/baselines/reference/functionTypesLackingReturnTypes.errors.txt @@ -0,0 +1,22 @@ +tests/cases/compiler/functionTypesLackingReturnTypes.ts(3,17): error TS1005: '=>' expected. +tests/cases/compiler/functionTypesLackingReturnTypes.ts(7,9): error TS2304: Cannot find name 'param'. + + +==== tests/cases/compiler/functionTypesLackingReturnTypes.ts (2 errors) ==== + + // Error (no '=>') + function f(x: ()) { + ~ +!!! error TS1005: '=>' expected. + } + + // Error (no '=>') + var g: (param); + ~~~~~ +!!! error TS2304: Cannot find name 'param'. + + // Okay + var h: { () } + + // Okay + var i: { new () } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt index d599e2da445..d9a25e24566 100644 --- a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt @@ -1,3 +1,14 @@ +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(4,1): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(12,1): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(22,1): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(31,1): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(43,1): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(48,1): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(56,1): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(56,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(56,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts (9 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 @@ -16,7 +27,7 @@ ~~~~~ } ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. function f2() { ~~~~~~~~~~~~~~~ @@ -36,7 +47,7 @@ ~~~~~ } ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. function f3() { ~~~~~~~~~~~~~~~ @@ -54,7 +65,7 @@ ~~~~~ } ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. function f4() { ~~~~~~~~~~~~~~~ @@ -78,7 +89,7 @@ ~~~~~ } ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. function f5() { ~~~~~~~~~~~~~~~ @@ -88,7 +99,7 @@ ~~~~~~~~~~~~~~ } ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. function f6(x: T, y:U) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -104,14 +115,14 @@ ~~~~~ } ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. function f8(x: T, y: U) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. if (true) { ~~~~~~~~~~~~~~~ return x; @@ -124,5 +135,5 @@ ~~~~~ } ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt new file mode 100644 index 00000000000..2b14bd97bad --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt @@ -0,0 +1,112 @@ +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(58,1): error TS2354: No best common type exists among return expressions. +tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(67,1): 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() { + ~~~~~~~~~~~~~~~ + if (true) { + ~~~~~~~~~~~~~~~ + return a; + ~~~~~~~~~~~~~~~~~ + } else { + ~~~~~~~~~~~~ + return b; + ~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! error TS2354: No best common type exists among return expressions. + + // returns typeof b + function f10() { + ~~~~~~~~~~~~~~~~ + if (true) { + ~~~~~~~~~~~~~~~ + return b; + ~~~~~~~~~~~~~~~~~ + } else { + ~~~~~~~~~~~~ + return a; + ~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! error TS2354: No best common type exists among return expressions. + + // 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.types b/tests/baselines/reference/functionWithMultipleReturnStatements2.types deleted file mode 100644 index 706aca40c94..00000000000 --- a/tests/baselines/reference/functionWithMultipleReturnStatements2.types +++ /dev/null @@ -1,146 +0,0 @@ -=== 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) { - return 1; - } else { - return null; - } -} - -function f2() { ->f2 : () => number - - if (true) { - return 1; - } else if (false) { - return null; - } else { - return 2; - } -} - -function f4() { ->f4 : () => number - - try { - return 1; - } - catch (e) { ->e : any - - return undefined; ->undefined : undefined - } - finally { - return 1; - } -} - -function f5() { ->f5 : () => Object - - return 1; - return new Object(); ->new Object() : Object ->Object : { (): any; (value: any): any; new (value?: any): Object; prototype: Object; getPrototypeOf(o: any): any; getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: any): any; freeze(o: any): any; preventExtensions(o: any): any; isSealed(o: any): boolean; isFrozen(o: any): boolean; isExtensible(o: any): boolean; keys(o: any): string[]; } -} - -function f6(x: T) { ->f6 : (x: T) => T ->T : T ->x : T ->T : T - - if (true) { - return x; ->x : T - - } else { - return 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; } - - if (true) { - return a; ->a : { x: number; y?: number; } - - } else { - return b; ->b : { x: number; z?: number; } - } -} - -// returns typeof b -function f10() { ->f10 : () => { x: number; z?: number; } - - if (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) { - 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) { - 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/functionWithSameNameAsField.errors.txt b/tests/baselines/reference/functionWithSameNameAsField.errors.txt index ce69b7feb56..168b9191df4 100644 --- a/tests/baselines/reference/functionWithSameNameAsField.errors.txt +++ b/tests/baselines/reference/functionWithSameNameAsField.errors.txt @@ -1,9 +1,15 @@ -==== tests/cases/compiler/functionWithSameNameAsField.ts (1 errors) ==== +tests/cases/compiler/functionWithSameNameAsField.ts(2,12): error TS2300: Duplicate identifier 'total'. +tests/cases/compiler/functionWithSameNameAsField.ts(3,12): error TS2300: Duplicate identifier 'total'. + + +==== tests/cases/compiler/functionWithSameNameAsField.ts (2 errors) ==== class TestProgressBar { public total: number; + ~~~~~ +!!! error TS2300: Duplicate identifier 'total'. public total(total: number) { ~~~~~ -!!! Duplicate identifier 'total'. +!!! error TS2300: Duplicate identifier 'total'. this.total = total; return this; } diff --git a/tests/baselines/reference/functionWithThrowButNoReturn1.errors.txt b/tests/baselines/reference/functionWithThrowButNoReturn1.errors.txt index b354a9f8852..72f45da8d97 100644 --- a/tests/baselines/reference/functionWithThrowButNoReturn1.errors.txt +++ b/tests/baselines/reference/functionWithThrowButNoReturn1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/functionWithThrowButNoReturn1.ts(1,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + + ==== tests/cases/compiler/functionWithThrowButNoReturn1.ts (1 errors) ==== function fn(): number { ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. throw new Error('NYI'); var t; } diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt index 6ddbc91db57..11ceb2aa3dd 100644 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt +++ b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt @@ -1,8 +1,15 @@ +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(117,5): error TS1003: Identifier expected. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(2,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(64,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(94,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(112,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. + + ==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (5 errors) ==== function f1(): string { ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. // errors because there are no return statements } @@ -66,7 +73,7 @@ function f14(): number { ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. // Not fine, since we can *only* consist of a single throw statement // if no return statements are present but we are annotated. throw undefined; @@ -98,7 +105,7 @@ class C { public get m1() { ~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. // Errors; get accessors must return a value. } @@ -118,12 +125,12 @@ public get m5() { ~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. // Not fine, since we can *only* consist of a single throw statement // if no return statements are present but we are a get accessor. throw null; throw undefined. } ~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. } \ No newline at end of file diff --git a/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt b/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt index 2d70aed4a3e..1fc68fff709 100644 --- a/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt +++ b/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/funduleSplitAcrossFiles_module.ts(1,8): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged + + ==== tests/cases/compiler/funduleSplitAcrossFiles_function.ts (0 errors) ==== function D() { } ==== tests/cases/compiler/funduleSplitAcrossFiles_module.ts (1 errors) ==== module D { ~ -!!! A module declaration cannot be in a different file from a class or function with which it is merged +!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged export var y = "hi"; } D.y; \ No newline at end of file diff --git a/tests/baselines/reference/fuzzy.errors.txt b/tests/baselines/reference/fuzzy.errors.txt index 36124da5cea..699841f8870 100644 --- a/tests/baselines/reference/fuzzy.errors.txt +++ b/tests/baselines/reference/fuzzy.errors.txt @@ -1,3 +1,12 @@ +tests/cases/compiler/fuzzy.ts(13,18): error TS2420: Class 'C' incorrectly implements interface 'I'. + Property 'alsoWorks' is missing in type 'C'. +tests/cases/compiler/fuzzy.ts(21,20): error TS2322: Type '{ anything: number; oneI: C; }' is not assignable to type 'R'. + Types of property 'oneI' are incompatible. + Type 'C' is not assignable to type 'I'. +tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other. + Property 'anything' is missing in type '{ oneI: C; }'. + + ==== tests/cases/compiler/fuzzy.ts (3 errors) ==== module M { export interface I { @@ -13,8 +22,8 @@ export class C implements I { ~ -!!! Class 'C' incorrectly implements interface 'I': -!!! Property 'alsoWorks' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'alsoWorks' is missing in type 'C'. constructor(public x:number) { } works():R { @@ -24,16 +33,16 @@ doesntWork():R { return { anything:1, oneI:this }; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Type '{ anything: number; oneI: C; }' is not assignable to type 'R': -!!! Types of property 'oneI' are incompatible: -!!! Type 'C' is not assignable to type 'I'. +!!! error TS2322: Type '{ anything: number; oneI: C; }' is not assignable to type 'R'. +!!! error TS2322: Types of property 'oneI' are incompatible. +!!! error TS2322: Type 'C' is not assignable to type 'I'. } worksToo():R { return ({ oneI: this }); ~~~~~~~~~~~~~~~~~~~ -!!! Neither type '{ oneI: C; }' nor type 'R' is assignable to the other: -!!! Property 'anything' is missing in type '{ oneI: C; }'. +!!! error TS2352: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other. +!!! error TS2352: Property 'anything' is missing in type '{ oneI: C; }'. } } } diff --git a/tests/baselines/reference/generatedContextualTyping.types b/tests/baselines/reference/generatedContextualTyping.types index 57b5408eabe..79787f6d994 100644 --- a/tests/baselines/reference/generatedContextualTyping.types +++ b/tests/baselines/reference/generatedContextualTyping.types @@ -34,57 +34,57 @@ var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); var x1: () => Base[] = () => [d1, d2]; >x1 : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x2: () => Base[] = function() { return [d1, d2] }; >x2 : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x3: () => Base[] = function named() { return [d1, d2] }; >x3 : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x4: { (): Base[]; } = () => [d1, d2]; >x4 : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x5: { (): Base[]; } = function() { return [d1, d2] }; >x5 : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x6: { (): Base[]; } = function named() { return [d1, d2] }; >x6 : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x7: Base[] = [d1, d2]; >x7 : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -92,7 +92,7 @@ var x8: Array = [d1, d2]; >x8 : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -100,7 +100,7 @@ var x9: { [n: number]: Base; } = [d1, d2]; >x9 : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -108,9 +108,9 @@ var x10: {n: Base[]; } = { n: [d1, d2] }; >x10 : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -127,11 +127,11 @@ var x12: Genric = { func: n => { return [d1, d2]; } }; >x12 : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -139,8 +139,8 @@ class x13 { member: () => Base[] = () => [d1, d2] } >x13 : x13 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -148,8 +148,8 @@ class x14 { member: () => Base[] = function() { return [d1, d2] } } >x14 : x14 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -157,9 +157,9 @@ class x15 { member: () => Base[] = function named() { return [d1, d2] } } >x15 : x15 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -167,8 +167,8 @@ class x16 { member: { (): Base[]; } = () => [d1, d2] } >x16 : x16 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -176,8 +176,8 @@ class x17 { member: { (): Base[]; } = function() { return [d1, d2] } } >x17 : x17 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -185,9 +185,9 @@ class x18 { member: { (): Base[]; } = function named() { return [d1, d2] } } >x18 : x18 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -195,7 +195,7 @@ class x19 { member: Base[] = [d1, d2] } >x19 : x19 >member : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -204,7 +204,7 @@ class x20 { member: Array = [d1, d2] } >member : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -213,7 +213,7 @@ class x21 { member: { [n: number]: Base; } = [d1, d2] } >member : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -222,9 +222,9 @@ class x22 { member: {n: Base[]; } = { n: [d1, d2] } } >member : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -243,11 +243,11 @@ class x24 { member: Genric = { func: n => { return [d1, d2]; } } } >member : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -255,8 +255,8 @@ class x25 { private member: () => Base[] = () => [d1, d2] } >x25 : x25 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -264,8 +264,8 @@ class x26 { private member: () => Base[] = function() { return [d1, d2] } } >x26 : x26 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -273,9 +273,9 @@ class x27 { private member: () => Base[] = function named() { return [d1, d2] } >x27 : x27 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -283,8 +283,8 @@ class x28 { private member: { (): Base[]; } = () => [d1, d2] } >x28 : x28 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -292,8 +292,8 @@ class x29 { private member: { (): Base[]; } = function() { return [d1, d2] } } >x29 : x29 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -301,9 +301,9 @@ class x30 { private member: { (): Base[]; } = function named() { return [d1, d2] >x30 : x30 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -311,7 +311,7 @@ class x31 { private member: Base[] = [d1, d2] } >x31 : x31 >member : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -320,7 +320,7 @@ class x32 { private member: Array = [d1, d2] } >member : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -329,7 +329,7 @@ class x33 { private member: { [n: number]: Base; } = [d1, d2] } >member : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -338,9 +338,9 @@ class x34 { private member: {n: Base[]; } = { n: [d1, d2] } } >member : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -359,11 +359,11 @@ class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } >member : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -371,8 +371,8 @@ class x37 { public member: () => Base[] = () => [d1, d2] } >x37 : x37 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -380,8 +380,8 @@ class x38 { public member: () => Base[] = function() { return [d1, d2] } } >x38 : x38 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -389,9 +389,9 @@ class x39 { public member: () => Base[] = function named() { return [d1, d2] } } >x39 : x39 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -399,8 +399,8 @@ class x40 { public member: { (): Base[]; } = () => [d1, d2] } >x40 : x40 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -408,8 +408,8 @@ class x41 { public member: { (): Base[]; } = function() { return [d1, d2] } } >x41 : x41 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -417,9 +417,9 @@ class x42 { public member: { (): Base[]; } = function named() { return [d1, d2] >x42 : x42 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -427,7 +427,7 @@ class x43 { public member: Base[] = [d1, d2] } >x43 : x43 >member : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -436,7 +436,7 @@ class x44 { public member: Array = [d1, d2] } >member : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -445,7 +445,7 @@ class x45 { public member: { [n: number]: Base; } = [d1, d2] } >member : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -454,9 +454,9 @@ class x46 { public member: {n: Base[]; } = { n: [d1, d2] } } >member : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -475,11 +475,11 @@ class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } >member : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -487,8 +487,8 @@ class x49 { static member: () => Base[] = () => [d1, d2] } >x49 : x49 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -496,8 +496,8 @@ class x50 { static member: () => Base[] = function() { return [d1, d2] } } >x50 : x50 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -505,9 +505,9 @@ class x51 { static member: () => Base[] = function named() { return [d1, d2] } } >x51 : x51 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -515,8 +515,8 @@ class x52 { static member: { (): Base[]; } = () => [d1, d2] } >x52 : x52 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -524,8 +524,8 @@ class x53 { static member: { (): Base[]; } = function() { return [d1, d2] } } >x53 : x53 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -533,9 +533,9 @@ class x54 { static member: { (): Base[]; } = function named() { return [d1, d2] >x54 : x54 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -543,7 +543,7 @@ class x55 { static member: Base[] = [d1, d2] } >x55 : x55 >member : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -552,7 +552,7 @@ class x56 { static member: Array = [d1, d2] } >member : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -561,7 +561,7 @@ class x57 { static member: { [n: number]: Base; } = [d1, d2] } >member : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -570,9 +570,9 @@ class x58 { static member: {n: Base[]; } = { n: [d1, d2] } } >member : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -591,11 +591,11 @@ class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } >member : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -603,8 +603,8 @@ class x61 { private static member: () => Base[] = () => [d1, d2] } >x61 : x61 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -612,8 +612,8 @@ class x62 { private static member: () => Base[] = function() { return [d1, d2] } >x62 : x62 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -621,9 +621,9 @@ class x63 { private static member: () => Base[] = function named() { return [d1, >x63 : x63 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -631,8 +631,8 @@ class x64 { private static member: { (): Base[]; } = () => [d1, d2] } >x64 : x64 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -640,8 +640,8 @@ class x65 { private static member: { (): Base[]; } = function() { return [d1, d2 >x65 : x65 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -649,9 +649,9 @@ class x66 { private static member: { (): Base[]; } = function named() { return [ >x66 : x66 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -659,7 +659,7 @@ class x67 { private static member: Base[] = [d1, d2] } >x67 : x67 >member : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -668,7 +668,7 @@ class x68 { private static member: Array = [d1, d2] } >member : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -677,7 +677,7 @@ class x69 { private static member: { [n: number]: Base; } = [d1, d2] } >member : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -686,9 +686,9 @@ class x70 { private static member: {n: Base[]; } = { n: [d1, d2] } } >member : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -707,11 +707,11 @@ class x72 { private static member: Genric = { func: n => { return [d1, d2] >member : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -719,8 +719,8 @@ class x73 { public static member: () => Base[] = () => [d1, d2] } >x73 : x73 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -728,8 +728,8 @@ class x74 { public static member: () => Base[] = function() { return [d1, d2] } >x74 : x74 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -737,9 +737,9 @@ class x75 { public static member: () => Base[] = function named() { return [d1, >x75 : x75 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -747,8 +747,8 @@ class x76 { public static member: { (): Base[]; } = () => [d1, d2] } >x76 : x76 >member : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -756,8 +756,8 @@ class x77 { public static member: { (): Base[]; } = function() { return [d1, d2] >x77 : x77 >member : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -765,9 +765,9 @@ class x78 { public static member: { (): Base[]; } = function named() { return [d >x78 : x78 >member : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -775,7 +775,7 @@ class x79 { public static member: Base[] = [d1, d2] } >x79 : x79 >member : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -784,7 +784,7 @@ class x80 { public static member: Array = [d1, d2] } >member : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -793,7 +793,7 @@ class x81 { public static member: { [n: number]: Base; } = [d1, d2] } >member : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -802,9 +802,9 @@ class x82 { public static member: {n: Base[]; } = { n: [d1, d2] } } >member : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -823,11 +823,11 @@ class x84 { public static member: Genric = { func: n => { return [d1, d2]; >member : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -835,8 +835,8 @@ class x85 { constructor(parm: () => Base[] = () => [d1, d2]) { } } >x85 : x85 >parm : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -844,8 +844,8 @@ class x86 { constructor(parm: () => Base[] = function() { return [d1, d2] }) { } >x86 : x86 >parm : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -853,9 +853,9 @@ class x87 { constructor(parm: () => Base[] = function named() { return [d1, d2] >x87 : x87 >parm : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -863,8 +863,8 @@ class x88 { constructor(parm: { (): Base[]; } = () => [d1, d2]) { } } >x88 : x88 >parm : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -872,8 +872,8 @@ class x89 { constructor(parm: { (): Base[]; } = function() { return [d1, d2] }) >x89 : x89 >parm : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -881,9 +881,9 @@ class x90 { constructor(parm: { (): Base[]; } = function named() { return [d1, d >x90 : x90 >parm : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -891,7 +891,7 @@ class x91 { constructor(parm: Base[] = [d1, d2]) { } } >x91 : x91 >parm : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -900,7 +900,7 @@ class x92 { constructor(parm: Array = [d1, d2]) { } } >parm : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -909,7 +909,7 @@ class x93 { constructor(parm: { [n: number]: Base; } = [d1, d2]) { } } >parm : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -918,9 +918,9 @@ class x94 { constructor(parm: {n: Base[]; } = { n: [d1, d2] }) { } } >parm : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -939,11 +939,11 @@ class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } } >parm : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -951,8 +951,8 @@ class x97 { constructor(public parm: () => Base[] = () => [d1, d2]) { } } >x97 : x97 >parm : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -960,8 +960,8 @@ class x98 { constructor(public parm: () => Base[] = function() { return [d1, d2] >x98 : x98 >parm : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -969,9 +969,9 @@ class x99 { constructor(public parm: () => Base[] = function named() { return [d >x99 : x99 >parm : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -979,8 +979,8 @@ class x100 { constructor(public parm: { (): Base[]; } = () => [d1, d2]) { } } >x100 : x100 >parm : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -988,8 +988,8 @@ class x101 { constructor(public parm: { (): Base[]; } = function() { return [d1, >x101 : x101 >parm : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -997,9 +997,9 @@ class x102 { constructor(public parm: { (): Base[]; } = function named() { retur >x102 : x102 >parm : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1007,7 +1007,7 @@ class x103 { constructor(public parm: Base[] = [d1, d2]) { } } >x103 : x103 >parm : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1016,7 +1016,7 @@ class x104 { constructor(public parm: Array = [d1, d2]) { } } >parm : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1025,7 +1025,7 @@ class x105 { constructor(public parm: { [n: number]: Base; } = [d1, d2]) { } } >parm : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1034,9 +1034,9 @@ class x106 { constructor(public parm: {n: Base[]; } = { n: [d1, d2] }) { } } >parm : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1055,11 +1055,11 @@ class x108 { constructor(public parm: Genric = { func: n => { return [d1, >parm : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1067,8 +1067,8 @@ class x109 { constructor(private parm: () => Base[] = () => [d1, d2]) { } } >x109 : x109 >parm : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1076,8 +1076,8 @@ class x110 { constructor(private parm: () => Base[] = function() { return [d1, d >x110 : x110 >parm : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1085,9 +1085,9 @@ class x111 { constructor(private parm: () => Base[] = function named() { return >x111 : x111 >parm : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1095,8 +1095,8 @@ class x112 { constructor(private parm: { (): Base[]; } = () => [d1, d2]) { } } >x112 : x112 >parm : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1104,8 +1104,8 @@ class x113 { constructor(private parm: { (): Base[]; } = function() { return [d1 >x113 : x113 >parm : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1113,9 +1113,9 @@ class x114 { constructor(private parm: { (): Base[]; } = function named() { retu >x114 : x114 >parm : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1123,7 +1123,7 @@ class x115 { constructor(private parm: Base[] = [d1, d2]) { } } >x115 : x115 >parm : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1132,7 +1132,7 @@ class x116 { constructor(private parm: Array = [d1, d2]) { } } >parm : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1141,7 +1141,7 @@ class x117 { constructor(private parm: { [n: number]: Base; } = [d1, d2]) { } } >parm : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1150,9 +1150,9 @@ class x118 { constructor(private parm: {n: Base[]; } = { n: [d1, d2] }) { } } >parm : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1171,11 +1171,11 @@ class x120 { constructor(private parm: Genric = { func: n => { return [d1, >parm : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1183,8 +1183,8 @@ function x121(parm: () => Base[] = () => [d1, d2]) { } >x121 : (parm?: () => Base[]) => void >parm : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1192,8 +1192,8 @@ function x122(parm: () => Base[] = function() { return [d1, d2] }) { } >x122 : (parm?: () => Base[]) => void >parm : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1201,9 +1201,9 @@ function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } >x123 : (parm?: () => Base[]) => void >parm : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1211,8 +1211,8 @@ function x124(parm: { (): Base[]; } = () => [d1, d2]) { } >x124 : (parm?: () => Base[]) => void >parm : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1220,8 +1220,8 @@ function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } >x125 : (parm?: () => Base[]) => void >parm : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1229,9 +1229,9 @@ function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } >x126 : (parm?: () => Base[]) => void >parm : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1239,7 +1239,7 @@ function x127(parm: Base[] = [d1, d2]) { } >x127 : (parm?: Base[]) => void >parm : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1248,7 +1248,7 @@ function x128(parm: Array = [d1, d2]) { } >parm : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1257,7 +1257,7 @@ function x129(parm: { [n: number]: Base; } = [d1, d2]) { } >parm : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1266,9 +1266,9 @@ function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } >parm : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1287,68 +1287,68 @@ function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } >parm : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x133(): () => Base[] { return () => [d1, d2]; } >x133 : () => () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x134(): () => Base[] { return function() { return [d1, d2] }; } >x134 : () => () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x135(): () => Base[] { return function named() { return [d1, d2] }; } >x135 : () => () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x136(): { (): Base[]; } { return () => [d1, d2]; } >x136 : () => () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } >x137 : () => () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } >x138 : () => () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x139(): Base[] { return [d1, d2]; } >x139 : () => Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1356,7 +1356,7 @@ function x140(): Array { return [d1, d2]; } >x140 : () => Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1364,7 +1364,7 @@ function x141(): { [n: number]: Base; } { return [d1, d2]; } >x141 : () => { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1372,9 +1372,9 @@ function x142(): {n: Base[]; } { return { n: [d1, d2] }; } >x142 : () => { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1391,97 +1391,97 @@ function x144(): Genric { return { func: n => { return [d1, d2]; } }; } >x144 : () => Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } >x145 : () => () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } >x146 : () => () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } >x147 : () => () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } >x148 : () => () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } >x149 : () => () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } >x150 : () => () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 function x151(): Base[] { return [d1, d2]; return [d1, d2]; } >x151 : () => Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1489,10 +1489,10 @@ function x152(): Array { return [d1, d2]; return [d1, d2]; } >x152 : () => Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1500,10 +1500,10 @@ function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } >x153 : () => { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1511,14 +1511,14 @@ function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] } >x154 : () => { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1539,82 +1539,82 @@ function x156(): Genric { return { func: n => { return [d1, d2]; } }; retu >x156 : () => Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x157: () => () => Base[] = () => { return () => [d1, d2]; }; >x157 : () => () => Base[] >Base : Base ->() => { return () => [d1, d2]; } : () => () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x158: () => () => Base[] = () => { return function() { return [d1, d2] }; }; >x158 : () => () => Base[] >Base : Base ->() => { return function() { return [d1, d2] }; } : () => () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>() => { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x159: () => () => Base[] = () => { return function named() { return [d1, d2] }; }; >x159 : () => () => Base[] >Base : Base ->() => { return function named() { return [d1, d2] }; } : () => () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>() => { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x160: () => { (): Base[]; } = () => { return () => [d1, d2]; }; >x160 : () => () => Base[] >Base : Base ->() => { return () => [d1, d2]; } : () => () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x161: () => { (): Base[]; } = () => { return function() { return [d1, d2] }; }; >x161 : () => () => Base[] >Base : Base ->() => { return function() { return [d1, d2] }; } : () => () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>() => { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x162: () => { (): Base[]; } = () => { return function named() { return [d1, d2] }; }; >x162 : () => () => Base[] >Base : Base ->() => { return function named() { return [d1, d2] }; } : () => () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>() => { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x163: () => Base[] = () => { return [d1, d2]; }; >x163 : () => Base[] >Base : Base ->() => { return [d1, d2]; } : () => Base[] ->[d1, d2] : Base[] +>() => { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1622,8 +1622,8 @@ var x164: () => Array = () => { return [d1, d2]; }; >x164 : () => Base[] >Array : T[] >Base : Base ->() => { return [d1, d2]; } : () => Base[] ->[d1, d2] : Base[] +>() => { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1631,8 +1631,8 @@ var x165: () => { [n: number]: Base; } = () => { return [d1, d2]; }; >x165 : () => { [x: number]: Base; } >n : number >Base : Base ->() => { return [d1, d2]; } : () => Base[] ->[d1, d2] : Base[] +>() => { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1640,10 +1640,10 @@ var x166: () => {n: Base[]; } = () => { return { n: [d1, d2] }; }; >x166 : () => { n: Base[]; } >n : Base[] >Base : Base ->() => { return { n: [d1, d2] }; } : () => { n: Base[]; } ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>() => { return { n: [d1, d2] }; } : () => { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1661,76 +1661,76 @@ var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } >x168 : () => Genric >Genric : Genric >Base : Base ->() => { return { func: n => { return [d1, d2]; } }; } : () => { func: (n: Base[]) => {}[]; } ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>() => { return { func: n => { return [d1, d2]; } }; } : () => { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x169: () => () => Base[] = function() { return () => [d1, d2]; }; >x169 : () => () => Base[] >Base : Base ->function() { return () => [d1, d2]; } : () => () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>function() { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x170: () => () => Base[] = function() { return function() { return [d1, d2] }; }; >x170 : () => () => Base[] >Base : Base ->function() { return function() { return [d1, d2] }; } : () => () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x171: () => () => Base[] = function() { return function named() { return [d1, d2] }; }; >x171 : () => () => Base[] >Base : Base ->function() { return function named() { return [d1, d2] }; } : () => () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function() { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x172: () => { (): Base[]; } = function() { return () => [d1, d2]; }; >x172 : () => () => Base[] >Base : Base ->function() { return () => [d1, d2]; } : () => () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>function() { return () => [d1, d2]; } : () => () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x173: () => { (): Base[]; } = function() { return function() { return [d1, d2] }; }; >x173 : () => () => Base[] >Base : Base ->function() { return function() { return [d1, d2] }; } : () => () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return function() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x174: () => { (): Base[]; } = function() { return function named() { return [d1, d2] }; }; >x174 : () => () => Base[] >Base : Base ->function() { return function named() { return [d1, d2] }; } : () => () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function() { return function named() { return [d1, d2] }; } : () => () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x175: () => Base[] = function() { return [d1, d2]; }; >x175 : () => Base[] >Base : Base ->function() { return [d1, d2]; } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1738,8 +1738,8 @@ var x176: () => Array = function() { return [d1, d2]; }; >x176 : () => Base[] >Array : T[] >Base : Base ->function() { return [d1, d2]; } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1747,8 +1747,8 @@ var x177: () => { [n: number]: Base; } = function() { return [d1, d2]; }; >x177 : () => { [x: number]: Base; } >n : number >Base : Base ->function() { return [d1, d2]; } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2]; } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1756,10 +1756,10 @@ var x178: () => {n: Base[]; } = function() { return { n: [d1, d2] }; }; >x178 : () => { n: Base[]; } >n : Base[] >Base : Base ->function() { return { n: [d1, d2] }; } : () => { n: Base[]; } ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>function() { return { n: [d1, d2] }; } : () => { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1777,12 +1777,12 @@ var x180: () => Genric = function() { return { func: n => { return [d1, d2 >x180 : () => Genric >Genric : Genric >Base : Base ->function() { return { func: n => { return [d1, d2]; } }; } : () => { func: (n: Base[]) => {}[]; } ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>function() { return { func: n => { return [d1, d2]; } }; } : () => { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1790,8 +1790,8 @@ module x181 { var t: () => Base[] = () => [d1, d2]; } >x181 : typeof x181 >t : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1799,8 +1799,8 @@ module x182 { var t: () => Base[] = function() { return [d1, d2] }; } >x182 : typeof x182 >t : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1808,9 +1808,9 @@ module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } >x183 : typeof x183 >t : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1818,8 +1818,8 @@ module x184 { var t: { (): Base[]; } = () => [d1, d2]; } >x184 : typeof x184 >t : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1827,8 +1827,8 @@ module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } >x185 : typeof x185 >t : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1836,9 +1836,9 @@ module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } >x186 : typeof x186 >t : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1846,7 +1846,7 @@ module x187 { var t: Base[] = [d1, d2]; } >x187 : typeof x187 >t : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1855,7 +1855,7 @@ module x188 { var t: Array = [d1, d2]; } >t : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1864,7 +1864,7 @@ module x189 { var t: { [n: number]: Base; } = [d1, d2]; } >t : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1873,9 +1873,9 @@ module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } >t : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1894,11 +1894,11 @@ module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } >t : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1906,8 +1906,8 @@ module x193 { export var t: () => Base[] = () => [d1, d2]; } >x193 : typeof x193 >t : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1915,8 +1915,8 @@ module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } >x194 : typeof x194 >t : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1924,9 +1924,9 @@ module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; >x195 : typeof x195 >t : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1934,8 +1934,8 @@ module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } >x196 : typeof x196 >t : () => Base[] >Base : Base ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1943,8 +1943,8 @@ module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } >x197 : typeof x197 >t : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1952,9 +1952,9 @@ module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] >x198 : typeof x198 >t : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1962,7 +1962,7 @@ module x199 { export var t: Base[] = [d1, d2]; } >x199 : typeof x199 >t : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1971,7 +1971,7 @@ module x200 { export var t: Array = [d1, d2]; } >t : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1980,7 +1980,7 @@ module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } >t : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -1989,9 +1989,9 @@ module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } >t : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2010,11 +2010,11 @@ module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; >t : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2022,8 +2022,8 @@ var x206 = <() => Base[]>function() { return [d1, d2] }; >x206 : () => Base[] ><() => Base[]>function() { return [d1, d2] } : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2031,9 +2031,9 @@ var x207 = <() => Base[]>function named() { return [d1, d2] }; >x207 : () => Base[] ><() => Base[]>function named() { return [d1, d2] } : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2041,8 +2041,8 @@ var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; >x209 : () => Base[] ><{ (): Base[]; }>function() { return [d1, d2] } : () => Base[] >Base : Base ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2050,9 +2050,9 @@ var x210 = <{ (): Base[]; }>function named() { return [d1, d2] }; >x210 : () => Base[] ><{ (): Base[]; }>function named() { return [d1, d2] } : () => Base[] >Base : Base ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2060,7 +2060,7 @@ var x211 = [d1, d2]; >x211 : Base[] >[d1, d2] : Base[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2069,7 +2069,7 @@ var x212 = >[d1, d2]; >>[d1, d2] : Base[] >Array : T[] >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2078,7 +2078,7 @@ var x213 = <{ [n: number]: Base; }>[d1, d2]; ><{ [n: number]: Base; }>[d1, d2] : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2087,9 +2087,9 @@ var x214 = <{n: Base[]; } >{ n: [d1, d2] }; ><{n: Base[]; } >{ n: [d1, d2] } : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2098,11 +2098,11 @@ var x216 = >{ func: n => { return [d1, d2]; } }; >>{ func: n => { return [d1, d2]; } } : Genric >Genric : Genric >Base : Base ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2113,8 +2113,8 @@ var x217 = (<() => Base[]>undefined) || function() { return [d1, d2] }; ><() => Base[]>undefined : () => Base[] >Base : Base >undefined : undefined ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2125,9 +2125,9 @@ var x218 = (<() => Base[]>undefined) || function named() { return [d1, d2] }; ><() => Base[]>undefined : () => Base[] >Base : Base >undefined : undefined ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2138,8 +2138,8 @@ var x219 = (<{ (): Base[]; }>undefined) || function() { return [d1, d2] }; ><{ (): Base[]; }>undefined : () => Base[] >Base : Base >undefined : undefined ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2150,9 +2150,9 @@ var x220 = (<{ (): Base[]; }>undefined) || function named() { return [d1, d2] }; ><{ (): Base[]; }>undefined : () => Base[] >Base : Base >undefined : undefined ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2163,7 +2163,7 @@ var x221 = (undefined) || [d1, d2]; >undefined : Base[] >Base : Base >undefined : undefined ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2175,7 +2175,7 @@ var x222 = (>undefined) || [d1, d2]; >Array : T[] >Base : Base >undefined : undefined ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2187,7 +2187,7 @@ var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2]; >n : number >Base : Base >undefined : undefined ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2199,80 +2199,80 @@ var x224 = (<{n: Base[]; } >undefined) || { n: [d1, d2] }; >n : Base[] >Base : Base >undefined : undefined ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x225: () => Base[]; x225 = () => [d1, d2]; >x225 : () => Base[] >Base : Base ->x225 = () => [d1, d2] : () => Base[] +>x225 = () => [d1, d2] : () => (Derived1 | Derived2)[] >x225 : () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x226: () => Base[]; x226 = function() { return [d1, d2] }; >x226 : () => Base[] >Base : Base ->x226 = function() { return [d1, d2] } : () => Base[] +>x226 = function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >x226 : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x227: () => Base[]; x227 = function named() { return [d1, d2] }; >x227 : () => Base[] >Base : Base ->x227 = function named() { return [d1, d2] } : () => Base[] +>x227 = function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >x227 : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x228: { (): Base[]; }; x228 = () => [d1, d2]; >x228 : () => Base[] >Base : Base ->x228 = () => [d1, d2] : () => Base[] +>x228 = () => [d1, d2] : () => (Derived1 | Derived2)[] >x228 : () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x229: { (): Base[]; }; x229 = function() { return [d1, d2] }; >x229 : () => Base[] >Base : Base ->x229 = function() { return [d1, d2] } : () => Base[] +>x229 = function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >x229 : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x230: { (): Base[]; }; x230 = function named() { return [d1, d2] }; >x230 : () => Base[] >Base : Base ->x230 = function named() { return [d1, d2] } : () => Base[] +>x230 = function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >x230 : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x231: Base[]; x231 = [d1, d2]; >x231 : Base[] >Base : Base ->x231 = [d1, d2] : Base[] +>x231 = [d1, d2] : (Derived1 | Derived2)[] >x231 : Base[] ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2280,9 +2280,9 @@ var x232: Array; x232 = [d1, d2]; >x232 : Base[] >Array : T[] >Base : Base ->x232 = [d1, d2] : Base[] +>x232 = [d1, d2] : (Derived1 | Derived2)[] >x232 : Base[] ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2290,9 +2290,9 @@ var x233: { [n: number]: Base; }; x233 = [d1, d2]; >x233 : { [x: number]: Base; } >n : number >Base : Base ->x233 = [d1, d2] : Base[] +>x233 = [d1, d2] : (Derived1 | Derived2)[] >x233 : { [x: number]: Base; } ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2300,11 +2300,11 @@ var x234: {n: Base[]; } ; x234 = { n: [d1, d2] }; >x234 : { n: Base[]; } >n : Base[] >Base : Base ->x234 = { n: [d1, d2] } : { n: Base[]; } +>x234 = { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >x234 : { n: Base[]; } ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2323,13 +2323,13 @@ var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; >x236 : Genric >Genric : Genric >Base : Base ->x236 = { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } +>x236 = { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >x236 : Genric ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2337,10 +2337,10 @@ var x237: { n: () => Base[]; } = { n: () => [d1, d2] }; >x237 : { n: () => Base[]; } >n : () => Base[] >Base : Base ->{ n: () => [d1, d2] } : { n: () => Base[]; } ->n : () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>{ n: () => [d1, d2] } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2348,10 +2348,10 @@ var x238: { n: () => Base[]; } = { n: function() { return [d1, d2] } }; >x238 : { n: () => Base[]; } >n : () => Base[] >Base : Base ->{ n: function() { return [d1, d2] } } : { n: () => Base[]; } ->n : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>{ n: function() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2359,11 +2359,11 @@ var x239: { n: () => Base[]; } = { n: function named() { return [d1, d2] } }; >x239 : { n: () => Base[]; } >n : () => Base[] >Base : Base ->{ n: function named() { return [d1, d2] } } : { n: () => Base[]; } ->n : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>{ n: function named() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2371,10 +2371,10 @@ var x240: { n: { (): Base[]; }; } = { n: () => [d1, d2] }; >x240 : { n: () => Base[]; } >n : () => Base[] >Base : Base ->{ n: () => [d1, d2] } : { n: () => Base[]; } ->n : () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>{ n: () => [d1, d2] } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2382,10 +2382,10 @@ var x241: { n: { (): Base[]; }; } = { n: function() { return [d1, d2] } }; >x241 : { n: () => Base[]; } >n : () => Base[] >Base : Base ->{ n: function() { return [d1, d2] } } : { n: () => Base[]; } ->n : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>{ n: function() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2393,11 +2393,11 @@ var x242: { n: { (): Base[]; }; } = { n: function named() { return [d1, d2] } }; >x242 : { n: () => Base[]; } >n : () => Base[] >Base : Base ->{ n: function named() { return [d1, d2] } } : { n: () => Base[]; } ->n : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>{ n: function named() { return [d1, d2] } } : { n: () => (Derived1 | Derived2)[]; } +>n : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2405,9 +2405,9 @@ var x243: { n: Base[]; } = { n: [d1, d2] }; >x243 : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2416,9 +2416,9 @@ var x244: { n: Array; } = { n: [d1, d2] }; >n : Base[] >Array : T[] >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2427,9 +2427,9 @@ var x245: { n: { [n: number]: Base; }; } = { n: [d1, d2] }; >n : { [x: number]: Base; } >n : number >Base : Base ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2438,11 +2438,11 @@ var x246: { n: {n: Base[]; } ; } = { n: { n: [d1, d2] } }; >n : { n: Base[]; } >n : Base[] >Base : Base ->{ n: { n: [d1, d2] } } : { n: { n: Base[]; }; } ->n : { n: Base[]; } ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: { n: [d1, d2] } } : { n: { n: (Derived1 | Derived2)[]; }; } +>n : { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2463,49 +2463,49 @@ var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; >n : Genric >Genric : Genric >Base : Base ->{ n: { func: n => { return [d1, d2]; } } } : { n: { func: (n: Base[]) => {}[]; }; } ->n : { func: (n: Base[]) => {}[]; } ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ n: { func: n => { return [d1, d2]; } } } : { n: { func: (n: Base[]) => (Derived1 | Derived2)[]; }; } +>n : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x252: { (): Base[]; }[] = [() => [d1, d2]]; ->x252 : { (): Base[]; }[] +>x252 : (() => Base[])[] >Base : Base ->[() => [d1, d2]] : { (): Base[]; }[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>[() => [d1, d2]] : (() => (Derived1 | Derived2)[])[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x253: { (): Base[]; }[] = [function() { return [d1, d2] }]; ->x253 : { (): Base[]; }[] +>x253 : (() => Base[])[] >Base : Base ->[function() { return [d1, d2] }] : { (): Base[]; }[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>[function() { return [d1, d2] }] : (() => (Derived1 | Derived2)[])[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x254: { (): Base[]; }[] = [function named() { return [d1, d2] }]; ->x254 : { (): Base[]; }[] +>x254 : (() => Base[])[] >Base : Base ->[function named() { return [d1, d2] }] : { (): Base[]; }[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>[function named() { return [d1, d2] }] : (() => (Derived1 | Derived2)[])[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x255: Base[][] = [[d1, d2]]; >x255 : Base[][] >Base : Base ->[[d1, d2]] : Base[][] ->[d1, d2] : Base[] +>[[d1, d2]] : (Derived1 | Derived2)[][] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2513,8 +2513,8 @@ var x256: Array[] = [[d1, d2]]; >x256 : Base[][] >Array : T[] >Base : Base ->[[d1, d2]] : Base[][] ->[d1, d2] : Base[] +>[[d1, d2]] : (Derived1 | Derived2)[][] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2522,8 +2522,8 @@ var x257: { [n: number]: Base; }[] = [[d1, d2]]; >x257 : { [x: number]: Base; }[] >n : number >Base : Base ->[[d1, d2]] : { [x: number]: Base; }[] ->[d1, d2] : Base[] +>[[d1, d2]] : (Derived1 | Derived2)[][] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2531,10 +2531,10 @@ var x258: {n: Base[]; } [] = [{ n: [d1, d2] }]; >x258 : { n: Base[]; }[] >n : Base[] >Base : Base ->[{ n: [d1, d2] }] : { n: Base[]; }[] ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>[{ n: [d1, d2] }] : { n: (Derived1 | Derived2)[]; }[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2542,21 +2542,21 @@ var x260: Genric[] = [{ func: n => { return [d1, d2]; } }]; >x260 : Genric[] >Genric : Genric >Base : Base ->[{ func: n => { return [d1, d2]; } }] : Genric[] ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>[{ func: n => { return [d1, d2]; } }] : { func: (n: Base[]) => (Derived1 | Derived2)[]; }[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x261: () => Base[] = function() { return [d1, d2] } || undefined; >x261 : () => Base[] >Base : Base ->function() { return [d1, d2] } || undefined : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -2564,10 +2564,10 @@ var x261: () => Base[] = function() { return [d1, d2] } || undefined; var x262: () => Base[] = function named() { return [d1, d2] } || undefined; >x262 : () => Base[] >Base : Base ->function named() { return [d1, d2] } || undefined : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -2575,9 +2575,9 @@ var x262: () => Base[] = function named() { return [d1, d2] } || undefined; var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; >x263 : () => Base[] >Base : Base ->function() { return [d1, d2] } || undefined : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -2585,10 +2585,10 @@ var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; >x264 : () => Base[] >Base : Base ->function named() { return [d1, d2] } || undefined : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } || undefined : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -2596,8 +2596,8 @@ var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; var x265: Base[] = [d1, d2] || undefined; >x265 : Base[] >Base : Base ->[d1, d2] || undefined : Base[] ->[d1, d2] : Base[] +>[d1, d2] || undefined : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -2606,8 +2606,8 @@ var x266: Array = [d1, d2] || undefined; >x266 : Base[] >Array : T[] >Base : Base ->[d1, d2] || undefined : Base[] ->[d1, d2] : Base[] +>[d1, d2] || undefined : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -2616,8 +2616,8 @@ var x267: { [n: number]: Base; } = [d1, d2] || undefined; >x267 : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] || undefined : { [x: number]: Base; } ->[d1, d2] : Base[] +>[d1, d2] || undefined : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -2626,10 +2626,10 @@ var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; >x268 : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } || undefined : { n: Base[]; } ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } || undefined : { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -2637,51 +2637,51 @@ var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; var x269: () => Base[] = undefined || function() { return [d1, d2] }; >x269 : () => Base[] >Base : Base ->undefined || function() { return [d1, d2] } : () => Base[] +>undefined || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >undefined : undefined ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x270: () => Base[] = undefined || function named() { return [d1, d2] }; >x270 : () => Base[] >Base : Base ->undefined || function named() { return [d1, d2] } : () => Base[] +>undefined || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >undefined : undefined ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x271: { (): Base[]; } = undefined || function() { return [d1, d2] }; >x271 : () => Base[] >Base : Base ->undefined || function() { return [d1, d2] } : () => Base[] +>undefined || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >undefined : undefined ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x272: { (): Base[]; } = undefined || function named() { return [d1, d2] }; >x272 : () => Base[] >Base : Base ->undefined || function named() { return [d1, d2] } : () => Base[] +>undefined || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >undefined : undefined ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x273: Base[] = undefined || [d1, d2]; >x273 : Base[] >Base : Base ->undefined || [d1, d2] : Base[] +>undefined || [d1, d2] : (Derived1 | Derived2)[] >undefined : undefined ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2689,9 +2689,9 @@ var x274: Array = undefined || [d1, d2]; >x274 : Base[] >Array : T[] >Base : Base ->undefined || [d1, d2] : Base[] +>undefined || [d1, d2] : (Derived1 | Derived2)[] >undefined : undefined ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2699,9 +2699,9 @@ var x275: { [n: number]: Base; } = undefined || [d1, d2]; >x275 : { [x: number]: Base; } >n : number >Base : Base ->undefined || [d1, d2] : { [x: number]: Base; } +>undefined || [d1, d2] : (Derived1 | Derived2)[] >undefined : undefined ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2709,78 +2709,78 @@ var x276: {n: Base[]; } = undefined || { n: [d1, d2] }; >x276 : { n: Base[]; } >n : Base[] >Base : Base ->undefined || { n: [d1, d2] } : { n: Base[]; } +>undefined || { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >undefined : undefined ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x277: () => Base[] = function() { return [d1, d2] } || function() { return [d1, d2] }; >x277 : () => Base[] >Base : Base ->function() { return [d1, d2] } || function() { return [d1, d2] } : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x278: () => Base[] = function named() { return [d1, d2] } || function named() { return [d1, d2] }; >x278 : () => Base[] >Base : Base ->function named() { return [d1, d2] } || function named() { return [d1, d2] } : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x279: { (): Base[]; } = function() { return [d1, d2] } || function() { return [d1, d2] }; >x279 : () => Base[] >Base : Base ->function() { return [d1, d2] } || function() { return [d1, d2] } : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } || function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x280: { (): Base[]; } = function named() { return [d1, d2] } || function named() { return [d1, d2] }; >x280 : () => Base[] >Base : Base ->function named() { return [d1, d2] } || function named() { return [d1, d2] } : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } || function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x281: Base[] = [d1, d2] || [d1, d2]; >x281 : Base[] >Base : Base ->[d1, d2] || [d1, d2] : Base[] ->[d1, d2] : Base[] +>[d1, d2] || [d1, d2] : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2788,11 +2788,11 @@ var x282: Array = [d1, d2] || [d1, d2]; >x282 : Base[] >Array : T[] >Base : Base ->[d1, d2] || [d1, d2] : Base[] ->[d1, d2] : Base[] +>[d1, d2] || [d1, d2] : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2800,11 +2800,11 @@ var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2]; >x283 : { [x: number]: Base; } >n : number >Base : Base ->[d1, d2] || [d1, d2] : { [x: number]: Base; } ->[d1, d2] : Base[] +>[d1, d2] || [d1, d2] : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2812,108 +2812,108 @@ var x284: {n: Base[]; } = { n: [d1, d2] } || { n: [d1, d2] }; >x284 : { n: Base[]; } >n : Base[] >Base : Base ->{ n: [d1, d2] } || { n: [d1, d2] } : { n: Base[]; } ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } || { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; >x285 : () => Base[] >Base : Base ->true ? () => [d1, d2] : () => [d1, d2] : () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; >x286 : () => Base[] >Base : Base ->true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x287: () => Base[] = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; >x287 : () => Base[] >Base : Base ->true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; >x288 : () => Base[] >Base : Base ->true ? () => [d1, d2] : () => [d1, d2] : () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; >x289 : () => Base[] >Base : Base ->true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; >x290 : () => Base[] >Base : Base ->true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x291: Base[] = true ? [d1, d2] : [d1, d2]; >x291 : Base[] >Base : Base ->true ? [d1, d2] : [d1, d2] : Base[] ->[d1, d2] : Base[] +>true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2921,11 +2921,11 @@ var x292: Array = true ? [d1, d2] : [d1, d2]; >x292 : Base[] >Array : T[] >Base : Base ->true ? [d1, d2] : [d1, d2] : Base[] ->[d1, d2] : Base[] +>true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2933,11 +2933,11 @@ var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; >x293 : { [x: number]: Base; } >n : number >Base : Base ->true ? [d1, d2] : [d1, d2] : { [x: number]: Base; } ->[d1, d2] : Base[] +>true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2945,15 +2945,15 @@ var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; >x294 : { n: Base[]; } >n : Base[] >Base : Base ->true ? { n: [d1, d2] } : { n: [d1, d2] } : { n: Base[]; } ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>true ? { n: [d1, d2] } : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2961,7 +2961,7 @@ var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n = >x295 : (s: Base[]) => any >s : Base[] >Base : Base ->true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; } : (s: Base[]) => any +>true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; } : (n: Base[]) => any >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] @@ -2975,90 +2975,90 @@ var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n >x296 : Genric >Genric : Genric >Base : Base ->true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } } : Genric ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x297: () => Base[] = true ? undefined : () => [d1, d2]; >x297 : () => Base[] >Base : Base ->true ? undefined : () => [d1, d2] : () => Base[] +>true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] >undefined : undefined ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; >x298 : () => Base[] >Base : Base ->true ? undefined : function() { return [d1, d2] } : () => Base[] +>true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >undefined : undefined ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] }; >x299 : () => Base[] >Base : Base ->true ? undefined : function named() { return [d1, d2] } : () => Base[] +>true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >undefined : undefined ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; >x300 : () => Base[] >Base : Base ->true ? undefined : () => [d1, d2] : () => Base[] +>true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] >undefined : undefined ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; >x301 : () => Base[] >Base : Base ->true ? undefined : function() { return [d1, d2] } : () => Base[] +>true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >undefined : undefined ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2] }; >x302 : () => Base[] >Base : Base ->true ? undefined : function named() { return [d1, d2] } : () => Base[] +>true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >undefined : undefined ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x303: Base[] = true ? undefined : [d1, d2]; >x303 : Base[] >Base : Base ->true ? undefined : [d1, d2] : Base[] +>true ? undefined : [d1, d2] : (Derived1 | Derived2)[] >undefined : undefined ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3066,9 +3066,9 @@ var x304: Array = true ? undefined : [d1, d2]; >x304 : Base[] >Array : T[] >Base : Base ->true ? undefined : [d1, d2] : Base[] +>true ? undefined : [d1, d2] : (Derived1 | Derived2)[] >undefined : undefined ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3076,9 +3076,9 @@ var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; >x305 : { [x: number]: Base; } >n : number >Base : Base ->true ? undefined : [d1, d2] : { [x: number]: Base; } +>true ? undefined : [d1, d2] : (Derived1 | Derived2)[] >undefined : undefined ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3086,11 +3086,11 @@ var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; >x306 : { n: Base[]; } >n : Base[] >Base : Base ->true ? undefined : { n: [d1, d2] } : { n: Base[]; } +>true ? undefined : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >undefined : undefined ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3098,7 +3098,7 @@ var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return n >x307 : (s: Base[]) => any >s : Base[] >Base : Base ->true ? undefined : n => { var n: Base[]; return null; } : (s: Base[]) => any +>true ? undefined : n => { var n: Base[]; return null; } : (n: Base[]) => any >undefined : undefined >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] @@ -3109,22 +3109,22 @@ var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; >x308 : Genric >Genric : Genric >Base : Base ->true ? undefined : { func: n => { return [d1, d2]; } } : Genric +>true ? undefined : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >undefined : undefined ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 var x309: () => Base[] = true ? () => [d1, d2] : undefined; >x309 : () => Base[] >Base : Base ->true ? () => [d1, d2] : undefined : () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3132,9 +3132,9 @@ var x309: () => Base[] = true ? () => [d1, d2] : undefined; var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; >x310 : () => Base[] >Base : Base ->true ? function() { return [d1, d2] } : undefined : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3142,10 +3142,10 @@ var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined; >x311 : () => Base[] >Base : Base ->true ? function named() { return [d1, d2] } : undefined : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3153,9 +3153,9 @@ var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; >x312 : () => Base[] >Base : Base ->true ? () => [d1, d2] : undefined : () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3163,9 +3163,9 @@ var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; >x313 : () => Base[] >Base : Base ->true ? function() { return [d1, d2] } : undefined : () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3173,10 +3173,10 @@ var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefined; >x314 : () => Base[] >Base : Base ->true ? function named() { return [d1, d2] } : undefined : () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3184,8 +3184,8 @@ var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefi var x315: Base[] = true ? [d1, d2] : undefined; >x315 : Base[] >Base : Base ->true ? [d1, d2] : undefined : Base[] ->[d1, d2] : Base[] +>true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3194,8 +3194,8 @@ var x316: Array = true ? [d1, d2] : undefined; >x316 : Base[] >Array : T[] >Base : Base ->true ? [d1, d2] : undefined : Base[] ->[d1, d2] : Base[] +>true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3204,8 +3204,8 @@ var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; >x317 : { [x: number]: Base; } >n : number >Base : Base ->true ? [d1, d2] : undefined : { [x: number]: Base; } ->[d1, d2] : Base[] +>true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3214,10 +3214,10 @@ var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; >x318 : { n: Base[]; } >n : Base[] >Base : Base ->true ? { n: [d1, d2] } : undefined : { n: Base[]; } ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>true ? { n: [d1, d2] } : undefined : { n: (Derived1 | Derived2)[]; } +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3226,7 +3226,7 @@ var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : und >x319 : (s: Base[]) => any >s : Base[] >Base : Base ->true ? n => { var n: Base[]; return null; } : undefined : (s: Base[]) => any +>true ? n => { var n: Base[]; return null; } : undefined : (n: Base[]) => any >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] @@ -3237,12 +3237,12 @@ var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; >x320 : Genric >Genric : Genric >Base : Base ->true ? { func: n => { return [d1, d2]; } } : undefined : Genric ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>true ? { func: n => { return [d1, d2]; } } : undefined : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 >undefined : undefined @@ -3253,8 +3253,8 @@ function x321(n: () => Base[]) { }; x321(() => [d1, d2]); >Base : Base >x321(() => [d1, d2]) : void >x321 : (n: () => Base[]) => void ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3264,8 +3264,8 @@ function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); >Base : Base >x322(function() { return [d1, d2] }) : void >x322 : (n: () => Base[]) => void ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3275,9 +3275,9 @@ function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); >Base : Base >x323(function named() { return [d1, d2] }) : void >x323 : (n: () => Base[]) => void ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3287,8 +3287,8 @@ function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); >Base : Base >x324(() => [d1, d2]) : void >x324 : (n: () => Base[]) => void ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3298,8 +3298,8 @@ function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); >Base : Base >x325(function() { return [d1, d2] }) : void >x325 : (n: () => Base[]) => void ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3309,9 +3309,9 @@ function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] } >Base : Base >x326(function named() { return [d1, d2] }) : void >x326 : (n: () => Base[]) => void ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3321,7 +3321,7 @@ function x327(n: Base[]) { }; x327([d1, d2]); >Base : Base >x327([d1, d2]) : void >x327 : (n: Base[]) => void ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3332,7 +3332,7 @@ function x328(n: Array) { }; x328([d1, d2]); >Base : Base >x328([d1, d2]) : void >x328 : (n: Base[]) => void ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3343,7 +3343,7 @@ function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); >Base : Base >x329([d1, d2]) : void >x329 : (n: { [x: number]: Base; }) => void ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3354,9 +3354,9 @@ function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); >Base : Base >x330({ n: [d1, d2] }) : void >x330 : (n: { n: Base[]; }) => void ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3379,11 +3379,11 @@ function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); >Base : Base >x332({ func: n => { return [d1, d2]; } }) : void >x332 : (n: Genric) => void ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3395,8 +3395,8 @@ var x333 = (n: () => Base[]) => n; x333(() => [d1, d2]); >n : () => Base[] >x333(() => [d1, d2]) : () => Base[] >x333 : (n: () => Base[]) => () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3408,8 +3408,8 @@ var x334 = (n: () => Base[]) => n; x334(function() { return [d1, d2] }); >n : () => Base[] >x334(function() { return [d1, d2] }) : () => Base[] >x334 : (n: () => Base[]) => () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3421,9 +3421,9 @@ var x335 = (n: () => Base[]) => n; x335(function named() { return [d1, d2] }); >n : () => Base[] >x335(function named() { return [d1, d2] }) : () => Base[] >x335 : (n: () => Base[]) => () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3435,8 +3435,8 @@ var x336 = (n: { (): Base[]; }) => n; x336(() => [d1, d2]); >n : () => Base[] >x336(() => [d1, d2]) : () => Base[] >x336 : (n: () => Base[]) => () => Base[] ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3448,8 +3448,8 @@ var x337 = (n: { (): Base[]; }) => n; x337(function() { return [d1, d2] }); >n : () => Base[] >x337(function() { return [d1, d2] }) : () => Base[] >x337 : (n: () => Base[]) => () => Base[] ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3461,9 +3461,9 @@ var x338 = (n: { (): Base[]; }) => n; x338(function named() { return [d1, d2] }) >n : () => Base[] >x338(function named() { return [d1, d2] }) : () => Base[] >x338 : (n: () => Base[]) => () => Base[] ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3475,7 +3475,7 @@ var x339 = (n: Base[]) => n; x339([d1, d2]); >n : Base[] >x339([d1, d2]) : Base[] >x339 : (n: Base[]) => Base[] ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3488,7 +3488,7 @@ var x340 = (n: Array) => n; x340([d1, d2]); >n : Base[] >x340([d1, d2]) : Base[] >x340 : (n: Base[]) => Base[] ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3501,7 +3501,7 @@ var x341 = (n: { [n: number]: Base; }) => n; x341([d1, d2]); >n : { [x: number]: Base; } >x341([d1, d2]) : { [x: number]: Base; } >x341 : (n: { [x: number]: Base; }) => { [x: number]: Base; } ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3514,9 +3514,9 @@ var x342 = (n: {n: Base[]; } ) => n; x342({ n: [d1, d2] }); >n : { n: Base[]; } >x342({ n: [d1, d2] }) : { n: Base[]; } >x342 : (n: { n: Base[]; }) => { n: Base[]; } ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3543,11 +3543,11 @@ var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); >n : Genric >x344({ func: n => { return [d1, d2]; } }) : Genric >x344 : (n: Genric) => Genric ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3558,8 +3558,8 @@ var x345 = function(n: () => Base[]) { }; x345(() => [d1, d2]); >Base : Base >x345(() => [d1, d2]) : void >x345 : (n: () => Base[]) => void ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3570,8 +3570,8 @@ var x346 = function(n: () => Base[]) { }; x346(function() { return [d1, d2] }); >Base : Base >x346(function() { return [d1, d2] }) : void >x346 : (n: () => Base[]) => void ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3582,9 +3582,9 @@ var x347 = function(n: () => Base[]) { }; x347(function named() { return [d1, d2 >Base : Base >x347(function named() { return [d1, d2] }) : void >x347 : (n: () => Base[]) => void ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3595,8 +3595,8 @@ var x348 = function(n: { (): Base[]; }) { }; x348(() => [d1, d2]); >Base : Base >x348(() => [d1, d2]) : void >x348 : (n: () => Base[]) => void ->() => [d1, d2] : () => Base[] ->[d1, d2] : Base[] +>() => [d1, d2] : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3607,8 +3607,8 @@ var x349 = function(n: { (): Base[]; }) { }; x349(function() { return [d1, d2] } >Base : Base >x349(function() { return [d1, d2] }) : void >x349 : (n: () => Base[]) => void ->function() { return [d1, d2] } : () => Base[] ->[d1, d2] : Base[] +>function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3619,9 +3619,9 @@ var x350 = function(n: { (): Base[]; }) { }; x350(function named() { return [d1, >Base : Base >x350(function named() { return [d1, d2] }) : void >x350 : (n: () => Base[]) => void ->function named() { return [d1, d2] } : () => Base[] ->named : () => Base[] ->[d1, d2] : Base[] +>function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>named : () => (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3632,7 +3632,7 @@ var x351 = function(n: Base[]) { }; x351([d1, d2]); >Base : Base >x351([d1, d2]) : void >x351 : (n: Base[]) => void ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3644,7 +3644,7 @@ var x352 = function(n: Array) { }; x352([d1, d2]); >Base : Base >x352([d1, d2]) : void >x352 : (n: Base[]) => void ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3656,7 +3656,7 @@ var x353 = function(n: { [n: number]: Base; }) { }; x353([d1, d2]); >Base : Base >x353([d1, d2]) : void >x353 : (n: { [x: number]: Base; }) => void ->[d1, d2] : Base[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3668,9 +3668,9 @@ var x354 = function(n: {n: Base[]; } ) { }; x354({ n: [d1, d2] }); >Base : Base >x354({ n: [d1, d2] }) : void >x354 : (n: { n: Base[]; }) => void ->{ n: [d1, d2] } : { n: Base[]; } ->n : Base[] ->[d1, d2] : Base[] +>{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>n : (Derived1 | Derived2)[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3695,11 +3695,11 @@ var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } >Base : Base >x356({ func: n => { return [d1, d2]; } }) : void >x356 : (n: Genric) => void ->{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } ->func : (n: Base[]) => {}[] ->n => { return [d1, d2]; } : (n: Base[]) => {}[] +>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>func : (n: Base[]) => (Derived1 | Derived2)[] +>n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] >n : Base[] ->[d1, d2] : {}[] +>[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 diff --git a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt index d07bbe81e1e..4c3245b11f7 100644 --- a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt +++ b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/interfaces/declarationMerging/genericAndNonGenericInterfaceWithTheSameName.ts(7,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/conformance/interfaces/declarationMerging/genericAndNonGenericInterfaceWithTheSameName.ts(16,15): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/conformance/interfaces/declarationMerging/genericAndNonGenericInterfaceWithTheSameName.ts(40,22): error TS2428: All declarations of an interface must have identical type parameters. + + ==== tests/cases/conformance/interfaces/declarationMerging/genericAndNonGenericInterfaceWithTheSameName.ts (3 errors) ==== // generic and non-generic interfaces with the same name do not merge @@ -7,7 +12,7 @@ interface A { // error ~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. bar: T; } @@ -18,7 +23,7 @@ interface A { // error ~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. foo: string; } } @@ -44,7 +49,7 @@ module M3 { export interface A { // error ~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. bar: T; } } \ No newline at end of file diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types index 2ac2483c405..768b8846880 100644 --- a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types @@ -49,7 +49,7 @@ _.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'] : {}[] +>[true, 1, null, 'yes'] : (string | number | boolean)[] >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericArray0.types b/tests/baselines/reference/genericArray0.types index 80a9d5199bd..bf0155bb9ba 100644 --- a/tests/baselines/reference/genericArray0.types +++ b/tests/baselines/reference/genericArray0.types @@ -16,6 +16,6 @@ function map() { var ys: U[] = []; >ys : U[] >U : U ->[] : U[] +>[] : undefined[] } diff --git a/tests/baselines/reference/genericArrayAssignment1.errors.txt b/tests/baselines/reference/genericArrayAssignment1.errors.txt index 1b8d6cb2aab..a0a6b020542 100644 --- a/tests/baselines/reference/genericArrayAssignment1.errors.txt +++ b/tests/baselines/reference/genericArrayAssignment1.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/genericArrayAssignment1.ts(4,1): error TS2322: Type 'number[]' is not assignable to type 'string[]'. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/genericArrayAssignment1.ts (1 errors) ==== var s: string[]; var n: number[]; s = n; ~ -!!! Type 'number[]' is not assignable to type 'string[]': -!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt b/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt index e57112cf0fa..02ac17bb10c 100644 --- a/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt +++ b/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/genericArrayAssignmentCompatErrors.ts(2,15): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/genericArrayAssignmentCompatErrors.ts(4,14): error TS2314: Generic type 'Array' requires 1 type argument(s). + + ==== tests/cases/compiler/genericArrayAssignmentCompatErrors.ts (2 errors) ==== var myCars=new Array(); var myCars2 = new []; ~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var myCars3 = new Array({}); var myCars4: Array; // error ~~~~~ -!!! Generic type 'Array' requires 1 type argument(s). +!!! error TS2314: Generic type 'Array' requires 1 type argument(s). var myCars5: Array[]; myCars = myCars2; diff --git a/tests/baselines/reference/genericArrayExtenstions.errors.txt b/tests/baselines/reference/genericArrayExtenstions.errors.txt index c13b637a392..e3004eb2838 100644 --- a/tests/baselines/reference/genericArrayExtenstions.errors.txt +++ b/tests/baselines/reference/genericArrayExtenstions.errors.txt @@ -1,10 +1,15 @@ +tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS2420: Class 'ObservableArray' incorrectly implements interface 'T[]'. + Property 'length' is missing in type 'ObservableArray'. + + ==== tests/cases/compiler/genericArrayExtenstions.ts (2 errors) ==== export declare class ObservableArray implements Array { // MS.Entertainment.ObservableArray ~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ~~~~~~~~~~~~~~~ -!!! Class 'ObservableArray' incorrectly implements interface 'T[]': -!!! Property 'length' is missing in type 'ObservableArray'. +!!! error TS2420: Class 'ObservableArray' incorrectly implements interface 'T[]'. +!!! error TS2420: Property 'length' is missing in type 'ObservableArray'. concat(...items: U[]): T[]; concat(...items: T[]): T[]; } diff --git a/tests/baselines/reference/genericArrayMethods1.errors.txt b/tests/baselines/reference/genericArrayMethods1.errors.txt index 669fa926c26..b5e766c54c4 100644 --- a/tests/baselines/reference/genericArrayMethods1.errors.txt +++ b/tests/baselines/reference/genericArrayMethods1.errors.txt @@ -1,6 +1,10 @@ +tests/cases/compiler/genericArrayMethods1.ts(1,5): error TS2322: Type 'number[]' is not assignable to type 'string[]'. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/genericArrayMethods1.ts (1 errors) ==== var x:string[] = [0,1].slice(0); // this should be an error ~ -!!! Type 'number[]' is not assignable to type 'string[]': -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt b/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt index 7cec6a532a4..dcb0de1cbb5 100644 --- a/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt +++ b/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts(4,24): error TS2314: Generic type 'IFoo' requires 1 type argument(s). + + ==== tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts (1 errors) ==== interface IFoo{ } class Bar { public getBar(foo: IFoo[]) { ~~~~ -!!! Generic type 'IFoo' requires 1 type argument(s). +!!! error TS2314: Generic type 'IFoo' requires 1 type argument(s). } } \ No newline at end of file diff --git a/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.errors.txt b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.errors.txt index ad664c5c5b8..2ff34413595 100644 --- a/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.errors.txt +++ b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/genericAssignmentCompatOfFunctionSignatures1.ts(1,27): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/genericAssignmentCompatOfFunctionSignatures1.ts(2,27): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/genericAssignmentCompatOfFunctionSignatures1.ts (2 errors) ==== var x1 = function foo3(x: T, z: U) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var x2 = function foo3(x: T, z: U) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x1 = x2; x2 = x1; \ No newline at end of file diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt index 8bd0c913128..f335319cafd 100644 --- a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt @@ -1,3 +1,21 @@ +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. + Types of property 'compareTo' are incompatible. + Type '(other: number) => number' is not assignable to type '(other: string) => number'. + Types of parameters 'other' and 'other' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(16,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS2322: Type 'K' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. + + ==== tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts (4 errors) ==== interface Comparable { compareTo(other: T): number; @@ -12,41 +30,29 @@ var z = { x: new A() }; var a1: I = { x: new A() }; ~~ -!!! Type '{ x: A; }' is not assignable to type 'I': -!!! Types of property 'x' are incompatible: -!!! Type 'A' is not assignable to type 'Comparable': -!!! Types of property 'compareTo' are incompatible: -!!! Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! Types of parameters 'other' and 'other' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2322: Types of property 'compareTo' are incompatible. +!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number'. +!!! error TS2322: Types of parameters 'other' and 'other' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var a2: I = function (): { x: A } { ~~ -!!! Type '{ x: A; }' is not assignable to type 'I': -!!! Types of property 'x' are incompatible: -!!! Type 'A' is not assignable to type 'Comparable': -!!! Types of property 'compareTo' are incompatible: -!!! Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! Types of parameters 'other' and 'other' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. var z = { x: new A() }; return z; } (); var a3: I = z; ~~ -!!! Type '{ x: A; }' is not assignable to type 'I': -!!! Types of property 'x' are incompatible: -!!! Type 'A' is not assignable to type 'Comparable': -!!! Types of property 'compareTo' are incompatible: -!!! Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! Types of parameters 'other' and 'other' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. var a4: I = >z; ~~ -!!! Type 'K' is not assignable to type 'I': -!!! Types of property 'x' are incompatible: -!!! Type 'A' is not assignable to type 'Comparable': -!!! Types of property 'compareTo' are incompatible: -!!! Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! Types of parameters 'other' and 'other' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'K' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. \ No newline at end of file diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.types b/tests/baselines/reference/genericBaseClassLiteralProperty2.types index b2d156e3c16..9caa45b8b8f 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.types +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.types @@ -14,11 +14,11 @@ class BaseCollection2 { constructor() { this._itemsByKey = {}; ->this._itemsByKey = {} : { [x: string]: TItem; } +>this._itemsByKey = {} : { [x: string]: undefined; } >this._itemsByKey : { [x: string]: TItem; } >this : BaseCollection2 >_itemsByKey : { [x: string]: TItem; } ->{} : { [x: string]: TItem; } +>{} : { [x: string]: undefined; } } } diff --git a/tests/baselines/reference/genericCallSpecializedToTypeArg.errors.txt b/tests/baselines/reference/genericCallSpecializedToTypeArg.errors.txt index 40d523e01e1..4deec14741c 100644 --- a/tests/baselines/reference/genericCallSpecializedToTypeArg.errors.txt +++ b/tests/baselines/reference/genericCallSpecializedToTypeArg.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/genericCallSpecializedToTypeArg.ts(6,5): error TS2339: Property 'getDist' does not exist on type 'U'. + + ==== tests/cases/compiler/genericCallSpecializedToTypeArg.ts (1 errors) ==== function dupe(x: T): T { return x; @@ -6,7 +9,7 @@ var y = dupe(x); //<-- dupe has incorrect type here y.getDist(); //<-- this requires a missing constraint, but it's not caught ~~~~~~~ -!!! Property 'getDist' does not exist on type 'U'. +!!! error TS2339: Property 'getDist' does not exist on type 'U'. return y; } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 95fec27cff6..8900e975030 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(24,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(53,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(69,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(85,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + + ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ==== module m1 { @@ -24,7 +30,7 @@ var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ -!!! Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. } ////////////////////////////////////// @@ -55,7 +61,7 @@ var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ -!!! Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. } ////////////////////////////////////// @@ -73,7 +79,7 @@ var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ -!!! Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. } ////////////////////////////////////// @@ -91,6 +97,6 @@ var numPromise: Promise; var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ -!!! Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types index c79efb0792c..f4965940436 100644 --- a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types @@ -25,36 +25,36 @@ var ra = foo([1, 2]); // any[] >ra : any[] >foo([1, 2]) : any[] >foo : (t: T) => T ->[1, 2] : any[] +>[1, 2] : number[] var r2 = foo([]); // any[] >r2 : any[] >foo([]) : any[] >foo : (t: T) => T ->[] : any[] +>[] : undefined[] var r3 = foo([]); // number[] >r3 : number[] >foo([]) : number[] >foo : (t: T) => T ->[] : number[] +>[] : undefined[] var r4 = foo([1, '']); // {}[] ->r4 : {}[] ->foo([1, '']) : {}[] +>r4 : (string | number)[] +>foo([1, '']) : (string | number)[] >foo : (t: T) => T ->[1, ''] : {}[] +>[1, ''] : (string | number)[] var r5 = foo([1, '']); // any[] >r5 : any[] >foo([1, '']) : any[] >foo : (t: T) => T ->[1, ''] : any[] +>[1, ''] : (string | number)[] var r6 = foo([1, '']); // Object[] >r6 : Object[] >foo([1, '']) : Object[] >foo : (t: T) => T >Object : Object ->[1, ''] : Object[] +>[1, ''] : (string | number)[] diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt index 6d829215cd2..604896319ca 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt @@ -1,9 +1,13 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts(3,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +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 (2 errors) ==== // Generic call with parameters of T and U, U extends T, no parameter of type U function foo(t: T) { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var u: U; return u; } @@ -13,5 +17,5 @@ var r3 = foo(new Object()); // {} var r4 = foo(1); // error ~ -!!! Argument of type 'number' is not assignable to parameter of type 'Date'. +!!! error TS2345: Argument of type 'number' 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/genericCallWithConstructorTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt index c92110911ab..48e615bdb3e 100644 --- a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: any) => string; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(13,14): error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. + + ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts (2 errors) ==== // Generic call with parameter of object type with member of function type of n args passed object whose associated member is call signature with n+1 args @@ -11,11 +15,11 @@ var arg2: { cb: new (x: T, y: T) => string }; var r2 = foo(arg2); // error ~~~~ -!!! Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: any) => string; }'. +!!! error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: any) => string; }'. var arg3: { cb: new (x: string, y: number) => string }; var r3 = foo(arg3); // error ~~~~ -!!! Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. +!!! error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. function foo2(arg: { cb: new(t: T, t2: T) => U }) { return new arg.cb(null, null); diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt new file mode 100644 index 00000000000..093c4bed545 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt @@ -0,0 +1,64 @@ +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'. +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'. +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'. +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'. +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'. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts (5 errors) ==== + // Generic functions used as arguments for function typed parameters are not used to make inferences from + // Using function arguments, no errors expected + + function foo(x: (a: T) => T) { + return x(null); + } + + var r = foo((x: U) => ''); // {} + var r2 = foo((x: U) => ''); // string + var r3 = foo(x => ''); // {} + + function foo2(x: T, cb: (a: T) => U) { + return cb(x); + } + + var r4 = foo2(1, function (a: Z) { return '' }); // string, contextual signature instantiation is applied to generic functions + var r5 = foo2(1, (a) => ''); // string + var r6 = foo2('', (a: Z) => 1); + + function foo3(x: T, cb: (a: T) => U, y: U) { + return cb(x); + } + + var r7 = foo3(1, (a: Z) => '', ''); // string + + 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'. + 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'. + 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'. + 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'. + 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'. + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments.js index 8e844cfbc5a..fed1d4ca990 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.js +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.js @@ -24,16 +24,16 @@ function foo3(x: T, cb: (a: T) => U, y: U) { var r7 = foo3(1, (a: Z) => '', ''); // string -var r8 = foo3(1, function (a) { return '' }, 1); // {} +var r8 = foo3(1, function (a) { return '' }, 1); // error var r9 = foo3(1, (a) => '', ''); // string function other(t: T, u: U) { - var r10 = foo2(1, (x: T) => ''); // string, non-generic signature allows inferences to be made + var r10 = foo2(1, (x: T) => ''); // error var r10 = foo2(1, (x) => ''); // string - var r11 = foo3(1, (x: T) => '', ''); // string - var r11b = foo3(1, (x: T) => '', 1); // {} - var r12 = foo3(1, function (a) { return '' }, 1); // {} + var r11 = foo3(1, (x: T) => '', ''); // error + var r11b = foo3(1, (x: T) => '', 1); // error + var r12 = foo3(1, function (a) { return '' }, 1); // error } //// [genericCallWithFunctionTypedArguments.js] @@ -59,14 +59,14 @@ function foo3(x, cb, y) { var r7 = foo3(1, function (a) { return ''; }, ''); // string var r8 = foo3(1, function (a) { return ''; -}, 1); // {} +}, 1); // error var r9 = foo3(1, function (a) { return ''; }, ''); // string function other(t, u) { - var r10 = foo2(1, function (x) { return ''; }); // string, non-generic signature allows inferences to be made + var r10 = foo2(1, function (x) { return ''; }); // error var r10 = foo2(1, function (x) { return ''; }); // string - var r11 = foo3(1, function (x) { return ''; }, ''); // string - var r11b = foo3(1, function (x) { return ''; }, 1); // {} + var r11 = foo3(1, function (x) { return ''; }, ''); // error + var r11b = foo3(1, function (x) { return ''; }, 1); // error var r12 = foo3(1, function (a) { return ''; - }, 1); // {} + }, 1); // error } diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments.types deleted file mode 100644 index 2d3b234d0e1..00000000000 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.types +++ /dev/null @@ -1,173 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts === -// Generic functions used as arguments for function typed parameters are not used to make inferences from -// Using function arguments, no errors expected - -function foo(x: (a: T) => T) { ->foo : (x: (a: T) => T) => T ->T : T ->x : (a: T) => T ->a : T ->T : T ->T : T - - return x(null); ->x(null) : T ->x : (a: T) => T -} - -var r = foo((x: U) => ''); // {} ->r : {} ->foo((x: U) => '') : {} ->foo : (x: (a: T) => T) => T ->(x: U) => '' : (x: U) => string ->U : U ->x : U ->U : U - -var r2 = foo((x: U) => ''); // string ->r2 : string ->foo((x: U) => '') : string ->foo : (x: (a: T) => T) => T ->(x: U) => '' : (x: U) => string ->U : U ->x : U ->U : U - -var r3 = foo(x => ''); // {} ->r3 : {} ->foo(x => '') : {} ->foo : (x: (a: T) => T) => T ->x => '' : (x: {}) => string ->x : {} - -function foo2(x: T, cb: (a: T) => U) { ->foo2 : (x: T, cb: (a: T) => U) => U ->T : T ->U : U ->x : T ->T : T ->cb : (a: T) => U ->a : T ->T : T ->U : U - - return cb(x); ->cb(x) : U ->cb : (a: T) => U ->x : T -} - -var r4 = foo2(1, function (a: Z) { return '' }); // string, contextual signature instantiation is applied to generic functions ->r4 : string ->foo2(1, function (a: Z) { return '' }) : string ->foo2 : (x: T, cb: (a: T) => U) => U ->function (a: Z) { return '' } : (a: Z) => string ->Z : Z ->a : Z ->Z : Z - -var r5 = foo2(1, (a) => ''); // string ->r5 : string ->foo2(1, (a) => '') : string ->foo2 : (x: T, cb: (a: T) => U) => U ->(a) => '' : (a: number) => string ->a : number - -var r6 = foo2('', (a: Z) => 1); ->r6 : number ->foo2('', (a: Z) => 1) : number ->foo2 : (x: T, cb: (a: T) => U) => U ->(a: Z) => 1 : (a: Z) => number ->Z : Z ->a : Z ->Z : Z - -function foo3(x: T, cb: (a: T) => U, y: U) { ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->T : T ->U : U ->x : T ->T : T ->cb : (a: T) => U ->a : T ->T : T ->U : U ->y : U ->U : U - - return cb(x); ->cb(x) : U ->cb : (a: T) => U ->x : T -} - -var r7 = foo3(1, (a: Z) => '', ''); // string ->r7 : string ->foo3(1, (a: Z) => '', '') : string ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->(a: Z) => '' : (a: Z) => string ->Z : Z ->a : Z ->Z : Z - -var r8 = foo3(1, function (a) { return '' }, 1); // {} ->r8 : {} ->foo3(1, function (a) { return '' }, 1) : {} ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->function (a) { return '' } : (a: number) => string ->a : number - -var r9 = foo3(1, (a) => '', ''); // string ->r9 : string ->foo3(1, (a) => '', '') : string ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->(a) => '' : (a: number) => string ->a : number - -function other(t: T, u: U) { ->other : (t: T, u: U) => void ->T : T ->U : U ->t : T ->T : T ->u : U ->U : U - - var r10 = foo2(1, (x: T) => ''); // string, non-generic signature allows inferences to be made ->r10 : string ->foo2(1, (x: T) => '') : string ->foo2 : (x: T, cb: (a: T) => U) => U ->(x: T) => '' : (x: T) => string ->x : T ->T : T - - var r10 = foo2(1, (x) => ''); // string ->r10 : string ->foo2(1, (x) => '') : string ->foo2 : (x: T, cb: (a: T) => U) => U ->(x) => '' : (x: number) => string ->x : number - - var r11 = foo3(1, (x: T) => '', ''); // string ->r11 : string ->foo3(1, (x: T) => '', '') : string ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->(x: T) => '' : (x: T) => string ->x : T ->T : T - - var r11b = foo3(1, (x: T) => '', 1); // {} ->r11b : {} ->foo3(1, (x: T) => '', 1) : {} ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->(x: T) => '' : (x: T) => string ->x : T ->T : T - - var r12 = foo3(1, function (a) { return '' }, 1); // {} ->r12 : {} ->foo3(1, function (a) { return '' }, 1) : {} ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->function (a) { return '' } : (a: number) => string ->a : number -} diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt new file mode 100644 index 00000000000..3a397a66eba --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt @@ -0,0 +1,54 @@ +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'. +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'. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts (2 errors) ==== + // Generic functions used as arguments for function typed parameters are not used to make inferences from + // Using construct signature arguments, no errors expected + + function foo(x: new(a: T) => T) { + return new x(null); + } + + interface I { + new (x: T): T; + } + interface I2 { + new (x: T): T; + } + var i: I; + var i2: I2; + var a: { + new (x: T): T; + } + + var r = foo(i); // any + var r2 = foo(i); // string + var r3 = foo(i2); // string + var r3b = foo(a); // any + + function foo2(x: T, cb: new(a: T) => U) { + return new cb(x); + } + + 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'. + var r4b = foo2(1, a); // any + var r5 = foo2(1, i); // any + var r6 = foo2('', i2); // string + + function foo3(x: T, cb: new(a: T) => U, y: U) { + return new cb(x); + } + + var r7 = foo3(null, i, ''); // any + var r7b = foo3(null, a, ''); // any + 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'. + var r9 = foo3('', i2, ''); // string \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js index ca9b79c3507..7e9b7886fb4 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js @@ -27,7 +27,7 @@ function foo2(x: T, cb: new(a: T) => U) { return new cb(x); } -var r4 = foo2(1, i2); // string, instantiated generic +var r4 = foo2(1, i2); // error var r4b = foo2(1, a); // any var r5 = foo2(1, i); // any var r6 = foo2('', i2); // string @@ -38,7 +38,7 @@ function foo3(x: T, cb: new(a: T) => U, y: U) { var r7 = foo3(null, i, ''); // any var r7b = foo3(null, a, ''); // any -var r8 = foo3(1, i2, 1); // {} +var r8 = foo3(1, i2, 1); // error var r9 = foo3('', i2, ''); // string //// [genericCallWithFunctionTypedArguments2.js] @@ -57,7 +57,7 @@ var r3b = foo(a); // any function foo2(x, cb) { return new cb(x); } -var r4 = foo2(1, i2); // string, instantiated generic +var r4 = foo2(1, i2); // error var r4b = foo2(1, a); // any var r5 = foo2(1, i); // any var r6 = foo2('', i2); // string @@ -66,5 +66,5 @@ function foo3(x, cb, y) { } var r7 = foo3(null, i, ''); // any var r7b = foo3(null, a, ''); // any -var r8 = foo3(1, i2, 1); // {} +var r8 = foo3(1, i2, 1); // error var r9 = foo3('', i2, ''); // string diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types deleted file mode 100644 index 89d7afd94e2..00000000000 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types +++ /dev/null @@ -1,161 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts === -// Generic functions used as arguments for function typed parameters are not used to make inferences from -// Using construct signature arguments, no errors expected - -function foo(x: new(a: T) => T) { ->foo : (x: new (a: T) => T) => T ->T : T ->x : new (a: T) => T ->a : T ->T : T ->T : T - - return new x(null); ->new x(null) : T ->x : new (a: T) => T -} - -interface I { ->I : I - - new (x: T): T; ->T : T ->x : T ->T : T ->T : T -} -interface I2 { ->I2 : I2 ->T : T - - new (x: T): T; ->x : T ->T : T ->T : T -} -var i: I; ->i : I ->I : I - -var i2: I2; ->i2 : I2 ->I2 : I2 - -var a: { ->a : new (x: T) => T - - new (x: T): T; ->T : T ->x : T ->T : T ->T : T -} - -var r = foo(i); // any ->r : any ->foo(i) : any ->foo : (x: new (a: T) => T) => T ->i : I - -var r2 = foo(i); // string ->r2 : string ->foo(i) : string ->foo : (x: new (a: T) => T) => T ->i : I - -var r3 = foo(i2); // string ->r3 : string ->foo(i2) : string ->foo : (x: new (a: T) => T) => T ->i2 : I2 - -var r3b = foo(a); // any ->r3b : any ->foo(a) : any ->foo : (x: new (a: T) => T) => T ->a : new (x: T) => T - -function foo2(x: T, cb: new(a: T) => U) { ->foo2 : (x: T, cb: new (a: T) => U) => U ->T : T ->U : U ->x : T ->T : T ->cb : new (a: T) => U ->a : T ->T : T ->U : U - - return new cb(x); ->new cb(x) : U ->cb : new (a: T) => U ->x : T -} - -var r4 = foo2(1, i2); // string, instantiated generic ->r4 : string ->foo2(1, i2) : string ->foo2 : (x: T, cb: new (a: T) => U) => U ->i2 : I2 - -var r4b = foo2(1, a); // any ->r4b : any ->foo2(1, a) : any ->foo2 : (x: T, cb: new (a: T) => U) => U ->a : new (x: T) => T - -var r5 = foo2(1, i); // any ->r5 : any ->foo2(1, i) : any ->foo2 : (x: T, cb: new (a: T) => U) => U ->i : I - -var r6 = foo2('', i2); // string ->r6 : string ->foo2('', i2) : string ->foo2 : (x: T, cb: new (a: T) => U) => U ->i2 : I2 - -function foo3(x: T, cb: new(a: T) => U, y: U) { ->foo3 : (x: T, cb: new (a: T) => U, y: U) => U ->T : T ->U : U ->x : T ->T : T ->cb : new (a: T) => U ->a : T ->T : T ->U : U ->y : U ->U : U - - return new cb(x); ->new cb(x) : U ->cb : new (a: T) => U ->x : T -} - -var r7 = foo3(null, i, ''); // any ->r7 : any ->foo3(null, i, '') : any ->foo3 : (x: T, cb: new (a: T) => U, y: U) => U ->i : I - -var r7b = foo3(null, a, ''); // any ->r7b : any ->foo3(null, a, '') : any ->foo3 : (x: T, cb: new (a: T) => U, y: U) => U ->a : new (x: T) => T - -var r8 = foo3(1, i2, 1); // {} ->r8 : {} ->foo3(1, i2, 1) : {} ->foo3 : (x: T, cb: new (a: T) => U, y: U) => U ->i2 : I2 - -var r9 = foo3('', i2, ''); // string ->r9 : string ->foo3('', i2, '') : string ->foo3 : (x: T, cb: new (a: T) => U, y: U) => U ->i2 : I2 - diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt index c185756667a..75ae76b1dbc 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt @@ -1,3 +1,11 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,14): error TS2345: Argument of type '{ cb: (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: {}) => string; }'. + Types of property 'cb' are incompatible. + Type '(x: T, y: T) => string' is not assignable to type '(t: {}) => string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. + Types of property 'cb' are incompatible. + Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. + + ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts (2 errors) ==== // Generic call with parameter of object type with member of function type of n args passed object whose associated member is call signature with n+1 args @@ -10,14 +18,14 @@ // more args not allowed var r2 = foo({ cb: (x: T, y: T) => '' }); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '{ cb: (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: any) => string; }'. -!!! Types of property 'cb' are incompatible: -!!! Type '(x: T, y: T) => string' is not assignable to type '(t: any) => string'. +!!! error TS2345: Argument of type '{ cb: (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: {}) => string; }'. +!!! error TS2345: Types of property 'cb' are incompatible. +!!! error TS2345: Type '(x: T, y: T) => string' is not assignable to type '(t: {}) => string'. var r3 = foo({ cb: (x: string, y: number) => '' }); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. -!!! Types of property 'cb' are incompatible: -!!! Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. +!!! error TS2345: Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. +!!! error TS2345: Types of property 'cb' are incompatible. +!!! error TS2345: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. function foo2(arg: { cb: (t: T, t2: T) => U }) { return arg.cb(null, null); diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt new file mode 100644 index 00000000000..2d5ad21959e --- /dev/null +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt @@ -0,0 +1,55 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts(18,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 '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts(19,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 '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts (2 errors) ==== + // When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, + // the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. + + function foo(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + //var r1 = foo((x: number) => 1, (x: string) => ''); // error + var r1b = foo((x) => 1, (x) => ''); // {} => {} + var r2 = foo((x: Object) => null, (x: string) => ''); // Object => Object + var r3 = foo((x: number) => 1, (x: Object) => null); // number => number + var r3ii = foo((x: number) => 1, (x: number) => 1); // number => number + + var a: { x: number; y?: number; }; + var b: { x: number; z?: number; }; + + var r4 = foo((x: typeof a) => a, (x: typeof b) => b); // typeof a => typeof 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 '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. + var r5 = foo((x: typeof b) => b, (x: typeof a) => a); // typeof b => typeof b + ~~~ +!!! 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 '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. + + function other(x: T) { + var r6 = foo((a: T) => a, (b: T) => b); // T => T + var r6b = foo((a) => a, (b) => b); // {} => {} + } + + function other2(x: T) { + var r7 = foo((a: T) => a, (b: T) => b); // T => T + var r7b = foo((a) => a, (b) => b); // {} => {} + var r8 = r7(null); + // BUG 835518 + //var r9 = r7(new Date()); + } + + + function foo2(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + function other3(x: T) { + var r8 = foo2((a: Date) => a, (b: Date) => b); // Date => Date + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments.types b/tests/baselines/reference/genericCallWithGenericSignatureArguments.types deleted file mode 100644 index 9f634070b56..00000000000 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments.types +++ /dev/null @@ -1,216 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts === -// When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, -// the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. - -function foo(a: (x: T) => T, b: (x: T) => T) { ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->T : T ->a : (x: T) => T ->x : T ->T : T ->T : T ->b : (x: T) => T ->x : T ->T : T ->T : T - - var r: (x: T) => T; ->r : (x: T) => T ->x : T ->T : T ->T : T - - return r; ->r : (x: T) => T -} - -//var r1 = foo((x: number) => 1, (x: string) => ''); // error -var r1b = foo((x) => 1, (x) => ''); // {} => {} ->r1b : (x: {}) => {} ->foo((x) => 1, (x) => '') : (x: {}) => {} ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x) => 1 : (x: {}) => number ->x : {} ->(x) => '' : (x: {}) => string ->x : {} - -var r2 = foo((x: Object) => null, (x: string) => ''); // Object => Object ->r2 : (x: any) => any ->foo((x: Object) => null, (x: string) => '') : (x: any) => any ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x: Object) => null : (x: Object) => any ->x : Object ->Object : Object ->(x: string) => '' : (x: string) => string ->x : string - -var r3 = foo((x: number) => 1, (x: Object) => null); // number => number ->r3 : (x: any) => any ->foo((x: number) => 1, (x: Object) => null) : (x: any) => any ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x: number) => 1 : (x: number) => number ->x : number ->(x: Object) => null : (x: Object) => any ->x : Object ->Object : Object - -var r3ii = foo((x: number) => 1, (x: number) => 1); // number => number ->r3ii : (x: number) => number ->foo((x: number) => 1, (x: number) => 1) : (x: number) => number ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x: number) => 1 : (x: number) => number ->x : number ->(x: number) => 1 : (x: number) => number ->x : number - -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 - -var r4 = foo((x: typeof a) => a, (x: typeof b) => b); // typeof a => typeof a ->r4 : (x: { x: number; y?: number; }) => { x: number; y?: number; } ->foo((x: typeof a) => a, (x: typeof b) => b) : (x: { x: number; y?: number; }) => { x: number; y?: number; } ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x: typeof a) => a : (x: { x: number; y?: number; }) => { x: number; y?: number; } ->x : { x: number; y?: number; } ->a : { x: number; y?: number; } ->a : { x: number; y?: number; } ->(x: typeof b) => b : (x: { x: number; z?: number; }) => { x: number; z?: number; } ->x : { x: number; z?: number; } ->b : { x: number; z?: number; } ->b : { x: number; z?: number; } - -var r5 = foo((x: typeof b) => b, (x: typeof a) => a); // typeof b => typeof b ->r5 : (x: { x: number; z?: number; }) => { x: number; z?: number; } ->foo((x: typeof b) => b, (x: typeof a) => a) : (x: { x: number; z?: number; }) => { x: number; z?: number; } ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x: typeof b) => b : (x: { x: number; z?: number; }) => { x: number; z?: number; } ->x : { x: number; z?: number; } ->b : { x: number; z?: number; } ->b : { x: number; z?: number; } ->(x: typeof a) => a : (x: { x: number; y?: number; }) => { x: number; y?: number; } ->x : { x: number; y?: number; } ->a : { x: number; y?: number; } ->a : { x: number; y?: number; } - -function other(x: T) { ->other : (x: T) => void ->T : T ->x : T ->T : T - - var r6 = foo((a: T) => a, (b: T) => b); // T => T ->r6 : (x: T) => T ->foo((a: T) => a, (b: T) => b) : (x: T) => T ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(a: T) => a : (a: T) => T ->a : T ->T : T ->a : T ->(b: T) => b : (b: T) => T ->b : T ->T : T ->b : T - - var r6b = foo((a) => a, (b) => b); // {} => {} ->r6b : (x: {}) => {} ->foo((a) => a, (b) => b) : (x: {}) => {} ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(a) => a : (a: {}) => {} ->a : {} ->a : {} ->(b) => b : (b: {}) => {} ->b : {} ->b : {} -} - -function other2(x: T) { ->other2 : (x: T) => void ->T : T ->Date : Date ->x : T ->T : T - - var r7 = foo((a: T) => a, (b: T) => b); // T => T ->r7 : (x: T) => T ->foo((a: T) => a, (b: T) => b) : (x: T) => T ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(a: T) => a : (a: T) => T ->a : T ->T : T ->a : T ->(b: T) => b : (b: T) => T ->b : T ->T : T ->b : T - - var r7b = foo((a) => a, (b) => b); // {} => {} ->r7b : (x: {}) => {} ->foo((a) => a, (b) => b) : (x: {}) => {} ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(a) => a : (a: {}) => {} ->a : {} ->a : {} ->(b) => b : (b: {}) => {} ->b : {} ->b : {} - - var r8 = r7(null); ->r8 : T ->r7(null) : T ->r7 : (x: T) => T - - // BUG 835518 - //var r9 = r7(new Date()); -} - - -function foo2(a: (x: T) => T, b: (x: T) => T) { ->foo2 : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->T : T ->Date : Date ->a : (x: T) => T ->x : T ->T : T ->T : T ->b : (x: T) => T ->x : T ->T : T ->T : T - - var r: (x: T) => T; ->r : (x: T) => T ->x : T ->T : T ->T : T - - return r; ->r : (x: T) => T -} - -function other3(x: T) { ->other3 : (x: T) => void ->T : T ->RegExp : RegExp ->x : T ->T : T - - var r8 = foo2((a: Date) => a, (b: Date) => b); // Date => Date ->r8 : (x: Date) => Date ->foo2((a: Date) => a, (b: Date) => b) : (x: Date) => Date ->foo2 : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(a: Date) => a : (a: Date) => Date ->a : Date ->Date : Date ->a : Date ->(b: Date) => b : (b: Date) => Date ->b : Date ->Date : Date ->b : Date -} diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt index 9396e3f2de9..a8ee6ac6ca9 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt @@ -1,45 +1,108 @@ -==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts (4 errors) ==== +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(25,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. +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'. +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(60,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(67,51): error TS2304: Cannot find name 'U'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(67,57): error TS2304: Cannot find name 'U'. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts (10 errors) ==== // When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, // the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. - function foo(a: (x: T) => T, b: (x: T) => T) { - var r: (x: T) => T; - return r; + module onlyT { + function foo(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); + ~~~ +!!! 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'. + + function other2(x: T) { + var r7 = foo((a: T) => a, (b: T) => b); // T => T + // BUG 835518 + var r9 = r7(new Date()); // should be ok + ~~~~~~~~~~ +!!! 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'. + } + + function foo2(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + function other3(x: T) { + var r7 = foo2((a: T) => a, (b: T) => b); // error + ~~~~~~~~~~~ +!!! error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. + var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date + } + + enum E { A } + enum F { A } + + function foo3(x: T, a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error + ~~~~~~~~~~ +!!! error TS2345: Argument of type '(x: E) => F' is not assignable to parameter of type '(x: E) => E'. } - var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); + module TU { + function foo(a: (x: T) => T, b: (x: U) => U) { + var r: (x: T) => T; + return r; + } - function other2(x: T) { - var r7 = foo((a: T) => a, (b: T) => b); // T => T - // BUG 835518 - var r9 = r7(new Date()); // should be ok - ~~~~~~~~~~ -!!! Argument of type 'Date' is not assignable to parameter of type 'T'. - var r10 = r7(1); // error - ~ -!!! Argument of type 'number' is not assignable to parameter of type 'T'. - } + var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); - function foo2(a: (x: T) => T, b: (x: T) => T) { - var r: (x: T) => T; - return r; - } + function other2(x: T) { + var r7 = foo((a: T) => a, (b: T) => b); + var r9 = r7(new Date()); + ~~~~~~~~~~ +!!! 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'. + } - function other3(x: T) { - var r7 = foo2((a: T) => a, (b: T) => b); // error - ~~~~~~~~~~~ -!!! Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. - var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date - } + function foo2(a: (x: T) => T, b: (x: U) => U) { + var r: (x: T) => T; + return r; + } - enum E { A } - enum F { A } + function other3(x: T) { + var r7 = foo2((a: T) => a, (b: T) => b); + ~~~~~~~~~~~ +!!! error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. + var r7b = foo2((a) => a, (b) => b); + } - function foo3(x: T, a: (x: T) => T, b: (x: T) => T) { - var r: (x: T) => T; - return r; - } + enum E { A } + enum F { A } - var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error - ~~~~~~~~~~ -!!! Argument of type '(x: E) => F' is not assignable to parameter of type '(x: E) => E'. \ No newline at end of file + function foo3(x: T, a: (x: T) => T, b: (x: U) => U) { + ~ +!!! error TS2304: Cannot find name 'U'. + ~ +!!! error TS2304: Cannot find name 'U'. + var r: (x: T) => T; + return r; + } + + var r7 = foo3(E.A, (x) => E.A, (x) => F.A); + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js index 7dc955b6172..7acdcc32536 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js @@ -2,72 +2,146 @@ // When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, // the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. -function foo(a: (x: T) => T, b: (x: T) => T) { - var r: (x: T) => T; - return r; +module onlyT { + function foo(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); + + function other2(x: T) { + var r7 = foo((a: T) => a, (b: T) => b); // T => T + // BUG 835518 + var r9 = r7(new Date()); // should be ok + var r10 = r7(1); // error + } + + function foo2(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + function other3(x: T) { + var r7 = foo2((a: T) => a, (b: T) => b); // error + var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date + } + + enum E { A } + enum F { A } + + function foo3(x: T, a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error } -var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); +module TU { + function foo(a: (x: T) => T, b: (x: U) => U) { + var r: (x: T) => T; + return r; + } -function other2(x: T) { - var r7 = foo((a: T) => a, (b: T) => b); // T => T - // BUG 835518 - var r9 = r7(new Date()); // should be ok - var r10 = r7(1); // error -} + var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); -function foo2(a: (x: T) => T, b: (x: T) => T) { - var r: (x: T) => T; - return r; -} + function other2(x: T) { + var r7 = foo((a: T) => a, (b: T) => b); + var r9 = r7(new Date()); + var r10 = r7(1); + } -function other3(x: T) { - var r7 = foo2((a: T) => a, (b: T) => b); // error - var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date -} + function foo2(a: (x: T) => T, b: (x: U) => U) { + var r: (x: T) => T; + return r; + } -enum E { A } -enum F { A } + function other3(x: T) { + var r7 = foo2((a: T) => a, (b: T) => b); + var r7b = foo2((a) => a, (b) => b); + } -function foo3(x: T, a: (x: T) => T, b: (x: T) => T) { - var r: (x: T) => T; - return r; -} + enum E { A } + enum F { A } -var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error + function foo3(x: T, a: (x: T) => T, b: (x: U) => U) { + var r: (x: T) => T; + return r; + } + + var r7 = foo3(E.A, (x) => E.A, (x) => F.A); +} //// [genericCallWithGenericSignatureArguments2.js] // When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, // the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. -function foo(a, b) { - var r; - return r; -} -var r1 = foo(function (x) { return 1; }, function (x) { return ''; }); -function other2(x) { - var r7 = foo(function (a) { return a; }, function (b) { return b; }); // T => T - // BUG 835518 - var r9 = r7(new Date()); // should be ok - var r10 = r7(1); // error -} -function foo2(a, b) { - var r; - return r; -} -function other3(x) { - var r7 = foo2(function (a) { return a; }, function (b) { return b; }); // error - var r7b = foo2(function (a) { return a; }, function (b) { return b; }); // valid, T is inferred to be Date -} -var E; -(function (E) { - E[E["A"] = 0] = "A"; -})(E || (E = {})); -var F; -(function (F) { - F[F["A"] = 0] = "A"; -})(F || (F = {})); -function foo3(x, a, b) { - var r; - return r; -} -var r7 = foo3(0 /* A */, function (x) { return 0 /* A */; }, function (x) { return 0 /* A */; }); // error +var onlyT; +(function (onlyT) { + function foo(a, b) { + var r; + return r; + } + var r1 = foo(function (x) { return 1; }, function (x) { return ''; }); + function other2(x) { + var r7 = foo(function (a) { return a; }, function (b) { return b; }); // T => T + // BUG 835518 + var r9 = r7(new Date()); // should be ok + var r10 = r7(1); // error + } + function foo2(a, b) { + var r; + return r; + } + function other3(x) { + var r7 = foo2(function (a) { return a; }, function (b) { return b; }); // error + var r7b = foo2(function (a) { return a; }, function (b) { return b; }); // valid, T is inferred to be Date + } + var E; + (function (E) { + E[E["A"] = 0] = "A"; + })(E || (E = {})); + var F; + (function (F) { + F[F["A"] = 0] = "A"; + })(F || (F = {})); + function foo3(x, a, b) { + var r; + return r; + } + var r7 = foo3(0 /* A */, function (x) { return 0 /* A */; }, function (x) { return 0 /* A */; }); // error +})(onlyT || (onlyT = {})); +var TU; +(function (TU) { + function foo(a, b) { + var r; + return r; + } + var r1 = foo(function (x) { return 1; }, function (x) { return ''; }); + function other2(x) { + var r7 = foo(function (a) { return a; }, function (b) { return b; }); + var r9 = r7(new Date()); + var r10 = r7(1); + } + function foo2(a, b) { + var r; + return r; + } + function other3(x) { + var r7 = foo2(function (a) { return a; }, function (b) { return b; }); + var r7b = foo2(function (a) { return a; }, function (b) { return b; }); + } + var E; + (function (E) { + E[E["A"] = 0] = "A"; + })(E || (E = {})); + var F; + (function (F) { + F[F["A"] = 0] = "A"; + })(F || (F = {})); + function foo3(x, a, b) { + var r; + return r; + } + var r7 = foo3(0 /* A */, function (x) { return 0 /* A */; }, function (x) { return 0 /* A */; }); +})(TU || (TU = {})); diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt new file mode 100644 index 00000000000..574cc5ca50d --- /dev/null +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(32,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 '(y: string) => string' is not a valid type argument because it is not a supertype of candidate '(a: string) => boolean'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(33,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts (2 errors) ==== + // When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, + // the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. + + function foo(x: T, a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + var r1 = foo('', (x: string) => '', (x: Object) => null); // any => any + var r1ii = foo('', (x) => '', (x) => null); // string => string + var r2 = foo('', (x: string) => '', (x: Object) => ''); // string => string + var r3 = foo(null, (x: Object) => '', (x: string) => ''); // Object => Object + var r4 = foo(null, (x) => '', (x) => ''); // any => any + var r5 = foo(new Object(), (x) => '', (x) => ''); // Object => Object + + enum E { A } + enum F { A } + + var r6 = foo(E.A, (x: number) => E.A, (x: F) => F.A); // number => number + + + function foo2(x: T, a: (x: T) => U, b: (x: T) => U) { + var r: (x: T) => U; + return r; + } + + var r8 = foo2('', (x) => '', (x) => null); // string => string + var r9 = foo2(null, (x) => '', (x) => ''); // any => any + var r10 = foo2(null, (x: Object) => '', (x: string) => ''); // Object => Object + + var x: (a: string) => boolean; + var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2); // 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 '(y: string) => string' is not a valid type argument because it is not a supertype of candidate '(a: string) => boolean'. + var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // 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 '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js index 8ffb4f9970b..ca28878daa3 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js @@ -30,8 +30,8 @@ var r9 = foo2(null, (x) => '', (x) => ''); // any => any var r10 = foo2(null, (x: Object) => '', (x: string) => ''); // Object => Object var x: (a: string) => boolean; -var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2); // {} => {} -var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // (string => boolean) => {} +var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2); // error +var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // error //// [genericCallWithGenericSignatureArguments3.js] // When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, @@ -63,5 +63,5 @@ var r8 = foo2('', function (x) { return ''; }, function (x) { return null; }); / var r9 = foo2(null, function (x) { return ''; }, function (x) { return ''; }); // any => any var r10 = foo2(null, function (x) { return ''; }, function (x) { return ''; }); // Object => Object var x; -var r11 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; }); // {} => {} -var r12 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; }); // (string => boolean) => {} +var r11 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; }); // error +var r12 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; }); // error diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types deleted file mode 100644 index 2c0d21a5a07..00000000000 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types +++ /dev/null @@ -1,202 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts === -// When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, -// the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. - -function foo(x: T, a: (x: T) => T, b: (x: T) => T) { ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->T : T ->x : T ->T : T ->a : (x: T) => T ->x : T ->T : T ->T : T ->b : (x: T) => T ->x : T ->T : T ->T : T - - var r: (x: T) => T; ->r : (x: T) => T ->x : T ->T : T ->T : T - - return r; ->r : (x: T) => T -} - -var r1 = foo('', (x: string) => '', (x: Object) => null); // any => any ->r1 : (x: any) => any ->foo('', (x: string) => '', (x: Object) => null) : (x: any) => any ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x: string) => '' : (x: string) => string ->x : string ->(x: Object) => null : (x: Object) => any ->x : Object ->Object : Object - -var r1ii = foo('', (x) => '', (x) => null); // string => string ->r1ii : (x: string) => string ->foo('', (x) => '', (x) => null) : (x: string) => string ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x) => '' : (x: string) => string ->x : string ->(x) => null : (x: string) => any ->x : string - -var r2 = foo('', (x: string) => '', (x: Object) => ''); // string => string ->r2 : (x: Object) => Object ->foo('', (x: string) => '', (x: Object) => '') : (x: Object) => Object ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x: string) => '' : (x: string) => string ->x : string ->(x: Object) => '' : (x: Object) => string ->x : Object ->Object : Object - -var r3 = foo(null, (x: Object) => '', (x: string) => ''); // Object => Object ->r3 : (x: Object) => Object ->foo(null, (x: Object) => '', (x: string) => '') : (x: Object) => Object ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x: Object) => '' : (x: Object) => string ->x : Object ->Object : Object ->(x: string) => '' : (x: string) => string ->x : string - -var r4 = foo(null, (x) => '', (x) => ''); // any => any ->r4 : (x: any) => any ->foo(null, (x) => '', (x) => '') : (x: any) => any ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->(x) => '' : (x: any) => string ->x : any ->(x) => '' : (x: any) => string ->x : any - -var r5 = foo(new Object(), (x) => '', (x) => ''); // Object => Object ->r5 : (x: Object) => Object ->foo(new Object(), (x) => '', (x) => '') : (x: Object) => Object ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->new Object() : Object ->Object : { (): any; (value: any): any; new (value?: any): Object; prototype: Object; getPrototypeOf(o: any): any; getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: any): any; freeze(o: any): any; preventExtensions(o: any): any; isSealed(o: any): boolean; isFrozen(o: any): boolean; isExtensible(o: any): boolean; keys(o: any): string[]; } ->(x) => '' : (x: Object) => string ->x : Object ->(x) => '' : (x: Object) => string ->x : Object - -enum E { A } ->E : E ->A : E - -enum F { A } ->F : F ->A : F - -var r6 = foo(E.A, (x: number) => E.A, (x: F) => F.A); // number => number ->r6 : (x: number) => number ->foo(E.A, (x: number) => E.A, (x: F) => F.A) : (x: number) => number ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T ->E.A : E ->E : typeof E ->A : E ->(x: number) => E.A : (x: number) => E ->x : number ->E.A : E ->E : typeof E ->A : E ->(x: F) => F.A : (x: F) => F ->x : F ->F : F ->F.A : F ->F : typeof F ->A : F - - -function foo2(x: T, a: (x: T) => U, b: (x: T) => U) { ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U ->T : T ->U : U ->x : T ->T : T ->a : (x: T) => U ->x : T ->T : T ->U : U ->b : (x: T) => U ->x : T ->T : T ->U : U - - var r: (x: T) => U; ->r : (x: T) => U ->x : T ->T : T ->U : U - - return r; ->r : (x: T) => U -} - -var r8 = foo2('', (x) => '', (x) => null); // string => string ->r8 : (x: string) => any ->foo2('', (x) => '', (x) => null) : (x: string) => any ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U ->(x) => '' : (x: string) => string ->x : string ->(x) => null : (x: string) => any ->x : string - -var r9 = foo2(null, (x) => '', (x) => ''); // any => any ->r9 : (x: any) => string ->foo2(null, (x) => '', (x) => '') : (x: any) => string ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U ->(x) => '' : (x: any) => string ->x : any ->(x) => '' : (x: any) => string ->x : any - -var r10 = foo2(null, (x: Object) => '', (x: string) => ''); // Object => Object ->r10 : (x: Object) => string ->foo2(null, (x: Object) => '', (x: string) => '') : (x: Object) => string ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U ->(x: Object) => '' : (x: Object) => string ->x : Object ->Object : Object ->(x: string) => '' : (x: string) => string ->x : string - -var x: (a: string) => boolean; ->x : (a: string) => boolean ->a : string - -var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2); // {} => {} ->r11 : (x: {}) => {} ->foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2) : (x: {}) => {} ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U ->x : (a: string) => boolean ->(a1: (y: string) => string) => (n: Object) => 1 : (a1: (y: string) => string) => (n: Object) => number ->a1 : (y: string) => string ->y : string ->(n: Object) => 1 : (n: Object) => number ->n : Object ->Object : Object ->(a2: (z: string) => string) => 2 : (a2: (z: string) => string) => number ->a2 : (z: string) => string ->z : string - -var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // (string => boolean) => {} ->r12 : (x: (a: string) => boolean) => {} ->foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2) : (x: (a: string) => boolean) => {} ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U ->x : (a: string) => boolean ->(a1: (y: string) => boolean) => (n: Object) => 1 : (a1: (y: string) => boolean) => (n: Object) => number ->a1 : (y: string) => boolean ->y : string ->(n: Object) => 1 : (n: Object) => number ->n : Object ->Object : Object ->(a2: (z: string) => boolean) => 2 : (a2: (z: string) => boolean) => number ->a2 : (z: string) => boolean ->z : string - diff --git a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt new file mode 100644 index 00000000000..2efcd043d78 --- /dev/null +++ b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts(12,9): 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; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts(13,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 '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts (2 errors) ==== + // generic type argument inference where inference leads to two candidates that are both supertypes of all candidates + // we choose the first candidate so the result is dependent on the order of the arguments provided + + function foo(x: T, y: T) { + var r: T; + return r; + } + + var a: { x: number; y?: number; }; + var b: { x: number; z?: number; }; + + var r = foo(a, b); // { x: number; y?: number; }; + ~~~ +!!! 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 '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. + var r2 = foo(b, a); // { x: number; z?: number; }; + ~~~ +!!! 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 '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. + + var x: { x: number; }; + var y: { x?: number; }; + + var r3 = foo(a, x); // { x: number; y?: number; }; + var r4 = foo(x, a); // { x: number; }; + + var r5 = foo(a, y); // { x?: number; }; + var r5 = foo(y, a); // { x?: number; }; + + var r6 = foo(x, y); // { x?: number; }; + var r6 = foo(y, x); // { x?: number; }; + + var s1: (x: Object) => string; + var s2: (x: string) => string; + + var r7 = foo(s1, s2); // (x: Object) => string; + var r8 = foo(s2, s1); // (x: string) => string; \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.types b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.types deleted file mode 100644 index e37a010baed..00000000000 --- a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.types +++ /dev/null @@ -1,117 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts === -// generic type argument inference where inference leads to two candidates that are both supertypes of all candidates -// we choose the first candidate so the result is dependent on the order of the arguments provided - -function foo(x: T, y: T) { ->foo : (x: T, y: T) => T ->T : T ->x : T ->T : T ->y : T ->T : T - - var r: T; ->r : T ->T : T - - return r; ->r : T -} - -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 - -var r = foo(a, b); // { x: number; y?: number; }; ->r : { x: number; y?: number; } ->foo(a, b) : { x: number; y?: number; } ->foo : (x: T, y: T) => T ->a : { x: number; y?: number; } ->b : { x: number; z?: number; } - -var r2 = foo(b, a); // { x: number; z?: number; }; ->r2 : { x: number; z?: number; } ->foo(b, a) : { x: number; z?: number; } ->foo : (x: T, y: T) => T ->b : { x: number; z?: number; } ->a : { x: number; y?: number; } - -var x: { x: number; }; ->x : { x: number; } ->x : number - -var y: { x?: number; }; ->y : { x?: number; } ->x : number - -var r3 = foo(a, x); // { x: number; y?: number; }; ->r3 : { x: number; y?: number; } ->foo(a, x) : { x: number; y?: number; } ->foo : (x: T, y: T) => T ->a : { x: number; y?: number; } ->x : { x: number; } - -var r4 = foo(x, a); // { x: number; }; ->r4 : { x: number; } ->foo(x, a) : { x: number; } ->foo : (x: T, y: T) => T ->x : { x: number; } ->a : { x: number; y?: number; } - -var r5 = foo(a, y); // { x?: number; }; ->r5 : { x?: number; } ->foo(a, y) : { x?: number; } ->foo : (x: T, y: T) => T ->a : { x: number; y?: number; } ->y : { x?: number; } - -var r5 = foo(y, a); // { x?: number; }; ->r5 : { x?: number; } ->foo(y, a) : { x?: number; } ->foo : (x: T, y: T) => T ->y : { x?: number; } ->a : { x: number; y?: number; } - -var r6 = foo(x, y); // { x?: number; }; ->r6 : { x?: number; } ->foo(x, y) : { x?: number; } ->foo : (x: T, y: T) => T ->x : { x: number; } ->y : { x?: number; } - -var r6 = foo(y, x); // { x?: number; }; ->r6 : { x?: number; } ->foo(y, x) : { x?: number; } ->foo : (x: T, y: T) => T ->y : { x?: number; } ->x : { x: number; } - -var s1: (x: Object) => string; ->s1 : (x: Object) => string ->x : Object ->Object : Object - -var s2: (x: string) => string; ->s2 : (x: string) => string ->x : string - -var r7 = foo(s1, s2); // (x: Object) => string; ->r7 : (x: Object) => string ->foo(s1, s2) : (x: Object) => string ->foo : (x: T, y: T) => T ->s1 : (x: Object) => string ->s2 : (x: string) => string - -var r8 = foo(s2, s1); // (x: string) => string; ->r8 : (x: string) => string ->foo(s2, s1) : (x: string) => string ->foo : (x: T, y: T) => T ->s2 : (x: string) => string ->s1 : (x: Object) => string - diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt b/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt new file mode 100644 index 00000000000..eb45586442d --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts(5,9): 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/genericCallWithObjectLiteralArgs.ts (1 errors) ==== + function foo(x: { bar: T; baz: T }) { + return x; + } + + var r = foo({ bar: 1, baz: '' }); // 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'. + var r2 = foo({ bar: 1, baz: 1 }); // T = number + var r3 = foo({ bar: foo, baz: foo }); // T = typeof foo + var r4 = foo({ bar: 1, baz: '' }); // T = Object \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.js b/tests/baselines/reference/genericCallWithObjectLiteralArgs.js index 84a630425be..2515bbef293 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArgs.js +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.js @@ -3,7 +3,7 @@ function foo(x: { bar: T; baz: T }) { return x; } -var r = foo({ bar: 1, baz: '' }); // T = {} +var r = foo({ bar: 1, baz: '' }); // error var r2 = foo({ bar: 1, baz: 1 }); // T = number var r3 = foo({ bar: foo, baz: foo }); // T = typeof foo var r4 = foo({ bar: 1, baz: '' }); // T = Object @@ -12,7 +12,7 @@ var r4 = foo({ bar: 1, baz: '' }); // T = Object function foo(x) { return x; } -var r = foo({ bar: 1, baz: '' }); // T = {} +var r = foo({ bar: 1, baz: '' }); // error var r2 = foo({ bar: 1, baz: 1 }); // T = number var r3 = foo({ bar: foo, baz: foo }); // T = typeof foo var r4 = foo({ bar: 1, baz: '' }); // T = Object diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.types b/tests/baselines/reference/genericCallWithObjectLiteralArgs.types deleted file mode 100644 index d23445ecbca..00000000000 --- a/tests/baselines/reference/genericCallWithObjectLiteralArgs.types +++ /dev/null @@ -1,49 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts === -function foo(x: { bar: T; baz: T }) { ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } ->T : T ->x : { bar: T; baz: T; } ->bar : T ->T : T ->baz : T ->T : T - - return x; ->x : { bar: T; baz: T; } -} - -var r = foo({ bar: 1, baz: '' }); // T = {} ->r : { bar: {}; baz: {}; } ->foo({ bar: 1, baz: '' }) : { bar: {}; baz: {}; } ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } ->{ bar: 1, baz: '' } : { bar: number; baz: string; } ->bar : number ->baz : string - -var r2 = foo({ bar: 1, baz: 1 }); // T = number ->r2 : { bar: number; baz: number; } ->foo({ bar: 1, baz: 1 }) : { bar: number; baz: number; } ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } ->{ bar: 1, baz: 1 } : { bar: number; baz: number; } ->bar : number ->baz : number - -var r3 = foo({ bar: foo, baz: foo }); // T = typeof foo ->r3 : { bar: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; baz: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; } ->foo({ bar: foo, baz: foo }) : { bar: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; baz: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; } ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } ->{ bar: foo, baz: foo } : { bar: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; baz: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; } ->bar : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } ->baz : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } - -var r4 = foo({ bar: 1, baz: '' }); // T = Object ->r4 : { bar: Object; baz: Object; } ->foo({ bar: 1, baz: '' }) : { bar: Object; baz: Object; } ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } ->Object : Object ->{ bar: 1, baz: '' } : { bar: number; baz: string; } ->bar : number ->baz : string - diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt index 9551a712b75..f389a0a6cae 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt @@ -1,24 +1,43 @@ -==== tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts (4 errors) ==== +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(3,9): 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/genericCallWithObjectLiteralArguments1.ts(4,22): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. + Types of property 'y' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(5,22): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'. + Types of property 'x' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(6,22): error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(7,22): error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. + Types of property 'y' are incompatible. + Type 'number' is not assignable to type 'string'. + + +==== tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts (5 errors) ==== function foo(n: { x: T; y: T }, m: T) { return m; } - var x = foo({ x: 3, y: "" }, 4); // no error, x is Object, the best common type // these are all errors + var x = foo({ x: 3, y: "" }, 4); + ~~~ +!!! 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'. var x2 = foo({ x: 3, y: "" }, 4); ~~~~~~~~~~~~~~~ -!!! Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. -!!! Types of property 'y' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. +!!! error TS2345: Types of property 'y' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. var x3 = foo({ x: 3, y: "" }, 4); ~~~~~~~~~~~~~~~ -!!! Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'. -!!! Types of property 'x' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'. +!!! error TS2345: Types of property 'x' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. var x4 = foo({ x: "", y: 4 }, ""); ~~~~~~~~~~~~~~~ -!!! Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'. -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'. +!!! error TS2345: Types of property 'x' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. var x5 = foo({ x: "", y: 4 }, ""); ~~~~~~~~~~~~~~~ -!!! Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. -!!! Types of property 'y' are incompatible: -!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. +!!! error TS2345: Types of property 'y' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js index 293a54e425f..c289ce3de14 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js @@ -1,7 +1,7 @@ //// [genericCallWithObjectLiteralArguments1.ts] function foo(n: { x: T; y: T }, m: T) { return m; } -var x = foo({ x: 3, y: "" }, 4); // no error, x is Object, the best common type // these are all errors +var x = foo({ x: 3, y: "" }, 4); var x2 = foo({ x: 3, y: "" }, 4); var x3 = foo({ x: 3, y: "" }, 4); var x4 = foo({ x: "", y: 4 }, ""); @@ -11,8 +11,8 @@ var x5 = foo({ x: "", y: 4 }, ""); function foo(n, m) { return m; } -var x = foo({ x: 3, y: "" }, 4); // no error, x is Object, the best common type // these are all errors +var x = foo({ x: 3, y: "" }, 4); var x2 = foo({ x: 3, y: "" }, 4); var x3 = foo({ x: 3, y: "" }, 4); var x4 = foo({ x: "", y: 4 }, ""); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt new file mode 100644 index 00000000000..97b09a7d43f --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt @@ -0,0 +1,29 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs.ts(20,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'C' is not a valid type argument because it is not a supertype of candidate 'D'. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs.ts (1 errors) ==== + class C { + private x: string; + } + + class D { + private x: string; + } + + class X { + x: T; + } + + function foo(t: X, t2: X) { + var x: T; + return x; + } + + var c1 = new X(); + var d1 = new X(); + var r = foo(c1, d1); // 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 'C' is not a valid type argument because it is not a supertype of candidate 'D'. + var r2 = foo(c1, c1); // ok \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs.types b/tests/baselines/reference/genericCallWithObjectTypeArgs.types deleted file mode 100644 index ddbd7d83054..00000000000 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs.types +++ /dev/null @@ -1,68 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs.ts === -class C { ->C : C - - private x: string; ->x : string -} - -class D { ->D : D - - private x: string; ->x : string -} - -class X { ->X : X ->T : T - - x: T; ->x : T ->T : T -} - -function foo(t: X, t2: X) { ->foo : (t: X, t2: X) => T ->T : T ->t : X ->X : X ->T : T ->t2 : X ->X : X ->T : T - - var x: T; ->x : T ->T : T - - return x; ->x : T -} - -var c1 = new X(); ->c1 : X ->new X() : X ->X : typeof X ->C : C - -var d1 = new X(); ->d1 : X ->new X() : X ->X : typeof X ->D : D - -var r = foo(c1, d1); // error ->r : {} ->foo(c1, d1) : {} ->foo : (t: X, t2: X) => T ->c1 : X ->d1 : X - -var r2 = foo(c1, c1); // ok ->r2 : C ->foo(c1, c1) : C ->foo : (t: X, t2: X) => T ->c1 : X ->c1 : X - diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.types b/tests/baselines/reference/genericCallWithObjectTypeArgs2.types index 0065811fdc1..3e178a7062d 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.types @@ -22,7 +22,7 @@ class Derived2 extends Base { // returns {}[] function f(a: { x: T; y: U }) { ->f : (a: { x: T; y: U; }) => {}[] +>f : (a: { x: T; y: U; }) => (T | U)[] >T : T >Base : Base >U : U @@ -34,7 +34,7 @@ function f(a: { x: T; y: U }) { >U : U return [a.x, a.y]; ->[a.x, a.y] : {}[] +>[a.x, a.y] : (T | U)[] >a.x : T >a : { x: T; y: U; } >x : T @@ -44,9 +44,9 @@ function f(a: { x: T; y: U }) { } var r = f({ x: new Derived(), y: new Derived2() }); // {}[] ->r : {}[] ->f({ x: new Derived(), y: new Derived2() }) : {}[] ->f : (a: { x: T; y: U; }) => {}[] +>r : (Derived | Derived2)[] +>f({ x: new Derived(), y: new Derived2() }) : (Derived | Derived2)[] +>f : (a: { x: T; y: U; }) => (T | U)[] >{ x: new Derived(), y: new Derived2() } : { x: Derived; y: Derived2; } >x : Derived >new Derived() : Derived @@ -56,9 +56,9 @@ var r = f({ x: new Derived(), y: new Derived2() }); // {}[] >Derived2 : typeof Derived2 var r2 = f({ x: new Base(), y: new Derived2() }); // {}[] ->r2 : {}[] ->f({ x: new Base(), y: new Derived2() }) : {}[] ->f : (a: { x: T; y: U; }) => {}[] +>r2 : Base[] +>f({ x: new Base(), y: new Derived2() }) : (Base | Derived2)[] +>f : (a: { x: T; y: U; }) => (T | U)[] >{ x: new Base(), y: new Derived2() } : { x: Base; y: Derived2; } >x : Base >new Base() : Base diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt index 6ac5e2234ef..02b38ddeb74 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt @@ -1,4 +1,9 @@ -==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts (1 errors) ==== +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(18,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 'Derived' is not a valid type argument because it is not a supertype of candidate 'Derived2'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(20,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts (2 errors) ==== // Generic call with constraints infering type parameter from object member properties class Base { @@ -16,11 +21,14 @@ return r; } - var r1 = f({ x: new Derived(), y: new Derived2() }); // ok, both extend Base + var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other + ~ +!!! 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 'Derived' is not a valid type argument because it is not a supertype of candidate 'Derived2'. function f2(a: U) { ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var r: T; return r; } @@ -33,7 +41,7 @@ return y(null); } - // all ok - T gets fixed too early, but then defaults to Base and everything works out + // all ok - second argument is processed before x is fixed var r4 = f3(x => x, new Base()); var r5 = f3(x => x, new Derived()); var r6 = f3(x => x, null); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index 3d37dace7ae..b9c722f80be 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -16,7 +16,7 @@ function f(a: { x: T; y: T }) { return r; } -var r1 = f({ x: new Derived(), y: new Derived2() }); // ok, both extend Base +var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other function f2(a: U) { var r: T; @@ -31,7 +31,7 @@ function f3(y: (a: T) => T, x: T) { return y(null); } -// all ok - T gets fixed too early, but then defaults to Base and everything works out +// all ok - second argument is processed before x is fixed var r4 = f3(x => x, new Base()); var r5 = f3(x => x, new Derived()); var r6 = f3(x => x, null); @@ -68,7 +68,7 @@ function f(a) { var r; return r; } -var r1 = f({ x: new Derived(), y: new Derived2() }); // ok, both extend Base +var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other function f2(a) { var r; return r; @@ -78,7 +78,7 @@ var r3 = f2({ x: new Derived(), y: new Derived2() }); // ok function f3(y, x) { return y(null); } -// all ok - T gets fixed too early, but then defaults to Base and everything works out +// all ok - second argument is processed before x is fixed var r4 = f3(function (x) { return x; }, new Base()); var r5 = f3(function (x) { return x; }, new Derived()); var r6 = f3(function (x) { return x; }, null); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt index 4d306264e7d..5f416bb8596 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts(12,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts(28,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts(30,24): error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'. + + ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts (3 errors) ==== // Generic call with constraints infering type parameter from object member properties @@ -12,7 +17,7 @@ function foo(t: T, t2: U) { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return (x: T) => t2; } @@ -30,11 +35,11 @@ function other() { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var r4 = foo(c, d); var r5 = foo(c, d); // error ~ -!!! Argument of type 'C' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt index 1b619f5ce7a..887abfaff63 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts(12,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts(21,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts(22,24): error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'. + + ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts (3 errors) ==== // Generic call with constraints infering type parameter from object member properties @@ -12,7 +17,7 @@ function foo(t: T, t2: U) { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return (x: T) => t2; } @@ -23,9 +28,9 @@ function other() { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var r5 = foo(c, d); // error ~ -!!! Argument of type 'C' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt index 3df159e7ce0..2a7bfd696cc 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(15,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(18,9): error TS2413: Numeric index type 'T' is not assignable to string index type 'Object'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(23,9): error TS2322: Type 'T' is not assignable to type 'U'. + + ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts (3 errors) ==== // Type inference infers from indexers in target type, error cases @@ -15,17 +20,17 @@ function other3(arg: T) { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var b: { [x: string]: Object; [x: number]: T; ~~~~~~~~~~~~~~~ -!!! Numeric index type 'T' is not assignable to string index type 'Object'. +!!! error TS2413: Numeric index type 'T' is not assignable to string index type 'Object'. }; var r2 = foo(b); var d = r2[1]; var e = r2['1']; var u: U = r2[1]; // ok ~ -!!! Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt index 880e0895c32..e9fae450377 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt @@ -1,3 +1,16 @@ +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(6,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +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(7,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(7,37): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,56): error TS2322: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,50): error TS2322: Type 'V' is not assignable to type 'U'. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts (11 errors) ==== // Generic typed parameters with initializers @@ -5,28 +18,28 @@ function foo2(x: T = undefined) { return x; } // ok function foo3(x: T = 1) { } // error ~~~~~~~~ -!!! Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type 'number' is not assignable to type 'T'. function foo4(x: T, y: U = x) { } // error ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. function foo5(x: U, y: T = x) { } // ok ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. function foo6(x: T, y: U, z: V = y) { } // error ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. function foo7(x: V, y: U = x) { } // should be ok ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! Type 'V' is not assignable to type 'U'. \ No newline at end of file +!!! error TS2322: Type 'V' is not assignable to type 'U'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt new file mode 100644 index 00000000000..2a0807bf6b9 --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt @@ -0,0 +1,56 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.ts(36,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 'boolean' is not a valid type argument because it is not a supertype of candidate 'number'. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.ts (1 errors) ==== + // Function typed arguments with multiple signatures must be passed an implementation that matches all of them + // Inferences are made quadratic-pairwise to and from these overload sets + + module NonGenericParameter { + var a: { + new(x: boolean): boolean; + new(x: string): string; + } + + function foo4(cb: typeof a) { + return new cb(null); + } + + var r = foo4(a); + var b: { new (x: T): T }; + var r2 = foo4(b); + } + + module GenericParameter { + function foo5(cb: { new(x: T): string; new(x: number): T }) { + return cb; + } + + var a: { + new (x: boolean): string; + new (x: number): boolean; + } + var r5 = foo5(a); // new{} => string; new(x:number) => {} + var b: { new(x: T): string; new(x: number): T; } + var r7 = foo5(b); // new any => string; new(x:number) => any + + function foo6(cb: { new(x: T): string; new(x: T, y?: T): string }) { + return cb; + } + + var r8 = foo6(a); // 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 'boolean' is not a valid type argument because it is not a supertype of candidate 'number'. + var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string + + function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { + return cb; + } + + var r13 = foo7(1, b); // new any => string; new(x:any, y?:any) => string + var c: { new (x: T): string; (x: number): T; } + var c2: { new (x: T): string; new(x: number): T; } + var r14 = foo7(1, c); // new any => string; new(x:any, y?:any) => string + var r15 = foo7(1, c2); // new any => string; new(x:any, y?:any) => string + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js index 9da34ebad86..4f74b043bd9 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js @@ -34,7 +34,7 @@ module GenericParameter { return cb; } - var r8 = foo6(a); // new{} => string; new(x:{}, y?:{}) => string + var r8 = foo6(a); // error var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { @@ -73,7 +73,7 @@ var GenericParameter; function foo6(cb) { return cb; } - var r8 = foo6(a); // new{} => string; new(x:{}, y?:{}) => string + var r8 = foo6(a); // error var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string function foo7(x, cb) { return cb; diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types deleted file mode 100644 index 6c16ad0259c..00000000000 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types +++ /dev/null @@ -1,173 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.ts === -// Function typed arguments with multiple signatures must be passed an implementation that matches all of them -// Inferences are made quadratic-pairwise to and from these overload sets - -module NonGenericParameter { ->NonGenericParameter : typeof NonGenericParameter - - var a: { ->a : { new (x: boolean): boolean; new (x: string): string; } - - new(x: boolean): boolean; ->x : boolean - - new(x: string): string; ->x : string - } - - function foo4(cb: typeof a) { ->foo4 : (cb: { new (x: boolean): boolean; new (x: string): string; }) => boolean ->cb : { new (x: boolean): boolean; new (x: string): string; } ->a : { new (x: boolean): boolean; new (x: string): string; } - - return new cb(null); ->new cb(null) : boolean ->cb : { new (x: boolean): boolean; new (x: string): string; } - } - - var r = foo4(a); ->r : boolean ->foo4(a) : boolean ->foo4 : (cb: { new (x: boolean): boolean; new (x: string): string; }) => boolean ->a : { new (x: boolean): boolean; new (x: string): string; } - - var b: { new (x: T): T }; ->b : new (x: T) => T ->T : T ->x : T ->T : T ->T : T - - var r2 = foo4(b); ->r2 : boolean ->foo4(b) : boolean ->foo4 : (cb: { new (x: boolean): boolean; new (x: string): string; }) => boolean ->b : new (x: T) => T -} - -module GenericParameter { ->GenericParameter : typeof GenericParameter - - function foo5(cb: { new(x: T): string; new(x: number): T }) { ->foo5 : (cb: { new (x: T): string; new (x: number): T; }) => { new (x: T): string; new (x: number): T; } ->T : T ->cb : { new (x: T): string; new (x: number): T; } ->x : T ->T : T ->x : number ->T : T - - return cb; ->cb : { new (x: T): string; new (x: number): T; } - } - - var a: { ->a : { new (x: boolean): string; new (x: number): boolean; } - - new (x: boolean): string; ->x : boolean - - new (x: number): boolean; ->x : number - } - var r5 = foo5(a); // new{} => string; new(x:number) => {} ->r5 : { new (x: boolean): string; new (x: number): boolean; } ->foo5(a) : { new (x: boolean): string; new (x: number): boolean; } ->foo5 : (cb: { new (x: T): string; new (x: number): T; }) => { new (x: T): string; new (x: number): T; } ->a : { new (x: boolean): string; new (x: number): boolean; } - - var b: { new(x: T): string; new(x: number): T; } ->b : { new (x: T): string; new (x: number): T; } ->T : T ->x : T ->T : T ->T : T ->x : number ->T : T - - var r7 = foo5(b); // new any => string; new(x:number) => any ->r7 : { new (x: any): string; new (x: number): any; } ->foo5(b) : { new (x: any): string; new (x: number): any; } ->foo5 : (cb: { new (x: T): string; new (x: number): T; }) => { new (x: T): string; new (x: number): T; } ->b : { new (x: T): string; new (x: number): T; } - - function foo6(cb: { new(x: T): string; new(x: T, y?: T): string }) { ->foo6 : (cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } ->T : T ->cb : { new (x: T): string; new (x: T, y?: T): string; } ->x : T ->T : T ->x : T ->T : T ->y : T ->T : T - - return cb; ->cb : { new (x: T): string; new (x: T, y?: T): string; } - } - - var r8 = foo6(a); // new{} => string; new(x:{}, y?:{}) => string ->r8 : { new (x: {}): string; new (x: {}, y?: {}): string; } ->foo6(a) : { new (x: {}): string; new (x: {}, y?: {}): string; } ->foo6 : (cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } ->a : { new (x: boolean): string; new (x: number): boolean; } - - var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string ->r9 : { new (x: any): string; new (x: any, y?: any): string; } ->foo6(b) : { new (x: any): string; new (x: any, y?: any): string; } ->foo6 : (cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } ->b : { new (x: T): string; new (x: number): T; } - - function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { ->foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } ->T : T ->x : T ->T : T ->cb : { new (x: T): string; new (x: T, y?: T): string; } ->x : T ->T : T ->x : T ->T : T ->y : T ->T : T - - return cb; ->cb : { new (x: T): string; new (x: T, y?: T): string; } - } - - var r13 = foo7(1, b); // new any => string; new(x:any, y?:any) => string ->r13 : { new (x: any): string; new (x: any, y?: any): string; } ->foo7(1, b) : { new (x: any): string; new (x: any, y?: any): string; } ->foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } ->b : { new (x: T): string; new (x: number): T; } - - var c: { new (x: T): string; (x: number): T; } ->c : { (x: number): T; new (x: T): string; } ->T : T ->x : T ->T : T ->T : T ->x : number ->T : T - - var c2: { new (x: T): string; new(x: number): T; } ->c2 : { new (x: T): string; new (x: number): T; } ->T : T ->x : T ->T : T ->T : T ->x : number ->T : T - - var r14 = foo7(1, c); // new any => string; new(x:any, y?:any) => string ->r14 : { new (x: any): string; new (x: any, y?: any): string; } ->foo7(1, c) : { new (x: any): string; new (x: any, y?: any): string; } ->foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } ->c : { (x: number): T; new (x: T): string; } - - var r15 = foo7(1, c2); // new any => string; new(x:any, y?:any) => string ->r15 : { new (x: any): string; new (x: any, y?: any): string; } ->foo7(1, c2) : { new (x: any): string; new (x: any, y?: any): string; } ->foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } ->c2 : { new (x: T): string; new (x: number): T; } -} diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt index 04756285abf..80bcf12494a 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: any): string; new (x: any, y?: any): string; }'. + + ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts (1 errors) ==== // Function typed arguments with multiple signatures must be passed an implementation that matches all of them // Inferences are made quadratic-pairwise to and from these overload sets @@ -31,7 +34,7 @@ var b: { new (x: T, y: T): string }; var r10 = foo6(b); // error ~ -!!! Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: any): string; new (x: any, y?: any): string; }'. +!!! error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: any): string; new (x: any, y?: any): string; }'. function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt index 7028f0cf38e..32fe6a09344 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: any): string; (x: any, y?: any): string; }'. + + ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts (1 errors) ==== // Function typed arguments with multiple signatures must be passed an implementation that matches all of them // Inferences are made quadratic-pairwise to and from these overload sets @@ -28,7 +31,7 @@ var r10 = foo6((x: T, y: T) => ''); // error ~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: any): string; (x: any, y?: any): string; }'. +!!! error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: any): string; (x: any, y?: any): string; }'. function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithTupleType.errors.txt b/tests/baselines/reference/genericCallWithTupleType.errors.txt new file mode 100644 index 00000000000..bcf580320e5 --- /dev/null +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -0,0 +1,65 @@ +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. + Types of property 'pop' are incompatible. + Type '() => string | number | boolean' is not assignable to type '() => string | number'. + Type 'string | number | boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'. + Type '{ a: string; }' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2322: Type '[number, string]' is not assignable to type '[string, number]'. + Types of property '0' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,1): error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]'. + Types of property '0' are incompatible. + Type '{}' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(24,1): error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. + Property '1' is missing in type '[{}]'. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts (5 errors) ==== + interface I { + tuple1: [T, U]; + } + + var i1: I; + var i2: I<{}, {}>; + + // no error + i1.tuple1 = ["foo", 5]; + var e1 = i1.tuple1[0]; // string + var e2 = i1.tuple1[1]; // number + i1.tuple1 = ["foo", 5, false, true]; + ~~~~~~~~~ +!!! error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number'. +!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + var e3 = i1.tuple1[2]; // {} + i1.tuple1[3] = { a: "string" }; + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'. +!!! error TS2322: Type '{ a: string; }' is not assignable to type 'number'. + var e4 = i1.tuple1[3]; // {} + i2.tuple1 = ["foo", 5]; + i2.tuple1 = ["foo", "bar"]; + i2.tuple1 = [5, "bar"]; + i2.tuple1 = [{}, {}]; + + // error + i1.tuple1 = [5, "foo"]; + ~~~~~~~~~ +!!! error TS2322: Type '[number, string]' is not assignable to type '[string, number]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. + i1.tuple1 = [{}, {}]; + ~~~~~~~~~ +!!! error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type '{}' is not assignable to type 'string'. + i2.tuple1 = [{}]; + ~~~~~~~~~ +!!! error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. +!!! error TS2322: Property '1' is missing in type '[{}]'. + \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithTupleType.js b/tests/baselines/reference/genericCallWithTupleType.js new file mode 100644 index 00000000000..296a6dad63b --- /dev/null +++ b/tests/baselines/reference/genericCallWithTupleType.js @@ -0,0 +1,46 @@ +//// [genericCallWithTupleType.ts] +interface I { + tuple1: [T, U]; +} + +var i1: I; +var i2: I<{}, {}>; + +// no error +i1.tuple1 = ["foo", 5]; +var e1 = i1.tuple1[0]; // string +var e2 = i1.tuple1[1]; // number +i1.tuple1 = ["foo", 5, false, true]; +var e3 = i1.tuple1[2]; // {} +i1.tuple1[3] = { a: "string" }; +var e4 = i1.tuple1[3]; // {} +i2.tuple1 = ["foo", 5]; +i2.tuple1 = ["foo", "bar"]; +i2.tuple1 = [5, "bar"]; +i2.tuple1 = [{}, {}]; + +// error +i1.tuple1 = [5, "foo"]; +i1.tuple1 = [{}, {}]; +i2.tuple1 = [{}]; + + +//// [genericCallWithTupleType.js] +var i1; +var i2; +// no error +i1.tuple1 = ["foo", 5]; +var e1 = i1.tuple1[0]; // string +var e2 = i1.tuple1[1]; // number +i1.tuple1 = ["foo", 5, false, true]; +var e3 = i1.tuple1[2]; // {} +i1.tuple1[3] = { a: "string" }; +var e4 = i1.tuple1[3]; // {} +i2.tuple1 = ["foo", 5]; +i2.tuple1 = ["foo", "bar"]; +i2.tuple1 = [5, "bar"]; +i2.tuple1 = [{}, {}]; +// error +i1.tuple1 = [5, "foo"]; +i1.tuple1 = [{}, {}]; +i2.tuple1 = [{}]; diff --git a/tests/baselines/reference/genericCallWithoutArgs.errors.txt b/tests/baselines/reference/genericCallWithoutArgs.errors.txt index 5756cc000d2..390fad31389 100644 --- a/tests/baselines/reference/genericCallWithoutArgs.errors.txt +++ b/tests/baselines/reference/genericCallWithoutArgs.errors.txt @@ -1,13 +1,19 @@ +tests/cases/compiler/genericCallWithoutArgs.ts(4,17): error TS1109: Expression expected. +tests/cases/compiler/genericCallWithoutArgs.ts(4,18): error TS1003: Identifier expected. +tests/cases/compiler/genericCallWithoutArgs.ts(4,3): error TS2304: Cannot find name 'number'. +tests/cases/compiler/genericCallWithoutArgs.ts(4,10): error TS2304: Cannot find name 'string'. + + ==== tests/cases/compiler/genericCallWithoutArgs.ts (4 errors) ==== function f(x: X, y: Y) { } f. ~ -!!! Expression expected. +!!! error TS1109: Expression expected. -!!! Identifier expected. +!!! error TS1003: Identifier expected. ~~~~~~ -!!! Cannot find name 'number'. +!!! error TS2304: Cannot find name 'number'. ~~~~~~ -!!! Cannot find name 'string'. \ No newline at end of file +!!! error TS2304: Cannot find name 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt index ca5fd616422..af5d92f4e3c 100644 --- a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt +++ b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt @@ -1,33 +1,43 @@ +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(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. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(12,17): error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(13,15): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,15): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts (8 errors) ==== function foo(x:T, y:U, f: (v: T) => U) { var r1 = f(1); ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r2 = f(1); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r4 = f(null); var r11 = f(x); var r21 = f(x); ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r31 = f(null); ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r41 = f(null); var r12 = f(y); ~ -!!! Argument of type 'U' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'. var r22 = f(y); ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r32 = f(null); ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r42 = f(null); } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallsWithoutParens.errors.txt b/tests/baselines/reference/genericCallsWithoutParens.errors.txt index bfce0d2bf22..aba66ed545f 100644 --- a/tests/baselines/reference/genericCallsWithoutParens.errors.txt +++ b/tests/baselines/reference/genericCallsWithoutParens.errors.txt @@ -1,18 +1,24 @@ +tests/cases/compiler/genericCallsWithoutParens.ts(2,18): error TS1109: Expression expected. +tests/cases/compiler/genericCallsWithoutParens.ts(7,22): error TS1109: Expression expected. +tests/cases/compiler/genericCallsWithoutParens.ts(2,11): error TS2304: Cannot find name 'number'. +tests/cases/compiler/genericCallsWithoutParens.ts(7,15): error TS2304: Cannot find name 'number'. + + ==== tests/cases/compiler/genericCallsWithoutParens.ts (4 errors) ==== function f() { } var r = f; // parse error ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~~ -!!! Cannot find name 'number'. +!!! error TS2304: Cannot find name 'number'. class C { foo: T; } var c = new C; // parse error ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~~ -!!! Cannot find name 'number'. +!!! error TS2304: Cannot find name 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericChainedCalls.errors.txt b/tests/baselines/reference/genericChainedCalls.errors.txt index 96ef5a3340f..6d8a3e6831c 100644 --- a/tests/baselines/reference/genericChainedCalls.errors.txt +++ b/tests/baselines/reference/genericChainedCalls.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/genericChainedCalls.ts(8,29): error TS2339: Property 'length' does not exist on type 'number'. +tests/cases/compiler/genericChainedCalls.ts(12,29): error TS2339: Property 'length' does not exist on type 'number'. + + ==== tests/cases/compiler/genericChainedCalls.ts (2 errors) ==== interface I1 { func(callback: (value: T) => U): I1; @@ -8,12 +12,12 @@ var r1 = v1.func(num => num.toString()) .func(str => str.length) // error, number doesn't have a length ~~~~~~ -!!! Property 'length' does not exist on type 'number'. +!!! error TS2339: Property 'length' does not exist on type 'number'. .func(num => num.toString()) var s1 = v1.func(num => num.toString()) var s2 = s1.func(str => str.length) // should also error ~~~~~~ -!!! Property 'length' does not exist on type 'number'. +!!! error TS2339: Property 'length' does not exist on type 'number'. var s3 = s2.func(num => num.toString()) \ No newline at end of file diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt new file mode 100644 index 00000000000..149a20e92a5 --- /dev/null +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt @@ -0,0 +1,87 @@ +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'. +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'. +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'. +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'. + + +==== tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts (4 errors) ==== + // Generic functions used as arguments for function typed parameters are not used to make inferences from + // Using function arguments, no errors expected + + module ImmediatelyFix { + class C { + foo(x: (a: T) => T) { + return x(null); + } + } + + var c = new C(); + var r = c.foo((x: U) => ''); // {} + var r2 = c.foo((x: U) => ''); // string + var r3 = c.foo(x => ''); // {} + + class C2 { + foo(x: (a: T) => T) { + return x(null); + } + } + + var c2 = new C2(); + var ra = c2.foo((x: U) => 1); // number + var r3a = c2.foo(x => 1); // number + } + + module WithCandidates { + class C { + foo2(x: T, cb: (a: T) => U) { + return cb(x); + } + } + + var c: C; + var r4 = c.foo2(1, function (a: Z) { return '' }); // string, contextual signature instantiation is applied to generic functions + var r5 = c.foo2(1, (a) => ''); // string + var r6 = c.foo2('', (a: Z) => 1); // number + + class C2 { + foo3(x: T, cb: (a: T) => U, y: U) { + return cb(x); + } + } + + var c2: C2; + var r7 = c2.foo3(1, (a: Z) => '', ''); // string + var r8 = c2.foo3(1, function (a) { return '' }, ''); // string + + class C3 { + foo3(x: T, cb: (a: T) => U, y: U) { + return cb(x); + } + } + var c3: C3; + + function other(t: T, u: U) { + 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'. + 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'. + 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'. + 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'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js index 1af5f0ea6e6..7ec25949534 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js @@ -55,12 +55,12 @@ module WithCandidates { var c3: C3; function other(t: T, u: U) { - var r10 = c.foo2(1, (x: T) => ''); // string, non-generic signature allows inferences to be made + var r10 = c.foo2(1, (x: T) => ''); // error var r10 = c.foo2(1, (x) => ''); // string - var r11 = c3.foo3(1, (x: T) => '', ''); // string - var r11b = c3.foo3(1, (x: T) => '', 1); // {} - var r12 = c3.foo3(1, function (a) { return '' }, 1); // {} + var r11 = c3.foo3(1, (x: T) => '', ''); // error + var r11b = c3.foo3(1, (x: T) => '', 1); // error + var r12 = c3.foo3(1, function (a) { return '' }, 1); // error } } @@ -132,12 +132,12 @@ var WithCandidates; })(); var c3; function other(t, u) { - var r10 = c.foo2(1, function (x) { return ''; }); // string, non-generic signature allows inferences to be made + var r10 = c.foo2(1, function (x) { return ''; }); // error var r10 = c.foo2(1, function (x) { return ''; }); // string - var r11 = c3.foo3(1, function (x) { return ''; }, ''); // string - var r11b = c3.foo3(1, function (x) { return ''; }, 1); // {} + var r11 = c3.foo3(1, function (x) { return ''; }, ''); // error + var r11b = c3.foo3(1, function (x) { return ''; }, 1); // error var r12 = c3.foo3(1, function (a) { return ''; - }, 1); // {} + }, 1); // error } })(WithCandidates || (WithCandidates = {})); diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types deleted file mode 100644 index 68b94d81d02..00000000000 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types +++ /dev/null @@ -1,297 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts === -// Generic functions used as arguments for function typed parameters are not used to make inferences from -// Using function arguments, no errors expected - -module ImmediatelyFix { ->ImmediatelyFix : typeof ImmediatelyFix - - class C { ->C : C ->T : T - - foo(x: (a: T) => T) { ->foo : (x: (a: T) => T) => T ->T : T ->x : (a: T) => T ->a : T ->T : T ->T : T - - return x(null); ->x(null) : T ->x : (a: T) => T - } - } - - var c = new C(); ->c : C ->new C() : C ->C : typeof C - - var r = c.foo((x: U) => ''); // {} ->r : {} ->c.foo((x: U) => '') : {} ->c.foo : (x: (a: T) => T) => T ->c : C ->foo : (x: (a: T) => T) => T ->(x: U) => '' : (x: U) => string ->U : U ->x : U ->U : U - - var r2 = c.foo((x: U) => ''); // string ->r2 : string ->c.foo((x: U) => '') : string ->c.foo : (x: (a: T) => T) => T ->c : C ->foo : (x: (a: T) => T) => T ->(x: U) => '' : (x: U) => string ->U : U ->x : U ->U : U - - var r3 = c.foo(x => ''); // {} ->r3 : {} ->c.foo(x => '') : {} ->c.foo : (x: (a: T) => T) => T ->c : C ->foo : (x: (a: T) => T) => T ->x => '' : (x: {}) => string ->x : {} - - class C2 { ->C2 : C2 ->T : T - - foo(x: (a: T) => T) { ->foo : (x: (a: T) => T) => T ->x : (a: T) => T ->a : T ->T : T ->T : T - - return x(null); ->x(null) : T ->x : (a: T) => T - } - } - - var c2 = new C2(); ->c2 : C2 ->new C2() : C2 ->C2 : typeof C2 - - var ra = c2.foo((x: U) => 1); // number ->ra : number ->c2.foo((x: U) => 1) : number ->c2.foo : (x: (a: number) => number) => number ->c2 : C2 ->foo : (x: (a: number) => number) => number ->(x: U) => 1 : (x: U) => number ->U : U ->x : U ->U : U - - var r3a = c2.foo(x => 1); // number ->r3a : number ->c2.foo(x => 1) : number ->c2.foo : (x: (a: number) => number) => number ->c2 : C2 ->foo : (x: (a: number) => number) => number ->x => 1 : (x: number) => number ->x : number -} - -module WithCandidates { ->WithCandidates : typeof WithCandidates - - class C { ->C : C ->T : T - - foo2(x: T, cb: (a: T) => U) { ->foo2 : (x: T, cb: (a: T) => U) => U ->T : T ->U : U ->x : T ->T : T ->cb : (a: T) => U ->a : T ->T : T ->U : U - - return cb(x); ->cb(x) : U ->cb : (a: T) => U ->x : T - } - } - - var c: C; ->c : C ->C : C - - var r4 = c.foo2(1, function (a: Z) { return '' }); // string, contextual signature instantiation is applied to generic functions ->r4 : string ->c.foo2(1, function (a: Z) { return '' }) : string ->c.foo2 : (x: T, cb: (a: T) => U) => U ->c : C ->foo2 : (x: T, cb: (a: T) => U) => U ->function (a: Z) { return '' } : (a: Z) => string ->Z : Z ->a : Z ->Z : Z - - var r5 = c.foo2(1, (a) => ''); // string ->r5 : string ->c.foo2(1, (a) => '') : string ->c.foo2 : (x: T, cb: (a: T) => U) => U ->c : C ->foo2 : (x: T, cb: (a: T) => U) => U ->(a) => '' : (a: number) => string ->a : number - - var r6 = c.foo2('', (a: Z) => 1); // number ->r6 : number ->c.foo2('', (a: Z) => 1) : number ->c.foo2 : (x: T, cb: (a: T) => U) => U ->c : C ->foo2 : (x: T, cb: (a: T) => U) => U ->(a: Z) => 1 : (a: Z) => number ->Z : Z ->a : Z ->Z : Z - - class C2 { ->C2 : C2 ->T : T ->U : U - - foo3(x: T, cb: (a: T) => U, y: U) { ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->x : T ->T : T ->cb : (a: T) => U ->a : T ->T : T ->U : U ->y : U ->U : U - - return cb(x); ->cb(x) : U ->cb : (a: T) => U ->x : T - } - } - - var c2: C2; ->c2 : C2 ->C2 : C2 - - var r7 = c2.foo3(1, (a: Z) => '', ''); // string ->r7 : string ->c2.foo3(1, (a: Z) => '', '') : string ->c2.foo3 : (x: number, cb: (a: number) => string, y: string) => string ->c2 : C2 ->foo3 : (x: number, cb: (a: number) => string, y: string) => string ->(a: Z) => '' : (a: Z) => string ->Z : Z ->a : Z ->Z : Z - - var r8 = c2.foo3(1, function (a) { return '' }, ''); // string ->r8 : string ->c2.foo3(1, function (a) { return '' }, '') : string ->c2.foo3 : (x: number, cb: (a: number) => string, y: string) => string ->c2 : C2 ->foo3 : (x: number, cb: (a: number) => string, y: string) => string ->function (a) { return '' } : (a: number) => string ->a : number - - class C3 { ->C3 : C3 ->T : T ->U : U - - foo3(x: T, cb: (a: T) => U, y: U) { ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->T : T ->U : U ->x : T ->T : T ->cb : (a: T) => U ->a : T ->T : T ->U : U ->y : U ->U : U - - return cb(x); ->cb(x) : U ->cb : (a: T) => U ->x : T - } - } - var c3: C3; ->c3 : C3 ->C3 : C3 - - function other(t: T, u: U) { ->other : (t: T, u: U) => void ->T : T ->U : U ->t : T ->T : T ->u : U ->U : U - - var r10 = c.foo2(1, (x: T) => ''); // string, non-generic signature allows inferences to be made ->r10 : string ->c.foo2(1, (x: T) => '') : string ->c.foo2 : (x: T, cb: (a: T) => U) => U ->c : C ->foo2 : (x: T, cb: (a: T) => U) => U ->(x: T) => '' : (x: T) => string ->x : T ->T : T - - var r10 = c.foo2(1, (x) => ''); // string ->r10 : string ->c.foo2(1, (x) => '') : string ->c.foo2 : (x: T, cb: (a: T) => U) => U ->c : C ->foo2 : (x: T, cb: (a: T) => U) => U ->(x) => '' : (x: number) => string ->x : number - - var r11 = c3.foo3(1, (x: T) => '', ''); // string ->r11 : string ->c3.foo3(1, (x: T) => '', '') : string ->c3.foo3 : (x: T, cb: (a: T) => U, y: U) => U ->c3 : C3 ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->(x: T) => '' : (x: T) => string ->x : T ->T : T - - var r11b = c3.foo3(1, (x: T) => '', 1); // {} ->r11b : {} ->c3.foo3(1, (x: T) => '', 1) : {} ->c3.foo3 : (x: T, cb: (a: T) => U, y: U) => U ->c3 : C3 ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->(x: T) => '' : (x: T) => string ->x : T ->T : T - - var r12 = c3.foo3(1, function (a) { return '' }, 1); // {} ->r12 : {} ->c3.foo3(1, function (a) { return '' }, 1) : {} ->c3.foo3 : (x: T, cb: (a: T) => U, y: U) => U ->c3 : C3 ->foo3 : (x: T, cb: (a: T) => U, y: U) => U ->function (a) { return '' } : (a: number) => string ->a : number - } -} diff --git a/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.errors.txt b/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.errors.txt index 588e70eb39e..076a5064bab 100644 --- a/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.errors.txt +++ b/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.errors.txt @@ -1,31 +1,40 @@ +tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(3,20): error TS2302: Static members cannot reference class type parameters. +tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(5,15): error TS2302: Static members cannot reference class type parameters. +tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(7,15): error TS2302: Static members cannot reference class type parameters. +tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(9,30): error TS2302: Static members cannot reference class type parameters. +tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(11,29): error TS2302: Static members cannot reference class type parameters. +tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(13,18): error TS2302: Static members cannot reference class type parameters. +tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(13,24): error TS2302: Static members cannot reference class type parameters. + + ==== tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts (7 errors) ==== // Should be error to use 'T' in all declarations within Foo. class Foo { static a = (n: T) => { }; ~ -!!! Static members cannot reference class type parameters. +!!! error TS2302: Static members cannot reference class type parameters. static b: T; ~ -!!! Static members cannot reference class type parameters. +!!! error TS2302: Static members cannot reference class type parameters. static c: T[] = []; ~ -!!! Static members cannot reference class type parameters. +!!! error TS2302: Static members cannot reference class type parameters. static d = false || ((x: T) => x || undefined)(null) ~ -!!! Static members cannot reference class type parameters. +!!! error TS2302: Static members cannot reference class type parameters. static e = function (x: T) { return null; } ~ -!!! Static members cannot reference class type parameters. +!!! error TS2302: Static members cannot reference class type parameters. static f(xs: T[]): T[] { ~ -!!! Static members cannot reference class type parameters. +!!! error TS2302: Static members cannot reference class type parameters. ~ -!!! Static members cannot reference class type parameters. +!!! error TS2302: Static members cannot reference class type parameters. return xs.reverse(); } } diff --git a/tests/baselines/reference/genericClassesRedeclaration.errors.txt b/tests/baselines/reference/genericClassesRedeclaration.errors.txt index 63263f3d6a2..abdea2b052b 100644 --- a/tests/baselines/reference/genericClassesRedeclaration.errors.txt +++ b/tests/baselines/reference/genericClassesRedeclaration.errors.txt @@ -1,4 +1,11 @@ -==== tests/cases/compiler/genericClassesRedeclaration.ts (3 errors) ==== +tests/cases/compiler/genericClassesRedeclaration.ts(16,11): error TS2300: Duplicate identifier 'StringHashTable'. +tests/cases/compiler/genericClassesRedeclaration.ts(29,11): error TS2300: Duplicate identifier 'IdentiferNameHashTable'. +tests/cases/compiler/genericClassesRedeclaration.ts(42,9): error TS2374: Duplicate string index signature. +tests/cases/compiler/genericClassesRedeclaration.ts(55,11): error TS2300: Duplicate identifier 'StringHashTable'. +tests/cases/compiler/genericClassesRedeclaration.ts(68,11): error TS2300: Duplicate identifier 'IdentiferNameHashTable'. + + +==== tests/cases/compiler/genericClassesRedeclaration.ts (5 errors) ==== declare module TypeScript { interface IIndexable { [s: string]: T; @@ -14,50 +21,9 @@ count(): number; lookup(key: string): T; } - class StringHashTable implements IHashTable { - private itemCount; - private table; - public getAllKeys(): string[]; - public add(key: string, data: T): boolean; - public addOrUpdate(key: string, data: T): boolean; - public map(fn: (k: string, value: T, context: any) => void, context: any): void; - public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; - public some(fn: (k: string, value: T, context: any) => void, context: any): boolean; - public count(): number; - public lookup(key: string): T; - public remove(key: string): void; - } - class IdentiferNameHashTable extends StringHashTable { - public getAllKeys(): string[]; - public add(key: string, data: T): boolean; - public addOrUpdate(key: string, data: T): boolean; - public map(fn: (k: string, value: T, context: any) => void, context: any): void; - public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; - public some(fn: (k: string, value: any, context: any) => void, context: any): boolean; - public lookup(key: string): T; - } - } - - declare module TypeScript { - interface IIndexable { - [s: string]: T; - ~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. - } - function createIntrinsicsObject(): IIndexable; - interface IHashTable { - getAllKeys(): string[]; - add(key: string, data: T): boolean; - addOrUpdate(key: string, data: T): boolean; - map(fn: (k: string, value: T, context: any) => void, context: any): void; - every(fn: (k: string, value: T, context: any) => void, context: any): boolean; - some(fn: (k: string, value: T, context: any) => void, context: any): boolean; - count(): number; - lookup(key: string): T; - } class StringHashTable implements IHashTable { ~~~~~~~~~~~~~~~ -!!! Duplicate identifier 'StringHashTable'. +!!! error TS2300: Duplicate identifier 'StringHashTable'. private itemCount; private table; public getAllKeys(): string[]; @@ -72,7 +38,52 @@ } class IdentiferNameHashTable extends StringHashTable { ~~~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate identifier 'IdentiferNameHashTable'. +!!! error TS2300: Duplicate identifier 'IdentiferNameHashTable'. + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: any, context: any) => void, context: any): boolean; + public lookup(key: string): T; + } + } + + declare module TypeScript { + interface IIndexable { + [s: string]: T; + ~~~~~~~~~~~~~~~ +!!! error TS2374: Duplicate string index signature. + } + function createIntrinsicsObject(): IIndexable; + interface IHashTable { + getAllKeys(): string[]; + add(key: string, data: T): boolean; + addOrUpdate(key: string, data: T): boolean; + map(fn: (k: string, value: T, context: any) => void, context: any): void; + every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + count(): number; + lookup(key: string): T; + } + class StringHashTable implements IHashTable { + ~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'StringHashTable'. + private itemCount; + private table; + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public count(): number; + public lookup(key: string): T; + public remove(key: string): void; + } + class IdentiferNameHashTable extends StringHashTable { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'IdentiferNameHashTable'. public getAllKeys(): string[]; public add(key: string, data: T): boolean; public addOrUpdate(key: string, data: T): boolean; diff --git a/tests/baselines/reference/genericCloduleInModule2.errors.txt b/tests/baselines/reference/genericCloduleInModule2.errors.txt index 38202cd40e7..6b8ec9012f0 100644 --- a/tests/baselines/reference/genericCloduleInModule2.errors.txt +++ b/tests/baselines/reference/genericCloduleInModule2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/genericCloduleInModule2.ts(14,8): error TS2314: Generic type 'B' requires 1 type argument(s). + + ==== tests/cases/compiler/genericCloduleInModule2.ts (1 errors) ==== module A { export class B { @@ -14,5 +17,5 @@ var b: A.B; ~~~ -!!! Generic type 'B' requires 1 type argument(s). +!!! error TS2314: Generic type 'B' requires 1 type argument(s). b.foo(); \ No newline at end of file diff --git a/tests/baselines/reference/genericCloneReturnTypes.errors.txt b/tests/baselines/reference/genericCloneReturnTypes.errors.txt index f2ba42e0168..0e54ebc02cf 100644 --- a/tests/baselines/reference/genericCloneReturnTypes.errors.txt +++ b/tests/baselines/reference/genericCloneReturnTypes.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/genericCloneReturnTypes.ts(25,1): error TS2322: Type 'Bar' is not assignable to type 'Bar'. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/genericCloneReturnTypes.ts (1 errors) ==== class Bar { @@ -25,5 +29,5 @@ b = b2; b = b3; ~ -!!! Type 'Bar' is not assignable to type 'Bar': -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'Bar' is not assignable to type 'Bar'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCloneReturnTypes2.errors.txt b/tests/baselines/reference/genericCloneReturnTypes2.errors.txt index 06966c7eb23..1ac5a862075 100644 --- a/tests/baselines/reference/genericCloneReturnTypes2.errors.txt +++ b/tests/baselines/reference/genericCloneReturnTypes2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/genericCloneReturnTypes2.ts(15,5): error TS2322: Type 'MyList' is not assignable to type 'MyList'. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/genericCloneReturnTypes2.ts (1 errors) ==== class MyList { public size: number; @@ -15,5 +19,5 @@ var c: MyList = a.clone(); // bug was there was an error on this line var d: MyList = a.clone(); // error ~ -!!! Type 'MyList' is not assignable to type 'MyList': -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'MyList' is not assignable to type 'MyList'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCombinators2.errors.txt b/tests/baselines/reference/genericCombinators2.errors.txt index aad1732547a..c09ef79b29b 100644 --- a/tests/baselines/reference/genericCombinators2.errors.txt +++ b/tests/baselines/reference/genericCombinators2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/genericCombinators2.ts(15,43): error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. +tests/cases/compiler/genericCombinators2.ts(16,43): error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. + + ==== tests/cases/compiler/genericCombinators2.ts (2 errors) ==== interface Collection { length: number; @@ -15,7 +19,7 @@ var rf1 = (x: number, y: string) => { return x.toFixed() }; var r5a = _.map(c2, (x, y) => { return x.toFixed() }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. +!!! error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. var r5b = _.map(c2, rf1); ~~~ -!!! Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. \ No newline at end of file +!!! error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint1.errors.txt b/tests/baselines/reference/genericConstraint1.errors.txt index fb61d930f8a..1f3f611a866 100644 --- a/tests/baselines/reference/genericConstraint1.errors.txt +++ b/tests/baselines/reference/genericConstraint1.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/genericConstraint1.ts(8,8): error TS2344: Type 'string' does not satisfy the constraint 'number'. + + ==== tests/cases/compiler/genericConstraint1.ts (1 errors) ==== class C { public bar2(x: T, y: U): T { @@ -8,4 +11,4 @@ var x = new C(); x.bar2(2, ""); ~~~~~~ -!!! Type 'string' does not satisfy the constraint 'number'. \ No newline at end of file +!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint2.errors.txt b/tests/baselines/reference/genericConstraint2.errors.txt index cce6068827d..3ab29b585d8 100644 --- a/tests/baselines/reference/genericConstraint2.errors.txt +++ b/tests/baselines/reference/genericConstraint2.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/genericConstraint2.ts(5,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/genericConstraint2.ts(11,7): error TS2420: Class 'ComparableString' incorrectly implements interface 'Comparable'. + Property 'comparer' is missing in type 'ComparableString'. +tests/cases/compiler/genericConstraint2.ts(21,17): error TS2344: Type 'ComparableString' does not satisfy the constraint 'Comparable'. + + ==== tests/cases/compiler/genericConstraint2.ts (3 errors) ==== interface Comparable { comparer(other: T): number; @@ -5,7 +11,7 @@ function compare>(x: T, y: T): number { ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. if (x == null) return y == null ? 0 : -1; if (y == null) return 1; return x.comparer(y); @@ -13,8 +19,8 @@ class ComparableString implements Comparable{ ~~~~~~~~~~~~~~~~ -!!! Class 'ComparableString' incorrectly implements interface 'Comparable': -!!! Property 'comparer' is missing in type 'ComparableString'. +!!! error TS2420: Class 'ComparableString' incorrectly implements interface 'Comparable'. +!!! error TS2420: Property 'comparer' is missing in type 'ComparableString'. constructor(public currentValue: string) { } localeCompare(other) { @@ -26,5 +32,4 @@ var b = new ComparableString("b"); var c = compare(a, b); ~~~~~~~~~~~~~~~~ -!!! Type 'ComparableString' does not satisfy the constraint 'Comparable': -!!! Property 'comparer' is missing in type 'ComparableString'. \ No newline at end of file +!!! error TS2344: Type 'ComparableString' does not satisfy the constraint 'Comparable'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint3.errors.txt b/tests/baselines/reference/genericConstraint3.errors.txt index d7d76b7de6f..525b11504fb 100644 --- a/tests/baselines/reference/genericConstraint3.errors.txt +++ b/tests/baselines/reference/genericConstraint3.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/genericConstraint3.ts(2,16): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/genericConstraint3.ts (1 errors) ==== interface C

{ x: P; } interface A> { x: U; } ~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. interface B extends A<{}, { x: {} }> { } // Should not produce an error \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt b/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt index 8b3673de74b..ade053d9344 100644 --- a/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt +++ b/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/genericConstraintSatisfaction1.ts(6,5): error TS2345: Argument of type '{ s: number; }' is not assignable to parameter of type '{ s: string; }'. + Types of property 's' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/genericConstraintSatisfaction1.ts (1 errors) ==== interface I { f: (x: T) => void @@ -6,7 +11,7 @@ var x: I<{s: string}> x.f({s: 1}) ~~~~~~ -!!! Argument of type '{ s: number; }' is not assignable to parameter of type '{ s: string; }'. -!!! Types of property 's' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2345: Argument of type '{ s: number; }' is not assignable to parameter of type '{ s: string; }'. +!!! error TS2345: Types of property 's' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstructExpressionWithoutArgs.errors.txt b/tests/baselines/reference/genericConstructExpressionWithoutArgs.errors.txt index e1ff11eee92..e89bf106ff4 100644 --- a/tests/baselines/reference/genericConstructExpressionWithoutArgs.errors.txt +++ b/tests/baselines/reference/genericConstructExpressionWithoutArgs.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/genericConstructExpressionWithoutArgs.ts(10,1): error TS1109: Expression expected. +tests/cases/compiler/genericConstructExpressionWithoutArgs.ts(9,16): error TS2304: Cannot find name 'number'. + + ==== tests/cases/compiler/genericConstructExpressionWithoutArgs.ts (2 errors) ==== class B { } var b = new B; // no error @@ -9,7 +13,7 @@ var c = new C // C var c2 = new C // error, type params are actually part of the arg list so you need both ~~~~~~ -!!! Cannot find name 'number'. +!!! error TS2304: Cannot find name 'number'. -!!! Expression expected. \ No newline at end of file +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt b/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt index cee2b8583ed..f155140f4dc 100644 --- a/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt +++ b/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/genericConstructInvocationWithNoTypeArg.ts(4,27): error TS2304: Cannot find name 'Foo'. + + ==== tests/cases/compiler/genericConstructInvocationWithNoTypeArg.ts (1 errors) ==== interface Foo { new (x: number): Foo; } var f2: Foo = new Foo(3); ~~~ -!!! Cannot find name 'Foo'. +!!! error TS2304: Cannot find name 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstructorFunction1.errors.txt b/tests/baselines/reference/genericConstructorFunction1.errors.txt index 14ac7d99b31..6f821e863f9 100644 --- a/tests/baselines/reference/genericConstructorFunction1.errors.txt +++ b/tests/baselines/reference/genericConstructorFunction1.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/genericConstructorFunction1.ts(4,5): error TS2348: Value of type 'new (arg: T) => Date' is not callable. Did you mean to include 'new'? +tests/cases/compiler/genericConstructorFunction1.ts(13,13): error TS2348: Value of type 'I1' is not callable. Did you mean to include 'new'? + + ==== tests/cases/compiler/genericConstructorFunction1.ts (2 errors) ==== function f1(args: T) { var v1: { [index: string]: new (arg: T) => Date }; var v2 = v1['test']; v2(args); ~~~~~~~~ -!!! Value of type 'new (arg: T) => Date' is not callable. Did you mean to include 'new'? +!!! error TS2348: Value of type 'new (arg: T) => Date' is not callable. Did you mean to include 'new'? return new v2(args); // used to give error } @@ -15,6 +19,6 @@ var v2 = v1['test']; var y = v2(args); ~~~~~~~~ -!!! Value of type 'I1' is not callable. Did you mean to include 'new'? +!!! error TS2348: Value of type 'I1' is not callable. Did you mean to include 'new'? return new v2(args); // used to give error } \ No newline at end of file diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt index 97da05bd69b..4ae63b6fc8e 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts (1 errors) ==== class A { x: T; @@ -11,7 +16,7 @@ var y: B; x = y; // error ~ -!!! Type 'B' is not assignable to type 'A': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt index 74cb9d29c11..38818b59863 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type '{ length: number; foo: number; }'. + Property 'foo' is missing in type 'String'. + + ==== tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts (1 errors) ==== class A { x: T; @@ -11,8 +17,8 @@ var y: B; x = y; // error ~ -!!! Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type '{ length: number; foo: number; }': -!!! Property 'foo' is missing in type 'String'. +!!! error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type '{ length: number; foo: number; }'. +!!! error TS2322: Property 'foo' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt index 19c27783c17..a1051e0b020 100644 --- a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt +++ b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts(10,1): error TS2304: Cannot find name 'console'. + + ==== tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts (1 errors) ==== interface Array {} @@ -10,5 +13,5 @@ console.log(s); ~~~~~~~ -!!! Cannot find name 'console'. +!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.errors.txt b/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.errors.txt index 0948a26e76b..6884dd7eeb4 100644 --- a/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.errors.txt +++ b/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/genericFunctionTypedArgumentsAreFixed.ts(2,14): error TS2339: Property 'length' does not exist on type 'number'. + + ==== tests/cases/compiler/genericFunctionTypedArgumentsAreFixed.ts (1 errors) ==== declare function map(f: (x: T) => U, xs: T[]): U[]; map((a) => a.length, [1]); ~~~~~~ -!!! Property 'length' does not exist on type 'number'. \ No newline at end of file +!!! error TS2339: Property 'length' does not exist on type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt index 8cc016566d9..5b9ed348583 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts (1 errors) ==== interface Utils { fold(c: Array, folder?: (s: S, t: T) => T, init?: S): T; @@ -7,7 +10,7 @@ utils.fold(); // error ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. utils.fold(null); // no error utils.fold(null, null); // no error utils.fold(null, null, null); // error: Unable to invoke type with no call signatures diff --git a/tests/baselines/reference/genericFunduleInModule.errors.txt b/tests/baselines/reference/genericFunduleInModule.errors.txt index 1bc72726712..ca82f7d2425 100644 --- a/tests/baselines/reference/genericFunduleInModule.errors.txt +++ b/tests/baselines/reference/genericFunduleInModule.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/genericFunduleInModule.ts(8,8): error TS2305: Module 'A' has no exported member 'B'. + + ==== tests/cases/compiler/genericFunduleInModule.ts (1 errors) ==== module A { export function B(x: T) { return x; } @@ -8,5 +11,5 @@ var b: A.B; ~~~ -!!! Module 'A' has no exported member 'B'. +!!! error TS2305: Module '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 306dd66d519..b92b314ece7 100644 --- a/tests/baselines/reference/genericFunduleInModule2.errors.txt +++ b/tests/baselines/reference/genericFunduleInModule2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/genericFunduleInModule2.ts(11,8): error TS2305: Module 'A' has no exported member 'B'. + + ==== tests/cases/compiler/genericFunduleInModule2.ts (1 errors) ==== module A { export function B(x: T) { return x; } @@ -11,5 +14,5 @@ var b: A.B; ~~~ -!!! Module 'A' has no exported member 'B'. +!!! error TS2305: Module 'A' has no exported member 'B'. A.B(1); \ No newline at end of file diff --git a/tests/baselines/reference/genericGetter.errors.txt b/tests/baselines/reference/genericGetter.errors.txt index 84b2a320580..3a8edb602e0 100644 --- a/tests/baselines/reference/genericGetter.errors.txt +++ b/tests/baselines/reference/genericGetter.errors.txt @@ -1,9 +1,13 @@ +tests/cases/compiler/genericGetter.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/genericGetter.ts(9,5): error TS2322: Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/genericGetter.ts (2 errors) ==== class C { data: T; get x(): T { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return this.data; } } @@ -11,4 +15,4 @@ var c = new C(); var r: string = c.x; ~ -!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericGetter2.errors.txt b/tests/baselines/reference/genericGetter2.errors.txt index 5c30fe0da97..586ae56f606 100644 --- a/tests/baselines/reference/genericGetter2.errors.txt +++ b/tests/baselines/reference/genericGetter2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/genericGetter2.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/genericGetter2.ts(5,14): error TS2314: Generic type 'A' requires 1 type argument(s). + + ==== tests/cases/compiler/genericGetter2.ts (2 errors) ==== class A { } @@ -5,9 +9,9 @@ data: A; get x(): A { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Generic type 'A' requires 1 type argument(s). +!!! error TS2314: Generic type 'A' requires 1 type argument(s). return this.data; } } \ No newline at end of file diff --git a/tests/baselines/reference/genericGetter3.errors.txt b/tests/baselines/reference/genericGetter3.errors.txt index ff1e7d5a1f9..24b44af28ee 100644 --- a/tests/baselines/reference/genericGetter3.errors.txt +++ b/tests/baselines/reference/genericGetter3.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/genericGetter3.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/genericGetter3.ts(11,5): error TS2322: Type 'A' is not assignable to type 'string'. + + ==== tests/cases/compiler/genericGetter3.ts (2 errors) ==== class A { } @@ -5,7 +9,7 @@ data: A; get x(): A { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return this.data; } } @@ -13,4 +17,4 @@ var c = new C(); var r: string = c.x; ~ -!!! Type 'A' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'A' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt b/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt index 59b4d33a38e..b81230b440d 100644 --- a/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt +++ b/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(3,8): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(4,10): error TS2314: Generic type 'I' requires 1 type argument(s). + + ==== tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts (2 errors) ==== interface I { } class C { } var i: I; ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). var c: C; ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt b/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt index 27623b6ebab..4348c1cf9c4 100644 --- a/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt +++ b/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts(7,11): error TS2314: Generic type 'Foo' requires 1 type argument(s). + + ==== tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts (1 errors) ==== interface Foo { x: T; @@ -7,5 +10,5 @@ } foo((arg: Foo) => { return arg.x; }); ~~~ -!!! Generic type 'Foo' requires 1 type argument(s). +!!! error TS2314: Generic type 'Foo' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericMemberFunction.errors.txt b/tests/baselines/reference/genericMemberFunction.errors.txt index 4e9e6a0b0d2..2199966ea56 100644 --- a/tests/baselines/reference/genericMemberFunction.errors.txt +++ b/tests/baselines/reference/genericMemberFunction.errors.txt @@ -1,38 +1,48 @@ +tests/cases/compiler/genericMemberFunction.ts(2,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/genericMemberFunction.ts(7,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/genericMemberFunction.ts(10,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/genericMemberFunction.ts(15,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/genericMemberFunction.ts(16,5): error TS2304: Cannot find name 'a'. +tests/cases/compiler/genericMemberFunction.ts(17,5): error TS2304: Cannot find name 'removedFiles'. +tests/cases/compiler/genericMemberFunction.ts(17,30): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/genericMemberFunction.ts(18,12): error TS2339: Property 'removeFile' does not exist on type 'BuildResult'. + + ==== tests/cases/compiler/genericMemberFunction.ts (8 errors) ==== export class BuildError{ public parent(): FileWithErrors { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return undefined; } } export class FileWithErrors{ public errors(): BuildError[] { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return undefined; } public parent(): BuildResult { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return undefined; } } export class BuildResult{ public merge(other: BuildResult): void { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. a.b.c.d.e.f.g = 0; ~ -!!! Cannot find name 'a'. +!!! error TS2304: Cannot find name 'a'. removedFiles.forEach((each: FileWithErrors) => { ~~~~~~~~~~~~ -!!! Cannot find name 'removedFiles'. +!!! error TS2304: Cannot find name 'removedFiles'. ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. this.removeFile(each); ~~~~~~~~~~ -!!! Property 'removeFile' does not exist on type 'BuildResult'. +!!! error TS2339: Property 'removeFile' does not exist on type 'BuildResult'. }); } } diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt index 5368c5b832a..43a73e76a3e 100644 --- a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt @@ -1,13 +1,18 @@ +tests/cases/compiler/genericMergedDeclarationUsingTypeParameter.ts(1,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/genericMergedDeclarationUsingTypeParameter.ts(3,19): error TS2304: Cannot find name 'T'. +tests/cases/compiler/genericMergedDeclarationUsingTypeParameter.ts(4,14): error TS2304: Cannot find name 'T'. + + ==== tests/cases/compiler/genericMergedDeclarationUsingTypeParameter.ts (3 errors) ==== function foo(y: T, z: U) { return y; } ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. module foo { export var x: T; ~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. var y = 1; ~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt index d6d1f1ae44d..7ab8ac4c0f1 100644 --- a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt @@ -1,11 +1,15 @@ +tests/cases/compiler/genericMergedDeclarationUsingTypeParameter2.ts(3,19): error TS2304: Cannot find name 'T'. +tests/cases/compiler/genericMergedDeclarationUsingTypeParameter2.ts(4,14): error TS2304: Cannot find name 'T'. + + ==== tests/cases/compiler/genericMergedDeclarationUsingTypeParameter2.ts (2 errors) ==== class foo { constructor(x: T) { } } module foo { export var x: T; ~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. var y = 1; ~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericNewInterface.errors.txt b/tests/baselines/reference/genericNewInterface.errors.txt index a8574f19eb5..f489b72c1b6 100644 --- a/tests/baselines/reference/genericNewInterface.errors.txt +++ b/tests/baselines/reference/genericNewInterface.errors.txt @@ -1,8 +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 errors) ==== function createInstance(ctor: new (s: string) => T): T { return new ctor(42); //should be an error ~~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. } interface INewable { @@ -12,5 +16,5 @@ function createInstance2(ctor: INewable): T { return new ctor(1024); //should be an error ~~~~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.errors.txt b/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.errors.txt index 2d6230b4563..3224d577fd2 100644 --- a/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.errors.txt +++ b/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/genericObjectCreationWithoutTypeArgs.ts(6,26): error TS1109: Expression expected. +tests/cases/compiler/genericObjectCreationWithoutTypeArgs.ts(6,19): error TS2304: Cannot find name 'number'. + + ==== tests/cases/compiler/genericObjectCreationWithoutTypeArgs.ts (2 errors) ==== class SS{ @@ -6,9 +10,9 @@ var x1 = new SS(); // OK var x2 = new SS < number>; // Correctly give error ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~~ -!!! Cannot find name 'number'. +!!! error TS2304: Cannot find name 'number'. var x3 = new SS(); // OK var x4 = new SS; // Should be allowed, but currently give error ('supplied parameters do not match any signature of the call target') \ No newline at end of file diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt index bce0417d81b..a76eb9d233d 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts(9,49): error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). + + ==== tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts (1 errors) ==== export declare module TypeScript { class PullSymbol { } @@ -9,7 +12,7 @@ } class PullTypeParameterSymbol extends PullTypeSymbol { ~~~~~~~~~~~~~~ -!!! Generic type 'PullTypeSymbol' requires 3 type argument(s). +!!! error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). } } diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt index ee9aadfdf93..760d1561113 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt @@ -1,11 +1,21 @@ +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(3,66): error TS2314: Generic type 'MemberName' requires 3 type argument(s). +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(3,66): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(10,22): error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(12,48): error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(13,31): error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(14,46): error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(18,53): error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(19,22): error TS2339: Property 'isArray' does not exist on type 'PullTypeSymbol'. + + ==== tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts (8 errors) ==== module TypeScript { export class MemberName { static create(arg1: any, arg2?: any, arg3?: any): MemberName { ~~~~~~~~~~ -!!! Generic type 'MemberName' requires 3 type argument(s). +!!! error TS2314: Generic type 'MemberName' requires 3 type argument(s). ~~~~~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. } } } @@ -14,26 +24,26 @@ export class PullSymbol { public type: PullTypeSymbol = null; ~~~~~~~~~~~~~~ -!!! Generic type 'PullTypeSymbol' requires 3 type argument(s). +!!! error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). } export class PullTypeSymbol extends PullSymbol { ~~~~~~~~~~ -!!! Generic type 'PullSymbol' requires 3 type argument(s). +!!! error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). private _elementType: PullTypeSymbol = null; ~~~~~~~~~~~~~~ -!!! Generic type 'PullTypeSymbol' requires 3 type argument(s). +!!! error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). public toString(scopeSymbol?: PullSymbol, useConstraintInName?: boolean) { ~~~~~~~~~~ -!!! Generic type 'PullSymbol' requires 3 type argument(s). +!!! error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). var s = this.getScopedNameEx(scopeSymbol, useConstraintInName).toString(); return s; } public getScopedNameEx(scopeSymbol?: PullSymbol, useConstraintInName?: boolean, getPrettyTypeName?: boolean, getTypeParamMarkerInfo?: boolean) { ~~~~~~~~~~ -!!! Generic type 'PullSymbol' requires 3 type argument(s). +!!! error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). if (this.isArray()) { ~~~~~~~ -!!! Property 'isArray' does not exist on type 'PullTypeSymbol'. +!!! error TS2339: Property 'isArray' does not exist on type 'PullTypeSymbol'. var elementMemberName = this._elementType ? (this._elementType.isArray() || this._elementType.isNamedTypeSymbol() ? this._elementType.getScopedNameEx(scopeSymbol, false, getPrettyTypeName, getTypeParamMarkerInfo) : diff --git a/tests/baselines/reference/genericReduce.errors.txt b/tests/baselines/reference/genericReduce.errors.txt index 4008fddb919..26e106dba1c 100644 --- a/tests/baselines/reference/genericReduce.errors.txt +++ b/tests/baselines/reference/genericReduce.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/genericReduce.ts(6,4): error TS2339: Property 'x' does not exist on type 'number'. +tests/cases/compiler/genericReduce.ts(8,4): error TS2339: Property 'x' does not exist on type 'number'. +tests/cases/compiler/genericReduce.ts(12,4): error TS2339: Property 'toExponential' does not exist on type 'string'. + + ==== tests/cases/compiler/genericReduce.ts (3 errors) ==== var a = ["An", "array", "of", "strings"]; var b = a.map(s => s.length); @@ -6,15 +11,15 @@ n1.x = "fail"; // should error, as 'n1' should be type 'number', not 'any'. ~ -!!! Property 'x' does not exist on type 'number'. +!!! error TS2339: Property 'x' does not exist on type 'number'. n1.toExponential(2); // should not error if 'n1' is correctly number. n2.x = "fail"; // should error, as 'n2' should be type 'number', not 'any'. ~ -!!! Property 'x' does not exist on type 'number'. +!!! error TS2339: Property 'x' does not exist on type 'number'. n2.toExponential(2); // should not error if 'n2' is correctly number. var n3 = b.reduce( (x, y) => x + y, ""); // Initial value is of type string n3.toExponential(2); // should error if 'n3' is correctly type 'string' ~~~~~~~~~~~~~ -!!! Property 'toExponential' does not exist on type 'string'. +!!! error TS2339: Property 'toExponential' does not exist on type 'string'. n3.charAt(0); // should not error if 'n3' is correctly type 'string' \ No newline at end of file diff --git a/tests/baselines/reference/genericRestArgs.errors.txt b/tests/baselines/reference/genericRestArgs.errors.txt index a23bec39f0e..8a977452958 100644 --- a/tests/baselines/reference/genericRestArgs.errors.txt +++ b/tests/baselines/reference/genericRestArgs.errors.txt @@ -1,17 +1,31 @@ -==== tests/cases/compiler/genericRestArgs.ts (2 errors) ==== +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'. +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[]'. + + +==== tests/cases/compiler/genericRestArgs.ts (4 errors) ==== function makeArrayG(...items: T[]): T[] { return items; } 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'. var a1Gb = makeArrayG(1, ""); var a1Gc = makeArrayG(1, ""); var a1Gd = makeArrayG(1, ""); // error ~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. function makeArrayGOpt(item1?: T, item2?: T, item3?: T) { return [item1, item2, item3]; } 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'. var a2Gb = makeArrayG(1, ""); var a2Gc = makeArrayG(1, ""); // error ~ -!!! Argument of type 'number' is not assignable to parameter of type 'any[]'. \ No newline at end of file +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt b/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt index 939cf38cb03..8215d687443 100644 --- a/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt +++ b/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/genericReturnTypeFromGetter1.ts(6,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/genericReturnTypeFromGetter1.ts(5,18): error TS2314: Generic type 'A' requires 1 type argument(s). + + ==== tests/cases/compiler/genericReturnTypeFromGetter1.ts (2 errors) ==== export interface A { new (dbSet: DbSet): T; @@ -5,9 +9,9 @@ export class DbSet { _entityType: A; ~ -!!! Generic type 'A' requires 1 type argument(s). +!!! error TS2314: Generic type 'A' requires 1 type argument(s). get entityType() { return this._entityType; } // used to ICE without return type annotation ~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/genericSpecializations2.errors.txt b/tests/baselines/reference/genericSpecializations2.errors.txt index 038c65e0e47..49729ca1d8c 100644 --- a/tests/baselines/reference/genericSpecializations2.errors.txt +++ b/tests/baselines/reference/genericSpecializations2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/genericSpecializations2.ts(8,9): error TS2368: Type parameter name cannot be 'string' +tests/cases/compiler/genericSpecializations2.ts(12,9): error TS2368: Type parameter name cannot be 'string' + + ==== tests/cases/compiler/genericSpecializations2.ts (2 errors) ==== class IFoo { foo(x: T): T { // no error on implementors because IFoo's T is different from foo's T @@ -8,13 +12,13 @@ class IntFooBad implements IFoo { foo(x: string): string { return null; } ~~~~~~ -!!! Type parameter name cannot be 'string' +!!! error TS2368: Type parameter name cannot be 'string' } class StringFoo2 implements IFoo { foo(x: string): string { return null; } ~~~~~~ -!!! Type parameter name cannot be 'string' +!!! error TS2368: Type parameter name cannot be 'string' } class StringFoo3 implements IFoo { diff --git a/tests/baselines/reference/genericSpecializations3.errors.txt b/tests/baselines/reference/genericSpecializations3.errors.txt index b4bf9f64bfb..ccaa839f9d0 100644 --- a/tests/baselines/reference/genericSpecializations3.errors.txt +++ b/tests/baselines/reference/genericSpecializations3.errors.txt @@ -1,3 +1,20 @@ +tests/cases/compiler/genericSpecializations3.ts(8,7): error TS2420: Class 'IntFooBad' incorrectly implements interface 'IFoo'. + Types of property 'foo' are incompatible. + Type '(x: string) => string' is not assignable to type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/genericSpecializations3.ts(28,1): error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo'. + Types of property 'foo' are incompatible. + Type '(x: string) => string' is not assignable to type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2'. + Types of property 'foo' are incompatible. + Type '(x: number) => number' is not assignable to type '(x: string) => string'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/genericSpecializations3.ts (3 errors) ==== interface IFoo { foo(x: T): T; @@ -8,11 +25,11 @@ class IntFooBad implements IFoo { // error ~~~~~~~~~ -!!! Class 'IntFooBad' incorrectly implements interface 'IFoo': -!!! Types of property 'foo' are incompatible: -!!! Type '(x: string) => string' is not assignable to type '(x: number) => number': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'IntFooBad' incorrectly implements interface 'IFoo'. +!!! error TS2420: Types of property 'foo' are incompatible. +!!! error TS2420: Type '(x: string) => string' is not assignable to type '(x: number) => number'. +!!! error TS2420: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'number'. foo(x: string): string { return null; } } @@ -34,18 +51,18 @@ intFoo = stringFoo2; // error ~~~~~~ -!!! Type 'StringFoo2' is not assignable to type 'IntFoo': -!!! Types of property 'foo' are incompatible: -!!! Type '(x: string) => string' is not assignable to type '(x: number) => number': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. stringFoo2 = intFoo; // error ~~~~~~~~~~ -!!! Type 'IntFoo' is not assignable to type 'StringFoo2': -!!! Types of property 'foo' are incompatible: -!!! Type '(x: number) => number' is not assignable to type '(x: string) => string': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x: string) => string'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. class StringFoo3 implements IFoo { // error diff --git a/tests/baselines/reference/genericTypeArgumentInference1.types b/tests/baselines/reference/genericTypeArgumentInference1.types index 20a9a0ca8f9..c718ccca620 100644 --- a/tests/baselines/reference/genericTypeArgumentInference1.types +++ b/tests/baselines/reference/genericTypeArgumentInference1.types @@ -42,12 +42,12 @@ declare var _: Underscore.Static; >Static : Underscore.Static var r = _.all([true, 1, null, 'yes'], _.identity); ->r : {} ->_.all([true, 1, null, 'yes'], _.identity) : {} +>r : string | number | boolean +>_.all([true, 1, null, 'yes'], _.identity) : string | number | boolean >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T ->[true, 1, null, 'yes'] : {}[] +>[true, 1, null, 'yes'] : (string | number | boolean)[] >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -69,7 +69,7 @@ var r3 = _.all([], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T ->[] : any[] +>[] : undefined[] >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericTypeAssertions1.errors.txt b/tests/baselines/reference/genericTypeAssertions1.errors.txt index 7ab9e056611..5479c5f948e 100644 --- a/tests/baselines/reference/genericTypeAssertions1.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions1.errors.txt @@ -1,15 +1,22 @@ +tests/cases/compiler/genericTypeAssertions1.ts(3,5): error TS2322: Type 'A' is not assignable to type 'A'. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/genericTypeAssertions1.ts(4,5): error TS2322: Type 'A>' is not assignable to type 'A'. + Type 'A' is not assignable to type 'number'. +tests/cases/compiler/genericTypeAssertions1.ts(4,21): error TS2352: Neither type 'A' nor type 'A>' is assignable to the other. + Type 'number' is not assignable to type 'A'. + + ==== tests/cases/compiler/genericTypeAssertions1.ts (3 errors) ==== class A { foo(x: T) { }} var foo = new A(); var r: A = >new A(); // error ~ -!!! Type 'A' is not assignable to type 'A': -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r2: A = >>foo; // error ~~ -!!! Type 'A>' is not assignable to type 'A': -!!! Type 'A' is not assignable to type 'number'. +!!! error TS2322: Type 'A>' is not assignable to type 'A'. +!!! error TS2322: Type 'A' is not assignable to type 'number'. ~~~~~~~~~~~~~~~~~ -!!! Neither type 'A' nor type 'A>' is assignable to the other: -!!! Type 'number' is not assignable to type 'A': -!!! Property 'foo' is missing in type 'Number'. \ No newline at end of file +!!! error TS2352: Neither type 'A' nor type 'A>' is assignable to the other. +!!! error TS2352: Type 'number' is not assignable to type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions2.errors.txt b/tests/baselines/reference/genericTypeAssertions2.errors.txt index 886031edaaf..eda4c83646c 100644 --- a/tests/baselines/reference/genericTypeAssertions2.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions2.errors.txt @@ -1,3 +1,14 @@ +tests/cases/compiler/genericTypeAssertions2.ts(10,5): error TS2322: Type 'B' is not assignable to type 'A'. + Types of property 'foo' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/genericTypeAssertions2.ts(11,5): error TS2322: Type 'A' is not assignable to type 'B'. + Property 'bar' is missing in type 'A'. +tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2352: Neither type 'undefined[]' nor type 'A' is assignable to the other. + Property 'foo' is missing in type 'undefined[]'. + + ==== tests/cases/compiler/genericTypeAssertions2.ts (3 errors) ==== class A { foo(x: T) { } } class B extends A { @@ -10,17 +21,17 @@ var r: A = >new B(); var r2: A = >new B(); // error ~~ -!!! Type 'B' is not assignable to type 'A': -!!! Types of property 'foo' are incompatible: -!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r3: B = >new B(); // error ~~ -!!! Type 'A' is not assignable to type 'B': -!!! Property 'bar' is missing in type 'A'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'bar' is missing in type 'A'. var r4: A = >new A(); var r5: A = >[]; // error ~~~~~~~~~~~~~ -!!! Neither type 'undefined[]' nor type 'A' is assignable to the other: -!!! Property 'foo' is missing in type 'undefined[]'. \ No newline at end of file +!!! error TS2352: Neither type 'undefined[]' nor type 'A' is assignable to the other. +!!! error TS2352: Property 'foo' is missing in type 'undefined[]'. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions4.errors.txt b/tests/baselines/reference/genericTypeAssertions4.errors.txt index c109b6988e9..055de774b39 100644 --- a/tests/baselines/reference/genericTypeAssertions4.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions4.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/genericTypeAssertions4.ts(19,5): error TS2322: Type 'A' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions4.ts(20,5): error TS2322: Type 'B' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions4.ts(21,5): error TS2322: Type 'C' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions4.ts(23,9): error TS2352: Neither type 'B' nor type 'T' is assignable to the other. +tests/cases/compiler/genericTypeAssertions4.ts(24,9): error TS2352: Neither type 'C' nor type 'T' is assignable to the other. + + ==== tests/cases/compiler/genericTypeAssertions4.ts (5 errors) ==== class A { foo() { return ""; } @@ -19,18 +26,18 @@ var y = x; y = a; // error: cannot convert A to T ~ -!!! Type 'A' is not assignable to type 'T'. +!!! error TS2322: Type 'A' is not assignable to type 'T'. y = b; // error: cannot convert B to T ~ -!!! Type 'B' is not assignable to type 'T'. +!!! error TS2322: Type 'B' is not assignable to type 'T'. y = c; // error: cannot convert C to T ~ -!!! Type 'C' is not assignable to type 'T'. +!!! error TS2322: Type 'C' is not assignable to type 'T'. y = a; y = b; // error: cannot convert B to T ~~~~ -!!! Neither type 'B' nor type 'T' is assignable to the other. +!!! error TS2352: Neither type 'B' nor type 'T' is assignable to the other. y = c; // error: cannot convert C to T ~~~~ -!!! Neither type 'C' nor type 'T' is assignable to the other. +!!! error TS2352: Neither type 'C' nor type 'T' is assignable to the other. } \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions5.errors.txt b/tests/baselines/reference/genericTypeAssertions5.errors.txt index 7fe23527273..e315a7f122a 100644 --- a/tests/baselines/reference/genericTypeAssertions5.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions5.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/genericTypeAssertions5.ts(19,5): error TS2322: Type 'A' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions5.ts(20,5): error TS2322: Type 'B' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions5.ts(21,5): error TS2322: Type 'C' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions5.ts(23,9): error TS2352: Neither type 'B' nor type 'T' is assignable to the other. +tests/cases/compiler/genericTypeAssertions5.ts(24,9): error TS2352: Neither type 'C' nor type 'T' is assignable to the other. + + ==== tests/cases/compiler/genericTypeAssertions5.ts (5 errors) ==== interface A { foo(): string; @@ -19,18 +26,18 @@ var y = x; y = a; // error: cannot convert A to T ~ -!!! Type 'A' is not assignable to type 'T'. +!!! error TS2322: Type 'A' is not assignable to type 'T'. y = b; // error: cannot convert B to T ~ -!!! Type 'B' is not assignable to type 'T'. +!!! error TS2322: Type 'B' is not assignable to type 'T'. y = c; // error: cannot convert C to T ~ -!!! Type 'C' is not assignable to type 'T'. +!!! error TS2322: Type 'C' is not assignable to type 'T'. y = a; y = b; // error: cannot convert B to T ~~~~ -!!! Neither type 'B' nor type 'T' is assignable to the other. +!!! error TS2352: Neither type 'B' nor type 'T' is assignable to the other. y = c; // error: cannot convert C to T ~~~~ -!!! Neither type 'C' nor type 'T' is assignable to the other. +!!! error TS2352: Neither type 'C' nor type 'T' is assignable to the other. } \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions6.errors.txt b/tests/baselines/reference/genericTypeAssertions6.errors.txt index 99d7f6b8509..93677b9ab84 100644 --- a/tests/baselines/reference/genericTypeAssertions6.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions6.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/genericTypeAssertions6.ts(8,13): error TS2352: Neither type 'U' nor type 'T' is assignable to the other. +tests/cases/compiler/genericTypeAssertions6.ts(9,13): error TS2352: Neither type 'T' nor type 'U' is assignable to the other. +tests/cases/compiler/genericTypeAssertions6.ts(19,17): error TS2352: Neither type 'U' nor type 'T' is assignable to the other. + + ==== tests/cases/compiler/genericTypeAssertions6.ts (3 errors) ==== class A { constructor(x) { @@ -8,10 +13,10 @@ f(x: T, y: U) { x = y; ~~~~ -!!! Neither type 'U' nor type 'T' is assignable to the other. +!!! error TS2352: Neither type 'U' nor type 'T' is assignable to the other. y = x; ~~~~ -!!! Neither type 'T' nor type 'U' is assignable to the other. +!!! error TS2352: Neither type 'T' nor type 'U' is assignable to the other. } } @@ -23,7 +28,7 @@ var d = new Date(); var e = new Date(); ~~~~~~~~~~~~~~~~ -!!! Neither type 'U' nor type 'T' is assignable to the other. +!!! error TS2352: Neither type 'U' nor type 'T' is assignable to the other. } } diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt index b3fdd2a93af..f646ac4725e 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt @@ -1,3 +1,19 @@ +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,19): error TS1023: An index signature parameter type must be 'string' or 'number'. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(8,16): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(10,21): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(11,22): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(11,26): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,22): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,26): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,23): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,27): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(16,25): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(22,26): error TS2305: Module 'M' has no exported member 'C'. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(23,28): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(25,30): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(26,30): error TS2314: Generic type 'E' requires 1 type argument(s). + + ==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts (14 errors) ==== // it is an error to use a generic type without type arguments // all of these are errors @@ -8,33 +24,33 @@ declare var c: C; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare var a: { x: C }; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare var b: { (x: C): C }; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare var d: { [x: C]: C }; ~ -!!! An index signature parameter type must be 'string' or 'number'. +!!! error TS1023: An index signature parameter type must be 'string' or 'number'. ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare function f(x: C): C; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare class D extends C {} ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare module M { export class E { foo: T } @@ -42,14 +58,14 @@ declare class D2 extends M.C { } ~~~ -!!! Module 'M' has no exported member 'C'. +!!! error TS2305: Module 'M' has no exported member 'C'. declare class D3 { } ~~~ -!!! Generic type 'E' requires 1 type argument(s). +!!! error TS2314: Generic type 'E' requires 1 type argument(s). declare function h(x: T); ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare function i(x: T); ~~~ -!!! Generic type 'E' requires 1 type argument(s). \ No newline at end of file +!!! error TS2314: Generic type 'E' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt index e8fee6f002b..a8627f3f18e 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt @@ -1,3 +1,29 @@ +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,11): error TS1023: An index signature parameter type must be 'string' or 'number'. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(8,8): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(10,13): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(11,14): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(11,18): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,14): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,18): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(14,13): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(14,28): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(16,15): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(16,19): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(16,30): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(18,23): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(18,27): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(18,38): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(20,17): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(23,21): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(29,18): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(30,20): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(31,22): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(33,22): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(34,22): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(36,10): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(37,10): error TS2314: Generic type 'E' requires 1 type argument(s). + + ==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts (24 errors) ==== // it is an error to use a generic type without type arguments // all of these are errors @@ -8,54 +34,54 @@ var c: C; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var a: { x: C }; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var b: { (x: C): C }; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var d: { [x: C]: C }; ~ -!!! An index signature parameter type must be 'string' or 'number'. +!!! error TS1023: An index signature parameter type must be 'string' or 'number'. ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var e = (x: C) => { var y: C; return y; } ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). function f(x: C): C { var y: C; return y; } ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var g = function f(x: C): C { var y: C; return y; } ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). class D extends C { ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). } interface I extends C {} ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). module M { export class E { foo: T } @@ -63,24 +89,24 @@ class D2 extends M.E { } ~~~ -!!! Generic type 'E' requires 1 type argument(s). +!!! error TS2314: Generic type 'E' requires 1 type argument(s). class D3 { } ~~~ -!!! Generic type 'E' requires 1 type argument(s). +!!! error TS2314: Generic type 'E' requires 1 type argument(s). interface I2 extends M.E { } ~~~ -!!! Generic type 'E' requires 1 type argument(s). +!!! error TS2314: Generic type 'E' requires 1 type argument(s). function h(x: T) { } ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). function i(x: T) { } ~~~ -!!! Generic type 'E' requires 1 type argument(s). +!!! error TS2314: Generic type 'E' requires 1 type argument(s). var j = null; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var k = null; ~~~ -!!! Generic type 'E' requires 1 type argument(s). \ No newline at end of file +!!! error TS2314: Generic type 'E' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt index 0513aaff05c..1802d0385c4 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt @@ -1,3 +1,29 @@ +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,11): error TS1023: An index signature parameter type must be 'string' or 'number'. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(8,8): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(10,13): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(11,14): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(11,18): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,14): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,18): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(14,13): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(14,28): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(16,15): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(16,19): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(16,30): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,23): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,27): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,38): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(20,17): error TS2314: Generic type 'I' requires 1 type argument(s). +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 TS2305: Module 'M' has no exported member 'C'. +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,22): error TS2305: Module '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'. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(37,10): error TS2314: Generic type 'E' requires 1 type argument(s). + + ==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts (24 errors) ==== // it is an error to use a generic type without type arguments // all of these are errors @@ -8,54 +34,54 @@ var c: I; ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). var a: { x: I }; ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). var b: { (x: I): I }; ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). var d: { [x: I]: I }; ~ -!!! An index signature parameter type must be 'string' or 'number'. +!!! error TS1023: An index signature parameter type must be 'string' or 'number'. ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). var e = (x: I) => { var y: I; return y; } ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). function f(x: I): I { var y: I; return y; } ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). var g = function f(x: I): I { var y: I; return y; } ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). class D extends I { ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). } interface U extends I {} ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). module M { export interface E { foo: T } @@ -63,24 +89,24 @@ class D2 extends M.C { } ~~~ -!!! Module 'M' has no exported member 'C'. +!!! error TS2305: Module 'M' has no exported member 'C'. interface D3 { } ~~~ -!!! Generic type 'E' requires 1 type argument(s). +!!! error TS2314: Generic type 'E' requires 1 type argument(s). interface I2 extends M.C { } ~~~ -!!! Module 'M' has no exported member 'C'. +!!! error TS2305: Module 'M' has no exported member 'C'. function h(x: T) { } ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). function i(x: T) { } ~~~ -!!! Generic type 'E' requires 1 type argument(s). +!!! error TS2314: Generic type 'E' requires 1 type argument(s). var j = null; ~ -!!! Cannot find name 'C'. +!!! error TS2304: Cannot find name 'C'. var k = null; ~~~ -!!! Generic type 'E' requires 1 type argument(s). \ No newline at end of file +!!! error TS2314: Generic type 'E' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt index 7b0e4ba6fbe..41774da0d00 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt @@ -1,3 +1,19 @@ +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,19): error TS1023: An index signature parameter type must be 'string' or 'number'. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(8,16): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(10,21): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(11,22): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(11,26): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,22): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,26): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,23): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,27): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(16,25): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(22,26): error TS2305: Module 'M' has no exported member 'C'. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(23,28): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(25,30): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(26,30): error TS2314: Generic type 'E' requires 1 type argument(s). + + ==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts (14 errors) ==== // it is an error to use a generic type without type arguments // all of these are errors @@ -8,33 +24,33 @@ declare var c: C; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare var a: { x: C }; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare var b: { (x: C): C }; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare var d: { [x: C]: C }; ~ -!!! An index signature parameter type must be 'string' or 'number'. +!!! error TS1023: An index signature parameter type must be 'string' or 'number'. ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare function f(x: C): C; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare class D extends C {} ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare module M { export class E { foo: T } @@ -42,14 +58,14 @@ declare class D2 extends M.C { } ~~~ -!!! Module 'M' has no exported member 'C'. +!!! error TS2305: Module 'M' has no exported member 'C'. declare class D3 { } ~~~ -!!! Generic type 'E' requires 1 type argument(s). +!!! error TS2314: Generic type 'E' requires 1 type argument(s). declare function h(x: T); ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). declare function i(x: T); ~~~ -!!! Generic type 'E' requires 1 type argument(s). \ No newline at end of file +!!! error TS2314: Generic type 'E' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt index 6f464ab0eab..224e5e038da 100644 --- a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt +++ b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(7,9): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(8,9): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(9,11): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(10,11): error TS2314: Generic type 'C' requires 1 type argument(s). + + ==== tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts (4 errors) ==== class C { foo(): T { return null } @@ -7,14 +13,14 @@ } var c1: C; // error ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var i1: I; // error ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). var c2: C; // should be an error ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). var i2: I; // should be an error ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt index 8f923d6bdb7..836f250f5fc 100644 --- a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt +++ b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/genericTypeUsedWithoutTypeArguments1.ts(2,25): error TS2314: Generic type 'Foo' requires 1 type argument(s). + + ==== tests/cases/compiler/genericTypeUsedWithoutTypeArguments1.ts (1 errors) ==== interface Foo { } class Bar implements Foo { } ~~~ -!!! Generic type 'Foo' requires 1 type argument(s). +!!! error TS2314: Generic type 'Foo' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt index b6f9510b525..c76133014f0 100644 --- a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt +++ b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/genericTypeUsedWithoutTypeArguments3.ts(2,26): error TS2314: Generic type 'Foo' requires 1 type argument(s). + + ==== tests/cases/compiler/genericTypeUsedWithoutTypeArguments3.ts (1 errors) ==== interface Foo { } interface Bar extends Foo { } ~~~ -!!! Generic type 'Foo' requires 1 type argument(s). +!!! error TS2314: Generic type 'Foo' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt index 2b755e16db2..ae93d059f9a 100644 --- a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt @@ -1,26 +1,42 @@ +tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(4,7): error TS2420: Class 'X' incorrectly implements interface 'I'. + Types of property 'f' are incompatible. + Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'. + Types of parameters 'a' and 'a' are incompatible. + Type 'T' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I'. + Types of property 'f' are incompatible. + Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. + Types of parameters 'a' and 'a' are incompatible. + Type '{ a: string; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts (2 errors) ==== interface I { f: (a: { a: number }) => void } class X implements I { ~ -!!! Class 'X' incorrectly implements interface 'I': -!!! Types of property 'f' are incompatible: -!!! Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void': -!!! Types of parameters 'a' and 'a' are incompatible: -!!! Type 'T' is not assignable to type '{ a: number; }': -!!! Types of property 'a' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'X' incorrectly implements interface 'I'. +!!! error TS2420: Types of property 'f' are incompatible. +!!! error TS2420: Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'. +!!! error TS2420: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2420: Type 'T' is not assignable to type '{ a: number; }'. +!!! error TS2420: Types of property 'a' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'number'. f(a: T): void { } } var x = new X<{ a: string }>(); var i: I = x; // Should not be allowed -- type of 'f' is incompatible with 'I' ~ -!!! Type 'X<{ a: string; }>' is not assignable to type 'I': -!!! Types of property 'f' are incompatible: -!!! Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void': -!!! Types of parameters 'a' and 'a' are incompatible: -!!! Type '{ a: string; }' is not assignable to type '{ a: number; }': -!!! Types of property 'a' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. +!!! error TS2322: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: number; }'. +!!! error TS2322: Types of property 'a' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types index 05697f1e1f9..f0cab6e7467 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types @@ -8,7 +8,7 @@ class LazyArray { ><{ [objectId: string]: T; }>{} : { [x: string]: T; } >objectId : string >T : T ->{} : { [x: string]: T; } +>{} : { [x: string]: undefined; } array() { >array : () => { [x: string]: T; } diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt index 98b077e1a77..98db4282244 100644 --- a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt @@ -1,3 +1,8 @@ +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(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. + + ==== tests/cases/compiler/genericWithOpenTypeParameters1.ts (3 errors) ==== class B { foo(x: T): T { return null; } @@ -7,12 +12,12 @@ x.foo(1); // no error var f = (x: B) => { return x.foo(1); } // error ~ -!!! Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. var f2 = (x: B) => { return x.foo(1); } // error ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var f3 = (x: B) => { return x.foo(1); } // error ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var f4 = (x: B) => { return x.foo(1); } // no error \ No newline at end of file diff --git a/tests/baselines/reference/generics1.errors.txt b/tests/baselines/reference/generics1.errors.txt index 030a820e6c9..81d250a2ef4 100644 --- a/tests/baselines/reference/generics1.errors.txt +++ b/tests/baselines/reference/generics1.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/generics1.ts(10,9): error TS2344: Type 'A' does not satisfy the constraint 'B'. + Property 'b' is missing in type 'A'. +tests/cases/compiler/generics1.ts(13,9): error TS2314: Generic type 'G' requires 2 type argument(s). +tests/cases/compiler/generics1.ts(14,9): error TS2314: Generic type 'G' requires 2 type argument(s). + + ==== tests/cases/compiler/generics1.ts (3 errors) ==== interface A { a: string; } interface B extends A { b: string; } @@ -10,14 +16,14 @@ var v2: G<{ a: string }, C>; // Ok, equivalent to G var v3: G; // Error, A not valid argument for U ~~~~~~~ -!!! Type 'A' does not satisfy the constraint 'B': -!!! Property 'b' is missing in type 'A'. +!!! error TS2344: Type 'A' does not satisfy the constraint 'B'. +!!! error TS2344: Property 'b' is missing in type 'A'. var v4: G, C>; // Ok var v5: G; // Error, any does not satisfy constraint B var v6: G; // Error, wrong number of arguments ~~~~~~ -!!! Generic type 'G' requires 2 type argument(s). +!!! error TS2314: Generic type 'G' requires 2 type argument(s). var v7: G; // Error, no type arguments ~ -!!! Generic type 'G' requires 2 type argument(s). +!!! error TS2314: Generic type 'G' requires 2 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/generics2.errors.txt b/tests/baselines/reference/generics2.errors.txt index 0d4742bc0e8..a0380eee753 100644 --- a/tests/baselines/reference/generics2.errors.txt +++ b/tests/baselines/reference/generics2.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/generics2.ts(17,9): error TS2344: Type 'A' does not satisfy the constraint 'B'. + Property 'b' is missing in type 'A'. +tests/cases/compiler/generics2.ts(20,9): error TS2314: Generic type 'G' requires 2 type argument(s). +tests/cases/compiler/generics2.ts(21,9): error TS2314: Generic type 'G' requires 2 type argument(s). + + ==== tests/cases/compiler/generics2.ts (3 errors) ==== interface A { a: string; } interface B extends A { b: string; } @@ -17,14 +23,14 @@ var v2: G<{ a: string }, C>; // Ok, equivalent to G var v3: G; // Error, A not valid argument for U ~~~~~~~ -!!! Type 'A' does not satisfy the constraint 'B': -!!! Property 'b' is missing in type 'A'. +!!! error TS2344: Type 'A' does not satisfy the constraint 'B'. +!!! error TS2344: Property 'b' is missing in type 'A'. var v4: G, C>; // Ok var v5: G; // Error, any does not satisfy constraint B var v6: G; // Error, wrong number of arguments ~~~~~~ -!!! Generic type 'G' requires 2 type argument(s). +!!! error TS2314: Generic type 'G' requires 2 type argument(s). var v7: G; // Error, no type arguments ~ -!!! Generic type 'G' requires 2 type argument(s). +!!! error TS2314: Generic type 'G' requires 2 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/generics4.errors.txt b/tests/baselines/reference/generics4.errors.txt index 9e2f1a5ccda..06bfa122901 100644 --- a/tests/baselines/reference/generics4.errors.txt +++ b/tests/baselines/reference/generics4.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C' is not assignable to type 'C'. + Type 'Y' is not assignable to type 'X'. + Types of property 'f' are incompatible. + Type '() => boolean' is not assignable to type '() => string'. + Type 'boolean' is not assignable to type 'string'. + + ==== tests/cases/compiler/generics4.ts (1 errors) ==== class C { private x: T; } interface X { f(): string; } @@ -7,8 +14,8 @@ a = b; // Not ok - return types of "f" are different ~ -!!! Type 'C' is not assignable to type 'C': -!!! Type 'Y' is not assignable to type 'X': -!!! Types of property 'f' are incompatible: -!!! Type '() => boolean' is not assignable to type '() => string': -!!! Type 'boolean' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'C'. +!!! error TS2322: Type 'Y' is not assignable to type 'X'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '() => boolean' is not assignable to type '() => string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/generics5.errors.txt b/tests/baselines/reference/generics5.errors.txt index 74f5d0e6e2c..17aeea63df2 100644 --- a/tests/baselines/reference/generics5.errors.txt +++ b/tests/baselines/reference/generics5.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/generics5.ts(10,9): error TS2344: Type 'A' does not satisfy the constraint 'B'. + Property 'b' is missing in type 'A'. + + ==== tests/cases/compiler/generics5.ts (1 errors) ==== interface A { a: string; } interface B extends A { b: string; } @@ -10,7 +14,7 @@ var v3: G; // Error, A not valid argument for U ~~~~~~~ -!!! Type 'A' does not satisfy the constraint 'B': -!!! Property 'b' is missing in type 'A'. +!!! error TS2344: Type 'A' does not satisfy the constraint 'B'. +!!! error TS2344: Property 'b' is missing in type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/genericsManyTypeParameters.types b/tests/baselines/reference/genericsManyTypeParameters.types index 65f9a7c115e..cb492c30623 100644 --- a/tests/baselines/reference/genericsManyTypeParameters.types +++ b/tests/baselines/reference/genericsManyTypeParameters.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericsManyTypeParameters.ts === function Foo< ->Foo : (x1: a1, y1: a21, z1: a31, a1: a41, b1: a51, c1: a61, x2: a119, y2: a22, z2: a32, a2: a42, b2: a52, c2: a62, x3: a219, y3: a23, z3: a33, a3: a43, b3: a53, c3: a63, x4: a319, y4: a24, z4: a34, a4: a44, b4: a54, c4: a64, x5: a419, y5: a25, z5: a35, a5: a45, b5: a55, c5: a65, x6: a519, y6: a26, z6: a36, a6: a46, b6: a56, c6: a66, x7: a619, y7: a27, z7: a37, a7: a47, b7: a57, c7: a67, x8: a71, y8: a28, z8: a38, a8: a48, b8: a58, c8: a68, x9: a81, y9: a29, z9: a39, a9: a49, b9: a59, c9: a69, x10: a91, y12: a210, z10: a310, a10: a410, b10: a510, c10: a610, x11: a111, y13: a211, z11: a311, a11: a411, b11: a511, c11: a611, x12: a112, y14: a212, z12: a312, a12: a412, b12: a512, c12: a612, x13: a113, y15: a213, z13: a313, a13: a413, b13: a513, c13: a613, x14: a114, y16: a214, z14: a314, a14: a414, b14: a514, c14: a614, x15: a115, y17: a215, z15: a315, a15: a415, b15: a515, c15: a615, x16: a116, y18: a216, z16: a316, a16: a416, b16: a516, c16: a616, x17: a117, y19: a217, z17: a317, a17: a417, b17: a517, c17: a617, x18: a118, y10: a218, z18: a318, a18: a418, b18: a518, c18: a618) => {}[] +>Foo : (x1: a1, y1: a21, z1: a31, a1: a41, b1: a51, c1: a61, x2: a119, y2: a22, z2: a32, a2: a42, b2: a52, c2: a62, x3: a219, y3: a23, z3: a33, a3: a43, b3: a53, c3: a63, x4: a319, y4: a24, z4: a34, a4: a44, b4: a54, c4: a64, x5: a419, y5: a25, z5: a35, a5: a45, b5: a55, c5: a65, x6: a519, y6: a26, z6: a36, a6: a46, b6: a56, c6: a66, x7: a619, y7: a27, z7: a37, a7: a47, b7: a57, c7: a67, x8: a71, y8: a28, z8: a38, a8: a48, b8: a58, c8: a68, x9: a81, y9: a29, z9: a39, a9: a49, b9: a59, c9: a69, x10: a91, y12: a210, z10: a310, a10: a410, b10: a510, c10: a610, x11: a111, y13: a211, z11: a311, a11: a411, b11: a511, c11: a611, x12: a112, y14: a212, z12: a312, a12: a412, b12: a512, c12: a612, x13: a113, y15: a213, z13: a313, a13: a413, b13: a513, c13: a613, x14: a114, y16: a214, z14: a314, a14: a414, b14: a514, c14: a614, x15: a115, y17: a215, z15: a315, a15: a415, b15: a515, c15: a615, x16: a116, y18: a216, z16: a316, a16: a416, b16: a516, c16: a616, x17: a117, y19: a217, z17: a317, a17: a417, b17: a517, c17: a617, x18: a118, y10: a218, z18: a318, a18: a418, b18: a518, c18: a618) => (a1 | a21 | a31 | a41 | a51 | a61 | a119 | a22 | a32 | a42 | a52 | a62 | a219 | a23 | a33 | a43 | a53 | a63 | a319 | a24 | a34 | a44 | a54 | a64 | a419 | a25 | a35 | a45 | a55 | a65 | a519 | a26 | a36 | a46 | a56 | a66 | a619 | a27 | a37 | a47 | a57 | a67 | a71 | a28 | a38 | a48 | a58 | a68 | a81 | a29 | a39 | a49 | a59 | a69 | a91 | a210 | a310 | a410 | a510 | a610 | a111 | a211 | a311 | a411 | a511 | a611 | a112 | a212 | a312 | a412 | a512 | a612 | a113 | a213 | a313 | a413 | a513 | a613 | a114 | a214 | a314 | a414 | a514 | a614 | a115 | a215 | a315 | a415 | a515 | a615 | a116 | a216 | a316 | a416 | a516 | a616 | a117 | a217 | a317 | a417 | a517 | a617 | a118 | a218 | a318 | a418 | a518 | a618)[] a1, a21, a31, a41, a51, a61, >a1 : a1 @@ -402,7 +402,7 @@ function Foo< ) { return [x1 , y1 , z1 , a1 , b1 , c1, ->[x1 , y1 , z1 , a1 , b1 , c1, x2 , y2 , z2 , a2 , b2 , c2, x3 , y3 , z3 , a3 , b3 , c3, x4 , y4 , z4 , a4 , b4 , c4, x5 , y5 , z5 , a5 , b5 , c5, x6 , y6 , z6 , a6 , b6 , c6, x7 , y7 , z7 , a7 , b7 , c7, x8 , y8 , z8 , a8 , b8 , c8, x9 , y9 , z9 , a9 , b9 , c9, x10 , y12 , z10 , a10 , b10 , c10, x11 , y13 , z11 , a11 , b11 , c11, x12 , y14 , z12 , a12 , b12 , c12, x13 , y15 , z13 , a13 , b13 , c13, x14 , y16 , z14 , a14 , b14 , c14, x15 , y17 , z15 , a15 , b15 , c15, x16 , y18 , z16 , a16 , b16 , c16, x17 , y19 , z17 , a17 , b17 , c17, x18 , y10 , z18 , a18 , b18 , c18] : {}[] +>[x1 , y1 , z1 , a1 , b1 , c1, x2 , y2 , z2 , a2 , b2 , c2, x3 , y3 , z3 , a3 , b3 , c3, x4 , y4 , z4 , a4 , b4 , c4, x5 , y5 , z5 , a5 , b5 , c5, x6 , y6 , z6 , a6 , b6 , c6, x7 , y7 , z7 , a7 , b7 , c7, x8 , y8 , z8 , a8 , b8 , c8, x9 , y9 , z9 , a9 , b9 , c9, x10 , y12 , z10 , a10 , b10 , c10, x11 , y13 , z11 , a11 , b11 , c11, x12 , y14 , z12 , a12 , b12 , c12, x13 , y15 , z13 , a13 , b13 , c13, x14 , y16 , z14 , a14 , b14 , c14, x15 , y17 , z15 , a15 , b15 , c15, x16 , y18 , z16 , a16 , b16 , c16, x17 , y19 , z17 , a17 , b17 , c17, x18 , y10 , z18 , a18 , b18 , c18] : (a1 | a21 | a31 | a41 | a51 | a61 | a119 | a22 | a32 | a42 | a52 | a62 | a219 | a23 | a33 | a43 | a53 | a63 | a319 | a24 | a34 | a44 | a54 | a64 | a419 | a25 | a35 | a45 | a55 | a65 | a519 | a26 | a36 | a46 | a56 | a66 | a619 | a27 | a37 | a47 | a57 | a67 | a71 | a28 | a38 | a48 | a58 | a68 | a81 | a29 | a39 | a49 | a59 | a69 | a91 | a210 | a310 | a410 | a510 | a610 | a111 | a211 | a311 | a411 | a511 | a611 | a112 | a212 | a312 | a412 | a512 | a612 | a113 | a213 | a313 | a413 | a513 | a613 | a114 | a214 | a314 | a414 | a514 | a614 | a115 | a215 | a315 | a415 | a515 | a615 | a116 | a216 | a316 | a416 | a516 | a616 | a117 | a217 | a317 | a417 | a517 | a617 | a118 | a218 | a318 | a418 | a518 | a618)[] >x1 : a1 >y1 : a21 >z1 : a31 diff --git a/tests/baselines/reference/genericsWithDuplicateTypeParameters1.errors.txt b/tests/baselines/reference/genericsWithDuplicateTypeParameters1.errors.txt index 052822f1bad..879a1b52d3b 100644 --- a/tests/baselines/reference/genericsWithDuplicateTypeParameters1.errors.txt +++ b/tests/baselines/reference/genericsWithDuplicateTypeParameters1.errors.txt @@ -1,37 +1,49 @@ +tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts(1,15): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts(2,16): error TS2300: Duplicate identifier 'X'. +tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts(3,12): error TS2300: Duplicate identifier 'X'. +tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts(4,17): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts(5,18): error TS2300: Duplicate identifier 'X'. +tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts(8,16): error TS2300: Duplicate identifier 'X'. +tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts(9,10): error TS2300: Duplicate identifier 'X'. +tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts(10,11): error TS2300: Duplicate identifier 'X'. +tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts(14,22): error TS2300: Duplicate identifier 'X'. +tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts(15,23): error TS2300: Duplicate identifier 'X'. + + ==== tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts (10 errors) ==== function f() { } ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. function f2(a: X, b: X): X { return null; } ~ -!!! Duplicate identifier 'X'. +!!! error TS2300: Duplicate identifier 'X'. class C { ~ -!!! Duplicate identifier 'X'. +!!! error TS2300: Duplicate identifier 'X'. public f() {} ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. public f2(a: X, b: X): X { return null; } ~ -!!! Duplicate identifier 'X'. +!!! error TS2300: Duplicate identifier 'X'. } interface I { ~ -!!! Duplicate identifier 'X'. +!!! error TS2300: Duplicate identifier 'X'. f(); ~ -!!! Duplicate identifier 'X'. +!!! error TS2300: Duplicate identifier 'X'. f2(a: X, b: X): X; ~ -!!! Duplicate identifier 'X'. +!!! error TS2300: Duplicate identifier 'X'. } var m = { a: function f() {}, ~ -!!! Duplicate identifier 'X'. +!!! error TS2300: Duplicate identifier 'X'. b: function f2(a: X, b: X): X { return null; } ~ -!!! Duplicate identifier 'X'. +!!! error TS2300: Duplicate identifier 'X'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt b/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt index eb0aac2035f..c1382788beb 100644 --- a/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt +++ b/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt @@ -1,3 +1,20 @@ +tests/cases/compiler/genericsWithoutTypeParameters1.ts(9,9): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(10,9): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(11,11): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(12,11): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(14,17): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(14,23): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(15,20): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(15,29): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(17,13): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(18,14): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(21,8): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(22,8): error TS2314: Generic type 'D' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(26,8): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(27,8): error TS2314: Generic type 'J' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(31,22): error TS2314: Generic type 'A' requires 1 type argument(s). + + ==== tests/cases/compiler/genericsWithoutTypeParameters1.ts (15 errors) ==== class C { foo(): T { return null } @@ -9,56 +26,56 @@ var c1: C; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var i1: I; ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). var c2: C; ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). var i2: I; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). function foo(x: C, y: I) { } ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). function foo2(x: C, y: I) { } ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var x: { a: C } = { a: new C() }; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). var x2: { a: I } = { a: { bar() { return 1 } } }; ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). class D { x: C; ~ -!!! Generic type 'C' requires 1 type argument(s). +!!! error TS2314: Generic type 'C' requires 1 type argument(s). y: D; ~ -!!! Generic type 'D' requires 1 type argument(s). +!!! error TS2314: Generic type 'D' requires 1 type argument(s). } interface J { x: I; ~ -!!! Generic type 'I' requires 1 type argument(s). +!!! error TS2314: Generic type 'I' requires 1 type argument(s). y: J; ~ -!!! Generic type 'J' requires 1 type argument(s). +!!! error TS2314: Generic type 'J' requires 1 type argument(s). } class A { } function f(x: T): A { ~ -!!! Generic type 'A' requires 1 type argument(s). +!!! error TS2314: Generic type 'A' requires 1 type argument(s). return null; } \ No newline at end of file diff --git a/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt index 2a3e67203c9..a7e8155c220 100644 --- a/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt +++ b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt @@ -1,12 +1,27 @@ -==== tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts (4 errors) ==== +tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(21,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(1,18): error TS2300: Duplicate identifier '_'. +tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(1,41): error TS2304: Cannot find name '_'. +tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(2,18): error TS2300: Duplicate identifier '_'. +tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(2,34): error TS2304: Cannot find name '_'. +tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(4,16): error TS2300: Duplicate identifier '_'. +tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(15,15): error TS2300: Duplicate identifier '_'. + + +==== tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts (7 errors) ==== declare function _(value: Array): _; + ~ +!!! error TS2300: Duplicate identifier '_'. ~~~~ -!!! Cannot find name '_'. +!!! error TS2304: Cannot find name '_'. declare function _(value: T): _; + ~ +!!! error TS2300: Duplicate identifier '_'. ~~~~ -!!! Cannot find name '_'. +!!! error TS2304: Cannot find name '_'. declare module _ { + ~ +!!! error TS2300: Duplicate identifier '_'. export function each( //list: List, //iterator: ListIterator, @@ -19,7 +34,7 @@ declare class _ { ~ -!!! Duplicate identifier '_'. +!!! error TS2300: Duplicate identifier '_'. each(iterator: _.ListIterator, context?: any): void; } @@ -27,7 +42,7 @@ export class MyClass { public get myGetter() { ~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var obj:any = {}; return obj; diff --git a/tests/baselines/reference/getAndSetAsMemberNames.errors.txt b/tests/baselines/reference/getAndSetAsMemberNames.errors.txt index ca92470e011..a83c4ba118c 100644 --- a/tests/baselines/reference/getAndSetAsMemberNames.errors.txt +++ b/tests/baselines/reference/getAndSetAsMemberNames.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/getAndSetAsMemberNames.ts(19,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/getAndSetAsMemberNames.ts (1 errors) ==== class C1 { set: boolean; @@ -19,6 +22,6 @@ get (): boolean { return true; } set t(x) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt index dbb4e935f2b..5fe2e7ae321 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt @@ -1,17 +1,23 @@ +tests/cases/compiler/getAndSetNotIdenticalType.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getAndSetNotIdenticalType.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getAndSetNotIdenticalType.ts(2,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. + + ==== tests/cases/compiler/getAndSetNotIdenticalType.ts (4 errors) ==== class C { get x(): number { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~~ return 1; ~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! 'get' and 'set' accessor must have the same type. +!!! error TS2380: 'get' and 'set' accessor must have the same type. set x(v: string) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~~~~~ -!!! 'get' and 'set' accessor must have the same type. +!!! error TS2380: 'get' and 'set' accessor must have the same type. } \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt index 4589f529603..69d367bb21c 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A'. + Type 'string' is not assignable to type 'T'. + + ==== tests/cases/compiler/getAndSetNotIdenticalType2.ts (5 errors) ==== class A { foo: T; } @@ -5,25 +13,25 @@ data: A; get x(): A { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~ return this.data; ~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! 'get' and 'set' accessor must have the same type. +!!! error TS2380: 'get' and 'set' accessor must have the same type. set x(v: A) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~~~~~~ this.data = v; ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ -!!! Type 'A' is not assignable to type 'A': -!!! Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. +!!! error TS2322: Type 'string' is not assignable to type 'T'. } ~~~~~ -!!! 'get' and 'set' accessor must have the same type. +!!! error TS2380: 'get' and 'set' accessor must have the same type. } var x = new C(); diff --git a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt index 193f7613202..bca86419f62 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A'. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/getAndSetNotIdenticalType3.ts (5 errors) ==== class A { foo: T; } @@ -5,25 +13,25 @@ data: A; get x(): A { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~~~~~ return this.data; ~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! 'get' and 'set' accessor must have the same type. +!!! error TS2380: 'get' and 'set' accessor must have the same type. set x(v: A) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~~~~~~ this.data = v; ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ -!!! Type 'A' is not assignable to type 'A': -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. } ~~~~~ -!!! 'get' and 'set' accessor must have the same type. +!!! error TS2380: 'get' and 'set' accessor must have the same type. } var x = new C(); diff --git a/tests/baselines/reference/getEmitOutputDeclarationMultiFiles.baseline b/tests/baselines/reference/getEmitOutputDeclarationMultiFiles.baseline new file mode 100644 index 00000000000..4b89414059c --- /dev/null +++ b/tests/baselines/reference/getEmitOutputDeclarationMultiFiles.baseline @@ -0,0 +1,30 @@ +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile1.js +var x = 5; +var Bar = (function () { + function Bar() { + } + return Bar; +})(); +Filename : tests/cases/fourslash/inputFile1.d.ts +declare var x: number; +declare class Bar { + x: string; + y: number; +} + +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile2.js +var x1 = "hello world"; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +Filename : tests/cases/fourslash/inputFile2.d.ts +declare var x1: string; +declare class Foo { + x: string; + y: number; +} + diff --git a/tests/baselines/reference/getEmitOutputDeclarationSingleFile.baseline b/tests/baselines/reference/getEmitOutputDeclarationSingleFile.baseline new file mode 100644 index 00000000000..545c37a0728 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputDeclarationSingleFile.baseline @@ -0,0 +1,26 @@ +EmitOutputStatus : Succeeded +Filename : declSingleFile.js +var x = 5; +var Bar = (function () { + function Bar() { + } + return Bar; +})(); +var x1 = "hello world"; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +Filename : declSingleFile.d.ts +declare var x: number; +declare class Bar { + x: string; + y: number; +} +declare var x1: string; +declare class Foo { + x: string; + y: number; +} + diff --git a/tests/baselines/reference/getEmitOutputExternalModule.baseline b/tests/baselines/reference/getEmitOutputExternalModule.baseline new file mode 100644 index 00000000000..33360cbed61 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputExternalModule.baseline @@ -0,0 +1,9 @@ +EmitOutputStatus : Succeeded +Filename : declSingleFile.js +var x = 5; +var Bar = (function () { + function Bar() { + } + return Bar; +})(); + diff --git a/tests/baselines/reference/getEmitOutputExternalModule2.baseline b/tests/baselines/reference/getEmitOutputExternalModule2.baseline new file mode 100644 index 00000000000..ede5474d8cc --- /dev/null +++ b/tests/baselines/reference/getEmitOutputExternalModule2.baseline @@ -0,0 +1,15 @@ +EmitOutputStatus : JSGeneratedWithSemanticErrors +Filename : declSingleFile.js +var x = 5; +var Bar = (function () { + function Bar() { + } + return Bar; +})(); +var x = "world"; +var Bar2 = (function () { + function Bar2() { + } + return Bar2; +})(); + diff --git a/tests/baselines/reference/getEmitOutputMapRoots.baseline b/tests/baselines/reference/getEmitOutputMapRoots.baseline new file mode 100644 index 00000000000..93dab28e6fc --- /dev/null +++ b/tests/baselines/reference/getEmitOutputMapRoots.baseline @@ -0,0 +1,11 @@ +EmitOutputStatus : Succeeded +Filename : declSingleFile.js.map +{"version":3,"file":"declSingleFile.js","sourceRoot":"","sources":["../tests/cases/fourslash/inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}Filename : declSingleFile.js +var x = 109; +var foo = "hello world"; +var M = (function () { + function M() { + } + return M; +})(); +//# sourceMappingURL=mapRootDir/declSingleFile.js.map diff --git a/tests/baselines/reference/getEmitOutputNoErrors.baseline b/tests/baselines/reference/getEmitOutputNoErrors.baseline new file mode 100644 index 00000000000..47ba1435319 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputNoErrors.baseline @@ -0,0 +1,9 @@ +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile.js +var x; +var M = (function () { + function M() { + } + return M; +})(); + diff --git a/tests/baselines/reference/getEmitOutputOnlyOneFile.baseline b/tests/baselines/reference/getEmitOutputOnlyOneFile.baseline new file mode 100644 index 00000000000..1f61d57c81e --- /dev/null +++ b/tests/baselines/reference/getEmitOutputOnlyOneFile.baseline @@ -0,0 +1,9 @@ +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile2.js +var x; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); + diff --git a/tests/baselines/reference/getEmitOutputSingleFile.baseline b/tests/baselines/reference/getEmitOutputSingleFile.baseline new file mode 100644 index 00000000000..dd8f2be8079 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputSingleFile.baseline @@ -0,0 +1,15 @@ +EmitOutputStatus : Succeeded +Filename : outputDir/singleFile.js +var x; +var Bar = (function () { + function Bar() { + } + return Bar; +})(); +var x; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); + diff --git a/tests/baselines/reference/getEmitOutputSingleFile2.baseline b/tests/baselines/reference/getEmitOutputSingleFile2.baseline new file mode 100644 index 00000000000..2f5dbe3daf8 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputSingleFile2.baseline @@ -0,0 +1,8 @@ +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile3.js +exports.foo = 10; +exports.bar = "hello world"; +Filename : tests/cases/fourslash/inputFile3.d.ts +export declare var foo: number; +export declare var bar: string; + diff --git a/tests/baselines/reference/getEmitOutputSourceMap.baseline b/tests/baselines/reference/getEmitOutputSourceMap.baseline new file mode 100644 index 00000000000..75ee2a26617 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputSourceMap.baseline @@ -0,0 +1,11 @@ +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile.js.map +{"version":3,"file":"inputFile.js","sourceRoot":"","sources":["inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}Filename : tests/cases/fourslash/inputFile.js +var x = 109; +var foo = "hello world"; +var M = (function () { + function M() { + } + return M; +})(); +//# sourceMappingURL=inputFile.js.map diff --git a/tests/baselines/reference/getEmitOutputSourceMap2.baseline b/tests/baselines/reference/getEmitOutputSourceMap2.baseline new file mode 100644 index 00000000000..2c132d8cd66 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputSourceMap2.baseline @@ -0,0 +1,19 @@ +EmitOutputStatus : Succeeded +Filename : sample/outDir/inputFile1.js.map +{"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile1.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}Filename : sample/outDir/inputFile1.js +var x = 109; +var foo = "hello world"; +var M = (function () { + function M() { + } + return M; +})(); +//# sourceMappingURL=inputFile1.js.map +EmitOutputStatus : Succeeded +Filename : sample/outDir/inputFile2.js.map +{"version":3,"file":"inputFile2.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,aAAa,CAAC;AAC1B,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;IACvB,IAAI,CAAC,GAAG,EAAE,CAAC;AACd,CAAC"}Filename : sample/outDir/inputFile2.js +var intro = "hello world"; +if (intro !== undefined) { + var k = 10; +} +//# sourceMappingURL=inputFile2.js.map diff --git a/tests/baselines/reference/getEmitOutputSourceRoot.baseline b/tests/baselines/reference/getEmitOutputSourceRoot.baseline new file mode 100644 index 00000000000..9252163165b --- /dev/null +++ b/tests/baselines/reference/getEmitOutputSourceRoot.baseline @@ -0,0 +1,11 @@ +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile.js.map +{"version":3,"file":"inputFile.js","sourceRoot":"sourceRootDir/","sources":["inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}Filename : tests/cases/fourslash/inputFile.js +var x = 109; +var foo = "hello world"; +var M = (function () { + function M() { + } + return M; +})(); +//# sourceMappingURL=inputFile.js.map diff --git a/tests/baselines/reference/getEmitOutputSourceRootMultiFiles.baseline b/tests/baselines/reference/getEmitOutputSourceRootMultiFiles.baseline new file mode 100644 index 00000000000..5c26a1920f9 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputSourceRootMultiFiles.baseline @@ -0,0 +1,21 @@ +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile1.js.map +{"version":3,"file":"inputFile1.js","sourceRoot":"sourceRootDir/","sources":["inputFile1.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}Filename : tests/cases/fourslash/inputFile1.js +var x = 109; +var foo = "hello world"; +var M = (function () { + function M() { + } + return M; +})(); +//# sourceMappingURL=inputFile1.js.map +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile2.js.map +{"version":3,"file":"inputFile2.js","sourceRoot":"sourceRootDir/","sources":["inputFile2.ts"],"names":["C","C.constructor"],"mappings":"AAAA,IAAI,GAAG,GAAG,wBAAwB,CAAC;AACnC,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}Filename : tests/cases/fourslash/inputFile2.js +var bar = "hello world Typescript"; +var C = (function () { + function C() { + } + return C; +})(); +//# sourceMappingURL=inputFile2.js.map diff --git a/tests/baselines/reference/getEmitOutputWithDeclarationFile.baseline b/tests/baselines/reference/getEmitOutputWithDeclarationFile.baseline new file mode 100644 index 00000000000..be0ac935601 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputWithDeclarationFile.baseline @@ -0,0 +1,11 @@ +EmitOutputStatus : Succeeded + +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile2.js +var x1 = "hello world"; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); + diff --git a/tests/baselines/reference/getEmitOutputWithDeclarationFile2.baseline b/tests/baselines/reference/getEmitOutputWithDeclarationFile2.baseline new file mode 100644 index 00000000000..92a1ea1fe7a --- /dev/null +++ b/tests/baselines/reference/getEmitOutputWithDeclarationFile2.baseline @@ -0,0 +1,15 @@ +EmitOutputStatus : Succeeded + +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile2.js +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +exports.Foo = Foo; + +EmitOutputStatus : Succeeded +Filename : tests/cases/fourslash/inputFile3.js +var x = "hello"; + diff --git a/tests/baselines/reference/getEmitOutputWithDeclarationFile3.baseline b/tests/baselines/reference/getEmitOutputWithDeclarationFile3.baseline new file mode 100644 index 00000000000..f960a05f151 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputWithDeclarationFile3.baseline @@ -0,0 +1,5 @@ +EmitOutputStatus : Succeeded +Filename : declSingle.js +var x = "hello"; +var x1 = 1000; + diff --git a/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline b/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline new file mode 100644 index 00000000000..f16e3810592 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputWithEmitterErrors.baseline @@ -0,0 +1,12 @@ +EmitOutputStatus : EmitErrorsEncountered +Filename : tests/cases/fourslash/inputFile.js +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + M.foo = new C(); +})(M || (M = {})); + diff --git a/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline b/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline new file mode 100644 index 00000000000..4befff0466c --- /dev/null +++ b/tests/baselines/reference/getEmitOutputWithEmitterErrors2.baseline @@ -0,0 +1,14 @@ +EmitOutputStatus : EmitErrorsEncountered +Filename : tests/cases/fourslash/inputFile.js +define(["require", "exports"], function (require, exports) { + var C = (function () { + function C() { + } + return C; + })(); + var M; + (function (M) { + M.foo = new C(); + })(M = exports.M || (exports.M = {})); +}); + diff --git a/tests/baselines/reference/getEmitOutputWithSemanticErrors.baseline b/tests/baselines/reference/getEmitOutputWithSemanticErrors.baseline new file mode 100644 index 00000000000..fed9a4d2089 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputWithSemanticErrors.baseline @@ -0,0 +1,4 @@ +EmitOutputStatus : JSGeneratedWithSemanticErrors +Filename : tests/cases/fourslash/inputFile.js +var x = "hello world"; + diff --git a/tests/baselines/reference/getEmitOutputWithSemanticErrors2.baseline b/tests/baselines/reference/getEmitOutputWithSemanticErrors2.baseline new file mode 100644 index 00000000000..a2e296b85e2 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputWithSemanticErrors2.baseline @@ -0,0 +1,4 @@ +EmitOutputStatus : DeclarationGenerationSkipped +Filename : tests/cases/fourslash/inputFile.js +var x = "hello world"; + diff --git a/tests/baselines/reference/getEmitOutputWithSyntaxErrors.baseline b/tests/baselines/reference/getEmitOutputWithSyntaxErrors.baseline new file mode 100644 index 00000000000..a5d5d2eb9d7 --- /dev/null +++ b/tests/baselines/reference/getEmitOutputWithSyntaxErrors.baseline @@ -0,0 +1,2 @@ +EmitOutputStatus : AllOutputGenerationSkipped + diff --git a/tests/baselines/reference/getsetReturnTypes.errors.txt b/tests/baselines/reference/getsetReturnTypes.errors.txt index 8b9b68e87cc..2a69548c7aa 100644 --- a/tests/baselines/reference/getsetReturnTypes.errors.txt +++ b/tests/baselines/reference/getsetReturnTypes.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/getsetReturnTypes.ts(3,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/getsetReturnTypes.ts (1 errors) ==== function makePoint(x: number) { return { get x() { return x; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } }; var x = makePoint(2).x; diff --git a/tests/baselines/reference/getterMissingReturnError.errors.txt b/tests/baselines/reference/getterMissingReturnError.errors.txt index ae560c5de87..8900cc5e78f 100644 --- a/tests/baselines/reference/getterMissingReturnError.errors.txt +++ b/tests/baselines/reference/getterMissingReturnError.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/getterMissingReturnError.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getterMissingReturnError.ts(2,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. + + ==== tests/cases/compiler/getterMissingReturnError.ts (2 errors) ==== class test { public get p2(){ ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. } } diff --git a/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.errors.txt b/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.errors.txt index 8b1a7a10a3a..563f30a201c 100644 --- a/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.errors.txt +++ b/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/getterThatThrowsShouldNotNeedReturn.ts(2,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/getterThatThrowsShouldNotNeedReturn.ts (1 errors) ==== class Greeter { public get greet(): string { ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. throw ''; // should not raise an error } public greeting(): string { diff --git a/tests/baselines/reference/gettersAndSetters.errors.txt b/tests/baselines/reference/gettersAndSetters.errors.txt index c17653545fa..2c287f30497 100644 --- a/tests/baselines/reference/gettersAndSetters.errors.txt +++ b/tests/baselines/reference/gettersAndSetters.errors.txt @@ -1,3 +1,13 @@ +tests/cases/compiler/gettersAndSetters.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSetters.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSetters.ts(10,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSetters.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSetters.ts(29,30): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSetters.ts(29,53): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSetters.ts(25,13): error TS2339: Property 'Baz' does not exist on type 'C'. +tests/cases/compiler/gettersAndSetters.ts(26,3): error TS2339: Property 'Baz' does not exist on type 'C'. + + ==== tests/cases/compiler/gettersAndSetters.ts (8 errors) ==== // classes class C { @@ -7,17 +17,17 @@ public get Foo() { return this.fooBack;} // ok ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set Foo(foo:string) {this.fooBack = foo;} // ok ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static get Bar() {return C.barBack;} // ok ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. static set Bar(bar:string) {C.barBack = bar;} // ok ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get = function() {} // ok public set = function() {} // ok @@ -33,17 +43,17 @@ var baz = c.Baz; ~~~ -!!! Property 'Baz' does not exist on type 'C'. +!!! error TS2339: Property 'Baz' does not exist on type 'C'. c.Baz = "bazv"; ~~~ -!!! Property 'Baz' does not exist on type 'C'. +!!! error TS2339: Property 'Baz' does not exist on type 'C'. // The Foo accessors' return and param types should be contextually typed to the Foo field var o : {Foo:number;} = {get Foo() {return 0;}, set Foo(val:number){val}}; // o ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var ofg = o.Foo; o.Foo = 0; diff --git a/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt b/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt index df23e0da362..ddb8e95e5eb 100644 --- a/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt +++ b/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt @@ -1,14 +1,20 @@ +tests/cases/compiler/gettersAndSettersAccessibility.ts(2,14): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersAccessibility.ts(3,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersAccessibility.ts(2,14): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/compiler/gettersAndSettersAccessibility.ts(3,13): error TS2379: Getter and setter accessors do not agree in visibility. + + ==== tests/cases/compiler/gettersAndSettersAccessibility.ts (4 errors) ==== class C99 { private get Baz():number { return 0; } ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Getter and setter accessors do not agree in visibility. +!!! error TS2379: Getter and setter accessors do not agree in visibility. public set Baz(n:number) {} // error - accessors do not agree in visibility ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Getter and setter accessors do not agree in visibility. +!!! error TS2379: Getter and setter accessors do not agree in visibility. } \ No newline at end of file diff --git a/tests/baselines/reference/gettersAndSettersErrors.errors.txt b/tests/baselines/reference/gettersAndSettersErrors.errors.txt index 1cfefea5202..95fb571d9b8 100644 --- a/tests/baselines/reference/gettersAndSettersErrors.errors.txt +++ b/tests/baselines/reference/gettersAndSettersErrors.errors.txt @@ -1,34 +1,51 @@ -==== tests/cases/compiler/gettersAndSettersErrors.ts (9 errors) ==== +tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersErrors.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersErrors.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersErrors.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2300: Duplicate identifier 'Foo'. +tests/cases/compiler/gettersAndSettersErrors.ts(11,17): error TS2379: Getter and setter accessors do not agree in visibility. +tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS2379: Getter and setter accessors do not agree in visibility. + + +==== tests/cases/compiler/gettersAndSettersErrors.ts (11 errors) ==== class C { public get Foo() { return "foo";} // ok ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'Foo'. public set Foo(foo:string) {} // ok ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'Foo'. public Foo = 0; // error - duplicate identifier Foo - confirmed ~~~ -!!! Duplicate identifier 'Foo'. +!!! error TS2300: Duplicate identifier 'Foo'. public get Goo(v:string):string {return null;} // error - getters must not have a parameter ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set Goo(v:string):string {} // error - setters must not specify a return type ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } class E { private get Baz():number { return 0; } ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Getter and setter accessors do not agree in visibility. +!!! error TS2379: Getter and setter accessors do not agree in visibility. public set Baz(n:number) {} // error - accessors do not agree in visibility ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Getter and setter accessors do not agree in visibility. +!!! error TS2379: Getter and setter accessors do not agree in visibility. } diff --git a/tests/baselines/reference/gettersAndSettersTypesAgree.errors.txt b/tests/baselines/reference/gettersAndSettersTypesAgree.errors.txt index 5b869132a70..7412b56e576 100644 --- a/tests/baselines/reference/gettersAndSettersTypesAgree.errors.txt +++ b/tests/baselines/reference/gettersAndSettersTypesAgree.errors.txt @@ -1,27 +1,37 @@ +tests/cases/compiler/gettersAndSettersTypesAgree.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersTypesAgree.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersTypesAgree.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersTypesAgree.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersTypesAgree.ts(9,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersTypesAgree.ts(9,37): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersTypesAgree.ts(10,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/gettersAndSettersTypesAgree.ts(10,37): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/gettersAndSettersTypesAgree.ts (8 errors) ==== class C { public get Foo() { return "foo";} // ok ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set Foo(foo) {} // ok - type inferred from getter return statement ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get Bar() { return "foo";} // ok ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set Bar(bar:string) {} // ok - type must be declared ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } var o1 = {get Foo(){return 0;}, set Foo(val){}}; // ok - types agree (inference) ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var o2 = {get Foo(){return 0;}, set Foo(val:number){}}; // ok - types agree ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. \ No newline at end of file +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/giant.errors.txt b/tests/baselines/reference/giant.errors.txt index 9f15a5061a3..767c419952c 100644 --- a/tests/baselines/reference/giant.errors.txt +++ b/tests/baselines/reference/giant.errors.txt @@ -1,4 +1,268 @@ -==== tests/cases/compiler/giant.ts (227 errors) ==== +tests/cases/compiler/giant.ts(24,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(26,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(28,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(30,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(34,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(61,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(62,5): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(63,6): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(88,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(90,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(92,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(94,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(98,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(100,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(125,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(126,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(127,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(154,39): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(167,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(169,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(171,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(173,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(177,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(179,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(204,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(205,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(206,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(233,39): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(238,35): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(240,24): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(243,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(244,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(245,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(246,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(247,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(248,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(249,23): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(250,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(251,32): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(252,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(254,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(255,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(256,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(257,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(258,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(262,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(262,25): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(267,30): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(267,33): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(282,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(284,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(286,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(288,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(292,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(294,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(319,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(320,5): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(321,6): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(346,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(348,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(350,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(352,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(356,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(358,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(383,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(384,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(385,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(412,39): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(425,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(427,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(429,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(431,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(435,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(437,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(462,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(463,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(464,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(491,39): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(496,35): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(498,24): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(501,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(502,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(503,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(504,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(505,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(506,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(507,23): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(508,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(509,32): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(510,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(512,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(513,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(514,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(515,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(516,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(520,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(520,25): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(525,30): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(525,33): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(532,31): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(534,20): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(537,17): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(538,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(539,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(540,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(541,27): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(542,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(543,19): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(544,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(545,28): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(546,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(548,17): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(549,27): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(550,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(551,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(552,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(556,18): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(556,21): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(558,24): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(561,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(563,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(587,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(588,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(589,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(606,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(606,25): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(611,30): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(611,33): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(615,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/giant.ts(616,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/giant.ts(616,42): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(617,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/giant.ts(618,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +tests/cases/compiler/giant.ts(621,26): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(621,29): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(623,24): error TS1111: A constructor implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(626,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(628,21): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(653,10): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/giant.ts(654,9): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/giant.ts(655,10): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/giant.ts(672,22): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(672,25): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(676,30): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/giant.ts(676,33): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/giant.ts(23,12): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(24,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(25,12): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(26,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(27,13): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(28,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(29,13): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(30,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(33,12): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(34,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(35,12): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(36,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(76,5): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(87,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(88,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(89,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(90,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(91,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(92,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(93,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(94,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(97,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(98,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(99,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(100,20): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(140,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(166,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(167,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(168,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(169,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(170,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(171,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(172,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(173,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(176,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(177,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(178,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(179,20): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(219,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(245,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(246,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(247,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(248,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(249,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(250,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(251,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(252,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(255,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(256,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(257,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(258,20): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(281,12): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(282,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(283,12): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(284,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(285,13): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(286,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(287,13): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(288,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(291,12): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(292,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(293,12): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(294,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(334,5): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(345,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(346,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(347,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(348,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(349,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(350,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(351,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(352,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(355,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(356,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(357,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(358,20): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(398,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(424,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(425,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(426,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(427,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(428,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(429,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(430,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(431,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(434,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(435,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(436,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(437,20): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(477,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(503,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(504,20): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(505,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(506,20): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(507,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(508,21): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(509,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(510,21): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(513,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(514,20): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(515,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(516,20): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(539,12): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(540,16): error TS2300: Duplicate identifier 'pgF'. +tests/cases/compiler/giant.ts(541,12): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(542,16): error TS2300: Duplicate identifier 'psF'. +tests/cases/compiler/giant.ts(543,13): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(544,17): error TS2300: Duplicate identifier 'rgF'. +tests/cases/compiler/giant.ts(545,13): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(546,17): error TS2300: Duplicate identifier 'rsF'. +tests/cases/compiler/giant.ts(549,12): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(550,16): error TS2300: Duplicate identifier 'tsF'. +tests/cases/compiler/giant.ts(551,12): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(552,16): error TS2300: Duplicate identifier 'tgF'. +tests/cases/compiler/giant.ts(602,9): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all be optional or required. + + +==== tests/cases/compiler/giant.ts (262 errors) ==== /* Prefixes @@ -22,50 +286,56 @@ public pF() { } private rF() { } public pgF() { } + ~~~ +!!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ -!!! Duplicate identifier 'psF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ -!!! Duplicate identifier 'rsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! '{' expected. static tF() { } static tsF(param:any) { } + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ -!!! Duplicate identifier 'tsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! '{' expected. interface I { //Call Signature (); @@ -91,13 +361,13 @@ //Index Signature [p]; ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -112,7 +382,7 @@ p7(pa1, pa2): void; p7? (pa1, pa2): void; ~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. } module M { var V; @@ -124,50 +394,56 @@ public pF() { } private rF() { } public pgF() { } + ~~~ +!!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ -!!! Duplicate identifier 'psF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ -!!! Duplicate identifier 'rsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! '{' expected. static tF() { } static tsF(param:any) { } + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ -!!! Duplicate identifier 'tsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! '{' expected. interface I { //Call Signature (); @@ -193,13 +469,13 @@ //Index Signature [p]; ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -214,7 +490,7 @@ p7(pa1, pa2): void; p7? (pa1, pa2): void; ~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. } module M { var V; @@ -230,7 +506,7 @@ export declare var eaV; export declare function eaF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { }; export declare module eaM { }; } @@ -243,50 +519,56 @@ public pF() { } private rF() { } public pgF() { } + ~~~ +!!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ -!!! Duplicate identifier 'psF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ -!!! Duplicate identifier 'rsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! '{' expected. static tF() { } static tsF(param:any) { } + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ -!!! Duplicate identifier 'tsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! '{' expected. export interface eI { //Call Signature (); @@ -312,13 +594,13 @@ //Index Signature [p]; ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -333,7 +615,7 @@ p7(pa1, pa2): void; p7? (pa1, pa2): void; ~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. } export module eM { var V; @@ -349,95 +631,107 @@ export declare var eaV; export declare function eaF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { }; export declare module eaM { }; } export declare var eaV; export declare function eaF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { constructor () { } ~ -!!! A constructor implementation cannot be declared in an ambient context. +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. public pV; private rV; public pF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. private rF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. public pgF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'pgF'. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'psF'. +!!! error TS2300: Duplicate identifier 'psF'. private rgF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'rgF'. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'rsF'. +!!! error TS2300: Duplicate identifier 'rsF'. static tV; static tF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. static tsF(param:any) { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'tsF'. +!!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'tgF'. +!!! error TS2300: Duplicate identifier 'tgF'. } export declare module eaM { var V; function F() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. class C { } interface I { } module M { } export var eV; export function eF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. export class eC { } export interface eI { } export module eM { } @@ -452,50 +746,56 @@ public pF() { } private rF() { } public pgF() { } + ~~~ +!!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ -!!! Duplicate identifier 'psF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ -!!! Duplicate identifier 'rsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! '{' expected. static tF() { } static tsF(param:any) { } + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ -!!! Duplicate identifier 'tsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! '{' expected. export interface eI { //Call Signature (); @@ -521,13 +821,13 @@ //Index Signature [p]; ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -542,7 +842,7 @@ p7(pa1, pa2): void; p7? (pa1, pa2): void; ~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. } export module eM { var V; @@ -554,50 +854,56 @@ public pF() { } private rF() { } public pgF() { } + ~~~ +!!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ -!!! Duplicate identifier 'psF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ -!!! Duplicate identifier 'rsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! '{' expected. static tF() { } static tsF(param:any) { } + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ -!!! Duplicate identifier 'tsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! '{' expected. interface I { //Call Signature (); @@ -623,13 +929,13 @@ //Index Signature [p]; ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -644,7 +950,7 @@ p7(pa1, pa2): void; p7? (pa1, pa2): void; ~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. } module M { var V; @@ -660,7 +966,7 @@ export declare var eaV; export declare function eaF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { }; export declare module eaM { }; } @@ -673,50 +979,56 @@ public pF() { } private rF() { } public pgF() { } + ~~~ +!!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ -!!! Duplicate identifier 'psF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ -!!! Duplicate identifier 'rsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! '{' expected. static tF() { } static tsF(param:any) { } + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ -!!! Duplicate identifier 'tsF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! '{' expected. + ~~~ +!!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! '{' expected. export interface eI { //Call Signature (); @@ -742,13 +1054,13 @@ //Index Signature [p]; ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -763,7 +1075,7 @@ p7(pa1, pa2): void; p7? (pa1, pa2): void; ~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. } export module eM { var V; @@ -779,95 +1091,107 @@ export declare var eaV; export declare function eaF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { }; export declare module eaM { }; } export declare var eaV; export declare function eaF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { constructor () { } ~ -!!! A constructor implementation cannot be declared in an ambient context. +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. public pV; private rV; public pF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. private rF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. public pgF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'pgF'. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'psF'. +!!! error TS2300: Duplicate identifier 'psF'. private rgF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'rgF'. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'rsF'. +!!! error TS2300: Duplicate identifier 'rsF'. static tV; static tF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. static tsF(param:any) { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'tsF'. +!!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'tgF'. +!!! error TS2300: Duplicate identifier 'tgF'. } export declare module eaM { var V; function F() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. class C { } interface I { } module M { } export var eV; export function eF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. export class eC { } export interface eI { } export module eM { } @@ -876,92 +1200,104 @@ export declare var eaV; export declare function eaF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. export declare class eaC { constructor () { } ~ -!!! A constructor implementation cannot be declared in an ambient context. +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. public pV; private rV; public pF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. private rF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. public pgF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'pgF'. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'psF'. +!!! error TS2300: Duplicate identifier 'psF'. private rgF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'rgF'. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'rsF'. +!!! error TS2300: Duplicate identifier 'rsF'. static tV; static tF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. static tsF(param:any) { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'tsF'. +!!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~ +!!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! Duplicate identifier 'tgF'. +!!! error TS2300: Duplicate identifier 'tgF'. } export declare module eaM { var V; function F() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. class C { constructor () { } ~ -!!! A constructor implementation cannot be declared in an ambient context. +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. public pV; private rV; public pF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. static tV; static tF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. } interface I { //Call Signature @@ -987,13 +1323,13 @@ //Index Signature [p]; ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -1008,63 +1344,61 @@ p7(pa1, pa2): void; p7? (pa1, pa2): void; ~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. } module M { var V; function F() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. class C { } interface I { } module M { } export var eV; export function eF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. export class eC { } export interface eI { } export module eM { } export declare var eaV ~~~~~~~ -!!! A 'declare' modifier cannot be used in an already ambient context. +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. export declare function eaF() { }; ~~~~~~~ -!!! A 'declare' modifier cannot be used in an already ambient context. - ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. export declare class eaC { } ~~~~~~~ -!!! A 'declare' modifier cannot be used in an already ambient context. +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. export declare module eaM { } ~~~~~~~ -!!! A 'declare' modifier cannot be used in an already ambient context. +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. } export var eV; export function eF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. export class eC { constructor () { } ~ -!!! A constructor implementation cannot be declared in an ambient context. +!!! error TS1111: A constructor implementation cannot be declared in an ambient context. public pV; private rV; public pF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. static tV static tF() { } ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. } export interface eI { //Call Signature @@ -1091,13 +1425,13 @@ //Index Signature [p]; ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. //Property Signature p; @@ -1112,23 +1446,23 @@ p7(pa1, pa2): void; p7? (pa1, pa2): void; ~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. } export module eM { var V; function F() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. class C { } module M { } export var eV; export function eF() { }; ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. export class eC { } export interface eI { } export module eM { } diff --git a/tests/baselines/reference/grammarAmbiguities.errors.txt b/tests/baselines/reference/grammarAmbiguities.errors.txt index ac6cadc92e4..3d21f10de7b 100644 --- a/tests/baselines/reference/grammarAmbiguities.errors.txt +++ b/tests/baselines/reference/grammarAmbiguities.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts(8,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts(9,1): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts (2 errors) ==== function f(n: any) { return null; } function g(x: any) { return null; } @@ -8,9 +12,9 @@ f(g(7)); f(g < A, B > 7); // Should error ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. f(g < A, B > +(7)); // Should error ~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/grammarAmbiguities1.errors.txt b/tests/baselines/reference/grammarAmbiguities1.errors.txt index 0c52ec2c98a..12df5f3c1e0 100644 --- a/tests/baselines/reference/grammarAmbiguities1.errors.txt +++ b/tests/baselines/reference/grammarAmbiguities1.errors.txt @@ -1,3 +1,11 @@ +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(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'. + + ==== tests/cases/compiler/grammarAmbiguities1.ts (6 errors) ==== class A { foo() { } } class B { bar() { }} @@ -8,16 +16,16 @@ f(g(7)); f(g < A, B > 7); ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. ~~~~~ -!!! Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. +!!! error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. ~~~~~ -!!! Operator '>' cannot be applied to types 'typeof B' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. f(g < A, B > +(7)); ~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. ~~~~~ -!!! Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. +!!! error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. ~~~~~~~~ -!!! Operator '>' cannot be applied to types 'typeof B' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 0eaf7593c56..e5c2be7a598 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string[]'. + Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (1 errors) ==== class arrTest { test(arg1: number[]); @@ -9,7 +14,8 @@ this.test([]); this.test([1, 2, "hi", 5]); // Error ~~~~~~~~~~~~~~~ -!!! Argument of type '{}[]' is not assignable to parameter of type 'string[]'. -!!! Type '{}' is not assignable to type 'string'. +!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string[]'. +!!! error TS2345: Type 'string | number' is not assignable to type 'string'. +!!! error TS2345: Type 'number' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.types b/tests/baselines/reference/heterogeneousArrayLiterals.types index 81770731633..7ea7d4196a6 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.types +++ b/tests/baselines/reference/heterogeneousArrayLiterals.types @@ -2,16 +2,16 @@ // type of an array is the best common type of its elements (plus its contextual type if it exists) var a = [1, '']; // {}[] ->a : {}[] ->[1, ''] : {}[] +>a : (string | number)[] +>[1, ''] : (string | number)[] var b = [1, null]; // number[] >b : number[] >[1, null] : number[] var c = [1, '', null]; // {}[] ->c : {}[] ->[1, '', null] : {}[] +>c : (string | number)[] +>[1, '', null] : (string | number)[] var d = [{}, 1]; // {}[] >d : {}[] @@ -31,8 +31,8 @@ var f = [[], [1]]; // number[][] >[1] : number[] var g = [[1], ['']]; // {}[] ->g : {}[] ->[[1], ['']] : {}[] +>g : (string[] | number[])[] +>[[1], ['']] : (string[] | number[])[] >[1] : number[] >[''] : string[] @@ -46,8 +46,8 @@ var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] >foo : number var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] ->i : {}[] ->[{ foo: 1, bar: '' }, { foo: '' }] : {}[] +>i : ({ foo: number; bar: string; } | { foo: string; })[] +>[{ foo: 1, bar: '' }, { foo: '' }] : ({ foo: number; bar: string; } | { foo: string; })[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number >bar : string @@ -55,36 +55,36 @@ var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] >foo : string var j = [() => 1, () => '']; // {}[] ->j : {}[] ->[() => 1, () => ''] : {}[] +>j : ((() => number) | (() => string))[] +>[() => 1, () => ''] : ((() => number) | (() => string))[] >() => 1 : () => number >() => '' : () => string var k = [() => 1, () => 1]; // { (): number }[] ->k : { (): number; }[] ->[() => 1, () => 1] : { (): number; }[] +>k : (() => number)[] +>[() => 1, () => 1] : (() => number)[] >() => 1 : () => number >() => 1 : () => number var l = [() => 1, () => null]; // { (): any }[] ->l : { (): any; }[] ->[() => 1, () => null] : { (): any; }[] +>l : (() => any)[] +>[() => 1, () => null] : (() => any)[] >() => 1 : () => number >() => null : () => any var m = [() => 1, () => '', () => null]; // { (): any }[] ->m : { (): any; }[] ->[() => 1, () => '', () => null] : { (): any; }[] +>m : (() => any)[] +>[() => 1, () => '', () => null] : (() => any)[] >() => 1 : () => number >() => '' : () => string >() => null : () => any var n = [[() => 1], [() => '']]; // {}[] ->n : {}[] ->[[() => 1], [() => '']] : {}[] ->[() => 1] : { (): number; }[] +>n : ((() => number)[] | (() => string)[])[] +>[[() => 1], [() => '']] : ((() => number)[] | (() => string)[])[] +>[() => 1] : (() => number)[] >() => 1 : () => number ->[() => ''] : { (): string; }[] +>[() => ''] : (() => string)[] >() => '' : () => string class Base { foo: string; } @@ -129,8 +129,8 @@ module Derived { >base : Base var i = [{ foo: base, basear: derived }, { foo: derived }]; // {foo: Derived}[] ->i : {}[] ->[{ foo: base, basear: derived }, { foo: derived }] : {}[] +>i : ({ foo: Base; basear: Derived; } | { foo: Derived; })[] +>[{ foo: base, basear: derived }, { foo: derived }] : ({ foo: Base; basear: Derived; } | { foo: Derived; })[] >{ foo: base, basear: derived } : { foo: Base; basear: Derived; } >foo : Base >base : Base @@ -141,30 +141,30 @@ module Derived { >derived : Derived var j = [() => base, () => derived]; // { {}: Base } ->j : { (): Base; }[] ->[() => base, () => derived] : { (): Base; }[] +>j : (() => Base)[] +>[() => base, () => derived] : (() => Base)[] >() => base : () => Base >base : Base >() => derived : () => Derived >derived : Derived var k = [() => base, () => 1]; // {}[]~ ->k : {}[] ->[() => base, () => 1] : {}[] +>k : ((() => Base) | (() => number))[] +>[() => base, () => 1] : ((() => Base) | (() => number))[] >() => base : () => Base >base : Base >() => 1 : () => number var l = [() => base, () => null]; // { (): any }[] ->l : { (): any; }[] ->[() => base, () => null] : { (): any; }[] +>l : (() => any)[] +>[() => base, () => null] : (() => any)[] >() => base : () => Base >base : Base >() => null : () => any var m = [() => base, () => derived, () => null]; // { (): any }[] ->m : { (): any; }[] ->[() => base, () => derived, () => null] : { (): any; }[] +>m : (() => any)[] +>[() => base, () => derived, () => null] : (() => any)[] >() => base : () => Base >base : Base >() => derived : () => Derived @@ -172,18 +172,18 @@ module Derived { >() => null : () => any var n = [[() => base], [() => derived]]; // { (): Base }[] ->n : { (): Base; }[][] ->[[() => base], [() => derived]] : { (): Base; }[][] ->[() => base] : { (): Base; }[] +>n : (() => Base)[][] +>[[() => base], [() => derived]] : (() => Base)[][] +>[() => base] : (() => Base)[] >() => base : () => Base >base : Base ->[() => derived] : { (): Derived; }[] +>[() => derived] : (() => Derived)[] >() => derived : () => Derived >derived : Derived var o = [derived, derived2]; // {}[] ->o : {}[] ->[derived, derived2] : {}[] +>o : (Derived | Derived2)[] +>[derived, derived2] : (Derived | Derived2)[] >derived : Derived >derived2 : Derived2 @@ -195,12 +195,12 @@ module Derived { >base : Base var q = [[() => derived2], [() => derived]]; // {}[] ->q : {}[] ->[[() => derived2], [() => derived]] : {}[] ->[() => derived2] : { (): Derived2; }[] +>q : ((() => Derived2)[] | (() => Derived)[])[] +>[[() => derived2], [() => derived]] : ((() => Derived2)[] | (() => Derived)[])[] +>[() => derived2] : (() => Derived2)[] >() => derived2 : () => Derived2 >derived2 : Derived2 ->[() => derived] : { (): Derived; }[] +>[() => derived] : (() => Derived)[] >() => derived : () => Derived >derived : Derived } @@ -212,24 +212,24 @@ module WithContextualType { var a: Base[] = [derived, derived2]; >a : Base[] >Base : Base ->[derived, derived2] : Base[] +>[derived, derived2] : (Derived | Derived2)[] >derived : Derived >derived2 : Derived2 var b: Derived[] = [null]; >b : Derived[] >Derived : Derived ->[null] : Derived[] +>[null] : null[] var c: Derived[] = []; >c : Derived[] >Derived : Derived ->[] : Derived[] +>[] : undefined[] var d: { (): Base }[] = [() => derived, () => derived2]; ->d : { (): Base; }[] +>d : (() => Base)[] >Base : Base ->[() => derived, () => derived2] : { (): Base; }[] +>[() => derived, () => derived2] : ((() => Derived) | (() => Derived2))[] >() => derived : () => Derived >derived : Derived >() => derived2 : () => Derived2 @@ -257,27 +257,27 @@ function foo(t: T, u: U) { >t : T var c = [t, u]; // {}[] ->c : {}[] ->[t, u] : {}[] +>c : (T | U)[] +>[t, u] : (T | U)[] >t : T >u : U var d = [t, 1]; // {}[] ->d : {}[] ->[t, 1] : {}[] +>d : (number | T)[] +>[t, 1] : (number | T)[] >t : T var e = [() => t, () => u]; // {}[] ->e : {}[] ->[() => t, () => u] : {}[] +>e : ((() => T) | (() => U))[] +>[() => t, () => u] : ((() => T) | (() => U))[] >() => t : () => T >t : T >() => u : () => U >u : U var f = [() => t, () => u, () => null]; // { (): any }[] ->f : { (): any; }[] ->[() => t, () => u, () => null] : { (): any; }[] +>f : (() => any)[] +>[() => t, () => u, () => null] : (() => any)[] >() => t : () => T >t : T >() => u : () => U @@ -308,27 +308,27 @@ function foo2(t: T, u: U) { >t : T var c = [t, u]; // {}[] ->c : {}[] ->[t, u] : {}[] +>c : (T | U)[] +>[t, u] : (T | U)[] >t : T >u : U var d = [t, 1]; // {}[] ->d : {}[] ->[t, 1] : {}[] +>d : (number | T)[] +>[t, 1] : (number | T)[] >t : T var e = [() => t, () => u]; // {}[] ->e : {}[] ->[() => t, () => u] : {}[] +>e : ((() => T) | (() => U))[] +>[() => t, () => u] : ((() => T) | (() => U))[] >() => t : () => T >t : T >() => u : () => U >u : U var f = [() => t, () => u, () => null]; // { (): any }[] ->f : { (): any; }[] ->[() => t, () => u, () => null] : { (): any; }[] +>f : (() => any)[] +>[() => t, () => u, () => null] : (() => any)[] >() => t : () => T >t : T >() => u : () => U @@ -342,8 +342,8 @@ function foo2(t: T, u: U) { >base : Base var h = [t, derived]; // Derived[] ->h : {}[] ->[t, derived] : {}[] +>h : (Derived | T)[] +>[t, derived] : (Derived | T)[] >t : T >derived : Derived @@ -383,27 +383,27 @@ function foo3(t: T, u: U) { >t : T var c = [t, u]; // {}[] ->c : {}[] ->[t, u] : {}[] +>c : (T | U)[] +>[t, u] : (T | U)[] >t : T >u : U var d = [t, 1]; // {}[] ->d : {}[] ->[t, 1] : {}[] +>d : (number | T)[] +>[t, 1] : (number | T)[] >t : T var e = [() => t, () => u]; // {}[] ->e : {}[] ->[() => t, () => u] : {}[] +>e : ((() => T) | (() => U))[] +>[() => t, () => u] : ((() => T) | (() => U))[] >() => t : () => T >t : T >() => u : () => U >u : U var f = [() => t, () => u, () => null]; // { (): any }[] ->f : { (): any; }[] ->[() => t, () => u, () => null] : { (): any; }[] +>f : (() => any)[] +>[() => t, () => u, () => null] : (() => any)[] >() => t : () => T >t : T >() => u : () => U @@ -458,27 +458,27 @@ function foo4(t: T, u: U) { >t : T var c = [t, u]; // BUG 821629 ->c : {}[] ->[t, u] : {}[] +>c : (T | U)[] +>[t, u] : (T | U)[] >t : T >u : U var d = [t, 1]; // {}[] ->d : {}[] ->[t, 1] : {}[] +>d : (number | T)[] +>[t, 1] : (number | T)[] >t : T var e = [() => t, () => u]; // {}[] ->e : {}[] ->[() => t, () => u] : {}[] +>e : ((() => T) | (() => U))[] +>[() => t, () => u] : ((() => T) | (() => U))[] >() => t : () => T >t : T >() => u : () => U >u : U var f = [() => t, () => u, () => null]; // { (): any }[] ->f : { (): any; }[] ->[() => t, () => u, () => null] : { (): any; }[] +>f : (() => any)[] +>[() => t, () => u, () => null] : (() => any)[] >() => t : () => T >t : T >() => u : () => U @@ -492,8 +492,8 @@ function foo4(t: T, u: U) { >base : Base var h = [t, derived]; // Derived[] ->h : {}[] ->[t, derived] : {}[] +>h : (Derived | T)[] +>[t, derived] : (Derived | T)[] >t : T >derived : Derived @@ -504,15 +504,15 @@ function foo4(t: T, u: U) { >base : Base var j = [u, derived]; // Derived[] ->j : {}[] ->[u, derived] : {}[] +>j : (Derived | U)[] +>[u, derived] : (Derived | U)[] >u : U >derived : Derived var k: Base[] = [t, u]; >k : Base[] >Base : Base ->[t, u] : Base[] +>[t, u] : (T | U)[] >t : T >u : U } diff --git a/tests/baselines/reference/i3.errors.txt b/tests/baselines/reference/i3.errors.txt index ebdf371ab36..ef7aefa4598 100644 --- a/tests/baselines/reference/i3.errors.txt +++ b/tests/baselines/reference/i3.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/i3.ts(6,1): error TS2322: Type 'I3' is not assignable to type '{ one: number; }'. + Property 'one' is optional in type 'I3' but required in type '{ one: number; }'. + + ==== tests/cases/compiler/i3.ts (1 errors) ==== interface I3 { one?: number; }; var x: {one: number}; @@ -6,5 +10,5 @@ i = x; x = i; ~ -!!! Type 'I3' is not assignable to type '{ one: number; }': -!!! Required property 'one' cannot be reimplemented with optional property in 'I3'. \ No newline at end of file +!!! error TS2322: Type 'I3' is not assignable to type '{ one: number; }'. +!!! error TS2322: Property 'one' is optional in type 'I3' but required in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt b/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt index 034bfe3026d..60239280226 100644 --- a/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt +++ b/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. +tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. +tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: string) => any'. +tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => string'. + + ==== tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts (4 errors) ==== var f: (x: T, y: U) => T; var f: (x: any, y: any) => any; @@ -5,19 +11,19 @@ var g: (x: T, y: U) => T; var g: (x: any, y: any) => any; ~ -!!! Subsequent variable declarations must have the same type. Variable 'g' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. var h: (x: T, y: U) => T; var h: (x: any, y: any) => any; ~ -!!! Subsequent variable declarations must have the same type. Variable 'h' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. var i: (x: T, y: U) => T; var i: (x: any, y: string) => any; ~ -!!! Subsequent variable declarations must have the same type. Variable 'i' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: string) => any'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: string) => any'. var j: (x: T, y: U) => T; var j: (x: any, y: any) => string; ~ -!!! Subsequent variable declarations must have the same type. Variable 'j' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => string'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/ifElseWithStatements1.errors.txt b/tests/baselines/reference/ifElseWithStatements1.errors.txt index ccadfd14ce7..186cff59241 100644 --- a/tests/baselines/reference/ifElseWithStatements1.errors.txt +++ b/tests/baselines/reference/ifElseWithStatements1.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/ifElseWithStatements1.ts(2,5): error TS2304: Cannot find name 'f'. +tests/cases/compiler/ifElseWithStatements1.ts(4,5): error TS2304: Cannot find name 'f'. + + ==== tests/cases/compiler/ifElseWithStatements1.ts (2 errors) ==== if (true) f(); ~ -!!! Cannot find name 'f'. +!!! error TS2304: Cannot find name 'f'. else f(); ~ -!!! Cannot find name 'f'. +!!! error TS2304: Cannot find name 'f'. function foo(): boolean { if (true) diff --git a/tests/baselines/reference/illegalModifiersOnClassElements.errors.txt b/tests/baselines/reference/illegalModifiersOnClassElements.errors.txt index 038d2ad7da5..eb373ad2fae 100644 --- a/tests/baselines/reference/illegalModifiersOnClassElements.errors.txt +++ b/tests/baselines/reference/illegalModifiersOnClassElements.errors.txt @@ -1,9 +1,13 @@ +tests/cases/compiler/illegalModifiersOnClassElements.ts(2,5): error TS1031: 'declare' modifier cannot appear on a class element. +tests/cases/compiler/illegalModifiersOnClassElements.ts(3,5): error TS1031: 'export' modifier cannot appear on a class element. + + ==== tests/cases/compiler/illegalModifiersOnClassElements.ts (2 errors) ==== class C { declare foo = 1; ~~~~~~~ -!!! 'declare' modifier cannot appear on a class element. +!!! error TS1031: 'declare' modifier cannot appear on a class element. export bar = 1; ~~~~~~ -!!! 'export' modifier cannot appear on a class element. +!!! error TS1031: 'export' modifier cannot appear on a class element. } \ No newline at end of file diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt b/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt index 41e124d7f14..6b86209b5b1 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt @@ -1,3 +1,13 @@ +tests/cases/compiler/illegalSuperCallsInConstructor.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/illegalSuperCallsInConstructor.ts(15,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/illegalSuperCallsInConstructor.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call. +tests/cases/compiler/illegalSuperCallsInConstructor.ts(7,24): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/compiler/illegalSuperCallsInConstructor.ts(8,26): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/compiler/illegalSuperCallsInConstructor.ts(9,32): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/compiler/illegalSuperCallsInConstructor.ts(12,17): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors +tests/cases/compiler/illegalSuperCallsInConstructor.ts(16,17): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors + + ==== tests/cases/compiler/illegalSuperCallsInConstructor.ts (8 errors) ==== class Base { x: string; @@ -9,42 +19,42 @@ var r2 = () => super(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors var r3 = () => { super(); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors var r4 = function () { super(); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors var r5 = { ~~~~~~~~~~~~~~~~~~ get foo() { ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~~~~~~~~ super(); ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors return 1; ~~~~~~~~~~~~~~~~~~~~~~~~~ }, ~~~~~~~~~~~~~~ set foo(v: number) { ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ super(); ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ -!!! Super calls are not permitted outside constructors or in nested functions inside constructors +!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } ~~~~~~~~~~~~~ } ~~~~~~~~~ } ~~~~~ -!!! Constructors for derived classes must contain a 'super' call. +!!! error TS2377: Constructors for derived classes must contain a 'super' call. } \ No newline at end of file diff --git a/tests/baselines/reference/implementClausePrecedingExtends.errors.txt b/tests/baselines/reference/implementClausePrecedingExtends.errors.txt index 997f49a9478..0ded03b0808 100644 --- a/tests/baselines/reference/implementClausePrecedingExtends.errors.txt +++ b/tests/baselines/reference/implementClausePrecedingExtends.errors.txt @@ -1,10 +1,16 @@ +tests/cases/compiler/implementClausePrecedingExtends.ts(2,22): error TS1005: '{' expected. +tests/cases/compiler/implementClausePrecedingExtends.ts(2,32): error TS1005: ';' expected. +tests/cases/compiler/implementClausePrecedingExtends.ts(2,7): error TS2420: Class 'D' incorrectly implements interface 'C'. + Property 'foo' is missing in type 'D'. + + ==== tests/cases/compiler/implementClausePrecedingExtends.ts (3 errors) ==== class C { foo: number } class D implements C extends C { } ~~~~~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Class 'D' incorrectly implements interface 'C': -!!! Property 'foo' is missing in type 'D'. \ No newline at end of file +!!! error TS2420: Class 'D' incorrectly implements interface 'C'. +!!! error TS2420: Property 'foo' is missing in type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt index 209749db465..7a128b87764 100644 --- a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt +++ b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt @@ -1,3 +1,14 @@ +tests/cases/compiler/implementGenericWithMismatchedTypes.ts(7,7): error TS2420: Class 'C' incorrectly implements interface 'IFoo'. + Types of property 'foo' are incompatible. + Type '(x: string) => number' is not assignable to type '(x: T) => T'. + Types of parameters 'x' and 'x' are incompatible. + Type 'string' is not assignable to type 'T'. +tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. + Types of property 'foo' are incompatible. + Type '(x: Tstring) => number' is not assignable to type '(x: T) => T'. + Type 'number' is not assignable to type 'T'. + + ==== tests/cases/compiler/implementGenericWithMismatchedTypes.ts (2 errors) ==== // no errors because in the derived types the best common type for T's value is Object // and that matches the original signature for assignability since we treat its T's as Object @@ -7,11 +18,11 @@ } class C implements IFoo { // error ~ -!!! Class 'C' incorrectly implements interface 'IFoo': -!!! Types of property 'foo' are incompatible: -!!! Type '(x: string) => number' is not assignable to type '(x: T) => T': -!!! Types of parameters 'x' and 'x' are incompatible: -!!! Type 'string' is not assignable to type 'T'. +!!! error TS2420: Class 'C' incorrectly implements interface 'IFoo'. +!!! error TS2420: Types of property 'foo' are incompatible. +!!! error TS2420: Type '(x: string) => number' is not assignable to type '(x: T) => T'. +!!! error TS2420: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'T'. foo(x: string): number { return null; } @@ -22,10 +33,10 @@ } class C2 implements IFoo2 { // error ~~ -!!! Class 'C2' incorrectly implements interface 'IFoo2': -!!! Types of property 'foo' are incompatible: -!!! Type '(x: Tstring) => number' is not assignable to type '(x: T) => T': -!!! Type 'number' is not assignable to type 'T'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. +!!! error TS2420: Types of property 'foo' are incompatible. +!!! error TS2420: Type '(x: Tstring) => number' is not assignable to type '(x: T) => T'. +!!! error TS2420: Type 'number' is not assignable to type 'T'. foo(x: Tstring): number { return null; } diff --git a/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt b/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt index 25ffa123d77..75d9fdcce34 100644 --- a/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt +++ b/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/implementPublicPropertyAsPrivate.ts(4,7): error TS2420: Class 'C' incorrectly implements interface 'I'. + Property 'x' is private in type 'C' but not in type 'I'. + + ==== tests/cases/compiler/implementPublicPropertyAsPrivate.ts (1 errors) ==== interface I { x: number; } class C implements I { ~ -!!! Class 'C' incorrectly implements interface 'I': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is private in type 'C' but not in type 'I'. private x = 0; // should raise error at class decl } \ No newline at end of file diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt index 22cbf1aacac..a38c477f111 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(9,7): error TS2420: Class 'Bar' incorrectly implements interface 'I'. + Property 'y' is missing in type 'Bar'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(12,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. + Property 'x' is missing in type 'Bar2'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(16,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. + Property 'x' is private in type 'I' but not in type 'Bar3'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(21,7): error TS2420: Class 'Bar4' incorrectly implements interface 'I'. + Types have separate declarations of a private property 'x'. + + ==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts (4 errors) ==== class Foo { private x: string; @@ -9,29 +19,29 @@ class Bar implements I { // error ~~~ -!!! Class 'Bar' incorrectly implements interface 'I': -!!! Property 'y' is missing in type 'Bar'. +!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar'. } class Bar2 implements I { // error ~~~~ -!!! Class 'Bar2' incorrectly implements interface 'I': -!!! Property 'x' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is missing in type 'Bar2'. y: number; } class Bar3 implements I { // error ~~~~ -!!! Class 'Bar3' incorrectly implements interface 'I': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is private in type 'I' but not in type 'Bar3'. x: string; y: number; } class Bar4 implements I { // error ~~~~ -!!! Class 'Bar4' incorrectly implements interface 'I': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'Bar4' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x: string; y: number; } \ No newline at end of file diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt index 7598e2b6132..c6c0be3896c 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt @@ -1,3 +1,33 @@ +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. + Property 'x' is private in type 'Foo' but not in type 'Bar2'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. + Property 'x' is private in type 'I' but not in type 'Bar2'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. + Types have separate declarations of a private property 'x'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. + Types have separate declarations of a private property 'x'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. + Property 'x' is private in type 'Foo' but not in type 'Bar2'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. + Property 'z' is missing in type 'Bar2'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. + Types have separate declarations of a private property 'x'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. + Property 'z' is missing in type 'Bar3'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(67,11): error TS2420: Class 'Bar' incorrectly implements interface 'I'. + Property 'y' is missing in type 'Bar'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(73,14): error TS2341: Property 'x' is private and only accessible within class 'Foo'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(74,16): error TS2339: Property 'y' does not exist on type 'Bar'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. + Property 'x' is private in type 'Foo' but not in type 'Bar2'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. + Property 'y' is missing in type 'Bar2'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. + Types have separate declarations of a private property 'x'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. + Property 'y' is missing in type 'Bar3'. + + ==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts (15 errors) ==== class Foo { private x: string; @@ -13,22 +43,22 @@ class Bar2 extends Foo implements I { // error ~~~~ -!!! Class 'Bar2' incorrectly extends base class 'Foo': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. +!!! error TS2415: Property 'x' is private in type 'Foo' but not in type 'Bar2'. ~~~~ -!!! Class 'Bar2' incorrectly implements interface 'I': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is private in type 'I' but not in type 'Bar2'. x: string; y: number; } class Bar3 extends Foo implements I { // error ~~~~ -!!! Class 'Bar3' incorrectly extends base class 'Foo': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~~~ -!!! Class 'Bar3' incorrectly implements interface 'I': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x: string; y: number; } @@ -54,22 +84,22 @@ class Bar2 extends Foo implements I { // error ~~~~ -!!! Class 'Bar2' incorrectly extends base class 'Foo': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. +!!! error TS2415: Property 'x' is private in type 'Foo' but not in type 'Bar2'. ~~~~ -!!! Class 'Bar2' incorrectly implements interface 'I': -!!! Property 'z' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'z' is missing in type 'Bar2'. x: string; y: number; } class Bar3 extends Foo implements I { // error ~~~~ -!!! Class 'Bar3' incorrectly extends base class 'Foo': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~~~ -!!! Class 'Bar3' incorrectly implements interface 'I': -!!! Property 'z' is missing in type 'Bar3'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'z' is missing in type 'Bar3'. private x: string; y: number; } @@ -91,8 +121,8 @@ class Bar extends Foo implements I { // error ~~~ -!!! Class 'Bar' incorrectly implements interface 'I': -!!! Property 'y' is missing in type 'Bar'. +!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar'. z: number; } @@ -100,29 +130,29 @@ var r1 = b.z; var r2 = b.x; // error ~~~ -!!! Property 'Foo.x' is inaccessible. +!!! error TS2341: Property 'x' is private and only accessible within class 'Foo'. var r3 = b.y; // error ~ -!!! Property 'y' does not exist on type 'Bar'. +!!! error TS2339: Property 'y' does not exist on type 'Bar'. class Bar2 extends Foo implements I { // error ~~~~ -!!! Class 'Bar2' incorrectly extends base class 'Foo': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. +!!! error TS2415: Property 'x' is private in type 'Foo' but not in type 'Bar2'. ~~~~ -!!! Class 'Bar2' incorrectly implements interface 'I': -!!! Property 'y' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar2'. x: string; z: number; } class Bar3 extends Foo implements I { // error ~~~~ -!!! Class 'Bar3' incorrectly extends base class 'Foo': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~~~ -!!! Class 'Bar3' incorrectly implements interface 'I': -!!! Property 'y' is missing in type 'Bar3'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar3'. private x: string; z: number; } diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt new file mode 100644 index 00000000000..3835408ab05 --- /dev/null +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt @@ -0,0 +1,74 @@ +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(9,7): error TS2420: Class 'Bar' incorrectly implements interface 'I'. + Property 'y' is missing in type 'Bar'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(12,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. + Property 'x' is missing in type 'Bar2'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(16,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. + Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(21,7): error TS2420: Class 'Bar4' incorrectly implements interface 'I'. + Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(26,7): error TS2420: Class 'Bar5' incorrectly implements interface 'I'. + Property 'y' is missing in type 'Bar5'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(29,7): error TS2420: Class 'Bar6' incorrectly implements interface 'I'. + Property 'y' is protected in type 'Bar6' but public in type 'I'. + + +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts (6 errors) ==== + class Foo { + protected x: string; + } + + interface I extends Foo { + y: number; + } + + class Bar implements I { // error + ~~~ +!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar'. + } + + class Bar2 implements I { // error + ~~~~ +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is missing in type 'Bar2'. + y: number; + } + + class Bar3 implements I { // error + ~~~~ +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'. + x: string; + y: number; + } + + class Bar4 implements I { // error + ~~~~ +!!! error TS2420: Class 'Bar4' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'. + protected x: string; + y: number; + } + + class Bar5 extends Foo implements I { // error + ~~~~ +!!! error TS2420: Class 'Bar5' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar5'. + } + + class Bar6 extends Foo implements I { // error + ~~~~ +!!! error TS2420: Class 'Bar6' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is protected in type 'Bar6' but public in type 'I'. + protected y: number; + } + + class Bar7 extends Foo implements I { + y: number; + } + + class Bar8 extends Foo implements I { + x: string; + y: number; + } + \ No newline at end of file diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js new file mode 100644 index 00000000000..1a79496bd12 --- /dev/null +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js @@ -0,0 +1,103 @@ +//// [implementingAnInterfaceExtendingClassWithProtecteds.ts] +class Foo { + protected x: string; +} + +interface I extends Foo { + y: number; +} + +class Bar implements I { // error +} + +class Bar2 implements I { // error + y: number; +} + +class Bar3 implements I { // error + x: string; + y: number; +} + +class Bar4 implements I { // error + protected x: string; + y: number; +} + +class Bar5 extends Foo implements I { // error +} + +class Bar6 extends Foo implements I { // error + protected y: number; +} + +class Bar7 extends Foo implements I { + y: number; +} + +class Bar8 extends Foo implements I { + x: string; + y: number; +} + + +//// [implementingAnInterfaceExtendingClassWithProtecteds.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Bar = (function () { + function Bar() { + } + return Bar; +})(); +var Bar2 = (function () { + function Bar2() { + } + return Bar2; +})(); +var Bar3 = (function () { + function Bar3() { + } + return Bar3; +})(); +var Bar4 = (function () { + function Bar4() { + } + return Bar4; +})(); +var Bar5 = (function (_super) { + __extends(Bar5, _super); + function Bar5() { + _super.apply(this, arguments); + } + return Bar5; +})(Foo); +var Bar6 = (function (_super) { + __extends(Bar6, _super); + function Bar6() { + _super.apply(this, arguments); + } + return Bar6; +})(Foo); +var Bar7 = (function (_super) { + __extends(Bar7, _super); + function Bar7() { + _super.apply(this, arguments); + } + return Bar7; +})(Foo); +var Bar8 = (function (_super) { + __extends(Bar8, _super); + function Bar8() { + _super.apply(this, arguments); + } + return Bar8; +})(Foo); diff --git a/tests/baselines/reference/implementsClauseAlreadySeen.errors.txt b/tests/baselines/reference/implementsClauseAlreadySeen.errors.txt index 020a061fa66..ca06cf9bb73 100644 --- a/tests/baselines/reference/implementsClauseAlreadySeen.errors.txt +++ b/tests/baselines/reference/implementsClauseAlreadySeen.errors.txt @@ -1,19 +1,27 @@ +tests/cases/compiler/implementsClauseAlreadySeen.ts(4,22): error TS1005: '{' expected. +tests/cases/compiler/implementsClauseAlreadySeen.ts(4,33): error TS1005: ';' expected. +tests/cases/compiler/implementsClauseAlreadySeen.ts(4,35): error TS1005: ';' expected. +tests/cases/compiler/implementsClauseAlreadySeen.ts(5,11): error TS1005: ';' expected. +tests/cases/compiler/implementsClauseAlreadySeen.ts(4,22): error TS2304: Cannot find name 'implements'. +tests/cases/compiler/implementsClauseAlreadySeen.ts(5,5): error TS2304: Cannot find name 'baz'. + + ==== tests/cases/compiler/implementsClauseAlreadySeen.ts (6 errors) ==== class C { } class D implements C implements C { ~~~~~~~~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~~~~~ -!!! Cannot find name 'implements'. +!!! error TS2304: Cannot find name 'implements'. baz() { } ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~ -!!! Cannot find name 'baz'. +!!! error TS2304: Cannot find name 'baz'. } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyAmbients.errors.txt b/tests/baselines/reference/implicitAnyAmbients.errors.txt index 99cd350286d..699bd4b7f34 100644 --- a/tests/baselines/reference/implicitAnyAmbients.errors.txt +++ b/tests/baselines/reference/implicitAnyAmbients.errors.txt @@ -1,45 +1,56 @@ +tests/cases/compiler/implicitAnyAmbients.ts(3,9): error TS7005: Variable 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyAmbients.ts(6,5): error TS7010: 'f', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyAmbients.ts(6,16): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyAmbients.ts(7,5): error TS7010: 'f2', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyAmbients.ts(11,9): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyAmbients.ts(12,9): error TS7010: 'foo2', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyAmbients.ts(17,9): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyAmbients.ts(18,9): error TS7010: 'foo2', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyAmbients.ts(23,13): error TS7005: Variable 'y' implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyAmbients.ts (9 errors) ==== declare module m { var x; // error ~ -!!! Variable 'x' implicitly has an 'any' type. +!!! error TS7005: Variable 'x' implicitly has an 'any' type. var y: any; function f(x); // error ~~~~~~~~~~~~~~ -!!! 'f', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'f', which lacks return-type annotation, implicitly has an 'any' return type. ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. function f2(x: any); // error ~~~~~~~~~~~~~~~~~~~~ -!!! 'f2', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'f2', which lacks return-type annotation, implicitly has an 'any' return type. function f3(x: any): any; interface I { foo(); // error ~~~~~~ -!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. foo2(x: any); // error ~~~~~~~~~~~~~ -!!! 'foo2', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'foo2', which lacks return-type annotation, implicitly has an 'any' return type. foo3(x: any): any; } class C { foo(); // error ~~~~~~ -!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. foo2(x: any); // error ~~~~~~~~~~~~~ -!!! 'foo2', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'foo2', which lacks return-type annotation, implicitly has an 'any' return type. foo3(x: any): any; } module n { var y; // error ~ -!!! Variable 'y' implicitly has an 'any' type. +!!! error TS7005: Variable 'y' implicitly has an 'any' type. } import m2 = n; diff --git a/tests/baselines/reference/implicitAnyCastedValue.errors.txt b/tests/baselines/reference/implicitAnyCastedValue.errors.txt index c0f887b04d8..4b88cb0a8b4 100644 --- a/tests/baselines/reference/implicitAnyCastedValue.errors.txt +++ b/tests/baselines/reference/implicitAnyCastedValue.errors.txt @@ -1,3 +1,14 @@ +tests/cases/compiler/implicitAnyCastedValue.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyCastedValue.ts(28,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyCastedValue.ts(32,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyCastedValue.ts(10,5): error TS7008: Member 'bar' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyCastedValue.ts(11,5): error TS7008: Member 'foo' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyCastedValue.ts(26,5): error TS7008: Member 'getValue' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyCastedValue.ts(41,1): error TS7010: 'notCastedNull', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyCastedValue.ts(53,24): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyCastedValue.ts(62,24): error TS7006: Parameter 'x' implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyCastedValue.ts (9 errors) ==== var x = function () { return 0; // this should not be an error @@ -10,13 +21,13 @@ class C { bar = null; // this should be an error ~~~~~~~~~~~ -!!! Member 'bar' implicitly has an 'any' type. +!!! error TS7008: Member 'bar' implicitly has an 'any' type. foo = undefined; // this should be an error ~~~~~~~~~~~~~~~~ -!!! Member 'foo' implicitly has an 'any' type. +!!! error TS7008: Member 'foo' implicitly has an 'any' type. public get tempVar() { ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 0; // this should not be an error } @@ -32,17 +43,17 @@ class C1 { getValue = null; // this should be an error ~~~~~~~~~~~~~~~~ -!!! Member 'getValue' implicitly has an 'any' type. +!!! error TS7008: Member 'getValue' implicitly has an 'any' type. public get castedGet() { ~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return this.getValue; // this should not be an error } public get notCastedGet() { ~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return this.getValue; // this should not be an error } } @@ -57,7 +68,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ -!!! 'notCastedNull', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'notCastedNull', which lacks return-type annotation, implicitly has an 'any' return type. function returnTypeBar(): any { return null; // this should not be an error @@ -69,7 +80,7 @@ function multipleRets1(x) { // this should not be an error ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. if (x) { return 0; } @@ -80,7 +91,7 @@ function multipleRets2(x) { // this should not be an error ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. if (x) { return null; } diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.errors.txt b/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.errors.txt index db1e773c17c..34aa58c4199 100644 --- a/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.errors.txt +++ b/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.errors.txt @@ -1,31 +1,41 @@ +tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(2,15): error TS7006: Parameter 'l1' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(3,15): error TS7006: Parameter 'll1' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(4,33): error TS7006: Parameter 'myParam' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(5,14): error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(8,15): error TS7010: 'temp', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(9,15): error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(10,15): error TS7010: 'temp', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts(11,15): error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type. + + ==== tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts (8 errors) ==== // these should be errors for implicit any parameter var lambda = (l1) => { }; // Error at "l1" ~~ -!!! Parameter 'l1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'l1' implicitly has an 'any' type. var lambd2 = (ll1, ll2: string) => { } // Error at "ll1" ~~~ -!!! Parameter 'll1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'll1' implicitly has an 'any' type. var lamda3 = function myLambda3(myParam) { } ~~~~~~~ -!!! Parameter 'myParam' implicitly has an 'any' type. +!!! error TS7006: Parameter 'myParam' implicitly has an 'any' type. var lamda4 = () => { return null }; ~~~~~~~~~~~~~~~~~~~~~ -!!! Function expression, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type. // these should be error for implicit any return type var lambda5 = function temp() { return null; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'temp', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'temp', which lacks return-type annotation, implicitly has an 'any' return type. var lambda6 = () => { return null; } ~~~~~~~~~~~~~~~~~~~~~~ -!!! Function expression, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type. var lambda7 = function temp() { return undefined; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'temp', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'temp', which lacks return-type annotation, implicitly has an 'any' return type. var lambda8 = () => { return undefined; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function expression, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any' return type. // this shouldn't be an error var lambda9 = () => { return 5; } diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.errors.txt b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.errors.txt index dffd6dac81c..57e9b70cf09 100644 --- a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.errors.txt +++ b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.errors.txt @@ -1,26 +1,36 @@ +tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts(2,14): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts(3,25): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts(4,16): error TS7006: Parameter 'a' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts(4,19): error TS7006: Parameter 'b' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts(4,22): error TS7006: Parameter 'c' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts(5,16): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type. +tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts(6,16): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts(6,25): error TS7006: Parameter 'w' implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts (8 errors) ==== // these should be errors function foo(x) { }; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. function bar(x: number, y) { }; // error at "y"; no error at "x" ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. function func2(a, b, c) { }; // error at "a,b,c" ~ -!!! Parameter 'a' implicitly has an 'any' type. +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. ~ -!!! Parameter 'b' implicitly has an 'any' type. +!!! error TS7006: Parameter 'b' implicitly has an 'any' type. ~ -!!! Parameter 'c' implicitly has an 'any' type. +!!! error TS7006: Parameter 'c' implicitly has an 'any' type. function func3(...args) { }; // error at "args" ~~~~~~~ -!!! Rest parameter 'args' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'args' implicitly has an 'any[]' type. function func4(z= null, w= undefined) { }; // error at "z,w" ~~~~~~~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. ~~~~~~~~~~~~ -!!! Parameter 'w' implicitly has an 'any' type. +!!! error TS7006: Parameter 'w' implicitly has an 'any' type. // these shouldn't be errors function noError1(x= 3, y= 2) { }; diff --git a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType.errors.txt b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType.errors.txt index a6ed50b77f4..710bcd32470 100644 --- a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType.errors.txt +++ b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType.errors.txt @@ -1,26 +1,36 @@ +tests/cases/compiler/implicitAnyDeclareMemberWithoutType.ts(3,5): error TS7008: Member 'member1' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType.ts(5,5): error TS7010: 'constructor', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType.ts(5,17): error TS7006: Parameter 'c1' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType.ts(5,33): error TS7006: Parameter 'c3' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType.ts(6,5): error TS7010: 'funcOfIFace', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType.ts(6,17): error TS7006: Parameter 'f1' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType.ts(6,21): error TS7006: Parameter 'f2' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType.ts(7,5): error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. + + ==== tests/cases/compiler/implicitAnyDeclareMemberWithoutType.ts (8 errors) ==== // this should be an error interface IFace { member1; // error at "member1" ~~~~~~~~ -!!! Member 'member1' implicitly has an 'any' type. +!!! error TS7008: Member 'member1' implicitly has an 'any' type. member2: string; constructor(c1, c2: string, c3); // error at "c1, c3, "constructor" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'constructor', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'constructor', which lacks return-type annotation, implicitly has an 'any' return type. ~~ -!!! Parameter 'c1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'c1' implicitly has an 'any' type. ~~ -!!! Parameter 'c3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'c3' implicitly has an 'any' type. funcOfIFace(f1, f2, f3: number); // error at "f1, f2, funcOfIFace" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'funcOfIFace', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'funcOfIFace', which lacks return-type annotation, implicitly has an 'any' return type. ~~ -!!! Parameter 'f1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'f1' implicitly has an 'any' type. ~~ -!!! Parameter 'f2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'f2' implicitly has an 'any' type. new (); ~~~~~~~ -!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.errors.txt b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.errors.txt index c98f3d3c311..45b95a1c863 100644 --- a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.errors.txt +++ b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.errors.txt @@ -1,20 +1,27 @@ +tests/cases/compiler/implicitAnyDeclareMemberWithoutType2.ts(3,5): error TS7008: Member 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType2.ts(6,17): error TS7006: Parameter 'c1' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType2.ts(6,21): error TS7006: Parameter 'c2' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType2.ts(7,13): error TS7006: Parameter 'f1' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareMemberWithoutType2.ts(7,17): error TS7006: Parameter 'f2' implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyDeclareMemberWithoutType2.ts (5 errors) ==== // this should be an error class C { public x = null;// error at "x" ~~~~~~~~~~~~~~~~ -!!! Member 'x' implicitly has an 'any' type. +!!! error TS7008: Member 'x' implicitly has an 'any' type. public x1: string // no error constructor(c1, c2, c3: string) { } // error at "c1, c2" ~~ -!!! Parameter 'c1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'c1' implicitly has an 'any' type. ~~ -!!! Parameter 'c2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'c2' implicitly has an 'any' type. funcOfC(f1, f2, f3: number) { } // error at "f1,f2" ~~ -!!! Parameter 'f1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'f1' implicitly has an 'any' type. ~~ -!!! Parameter 'f2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'f2' implicitly has an 'any' type. } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.errors.txt b/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.errors.txt index 9d1fa68e502..8523b361ba8 100644 --- a/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.errors.txt +++ b/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(6,10): error TS7008: Member 'y' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(6,13): error TS7008: Member 'z' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(7,18): error TS7008: Member 'z1' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(8,12): error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(9,10): error TS7006: Parameter 'y2' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts(10,22): error TS7006: Parameter 'y3' implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts (6 errors) ==== class C { constructor() { } @@ -6,21 +14,21 @@ // this should be an error var x: { y; z; } // error at "y,z" ~~ -!!! Member 'y' implicitly has an 'any' type. +!!! error TS7008: Member 'y' implicitly has an 'any' type. ~~ -!!! Member 'z' implicitly has an 'any' type. +!!! error TS7008: Member 'z' implicitly has an 'any' type. var x1: { y1: C; z1; }; // error at "z1" ~~~ -!!! Member 'z1' implicitly has an 'any' type. +!!! error TS7008: Member 'z1' implicitly has an 'any' type. var x11: { new (); }; // error at "new" ~~~~~~~ -!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. var x2: (y2) => number; // error at "y2" ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. var x3: (x3: string, y3) => void ; // error at "y3" ~~ -!!! Parameter 'y3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y3' implicitly has an 'any' type. // this should not be an error var bar: { a: number; b: number }; diff --git a/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.errors.txt b/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.errors.txt index 57e74c34a34..3acb6e47e10 100644 --- a/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.errors.txt +++ b/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.errors.txt @@ -1,14 +1,19 @@ +tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(2,5): error TS7005: Variable 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(3,13): error TS7005: Variable 'foo' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts(4,15): error TS7006: Parameter 'k' implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts (3 errors) ==== // this should be an error var x; // error at "x" ~ -!!! Variable 'x' implicitly has an 'any' type. +!!! error TS7005: Variable 'x' implicitly has an 'any' type. declare var foo; // error at "foo" ~~~ -!!! Variable 'foo' implicitly has an 'any' type. +!!! error TS7005: Variable 'foo' implicitly has an 'any' type. function func(k) { }; //error at "k" ~ -!!! Parameter 'k' implicitly has an 'any' type. +!!! error TS7006: Parameter 'k' implicitly has an 'any' type. func(x); // this shouldn't be an error diff --git a/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt b/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt new file mode 100644 index 00000000000..7b80d6405c9 --- /dev/null +++ b/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt @@ -0,0 +1,84 @@ +tests/cases/compiler/implicitAnyFromCircularInference.ts(3,5): error TS7021: 'a' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. +tests/cases/compiler/implicitAnyFromCircularInference.ts(7,5): error TS7021: 'c' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. +tests/cases/compiler/implicitAnyFromCircularInference.ts(10,5): error TS7021: 'd' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. +tests/cases/compiler/implicitAnyFromCircularInference.ts(15,10): error TS7023: 'g' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +tests/cases/compiler/implicitAnyFromCircularInference.ts(18,10): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +tests/cases/compiler/implicitAnyFromCircularInference.ts(23,10): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +tests/cases/compiler/implicitAnyFromCircularInference.ts(26,10): error TS7023: 'h' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +tests/cases/compiler/implicitAnyFromCircularInference.ts(41,5): error TS7022: 's' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer. +tests/cases/compiler/implicitAnyFromCircularInference.ts(46,5): error TS7023: 'x' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. + + +==== tests/cases/compiler/implicitAnyFromCircularInference.ts (9 errors) ==== + + // Error expected + var a: typeof a; + ~ +!!! error TS7021: 'a' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. + + // Error expected on b or c + var b: typeof c; + var c: typeof b; + ~ +!!! error TS7021: 'c' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. + + // Error expected + var d: Array; + ~ +!!! error TS7021: 'd' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation. + + function f() { return f; } + + // Error expected + function g() { return g(); } + ~ +!!! error TS7023: 'g' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. + + // Error expected + var f1 = function () { + ~~~~~~~~~~~~~ + return f1(); + ~~~~~~~~~~~~~~~~ + }; + ~ +!!! error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. + + // Error expected + var f2 = () => f2(); + ~~~~~~~~~~ +!!! error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. + + // Error expected + function h() { + ~ +!!! error TS7023: 'h' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. + return foo(); + function foo() { + return h() || "hello"; + } + } + + interface A { + s: string; + } + + function foo(x: A): string { return "abc"; } + + class C { + // Error expected + s = foo(this); + ~~~~~~~~~~~~~~ +!!! error TS7022: 's' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer. + } + + class D { + // Error expected + get x() { + ~~~~~~~~~ + return this.x; + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! error TS7023: 'x' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. + } + \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyFromCircularInference.js b/tests/baselines/reference/implicitAnyFromCircularInference.js new file mode 100644 index 00000000000..d97b8420ebf --- /dev/null +++ b/tests/baselines/reference/implicitAnyFromCircularInference.js @@ -0,0 +1,103 @@ +//// [implicitAnyFromCircularInference.ts] + +// Error expected +var a: typeof a; + +// Error expected on b or c +var b: typeof c; +var c: typeof b; + +// Error expected +var d: Array; + +function f() { return f; } + +// Error expected +function g() { return g(); } + +// Error expected +var f1 = function () { + return f1(); +}; + +// Error expected +var f2 = () => f2(); + +// Error expected +function h() { + return foo(); + function foo() { + return h() || "hello"; + } +} + +interface A { + s: string; +} + +function foo(x: A): string { return "abc"; } + +class C { + // Error expected + s = foo(this); +} + +class D { + // Error expected + get x() { + return this.x; + } +} + + +//// [implicitAnyFromCircularInference.js] +// Error expected +var a; +// Error expected on b or c +var b; +var c; +// Error expected +var d; +function f() { + return f; +} +// Error expected +function g() { + return g(); +} +// Error expected +var f1 = function () { + return f1(); +}; +// Error expected +var f2 = function () { return f2(); }; +// Error expected +function h() { + return foo(); + function foo() { + return h() || "hello"; + } +} +function foo(x) { + return "abc"; +} +var C = (function () { + function C() { + // Error expected + this.s = foo(this); + } + return C; +})(); +var D = (function () { + function D() { + } + Object.defineProperty(D.prototype, "x", { + // Error expected + get: function () { + return this.x; + }, + enumerable: true, + configurable: true + }); + return D; +})(); diff --git a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.errors.txt b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.errors.txt index cf135dbbd41..b15fb779b51 100644 --- a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.errors.txt +++ b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.errors.txt @@ -1,28 +1,37 @@ +tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(2,5): error TS7005: Variable 'arg0' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(3,5): error TS7005: Variable 'anyArray' implicitly has an 'any[]' type. +tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(4,13): error TS7008: Member 'v' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(4,16): error TS7008: Member 'w' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(5,13): error TS7006: Parameter 'y2' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(6,16): error TS7006: Parameter 'arg1' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts(10,36): error TS7006: Parameter 'y2' implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts (7 errors) ==== // this should be errors var arg0 = null; // error at "arg0" ~~~~ -!!! Variable 'arg0' implicitly has an 'any' type. +!!! error TS7005: Variable 'arg0' implicitly has an 'any' type. var anyArray = [null, undefined]; // error at array literal ~~~~~~~~ -!!! Variable 'anyArray' implicitly has an 'any[]' type. +!!! error TS7005: Variable 'anyArray' implicitly has an 'any[]' type. var objL: { v; w; } // error at "y,z" ~~ -!!! Member 'v' implicitly has an 'any' type. +!!! error TS7008: Member 'v' implicitly has an 'any' type. ~~ -!!! Member 'w' implicitly has an 'any' type. +!!! error TS7008: Member 'w' implicitly has an 'any' type. var funcL: (y2) => number; ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. function temp1(arg1) { } // error at "temp1" ~~~~ -!!! Parameter 'arg1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'arg1' implicitly has an 'any' type. function testFunctionExprC(subReplace: (s: string, ...arg: any[]) => string) { } function testFunctionExprC2(eq: (v1: any, v2: any) => number) { }; function testObjLiteral(objLit: { v: any; w: any }) { }; function testFuncLiteral(funcLit: (y2) => number) { }; ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. // this should not be an error testFunctionExprC2((v1, v2) => 1); diff --git a/tests/baselines/reference/implicitAnyFunctionOverloadWithImplicitAnyReturnType.errors.txt b/tests/baselines/reference/implicitAnyFunctionOverloadWithImplicitAnyReturnType.errors.txt index 6ef65b09ed9..ecd9cfde121 100644 --- a/tests/baselines/reference/implicitAnyFunctionOverloadWithImplicitAnyReturnType.errors.txt +++ b/tests/baselines/reference/implicitAnyFunctionOverloadWithImplicitAnyReturnType.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/implicitAnyFunctionOverloadWithImplicitAnyReturnType.ts(3,5): error TS7010: 'funcOfIFace', which lacks return-type annotation, implicitly has an 'any' return type. + + ==== tests/cases/compiler/implicitAnyFunctionOverloadWithImplicitAnyReturnType.ts (1 errors) ==== // this should be an error interface IFace { funcOfIFace(); // error at "f" ~~~~~~~~~~~~~~ -!!! 'funcOfIFace', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'funcOfIFace', which lacks return-type annotation, implicitly has an 'any' return type. } // this should not be an error diff --git a/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.errors.txt b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.errors.txt index 5c8ab6e19a3..de1c57dd797 100644 --- a/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.errors.txt +++ b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.errors.txt @@ -1,11 +1,17 @@ +tests/cases/compiler/implicitAnyFunctionReturnNullOrUndefined.ts(2,1): error TS7010: 'nullWidenFunction', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyFunctionReturnNullOrUndefined.ts(3,1): error TS7010: 'undefinedWidenFunction', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyFunctionReturnNullOrUndefined.ts(6,5): error TS7010: 'nullWidenFuncOfC', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyFunctionReturnNullOrUndefined.ts(10,5): error TS7010: 'underfinedWidenFuncOfC', which lacks return-type annotation, implicitly has an 'any' return type. + + ==== tests/cases/compiler/implicitAnyFunctionReturnNullOrUndefined.ts (4 errors) ==== // this should be an error function nullWidenFunction() { return null;} // error at "nullWidenFunction" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'nullWidenFunction', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'nullWidenFunction', which lacks return-type annotation, implicitly has an 'any' return type. function undefinedWidenFunction() { return undefined; } // error at "undefinedWidenFunction" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'undefinedWidenFunction', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'undefinedWidenFunction', which lacks return-type annotation, implicitly has an 'any' return type. class C { nullWidenFuncOfC() { // error at "nullWidenFuncOfC" @@ -14,7 +20,7 @@ ~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! 'nullWidenFuncOfC', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'nullWidenFuncOfC', which lacks return-type annotation, implicitly has an 'any' return type. underfinedWidenFuncOfC() { // error at "underfinedWidenFuncOfC" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -22,7 +28,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! 'underfinedWidenFuncOfC', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'underfinedWidenFuncOfC', which lacks return-type annotation, implicitly has an 'any' return type. } // this should not be an error diff --git a/tests/baselines/reference/implicitAnyGenericTypeInference.errors.txt b/tests/baselines/reference/implicitAnyGenericTypeInference.errors.txt index 3f95e27ab0a..c479d06d898 100644 --- a/tests/baselines/reference/implicitAnyGenericTypeInference.errors.txt +++ b/tests/baselines/reference/implicitAnyGenericTypeInference.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/implicitAnyGenericTypeInference.ts(7,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyGenericTypeInference.ts(7,22): error TS7006: Parameter 'y' implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyGenericTypeInference.ts (2 errors) ==== interface Comparer { @@ -7,7 +11,7 @@ var c: Comparer; c = { compareTo: (x, y) => { return y; } }; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. var r = c.compareTo(1, ''); \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt index c3484202590..9f2dc9ce949 100644 --- a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt +++ b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt @@ -1,19 +1,29 @@ +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(4,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(3,5): error TS7008: Member 'getAndSet' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,5): error TS7016: Property 'haveOnlySet' implicitly has type 'any', because its 'set' accessor lacks a type annotation. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,28): error TS7006: Parameter 'newXValue' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,5): error TS7010: 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. + + ==== tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts (8 errors) ==== // these should be errors class GetAndSet { getAndSet = null; // error at "getAndSet" ~~~~~~~~~~~~~~~~~ -!!! Member 'getAndSet' implicitly has an 'any' type. +!!! error TS7008: Member 'getAndSet' implicitly has an 'any' type. public get haveGetAndSet() { // this should not be an error ~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return this.getAndSet; } // this shouldn't be an error public set haveGetAndSet(value) { // error at "value" ~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. this.getAndSet = value; } } @@ -21,23 +31,23 @@ class SetterOnly { public set haveOnlySet(newXValue) { // error at "haveOnlySet, newXValue" ~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ -!!! Parameter 'newXValue' implicitly has an 'any' type. +!!! error TS7006: Parameter 'newXValue' implicitly has an 'any' type. } ~~~~~ -!!! Property 'haveOnlySet' implicitly has type 'any', because its 'set' accessor lacks a type annotation. +!!! error TS7016: Property 'haveOnlySet' implicitly has type 'any', because its 'set' accessor lacks a type annotation. } class GetterOnly { public get haveOnlyGet() { // error at "haveOnlyGet" ~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return null; ~~~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt b/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt index 16ee2425d41..6ec975e33ea 100644 --- a/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt +++ b/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt @@ -1,19 +1,25 @@ +tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(8,9): error TS1089: 'private' modifier cannot appear on a constructor declaration. +tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(3,9): error TS7008: Member 'publicMember' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(6,9): error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyInAmbientDeclaration.ts(6,31): error TS7006: Parameter 'x' implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyInAmbientDeclaration.ts (4 errors) ==== module Test { declare class C { public publicMember; // this should be an error ~~~~~~~~~~~~~~~~~~~~ -!!! Member 'publicMember' implicitly has an 'any' type. +!!! error TS7008: Member 'publicMember' implicitly has an 'any' type. private privateMember; // this should not be an error public publicFunction(x); // this should be an error ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. private privateFunction(privateParam); // this should not be an error private constructor(privateParam); ~~~~~~~ -!!! 'private' modifier cannot appear on a constructor declaration. +!!! error TS1089: 'private' modifier cannot appear on a constructor declaration. } } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt b/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt index c65b2e49340..726c408aced 100644 --- a/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt +++ b/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt @@ -1,31 +1,41 @@ +tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(9,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. +tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(1,1): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(1,22): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(2,13): error TS7005: Variable 'bar' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(4,5): error TS7008: Member 'publicMember' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(7,5): error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(7,27): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts(13,24): error TS7006: Parameter 'publicConsParam' implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts (8 errors) ==== declare function foo(x); // this should be an error ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. declare var bar; // this should be be an erro ~~~ -!!! Variable 'bar' implicitly has an 'any' type. +!!! error TS7005: Variable 'bar' implicitly has an 'any' type. declare class C { public publicMember; // this should be an error ~~~~~~~~~~~~~~~~~~~~ -!!! Member 'publicMember' implicitly has an 'any' type. +!!! error TS7008: Member 'publicMember' implicitly has an 'any' type. private privateMember; // this should not be an error public publicFunction(x); // this should be an error ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. private privateFunction(privateParam); // this should not be an error private constructor(privateParam); // this should not be an error ~~~~~~~ -!!! 'private' modifier cannot appear on a constructor declaration. +!!! error TS1089: 'private' modifier cannot appear on a constructor declaration. } declare class D { public constructor(publicConsParam, int: number); // this should be an error ~~~~~~~~~~~~~~~ -!!! Parameter 'publicConsParam' implicitly has an 'any' type. +!!! error TS7006: Parameter 'publicConsParam' implicitly has an 'any' type. } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.errors.txt b/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.errors.txt index d78cf0d5b4b..e623cae18d8 100644 --- a/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.errors.txt +++ b/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/implicitAnyNewExprLackConstructorSignature.ts(2,14): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + + ==== tests/cases/compiler/implicitAnyNewExprLackConstructorSignature.ts (1 errors) ==== function Point() { this.x = 3; } var x: any = new Point(); // error at "new" ~~~~~~~~~~~ -!!! 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. \ No newline at end of file +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyWidenToAny.errors.txt b/tests/baselines/reference/implicitAnyWidenToAny.errors.txt index b9e5cbf1a1e..3b86c52c2ea 100644 --- a/tests/baselines/reference/implicitAnyWidenToAny.errors.txt +++ b/tests/baselines/reference/implicitAnyWidenToAny.errors.txt @@ -1,17 +1,23 @@ +tests/cases/compiler/implicitAnyWidenToAny.ts(2,5): error TS7005: Variable 'x' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyWidenToAny.ts(3,5): error TS7005: Variable 'x1' implicitly has an 'any' type. +tests/cases/compiler/implicitAnyWidenToAny.ts(4,5): error TS7005: Variable 'widenArray' implicitly has an 'any[]' type. +tests/cases/compiler/implicitAnyWidenToAny.ts(5,5): error TS7005: Variable 'emptyArray' implicitly has an 'any[]' type. + + ==== tests/cases/compiler/implicitAnyWidenToAny.ts (4 errors) ==== // these should be errors var x = null; // error at "x" ~ -!!! Variable 'x' implicitly has an 'any' type. +!!! error TS7005: Variable 'x' implicitly has an 'any' type. var x1 = undefined; // error at "x1" ~~ -!!! Variable 'x1' implicitly has an 'any' type. +!!! error TS7005: Variable 'x1' implicitly has an 'any' type. var widenArray = [null, undefined]; // error at "widenArray" ~~~~~~~~~~ -!!! Variable 'widenArray' implicitly has an 'any[]' type. +!!! error TS7005: Variable 'widenArray' implicitly has an 'any[]' type. var emptyArray = []; // error at "emptyArray" ~~~~~~~~~~ -!!! Variable 'emptyArray' implicitly has an 'any[]' type. +!!! error TS7005: Variable 'emptyArray' implicitly has an 'any[]' type. // these should not be error class AnimalObj { diff --git a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt index 3960281c7d4..abd9ee65196 100644 --- a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt +++ b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts(1,15): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file1.ts (0 errors) ==== import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); module m_private { @@ -9,7 +12,7 @@ ==== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts (1 errors) ==== export module m { ~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. export function foo() { } } \ No newline at end of file diff --git a/tests/baselines/reference/importAliasIdentifiers.types b/tests/baselines/reference/importAliasIdentifiers.types index 5cff22d7e98..7401c3e7518 100644 --- a/tests/baselines/reference/importAliasIdentifiers.types +++ b/tests/baselines/reference/importAliasIdentifiers.types @@ -61,12 +61,12 @@ import clolias = clodule; var p: clolias.Point; >p : alias.Point ->clolias : clodule +>clolias : unknown >Point : clolias.Point var p: clodule.Point; >p : alias.Point ->clodule : clodule +>clodule : unknown >Point : clolias.Point var p: { x: number; y: number; }; diff --git a/tests/baselines/reference/importAnImport.errors.txt b/tests/baselines/reference/importAnImport.errors.txt index 147b856685e..662655d3a3e 100644 --- a/tests/baselines/reference/importAnImport.errors.txt +++ b/tests/baselines/reference/importAnImport.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/importAnImport.ts(6,5): error TS2305: Module 'c.a.b' has no exported member 'ma'. + + ==== tests/cases/compiler/importAnImport.ts (1 errors) ==== module c.a.b { import ma = a; @@ -6,5 +9,5 @@ module m0 { import m8 = c.a.b.ma; ~~~~~~~~~~~~~~~~~~~~~ -!!! Module 'c.a.b' has no exported member 'ma'. +!!! error TS2305: Module 'c.a.b' has no exported member 'ma'. } \ No newline at end of file diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt b/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt index faf8a4bfe73..cae8612481a 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt +++ b/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/importAndVariableDeclarationConflict1.ts(5,1): error TS2440: Import declaration conflicts with local declaration of 'x' + + ==== tests/cases/compiler/importAndVariableDeclarationConflict1.ts (1 errors) ==== module m { export var m = ''; @@ -5,6 +8,6 @@ import x = m.m; ~~~~~~~~~~~~~~~ -!!! Import declaration conflicts with local declaration of 'x' +!!! error TS2440: Import declaration conflicts with local declaration of 'x' var x = ''; \ No newline at end of file diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt b/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt index 53ec5b64fac..39567a11753 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt +++ b/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt @@ -1,10 +1,16 @@ -==== tests/cases/compiler/importAndVariableDeclarationConflict3.ts (1 errors) ==== +tests/cases/compiler/importAndVariableDeclarationConflict3.ts(5,8): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/importAndVariableDeclarationConflict3.ts(6,8): error TS2300: Duplicate identifier 'x'. + + +==== tests/cases/compiler/importAndVariableDeclarationConflict3.ts (2 errors) ==== module m { export var m = ''; } import x = m.m; + ~ +!!! error TS2300: Duplicate identifier 'x'. import x = m.m; ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. \ No newline at end of file diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt b/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt index edef13b1a26..4905d4d2a73 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt +++ b/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/importAndVariableDeclarationConflict4.ts(6,1): error TS2440: Import declaration conflicts with local declaration of 'x' + + ==== tests/cases/compiler/importAndVariableDeclarationConflict4.ts (1 errors) ==== module m { export var m = ''; @@ -6,5 +9,5 @@ var x = ''; import x = m.m; ~~~~~~~~~~~~~~~ -!!! Import declaration conflicts with local declaration of 'x' +!!! error TS2440: Import declaration conflicts with local declaration of 'x' \ No newline at end of file diff --git a/tests/baselines/reference/importAsBaseClass.errors.txt b/tests/baselines/reference/importAsBaseClass.errors.txt index e9cd8590cbc..f09eb55561b 100644 --- a/tests/baselines/reference/importAsBaseClass.errors.txt +++ b/tests/baselines/reference/importAsBaseClass.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/importAsBaseClass_1.ts(2,21): error TS2304: Cannot find name 'Greeter'. + + ==== tests/cases/compiler/importAsBaseClass_1.ts (1 errors) ==== import Greeter = require("importAsBaseClass_0"); class Hello extends Greeter { } ~~~~~~~ -!!! Cannot find name 'Greeter'. +!!! error TS2304: Cannot find name 'Greeter'. ==== tests/cases/compiler/importAsBaseClass_0.ts (0 errors) ==== export class Greeter { diff --git a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt index 9cb444661b9..7603a694348 100644 --- a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt +++ b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt @@ -1,14 +1,20 @@ +tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,20): error TS2307: Cannot find external module 'externalModule'. +tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2435: Ambient external modules cannot be nested in other modules. +tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): error TS2307: Cannot find external module 'externalModule'. + + ==== tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts (4 errors) ==== import b = require("externalModule"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ~~~~~~~~~~~~~~~~ -!!! Cannot find external module 'externalModule'. +!!! error TS2307: Cannot find external module 'externalModule'. declare module "m1" { ~~~~ -!!! Ambient external modules cannot be nested in other modules. +!!! error TS2435: Ambient external modules cannot be nested in other modules. import im2 = require("externalModule"); ~~~~~~~~~~~~~~~~ -!!! Cannot find external module 'externalModule'. +!!! error TS2307: Cannot find external module 'externalModule'. } \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt index 081bebda446..7555ac366c4 100644 --- a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt +++ b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/importDeclWithClassModifiers.ts(5,8): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/compiler/importDeclWithClassModifiers.ts(6,8): error TS1044: 'private' modifier cannot appear on a module element. +tests/cases/compiler/importDeclWithClassModifiers.ts(7,8): error TS1044: 'static' modifier cannot appear on a module element. +tests/cases/compiler/importDeclWithClassModifiers.ts(5,1): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithClassModifiers.ts(6,1): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithClassModifiers.ts(7,1): error TS2305: Module 'x' has no exported member 'c'. + + ==== tests/cases/compiler/importDeclWithClassModifiers.ts (6 errors) ==== module x { interface c { @@ -5,18 +13,18 @@ } export public import a = x.c; ~~~~~~ -!!! 'public' modifier cannot appear on a module element. +!!! error TS1044: 'public' modifier cannot appear on a module element. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Module 'x' has no exported member 'c'. +!!! error TS2305: Module 'x' has no exported member 'c'. export private import b = x.c; ~~~~~~~ -!!! 'private' modifier cannot appear on a module element. +!!! error TS1044: 'private' modifier cannot appear on a module element. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Module 'x' has no exported member 'c'. +!!! error TS2305: Module 'x' has no exported member 'c'. export static import c = x.c; ~~~~~~ -!!! 'static' modifier cannot appear on a module element. +!!! error TS1044: 'static' modifier cannot appear on a module element. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Module 'x' has no exported member 'c'. +!!! error TS2305: Module '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 972a1b9cc77..35c91e38dc5 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt @@ -1,16 +1,19 @@ -==== tests/cases/compiler/importDeclWithDeclareModifier.ts (4 errors) ==== +tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/importDeclWithDeclareModifier.ts(5,9): error TS1029: 'export' modifier must precede 'declare' modifier. +tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS2305: Module 'x' has no exported member 'c'. + + +==== tests/cases/compiler/importDeclWithDeclareModifier.ts (3 errors) ==== module x { interface c { } } declare export import a = x.c; - ~~~~~~~ -!!! A 'declare' modifier cannot be used with an import declaration. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ~~~~~~ -!!! 'export' modifier must precede 'declare' modifier. +!!! error TS1029: 'export' modifier must precede 'declare' modifier. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Module 'x' has no exported member 'c'. +!!! error TS2305: Module 'x' has no exported member 'c'. var b: a; \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt index 38c3d97185c..47d9eb1eec3 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt @@ -1,4 +1,7 @@ -==== tests/cases/compiler/importDeclWithDeclareModifierInAmbientContext.ts (3 errors) ==== +tests/cases/compiler/importDeclWithDeclareModifierInAmbientContext.ts(6,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. + + +==== tests/cases/compiler/importDeclWithDeclareModifierInAmbientContext.ts (1 errors) ==== declare module "m" { module x { interface c { @@ -6,11 +9,7 @@ } declare export import a = x.c; ~~~~~~~ -!!! A 'declare' modifier cannot be used in an already ambient context. - ~~~~~~~ -!!! A 'declare' modifier cannot be used with an import declaration. - ~~~~~~ -!!! 'export' modifier must precede 'declare' modifier. +!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. 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 ffa48b8a523..e1d75496a39 100644 --- a/tests/baselines/reference/importDeclWithExportModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithExportModifier.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/importDeclWithExportModifier.ts(5,1): error TS2305: Module 'x' has no exported member 'c'. + + ==== tests/cases/compiler/importDeclWithExportModifier.ts (1 errors) ==== module x { interface c { @@ -5,6 +8,6 @@ } export import a = x.c; ~~~~~~~~~~~~~~~~~~~~~~ -!!! Module 'x' has no exported member 'c'. +!!! error TS2305: Module '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 9c66bc3ca42..b7d938fbd58 100644 --- a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt +++ b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(5,1): error TS2305: Module '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. + + ==== tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts (2 errors) ==== module x { interface c { @@ -5,7 +9,7 @@ } export import a = x.c; ~~~~~~~~~~~~~~~~~~~~~~ -!!! Module 'x' has no exported member 'c'. +!!! error TS2305: Module 'x' has no exported member 'c'. export = x; ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. \ No newline at end of file +!!! 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/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt index 5dc48436ad7..19fe8d55955 100644 --- a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt +++ b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.ts(7,5): error TS2309: An export assignment cannot be used in a module with other exported elements. + + ==== tests/cases/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.ts (1 errors) ==== declare module "m" { module x { @@ -7,5 +10,5 @@ export import a = x.c; export = x; ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. +!!! 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/importDeclarationInModuleDeclaration1.errors.txt b/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt new file mode 100644 index 00000000000..e8e9de076ad --- /dev/null +++ b/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/importDeclarationInModuleDeclaration1.ts(2,25): error TS1147: Import declarations in an internal module cannot reference an external module. + + +==== tests/cases/compiler/importDeclarationInModuleDeclaration1.ts (1 errors) ==== + module m2 { + import m3 = require("use_glo_M1_public"); + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1147: Import declarations in an internal module cannot reference an external module. + } \ No newline at end of file diff --git a/tests/baselines/reference/importInsideModule.errors.txt b/tests/baselines/reference/importInsideModule.errors.txt index 38f09c07cf2..efe9b78125f 100644 --- a/tests/baselines/reference/importInsideModule.errors.txt +++ b/tests/baselines/reference/importInsideModule.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/importInsideModule_file2.ts(2,26): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/importInsideModule_file2.ts(2,26): error TS2307: Cannot find external module 'importInsideModule_file1'. + + ==== tests/cases/compiler/importInsideModule_file2.ts (2 errors) ==== export module myModule { import foo = require("importInsideModule_file1"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot find external module 'importInsideModule_file1'. +!!! error TS1147: Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find external module 'importInsideModule_file1'. var a = foo.x; } ==== tests/cases/compiler/importInsideModule_file1.ts (0 errors) ==== diff --git a/tests/baselines/reference/importNonExternalModule.errors.txt b/tests/baselines/reference/importNonExternalModule.errors.txt index 6abcf7ac44b..bce2c86d0f0 100644 --- a/tests/baselines/reference/importNonExternalModule.errors.txt +++ b/tests/baselines/reference/importNonExternalModule.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2306: File 'tests/cases/conformance/externalModules/foo_0.ts' is not an external module. + + ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require("./foo_0"); ~~~~~~~~~ -!!! File 'foo_0.ts' is not an external module. +!!! error TS2306: File 'foo_0.ts' is not an external module. // Import should fail. foo_0 not an external module if(foo.answer === 42){ diff --git a/tests/baselines/reference/importNonStringLiteral.errors.txt b/tests/baselines/reference/importNonStringLiteral.errors.txt index 0c1c2fde046..ce3dbb3e1ec 100644 --- a/tests/baselines/reference/importNonStringLiteral.errors.txt +++ b/tests/baselines/reference/importNonStringLiteral.errors.txt @@ -1,8 +1,12 @@ +tests/cases/conformance/externalModules/importNonStringLiteral.ts(2,22): error TS1141: String literal expected. +tests/cases/conformance/externalModules/importNonStringLiteral.ts(2,23): error TS1005: ';' expected. + + ==== tests/cases/conformance/externalModules/importNonStringLiteral.ts (2 errors) ==== var x = "filename"; import foo = require(x); // invalid ~ -!!! String literal expected. +!!! error TS1141: String literal expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/importStatementsInterfaces.errors.txt b/tests/baselines/reference/importStatementsInterfaces.errors.txt index 95a733dc2c4..313365fb191 100644 --- a/tests/baselines/reference/importStatementsInterfaces.errors.txt +++ b/tests/baselines/reference/importStatementsInterfaces.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/internalModules/codeGeneration/importStatementsInterfaces.ts(23,19): error TS2304: Cannot find name 'a'. + + ==== tests/cases/conformance/internalModules/codeGeneration/importStatementsInterfaces.ts (1 errors) ==== module A { export interface Point { @@ -23,7 +26,7 @@ import b = a.inA; var m: typeof a; ~ -!!! Cannot find name 'a'. +!!! error TS2304: Cannot find name 'a'. var p: b.Point3D; var p = {x:0, y:0, z: 0 }; } diff --git a/tests/baselines/reference/importTsBeforeDTs.errors.txt b/tests/baselines/reference/importTsBeforeDTs.errors.txt index 58e72634573..aaee4e3d070 100644 --- a/tests/baselines/reference/importTsBeforeDTs.errors.txt +++ b/tests/baselines/reference/importTsBeforeDTs.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/externalModules/foo_1.ts(2,14): error TS2339: Property 'x' does not exist on type 'typeof "tests/cases/conformance/externalModules/foo_0"'. + + ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require("./foo_0"); var z1 = foo.x + 10; // Should error, as .ts preferred over .d.ts ~ -!!! Property 'x' does not exist on type 'typeof "tests/cases/conformance/externalModules/foo_0"'. +!!! error TS2339: Property 'x' does not exist on type 'typeof "tests/cases/conformance/externalModules/foo_0"'. var z2 = foo.y + 10; // Should resolve ==== tests/cases/conformance/externalModules/foo_0.d.ts (0 errors) ==== diff --git a/tests/baselines/reference/importedModuleAddToGlobal.errors.txt b/tests/baselines/reference/importedModuleAddToGlobal.errors.txt index d6989e5b3b9..2ffd16ecbf2 100644 --- a/tests/baselines/reference/importedModuleAddToGlobal.errors.txt +++ b/tests/baselines/reference/importedModuleAddToGlobal.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/importedModuleAddToGlobal.ts(15,23): error TS2304: Cannot find name 'b'. + + ==== tests/cases/compiler/importedModuleAddToGlobal.ts (1 errors) ==== // Binding for an import statement in a typeref position is being added to the global scope // Shouldn't compile b.B is not defined in C @@ -15,5 +18,5 @@ import a = A; function hello(): b.B { return null; } ~~~ -!!! Cannot find name 'b'. +!!! error TS2304: Cannot find name 'b'. } \ No newline at end of file diff --git a/tests/baselines/reference/inOperator.errors.txt b/tests/baselines/reference/inOperator.errors.txt index 83f11b759e5..7c9c874ea19 100644 --- a/tests/baselines/reference/inOperator.errors.txt +++ b/tests/baselines/reference/inOperator.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/inOperator.ts(7,15): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + + ==== tests/cases/compiler/inOperator.ts (1 errors) ==== var a=[]; @@ -7,7 +10,7 @@ var b = '' in 0; ~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter var c: any; var y: number; diff --git a/tests/baselines/reference/inOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/inOperatorWithInvalidOperands.errors.txt index cb65a412006..5f538eef40c 100644 --- a/tests/baselines/reference/inOperatorWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/inOperatorWithInvalidOperands.errors.txt @@ -1,4 +1,27 @@ -==== tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts (20 errors) ==== +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(12,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(13,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(14,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(15,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(16,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(17,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(18,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(19,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(20,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(30,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(31,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(32,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(33,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(34,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(35,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(36,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(37,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(38,16): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(39,17): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(43,11): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts(43,17): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + + +==== tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts (21 errors) ==== enum E { a } var x: any; @@ -12,31 +35,31 @@ var ra1 = a1 in x; ~~ -!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. var ra2 = a2 in x; ~~ -!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. var ra3 = a3 in x; ~~ -!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. var ra4 = a4 in x; ~~ -!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. var ra5 = null in x; ~~~~ -!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. var ra6 = undefined in x; ~~~~~~~~~ -!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. var ra7 = E.a in x; ~~~ -!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. var ra8 = false in x; ~~~~~ -!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. var ra9 = {} in x; ~~ -!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. // invalid right operands // the right operand is required to be of type Any, an object type, or a type parameter type @@ -44,38 +67,43 @@ var b2: boolean; var b3: string; var b4: void; + var b5: string | number; var rb1 = x in b1; ~~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter var rb2 = x in b2; ~~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter var rb3 = x in b3; ~~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter var rb4 = x in b4; ~~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter - var rb5 = x in 0; - ~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter - var rb6 = x in false; - ~~~~~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter - var rb7 = x in ''; +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb5 = x in b5; ~~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter - var rb8 = x in null; +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb6 = x in 0; + ~ +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb7 = x in false; + ~~~~~ +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb8 = x in ''; + ~~ +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb9 = x in null; ~~~~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter - var rb9 = x in undefined; - ~~~~~~~~~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb10 = x in undefined; + ~~~~~~~~~ +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + // both operands are invalid var rc1 = {} in ''; ~~ -!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. +!!! error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. ~~ -!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter \ No newline at end of file +!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter \ No newline at end of file diff --git a/tests/baselines/reference/inOperatorWithInvalidOperands.js b/tests/baselines/reference/inOperatorWithInvalidOperands.js index eb117aafde3..29293f880ed 100644 --- a/tests/baselines/reference/inOperatorWithInvalidOperands.js +++ b/tests/baselines/reference/inOperatorWithInvalidOperands.js @@ -26,16 +26,19 @@ var b1: number; var b2: boolean; var b3: string; var b4: void; +var b5: string | number; var rb1 = x in b1; var rb2 = x in b2; var rb3 = x in b3; var rb4 = x in b4; -var rb5 = x in 0; -var rb6 = x in false; -var rb7 = x in ''; -var rb8 = x in null; -var rb9 = x in undefined; +var rb5 = x in b5; +var rb6 = x in 0; +var rb7 = x in false; +var rb8 = x in ''; +var rb9 = x in null; +var rb10 = x in undefined; + // both operands are invalid var rc1 = {} in ''; @@ -67,14 +70,16 @@ var b1; var b2; var b3; var b4; +var b5; var rb1 = x in b1; var rb2 = x in b2; var rb3 = x in b3; var rb4 = x in b4; -var rb5 = x in 0; -var rb6 = x in false; -var rb7 = x in ''; -var rb8 = x in null; -var rb9 = x in undefined; +var rb5 = x in b5; +var rb6 = x in 0; +var rb7 = x in false; +var rb8 = x in ''; +var rb9 = x in null; +var rb10 = x in undefined; // both operands are invalid var rc1 = {} in ''; diff --git a/tests/baselines/reference/inOperatorWithValidOperands.js b/tests/baselines/reference/inOperatorWithValidOperands.js index 16df96f22fb..561abbe340b 100644 --- a/tests/baselines/reference/inOperatorWithValidOperands.js +++ b/tests/baselines/reference/inOperatorWithValidOperands.js @@ -21,7 +21,18 @@ var rb2 = x in {}; function foo(t: T) { var rb3 = x in t; -} +} + +interface X { x: number } +interface Y { y: number } + +var c1: X | Y; +var c2: X; +var c3: Y; + +var rc1 = x in c1; +var rc2 = x in (c2 || c3); + //// [inOperatorWithValidOperands.js] var x; @@ -42,3 +53,8 @@ var rb2 = x in {}; function foo(t) { var rb3 = x in t; } +var c1; +var c2; +var c3; +var rc1 = x in c1; +var rc2 = x in (c2 || c3); diff --git a/tests/baselines/reference/inOperatorWithValidOperands.types b/tests/baselines/reference/inOperatorWithValidOperands.types index f621c3bf55d..27ba22055bf 100644 --- a/tests/baselines/reference/inOperatorWithValidOperands.types +++ b/tests/baselines/reference/inOperatorWithValidOperands.types @@ -67,3 +67,40 @@ function foo(t: T) { >x : any >t : T } + +interface X { x: number } +>X : X +>x : number + +interface Y { y: number } +>Y : Y +>y : number + +var c1: X | Y; +>c1 : X | Y +>X : X +>Y : Y + +var c2: X; +>c2 : X +>X : X + +var c3: Y; +>c3 : Y +>Y : Y + +var rc1 = x in c1; +>rc1 : boolean +>x in c1 : boolean +>x : any +>c1 : X | Y + +var rc2 = x in (c2 || c3); +>rc2 : boolean +>x in (c2 || c3) : boolean +>x : any +>(c2 || c3) : X | Y +>c2 || c3 : X | Y +>c2 : X +>c3 : Y + diff --git a/tests/baselines/reference/incompatibleExports1.errors.txt b/tests/baselines/reference/incompatibleExports1.errors.txt index 99a35e122bb..6371bfc5377 100644 --- a/tests/baselines/reference/incompatibleExports1.errors.txt +++ b/tests/baselines/reference/incompatibleExports1.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/incompatibleExports1.ts(4,5): error TS2309: An export assignment cannot be used in a module with other exported elements. +tests/cases/compiler/incompatibleExports1.ts(16,5): error TS2309: An export assignment cannot be used in a module with other exported elements. + + ==== tests/cases/compiler/incompatibleExports1.ts (2 errors) ==== declare module "foo" { export interface x { a: string } interface y { a: Date } export = y; ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. } declare module "baz" { @@ -18,6 +22,6 @@ export = c; ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. +!!! 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/incompatibleExports2.errors.txt b/tests/baselines/reference/incompatibleExports2.errors.txt index a809d70feb7..0ea5a35cf62 100644 --- a/tests/baselines/reference/incompatibleExports2.errors.txt +++ b/tests/baselines/reference/incompatibleExports2.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/incompatibleExports2.ts(4,5): error TS2309: An export assignment cannot be used in a module with other exported elements. + + ==== tests/cases/compiler/incompatibleExports2.ts (1 errors) ==== declare module "foo" { export interface x { a: string } interface y { a: Date } export = y; ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. +!!! 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/incompatibleGenericTypes.errors.txt b/tests/baselines/reference/incompatibleGenericTypes.errors.txt index 5dca84027d8..e5dc6ed5b3c 100644 --- a/tests/baselines/reference/incompatibleGenericTypes.errors.txt +++ b/tests/baselines/reference/incompatibleGenericTypes.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/incompatibleGenericTypes.ts(10,5): error TS2322: Type 'I1' is not assignable to type 'I1'. + Type 'boolean' is not assignable to type 'number'. + + ==== tests/cases/compiler/incompatibleGenericTypes.ts (1 errors) ==== interface I1 { @@ -10,5 +14,5 @@ var v2: I1 = v1; ~~ -!!! Type 'I1' is not assignable to type 'I1': -!!! Type 'boolean' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'I1' is not assignable to type 'I1'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index bac9dbabf1f..14dfa883f45 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -1,3 +1,28 @@ +tests/cases/compiler/incompatibleTypes.ts(5,7): error TS2420: Class 'C1' incorrectly implements interface 'IFoo1'. + Types of property 'p1' are incompatible. + Type '() => string' is not assignable to type '() => number'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/incompatibleTypes.ts(15,7): error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. + Types of property 'p1' are incompatible. + Type '(n: number) => number' is not assignable to type '(s: string) => number'. + Types of parameters 'n' and 's' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/incompatibleTypes.ts(25,7): error TS2420: Class 'C3' incorrectly implements interface 'IFoo3'. + Types of property 'p1' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/incompatibleTypes.ts(33,7): error TS2420: Class 'C4' incorrectly implements interface 'IFoo4'. + Types of property 'p1' are incompatible. + Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }'. + Property 'a' is missing in type '{ c: { b: string; }; d: string; }'. +tests/cases/compiler/incompatibleTypes.ts(42,5): error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. +tests/cases/compiler/incompatibleTypes.ts(49,5): error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. + Property 'c' is missing in type '{ e: number; f: number; }'. +tests/cases/compiler/incompatibleTypes.ts(66,5): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. + Property 'a' is missing in type '{ e: number; f: number; }'. +tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type 'number' 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'. + + ==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ==== interface IFoo1 { p1(): number; @@ -5,10 +30,10 @@ class C1 implements IFoo1 { // incompatible on the return type ~~ -!!! Class 'C1' incorrectly implements interface 'IFoo1': -!!! Types of property 'p1' are incompatible: -!!! Type '() => string' is not assignable to type '() => number': -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'IFoo1'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type '() => string' is not assignable to type '() => number'. +!!! error TS2420: Type 'string' is not assignable to type 'number'. public p1() { return "s"; } @@ -20,11 +45,11 @@ class C2 implements IFoo2 { // incompatible on the param type ~~ -!!! Class 'C2' incorrectly implements interface 'IFoo2': -!!! Types of property 'p1' are incompatible: -!!! Type '(n: number) => number' is not assignable to type '(s: string) => number': -!!! Types of parameters 'n' and 's' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type '(n: number) => number' is not assignable to type '(s: string) => number'. +!!! error TS2420: Types of parameters 'n' and 's' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public p1(n:number) { return 0; } @@ -36,9 +61,9 @@ class C3 implements IFoo3 { // incompatible on the property type ~~ -!!! Class 'C3' incorrectly implements interface 'IFoo3': -!!! Types of property 'p1' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'IFoo3'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public p1: number; } @@ -48,10 +73,10 @@ class C4 implements IFoo4 { // incompatible on the property type ~~ -!!! Class 'C4' incorrectly implements interface 'IFoo4': -!!! Types of property 'p1' are incompatible: -!!! Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }': -!!! Property 'a' is missing in type '{ c: { b: string; }; d: string; }'. +!!! error TS2420: Class 'C4' incorrectly implements interface 'IFoo4'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }'. +!!! error TS2420: Property 'a' is missing in type '{ c: { b: string; }; d: string; }'. public p1: { c: { b: string; }; d: string; }; } @@ -62,7 +87,7 @@ var c2: C2; if1(c1); ~~ -!!! Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. +!!! error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. function of1(n: { a: { a: string; }; b: string; }): number; @@ -71,8 +96,8 @@ of1({ e: 0, f: 0 }); ~~~~~~~~~~~~~~ -!!! Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. -!!! Property 'c' is missing in type '{ e: number; f: number; }'. +!!! error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. +!!! error TS2345: Property 'c' is missing in type '{ e: number; f: number; }'. interface IMap { [key:string]:string; @@ -91,8 +116,8 @@ var o1: { a: { a: string; }; b: string; } = { e: 0, f: 0 }; ~~ -!!! Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }': -!!! Property 'a' is missing in type '{ e: number; f: number; }'. +!!! error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. +!!! error TS2322: Property 'a' is missing in type '{ e: number; f: number; }'. var a1 = [{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }]; @@ -100,9 +125,9 @@ var i1c1: { (): string; } = 5; ~~~~ -!!! Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Type 'number' is not assignable to type '() => string'. var fp1: () =>any = a => 0; ~~~ -!!! Type '(a: any) => number' is not assignable to type '() => any'. +!!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. \ No newline at end of file diff --git a/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt b/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt index f54412d13d4..b338129db8c 100644 --- a/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt +++ b/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt @@ -1,7 +1,11 @@ +tests/cases/compiler/incompleteDottedExpressionAtEOF.ts(2,18): error TS1003: Identifier expected. +tests/cases/compiler/incompleteDottedExpressionAtEOF.ts(2,10): error TS2304: Cannot find name 'window'. + + ==== tests/cases/compiler/incompleteDottedExpressionAtEOF.ts (2 errors) ==== // used to leak __missing into error message var p2 = window. -!!! Identifier expected. +!!! error TS1003: Identifier expected. ~~~~~~ -!!! Cannot find name 'window'. \ No newline at end of file +!!! error TS2304: Cannot find name 'window'. \ No newline at end of file diff --git a/tests/baselines/reference/incompleteObjectLiteral1.errors.txt b/tests/baselines/reference/incompleteObjectLiteral1.errors.txt index 60bebb70367..2e363de591e 100644 --- a/tests/baselines/reference/incompleteObjectLiteral1.errors.txt +++ b/tests/baselines/reference/incompleteObjectLiteral1.errors.txt @@ -1,7 +1,11 @@ +tests/cases/compiler/incompleteObjectLiteral1.ts(1,14): error TS1005: ':' expected. +tests/cases/compiler/incompleteObjectLiteral1.ts(1,16): error TS1128: Declaration or statement expected. + + ==== tests/cases/compiler/incompleteObjectLiteral1.ts (2 errors) ==== var tt = { aa; } ~ -!!! ':' expected. +!!! error TS1005: ':' expected. ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. var x = tt; \ No newline at end of file diff --git a/tests/baselines/reference/incorrectClassOverloadChain.errors.txt b/tests/baselines/reference/incorrectClassOverloadChain.errors.txt index c6a4361b56e..c33ba4c9b7b 100644 --- a/tests/baselines/reference/incorrectClassOverloadChain.errors.txt +++ b/tests/baselines/reference/incorrectClassOverloadChain.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/incorrectClassOverloadChain.ts(3,5): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/compiler/incorrectClassOverloadChain.ts (1 errors) ==== class C { foo(): string; foo(x): number; ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. x = 1; } \ No newline at end of file diff --git a/tests/baselines/reference/incrementAndDecrement.errors.txt b/tests/baselines/reference/incrementAndDecrement.errors.txt index b8dc8c5b4e0..f8a718c5f06 100644 --- a/tests/baselines/reference/incrementAndDecrement.errors.txt +++ b/tests/baselines/reference/incrementAndDecrement.errors.txt @@ -1,3 +1,26 @@ +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(8,5): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(11,5): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(14,5): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(17,5): error TS1005: ';' expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(5,9): error TS2304: Cannot find name 'window'. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(24,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(25,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(26,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(27,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(34,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(35,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(36,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(37,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(44,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(45,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(46,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(47,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(55,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(56,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(57,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + + ==== tests/cases/conformance/expressions/operators/incrementAndDecrement.ts (21 errors) ==== enum E { A, B, C }; var x = 4; @@ -5,27 +28,27 @@ var a: any; var w = window; ~~~~~~ -!!! Cannot find name 'window'. +!!! error TS2304: Cannot find name 'window'. // Assign to expression++ x++ = 4; // Error ~ -!!! ';' expected. +!!! error TS1005: ';' expected. // Assign to expression-- x-- = 5; // Error ~ -!!! ';' expected. +!!! error TS1005: ';' expected. // Assign to++expression ++x = 4; // Error ~ -!!! ';' expected. +!!! error TS1005: ';' expected. // Assign to--expression --x = 5; // Error ~ -!!! ';' expected. +!!! error TS1005: ';' expected. // Pre and postfix++ on number x++; @@ -34,16 +57,16 @@ --x; ++x++; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --x--; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++x--; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --x++; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. // Pre and postfix++ on enum e++; @@ -52,16 +75,16 @@ --e; ++e++; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --e--; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++e--; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --e++; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. // Pre and postfix++ on value of type 'any' a++; @@ -70,16 +93,16 @@ --a; ++a++; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --a--; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++a--; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --a++; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. // Pre and postfix++ on other types @@ -89,16 +112,16 @@ --w; // Error ++w++; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --w--; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++w--; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. --w++; // Error ~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOnTypeParameter.errors.txt b/tests/baselines/reference/incrementOnTypeParameter.errors.txt index b9461c690e2..10cfb13aee5 100644 --- a/tests/baselines/reference/incrementOnTypeParameter.errors.txt +++ b/tests/baselines/reference/incrementOnTypeParameter.errors.txt @@ -1,13 +1,17 @@ +tests/cases/compiler/incrementOnTypeParameter.ts(4,9): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/compiler/incrementOnTypeParameter.ts(5,39): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + + ==== tests/cases/compiler/incrementOnTypeParameter.ts (2 errors) ==== class C { a: T; foo() { this.a++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. for (var i: T, j = 0; j < 10; i++) { ~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. } } } diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types index 3d43764943a..930c87274d0 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types @@ -9,13 +9,13 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] ->["", ""] : any[] +>["", ""] : string[] var obj = {x:1,y:null}; >obj : { x: number; y: any; } >{x:1,y:null} : { x: number; y: null; } >x : number ->y : any +>y : null class A { >A : A diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt index 6ebcb4490eb..ab301964026 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -1,3 +1,47 @@ +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(25,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(26,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(27,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(28,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(30,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(31,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(32,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(33,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(34,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(37,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(38,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(39,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(41,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(42,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(43,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(46,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(47,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(48,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(49,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(50,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(51,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(52,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(54,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(55,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(56,25): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(57,25): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(58,25): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(59,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(60,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(63,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(65,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(67,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(68,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(68,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + + ==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts (42 errors) ==== // ++ operator on any type var ANY1; @@ -24,131 +68,131 @@ // any type var var ResultIsNumber1 = ++ANY2; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber2 = ++A; ~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber3 = ++M; ~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber4 = ++obj; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber5 = ++obj1; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber6 = ANY2++; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber7 = A++; ~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber8 = M++; ~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber9 = obj++; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber10 = obj1++; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // any type literal var ResultIsNumber11 = ++{}; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber12 = ++null; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber13 = ++undefined; ~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber14 = null++; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber15 = {}++; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber16 = undefined++; ~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // any type expressions var ResultIsNumber17 = ++foo(); ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber18 = ++A.foo(); ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber19 = ++(null + undefined); ~~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber20 = ++(null + null); ~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber21 = ++(undefined + undefined); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber22 = ++obj1.x; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber23 = ++obj1.y; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber24 = foo()++; ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber25 = A.foo()++; ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber26 = (null + undefined)++; ~~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber27 = (null + null)++; ~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsNumber28 = (undefined + undefined)++; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsNumber29 = obj1.x++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber30 = obj1.y++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // miss assignment operators ++ANY2; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ANY2++; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++ANY1++; ~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++ANY2++; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++ANY2[0]++; ~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt b/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..9bcf6c7612f --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,23): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + + +==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts (2 errors) ==== + // ++ operator on enum type + + enum ENUM1 { A, B, "" }; + + // expression + var ResultIsNumber1 = ++ENUM1["B"]; + var ResultIsNumber2 = ENUM1.B++; + ~~~~~~~ +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + + // miss assignment operator + ++ENUM1["B"]; + + ENUM1.B++; + ~~~~~~~ +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithEnumType.js b/tests/baselines/reference/incrementOperatorWithEnumType.js index cdea036c335..590815ffec5 100644 --- a/tests/baselines/reference/incrementOperatorWithEnumType.js +++ b/tests/baselines/reference/incrementOperatorWithEnumType.js @@ -1,29 +1,29 @@ //// [incrementOperatorWithEnumType.ts] // ++ operator on enum type -enum ENUM1 { 1, 2, "" }; +enum ENUM1 { A, B, "" }; // expression -var ResultIsNumber1 = ++ENUM1[1]; -var ResultIsNumber2 = ENUM1[1]++; +var ResultIsNumber1 = ++ENUM1["B"]; +var ResultIsNumber2 = ENUM1.B++; // miss assignment operator -++ENUM1[1]; +++ENUM1["B"]; -ENUM1[1]++; +ENUM1.B++; //// [incrementOperatorWithEnumType.js] // ++ operator on enum type var ENUM1; (function (ENUM1) { - ENUM1[ENUM1["1"] = 0] = "1"; - ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1["A"] = 0] = "A"; + ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; })(ENUM1 || (ENUM1 = {})); ; // expression -var ResultIsNumber1 = ++ENUM1[1]; -var ResultIsNumber2 = ENUM1[1]++; +var ResultIsNumber1 = ++1 /* "B" */; +var ResultIsNumber2 = 1 /* B */++; // miss assignment operator -++ENUM1[1]; -ENUM1[1]++; +++1 /* "B" */; +1 /* B */++; diff --git a/tests/baselines/reference/incrementOperatorWithEnumType.types b/tests/baselines/reference/incrementOperatorWithEnumType.types deleted file mode 100644 index 3b13c01d5df..00000000000 --- a/tests/baselines/reference/incrementOperatorWithEnumType.types +++ /dev/null @@ -1,30 +0,0 @@ -=== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts === -// ++ operator on enum type - -enum ENUM1 { 1, 2, "" }; ->ENUM1 : ENUM1 - -// expression -var ResultIsNumber1 = ++ENUM1[1]; ->ResultIsNumber1 : number ->++ENUM1[1] : number ->ENUM1[1] : ENUM1 ->ENUM1 : typeof ENUM1 - -var ResultIsNumber2 = ENUM1[1]++; ->ResultIsNumber2 : number ->ENUM1[1]++ : number ->ENUM1[1] : ENUM1 ->ENUM1 : typeof ENUM1 - -// miss assignment operator -++ENUM1[1]; ->++ENUM1[1] : number ->ENUM1[1] : ENUM1 ->ENUM1 : typeof ENUM1 - -ENUM1[1]++; ->ENUM1[1]++ : number ->ENUM1[1] : ENUM1 ->ENUM1 : typeof ENUM1 - diff --git a/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt index f2262423810..08a1b8ec460 100644 --- a/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt @@ -1,43 +1,55 @@ +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(7,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(8,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(10,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(11,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(14,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(15,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(18,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(19,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(21,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(22,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + + ==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts (10 errors) ==== // ++ operator on enum type enum ENUM { }; - enum ENUM1 { 1, 2, "" }; + enum ENUM1 { A, B, "" }; // enum type var var ResultIsNumber1 = ++ENUM; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber2 = ++ENUM1; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber3 = ENUM++; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber4 = ENUM1++; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // enum type expressions var ResultIsNumber5 = ++(ENUM[1] + ENUM[2]); ~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber6 = (ENUM[1] + ENUM[2])++; ~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // miss assignment operator ++ENUM; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++ENUM1; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ENUM++; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ENUM1++; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.js b/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.js index ed9b33e16bb..3bc43cefa4b 100644 --- a/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.js +++ b/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.js @@ -2,7 +2,7 @@ // ++ operator on enum type enum ENUM { }; -enum ENUM1 { 1, 2, "" }; +enum ENUM1 { A, B, "" }; // enum type var var ResultIsNumber1 = ++ENUM; @@ -30,8 +30,8 @@ var ENUM; ; var ENUM1; (function (ENUM1) { - ENUM1[ENUM1["1"] = 0] = "1"; - ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1["A"] = 0] = "A"; + ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; })(ENUM1 || (ENUM1 = {})); ; diff --git a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt index be0ea1d1492..71c3ad67c46 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt @@ -1,3 +1,25 @@ +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(18,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(19,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(22,25): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(23,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(26,23): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(27,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(28,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(31,25): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(32,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(33,26): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(35,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(36,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(37,24): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(40,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(41,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(42,3): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(44,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(45,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts(46,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. + + ==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts (20 errors) ==== // ++ operator on number type var NUMBER: number; @@ -18,70 +40,70 @@ //number type var var ResultIsNumber1 = ++NUMBER1; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber2 = NUMBER1++; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // number type literal var ResultIsNumber3 = ++1; ~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber4 = ++{ x: 1, y: 2}; ~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber5 = ++{ x: 1, y: (n: number) => { return n; } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber6 = 1++; ~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber7 = { x: 1, y: 2 }++; ~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber8 = { x: 1, y: (n: number) => { return n; } }++; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // number type expressions var ResultIsNumber9 = ++foo(); ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber10 = ++A.foo(); ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber11 = ++(NUMBER + NUMBER); ~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber12 = foo()++; ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber13 = A.foo()++; ~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. var ResultIsNumber14 = (NUMBER + NUMBER)++; ~~~~~~~~~~~~~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. // miss assignment operator ++1; ~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. ++NUMBER1; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++foo(); ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. 1++; ~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. NUMBER1++; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. foo()++; ~~~~~ -!!! The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file +!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt index ff51aac9af0..42c00a2bf28 100644 --- a/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt @@ -1,3 +1,34 @@ +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(17,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(19,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(22,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(23,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(26,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(27,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(28,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(31,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(32,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(33,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(34,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(36,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(37,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(38,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(39,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(42,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(43,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(44,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(45,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(46,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(47,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(49,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(50,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(51,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(52,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(53,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(54,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts(54,11): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + + ==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts (29 errors) ==== // ++ operator on boolean type var BOOLEAN: boolean; @@ -17,97 +48,97 @@ // boolean type var var ResultIsNumber1 = ++BOOLEAN; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber2 = BOOLEAN++; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // boolean type literal var ResultIsNumber3 = ++true; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber4 = ++{ x: true, y: false }; ~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber5 = ++{ x: true, y: (n: boolean) => { return n; } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber6 = true++; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber7 = { x: true, y: false }++; ~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }++; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // boolean type expressions var ResultIsNumber9 = ++objA.a; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber10 = ++M.n; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber11 = ++foo(); ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber12 = ++A.foo(); ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber13 = foo()++; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber14 = A.foo()++; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber15 = objA.a++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber16 = M.n++; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // miss assignment operators ++true; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++BOOLEAN; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++foo(); ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++objA.a; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++M.n; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++objA.a, M.n; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. true++; ~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. BOOLEAN++; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. foo()++; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. objA.a++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. M.n++; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. objA.a++, M.n++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt index 3449108faa4..7947bcb34b8 100644 --- a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt @@ -1,3 +1,44 @@ +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(18,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(19,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(21,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(22,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(25,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(26,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(27,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(29,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(30,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(31,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(34,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(35,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(36,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(37,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(38,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(39,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(41,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(42,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(43,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(44,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(45,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(46,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(49,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(50,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(51,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(52,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(53,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(54,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(55,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(56,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(58,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(59,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(60,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(61,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(62,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(63,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(64,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(65,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts(65,11): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. + + ==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts (39 errors) ==== // ++ operator on string type var STRING: string; @@ -18,127 +59,127 @@ // string type var var ResultIsNumber1 = ++STRING; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber2 = ++STRING1; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber3 = STRING++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber4 = STRING1++; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // string type literal var ResultIsNumber5 = ++""; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber6 = ++{ x: "", y: "" }; ~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber7 = ++{ x: "", y: (s: string) => { return s; } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber8 = ""++; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber9 = { x: "", y: "" }++; ~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }++; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // string type expressions var ResultIsNumber11 = ++objA.a; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber12 = ++M.n; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber13 = ++STRING1[0]; ~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber14 = ++foo(); ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber15 = ++A.foo(); ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber16 = ++(STRING + STRING); ~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber17 = objA.a++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber18 = M.n++; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber19 = STRING1[0]++; ~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber20 = foo()++; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber21 = A.foo()++; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. var ResultIsNumber22 = (STRING + STRING)++; ~~~~~~~~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. // miss assignment operators ++""; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++STRING; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++STRING1; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++STRING1[0]; ~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++foo(); ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++objA.a; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++M.n; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++objA.a, M.n; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ""++; ~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. STRING++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. STRING1++; ~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. STRING1[0]++; ~~~~~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. foo()++; ~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. objA.a++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. M.n++; ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. objA.a++, M.n++; ~~~~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ~~~ -!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/indexIntoArraySubclass.errors.txt b/tests/baselines/reference/indexIntoArraySubclass.errors.txt index 83919640f7a..1628e12d22f 100644 --- a/tests/baselines/reference/indexIntoArraySubclass.errors.txt +++ b/tests/baselines/reference/indexIntoArraySubclass.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2322: Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/indexIntoArraySubclass.ts (1 errors) ==== interface Foo2 extends Array { } var x2: Foo2; var r = x2[0]; // string r = 0; //error ~ -!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt index d0aec71ef15..e7437fcb056 100644 --- a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt +++ b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt @@ -1,22 +1,28 @@ +tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(2,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,5): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(7,6): error TS1022: An index signature parameter must have a type annotation. +tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(12,5): error TS1021: An index signature must have a type annotation. + + ==== tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts (4 errors) ==== interface I { [x]: string; ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. [x: string]; - ~~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. } class C { [x]: string ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. } class C2 { [x: string] ~~~~~~~~~~~ -!!! An index signature must have a type annotation. +!!! error TS1021: An index signature must have a type annotation. } \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureTypeCheck.errors.txt b/tests/baselines/reference/indexSignatureTypeCheck.errors.txt index 0c808feecbf..1cc69f6294b 100644 --- a/tests/baselines/reference/indexSignatureTypeCheck.errors.txt +++ b/tests/baselines/reference/indexSignatureTypeCheck.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/indexSignatureTypeCheck.ts(14,6): error TS1019: An index signature parameter cannot have a question mark. +tests/cases/compiler/indexSignatureTypeCheck.ts(15,9): error TS1017: An index signature cannot have a rest parameter. +tests/cases/compiler/indexSignatureTypeCheck.ts(16,6): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/indexSignatureTypeCheck.ts(17,6): error TS1096: An index signature must have exactly one parameter. + + ==== tests/cases/compiler/indexSignatureTypeCheck.ts (4 errors) ==== interface IPropertySet { @@ -14,14 +20,14 @@ interface indexErrors { [p2?: string]; ~~ -!!! An index signature parameter cannot have a question mark. +!!! error TS1019: An index signature parameter cannot have a question mark. [...p3: any[]]; ~~ -!!! An index signature cannot have a rest parameter. +!!! error TS1017: An index signature cannot have a rest parameter. [p4: string, p5?: string]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. [p6: string, ...p7: any[]]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. } \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureTypeCheck2.errors.txt b/tests/baselines/reference/indexSignatureTypeCheck2.errors.txt index 88a004e0b37..25e3ab94280 100644 --- a/tests/baselines/reference/indexSignatureTypeCheck2.errors.txt +++ b/tests/baselines/reference/indexSignatureTypeCheck2.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/indexSignatureTypeCheck2.ts(10,6): error TS1019: An index signature parameter cannot have a question mark. +tests/cases/compiler/indexSignatureTypeCheck2.ts(11,9): error TS1017: An index signature cannot have a rest parameter. +tests/cases/compiler/indexSignatureTypeCheck2.ts(12,6): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/indexSignatureTypeCheck2.ts(13,6): error TS1096: An index signature must have exactly one parameter. + + ==== tests/cases/compiler/indexSignatureTypeCheck2.ts (4 errors) ==== class IPropertySet { [index: string]: any @@ -10,14 +16,14 @@ interface indexErrors { [p2?: string]; ~~ -!!! An index signature parameter cannot have a question mark. +!!! error TS1019: An index signature parameter cannot have a question mark. [...p3: any[]]; ~~ -!!! An index signature cannot have a rest parameter. +!!! error TS1017: An index signature cannot have a rest parameter. [p4: string, p5?: string]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. [p6: string, ...p7: any[]]; ~~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. } \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureTypeInference.errors.txt b/tests/baselines/reference/indexSignatureTypeInference.errors.txt index ee42069a4ec..55bd2ce884f 100644 --- a/tests/baselines/reference/indexSignatureTypeInference.errors.txt +++ b/tests/baselines/reference/indexSignatureTypeInference.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts(18,27): error TS2345: Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap<{}>'. + + ==== tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts (1 errors) ==== interface NumberMap { [index: number]: T; @@ -18,6 +21,6 @@ var v1 = numberMapToArray(stringMap); // Ok var v1 = stringMapToArray(numberMap); // Error expected here ~~~~~~~~~ -!!! Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap<{}>'. +!!! error TS2345: Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap<{}>'. var v1 = stringMapToArray(stringMap); // Ok \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt b/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt index 0b857a8df05..6c836e268d6 100644 --- a/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt +++ b/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt @@ -1,16 +1,22 @@ +tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts(2,13): error TS1018: An index signature parameter cannot have an accessibility modifier. +tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts(6,13): error TS1018: An index signature parameter cannot have an accessibility modifier. +tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts(2,6): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts(6,6): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts (4 errors) ==== interface I { [public x: string]: string; ~ -!!! An index signature parameter cannot have an accessibility modifier. +!!! error TS1018: An index signature parameter cannot have an accessibility modifier. ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } class C { [public x: string]: string ~ -!!! An index signature parameter cannot have an accessibility modifier. +!!! error TS1018: An index signature parameter cannot have an accessibility modifier. ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureWithInitializer.errors.txt b/tests/baselines/reference/indexSignatureWithInitializer.errors.txt index c82a2103e66..9eeff2c5781 100644 --- a/tests/baselines/reference/indexSignatureWithInitializer.errors.txt +++ b/tests/baselines/reference/indexSignatureWithInitializer.errors.txt @@ -1,16 +1,22 @@ +tests/cases/compiler/indexSignatureWithInitializer.ts(2,6): error TS1020: An index signature parameter cannot have an initializer. +tests/cases/compiler/indexSignatureWithInitializer.ts(6,6): error TS1020: An index signature parameter cannot have an initializer. +tests/cases/compiler/indexSignatureWithInitializer.ts(2,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +tests/cases/compiler/indexSignatureWithInitializer.ts(6,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. + + ==== tests/cases/compiler/indexSignatureWithInitializer.ts (4 errors) ==== interface I { [x = '']: string; ~ -!!! An index signature parameter cannot have an initializer. +!!! error TS1020: An index signature parameter cannot have an initializer. ~~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. } class C { [x = 0]: string ~ -!!! An index signature parameter cannot have an initializer. +!!! error TS1020: An index signature parameter cannot have an initializer. ~~~~~ -!!! A parameter initializer is only allowed in a function or constructor implementation. +!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.types b/tests/baselines/reference/indexSignaturesInferentialTyping.types index 3c16db3a2bf..4054ccca227 100644 --- a/tests/baselines/reference/indexSignaturesInferentialTyping.types +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.types @@ -24,10 +24,10 @@ var x1 = foo({ 0: 0, 1: 1 }); // type should be number >{ 0: 0, 1: 1 } : { [x: number]: number; 0: number; 1: number; } var x2 = foo({ zero: 0, one: 1 }); ->x2 : {} ->foo({ zero: 0, one: 1 }) : {} +>x2 : any +>foo({ zero: 0, one: 1 }) : any >foo : (items: { [x: number]: T; }) => T ->{ zero: 0, one: 1 } : { [x: number]: {}; zero: number; one: number; } +>{ zero: 0, one: 1 } : { [x: number]: undefined; zero: number; one: number; } >zero : number >one : number diff --git a/tests/baselines/reference/indexTypeCheck.errors.txt b/tests/baselines/reference/indexTypeCheck.errors.txt index d5a9fab9d62..efa02c3ff1f 100644 --- a/tests/baselines/reference/indexTypeCheck.errors.txt +++ b/tests/baselines/reference/indexTypeCheck.errors.txt @@ -1,11 +1,21 @@ +tests/cases/compiler/indexTypeCheck.ts(2,2): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/indexTypeCheck.ts(3,2): error TS1021: An index signature must have a type annotation. +tests/cases/compiler/indexTypeCheck.ts(32,3): error TS1096: An index signature must have exactly one parameter. +tests/cases/compiler/indexTypeCheck.ts(36,3): error TS1023: An index signature parameter type must be 'string' or 'number'. +tests/cases/compiler/indexTypeCheck.ts(17,2): error TS2413: Numeric index type 'number' is not assignable to string index type 'string'. +tests/cases/compiler/indexTypeCheck.ts(22,2): error TS2413: Numeric index type 'Orange' is not assignable to string index type 'Yellow'. +tests/cases/compiler/indexTypeCheck.ts(27,2): error TS2413: Numeric index type 'number' is not assignable to string index type 'string'. +tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression argument must be of type 'string', 'number', or 'any'. + + ==== tests/cases/compiler/indexTypeCheck.ts (8 errors) ==== interface Red { [n:number]; // ok - ~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. [s:string]; // ok - ~~~~~~~~~~ -!!! An index signature must have a type annotation. + ~~~~~~~~~~~ +!!! error TS1021: An index signature must have a type annotation. } interface Blue { @@ -21,34 +31,34 @@ interface Orange { [n:number]: number; // ok ~~~~~~~~~~~~~~~~~~~ -!!! Numeric index type 'number' is not assignable to string index type 'string'. +!!! error TS2413: Numeric index type 'number' is not assignable to string index type 'string'. [s:string]: string; // error } interface Green { [n:number]: Orange; // error ~~~~~~~~~~~~~~~~~~~ -!!! Numeric index type 'Orange' is not assignable to string index type 'Yellow'. +!!! error TS2413: Numeric index type 'Orange' is not assignable to string index type 'Yellow'. [s:string]: Yellow; // ok } interface Cyan { [n:number]: number; // error ~~~~~~~~~~~~~~~~~~~ -!!! Numeric index type 'number' is not assignable to string index type 'string'. +!!! error TS2413: Numeric index type 'number' is not assignable to string index type 'string'. [s:string]: string; // ok } interface Purple { [n:number, s:string]; // error ~ -!!! An index signature must have exactly one parameter. +!!! error TS1096: An index signature must have exactly one parameter. } interface Magenta { [p:Purple]; // error ~ -!!! An index signature parameter type must be 'string' or 'number'. +!!! error TS1023: An index signature parameter type must be 'string' or 'number'. } var yellow: Yellow; @@ -65,7 +75,7 @@ yellow[blue]; // error ~~~~~~~~~~~~ -!!! An index expression argument must be of type 'string', 'number', or 'any'. +!!! error TS2342: An index expression argument must be of type 'string', 'number', or 'any'. var x:number[]; x[0]; diff --git a/tests/baselines/reference/indexWithoutParamType.errors.txt b/tests/baselines/reference/indexWithoutParamType.errors.txt index 0fc4f4c094f..01a5b44a2e0 100644 --- a/tests/baselines/reference/indexWithoutParamType.errors.txt +++ b/tests/baselines/reference/indexWithoutParamType.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/indexWithoutParamType.ts(1,10): error TS1096: An index signature must have exactly one parameter. + + ==== tests/cases/compiler/indexWithoutParamType.ts (1 errors) ==== var y: { []; } // Error - ~~ -!!! An index signature must have exactly one parameter. \ No newline at end of file + ~~~ +!!! error TS1096: An index signature must have exactly one parameter. \ No newline at end of file diff --git a/tests/baselines/reference/indexWithoutParamType2.errors.txt b/tests/baselines/reference/indexWithoutParamType2.errors.txt index 50cdb50379e..3e7b9b49223 100644 --- a/tests/baselines/reference/indexWithoutParamType2.errors.txt +++ b/tests/baselines/reference/indexWithoutParamType2.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/indexWithoutParamType2.ts(2,6): error TS1022: An index signature parameter must have a type annotation. + + ==== tests/cases/compiler/indexWithoutParamType2.ts (1 errors) ==== class C { [x]: string ~ -!!! An index signature parameter must have a type annotation. +!!! error TS1022: An index signature parameter must have a type annotation. } \ No newline at end of file diff --git a/tests/baselines/reference/indexer.types b/tests/baselines/reference/indexer.types index 236113cfaa8..9987fdde0b1 100644 --- a/tests/baselines/reference/indexer.types +++ b/tests/baselines/reference/indexer.types @@ -17,7 +17,7 @@ interface JQuery { var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >jq : JQuery >JQuery : JQuery ->{ 0: { id : "a" }, 1: { id : "b" } } : { [x: number]: JQueryElement; 0: { id: string; }; 1: { id: string; }; } +>{ 0: { id : "a" }, 1: { id : "b" } } : { [x: number]: { id: string; }; 0: { id: string; }; 1: { id: string; }; } >{ id : "a" } : { id: string; } >id : string >{ id : "b" } : { id: string; } diff --git a/tests/baselines/reference/indexer2.errors.txt b/tests/baselines/reference/indexer2.errors.txt new file mode 100644 index 00000000000..28020a570ed --- /dev/null +++ b/tests/baselines/reference/indexer2.errors.txt @@ -0,0 +1,20 @@ +tests/cases/compiler/indexer2.ts(6,25): error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. + Types of property 'hasOwnProperty' are incompatible. + Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. + Types of parameters 'v' and 'objectId' are incompatible. + Type 'string' is not assignable to type 'number'. + + +==== tests/cases/compiler/indexer2.ts (1 errors) ==== + interface IHeapObjectProperty {} + interface IDirectChildrenMap { + hasOwnProperty(objectId: number) : boolean; + [objectId: number] : IHeapObjectProperty[]; + } + var directChildrenMap = {}; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. +!!! error TS2352: Types of property 'hasOwnProperty' are incompatible. +!!! error TS2352: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. +!!! error TS2352: Types of parameters 'v' and 'objectId' are incompatible. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/indexer2.types b/tests/baselines/reference/indexer2.types deleted file mode 100644 index 498ade679a8..00000000000 --- a/tests/baselines/reference/indexer2.types +++ /dev/null @@ -1,21 +0,0 @@ -=== tests/cases/compiler/indexer2.ts === -interface IHeapObjectProperty {} ->IHeapObjectProperty : IHeapObjectProperty - -interface IDirectChildrenMap { ->IDirectChildrenMap : IDirectChildrenMap - - hasOwnProperty(objectId: number) : boolean; ->hasOwnProperty : (objectId: number) => boolean ->objectId : number - - [objectId: number] : IHeapObjectProperty[]; ->objectId : number ->IHeapObjectProperty : IHeapObjectProperty -} -var directChildrenMap = {}; ->directChildrenMap : IDirectChildrenMap ->{} : IDirectChildrenMap ->IDirectChildrenMap : IDirectChildrenMap ->{} : { [x: number]: IHeapObjectProperty[]; } - diff --git a/tests/baselines/reference/indexer2A.errors.txt b/tests/baselines/reference/indexer2A.errors.txt index 59575b3ef5b..f2314c5b49b 100644 --- a/tests/baselines/reference/indexer2A.errors.txt +++ b/tests/baselines/reference/indexer2A.errors.txt @@ -1,10 +1,24 @@ -==== tests/cases/compiler/indexer2A.ts (1 errors) ==== +tests/cases/compiler/indexer2A.ts(4,5): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/indexer2A.ts(7,25): error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. + Types of property 'hasOwnProperty' are incompatible. + Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. + Types of parameters 'v' and 'objectId' are incompatible. + Type 'string' is not assignable to type 'number'. + + +==== tests/cases/compiler/indexer2A.ts (2 errors) ==== class IHeapObjectProperty { } class IDirectChildrenMap { // Decided to enforce a semicolon after declarations hasOwnProperty(objectId: number): boolean ~~~~~~~~~~~~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. [objectId: number]: IHeapObjectProperty[] } - var directChildrenMap = {}; \ No newline at end of file + var directChildrenMap = {}; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. +!!! error TS2352: Types of property 'hasOwnProperty' are incompatible. +!!! error TS2352: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. +!!! error TS2352: Types of parameters 'v' and 'objectId' are incompatible. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/indexer3.types b/tests/baselines/reference/indexer3.types index 2b23ac85885..7f660ab6aa9 100644 --- a/tests/baselines/reference/indexer3.types +++ b/tests/baselines/reference/indexer3.types @@ -3,7 +3,7 @@ var dateMap: { [x: string]: Date; } = {} >dateMap : { [x: string]: Date; } >x : string >Date : Date ->{} : { [x: string]: Date; } +>{} : { [x: string]: undefined; } var r: Date = dateMap["hello"] // result type includes indexer using BCT >r : Date diff --git a/tests/baselines/reference/indexerA.types b/tests/baselines/reference/indexerA.types index 7b409ecedc0..39f7372c839 100644 --- a/tests/baselines/reference/indexerA.types +++ b/tests/baselines/reference/indexerA.types @@ -17,7 +17,7 @@ class JQuery { var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >jq : JQuery >JQuery : JQuery ->{ 0: { id : "a" }, 1: { id : "b" } } : { [x: number]: JQueryElement; 0: { id: string; }; 1: { id: string; }; } +>{ 0: { id : "a" }, 1: { id : "b" } } : { [x: number]: { id: string; }; 0: { id: string; }; 1: { id: string; }; } >{ id : "a" } : { id: string; } >id : string >{ id : "b" } : { id: string; } diff --git a/tests/baselines/reference/indexerAsOptional.errors.txt b/tests/baselines/reference/indexerAsOptional.errors.txt index c76a4791936..101c03acccd 100644 --- a/tests/baselines/reference/indexerAsOptional.errors.txt +++ b/tests/baselines/reference/indexerAsOptional.errors.txt @@ -1,14 +1,18 @@ +tests/cases/compiler/indexerAsOptional.ts(3,6): error TS1019: An index signature parameter cannot have a question mark. +tests/cases/compiler/indexerAsOptional.ts(8,6): error TS1019: An index signature parameter cannot have a question mark. + + ==== tests/cases/compiler/indexerAsOptional.ts (2 errors) ==== interface indexSig { //Index signatures can't be optional [idx?: number]: any; //err ~~~ -!!! An index signature parameter cannot have a question mark. +!!! error TS1019: An index signature parameter cannot have a question mark. } class indexSig2 { //Index signatures can't be optional [idx?: number]: any //err ~~~ -!!! An index signature parameter cannot have a question mark. +!!! error TS1019: An index signature parameter cannot have a question mark. } \ No newline at end of file diff --git a/tests/baselines/reference/indexerAssignability.errors.txt b/tests/baselines/reference/indexerAssignability.errors.txt index b7dca06f207..9f28fc1e9e0 100644 --- a/tests/baselines/reference/indexerAssignability.errors.txt +++ b/tests/baselines/reference/indexerAssignability.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/indexerAssignability.ts(5,1): error TS2322: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }'. + Index signature is missing in type '{ [x: number]: string; }'. +tests/cases/compiler/indexerAssignability.ts(6,1): error TS2322: Type '{}' is not assignable to type '{ [x: string]: string; }'. + Index signature is missing in type '{}'. +tests/cases/compiler/indexerAssignability.ts(8,1): error TS2322: Type '{}' is not assignable to type '{ [x: number]: string; }'. + Index signature is missing in type '{}'. + + ==== tests/cases/compiler/indexerAssignability.ts (3 errors) ==== var a: { [s: string]: string; }; var b: { [n: number]: string; }; @@ -5,16 +13,16 @@ a = b; ~ -!!! Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }': -!!! Index signature is missing in type '{ [x: number]: string; }'. +!!! error TS2322: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signature is missing in type '{ [x: number]: string; }'. a = c; ~ -!!! Type '{}' is not assignable to type '{ [x: string]: string; }': -!!! Index signature is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signature is missing in type '{}'. b = a; b = c; ~ -!!! Type '{}' is not assignable to type '{ [x: number]: string; }': -!!! Index signature is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2322: Index signature is missing in type '{}'. c = a; c = b; \ No newline at end of file diff --git a/tests/baselines/reference/indexerConstraints.errors.txt b/tests/baselines/reference/indexerConstraints.errors.txt index ff0a75e0b7f..cb7785535d1 100644 --- a/tests/baselines/reference/indexerConstraints.errors.txt +++ b/tests/baselines/reference/indexerConstraints.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/indexerConstraints.ts(17,5): error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. +tests/cases/compiler/indexerConstraints.ts(25,5): error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. +tests/cases/compiler/indexerConstraints.ts(33,5): error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. +tests/cases/compiler/indexerConstraints.ts(41,5): error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. + + ==== tests/cases/compiler/indexerConstraints.ts (4 errors) ==== interface A { a: number; } interface B extends A { b: number; } @@ -17,7 +23,7 @@ interface E { [n: number]: A; ~~~~~~~~~~~~~~~ -!!! Numeric index type 'A' is not assignable to string index type 'B'. +!!! error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. } // Inheritance @@ -27,7 +33,7 @@ interface G extends F { [n: number]: A; ~~~~~~~~~~~~~~~ -!!! Numeric index type 'A' is not assignable to string index type 'B'. +!!! error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. } // Other way @@ -37,7 +43,7 @@ interface I extends H { [s: string]: B; ~~~~~~~~~~~~~~~ -!!! Numeric index type 'A' is not assignable to string index type 'B'. +!!! error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. } // With hidden indexer @@ -47,6 +53,6 @@ interface K extends J { [n: number]: A; ~~~~~~~~~~~~~~~ -!!! Numeric index type 'A' is not assignable to string index type 'B'. +!!! error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. [s: string]: B; } \ No newline at end of file diff --git a/tests/baselines/reference/indexerConstraints2.errors.txt b/tests/baselines/reference/indexerConstraints2.errors.txt index 39f16a1b200..316486e709f 100644 --- a/tests/baselines/reference/indexerConstraints2.errors.txt +++ b/tests/baselines/reference/indexerConstraints2.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/indexerConstraints2.ts(9,5): error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. +tests/cases/compiler/indexerConstraints2.ts(17,5): error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. +tests/cases/compiler/indexerConstraints2.ts(26,5): error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. + + ==== tests/cases/compiler/indexerConstraints2.ts (3 errors) ==== class A { a: number; } class B extends A { b: number; } @@ -9,7 +14,7 @@ class G extends F { [n: number]: A ~~~~~~~~~~~~~~ -!!! Numeric index type 'A' is not assignable to string index type 'B'. +!!! error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. } // Other way @@ -19,7 +24,7 @@ class I extends H { [s: string]: B ~~~~~~~~~~~~~~ -!!! Numeric index type 'A' is not assignable to string index type 'B'. +!!! error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. } // With hidden indexer @@ -30,6 +35,6 @@ class K extends J { [n: number]: A; ~~~~~~~~~~~~~~~ -!!! Numeric index type 'A' is not assignable to string index type 'B'. +!!! error TS2413: Numeric index type 'A' is not assignable to string index type 'B'. [s: string]: B; } \ No newline at end of file diff --git a/tests/baselines/reference/indexerSignatureWithRestParam.errors.txt b/tests/baselines/reference/indexerSignatureWithRestParam.errors.txt index d97a4d2a19d..4743ed8e91c 100644 --- a/tests/baselines/reference/indexerSignatureWithRestParam.errors.txt +++ b/tests/baselines/reference/indexerSignatureWithRestParam.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/indexerSignatureWithRestParam.ts(2,9): error TS1017: An index signature cannot have a rest parameter. +tests/cases/compiler/indexerSignatureWithRestParam.ts(6,9): error TS1017: An index signature cannot have a rest parameter. + + ==== tests/cases/compiler/indexerSignatureWithRestParam.ts (2 errors) ==== interface I { [...x]: string; ~ -!!! An index signature cannot have a rest parameter. +!!! error TS1017: An index signature cannot have a rest parameter. } class C { [...x]: string ~ -!!! An index signature cannot have a rest parameter. +!!! error TS1017: An index signature cannot have a rest parameter. } \ No newline at end of file diff --git a/tests/baselines/reference/indexerWithTuple.js b/tests/baselines/reference/indexerWithTuple.js new file mode 100644 index 00000000000..fc82716ba05 --- /dev/null +++ b/tests/baselines/reference/indexerWithTuple.js @@ -0,0 +1,32 @@ +//// [indexerWithTuple.ts] +var strNumTuple: [string, number] = ["foo", 10]; +var numTupleTuple: [number, [string, number]] = [10, ["bar", 20]]; + +// no error +var idx0 = 0; +var idx1 = 1; +var ele10 = strNumTuple[0]; // string +var ele11 = strNumTuple[1]; // number +var ele12 = strNumTuple[2]; // {} +var ele13 = strNumTuple[idx0]; // {} +var ele14 = strNumTuple[idx1]; // {} +var ele15 = strNumTuple["0"]; // string +var ele16 = strNumTuple["1"]; // number +var strNumTuple1 = numTupleTuple[1]; //[string, number]; +var ele17 = numTupleTuple[2]; // {} + +//// [indexerWithTuple.js] +var strNumTuple = ["foo", 10]; +var numTupleTuple = [10, ["bar", 20]]; +// no error +var idx0 = 0; +var idx1 = 1; +var ele10 = strNumTuple[0]; // string +var ele11 = strNumTuple[1]; // number +var ele12 = strNumTuple[2]; // {} +var ele13 = strNumTuple[idx0]; // {} +var ele14 = strNumTuple[idx1]; // {} +var ele15 = strNumTuple["0"]; // string +var ele16 = strNumTuple["1"]; // number +var strNumTuple1 = numTupleTuple[1]; //[string, number]; +var ele17 = numTupleTuple[2]; // {} diff --git a/tests/baselines/reference/indexerWithTuple.types b/tests/baselines/reference/indexerWithTuple.types new file mode 100644 index 00000000000..28053a33081 --- /dev/null +++ b/tests/baselines/reference/indexerWithTuple.types @@ -0,0 +1,64 @@ +=== tests/cases/conformance/types/tuple/indexerWithTuple.ts === +var strNumTuple: [string, number] = ["foo", 10]; +>strNumTuple : [string, number] +>["foo", 10] : [string, number] + +var numTupleTuple: [number, [string, number]] = [10, ["bar", 20]]; +>numTupleTuple : [number, [string, number]] +>[10, ["bar", 20]] : [number, [string, number]] +>["bar", 20] : [string, number] + +// no error +var idx0 = 0; +>idx0 : number + +var idx1 = 1; +>idx1 : number + +var ele10 = strNumTuple[0]; // string +>ele10 : string +>strNumTuple[0] : string +>strNumTuple : [string, number] + +var ele11 = strNumTuple[1]; // number +>ele11 : number +>strNumTuple[1] : number +>strNumTuple : [string, number] + +var ele12 = strNumTuple[2]; // {} +>ele12 : string | number +>strNumTuple[2] : string | number +>strNumTuple : [string, number] + +var ele13 = strNumTuple[idx0]; // {} +>ele13 : string | number +>strNumTuple[idx0] : string | number +>strNumTuple : [string, number] +>idx0 : number + +var ele14 = strNumTuple[idx1]; // {} +>ele14 : string | number +>strNumTuple[idx1] : string | number +>strNumTuple : [string, number] +>idx1 : number + +var ele15 = strNumTuple["0"]; // string +>ele15 : string +>strNumTuple["0"] : string +>strNumTuple : [string, number] + +var ele16 = strNumTuple["1"]; // number +>ele16 : number +>strNumTuple["1"] : number +>strNumTuple : [string, number] + +var strNumTuple1 = numTupleTuple[1]; //[string, number]; +>strNumTuple1 : [string, number] +>numTupleTuple[1] : [string, number] +>numTupleTuple : [number, [string, number]] + +var ele17 = numTupleTuple[2]; // {} +>ele17 : number | [string, number] +>numTupleTuple[2] : number | [string, number] +>numTupleTuple : [number, [string, number]] + diff --git a/tests/baselines/reference/indirectSelfReference.errors.txt b/tests/baselines/reference/indirectSelfReference.errors.txt index 209d85233ac..e7c5a00d421 100644 --- a/tests/baselines/reference/indirectSelfReference.errors.txt +++ b/tests/baselines/reference/indirectSelfReference.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/indirectSelfReference.ts(1,7): error TS2310: Type 'a' recursively references itself as a base type. + + ==== tests/cases/compiler/indirectSelfReference.ts (1 errors) ==== class a extends b{ } ~ -!!! Type 'a' recursively references itself as a base type. +!!! error TS2310: Type 'a' recursively references itself as a base type. class b extends a{ } \ No newline at end of file diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt b/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt index 6ce51ab9752..765112f0e99 100644 --- a/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/indirectSelfReferenceGeneric.ts(1,7): error TS2310: Type 'a' recursively references itself as a base type. + + ==== tests/cases/compiler/indirectSelfReferenceGeneric.ts (1 errors) ==== class a extends b { } ~ -!!! Type 'a' recursively references itself as a base type. +!!! error TS2310: Type 'a' recursively references itself as a base type. class b extends a { } \ No newline at end of file diff --git a/tests/baselines/reference/inferSetterParamType.errors.txt b/tests/baselines/reference/inferSetterParamType.errors.txt index 5c8a590e620..c9232d3fac7 100644 --- a/tests/baselines/reference/inferSetterParamType.errors.txt +++ b/tests/baselines/reference/inferSetterParamType.errors.txt @@ -1,14 +1,21 @@ +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(15,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 (5 errors) ==== class Foo { get bar() { ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 0; } set bar(n) { // should not be an error - infer number ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } @@ -16,14 +23,14 @@ get bar() { ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! 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 ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } set bar(n:string) { ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } \ No newline at end of file diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types index 0596081ade3..c411dd00514 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types @@ -20,10 +20,10 @@ declare function identity(y: V): V; >V : V var s = map("", () => { return { x: identity }; }); ->s : any ->map("", () => { return { x: identity }; }) : any +>s : string +>map("", () => { return { x: identity }; }) : string >map : (x: T, f: () => { x: (s: T) => U; }) => U ->() => { return { x: identity }; } : () => { x: (y: V) => V; } +>() => { return { x: identity }; } : () => { x: (y: string) => string; } >{ x: identity } : { x: (y: V) => V; } >x : (y: V) => V >identity : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types index 11e017d6661..53a9dff0b48 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types @@ -34,7 +34,7 @@ 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[] ->['a', 'b'] : {}[] +>['a', 'b'] : string[] >pair : (x: T) => (y: S) => { x: T; y: S; } var i = result[0].x; // number diff --git a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt index 8644e8b3e0b..9dfb41c0fac 100644 --- a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt +++ b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt @@ -1,11 +1,15 @@ +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 (2 errors) ==== function f(x: T, y: T): T { return x; } f({ x: [null] }, { x: [1] }).x[0] = "" // ok ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. f({ x: [1] }, { x: [null] }).x[0] = "" // was error TS2011: Cannot convert 'string' to 'number'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/inferentiallyTypingAnEmptyArray.types b/tests/baselines/reference/inferentiallyTypingAnEmptyArray.types index c8f51c985e6..451280ee16f 100644 --- a/tests/baselines/reference/inferentiallyTypingAnEmptyArray.types +++ b/tests/baselines/reference/inferentiallyTypingAnEmptyArray.types @@ -25,6 +25,6 @@ foo([]).bar; >foo([]).bar : any >foo([]) : any >foo : (arr: T[]) => T ->[] : any[] +>[] : undefined[] >bar : any diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt index d1afdb17f44..915e75dd6da 100644 --- a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt +++ b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(1,1): error TS2354: No best common type exists among return expressions. + + ==== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts (1 errors) ==== function foo() { ~~~~~~~~~~~~~~~~ @@ -15,5 +18,5 @@ ~~~~~ }; ~ -!!! No best common type exists among return expressions. +!!! error TS2354: No best common type exists among return expressions. \ No newline at end of file diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt b/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt index 577913c10e9..c8367bef57b 100644 --- a/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt @@ -1,3 +1,11 @@ +tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(16,1): error TS2322: Type 'OwnerList' is not assignable to type 'List'. + Types of property 'data' are incompatible. + Type 'List' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(21,5): error TS2322: Type 'OwnerList' is not assignable to type 'List'. + Types of property 'data' are incompatible. + Type 'List' is not assignable to type 'T'. + + ==== tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts (2 errors) ==== // instantiating a derived type can cause an infinitely expanding type reference to be generated @@ -16,18 +24,18 @@ var ownerList: OwnerList; list = ownerList; ~~~~ -!!! Type 'OwnerList' is not assignable to type 'List': -!!! Types of property 'data' are incompatible: -!!! Type 'List' is not assignable to type 'string'. +!!! error TS2322: Type 'OwnerList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. +!!! error TS2322: Type 'List' is not assignable to type 'string'. function other(x: T) { var list: List; var ownerList: OwnerList; list = ownerList; ~~~~ -!!! Type 'OwnerList' is not assignable to type 'List': -!!! Types of property 'data' are incompatible: -!!! Type 'List' is not assignable to type 'T'. +!!! error TS2322: Type 'OwnerList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. +!!! error TS2322: Type 'List' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation2.errors.txt b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.errors.txt index 958adf5d312..1778e092715 100644 --- a/tests/baselines/reference/infiniteExpansionThroughInstantiation2.errors.txt +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.errors.txt @@ -1,10 +1,13 @@ +tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation2.ts(4,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation2.ts (1 errors) ==== // instantiating a derived type can cause an infinitely expanding type reference to be generated // which could be used in an assignment check for constraint satisfaction interface AA> // now an error due to referencing type parameter in constraint ~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. { x: T } diff --git a/tests/baselines/reference/infinitelyExpandingOverloads.errors.txt b/tests/baselines/reference/infinitelyExpandingOverloads.errors.txt index fb3893d9c2a..fc3c49477fb 100644 --- a/tests/baselines/reference/infinitelyExpandingOverloads.errors.txt +++ b/tests/baselines/reference/infinitelyExpandingOverloads.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/infinitelyExpandingOverloads.ts(23,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/infinitelyExpandingOverloads.ts (1 errors) ==== interface KnockoutSubscription2 { target: KnockoutObservableBase2; @@ -23,7 +26,7 @@ } public get options(): ViewModel { ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null; } } \ No newline at end of file diff --git a/tests/baselines/reference/infinitelyExpandingTypes1.errors.txt b/tests/baselines/reference/infinitelyExpandingTypes1.errors.txt index 969036a6355..e188c8da45f 100644 --- a/tests/baselines/reference/infinitelyExpandingTypes1.errors.txt +++ b/tests/baselines/reference/infinitelyExpandingTypes1.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/infinitelyExpandingTypes1.ts(21,1): error TS2365: Operator '==' cannot be applied to types 'List' and 'List'. + + ==== tests/cases/compiler/infinitelyExpandingTypes1.ts (1 errors) ==== interface List { data: T; @@ -21,6 +24,6 @@ l == l2; // should error; ~~~~~~~ -!!! Operator '==' cannot be applied to types 'List' and 'List'. +!!! error TS2365: Operator '==' cannot be applied to types 'List' and 'List'. l == l; // should not error \ No newline at end of file diff --git a/tests/baselines/reference/infinitelyExpandingTypes2.errors.txt b/tests/baselines/reference/infinitelyExpandingTypes2.errors.txt index c9e46e20b97..3f79b63ca1e 100644 --- a/tests/baselines/reference/infinitelyExpandingTypes2.errors.txt +++ b/tests/baselines/reference/infinitelyExpandingTypes2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/infinitelyExpandingTypes2.ts(10,5): error TS2304: Cannot find name 'console'. + + ==== tests/cases/compiler/infinitelyExpandingTypes2.ts (1 errors) ==== interface Foo { x: Foo>; @@ -10,7 +13,7 @@ function f(p: Foo) { console.log(p); ~~~~~~~ -!!! Cannot find name 'console'. +!!! error TS2304: Cannot find name 'console'. } var v: Bar = null; diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt b/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt index f2946439380..a9b3cb4b686 100644 --- a/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt @@ -1,7 +1,11 @@ +tests/cases/compiler/inheritFromGenericTypeParameter.ts(1,20): error TS2311: A class may only extend another class. +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 { } ~ -!!! A class may only extend another class. +!!! error TS2311: A class may only extend another class. interface I extends T { } ~ -!!! An interface may only extend a class or another interface. \ No newline at end of file +!!! error TS2312: An interface may only extend a class or another interface. \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt index c4093032cf8..555349cc251 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. + Named properties 'x' of types 'C' and 'C2' are not identical. + + ==== tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts (1 errors) ==== class C { private x: number; @@ -9,7 +13,7 @@ interface A extends C, C2 { // error ~ -!!! Interface 'A' cannot simultaneously extend types 'C' and 'C2': -!!! Named properties 'x' of types 'C' and 'C2' are not identical. +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. +!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt index 3dc0aa2b25b..3f9c4a3bae0 100644 --- a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. + Named properties 'x' of types 'C' and 'C2' are not identical. + + ==== tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts (1 errors) ==== interface C { x?: number; @@ -9,7 +13,7 @@ interface A extends C, C2 { // error ~ -!!! Interface 'A' cannot simultaneously extend types 'C' and 'C2': -!!! Named properties 'x' of types 'C' and 'C2' are not identical. +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. +!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt index e8d89b75c09..9864b4a4792 100644 --- a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. + Named properties 'x' of types 'C' and 'C2' are not identical. + + ==== tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts (1 errors) ==== class C { public x: number; @@ -9,7 +13,7 @@ interface A extends C, C2 { // error ~ -!!! Interface 'A' cannot simultaneously extend types 'C' and 'C2': -!!! Named properties 'x' of types 'C' and 'C2' are not identical. +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. +!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritance.errors.txt b/tests/baselines/reference/inheritance.errors.txt index dfe00fc6240..c667e8b001e 100644 --- a/tests/baselines/reference/inheritance.errors.txt +++ b/tests/baselines/reference/inheritance.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/inheritance.ts(30,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'. + Types of property 'g' are incompatible. + Type '(n: number) => number' is not assignable to type '() => number'. +tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. + + ==== tests/cases/compiler/inheritance.ts (2 errors) ==== class B1 { public x; @@ -30,12 +36,12 @@ class Baad extends Good { ~~~~ -!!! Class 'Baad' incorrectly extends base class 'Good': -!!! Types of property 'g' are incompatible: -!!! Type '(n: number) => number' is not assignable to type '() => number'. +!!! error TS2415: Class 'Baad' incorrectly extends base class 'Good'. +!!! error TS2415: Types of property 'g' are incompatible. +!!! error TS2415: Type '(n: number) => number' is not assignable to type '() => number'. public f(): number { return 0; } ~ -!!! Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. +!!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. public g(n: number) { return 0; } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritance1.errors.txt b/tests/baselines/reference/inheritance1.errors.txt index 537b7b8fa4e..f33dd120e76 100644 --- a/tests/baselines/reference/inheritance1.errors.txt +++ b/tests/baselines/reference/inheritance1.errors.txt @@ -1,3 +1,27 @@ +tests/cases/compiler/inheritance1.ts(14,7): error TS2420: Class 'ImageBase' incorrectly implements interface 'SelectableControl'. + Property 'select' is missing in type 'ImageBase'. +tests/cases/compiler/inheritance1.ts(18,7): error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'. + Property 'state' is missing in type 'Locations'. +tests/cases/compiler/inheritance1.ts(31,1): error TS2322: Type 'Control' is not assignable to type 'Button'. + Property 'select' is missing in type 'Control'. +tests/cases/compiler/inheritance1.ts(37,1): error TS2322: Type 'Control' is not assignable to type 'TextBox'. + Property 'select' is missing in type 'Control'. +tests/cases/compiler/inheritance1.ts(40,1): error TS2322: Type 'ImageBase' is not assignable to type 'SelectableControl'. +tests/cases/compiler/inheritance1.ts(46,1): error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'. + Property 'select' is missing in type 'Image1'. +tests/cases/compiler/inheritance1.ts(52,1): error TS2322: Type 'Locations' is not assignable to type 'SelectableControl'. +tests/cases/compiler/inheritance1.ts(53,1): error TS2322: Type 'Locations' is not assignable to type 'Control'. + Property 'state' is missing in type 'Locations'. +tests/cases/compiler/inheritance1.ts(55,1): error TS2322: Type 'Control' is not assignable to type 'Locations'. + Property 'select' is missing in type 'Control'. +tests/cases/compiler/inheritance1.ts(58,1): error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl'. + Property 'state' is missing in type 'Locations1'. +tests/cases/compiler/inheritance1.ts(59,1): error TS2322: Type 'Locations1' is not assignable to type 'Control'. + Property 'state' is missing in type 'Locations1'. +tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not assignable to type 'Locations1'. + Property 'select' is missing in type 'Control'. + + ==== tests/cases/compiler/inheritance1.ts (12 errors) ==== class Control { private state: any; @@ -14,15 +38,15 @@ } class ImageBase extends Control implements SelectableControl{ ~~~~~~~~~ -!!! Class 'ImageBase' incorrectly implements interface 'SelectableControl': -!!! Property 'select' is missing in type 'ImageBase'. +!!! error TS2420: Class 'ImageBase' incorrectly implements interface 'SelectableControl'. +!!! error TS2420: Property 'select' is missing in type 'ImageBase'. } class Image1 extends Control { } class Locations implements SelectableControl { ~~~~~~~~~ -!!! Class 'Locations' incorrectly implements interface 'SelectableControl': -!!! Property 'state' is missing in type 'Locations'. +!!! error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'. +!!! error TS2420: Property 'state' is missing in type 'Locations'. select() { } } class Locations1 { @@ -37,8 +61,8 @@ b = sc; b = c; ~ -!!! Type 'Control' is not assignable to type 'Button': -!!! Property 'select' is missing in type 'Control'. +!!! error TS2322: Type 'Control' is not assignable to type 'Button'. +!!! error TS2322: Property 'select' is missing in type 'Control'. var t: TextBox; sc = t; @@ -46,13 +70,13 @@ t = sc; t = c; ~ -!!! Type 'Control' is not assignable to type 'TextBox': -!!! Property 'select' is missing in type 'Control'. +!!! error TS2322: Type 'Control' is not assignable to type 'TextBox'. +!!! error TS2322: Property 'select' is missing in type 'Control'. var i: ImageBase; sc = i; ~~ -!!! Type 'ImageBase' is not assignable to type 'SelectableControl'. +!!! error TS2322: Type 'ImageBase' is not assignable to type 'SelectableControl'. c = i; i = sc; i = c; @@ -60,8 +84,8 @@ var i1: Image1; sc = i1; ~~ -!!! Type 'Image1' is not assignable to type 'SelectableControl': -!!! Property 'select' is missing in type 'Image1'. +!!! error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'. +!!! error TS2322: Property 'select' is missing in type 'Image1'. c = i1; i1 = sc; i1 = c; @@ -69,28 +93,28 @@ var l: Locations; sc = l; ~~ -!!! Type 'Locations' is not assignable to type 'SelectableControl'. +!!! error TS2322: Type 'Locations' is not assignable to type 'SelectableControl'. c = l; ~ -!!! Type 'Locations' is not assignable to type 'Control': -!!! Property 'state' is missing in type 'Locations'. +!!! error TS2322: Type 'Locations' is not assignable to type 'Control'. +!!! error TS2322: Property 'state' is missing in type 'Locations'. l = sc; l = c; ~ -!!! Type 'Control' is not assignable to type 'Locations': -!!! Property 'select' is missing in type 'Control'. +!!! error TS2322: Type 'Control' is not assignable to type 'Locations'. +!!! error TS2322: Property 'select' is missing in type 'Control'. var l1: Locations1; sc = l1; ~~ -!!! Type 'Locations1' is not assignable to type 'SelectableControl': -!!! Property 'state' is missing in type 'Locations1'. +!!! error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl'. +!!! error TS2322: Property 'state' is missing in type 'Locations1'. c = l1; ~ -!!! Type 'Locations1' is not assignable to type 'Control': -!!! Property 'state' is missing in type 'Locations1'. +!!! error TS2322: Type 'Locations1' is not assignable to type 'Control'. +!!! error TS2322: Property 'state' is missing in type 'Locations1'. l1 = sc; l1 = c; ~~ -!!! Type 'Control' is not assignable to type 'Locations1': -!!! Property 'select' is missing in type 'Control'. \ No newline at end of file +!!! error TS2322: Type 'Control' is not assignable to type 'Locations1'. +!!! error TS2322: Property 'select' is missing in type 'Control'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt index a59e3da0d04..84a04107008 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts(7,7): error TS2415: Class 'C' incorrectly extends base class 'B'. + Types have separate declarations of a private property 'myMethod'. + + ==== tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts (1 errors) ==== class A { private myMethod() { } @@ -7,8 +11,8 @@ class C extends B { ~ -!!! Class 'C' incorrectly extends base class 'B': -!!! Private property 'myMethod' cannot be reimplemented. +!!! error TS2415: Class 'C' incorrectly extends base class 'B'. +!!! error TS2415: Types have separate declarations of a private property 'myMethod'. private myMethod() { } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt index ca7a3b32b8e..7486fbc6e8f 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.ts(7,7): error TS2415: Class 'C' incorrectly extends base class 'B'. + Property 'myMethod' is private in type 'B' but not in type 'C'. + + ==== tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.ts (1 errors) ==== class A { private myMethod() { } @@ -7,8 +11,8 @@ class C extends B { ~ -!!! Class 'C' incorrectly extends base class 'B': -!!! Private property 'myMethod' cannot be reimplemented. +!!! error TS2415: Class 'C' incorrectly extends base class 'B'. +!!! error TS2415: Property 'myMethod' is private in type 'B' but not in type 'C'. public myMethod() { } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt index be63f2e9c1e..1ef0d8c0cdb 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.ts(7,7): error TS2415: Class 'C' incorrectly extends base class 'B'. + Property 'myMethod' is private in type 'C' but not in type 'B'. + + ==== tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.ts (1 errors) ==== class A { public myMethod() { } @@ -7,8 +11,8 @@ class C extends B { ~ -!!! Class 'C' incorrectly extends base class 'B': -!!! Private property 'myMethod' cannot be reimplemented. +!!! error TS2415: Class 'C' incorrectly extends base class 'B'. +!!! error TS2415: Property 'myMethod' is private in type 'C' but not in type 'B'. private myMethod() { } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.errors.txt index b62b70743ca..f729e230ca2 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.errors.txt @@ -1,13 +1,19 @@ +tests/cases/compiler/inheritanceMemberAccessorOverridingAccessor.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceMemberAccessorOverridingAccessor.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceMemberAccessorOverridingAccessor.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceMemberAccessorOverridingAccessor.ts(14,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/inheritanceMemberAccessorOverridingAccessor.ts (4 errors) ==== class a { get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "20"; } set x(aValue: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } @@ -15,12 +21,12 @@ class b extends a { get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "20"; } set x(aValue: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt index 3d97822ef7d..54f5fcc2a34 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(7,7): error TS2415: Class 'b' incorrectly extends base class 'a'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type '() => string'. +tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS2423: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor. + + ==== tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts (4 errors) ==== class a { x() { @@ -7,19 +15,19 @@ class b extends a { ~ -!!! Class 'b' incorrectly extends base class 'a': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type '() => string'. +!!! error TS2415: Class 'b' incorrectly extends base class 'a'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type '() => string'. get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor. +!!! error TS2423: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor. return "20"; } set x(aValue: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.errors.txt b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.errors.txt index 85342038c54..98b9d349d64 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.errors.txt +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/inheritanceMemberAccessorOverridingProperty.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceMemberAccessorOverridingProperty.ts(9,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/inheritanceMemberAccessorOverridingProperty.ts (2 errors) ==== class a { x: string; @@ -6,12 +10,12 @@ class b extends a { get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "20"; } set x(aValue: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt index 8575f167c0b..283e7ce3f18 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt @@ -1,25 +1,33 @@ +tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(10,7): error TS2415: Class 'b' incorrectly extends base class 'a'. + Types of property 'x' are incompatible. + Type '() => string' is not assignable to type 'string'. +tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(11,5): error TS2426: Class 'a' defines instance member accessor 'x', but extended class 'b' defines it as instance member function. + + ==== tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts (4 errors) ==== class a { get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "20"; } set x(aValue: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } class b extends a { ~ -!!! Class 'b' incorrectly extends base class 'a': -!!! Types of property 'x' are incompatible: -!!! Type '() => string' is not assignable to type 'string'. +!!! error TS2415: Class 'b' incorrectly extends base class 'a'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type '() => string' is not assignable to type 'string'. x() { ~ -!!! Class 'a' defines instance member accessor 'x', but extended class 'b' defines it as instance member function. +!!! error TS2426: Class 'a' defines instance member accessor 'x', but extended class 'b' defines it as instance member function. return "20"; } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.errors.txt b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.errors.txt index 9c1fc8c565f..bf35b620e73 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.errors.txt +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/inheritanceMemberFuncOverridingProperty.ts(6,5): error TS2425: Class 'a' defines instance member property 'x', but extended class 'b' defines it as instance member function. + + ==== tests/cases/compiler/inheritanceMemberFuncOverridingProperty.ts (1 errors) ==== class a { x: () => string; @@ -6,7 +9,7 @@ class b extends a { x() { ~ -!!! Class 'a' defines instance member property 'x', but extended class 'b' defines it as instance member function. +!!! error TS2425: Class 'a' defines instance member property 'x', but extended class 'b' defines it as instance member function. return "20"; } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.errors.txt index 45f6ed765df..ec8ec05a8ae 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.errors.txt @@ -1,14 +1,18 @@ +tests/cases/compiler/inheritanceMemberPropertyOverridingAccessor.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceMemberPropertyOverridingAccessor.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/inheritanceMemberPropertyOverridingAccessor.ts (2 errors) ==== class a { private __x: () => string; get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return this.__x; } set x(aValue: () => string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. this.__x = aValue; } } diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.errors.txt index 03a0e21de72..2b56866b22b 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/inheritanceMemberPropertyOverridingMethod.ts(8,5): error TS2424: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member property. + + ==== tests/cases/compiler/inheritanceMemberPropertyOverridingMethod.ts (1 errors) ==== class a { x() { @@ -8,5 +11,5 @@ class b extends a { x: () => string; ~ -!!! Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member property. +!!! error TS2424: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member property. } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.errors.txt index 74f1f1409e8..ae6a19c4530 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.errors.txt @@ -1,13 +1,19 @@ +tests/cases/compiler/inheritanceStaticAccessorOverridingAccessor.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticAccessorOverridingAccessor.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticAccessorOverridingAccessor.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticAccessorOverridingAccessor.ts(14,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/inheritanceStaticAccessorOverridingAccessor.ts (4 errors) ==== class a { static get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "20"; } static set x(aValue: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } @@ -15,12 +21,12 @@ class b extends a { static get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "20"; } static set x(aValue: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt index 47752c88765..026c2b51ac9 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type '() => string'. + + ==== tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts (3 errors) ==== class a { static x() { @@ -7,17 +14,17 @@ class b extends a { ~ -!!! Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type '() => string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type 'string' is not assignable to type '() => string'. static get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "20"; } static set x(aValue: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.errors.txt b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.errors.txt index 65d69802e8a..cdcbaa101e7 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.errors.txt +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/inheritanceStaticAccessorOverridingProperty.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticAccessorOverridingProperty.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/inheritanceStaticAccessorOverridingProperty.ts (2 errors) ==== class a { static x: string; @@ -6,12 +10,12 @@ class b extends a { static get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "20"; } static set x(aValue: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt index 5b015fd54cd..cfe05da8ea4 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt @@ -1,22 +1,29 @@ +tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(10,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. + Type '() => string' is not assignable to type 'string'. + + ==== tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts (3 errors) ==== class a { static get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "20"; } static set x(aValue: string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } class b extends a { ~ -!!! Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! Types of property 'x' are incompatible: -!!! Type '() => string' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type '() => string' is not assignable to type 'string'. static x() { return "20"; } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.errors.txt b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.errors.txt index 2c3804a5eba..1fa828f30c4 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.errors.txt +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/inheritanceStaticFuncOverridingAccessorOfFuncType.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/inheritanceStaticFuncOverridingAccessorOfFuncType.ts (1 errors) ==== class a { static get x(): () => string { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null; } } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt index 346937240e1..61edfe7fc64 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/inheritanceStaticFuncOverridingProperty.ts(5,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. + Type '() => string' is not assignable to type 'string'. + + ==== tests/cases/compiler/inheritanceStaticFuncOverridingProperty.ts (1 errors) ==== class a { static x: string; @@ -5,9 +10,9 @@ class b extends a { ~ -!!! Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! Types of property 'x' are incompatible: -!!! Type '() => string' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type '() => string' is not assignable to type 'string'. static x() { return "20"; } diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt b/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt index 92c0c6a83b1..49dfd2de513 100644 --- a/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/inheritanceStaticMembersIncompatible.ts(5,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/inheritanceStaticMembersIncompatible.ts (1 errors) ==== class a { static x: string; @@ -5,8 +10,8 @@ class b extends a { ~ -!!! Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! Types of property 'x' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type 'number' is not assignable to type 'string'. static x: number; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt index 3611d019a2a..08aab5b1158 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt @@ -1,13 +1,17 @@ +tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts (2 errors) ==== class a { static get x(): () => string { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null;; } static set x(aValue: () => string) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } } diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt index 5498010bddb..22748fda783 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type '() => string'. + + ==== tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts (1 errors) ==== class a { static x() { @@ -7,8 +12,8 @@ class b extends a { ~ -!!! Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type '() => string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type 'string' is not assignable to type '() => string'. static x: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt index 7a1dcbe5a55..fd63eafbaf7 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt @@ -1,3 +1,7 @@ +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 (2 errors) ==== class Base { constructor(...a: string[]) { } @@ -13,7 +17,7 @@ // Errors new Derived("", 3); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. new Derived(3); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type 'number' 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 c26643584c8..514d0d8941f 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -1,3 +1,8 @@ +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 (3 errors) ==== class IBaseBase { constructor(x: U) { } @@ -32,10 +37,10 @@ // Errors new Derived(3); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. new Derived("", 3, "", ""); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt index d02ddfbb148..d2ad69730da 100644 --- a/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt +++ b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/inheritedMembersAndIndexSignaturesFromDifferentBases.ts(17,11): error TS2411: Property 'm' of type '{}' is not assignable to string index type '{ a: any; }'. +tests/cases/compiler/inheritedMembersAndIndexSignaturesFromDifferentBases.ts(23,11): error TS2411: Property '0' of type '{}' is not assignable to string index type '{ a: any; }'. +tests/cases/compiler/inheritedMembersAndIndexSignaturesFromDifferentBases.ts(23,11): error TS2412: Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. +tests/cases/compiler/inheritedMembersAndIndexSignaturesFromDifferentBases.ts(25,11): error TS2411: Property '0' of type '{}' is not assignable to string index type '{ a: any; }'. +tests/cases/compiler/inheritedMembersAndIndexSignaturesFromDifferentBases.ts(25,11): error TS2411: Property 'm' of type '{}' is not assignable to string index type '{ a: any; }'. +tests/cases/compiler/inheritedMembersAndIndexSignaturesFromDifferentBases.ts(25,11): error TS2412: Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. + + ==== tests/cases/compiler/inheritedMembersAndIndexSignaturesFromDifferentBases.ts (6 errors) ==== // indexer in B is a subtype of indexer in A interface A { @@ -17,7 +25,7 @@ interface D extends A, B, C { } // error because m is not a subtype of {a;} ~ -!!! Property 'm' of type '{}' is not assignable to string index type '{ a: any; }'. +!!! error TS2411: Property 'm' of type '{}' is not assignable to string index type '{ a: any; }'. interface E { 0: {}; @@ -25,16 +33,16 @@ interface F extends A, B, E { } // error because 0 is not a subtype of {a; b;} ~ -!!! Property '0' of type '{}' is not assignable to string index type '{ a: any; }'. +!!! error TS2411: Property '0' of type '{}' is not assignable to string index type '{ a: any; }'. ~ -!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. +!!! error TS2412: Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. interface G extends A, B, C, E { } // should only report one error ~ -!!! Property '0' of type '{}' is not assignable to string index type '{ a: any; }'. +!!! error TS2411: Property '0' of type '{}' is not assignable to string index type '{ a: any; }'. ~ -!!! Property 'm' of type '{}' is not assignable to string index type '{ a: any; }'. +!!! error TS2411: Property 'm' of type '{}' is not assignable to string index type '{ a: any; }'. ~ -!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. +!!! error TS2412: Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. interface H extends A, F { } // Should report no error at all because error is internal to F \ No newline at end of file diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt index ed90ca4d415..0b7e00d95ce 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'. + Types of property 'foo' are incompatible. + Type '() => number' is not assignable to type '() => string'. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/inheritedModuleMembersForClodule.ts (1 errors) ==== class C { static foo(): string { @@ -7,10 +13,10 @@ class D extends C { ~ -!!! Class static side 'typeof D' incorrectly extends base class static side 'typeof C': -!!! Types of property 'foo' are incompatible: -!!! Type '() => number' is not assignable to type '() => string': -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'. +!!! error TS2417: Types of property 'foo' are incompatible. +!!! error TS2417: Type '() => number' is not assignable to type '() => string'. +!!! error TS2417: Type 'number' is not assignable to type 'string'. } module D { diff --git a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt index cd119798286..b99efb5e157 100644 --- a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt +++ b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(13,11): error TS2430: Interface 'E' incorrectly extends interface 'D'. + Index signatures are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(28,11): error TS2430: Interface 'E2' incorrectly extends interface 'D2'. + Index signatures are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts (2 errors) ==== // string indexer tests interface A { @@ -13,9 +21,9 @@ } interface E extends A, D { } // error ~ -!!! Interface 'E' incorrectly extends interface 'D': -!!! Index signatures are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'E' incorrectly extends interface 'D'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. // Same tests for number indexer @@ -32,6 +40,6 @@ } interface E2 extends A2, D2 { } // error ~~ -!!! Interface 'E2' incorrectly extends interface 'D2': -!!! Index signatures are incompatible: -!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2430: Interface 'E2' incorrectly extends interface 'D2'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes2.errors.txt b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes2.errors.txt index de29e44ac46..8e6fc5b3158 100644 --- a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes2.errors.txt +++ b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes2.ts(18,11): error TS2413: Numeric index type '{}' is not assignable to string index type '{ a: any; }'. + + ==== tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes2.ts (1 errors) ==== // indexer in B is a subtype of indexer in A interface A { @@ -18,7 +21,7 @@ } interface E extends A, D { } // error ~ -!!! Numeric index type '{}' is not assignable to string index type '{ a: any; }'. +!!! error TS2413: Numeric index type '{}' is not assignable to string index type '{ a: any; }'. interface F extends A, D { [s: number]: { diff --git a/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt b/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt index 56a9455608b..896552cabd5 100644 --- a/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt +++ b/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt @@ -1,46 +1,60 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(7,15): error TS1003: Identifier expected. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(17,15): error TS1003: Identifier expected. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(4,9): error TS2304: Cannot find name 'z'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(5,15): error TS2304: Cannot find name 'z'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(6,14): error TS2339: Property 'z' does not exist on type 'C'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(7,20): error TS2339: Property 'z' does not exist on type 'C'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(9,9): error TS2304: Cannot find name 'z'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(14,9): error TS2304: Cannot find name 'z'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(15,15): error TS2304: Cannot find name 'z'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(16,14): error TS2339: Property 'z' does not exist on type 'D'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(17,20): error TS2339: Property 'z' does not exist on type 'D'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts(19,9): error TS2304: Cannot find name 'z'. + + ==== tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts (12 errors) ==== // Initializer expressions for instance member variables are evaluated in the scope of the class constructor body but are not permitted to reference parameters or local variables of the constructor. class C { a = z; // error ~ -!!! Cannot find name 'z'. +!!! error TS2304: Cannot find name 'z'. b: typeof z; // error ~ -!!! Cannot find name 'z'. +!!! error TS2304: Cannot find name 'z'. c = this.z; // error ~ -!!! Property 'z' does not exist on type 'C'. +!!! error TS2339: Property 'z' does not exist on type 'C'. d: typeof this.z; // error ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ~ -!!! Property 'z' does not exist on type 'C'. +!!! error TS2339: Property 'z' does not exist on type 'C'. constructor(x) { z = 1; ~ -!!! Cannot find name 'z'. +!!! error TS2304: Cannot find name 'z'. } } class D { a = z; // error ~ -!!! Cannot find name 'z'. +!!! error TS2304: Cannot find name 'z'. b: typeof z; // error ~ -!!! Cannot find name 'z'. +!!! error TS2304: Cannot find name 'z'. c = this.z; // error ~ -!!! Property 'z' does not exist on type 'D'. +!!! error TS2339: Property 'z' does not exist on type 'D'. d: typeof this.z; // error ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. ~ -!!! Property 'z' does not exist on type 'D'. +!!! error TS2339: Property 'z' does not exist on type 'D'. constructor(x: T) { z = 1; ~ -!!! Cannot find name 'z'. +!!! error TS2304: Cannot find name 'z'. } } \ No newline at end of file diff --git a/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt b/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt index 6d137e173ce..465e3c42167 100644 --- a/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt +++ b/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt @@ -1,23 +1,31 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(17,15): error TS1003: Identifier expected. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(4,9): error TS2304: Cannot find name 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(5,15): error TS2304: Cannot find name 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(10,9): error TS2304: Cannot find name 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(11,15): error TS2304: Cannot find name 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(23,9): error TS2304: Cannot find name 'x'. + + ==== tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts (6 errors) ==== // Initializer expressions for instance member variables are evaluated in the scope of the class constructor body but are not permitted to reference parameters or local variables of the constructor. class C { a = x; // error ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. b: typeof x; // error ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. constructor(x) { } } class D { a = x; // error ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. b: typeof x; // error ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. constructor(public x) { } } @@ -25,7 +33,7 @@ a = this.x; // ok b: typeof this.x; // error ~~~~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. constructor(public x) { } } @@ -33,6 +41,6 @@ a = this.x; // ok b = x; // error ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. constructor(public x: T) { } } \ No newline at end of file diff --git a/tests/baselines/reference/initializersInDeclarations.errors.txt b/tests/baselines/reference/initializersInDeclarations.errors.txt index ff2555447ce..5ab9ae5d2bc 100644 --- a/tests/baselines/reference/initializersInDeclarations.errors.txt +++ b/tests/baselines/reference/initializersInDeclarations.errors.txt @@ -1,34 +1,43 @@ +tests/cases/conformance/externalModules/initializersInDeclarations.ts(5,9): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(6,16): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(7,16): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(12,15): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(13,15): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(16,2): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(18,16): error TS1039: Initializers are not allowed in ambient contexts. + + ==== tests/cases/conformance/externalModules/initializersInDeclarations.ts (7 errors) ==== // Errors: Initializers & statements in declaration file declare class Foo { name = "test"; - ~ -!!! Initializers are not allowed in ambient contexts. + ~~~~~~ +!!! error TS1039: Initializers are not allowed in ambient contexts. "some prop" = 42; - ~ -!!! Initializers are not allowed in ambient contexts. + ~~ +!!! error TS1039: Initializers are not allowed in ambient contexts. fn(): boolean { ~ -!!! A function implementation cannot be declared in an ambient context. +!!! error TS1037: A function implementation cannot be declared in an ambient context. return false; } } declare var x = []; ~ -!!! Initializers are not allowed in ambient contexts. +!!! error TS1039: Initializers are not allowed in ambient contexts. declare var y = {}; ~ -!!! Initializers are not allowed in ambient contexts. +!!! error TS1039: Initializers are not allowed in ambient contexts. declare module M1 { while(true); ~~~~~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. export var v1 = () => false; ~ -!!! Initializers are not allowed in ambient contexts. +!!! error TS1039: Initializers are not allowed in ambient contexts. } \ No newline at end of file diff --git a/tests/baselines/reference/innerAliases.errors.txt b/tests/baselines/reference/innerAliases.errors.txt index f8010153c58..b5135c19d12 100644 --- a/tests/baselines/reference/innerAliases.errors.txt +++ b/tests/baselines/reference/innerAliases.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/innerAliases.ts(19,8): error TS2305: Module 'D' has no exported member 'inner'. +tests/cases/compiler/innerAliases.ts(21,11): error TS2339: Property 'inner' does not exist on type 'typeof D'. + + ==== tests/cases/compiler/innerAliases.ts (2 errors) ==== module A { export module B { @@ -19,10 +23,10 @@ var c: D.inner.Class1; ~~~~~~~~~~~~~~ -!!! Module 'D' has no exported member 'inner'. +!!! error TS2305: Module 'D' has no exported member 'inner'. c = new D.inner.Class1(); ~~~~~ -!!! Property 'inner' does not exist on type 'typeof D'. +!!! error TS2339: Property 'inner' does not exist on type 'typeof D'. \ No newline at end of file diff --git a/tests/baselines/reference/innerModExport1.errors.txt b/tests/baselines/reference/innerModExport1.errors.txt index 1f960cd37f7..11e9cdc01d1 100644 --- a/tests/baselines/reference/innerModExport1.errors.txt +++ b/tests/baselines/reference/innerModExport1.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/innerModExport1.ts(5,12): error TS1005: ';' expected. +tests/cases/compiler/innerModExport1.ts(7,9): error TS1129: Statement expected. +tests/cases/compiler/innerModExport1.ts(14,5): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/innerModExport1.ts(17,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/innerModExport1.ts(5,5): error TS2304: Cannot find name 'module'. + + ==== tests/cases/compiler/innerModExport1.ts (5 errors) ==== module Outer { @@ -5,13 +12,13 @@ var non_export_var: number; module { ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~ -!!! Cannot find name 'module'. +!!! error TS2304: Cannot find name 'module'. var non_export_var = 0; export var export_var = 1; ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. function NonExportFunc() { return 0; } @@ -20,11 +27,11 @@ export var outer_var_export = 0; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. export function outerFuncExport() { return 0; } } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. Outer.ExportFunc(); \ No newline at end of file diff --git a/tests/baselines/reference/innerModExport2.errors.txt b/tests/baselines/reference/innerModExport2.errors.txt index 59c6c4dde83..1adcc46d441 100644 --- a/tests/baselines/reference/innerModExport2.errors.txt +++ b/tests/baselines/reference/innerModExport2.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/innerModExport2.ts(5,12): error TS1005: ';' expected. +tests/cases/compiler/innerModExport2.ts(7,9): error TS1129: Statement expected. +tests/cases/compiler/innerModExport2.ts(15,5): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/compiler/innerModExport2.ts(18,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/innerModExport2.ts(5,5): error TS2304: Cannot find name 'module'. +tests/cases/compiler/innerModExport2.ts(20,7): error TS2339: Property 'NonExportFunc' does not exist on type 'typeof Outer'. + + ==== tests/cases/compiler/innerModExport2.ts (6 errors) ==== module Outer { @@ -5,13 +13,13 @@ var non_export_var: number; module { ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~ -!!! Cannot find name 'module'. +!!! error TS2304: Cannot find name 'module'. var non_export_var = 0; export var export_var = 1; ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. function NonExportFunc() { return 0; } @@ -21,13 +29,13 @@ export var outer_var_export = 0; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. export function outerFuncExport() { return 0; } } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. Outer.NonExportFunc(); ~~~~~~~~~~~~~ -!!! Property 'NonExportFunc' does not exist on type 'typeof Outer'. \ No newline at end of file +!!! error TS2339: Property 'NonExportFunc' does not exist on type 'typeof Outer'. \ No newline at end of file diff --git a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt index be79017314f..b5e56d2f4e3 100644 --- a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt +++ b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2322: Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts (1 errors) ==== function takesCallback(callback: (n) =>any) { @@ -10,7 +13,7 @@ // otherwise, there's a bug in overload resolution / partial typechecking var k: string = 10; ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } ); \ No newline at end of file diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt index 124c3ab81df..080316f8daf 100644 --- a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. + Type 'void' is not assignable to type 'number'. + + ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts (1 errors) ==== class C { foo() { @@ -7,8 +11,8 @@ bar(x: number): number { C.prototype.bar = () => { } // error ~~~~~~~~~~~~~~~ -!!! Type '() => void' is not assignable to type '(x: number) => number': -!!! Type 'void' is not assignable to type 'number'. +!!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. +!!! error TS2322: Type 'void' is not assignable to type 'number'. C.prototype.bar = (x) => x; // ok C.prototype.bar = (x: number) => 1; // ok return 1; diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt index b6cabdb962f..fbd64e5018e 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt @@ -1,15 +1,23 @@ +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(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(19,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. + + ==== tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts (6 errors) ==== module NonGeneric { class C { x: string; get y() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 1; } set y(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. fn() { return this; } constructor(public a: number, private b: number) { } } @@ -23,7 +31,7 @@ r.y = 4; var r6 = d.y(); // error ~~~~~ -!!! Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. } @@ -32,12 +40,12 @@ x: T; get y() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null; } set y(v: U) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. fn() { return this; } constructor(public a: T, private b: U) { } } @@ -51,5 +59,5 @@ r.y = ''; var r6 = d.y(); // error ~~~~~ -!!! Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. } \ No newline at end of file diff --git a/tests/baselines/reference/instancePropertyInClassType.errors.txt b/tests/baselines/reference/instancePropertyInClassType.errors.txt index 79177eb22e9..9a7dce0f0cd 100644 --- a/tests/baselines/reference/instancePropertyInClassType.errors.txt +++ b/tests/baselines/reference/instancePropertyInClassType.errors.txt @@ -1,15 +1,23 @@ +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(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(17,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. + + ==== tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts (6 errors) ==== module NonGeneric { class C { x: string; get y() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 1; } set y(v) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. fn() { return this; } constructor(public a: number, private b: number) { } } @@ -21,7 +29,7 @@ r.y = 4; var r6 = c.y(); // error ~~~~~ -!!! Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. } @@ -30,12 +38,12 @@ x: T; get y() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return null; } set y(v: U) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. fn() { return this; } constructor(public a: T, private b: U) { } } @@ -47,5 +55,5 @@ r.y = ''; var r6 = c.y(); // error ~~~~~ -!!! Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. } \ No newline at end of file diff --git a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt index d123ec33f9f..ba93c2ef127 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt +++ b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2415: Class 'C2' incorrectly extends base class 'C1'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type 'C2'. + Property 'x' is missing in type 'String'. + + ==== tests/cases/compiler/instanceSubtypeCheck2.ts (1 errors) ==== class C1 { x: C2; @@ -5,9 +11,9 @@ class C2 extends C1 { ~~ -!!! Class 'C2' incorrectly extends base class 'C1': -!!! Types of property 'x' are incompatible: -!!! Type 'string' is not assignable to type 'C2': -!!! Property 'x' is missing in type 'String'. +!!! error TS2415: Class 'C2' incorrectly extends base class 'C1'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'C2'. +!!! error TS2415: Property 'x' is missing in type 'String'. x: string } \ No newline at end of file diff --git a/tests/baselines/reference/instanceofOperator.errors.txt b/tests/baselines/reference/instanceofOperator.errors.txt index df7ed3991cb..2fa517c53be 100644 --- a/tests/baselines/reference/instanceofOperator.errors.txt +++ b/tests/baselines/reference/instanceofOperator.errors.txt @@ -1,35 +1,42 @@ -==== tests/cases/compiler/instanceofOperator.ts (6 errors) ==== +tests/cases/compiler/instanceofOperator.ts(12,5): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/compiler/instanceofOperator.ts(15,20): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/compiler/instanceofOperator.ts(16,23): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/compiler/instanceofOperator.ts(19,5): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/compiler/instanceofOperator.ts(21,5): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + + +==== tests/cases/compiler/instanceofOperator.ts (5 errors) ==== // Spec: // The instanceof operator requires the left operand to be of type Any or an object type, and the right // operand to be of type Any or a subtype of the ‘Function’ interface type. The result is always of the // Boolean primitive type. - class Object { } - ~~~~~~ -!!! Duplicate identifier 'Object'. - var obj: Object; + module test { + class Object { } + var obj: Object; - 4 instanceof null; - ~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + 4 instanceof null; + ~ +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. - // Error and should be error - obj instanceof 4; - ~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. - Object instanceof obj; - ~~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + // Error and should be error + obj instanceof 4; + ~ +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + Object instanceof obj; + ~~~ +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. - // Error on left hand side - null instanceof null; - ~~~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. - obj instanceof Object; - undefined instanceof undefined; - ~~~~~~~~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + // Error on left hand side + null instanceof null; + ~~~~ +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + obj instanceof Object; + undefined instanceof undefined; + ~~~~~~~~~ +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + } \ No newline at end of file diff --git a/tests/baselines/reference/instanceofOperator.js b/tests/baselines/reference/instanceofOperator.js index 7620c3e83f4..3c6970b66a4 100644 --- a/tests/baselines/reference/instanceofOperator.js +++ b/tests/baselines/reference/instanceofOperator.js @@ -4,21 +4,23 @@ // operand to be of type Any or a subtype of the ‘Function’ interface type. The result is always of the // Boolean primitive type. -class Object { } -var obj: Object; +module test { + class Object { } + var obj: Object; -4 instanceof null; + 4 instanceof null; -// Error and should be error -obj instanceof 4; -Object instanceof obj; + // Error and should be error + obj instanceof 4; + Object instanceof obj; -// Error on left hand side -null instanceof null; -obj instanceof Object; -undefined instanceof undefined; + // Error on left hand side + null instanceof null; + obj instanceof Object; + undefined instanceof undefined; +} @@ -27,17 +29,20 @@ undefined instanceof undefined; // The instanceof operator requires the left operand to be of type Any or an object type, and the right // operand to be of type Any or a subtype of the ‘Function’ interface type. The result is always of the // Boolean primitive type. -var Object = (function () { - function Object() { - } - return Object; -})(); -var obj; -4 instanceof null; -// Error and should be error -obj instanceof 4; -Object instanceof obj; -// Error on left hand side -null instanceof null; -obj instanceof Object; -undefined instanceof undefined; +var test; +(function (test) { + var Object = (function () { + function Object() { + } + return Object; + })(); + var obj; + 4 instanceof null; + // Error and should be error + obj instanceof 4; + Object instanceof obj; + // Error on left hand side + null instanceof null; + obj instanceof Object; + undefined instanceof undefined; +})(test || (test = {})); diff --git a/tests/baselines/reference/instanceofOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/instanceofOperatorWithInvalidOperands.errors.txt index f5698b29c6b..49b5fbc0cd0 100644 --- a/tests/baselines/reference/instanceofOperatorWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/instanceofOperatorWithInvalidOperands.errors.txt @@ -1,3 +1,26 @@ +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(14,11): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(15,11): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(16,11): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(17,11): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(18,11): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(19,11): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(20,11): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(21,11): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(22,11): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(34,24): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(35,24): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(36,24): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(37,24): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(38,24): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(39,24): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(40,24): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(41,24): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(42,24): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(43,25): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(46,11): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts(46,25): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + + ==== tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts (21 errors) ==== class C { foo() { } @@ -14,31 +37,31 @@ var ra1 = a1 instanceof x; ~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. var ra2 = a2 instanceof x; ~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. var ra3 = a3 instanceof x; ~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. var ra4 = a4 instanceof x; ~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. var ra5 = 0 instanceof x; ~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. var ra6 = true instanceof x; ~~~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. var ra7 = '' instanceof x; ~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. var ra8 = null instanceof x; ~~~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. var ra9 = undefined instanceof x; ~~~~~~~~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. // invalid right operand // the right operand to be of type Any or a subtype of the 'Function' interface type @@ -52,38 +75,38 @@ var rb1 = x instanceof b1; ~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. var rb2 = x instanceof b2; ~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. var rb3 = x instanceof b3; ~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. var rb4 = x instanceof b4; ~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. var rb5 = x instanceof 0; ~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. var rb6 = x instanceof true; ~~~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. var rb7 = x instanceof ''; ~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. var rb8 = x instanceof o1; ~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. var rb9 = x instanceof o2; ~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. var rb10 = x instanceof o3; ~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. // both operands are invalid var rc1 = '' instanceof {}; ~~ -!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. ~~ -!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. \ No newline at end of file +!!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateConstraintsToTypeArguments2.errors.txt b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.errors.txt index 1f74e2c9e56..f5d53c582f6 100644 --- a/tests/baselines/reference/instantiateConstraintsToTypeArguments2.errors.txt +++ b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.errors.txt @@ -1,11 +1,17 @@ +tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts(1,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts(1,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts(2,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts(2,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts (4 errors) ==== interface A, S extends A> { } ~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. interface B, S extends B> extends A, B> { } ~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. \ No newline at end of file +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt index d058f42951b..5162cd28fd5 100644 --- a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt +++ b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(8,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(16,9): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts (2 errors) ==== // it is always an error to provide a type argument list whose count does not match the type parameter list // both of these attempts to construct a type is an error @@ -8,7 +12,7 @@ var c = new C(); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. class D { x: T @@ -18,4 +22,4 @@ // BUG 794238 var d = new D(); ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt index 8129005313e..8322fd3b2e4 100644 --- a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt +++ b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt @@ -1,3 +1,11 @@ +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(8,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,9): error TS2350: Only a void function can be called with the 'new' keyword. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,10): error TS2350: Only a void function can be called with the 'new' keyword. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(18,10): error TS2347: Untyped function calls may not accept type arguments. + + ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts (6 errors) ==== // it is an error to provide type arguments to a non-generic call // all of these are errors @@ -8,24 +16,24 @@ var c = new C(); ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. function Foo(): void { } var r = new Foo(); ~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. ~~~~~~~~~~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. +!!! error TS2350: Only a void function can be called with the 'new' keyword. var f: { (): void }; var r2 = new f(); ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. ~~~~~~~~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. +!!! error TS2350: Only a void function can be called with the 'new' keyword. var a: any; // BUG 790977 var r2 = new a(); ~~~~~~~~~~~~~~~ -!!! Untyped function calls may not accept type arguments. \ No newline at end of file +!!! error TS2347: Untyped function calls may not accept type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateTypeParameter.errors.txt b/tests/baselines/reference/instantiateTypeParameter.errors.txt index 6d5a507f475..f56f8a761dd 100644 --- a/tests/baselines/reference/instantiateTypeParameter.errors.txt +++ b/tests/baselines/reference/instantiateTypeParameter.errors.txt @@ -1,12 +1,15 @@ -==== tests/cases/compiler/instantiateTypeParameter.ts (4 errors) ==== +tests/cases/compiler/instantiateTypeParameter.ts(2,5): error TS1131: Property or signature expected. +tests/cases/compiler/instantiateTypeParameter.ts(3,1): error TS1128: Declaration or statement expected. +tests/cases/compiler/instantiateTypeParameter.ts(2,12): error TS2304: Cannot find name 'T'. + + +==== tests/cases/compiler/instantiateTypeParameter.ts (3 errors) ==== interface Foo { var x: T<>; ~~~ -!!! Property or signature expected. - ~~ -!!! Type argument list cannot be empty. +!!! error TS1131: Property or signature expected. ~~~ -!!! Cannot find name 'T'. +!!! error TS2304: Cannot find name 'T'. } ~ -!!! Declaration or statement expected. \ No newline at end of file +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints.errors.txt b/tests/baselines/reference/instantiatedBaseTypeConstraints.errors.txt index 489103dc682..db62abe5688 100644 --- a/tests/baselines/reference/instantiatedBaseTypeConstraints.errors.txt +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/instantiatedBaseTypeConstraints.ts(1,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/instantiatedBaseTypeConstraints.ts (1 errors) ==== interface Foo, C> { ~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo(bar: C): void; } diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints2.errors.txt b/tests/baselines/reference/instantiatedBaseTypeConstraints2.errors.txt index f80877a9142..d5c6d838a84 100644 --- a/tests/baselines/reference/instantiatedBaseTypeConstraints2.errors.txt +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints2.errors.txt @@ -1,7 +1,11 @@ +tests/cases/compiler/instantiatedBaseTypeConstraints2.ts(1,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/instantiatedBaseTypeConstraints2.ts(1,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/instantiatedBaseTypeConstraints2.ts (2 errors) ==== interface A, S extends A> { } ~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. interface B extends A, B> { } \ No newline at end of file diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index 29462bbf527..64655f1bd35 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -1,4 +1,91 @@ -==== tests/cases/compiler/intTypeCheck.ts (73 errors) ==== +tests/cases/compiler/intTypeCheck.ts(104,20): error TS1109: Expression expected. +tests/cases/compiler/intTypeCheck.ts(118,21): error TS1109: Expression expected. +tests/cases/compiler/intTypeCheck.ts(132,21): error TS1109: Expression expected. +tests/cases/compiler/intTypeCheck.ts(146,21): error TS1109: Expression expected. +tests/cases/compiler/intTypeCheck.ts(160,21): error TS1109: Expression expected. +tests/cases/compiler/intTypeCheck.ts(174,21): error TS1109: Expression expected. +tests/cases/compiler/intTypeCheck.ts(188,21): error TS1109: Expression expected. +tests/cases/compiler/intTypeCheck.ts(202,21): error TS1109: Expression expected. +tests/cases/compiler/intTypeCheck.ts(83,5): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/intTypeCheck.ts(97,5): error TS2322: Type 'Object' is not assignable to type 'i1'. + Property 'p' is missing in type 'Object'. +tests/cases/compiler/intTypeCheck.ts(98,16): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'i1'. + Property 'p' is missing in type 'Base'. +tests/cases/compiler/intTypeCheck.ts(101,5): error TS2322: Type '() => void' is not assignable to type 'i1'. + Property 'p' is missing in type '() => void'. +tests/cases/compiler/intTypeCheck.ts(104,5): error TS2322: Type 'boolean' is not assignable to type 'i1'. + Property 'p' is missing in type 'Boolean'. +tests/cases/compiler/intTypeCheck.ts(104,21): error TS2304: Cannot find name 'i1'. +tests/cases/compiler/intTypeCheck.ts(105,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(110,5): error TS2322: Type '{}' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(111,5): error TS2322: Type 'Object' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(112,17): error TS2350: Only a void function can be called with the 'new' keyword. +tests/cases/compiler/intTypeCheck.ts(113,5): error TS2322: Type 'Base' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(118,5): error TS2322: Type 'boolean' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(118,22): error TS2304: Cannot find name 'i2'. +tests/cases/compiler/intTypeCheck.ts(119,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(124,5): error TS2322: Type '{}' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(125,5): error TS2322: Type 'Object' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(127,5): error TS2322: Type 'Base' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(129,5): error TS2322: Type '() => void' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(132,5): error TS2322: Type 'boolean' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(132,22): error TS2304: Cannot find name 'i3'. +tests/cases/compiler/intTypeCheck.ts(133,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(139,5): error TS2322: Type 'Object' is not assignable to type 'i4'. + Index signature is missing in type 'Object'. +tests/cases/compiler/intTypeCheck.ts(140,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(141,5): error TS2322: Type 'Base' is not assignable to type 'i4'. + Index signature is missing in type 'Base'. +tests/cases/compiler/intTypeCheck.ts(143,5): error TS2322: Type '() => void' is not assignable to type 'i4'. + Index signature is missing in type '() => void'. +tests/cases/compiler/intTypeCheck.ts(146,5): error TS2322: Type 'boolean' is not assignable to type 'i4'. + Index signature is missing in type 'Boolean'. +tests/cases/compiler/intTypeCheck.ts(146,22): error TS2304: Cannot find name 'i4'. +tests/cases/compiler/intTypeCheck.ts(147,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(152,5): error TS2322: Type '{}' is not assignable to type 'i5'. + Property 'p' is missing in type '{}'. +tests/cases/compiler/intTypeCheck.ts(153,5): error TS2322: Type 'Object' is not assignable to type 'i5'. + Property 'p' is missing in type 'Object'. +tests/cases/compiler/intTypeCheck.ts(154,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(155,5): error TS2322: Type 'Base' is not assignable to type 'i5'. + Property 'p' is missing in type 'Base'. +tests/cases/compiler/intTypeCheck.ts(157,5): error TS2322: Type '() => void' is not assignable to type 'i5'. + Property 'p' is missing in type '() => void'. +tests/cases/compiler/intTypeCheck.ts(160,5): error TS2322: Type 'boolean' is not assignable to type 'i5'. + Property 'p' is missing in type 'Boolean'. +tests/cases/compiler/intTypeCheck.ts(160,22): error TS2304: Cannot find name 'i5'. +tests/cases/compiler/intTypeCheck.ts(161,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(166,5): error TS2322: Type '{}' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(167,5): error TS2322: Type 'Object' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(168,17): error TS2350: Only a void function can be called with the 'new' keyword. +tests/cases/compiler/intTypeCheck.ts(169,5): error TS2322: Type 'Base' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(171,5): error TS2322: Type '() => void' is not assignable to type 'i6'. + Type 'void' is not assignable to type 'number'. +tests/cases/compiler/intTypeCheck.ts(174,5): error TS2322: Type 'boolean' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(174,22): error TS2304: Cannot find name 'i6'. +tests/cases/compiler/intTypeCheck.ts(175,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(180,5): error TS2322: Type '{}' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(181,5): error TS2322: Type 'Object' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(183,17): error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other. +tests/cases/compiler/intTypeCheck.ts(185,5): error TS2322: Type '() => void' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(188,5): error TS2322: Type 'boolean' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(188,22): error TS2304: Cannot find name 'i7'. +tests/cases/compiler/intTypeCheck.ts(189,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(195,5): error TS2322: Type 'Object' is not assignable to type 'i8'. + Index signature is missing in type 'Object'. +tests/cases/compiler/intTypeCheck.ts(196,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/compiler/intTypeCheck.ts(197,5): error TS2322: Type 'Base' is not assignable to type 'i8'. + Index signature is missing in type 'Base'. +tests/cases/compiler/intTypeCheck.ts(199,5): error TS2322: Type '() => void' is not assignable to type 'i8'. + Index signature is missing in type '() => void'. +tests/cases/compiler/intTypeCheck.ts(202,5): error TS2322: Type 'boolean' is not assignable to type 'i8'. + Index signature is missing in type 'Boolean'. +tests/cases/compiler/intTypeCheck.ts(202,22): error TS2304: Cannot find name 'i8'. +tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + + +==== tests/cases/compiler/intTypeCheck.ts (67 errors) ==== interface i1 { //Property Signatures p; @@ -34,14 +121,8 @@ interface i4 { //Index Signatures [p]; - ~ -!!! An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! An index signature must have a type annotation. [p2: string, p3: number]; - ~~ -!!! An index signature must have exactly one parameter. } interface i5 extends i1 { } interface i6 extends i2 { } @@ -75,14 +156,8 @@ //Index Signatures [p]; - ~ -!!! An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! An index signature must have a type annotation. [p2: string, p3: number]; - ~~ -!!! An index signature must have exactly one parameter. //Property Signatures p; @@ -95,7 +170,7 @@ p7(pa1, pa2): void; p7? (pa1, pa2): void; ~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. } var anyVar: any; @@ -111,93 +186,93 @@ }; var obj2: i1 = new Object(); ~~~~ -!!! Type 'Object' is not assignable to type 'i1': -!!! Property 'p' is missing in type 'Object'. +!!! error TS2322: Type 'Object' is not assignable to type 'i1'. +!!! error TS2322: Property 'p' is missing in type 'Object'. var obj3: i1 = new obj0; ~~~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj4: i1 = new Base; ~~~~ -!!! Type 'Base' is not assignable to type 'i1': -!!! Property 'p' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'i1'. +!!! error TS2322: Property 'p' is missing in type 'Base'. var obj5: i1 = null; var obj6: i1 = function () { }; ~~~~ -!!! Type '() => void' is not assignable to type 'i1': -!!! Property 'p' is missing in type '() => void'. +!!! error TS2322: Type '() => void' is not assignable to type 'i1'. +!!! error TS2322: Property 'p' is missing in type '() => void'. //var obj7: i1 = function foo() { }; var obj8: i1 = anyVar; var obj9: i1 = new anyVar; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~ -!!! Type 'boolean' is not assignable to type 'i1': -!!! Property 'p' is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i1'. +!!! error TS2322: Property 'p' is missing in type 'Boolean'. ~~ -!!! Cannot find name 'i1'. +!!! error TS2304: Cannot find name 'i1'. var obj10: i1 = new {}; ~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. // // Call signatures // var obj11: i2; var obj12: i2 = {}; ~~~~~ -!!! Type '{}' is not assignable to type 'i2'. +!!! error TS2322: Type '{}' is not assignable to type 'i2'. var obj13: i2 = new Object(); ~~~~~ -!!! Type 'Object' is not assignable to type 'i2'. +!!! error TS2322: Type 'Object' is not assignable to type 'i2'. var obj14: i2 = new obj11; ~~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. +!!! error TS2350: Only a void function can be called with the 'new' keyword. var obj15: i2 = new Base; ~~~~~ -!!! Type 'Base' is not assignable to type 'i2'. +!!! error TS2322: Type 'Base' is not assignable to type 'i2'. var obj16: i2 = null; var obj17: i2 = function ():any { return 0; }; //var obj18: i2 = function foo() { }; var obj19: i2 = anyVar; var obj20: i2 = new anyVar; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~ -!!! Type 'boolean' is not assignable to type 'i2'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i2'. ~~ -!!! Cannot find name 'i2'. +!!! error TS2304: Cannot find name 'i2'. var obj21: i2 = new {}; ~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. // // Construct Signatures // var obj22: i3; var obj23: i3 = {}; ~~~~~ -!!! Type '{}' is not assignable to type 'i3'. +!!! error TS2322: Type '{}' is not assignable to type 'i3'. var obj24: i3 = new Object(); ~~~~~ -!!! Type 'Object' is not assignable to type 'i3'. +!!! error TS2322: Type 'Object' is not assignable to type 'i3'. var obj25: i3 = new obj22; var obj26: i3 = new Base; ~~~~~ -!!! Type 'Base' is not assignable to type 'i3'. +!!! error TS2322: Type 'Base' is not assignable to type 'i3'. var obj27: i3 = null; var obj28: i3 = function () { }; ~~~~~ -!!! Type '() => void' is not assignable to type 'i3'. +!!! error TS2322: Type '() => void' is not assignable to type 'i3'. //var obj29: i3 = function foo() { }; var obj30: i3 = anyVar; var obj31: i3 = new anyVar; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~ -!!! Type 'boolean' is not assignable to type 'i3'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i3'. ~~ -!!! Cannot find name 'i3'. +!!! error TS2304: Cannot find name 'i3'. var obj32: i3 = new {}; ~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. // // Index Signatures // @@ -205,133 +280,133 @@ var obj34: i4 = {}; var obj35: i4 = new Object(); ~~~~~ -!!! Type 'Object' is not assignable to type 'i4': -!!! Index signature is missing in type 'Object'. +!!! error TS2322: Type 'Object' is not assignable to type 'i4'. +!!! error TS2322: Index signature is missing in type 'Object'. var obj36: i4 = new obj33; ~~~~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj37: i4 = new Base; ~~~~~ -!!! Type 'Base' is not assignable to type 'i4': -!!! Index signature is missing in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'i4'. +!!! error TS2322: Index signature is missing in type 'Base'. var obj38: i4 = null; var obj39: i4 = function () { }; ~~~~~ -!!! Type '() => void' is not assignable to type 'i4': -!!! Index signature is missing in type '() => void'. +!!! error TS2322: Type '() => void' is not assignable to type 'i4'. +!!! error TS2322: Index signature is missing in type '() => void'. //var obj40: i4 = function foo() { }; var obj41: i4 = anyVar; var obj42: i4 = new anyVar; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~ -!!! Type 'boolean' is not assignable to type 'i4': -!!! Index signature is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i4'. +!!! error TS2322: Index signature is missing in type 'Boolean'. ~~ -!!! Cannot find name 'i4'. +!!! error TS2304: Cannot find name 'i4'. var obj43: i4 = new {}; ~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. // // Interface Derived I1 // var obj44: i5; var obj45: i5 = {}; ~~~~~ -!!! Type '{}' is not assignable to type 'i5': -!!! Property 'p' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'i5'. +!!! error TS2322: Property 'p' is missing in type '{}'. var obj46: i5 = new Object(); ~~~~~ -!!! Type 'Object' is not assignable to type 'i5': -!!! Property 'p' is missing in type 'Object'. +!!! error TS2322: Type 'Object' is not assignable to type 'i5'. +!!! error TS2322: Property 'p' is missing in type 'Object'. var obj47: i5 = new obj44; ~~~~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj48: i5 = new Base; ~~~~~ -!!! Type 'Base' is not assignable to type 'i5': -!!! Property 'p' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'i5'. +!!! error TS2322: Property 'p' is missing in type 'Base'. var obj49: i5 = null; var obj50: i5 = function () { }; ~~~~~ -!!! Type '() => void' is not assignable to type 'i5': -!!! Property 'p' is missing in type '() => void'. +!!! error TS2322: Type '() => void' is not assignable to type 'i5'. +!!! error TS2322: Property 'p' is missing in type '() => void'. //var obj51: i5 = function foo() { }; var obj52: i5 = anyVar; var obj53: i5 = new anyVar; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~ -!!! Type 'boolean' is not assignable to type 'i5': -!!! Property 'p' is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i5'. +!!! error TS2322: Property 'p' is missing in type 'Boolean'. ~~ -!!! Cannot find name 'i5'. +!!! error TS2304: Cannot find name 'i5'. var obj54: i5 = new {}; ~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. // // Interface Derived I2 // var obj55: i6; var obj56: i6 = {}; ~~~~~ -!!! Type '{}' is not assignable to type 'i6'. +!!! error TS2322: Type '{}' is not assignable to type 'i6'. var obj57: i6 = new Object(); ~~~~~ -!!! Type 'Object' is not assignable to type 'i6'. +!!! error TS2322: Type 'Object' is not assignable to type 'i6'. var obj58: i6 = new obj55; ~~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. +!!! error TS2350: Only a void function can be called with the 'new' keyword. var obj59: i6 = new Base; ~~~~~ -!!! Type 'Base' is not assignable to type 'i6'. +!!! error TS2322: Type 'Base' is not assignable to type 'i6'. var obj60: i6 = null; var obj61: i6 = function () { }; ~~~~~ -!!! Type '() => void' is not assignable to type 'i6': -!!! Type 'void' is not assignable to type 'number'. +!!! error TS2322: Type '() => void' is not assignable to type 'i6'. +!!! error TS2322: Type 'void' is not assignable to type 'number'. //var obj62: i6 = function foo() { }; var obj63: i6 = anyVar; var obj64: i6 = new anyVar; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~ -!!! Type 'boolean' is not assignable to type 'i6'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i6'. ~~ -!!! Cannot find name 'i6'. +!!! error TS2304: Cannot find name 'i6'. var obj65: i6 = new {}; ~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. // // Interface Derived I3 // var obj66: i7; var obj67: i7 = {}; ~~~~~ -!!! Type '{}' is not assignable to type 'i7'. +!!! error TS2322: Type '{}' is not assignable to type 'i7'. var obj68: i7 = new Object(); ~~~~~ -!!! Type 'Object' is not assignable to type 'i7'. +!!! error TS2322: Type 'Object' is not assignable to type 'i7'. var obj69: i7 = new obj66; var obj70: i7 = new Base; ~~~~~~~~~~~~ -!!! Neither type 'Base' nor type 'i7' is assignable to the other. +!!! error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other. var obj71: i7 = null; var obj72: i7 = function () { }; ~~~~~ -!!! Type '() => void' is not assignable to type 'i7'. +!!! error TS2322: Type '() => void' is not assignable to type 'i7'. //var obj73: i7 = function foo() { }; var obj74: i7 = anyVar; var obj75: i7 = new anyVar; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~ -!!! Type 'boolean' is not assignable to type 'i7'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i7'. ~~ -!!! Cannot find name 'i7'. +!!! error TS2304: Cannot find name 'i7'. var obj76: i7 = new {}; ~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. // // Interface Derived I4 // @@ -339,30 +414,30 @@ var obj78: i8 = {}; var obj79: i8 = new Object(); ~~~~~ -!!! Type 'Object' is not assignable to type 'i8': -!!! Index signature is missing in type 'Object'. +!!! error TS2322: Type 'Object' is not assignable to type 'i8'. +!!! error TS2322: Index signature is missing in type 'Object'. var obj80: i8 = new obj77; ~~~~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj81: i8 = new Base; ~~~~~ -!!! Type 'Base' is not assignable to type 'i8': -!!! Index signature is missing in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'i8'. +!!! error TS2322: Index signature is missing in type 'Base'. var obj82: i8 = null; var obj83: i8 = function () { }; ~~~~~ -!!! Type '() => void' is not assignable to type 'i8': -!!! Index signature is missing in type '() => void'. +!!! error TS2322: Type '() => void' is not assignable to type 'i8'. +!!! error TS2322: Index signature is missing in type '() => void'. //var obj84: i8 = function foo() { }; var obj85: i8 = anyVar; var obj86: i8 = new anyVar; ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~ -!!! Type 'boolean' is not assignable to type 'i8': -!!! Index signature is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i8'. +!!! error TS2322: Index signature is missing in type 'Boolean'. ~~ -!!! Cannot find name 'i8'. +!!! error TS2304: Cannot find name 'i8'. var obj87: i8 = new {}; ~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. \ No newline at end of file +!!! 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/interfaceAssignmentCompat.errors.txt b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt index 663cb9a56ca..35cf2df71ff 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt +++ b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/interfaceAssignmentCompat.ts(32,18): error TS2345: Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'. +tests/cases/compiler/interfaceAssignmentCompat.ts(37,29): error TS2339: Property '_map' does not exist on type 'typeof Color'. +tests/cases/compiler/interfaceAssignmentCompat.ts(42,13): error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. +tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'. + Type 'IEye' is not assignable to type 'IFrenchEye'. + + ==== tests/cases/compiler/interfaceAssignmentCompat.ts (4 errors) ==== module M { export enum Color { @@ -32,27 +39,26 @@ x=x.sort(CompareYeux); // parameter mismatch ~~~~~~~~~~~ -!!! Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'. +!!! error TS2345: Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'. // type of z inferred from specialized array type var z=x.sort(CompareEyes); // ok for (var i=0,len=z.length;i=0;j--) { eeks[j]=z[j]; // nope: element assignment ~~~~~~~ -!!! Type 'IEye' is not assignable to type 'IFrenchEye': -!!! Property 'coleur' is missing in type 'IEye'. +!!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. } eeks=z; // nope: array assignment ~~~~ -!!! Type 'IEye[]' is not assignable to type 'IFrenchEye[]': -!!! Type 'IEye' is not assignable to type 'IFrenchEye'. +!!! error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'. +!!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. return result; } } diff --git a/tests/baselines/reference/interfaceContextualType.types b/tests/baselines/reference/interfaceContextualType.types index 88ba9dcbc24..3078ecfdfa4 100644 --- a/tests/baselines/reference/interfaceContextualType.types +++ b/tests/baselines/reference/interfaceContextualType.types @@ -27,11 +27,11 @@ class Bug { >ok : () => void this.values = {}; ->this.values = {} : { [x: string]: IOptions; } +>this.values = {} : { [x: string]: undefined; } >this.values : IMap >this : Bug >values : IMap ->{} : { [x: string]: IOptions; } +>{} : { [x: string]: undefined; } this.values['comments'] = { italic: true }; >this.values['comments'] = { italic: true } : { italic: boolean; } @@ -46,11 +46,11 @@ class Bug { >shouldBeOK : () => void this.values = { ->this.values = { comments: { italic: true } } : { [x: string]: IOptions; comments: { italic: boolean; }; } +>this.values = { comments: { italic: true } } : { [x: string]: { italic: boolean; }; comments: { italic: boolean; }; } >this.values : IMap >this : Bug >values : IMap ->{ comments: { italic: true } } : { [x: string]: IOptions; comments: { italic: boolean; }; } +>{ comments: { italic: true } } : { [x: string]: { italic: boolean; }; comments: { italic: boolean; }; } comments: { italic: true } >comments : { italic: boolean; } diff --git a/tests/baselines/reference/interfaceDeclaration1.errors.txt b/tests/baselines/reference/interfaceDeclaration1.errors.txt index 512f49776e2..1e8cc0c1e68 100644 --- a/tests/baselines/reference/interfaceDeclaration1.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration1.errors.txt @@ -1,16 +1,32 @@ -==== tests/cases/compiler/interfaceDeclaration1.ts (6 errors) ==== +tests/cases/compiler/interfaceDeclaration1.ts(2,5): error TS2300: Duplicate identifier 'item'. +tests/cases/compiler/interfaceDeclaration1.ts(3,5): error TS2300: Duplicate identifier 'item'. +tests/cases/compiler/interfaceDeclaration1.ts(7,5): error TS2300: Duplicate identifier 'item'. +tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2300: Duplicate identifier 'item'. +tests/cases/compiler/interfaceDeclaration1.ts(22,11): error TS2310: Type 'I5' recursively references itself as a base type. +tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2420: Class 'C1' incorrectly implements interface 'I3'. + Property 'prototype' is missing in type 'C1'. +tests/cases/compiler/interfaceDeclaration1.ts(41,11): error TS2310: Type 'i8' recursively references itself as a base type. +tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11'. + Named properties 'foo' of types 'i10' and 'i11' are not identical. + + +==== tests/cases/compiler/interfaceDeclaration1.ts (8 errors) ==== interface I1 { item:number; + ~~~~ +!!! error TS2300: Duplicate identifier 'item'. item:number; ~~~~ -!!! Duplicate identifier 'item'. +!!! error TS2300: Duplicate identifier 'item'. } interface I2 { item:any; + ~~~~ +!!! error TS2300: Duplicate identifier 'item'. item:number; ~~~~ -!!! Duplicate identifier 'item'. +!!! error TS2300: Duplicate identifier 'item'. } interface I3 { @@ -26,7 +42,7 @@ interface I5 extends I5 { ~~ -!!! Type 'I5' recursively references itself as a base type. +!!! error TS2310: Type 'I5' recursively references itself as a base type. foo():void; } @@ -41,8 +57,8 @@ class C1 implements I3 { ~~ -!!! Class 'C1' incorrectly implements interface 'I3': -!!! Property 'prototype' is missing in type 'C1'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I3'. +!!! error TS2420: Property 'prototype' is missing in type 'C1'. constructor() { var prototype: number = 3; } @@ -50,7 +66,7 @@ interface i8 extends i9 { } ~~ -!!! Type 'i8' recursively references itself as a base type. +!!! error TS2310: Type 'i8' recursively references itself as a base type. interface i9 extends i8 { } interface i10 { @@ -63,6 +79,6 @@ interface i12 extends i10, i11 { } ~~~ -!!! Interface 'i12' cannot simultaneously extend types 'i10' and 'i11': -!!! Named properties 'foo' of types 'i10' and 'i11' are not identical. +!!! error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11'. +!!! error TS2320: Named properties 'foo' of types 'i10' and 'i11' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration2.errors.txt b/tests/baselines/reference/interfaceDeclaration2.errors.txt index a7ee7796372..9739d946bc5 100644 --- a/tests/baselines/reference/interfaceDeclaration2.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration2.errors.txt @@ -1,11 +1,17 @@ -==== tests/cases/compiler/interfaceDeclaration2.ts (1 errors) ==== +tests/cases/compiler/interfaceDeclaration2.ts(4,11): error TS2300: Duplicate identifier 'I2'. +tests/cases/compiler/interfaceDeclaration2.ts(5,7): error TS2300: Duplicate identifier 'I2'. + + +==== tests/cases/compiler/interfaceDeclaration2.ts (2 errors) ==== interface I1 { } module I1 { } interface I2 { } + ~~ +!!! error TS2300: Duplicate identifier 'I2'. class I2 { } ~~ -!!! Duplicate identifier 'I2'. +!!! error TS2300: Duplicate identifier 'I2'. interface I3 { } function I3() { } diff --git a/tests/baselines/reference/interfaceDeclaration3.errors.txt b/tests/baselines/reference/interfaceDeclaration3.errors.txt index f3a861a849b..a9bd1d42647 100644 --- a/tests/baselines/reference/interfaceDeclaration3.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration3.errors.txt @@ -1,3 +1,14 @@ +tests/cases/compiler/interfaceDeclaration3.ts(6,11): error TS2420: Class 'C1' incorrectly implements interface 'I1'. + Types of property 'item' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/interfaceDeclaration3.ts(31,11): error TS2420: Class 'C1' incorrectly implements interface 'I1'. + Types of property 'item' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2430: Interface 'I2' incorrectly extends interface 'I1'. + Types of property 'item' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/interfaceDeclaration3.ts (3 errors) ==== interface I1 { item:number; } @@ -6,9 +17,9 @@ interface I2 { item:number; } class C1 implements I1 { ~~ -!!! Class 'C1' incorrectly implements interface 'I1': -!!! Types of property 'item' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'. +!!! error TS2420: Types of property 'item' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public item:number; } class C2 implements I1 { @@ -35,9 +46,9 @@ } class C1 implements I1 { ~~ -!!! Class 'C1' incorrectly implements interface 'I1': -!!! Types of property 'item' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'. +!!! error TS2420: Types of property 'item' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public item:number; } class C2 implements I1 { @@ -62,7 +73,7 @@ interface I2 extends I1 { item:string; } ~~ -!!! Interface 'I2' incorrectly extends interface 'I1': -!!! Types of property 'item' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'I1'. +!!! error TS2430: Types of property 'item' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration4.errors.txt b/tests/baselines/reference/interfaceDeclaration4.errors.txt index 3f81ffba644..520c0c2cadf 100644 --- a/tests/baselines/reference/interfaceDeclaration4.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration4.errors.txt @@ -1,3 +1,15 @@ +tests/cases/compiler/interfaceDeclaration4.ts(39,14): error TS1005: '{' expected. +tests/cases/compiler/interfaceDeclaration4.ts(39,18): error TS1005: ';' expected. +tests/cases/compiler/interfaceDeclaration4.ts(18,11): error TS2430: Interface 'I3' incorrectly extends interface 'I1'. + Types of property 'item' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/interfaceDeclaration4.ts(27,7): error TS2420: Class 'C2' incorrectly implements interface 'I4'. + Property 'item' is missing in type 'C2'. +tests/cases/compiler/interfaceDeclaration4.ts(36,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'. + Property 'item' is missing in type 'C3'. +tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find name 'I1'. + + ==== tests/cases/compiler/interfaceDeclaration4.ts (6 errors) ==== // Import this module when test harness supports external modules. Also remove the internal module below. // import Foo = require("interfaceDeclaration5") @@ -18,9 +30,9 @@ // Negative Case interface I3 extends Foo.I1 { ~~ -!!! Interface 'I3' incorrectly extends interface 'I1': -!!! Types of property 'item' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'I1'. +!!! error TS2430: Types of property 'item' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. item:number; } @@ -31,8 +43,8 @@ // Err - not implemented item class C2 implements I4 { ~~ -!!! Class 'C2' incorrectly implements interface 'I4': -!!! Property 'item' is missing in type 'C2'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'I4'. +!!! error TS2420: Property 'item' is missing in type 'C2'. public token: string; } @@ -43,15 +55,15 @@ class C3 implements Foo.I1 { } ~~ -!!! Class 'C3' incorrectly implements interface 'I1': -!!! Property 'item' is missing in type 'C3'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'item' is missing in type 'C3'. // Negative case interface Foo.I1 { } ~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~ -!!! Cannot find name 'I1'. +!!! error TS2304: Cannot find name 'I1'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration6.errors.txt b/tests/baselines/reference/interfaceDeclaration6.errors.txt index a517250e9b9..ab5ac03a31d 100644 --- a/tests/baselines/reference/interfaceDeclaration6.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration6.errors.txt @@ -1,11 +1,16 @@ +tests/cases/compiler/interfaceDeclaration6.ts(3,11): error TS2430: Interface 'i3' incorrectly extends interface 'i1'. + Types of property 'foo' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/interfaceDeclaration6.ts (1 errors) ==== interface i1 { foo: number; }; interface i2 extends i1 { foo: number; }; interface i3 extends i1 { foo: string; }; ~~ -!!! Interface 'i3' incorrectly extends interface 'i1': -!!! Types of property 'foo' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'i3' incorrectly extends interface 'i1'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. interface i4 { bar():any; bar():any; diff --git a/tests/baselines/reference/interfaceExtendingClass.errors.txt b/tests/baselines/reference/interfaceExtendingClass.errors.txt index 7600d983fd7..66a75a1c998 100644 --- a/tests/baselines/reference/interfaceExtendingClass.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClass.errors.txt @@ -1,10 +1,13 @@ +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass.ts (1 errors) ==== class Foo { x: string; y() { } get Z() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 1; } [x: string]: Object; diff --git a/tests/baselines/reference/interfaceExtendingClass2.errors.txt b/tests/baselines/reference/interfaceExtendingClass2.errors.txt index 7bd8509ee2f..1e07199686b 100644 --- a/tests/baselines/reference/interfaceExtendingClass2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClass2.errors.txt @@ -1,10 +1,14 @@ -==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (6 errors) ==== +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(13,13): error TS1131: Property or signature expected. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(14,9): error TS1128: Declaration or statement expected. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(15,5): error TS1128: Declaration or statement expected. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(11,5): error TS2411: Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. + + +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (4 errors) ==== class Foo { x: string; y() { } get Z() { - ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. return 1; } [x: string]: Object; @@ -15,15 +19,13 @@ ~~~~ toString: () => { ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. return 1; ~~~~~~ -!!! A 'return' statement can only be used within a function body. - ~~~~~~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. }; ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. } ~ -!!! Declaration or statement expected. \ No newline at end of file +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt index 525f9e2d517..d80df216c79 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt @@ -1,3 +1,8 @@ +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(5,11): error TS2430: Interface 'I' incorrectly extends interface 'Foo'. + Property 'x' is private in type 'Foo' but not in type 'I'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(15,10): error TS2341: Property 'x' is private and only accessible within class 'Foo'. + + ==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts (2 errors) ==== class Foo { private x: string; @@ -5,8 +10,8 @@ interface I extends Foo { // error ~ -!!! Interface 'I' incorrectly extends interface 'Foo': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2430: Interface 'I' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is private in type 'Foo' but not in type 'I'. x: string; } @@ -18,4 +23,4 @@ var r = i.y; var r2 = i.x; // error ~~~ -!!! Property 'Foo.x' is inaccessible. \ No newline at end of file +!!! error TS2341: Property 'x' is private and only accessible within class 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt index 9af19f5f67e..c9be8471e8c 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. + Named properties 'x' of types 'Foo' and 'Bar' are not identical. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. + Property 'x' is private in type 'Bar' but not in type 'I4'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. + Property 'x' is private in type 'Foo' but not in type 'I4'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(26,10): error TS2341: Property 'x' is private and only accessible within class 'Foo'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(27,10): error TS2341: Property 'y' is private and only accessible within class 'Baz'. + + ==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts (5 errors) ==== class Foo { private x: string; @@ -9,17 +19,17 @@ interface I3 extends Foo, Bar { // error ~~ -!!! Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar': -!!! Named properties 'x' of types 'Foo' and 'Bar' are not identical. +!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. +!!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical. } interface I4 extends Foo, Bar { // error ~~ -!!! Interface 'I4' incorrectly extends interface 'Bar': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. +!!! error TS2430: Property 'x' is private in type 'Bar' but not in type 'I4'. ~~ -!!! Interface 'I4' incorrectly extends interface 'Foo': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is private in type 'Foo' but not in type 'I4'. x: string; } @@ -35,7 +45,7 @@ var r: string = i.z; var r2 = i.x; // error ~~~ -!!! Property 'Foo.x' is inaccessible. +!!! error TS2341: Property 'x' is private and only accessible within class 'Foo'. var r3 = i.y; // error ~~~ -!!! Property 'Baz.y' is inaccessible. \ No newline at end of file +!!! error TS2341: Property 'y' is private and only accessible within class 'Baz'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt new file mode 100644 index 00000000000..05651c92976 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt @@ -0,0 +1,26 @@ +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts(5,11): error TS2430: Interface 'I' incorrectly extends interface 'Foo'. + Property 'x' is protected but type 'I' is not a class derived from 'Foo'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts(15,10): error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses. + + +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts (2 errors) ==== + class Foo { + protected x: string; + } + + interface I extends Foo { // error + ~ +!!! error TS2430: Interface 'I' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is protected but type 'I' is not a class derived from 'Foo'. + x: string; + } + + interface I2 extends Foo { + y: string; + } + + var i: I2; + var r = i.y; + var r2 = i.x; // error + ~~~ +!!! error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClassWithProtecteds.js b/tests/baselines/reference/interfaceExtendingClassWithProtecteds.js new file mode 100644 index 00000000000..f2d95812fd2 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendingClassWithProtecteds.js @@ -0,0 +1,26 @@ +//// [interfaceExtendingClassWithProtecteds.ts] +class Foo { + protected x: string; +} + +interface I extends Foo { // error + x: string; +} + +interface I2 extends Foo { + y: string; +} + +var i: I2; +var r = i.y; +var r2 = i.x; // error + +//// [interfaceExtendingClassWithProtecteds.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var i; +var r = i.y; +var r2 = i.x; // error diff --git a/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt new file mode 100644 index 00000000000..a63dfd6efca --- /dev/null +++ b/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt @@ -0,0 +1,51 @@ +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. + Named properties 'x' of types 'Foo' and 'Bar' are not identical. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. + Property 'x' is protected but type 'I4' is not a class derived from 'Bar'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. + Property 'x' is protected but type 'I4' is not a class derived from 'Foo'. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(26,10): error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses. +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(27,10): error TS2445: Property 'y' is protected and only accessible within class 'Baz' and its subclasses. + + +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts (5 errors) ==== + class Foo { + protected x: string; + } + + class Bar { + protected x: string; + } + + interface I3 extends Foo, Bar { // error + ~~ +!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. +!!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical. + } + + interface I4 extends Foo, Bar { // error + ~~ +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. +!!! error TS2430: Property 'x' is protected but type 'I4' is not a class derived from 'Bar'. + ~~ +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is protected but type 'I4' is not a class derived from 'Foo'. + x: string; + } + + class Baz { + protected y: string; + } + + interface I5 extends Foo, Baz { + z: string; + } + + var i: I5; + var r: string = i.z; + var r2 = i.x; // error + ~~~ +!!! error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses. + var r3 = i.y; // error + ~~~ +!!! error TS2445: Property 'y' is protected and only accessible within class 'Baz' and its subclasses. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.js b/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.js new file mode 100644 index 00000000000..277c32a10c1 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.js @@ -0,0 +1,49 @@ +//// [interfaceExtendingClassWithProtecteds2.ts] +class Foo { + protected x: string; +} + +class Bar { + protected x: string; +} + +interface I3 extends Foo, Bar { // error +} + +interface I4 extends Foo, Bar { // error + x: string; +} + +class Baz { + protected y: string; +} + +interface I5 extends Foo, Baz { + z: string; +} + +var i: I5; +var r: string = i.z; +var r2 = i.x; // error +var r3 = i.y; // error + +//// [interfaceExtendingClassWithProtecteds2.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Bar = (function () { + function Bar() { + } + return Bar; +})(); +var Baz = (function () { + function Baz() { + } + return Baz; +})(); +var i; +var r = i.z; +var r2 = i.x; // error +var r3 = i.y; // error diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt index e9864c85b6b..f624560b7c0 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(21,1): error TS2322: Type 'C' is not assignable to type 'I'. + Property 'other' is missing in type 'C'. +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(24,1): error TS2322: Type 'I' is not assignable to type 'D'. + Property 'bar' is missing in type 'I'. +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2322: Type 'C' is not assignable to type 'D'. + Property 'other' is missing in type 'C'. + + ==== tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts (3 errors) ==== class C { public foo(x: any) { return x; } @@ -21,17 +29,17 @@ c = i; i = c; // error ~ -!!! Type 'C' is not assignable to type 'I': -!!! Property 'other' is missing in type 'C'. +!!! error TS2322: Type 'C' is not assignable to type 'I'. +!!! error TS2322: Property 'other' is missing in type 'C'. i = d; d = i; // error ~ -!!! Type 'I' is not assignable to type 'D': -!!! Property 'bar' is missing in type 'I'. +!!! error TS2322: Type 'I' is not assignable to type 'D'. +!!! error TS2322: Property 'bar' is missing in type 'I'. c = d; d = c; // error ~ -!!! Type 'C' is not assignable to type 'D': -!!! Property 'other' is missing in type 'C'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'D'. +!!! error TS2322: Property 'other' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt index 54d0ebef980..035fe89cd35 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt @@ -1,3 +1,13 @@ +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2415: Class 'D' incorrectly extends base class 'C'. + Types have separate declarations of a private property 'x'. +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2420: Class 'D' incorrectly implements interface 'I'. + Types have separate declarations of a private property 'x'. +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2415: Class 'D2' incorrectly extends base class 'C'. + Types have separate declarations of a private property 'x'. +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2420: Class 'D2' incorrectly implements interface 'I'. + Types have separate declarations of a private property 'x'. + + ==== tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts (4 errors) ==== class C { public foo(x: any) { return x; } @@ -10,11 +20,11 @@ class D extends C implements I { // error ~ -!!! Class 'D' incorrectly extends base class 'C': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2415: Class 'D' incorrectly extends base class 'C'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~ -!!! Class 'D' incorrectly implements interface 'I': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'D' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. public foo(x: any) { return x; } private x = 2; private y = 3; @@ -24,11 +34,11 @@ class D2 extends C implements I { // error ~~ -!!! Class 'D2' incorrectly extends base class 'C': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2415: Class 'D2' incorrectly extends base class 'C'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~ -!!! Class 'D2' incorrectly implements interface 'I': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'D2' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. public foo(x: any) { return x; } private x = ""; other(x: any) { return x; } diff --git a/tests/baselines/reference/interfaceImplementation1.errors.txt b/tests/baselines/reference/interfaceImplementation1.errors.txt index f278e160227..45b011c6929 100644 --- a/tests/baselines/reference/interfaceImplementation1.errors.txt +++ b/tests/baselines/reference/interfaceImplementation1.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' incorrectly implements interface 'I1'. + Property 'iObj' is private in type 'C1' but not in type 'I1'. +tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'. + Property 'iFn' is private in type 'C1' but not in type 'I2'. +tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2322: Type '() => C2' is not assignable to type 'I4'. + + ==== tests/cases/compiler/interfaceImplementation1.ts (3 errors) ==== interface I1 { iObj:{ }; @@ -12,11 +19,11 @@ class C1 implements I1,I2 { ~~ -!!! Class 'C1' incorrectly implements interface 'I1': -!!! Private property 'iObj' cannot be reimplemented. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iObj' is private in type 'C1' but not in type 'I1'. ~~ -!!! Class 'C1' incorrectly implements interface 'I2': -!!! Private property 'iFn' cannot be reimplemented. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I2'. +!!! error TS2420: Property 'iFn' is private in type 'C1' but not in type 'I2'. private iFn(); private iFn(n?:number, s?:string) { } private iAny:any; @@ -40,7 +47,7 @@ var a:I4 = function(){ ~ -!!! Type '() => C2' is not assignable to type 'I4'. +!!! error TS2322: Type '() => C2' is not assignable to type 'I4'. return new C2(); } new a(); diff --git a/tests/baselines/reference/interfaceImplementation2.errors.txt b/tests/baselines/reference/interfaceImplementation2.errors.txt index 3e050e9b056..eedc3a4f746 100644 --- a/tests/baselines/reference/interfaceImplementation2.errors.txt +++ b/tests/baselines/reference/interfaceImplementation2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/interfaceImplementation2.ts(8,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'. + Property 'iFn' is missing in type 'C3'. + + ==== tests/cases/compiler/interfaceImplementation2.ts (1 errors) ==== interface I1 { iObj:{ }; @@ -8,8 +12,8 @@ class C3 implements I1 { ~~ -!!! Class 'C3' incorrectly implements interface 'I1': -!!! Property 'iFn' is missing in type 'C3'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iFn' is missing in type 'C3'. public iObj:{ }; public iNum:number; public iAny:any; diff --git a/tests/baselines/reference/interfaceImplementation3.errors.txt b/tests/baselines/reference/interfaceImplementation3.errors.txt index b89b58fc379..06baf5d5915 100644 --- a/tests/baselines/reference/interfaceImplementation3.errors.txt +++ b/tests/baselines/reference/interfaceImplementation3.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/interfaceImplementation3.ts(8,7): error TS2420: Class 'C4' incorrectly implements interface 'I1'. + Property 'iAny' is missing in type 'C4'. + + ==== tests/cases/compiler/interfaceImplementation3.ts (1 errors) ==== interface I1 { iObj:{ }; @@ -8,8 +12,8 @@ class C4 implements I1 { ~~ -!!! Class 'C4' incorrectly implements interface 'I1': -!!! Property 'iAny' is missing in type 'C4'. +!!! error TS2420: Class 'C4' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iAny' is missing in type 'C4'. public iObj:{ }; public iNum:number; public iFn() { } diff --git a/tests/baselines/reference/interfaceImplementation4.errors.txt b/tests/baselines/reference/interfaceImplementation4.errors.txt index e2af897853d..f50aa4ade97 100644 --- a/tests/baselines/reference/interfaceImplementation4.errors.txt +++ b/tests/baselines/reference/interfaceImplementation4.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/interfaceImplementation4.ts(8,7): error TS2420: Class 'C5' incorrectly implements interface 'I1'. + Property 'iObj' is missing in type 'C5'. + + ==== tests/cases/compiler/interfaceImplementation4.ts (1 errors) ==== interface I1 { iObj:{ }; @@ -8,8 +12,8 @@ class C5 implements I1 { ~~ -!!! Class 'C5' incorrectly implements interface 'I1': -!!! Property 'iObj' is missing in type 'C5'. +!!! error TS2420: Class 'C5' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iObj' is missing in type 'C5'. public iNum:number; public iAny:any; public iFn() { } diff --git a/tests/baselines/reference/interfaceImplementation5.errors.txt b/tests/baselines/reference/interfaceImplementation5.errors.txt index de49d201e68..882d8516121 100644 --- a/tests/baselines/reference/interfaceImplementation5.errors.txt +++ b/tests/baselines/reference/interfaceImplementation5.errors.txt @@ -1,3 +1,13 @@ +tests/cases/compiler/interfaceImplementation5.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/interfaceImplementation5.ts(10,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/interfaceImplementation5.ts(14,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/interfaceImplementation5.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/interfaceImplementation5.ts(19,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/interfaceImplementation5.ts(23,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/interfaceImplementation5.ts(27,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/interfaceImplementation5.ts(28,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/interfaceImplementation5.ts (8 errors) ==== interface I1 { getset1:number; @@ -6,43 +16,43 @@ class C1 implements I1 { public get getset1(){return 1;} ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } class C2 implements I1 { public set getset1(baz:number){} ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } class C3 implements I1 { public get getset1(){return 1;} ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public set getset1(baz:number){} ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } class C4 implements I1 { public get getset1(){var x:any; return x;} ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } class C5 implements I1 { public set getset1(baz:any){} ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } class C6 implements I1 { public set getset1(baz:any){} ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public get getset1(){var x:any; return x;} ~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation6.errors.txt b/tests/baselines/reference/interfaceImplementation6.errors.txt index a935fa60c7d..c4c0dcba8ae 100644 --- a/tests/baselines/reference/interfaceImplementation6.errors.txt +++ b/tests/baselines/reference/interfaceImplementation6.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/interfaceImplementation6.ts(9,7): error TS2420: Class 'C2' incorrectly implements interface 'I1'. + Property 'item' is private in type 'C2' but not in type 'I1'. +tests/cases/compiler/interfaceImplementation6.ts(13,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'. + Property 'item' is missing in type 'C3'. + + ==== tests/cases/compiler/interfaceImplementation6.ts (2 errors) ==== interface I1 { item:number; @@ -9,15 +15,15 @@ class C2 implements I1 { ~~ -!!! Class 'C2' incorrectly implements interface 'I1': -!!! Private property 'item' cannot be reimplemented. +!!! error TS2420: Class 'C2' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'item' is private in type 'C2' but not in type 'I1'. private item:number; } class C3 implements I1 { ~~ -!!! Class 'C3' incorrectly implements interface 'I1': -!!! Property 'item' is missing in type 'C3'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'item' is missing in type 'C3'. constructor() { var item: number; } diff --git a/tests/baselines/reference/interfaceImplementation7.errors.txt b/tests/baselines/reference/interfaceImplementation7.errors.txt index c39158df66c..ff1118e5c69 100644 --- a/tests/baselines/reference/interfaceImplementation7.errors.txt +++ b/tests/baselines/reference/interfaceImplementation7.errors.txt @@ -1,20 +1,29 @@ +tests/cases/compiler/interfaceImplementation7.ts(4,11): error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'. + Named properties 'name' of types 'i1' and 'i2' are not identical. +tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' incorrectly implements interface 'i4'. + Types of property 'name' are incompatible. + Type '() => string' is not assignable to type '() => { s: string; n: number; }'. + Type 'string' is not assignable to type '{ s: string; n: number; }'. + Property 's' is missing in type 'String'. + + ==== tests/cases/compiler/interfaceImplementation7.ts (2 errors) ==== interface i1{ name(): { s: string; }; } interface i2{ name(): { n: number; }; } interface i3 extends i1, i2 { } ~~ -!!! Interface 'i3' cannot simultaneously extend types 'i1' and 'i2': -!!! Named properties 'name' of types 'i1' and 'i2' are not identical. +!!! error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'. +!!! error TS2320: Named properties 'name' of types 'i1' and 'i2' are not identical. interface i4 extends i1, i2 { name(): { s: string; n: number; }; } class C1 implements i4 { ~~ -!!! Class 'C1' incorrectly implements interface 'i4': -!!! Types of property 'name' are incompatible: -!!! Type '() => string' is not assignable to type '() => { s: string; n: number; }': -!!! Type 'string' is not assignable to type '{ s: string; n: number; }': -!!! Property 's' is missing in type 'String'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'i4'. +!!! error TS2420: Types of property 'name' are incompatible. +!!! error TS2420: Type '() => string' is not assignable to type '() => { s: string; n: number; }'. +!!! error TS2420: Type 'string' is not assignable to type '{ s: string; n: number; }'. +!!! error TS2420: Property 's' is missing in type 'String'. public name(): string { return ""; } } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation8.errors.txt b/tests/baselines/reference/interfaceImplementation8.errors.txt index 6218ecd6a5e..6b4b8f4a4fa 100644 --- a/tests/baselines/reference/interfaceImplementation8.errors.txt +++ b/tests/baselines/reference/interfaceImplementation8.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/interfaceImplementation8.ts(12,7): error TS2420: Class 'C2' incorrectly implements interface 'i1'. + Property 'name' is private in type 'C2' but not in type 'i1'. +tests/cases/compiler/interfaceImplementation8.ts(21,7): error TS2420: Class 'C5' incorrectly implements interface 'i1'. + Property 'name' is private in type 'C5' but not in type 'i1'. +tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2420: Class 'C6' incorrectly implements interface 'i1'. + Property 'name' is private in type 'C6' but not in type 'i1'. + + ==== tests/cases/compiler/interfaceImplementation8.ts (3 errors) ==== /* 1 @@ -12,8 +20,8 @@ class C2 implements i1 { ~~ -!!! Class 'C2' incorrectly implements interface 'i1': -!!! Private property 'name' cannot be reimplemented. +!!! error TS2420: Class 'C2' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'C2' but not in type 'i1'. private name:string; } @@ -24,12 +32,12 @@ class C4 extends C1 implements i1{ } class C5 extends C2 implements i1{ } ~~ -!!! Class 'C5' incorrectly implements interface 'i1': -!!! Private property 'name' cannot be reimplemented. +!!! error TS2420: Class 'C5' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'C5' but not in type 'i1'. class C6 extends C3 implements i1{ } ~~ -!!! Class 'C6' incorrectly implements interface 'i1': -!!! Private property 'name' cannot be reimplemented. +!!! error TS2420: Class 'C6' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'C6' but not in type 'i1'. /* 2 diff --git a/tests/baselines/reference/interfaceInheritance.errors.txt b/tests/baselines/reference/interfaceInheritance.errors.txt index f8ef8d0861e..c96053b8a84 100644 --- a/tests/baselines/reference/interfaceInheritance.errors.txt +++ b/tests/baselines/reference/interfaceInheritance.errors.txt @@ -1,3 +1,15 @@ +tests/cases/compiler/interfaceInheritance.ts(22,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'. + Property 'i1P1' is missing in type 'C1'. +tests/cases/compiler/interfaceInheritance.ts(30,1): error TS2322: Type 'I3' is not assignable to type 'I2'. + Property 'i1P1' is missing in type 'I3'. +tests/cases/compiler/interfaceInheritance.ts(37,1): error TS2322: Type 'I5' is not assignable to type 'I4'. + Types of property 'one' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is not assignable to type 'I5'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/interfaceInheritance.ts (4 errors) ==== interface I1 { i1P1: number; @@ -22,8 +34,8 @@ class C1 implements I2 { // should be an error - it doesn't implement the members of I1 ~~ -!!! Class 'C1' incorrectly implements interface 'I2': -!!! Property 'i1P1' is missing in type 'C1'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I2'. +!!! error TS2420: Property 'i1P1' is missing in type 'C1'. public i2P1: string; } @@ -33,8 +45,8 @@ i1 = i2; i2 = i3; // should be an error - i3 does not implement the members of i1 ~~ -!!! Type 'I3' is not assignable to type 'I2': -!!! Property 'i1P1' is missing in type 'I3'. +!!! error TS2322: Type 'I3' is not assignable to type 'I2'. +!!! error TS2322: Property 'i1P1' is missing in type 'I3'. var c1: C1; @@ -43,13 +55,13 @@ i4 = i5; // should be an error ~~ -!!! Type 'I5' is not assignable to type 'I4': -!!! Types of property 'one' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'I5' is not assignable to type 'I4'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. i5 = i4; // should be an error ~~ -!!! Type 'I4' is not assignable to type 'I5': -!!! Types of property 'one' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'I4' is not assignable to type 'I5'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt index a1644c4a282..06abf0987d6 100644 --- a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt +++ b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt @@ -1,11 +1,15 @@ +tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,29): error TS1005: ',' expected. +tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts(3,32): error TS1005: '=>' expected. + + ==== tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts (2 errors) ==== interface color {} interface blue extends color() { // error ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceMemberValidation.errors.txt b/tests/baselines/reference/interfaceMemberValidation.errors.txt index c6ce933777c..3b2b1d1874c 100644 --- a/tests/baselines/reference/interfaceMemberValidation.errors.txt +++ b/tests/baselines/reference/interfaceMemberValidation.errors.txt @@ -1,20 +1,27 @@ +tests/cases/compiler/interfaceMemberValidation.ts(2,11): error TS2430: Interface 'i2' incorrectly extends interface 'i1'. + Types of property 'name' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/interfaceMemberValidation.ts(5,2): error TS2411: Property 'bar' of type '{ (): any; (): any; }' is not assignable to string index type 'number'. +tests/cases/compiler/interfaceMemberValidation.ts(10,2): error TS2374: Duplicate string index signature. + + ==== tests/cases/compiler/interfaceMemberValidation.ts (3 errors) ==== interface i1 { name: string; } interface i2 extends i1 { name: number; yo: string; } ~~ -!!! Interface 'i2' incorrectly extends interface 'i1': -!!! Types of property 'name' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'i2' incorrectly extends interface 'i1'. +!!! error TS2430: Types of property 'name' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. interface foo { bar():any; ~~~~~~~~~~ -!!! Property 'bar' of type '{ (): any; (): any; }' is not assignable to string index type 'number'. +!!! error TS2411: Property 'bar' of type '{ (): any; (): any; }' is not assignable to string index type 'number'. bar():any; new():void; new():void; [s:string]:number; [s:string]:number; ~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt b/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt index 055940a5e2e..4be4d858d7b 100644 --- a/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt +++ b/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/interfaceNameAsIdentifier.ts(4,1): error TS2304: Cannot find name 'C'. +tests/cases/compiler/interfaceNameAsIdentifier.ts(12,1): error TS2304: Cannot find name 'm2'. + + ==== tests/cases/compiler/interfaceNameAsIdentifier.ts (2 errors) ==== interface C { (): void; } C(); ~ -!!! Cannot find name 'C'. +!!! error TS2304: Cannot find name 'C'. module m2 { export interface C { @@ -14,5 +18,5 @@ m2.C(); ~~ -!!! Cannot find name 'm2'. +!!! error TS2304: Cannot find name 'm2'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceNaming1.errors.txt b/tests/baselines/reference/interfaceNaming1.errors.txt index 8f341f0e4ce..67158ce6109 100644 --- a/tests/baselines/reference/interfaceNaming1.errors.txt +++ b/tests/baselines/reference/interfaceNaming1.errors.txt @@ -1,13 +1,19 @@ +tests/cases/compiler/interfaceNaming1.ts(1,11): error TS1005: ';' expected. +tests/cases/compiler/interfaceNaming1.ts(1,1): error TS2304: Cannot find name 'interface'. +tests/cases/compiler/interfaceNaming1.ts(3,1): error TS2304: Cannot find name 'interface'. +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 { } ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~~~~ -!!! Cannot find name 'interface'. +!!! error TS2304: Cannot find name 'interface'. interface interface{ } interface & { } ~~~~~~~~~ -!!! Cannot find name 'interface'. +!!! error TS2304: Cannot find name 'interface'. ~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! 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/interfacePropertiesWithSameName2.errors.txt b/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt index bf5dead7037..a7df9c15e59 100644 --- a/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt +++ b/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/interfacePropertiesWithSameName2.ts(10,11): error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'. + Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. +tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'. + Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. + + ==== tests/cases/compiler/interfacePropertiesWithSameName2.ts (2 errors) ==== interface Mover { move(): void; @@ -10,8 +16,8 @@ interface MoverShaker extends Mover, Shaker { ~~~~~~~~~~~ -!!! Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker': -!!! Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. +!!! error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'. +!!! error TS2320: Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. } @@ -29,8 +35,8 @@ interface MoverShaker2 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { } // error ~~~~~~~~~~~~ -!!! Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker': -!!! Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. +!!! error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'. +!!! error TS2320: Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. interface MoverShaker3 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { getStatus(): { speed: number; frequency: number; }; // ok because this getStatus overrides the conflicting ones above diff --git a/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt b/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt index 92a1f5782d1..b7dfdffc79e 100644 --- a/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt +++ b/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt @@ -1,15 +1,21 @@ +tests/cases/compiler/interfacePropertiesWithSameName3.ts(3,11): error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D'. + Named properties 'a' of types 'E' and 'D' are not identical. +tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2'. + Named properties 'a' of types 'E2' and 'D2' are not identical. + + ==== tests/cases/compiler/interfacePropertiesWithSameName3.ts (2 errors) ==== interface D { a: number; } interface E { a: string; } interface F extends E, D { } // error ~ -!!! Interface 'F' cannot simultaneously extend types 'E' and 'D': -!!! Named properties 'a' of types 'E' and 'D' are not identical. +!!! error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D'. +!!! error TS2320: Named properties 'a' of types 'E' and 'D' are not identical. class D2 { a: number; } class E2 { a: string; } interface F2 extends E2, D2 { } // error ~~ -!!! Interface 'F2' cannot simultaneously extend types 'E2' and 'D2': -!!! Named properties 'a' of types 'E2' and 'D2' are not identical. +!!! error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2'. +!!! error TS2320: Named properties 'a' of types 'E2' and 'D2' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt b/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt index 456ed18e007..f66e13c0d9d 100644 --- a/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt +++ b/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt @@ -1,3 +1,10 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseProperty2.ts(5,11): error TS2430: Interface 'Derived' incorrectly extends interface 'Base'. + Types of property 'x' are incompatible. + Type '{ a: string; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseProperty2.ts (1 errors) ==== interface Base { x: { a: number }; @@ -5,11 +12,11 @@ interface Derived extends Base { // error ~~~~~~~ -!!! Interface 'Derived' incorrectly extends interface 'Base': -!!! Types of property 'x' are incompatible: -!!! Type '{ a: string; }' is not assignable to type '{ a: number; }': -!!! Types of property 'a' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'Derived' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: string; }' is not assignable to type '{ a: number; }'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. x: { a: string; }; diff --git a/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt b/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt index d13ee9de95e..3749cae8682 100644 --- a/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt +++ b/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt @@ -1,7 +1,11 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatIndirectlyInheritsFromItself.ts(1,11): error TS2310: Type 'Base' recursively references itself as a base type. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatIndirectlyInheritsFromItself.ts(14,15): error TS2310: Type 'Base' recursively references itself as a base type. + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatIndirectlyInheritsFromItself.ts (2 errors) ==== interface Base extends Derived2 { // error ~~~~ -!!! Type 'Base' recursively references itself as a base type. +!!! error TS2310: Type 'Base' recursively references itself as a base type. x: string; } @@ -16,7 +20,7 @@ module Generic { interface Base extends Derived2 { // error ~~~~ -!!! Type 'Base' recursively references itself as a base type. +!!! error TS2310: Type 'Base' recursively references itself as a base type. x: string; } diff --git a/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt b/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt index b88f09304af..7aa5cc04a87 100644 --- a/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt +++ b/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt @@ -1,30 +1,40 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,15): error TS1005: '{' expected. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,26): error TS1005: ';' expected. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,30): error TS1005: ';' expected. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(1,11): error TS2310: Type 'Foo' recursively references itself as a base type. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(4,11): error TS2310: Type 'Foo2' recursively references itself as a base type. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(7,11): error TS2310: Type 'Foo3' recursively references itself as a base type. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,15): error TS2304: Cannot find name 'implements'. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,26): error TS2304: Cannot find name 'Bar'. + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts (8 errors) ==== interface Foo extends Foo { // error ~~~ -!!! Type 'Foo' recursively references itself as a base type. +!!! error TS2310: Type 'Foo' recursively references itself as a base type. } interface Foo2 extends Foo2 { // error ~~~~ -!!! Type 'Foo2' recursively references itself as a base type. +!!! error TS2310: Type 'Foo2' recursively references itself as a base type. } interface Foo3 extends Foo3 { // error ~~~~ -!!! Type 'Foo3' recursively references itself as a base type. +!!! error TS2310: Type 'Foo3' recursively references itself as a base type. } interface Bar implements Bar { // error ~~~~~~~~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~~~~~ -!!! Cannot find name 'implements'. +!!! error TS2304: Cannot find name 'implements'. ~~~ -!!! Cannot find name 'Bar'. +!!! error TS2304: Cannot find name 'Bar'. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithAccessibilityModifiers.errors.txt b/tests/baselines/reference/interfaceWithAccessibilityModifiers.errors.txt new file mode 100644 index 00000000000..ecf803d522b --- /dev/null +++ b/tests/baselines/reference/interfaceWithAccessibilityModifiers.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithAccessibilityModifiers.ts(3,5): error TS1131: Property or signature expected. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithAccessibilityModifiers.ts(4,5): error TS1131: Property or signature expected. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithAccessibilityModifiers.ts(5,5): error TS1131: Property or signature expected. + + +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithAccessibilityModifiers.ts (3 errors) ==== + // Errors + interface Foo { + public a: any; + ~~~~~~ +!!! error TS1131: Property or signature expected. + private b: any; + ~~~~~~~ +!!! error TS1131: Property or signature expected. + protected c: any; + ~~~~~~~~~ +!!! error TS1131: Property or signature expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithImplements1.errors.txt b/tests/baselines/reference/interfaceWithImplements1.errors.txt index b2b1fdc3954..bb9465712d8 100644 --- a/tests/baselines/reference/interfaceWithImplements1.errors.txt +++ b/tests/baselines/reference/interfaceWithImplements1.errors.txt @@ -1,15 +1,22 @@ +tests/cases/compiler/interfaceWithImplements1.ts(3,16): error TS1005: '{' expected. +tests/cases/compiler/interfaceWithImplements1.ts(3,27): error TS1005: ';' expected. +tests/cases/compiler/interfaceWithImplements1.ts(3,32): error TS1005: ';' expected. +tests/cases/compiler/interfaceWithImplements1.ts(3,16): error TS2304: Cannot find name 'implements'. +tests/cases/compiler/interfaceWithImplements1.ts(3,27): error TS2304: Cannot find name 'IFoo'. + + ==== tests/cases/compiler/interfaceWithImplements1.ts (5 errors) ==== interface IFoo { } interface IBar implements IFoo { ~~~~~~~~~~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~~~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~~~~~ -!!! Cannot find name 'implements'. +!!! error TS2304: Cannot find name 'implements'. ~~~~ -!!! Cannot find name 'IFoo'. +!!! error TS2304: Cannot find name 'IFoo'. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt b/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt index d96a8d33a63..1562e16df4d 100644 --- a/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt @@ -1,3 +1,30 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(21,11): error TS2430: Interface 'Derived2' incorrectly extends interface 'Base2'. + Types of property 'x' are incompatible. + Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }'. + Types of property 'b' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(52,15): error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2'. + Named properties 'x' of types 'Base1' and 'Base2' are not identical. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2430: Interface 'Derived4' incorrectly extends interface 'Base1'. + Types of property 'x' are incompatible. + Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. + Type 'T' is not assignable to type 'number'. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2430: Interface 'Derived4' incorrectly extends interface 'Base2'. + Types of property 'x' are incompatible. + Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }'. + Types of property 'b' are incompatible. + Type 'T' is not assignable to type 'number'. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(60,15): error TS2430: Interface 'Derived5' incorrectly extends interface 'Base1'. + Types of property 'x' are incompatible. + Type 'T' is not assignable to type '{ a: T; }'. + Property 'a' is missing in type '{}'. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(60,15): error TS2430: Interface 'Derived5' incorrectly extends interface 'Base2'. + Types of property 'x' are incompatible. + Type 'T' is not assignable to type '{ b: T; }'. + Property 'b' is missing in type '{}'. + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts (6 errors) ==== // an interface may have multiple bases with properties of the same name as long as the interface's implementation satisfies all base type versions @@ -21,11 +48,11 @@ interface Derived2 extends Base1, Base2 { // error ~~~~~~~~ -!!! Interface 'Derived2' incorrectly extends interface 'Base2': -!!! Types of property 'x' are incompatible: -!!! Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }': -!!! Types of property 'b' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'Derived2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }'. +!!! error TS2430: Types of property 'b' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. x: { a: string; b: number; } @@ -58,22 +85,22 @@ interface Derived3 extends Base1, Base2 { } // error ~~~~~~~~ -!!! Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2': -!!! Named properties 'x' of types 'Base1' and 'Base2' are not identical. +!!! error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2'. +!!! error TS2320: Named properties 'x' of types 'Base1' and 'Base2' are not identical. interface Derived4 extends Base1, Base2 { // error ~~~~~~~~ -!!! Interface 'Derived4' incorrectly extends interface 'Base1': -!!! Types of property 'x' are incompatible: -!!! Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }': -!!! Types of property 'a' are incompatible: -!!! Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'Derived4' incorrectly extends interface 'Base1'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. ~~~~~~~~ -!!! Interface 'Derived4' incorrectly extends interface 'Base2': -!!! Types of property 'x' are incompatible: -!!! Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }': -!!! Types of property 'b' are incompatible: -!!! Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'Derived4' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }'. +!!! error TS2430: Types of property 'b' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. x: { a: T; b: T; } @@ -81,15 +108,15 @@ interface Derived5 extends Base1, Base2 { // error ~~~~~~~~ -!!! Interface 'Derived5' incorrectly extends interface 'Base1': -!!! Types of property 'x' are incompatible: -!!! Type 'T' is not assignable to type '{ a: T; }': -!!! Property 'a' is missing in type '{}'. +!!! error TS2430: Interface 'Derived5' incorrectly extends interface 'Base1'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type '{ a: T; }'. +!!! error TS2430: Property 'a' is missing in type '{}'. ~~~~~~~~ -!!! Interface 'Derived5' incorrectly extends interface 'Base2': -!!! Types of property 'x' are incompatible: -!!! Type 'T' is not assignable to type '{ b: T; }': -!!! Property 'b' is missing in type '{}'. +!!! error TS2430: Interface 'Derived5' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type '{ b: T; }'. +!!! error TS2430: Property 'b' is missing in type '{}'. x: T; } } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt b/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt index 1ade49844d0..b3459233923 100644 --- a/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt @@ -1,3 +1,10 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes2.ts(17,11): error TS2430: Interface 'Derived2' incorrectly extends interface 'Base'. + Types of property 'x' are incompatible. + Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }'. + Types of property 'a' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes2.ts (1 errors) ==== interface Base { x: { @@ -17,11 +24,11 @@ interface Derived2 extends Base, Base2 { // error ~~~~~~~~ -!!! Interface 'Derived2' incorrectly extends interface 'Base': -!!! Types of property 'x' are incompatible: -!!! Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }': -!!! Types of property 'a' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'Derived2' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. x: { a: number; b: string } } diff --git a/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt b/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt index 0297e7966f5..9afd0d37733 100644 --- a/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt +++ b/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt @@ -1,68 +1,85 @@ +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(3,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(5,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(5,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(7,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(9,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(9,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(11,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(16,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(18,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(20,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(22,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(24,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(29,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(34,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/interfaceWithMultipleDeclarations.ts(36,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/interfaceWithMultipleDeclarations.ts (15 errors) ==== interface I1 { } interface I1 { // Name mismatch ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. } interface I1 { // Length mismatch ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } interface I1 { // constraint present ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. } interface I1 { // Length mismatch ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } interface I1 { // Length mismatch ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. } interface I2 { } interface I2 string> { // constraint mismatch ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. } interface I2 { // constraint absent ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. } interface I2 { // name mismatch ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. } interface I2 { // length mismatch ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. } interface I2 { // length mismatch ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. } interface I3 { } interface I3 { // length mismatch ~~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. } class Foo { } interface I4> { ~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } interface I4> { // Should not be error ~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithPrivateMember.errors.txt b/tests/baselines/reference/interfaceWithPrivateMember.errors.txt index b0c2e9fcfd2..e019ff9d9a1 100644 --- a/tests/baselines/reference/interfaceWithPrivateMember.errors.txt +++ b/tests/baselines/reference/interfaceWithPrivateMember.errors.txt @@ -1,24 +1,31 @@ +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(4,5): error TS1131: Property or signature expected. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(8,5): error TS1131: Property or signature expected. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(12,5): error TS1131: Property or signature expected. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(13,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts(12,16): error TS2304: Cannot find name 'string'. + + ==== tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts (5 errors) ==== // interfaces do not permit private members, these are errors interface I { private x: string; ~~~~~~~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. } interface I2 { private y: T; ~~~~~~~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. } var x: { private y: string; ~~~~~~~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. ~~~~~~ -!!! Cannot find name 'string'. +!!! error TS2304: Cannot find name 'string'. } ~ -!!! Declaration or statement expected. \ No newline at end of file +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types index 69ad29374a2..21d4359b6fb 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types @@ -95,7 +95,7 @@ var a: Foo = { >{} : {} e: null , ->e : any +>e : null f: [1], >f : number[] diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt index 543e7fc9ce8..79cbd0e6b4e 100644 --- a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(5,11): error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. + Property 'x' is private in type 'Base' but not in type 'Foo'. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(13,11): error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. + Property 'x' is private in type 'Base2' but not in type 'Foo2'. + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts (2 errors) ==== class Base { private x: number; @@ -5,8 +11,8 @@ interface Foo extends Base { // error ~~~ -!!! Interface 'Foo' incorrectly extends interface 'Base': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. +!!! error TS2430: Property 'x' is private in type 'Base' but not in type 'Foo'. x: number; } @@ -16,7 +22,7 @@ interface Foo2 extends Base2 { // error ~~~~ -!!! Interface 'Foo2' incorrectly extends interface 'Base2': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. +!!! error TS2430: Property 'x' is private in type 'Base2' but not in type 'Foo2'. x: number; } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt index f056d65fe16..3a31d7dfcbd 100644 --- a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(5,11): error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. + Property 'x' is private in type 'Base' but not in type 'Foo'. +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(13,11): error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. + Property 'x' is private in type 'Base2' but not in type 'Foo2'. + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts (2 errors) ==== class Base { private x() {} @@ -5,8 +11,8 @@ interface Foo extends Base { // error ~~~ -!!! Interface 'Foo' incorrectly extends interface 'Base': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. +!!! error TS2430: Property 'x' is private in type 'Base' but not in type 'Foo'. x(): any; } @@ -16,7 +22,7 @@ interface Foo2 extends Base2 { // error ~~~~ -!!! Interface 'Foo2' incorrectly extends interface 'Base2': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. +!!! error TS2430: Property 'x' is private in type 'Base2' but not in type 'Foo2'. x(): any; } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer.errors.txt b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer.errors.txt index b93e0479e10..40dc5668eb2 100644 --- a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer.errors.txt +++ b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithStringIndexerHidingBaseTypeIndexer.ts(13,5): error TS2411: Property 'y' of type '{ a: number; }' is not assignable to string index type '{ a: number; b: number; }'. + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithStringIndexerHidingBaseTypeIndexer.ts (1 errors) ==== interface Base { [x: string]: { a: number } @@ -17,5 +20,5 @@ ~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! Property 'y' of type '{ a: number; }' is not assignable to string index type '{ a: number; b: number; }'. +!!! error TS2411: Property 'y' of type '{ a: number; }' is not assignable to string index type '{ a: number; b: number; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer2.errors.txt b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer2.errors.txt index 965cba84565..ac66d08a83a 100644 --- a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer2.errors.txt +++ b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithStringIndexerHidingBaseTypeIndexer2.ts(17,5): error TS2412: Property '1' of type '{ a: number; }' is not assignable to numeric index type '{ a: number; b: number; }'. + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithStringIndexerHidingBaseTypeIndexer2.ts (1 errors) ==== interface Base { [x: number]: { a: number; b: number } @@ -21,5 +24,5 @@ ~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! Property '1' of type '{ a: number; }' is not assignable to numeric index type '{ a: number; b: number; }'. +!!! error TS2412: Property '1' of type '{ a: number; }' is not assignable to numeric index type '{ a: number; b: number; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer3.errors.txt b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer3.errors.txt index 080ffc7fb76..932780aaa1a 100644 --- a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer3.errors.txt +++ b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer3.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithStringIndexerHidingBaseTypeIndexer3.ts(13,5): error TS2412: Property '2' of type '{ a: number; }' is not assignable to numeric index type '{ a: number; b: number; }'. + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithStringIndexerHidingBaseTypeIndexer3.ts (1 errors) ==== interface Base { [x: number]: { a: number } @@ -17,5 +20,5 @@ ~~~~~~~~~~~~~~~~~~ } ~~~~~ -!!! Property '2' of type '{ a: number; }' is not assignable to numeric index type '{ a: number; b: number; }'. +!!! error TS2412: Property '2' of type '{ a: number; }' is not assignable to numeric index type '{ a: number; b: number; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/interfacedeclWithIndexerErrors.errors.txt b/tests/baselines/reference/interfacedeclWithIndexerErrors.errors.txt index 118e4c20911..3eff7ad420c 100644 --- a/tests/baselines/reference/interfacedeclWithIndexerErrors.errors.txt +++ b/tests/baselines/reference/interfacedeclWithIndexerErrors.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/interfacedeclWithIndexerErrors.ts(12,5): error TS2411: Property 'p2' of type 'string' is not assignable to string index type '() => string'. +tests/cases/compiler/interfacedeclWithIndexerErrors.ts(14,5): error TS2411: Property 'p4' of type 'number' is not assignable to string index type '() => string'. +tests/cases/compiler/interfacedeclWithIndexerErrors.ts(15,5): error TS2411: Property 'p5' of type '(s: number) => string' is not assignable to string index type '() => string'. +tests/cases/compiler/interfacedeclWithIndexerErrors.ts(19,5): error TS2411: Property 'f3' of type '(a: string) => number' is not assignable to string index type '() => string'. +tests/cases/compiler/interfacedeclWithIndexerErrors.ts(20,5): error TS2411: Property 'f4' of type '(s: number) => string' is not assignable to string index type '() => string'. + + ==== tests/cases/compiler/interfacedeclWithIndexerErrors.ts (5 errors) ==== interface a0 { (): string; @@ -12,23 +19,23 @@ p1; p2: string; ~~~~~~~~~~~ -!!! Property 'p2' of type 'string' is not assignable to string index type '() => string'. +!!! error TS2411: Property 'p2' of type 'string' is not assignable to string index type '() => string'. p3?; p4?: number; ~~~~~~~~~~~~ -!!! Property 'p4' of type 'number' is not assignable to string index type '() => string'. +!!! error TS2411: Property 'p4' of type 'number' is not assignable to string index type '() => string'. p5: (s: number) =>string; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Property 'p5' of type '(s: number) => string' is not assignable to string index type '() => string'. +!!! error TS2411: Property 'p5' of type '(s: number) => string' is not assignable to string index type '() => string'. f1(); f2? (); f3(a: string): number; ~~~~~~~~~~~~~~~~~~~~~~ -!!! Property 'f3' of type '(a: string) => number' is not assignable to string index type '() => string'. +!!! error TS2411: Property 'f3' of type '(a: string) => number' is not assignable to string index type '() => string'. f4? (s: number): string; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Property 'f4' of type '(s: number) => string' is not assignable to string index type '() => string'. +!!! error TS2411: Property 'f4' of type '(s: number) => string' is not assignable to string index type '() => string'. } diff --git a/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt b/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt index 5daed96e71f..20ef6f7a39d 100644 --- a/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt +++ b/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt @@ -1,16 +1,23 @@ +tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(5,11): error TS1003: Identifier expected. +tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(1,11): error TS2427: Interface name cannot be 'any' +tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(2,11): error TS2427: Interface name cannot be 'number' +tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(3,11): error TS2427: Interface name cannot be 'string' +tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(4,11): error TS2427: Interface name cannot be 'boolean' + + ==== tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts (5 errors) ==== interface any { } ~~~ -!!! Interface name cannot be 'any' +!!! error TS2427: Interface name cannot be 'any' interface number { } ~~~~~~ -!!! Interface name cannot be 'number' +!!! error TS2427: Interface name cannot be 'number' interface string { } ~~~~~~ -!!! Interface name cannot be 'string' +!!! error TS2427: Interface name cannot be 'string' interface boolean { } ~~~~~~~ -!!! Interface name cannot be 'boolean' +!!! error TS2427: Interface name cannot be 'boolean' interface void {} ~~~~ -!!! Identifier expected. \ No newline at end of file +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt index 88f24934256..ee6a580ef40 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/internalAliasClassInsideLocalModuleWithoutExportAccessError.ts(17,26): error TS2339: Property 'c' does not exist on type 'typeof m3'. + + ==== tests/cases/compiler/internalAliasClassInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== export module x { export class c { @@ -17,4 +20,4 @@ export var d = new m2.m3.c(); ~ -!!! Property 'c' does not exist on type 'typeof m3'. \ No newline at end of file +!!! error TS2339: Property 'c' does not exist on type 'typeof m3'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt index 0c2d7780a14..ff1739be202 100644 --- a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/internalAliasEnumInsideLocalModuleWithoutExportAccessError.ts(14,21): error TS2339: Property 'b' does not exist on type 'typeof c'. + + ==== tests/cases/compiler/internalAliasEnumInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== export module a { export enum weekend { @@ -14,4 +17,4 @@ var happyFriday = c.b.Friday; ~ -!!! Property 'b' does not exist on type 'typeof c'. \ No newline at end of file +!!! error TS2339: Property 'b' does not exist on type 'typeof c'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt index 3fd6a4f97cf..c28842aee7f 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.ts(12,11): error TS2339: Property 'b' does not exist on type 'typeof c'. + + ==== tests/cases/compiler/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== export module a { export function foo(x: number) { @@ -12,4 +15,4 @@ } var d = c.b(11); ~ -!!! Property 'b' does not exist on type 'typeof c'. \ No newline at end of file +!!! error TS2339: Property 'b' does not exist on type 'typeof c'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt index 34496189449..7997eb2b3ae 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.ts(13,22): error TS2339: Property 'b' does not exist on type 'typeof c'. + + ==== tests/cases/compiler/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== export module a { export module b { @@ -13,4 +16,4 @@ export var d = new c.b.c(); ~ -!!! Property 'b' does not exist on type 'typeof c'. \ No newline at end of file +!!! error TS2339: Property 'b' does not exist on type 'typeof c'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt index eba8ac44484..9b5bf66844d 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts(11,8): error TS2305: Module '"tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. + + ==== tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== export module a { export interface I { @@ -11,4 +14,4 @@ var x: c.b; ~~~ -!!! Module '"tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. \ No newline at end of file +!!! error TS2305: Module '"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 b8b04cfc224..33bb8f16331 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts(16,15): error TS2305: Module '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. + + ==== tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== export module a { export module b { @@ -16,4 +19,4 @@ export var z: c.b.I; ~~~~~ -!!! Module '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. \ No newline at end of file +!!! error TS2305: Module '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt index 90723aaa157..6c00ac57794 100644 --- a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/internalAliasVarInsideLocalModuleWithoutExportAccessError.ts(10,18): error TS2339: Property 'b' does not exist on type 'typeof c'. + + ==== tests/cases/compiler/internalAliasVarInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== export module a { export var x = 10; @@ -10,4 +13,4 @@ export var z = c.b; ~ -!!! Property 'b' does not exist on type 'typeof c'. \ No newline at end of file +!!! error TS2339: Property 'b' does not exist on type 'typeof c'. \ No newline at end of file diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt index 64d2e92bdd4..1292efd8a08 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.ts(11,16): error TS2437: Module 'A' is hidden by a local declaration with the same name + + ==== tests/cases/compiler/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.ts (1 errors) ==== class A { aProp: string; @@ -11,6 +14,6 @@ var A = 1; import Y = A; ~ -!!! Module 'A' is hidden by a local declaration with the same name +!!! error TS2437: Module 'A' is hidden by a local declaration with the same name } \ No newline at end of file diff --git a/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.errors.txt b/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.errors.txt index 3cbb49c6809..5146966c3a4 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.errors.txt +++ b/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/internalImportInstantiatedModuleNotReferencingInstance.ts(8,16): error TS2437: Module 'A' is hidden by a local declaration with the same name + + ==== tests/cases/compiler/internalImportInstantiatedModuleNotReferencingInstance.ts (1 errors) ==== module A { export interface X { s: string } @@ -8,6 +11,6 @@ var A = 1; import Y = A; ~ -!!! Module 'A' is hidden by a local declaration with the same name +!!! error TS2437: Module 'A' is hidden by a local declaration with the same name } \ No newline at end of file diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt index 3e50f2be298..9f5cba24873 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.ts(10,16): error TS2437: Module 'A' is hidden by a local declaration with the same name + + ==== tests/cases/compiler/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.ts (1 errors) ==== class A { aProp: string; @@ -10,6 +13,6 @@ var A = 1; import Y = A; ~ -!!! Module 'A' is hidden by a local declaration with the same name +!!! error TS2437: Module 'A' is hidden by a local declaration with the same name } \ No newline at end of file diff --git a/tests/baselines/reference/intrinsics.errors.txt b/tests/baselines/reference/intrinsics.errors.txt index c2ffc5a2fc9..e9529d4b9f0 100644 --- a/tests/baselines/reference/intrinsics.errors.txt +++ b/tests/baselines/reference/intrinsics.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/intrinsics.ts(2,21): error TS2304: Cannot find name 'hasOwnProperty'. +tests/cases/compiler/intrinsics.ts(11,1): error TS2304: Cannot find name '__proto__'. + + ==== tests/cases/compiler/intrinsics.ts (2 errors) ==== var hasOwnProperty: hasOwnProperty; // Error ~~~~~~~~~~~~~~ -!!! Cannot find name 'hasOwnProperty'. +!!! error TS2304: Cannot find name 'hasOwnProperty'. module m1 { export var __proto__; @@ -13,7 +17,7 @@ __proto__ = 0; // Error, __proto__ not defined ~~~~~~~~~ -!!! Cannot find name '__proto__'. +!!! error TS2304: Cannot find name '__proto__'. m1.__proto__ = 0; class Foo<__proto__> { } diff --git a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt index a89539e5da3..3ac4f122e58 100644 --- a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt +++ b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt @@ -1,43 +1,55 @@ +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(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'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(14,1): error TS2322: Type 'I' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(17,1): error TS2322: Type 'typeof M' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(20,5): error TS2322: Type 'T' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(22,1): error TS2322: Type '(a: T) => void' is not assignable to type 'void'. + + ==== tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts (10 errors) ==== var x: void; x = 1; ~ -!!! Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. x = true; ~ -!!! Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'boolean' is not assignable to type 'void'. x = ''; ~ -!!! Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type 'string' is not assignable to type 'void'. x = {} ~ -!!! Type '{}' is not assignable to type 'void'. +!!! error TS2322: Type '{}' is not assignable to type 'void'. class C { foo: string; } var c: C; x = C; ~ -!!! Type 'typeof C' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof C' is not assignable to type 'void'. x = c; ~ -!!! Type 'C' is not assignable to type 'void'. +!!! error TS2322: Type 'C' is not assignable to type 'void'. interface I { foo: string; } var i: I; x = i; ~ -!!! Type 'I' is not assignable to type 'void'. +!!! error TS2322: Type 'I' is not assignable to type 'void'. module M { export var x = 1; } x = M; ~ -!!! Type 'typeof M' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof M' is not assignable to type 'void'. function f(a: T) { x = a; ~ -!!! Type 'T' is not assignable to type 'void'. +!!! error TS2322: Type 'T' is not assignable to type 'void'. } x = f; ~ -!!! Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index 8da60d2e27a..84ced226113 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -1,49 +1,63 @@ +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'. + Property 'foo' is missing in type 'Boolean'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'. + Property 'bar' is missing in type 'Boolean'. +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(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. + + ==== tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts (10 errors) ==== var x = true; var a: number = x; ~ -!!! Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. var b: string = x; ~ -!!! Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. var c: void = x; ~ -!!! Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'boolean' is not assignable to type 'void'. var d: typeof undefined = x; enum E { A } var e: E = x; ~ -!!! Type 'boolean' is not assignable to type 'E'. +!!! error TS2322: Type 'boolean' is not assignable to type 'E'. class C { foo: string } var f: C = x; ~ -!!! Type 'boolean' is not assignable to type 'C': -!!! Property 'foo' is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'C'. +!!! error TS2322: Property 'foo' is missing in type 'Boolean'. interface I { bar: string } var g: I = x; ~ -!!! Type 'boolean' is not assignable to type 'I': -!!! Property 'bar' is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'I'. +!!! error TS2322: Property 'bar' is missing in type 'Boolean'. var h: { (): string } = x; ~ -!!! Type 'boolean' is not assignable to type '() => string'. +!!! error TS2322: Type 'boolean' is not assignable to type '() => string'. var h2: { toString(): string } = x; // no error module M { export var a = 1; } M = x; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. function i(a: T) { a = x; ~ -!!! Type 'boolean' is not assignable to type 'T'. +!!! error TS2322: Type 'boolean' is not assignable to type 'T'. } i = x; ~ -!!! Invalid left-hand side of assignment expression. \ No newline at end of file +!!! error TS2364: Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/invalidConstraint1.errors.txt b/tests/baselines/reference/invalidConstraint1.errors.txt index c38b126504c..bac8f805c0f 100644 --- a/tests/baselines/reference/invalidConstraint1.errors.txt +++ b/tests/baselines/reference/invalidConstraint1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/invalidConstraint1.ts(1,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/invalidConstraint1.ts (1 errors) ==== function f() { ~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return undefined; } f(); // should error diff --git a/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt b/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt index 9b526d3c219..65fd55b763b 100644 --- a/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt +++ b/tests/baselines/reference/invalidDoWhileBreakStatements.errors.txt @@ -1,16 +1,24 @@ +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(8,4): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. + + ==== tests/cases/conformance/statements/breakStatements/invalidDoWhileBreakStatements.ts (6 errors) ==== // All errors // naked break not allowed break; ~~~~~~ -!!! A 'break' statement can only be used within an enclosing iteration or switch statement. +!!! error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. // non-existent label ONE: do break TWO; while (true) ~~~~~~~~~~ -!!! A 'break' statement can only jump to a label of an enclosing statement. +!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. // break from inside function TWO: @@ -18,7 +26,7 @@ var x = () => { break TWO; ~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } }while (true) @@ -27,7 +35,7 @@ var fn = function () { break THREE; ~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } }while (true) @@ -35,7 +43,7 @@ do { break FIVE; ~~~~~~~~~~~ -!!! A 'break' statement can only jump to a label of an enclosing statement. +!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. FIVE: do { } while (true) }while (true) @@ -47,5 +55,5 @@ do { break NINE; ~~~~~~~~~~~ -!!! A 'break' statement can only jump to a label of an enclosing statement. +!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. }while (true) \ No newline at end of file diff --git a/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt b/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt index 38c54104d39..e9643394d12 100644 --- a/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidDoWhileContinueStatements.errors.txt @@ -1,16 +1,24 @@ +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(8,4): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. + + ==== tests/cases/conformance/statements/continueStatements/invalidDoWhileContinueStatements.ts (6 errors) ==== // All errors // naked continue not allowed continue; ~~~~~~~~~ -!!! A 'continue' statement can only be used within an enclosing iteration statement. +!!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. // non-existent label ONE: do continue TWO; while (true) ~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: @@ -18,7 +26,7 @@ var x = () => { continue TWO; ~~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } }while (true) @@ -27,7 +35,7 @@ var fn = function () { continue THREE; ~~~~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } }while (true) @@ -35,7 +43,7 @@ do { continue FIVE; ~~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. FIVE: do { } while (true) }while (true) @@ -47,5 +55,5 @@ do { continue NINE; ~~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. }while (true) \ No newline at end of file diff --git a/tests/baselines/reference/invalidEnumAssignments.errors.txt b/tests/baselines/reference/invalidEnumAssignments.errors.txt index cfbc67c3390..962e4bf62d5 100644 --- a/tests/baselines/reference/invalidEnumAssignments.errors.txt +++ b/tests/baselines/reference/invalidEnumAssignments.errors.txt @@ -1,3 +1,11 @@ +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(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(21,5): error TS2322: Type 'T' is not assignable to type 'E'. + + ==== tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts (6 errors) ==== enum E { A, @@ -14,22 +22,22 @@ e = E2.A; ~ -!!! Type 'E2' is not assignable to type 'E'. +!!! error TS2322: Type 'E2' is not assignable to type 'E'. e2 = E.A; ~~ -!!! Type 'E' is not assignable to type 'E2'. +!!! error TS2322: Type 'E' is not assignable to type 'E2'. e = null; ~ -!!! Type 'void' is not assignable to type 'E'. +!!! error TS2322: Type 'void' is not assignable to type 'E'. e = {}; ~ -!!! Type '{}' is not assignable to type 'E'. +!!! error TS2322: Type '{}' is not assignable to type 'E'. e = ''; ~ -!!! Type 'string' is not assignable to type 'E'. +!!! error TS2322: Type 'string' is not assignable to type 'E'. function f(a: T) { e = a; ~ -!!! Type 'T' is not assignable to type 'E'. +!!! error TS2322: Type 'T' is not assignable to type 'E'. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidForBreakStatements.errors.txt b/tests/baselines/reference/invalidForBreakStatements.errors.txt index 28c110b1105..50e4013c0ea 100644 --- a/tests/baselines/reference/invalidForBreakStatements.errors.txt +++ b/tests/baselines/reference/invalidForBreakStatements.errors.txt @@ -1,16 +1,24 @@ +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(8,9): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts(36,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. + + ==== tests/cases/conformance/statements/breakStatements/invalidForBreakStatements.ts (6 errors) ==== // All errors // naked break not allowed break; ~~~~~~ -!!! A 'break' statement can only be used within an enclosing iteration or switch statement. +!!! error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. // non-existent label ONE: for(;;) break TWO; ~~~~~~~~~~ -!!! A 'break' statement can only jump to a label of an enclosing statement. +!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. // break from inside function TWO: @@ -18,7 +26,7 @@ var x = () => { break TWO; ~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } @@ -27,7 +35,7 @@ var fn = function () { break THREE; ~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } @@ -35,7 +43,7 @@ for(;;) { break FIVE; ~~~~~~~~~~~ -!!! A 'break' statement can only jump to a label of an enclosing statement. +!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. FIVE: for (; ;) { } } @@ -46,5 +54,5 @@ for(;;) { break NINE; ~~~~~~~~~~~ -!!! A 'break' statement can only jump to a label of an enclosing statement. +!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidForContinueStatements.errors.txt b/tests/baselines/reference/invalidForContinueStatements.errors.txt index d3aadb0b694..3af47370df1 100644 --- a/tests/baselines/reference/invalidForContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidForContinueStatements.errors.txt @@ -1,16 +1,24 @@ +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(8,9): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts(36,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. + + ==== tests/cases/conformance/statements/continueStatements/invalidForContinueStatements.ts (6 errors) ==== // All errors // naked continue not allowed continue; ~~~~~~~~~ -!!! A 'continue' statement can only be used within an enclosing iteration statement. +!!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. // non-existent label ONE: for(;;) continue TWO; ~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: @@ -18,7 +26,7 @@ var x = () => { continue TWO; ~~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } @@ -27,7 +35,7 @@ var fn = function () { continue THREE; ~~~~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } @@ -35,7 +43,7 @@ for(;;) { continue FIVE; ~~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. FIVE: for (; ;) { } } @@ -46,5 +54,5 @@ for(;;) { continue NINE; ~~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidForInBreakStatements.errors.txt b/tests/baselines/reference/invalidForInBreakStatements.errors.txt index 6e29ea04c8e..d83304ab1c6 100644 --- a/tests/baselines/reference/invalidForInBreakStatements.errors.txt +++ b/tests/baselines/reference/invalidForInBreakStatements.errors.txt @@ -1,16 +1,24 @@ +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(4,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(8,19): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(27,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. +tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts(37,5): error TS1116: A 'break' statement can only jump to a label of an enclosing statement. + + ==== tests/cases/conformance/statements/breakStatements/invalidForInBreakStatements.ts (6 errors) ==== // All errors // naked break not allowed break; ~~~~~~ -!!! A 'break' statement can only be used within an enclosing iteration or switch statement. +!!! error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. // non-existent label ONE: for (var x in {}) break TWO; ~~~~~~~~~~ -!!! A 'break' statement can only jump to a label of an enclosing statement. +!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. // break from inside function TWO: @@ -18,7 +26,7 @@ var fn = () => { break TWO; ~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } @@ -27,7 +35,7 @@ var fn = function () { break THREE; ~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } @@ -35,7 +43,7 @@ for (var x in {}) { break FIVE; ~~~~~~~~~~~ -!!! A 'break' statement can only jump to a label of an enclosing statement. +!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. FIVE: for (var x in {}) { } } @@ -47,5 +55,5 @@ for (var x in {}) { break NINE; ~~~~~~~~~~~ -!!! A 'break' statement can only jump to a label of an enclosing statement. +!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidForInContinueStatements.errors.txt b/tests/baselines/reference/invalidForInContinueStatements.errors.txt index f9cf403c975..7353a22d9cd 100644 --- a/tests/baselines/reference/invalidForInContinueStatements.errors.txt +++ b/tests/baselines/reference/invalidForInContinueStatements.errors.txt @@ -1,16 +1,24 @@ +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(4,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(8,19): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(14,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(21,9): error TS1107: Jump target cannot cross function boundary. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(27,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. +tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts(37,5): error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. + + ==== tests/cases/conformance/statements/continueStatements/invalidForInContinueStatements.ts (6 errors) ==== // All errors // naked continue not allowed continue; ~~~~~~~~~ -!!! A 'continue' statement can only be used within an enclosing iteration statement. +!!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. // non-existent label ONE: for (var x in {}) continue TWO; ~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. // continue from inside function TWO: @@ -18,7 +26,7 @@ var fn = () => { continue TWO; ~~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } @@ -27,7 +35,7 @@ var fn = function () { continue THREE; ~~~~~~~~~~~~~~~ -!!! Jump target cannot cross function boundary. +!!! error TS1107: Jump target cannot cross function boundary. } } @@ -35,7 +43,7 @@ for (var x in {}) { continue FIVE; ~~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. FIVE: for (var x in {}) { } } @@ -47,5 +55,5 @@ for (var x in {}) { continue NINE; ~~~~~~~~~~~~~~ -!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. +!!! error TS1115: A 'continue' statement can only jump to a label of an enclosing iteration statement. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt b/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt index 0248c590eb8..ea582635856 100644 --- a/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt +++ b/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(5,1): error TS2304: Cannot find name 'V'. +tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(11,1): error TS2304: Cannot find name 'C'. +tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(17,1): error TS2304: Cannot find name 'E'. +tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(23,1): error TS2304: Cannot find name 'I'. + + ==== tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts (4 errors) ==== // none of these should work, since non are actually modules @@ -5,7 +11,7 @@ import v = V; ~~~~~~~~~~~~~ -!!! Cannot find name 'V'. +!!! error TS2304: Cannot find name 'V'. class C { name: string; @@ -13,7 +19,7 @@ import c = C; ~~~~~~~~~~~~~ -!!! Cannot find name 'C'. +!!! error TS2304: Cannot find name 'C'. enum E { Red, Blue @@ -21,7 +27,7 @@ import e = E; ~~~~~~~~~~~~~ -!!! Cannot find name 'E'. +!!! error TS2304: Cannot find name 'E'. interface I { id: number; @@ -29,5 +35,5 @@ import i = I; ~~~~~~~~~~~~~ -!!! Cannot find name 'I'. +!!! error TS2304: Cannot find name 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidInstantiatedModule.errors.txt b/tests/baselines/reference/invalidInstantiatedModule.errors.txt index ed5ae704038..5a8ac069803 100644 --- a/tests/baselines/reference/invalidInstantiatedModule.errors.txt +++ b/tests/baselines/reference/invalidInstantiatedModule.errors.txt @@ -1,9 +1,16 @@ -==== tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts (2 errors) ==== +tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts(2,18): error TS2300: Duplicate identifier 'Point'. +tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts(3,16): error TS2300: Duplicate identifier 'Point'. +tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts(12,8): error TS2304: Cannot find name 'm'. + + +==== tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts (3 errors) ==== module M { export class Point { x: number; y: number } + ~~~~~ +!!! error TS2300: Duplicate identifier 'Point'. export var Point = 1; // Error ~~~~~ -!!! Duplicate identifier 'Point'. +!!! error TS2300: Duplicate identifier 'Point'. } module M2 { @@ -14,7 +21,7 @@ var m = M2; var p: m.Point; // Error ~~~~~~~ -!!! Cannot find name 'm'. +!!! error TS2304: Cannot find name 'm'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt index a9707aedc84..101ee0124cc 100644 --- a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt @@ -1,14 +1,37 @@ +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(4,5): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(6,5): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(12,5): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(13,5): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(15,5): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(19,5): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(25,5): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(29,5): error TS1044: 'private' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(31,5): error TS1044: 'private' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(37,5): error TS1044: 'private' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(38,5): error TS1044: 'private' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(40,5): error TS1044: 'private' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(44,5): error TS1044: 'private' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(50,5): error TS1044: 'private' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(55,5): error TS1044: 'static' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(57,5): error TS1044: 'static' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(63,5): error TS1044: 'static' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(64,5): error TS1044: 'static' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(66,5): error TS1044: 'static' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(70,5): error TS1044: 'static' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier cannot appear on a module element. + + ==== tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts (21 errors) ==== // All of these should be an error module Y { public class A { s: string } ~~~~~~ -!!! 'public' modifier cannot appear on a module element. +!!! error TS1044: 'public' modifier cannot appear on a module element. public class BB extends A { ~~~~~~ -!!! 'public' modifier cannot appear on a module element. +!!! error TS1044: 'public' modifier cannot appear on a module element. id: number; } } @@ -16,20 +39,20 @@ module Y2 { public class AA { s: T } ~~~~~~ -!!! 'public' modifier cannot appear on a module element. +!!! error TS1044: 'public' modifier cannot appear on a module element. public interface I { id: number } ~~~~~~ -!!! 'public' modifier cannot appear on a module element. +!!! error TS1044: 'public' modifier cannot appear on a module element. public class B extends AA implements I { id: number } ~~~~~~ -!!! 'public' modifier cannot appear on a module element. +!!! error TS1044: 'public' modifier cannot appear on a module element. } module Y3 { public module Module { ~~~~~~ -!!! 'public' modifier cannot appear on a module element. +!!! error TS1044: 'public' modifier cannot appear on a module element. class A { s: string } } } @@ -37,17 +60,17 @@ module Y4 { public enum Color { Blue, Red } ~~~~~~ -!!! 'public' modifier cannot appear on a module element. +!!! error TS1044: 'public' modifier cannot appear on a module element. } module YY { private class A { s: string } ~~~~~~~ -!!! 'private' modifier cannot appear on a module element. +!!! error TS1044: 'private' modifier cannot appear on a module element. private class BB extends A { ~~~~~~~ -!!! 'private' modifier cannot appear on a module element. +!!! error TS1044: 'private' modifier cannot appear on a module element. id: number; } } @@ -55,20 +78,20 @@ module YY2 { private class AA { s: T } ~~~~~~~ -!!! 'private' modifier cannot appear on a module element. +!!! error TS1044: 'private' modifier cannot appear on a module element. private interface I { id: number } ~~~~~~~ -!!! 'private' modifier cannot appear on a module element. +!!! error TS1044: 'private' modifier cannot appear on a module element. private class B extends AA implements I { id: number } ~~~~~~~ -!!! 'private' modifier cannot appear on a module element. +!!! error TS1044: 'private' modifier cannot appear on a module element. } module YY3 { private module Module { ~~~~~~~ -!!! 'private' modifier cannot appear on a module element. +!!! error TS1044: 'private' modifier cannot appear on a module element. class A { s: string } } } @@ -76,18 +99,18 @@ module YY4 { private enum Color { Blue, Red } ~~~~~~~ -!!! 'private' modifier cannot appear on a module element. +!!! error TS1044: 'private' modifier cannot appear on a module element. } module YYY { static class A { s: string } ~~~~~~ -!!! 'static' modifier cannot appear on a module element. +!!! error TS1044: 'static' modifier cannot appear on a module element. static class BB extends A { ~~~~~~ -!!! 'static' modifier cannot appear on a module element. +!!! error TS1044: 'static' modifier cannot appear on a module element. id: number; } } @@ -95,20 +118,20 @@ module YYY2 { static class AA { s: T } ~~~~~~ -!!! 'static' modifier cannot appear on a module element. +!!! error TS1044: 'static' modifier cannot appear on a module element. static interface I { id: number } ~~~~~~ -!!! 'static' modifier cannot appear on a module element. +!!! error TS1044: 'static' modifier cannot appear on a module element. static class B extends AA implements I { id: number } ~~~~~~ -!!! 'static' modifier cannot appear on a module element. +!!! error TS1044: 'static' modifier cannot appear on a module element. } module YYY3 { static module Module { ~~~~~~ -!!! 'static' modifier cannot appear on a module element. +!!! error TS1044: 'static' modifier cannot appear on a module element. class A { s: string } } } @@ -116,6 +139,6 @@ module YYY4 { static enum Color { Blue, Red } ~~~~~~ -!!! 'static' modifier cannot appear on a module element. +!!! error TS1044: 'static' modifier cannot appear on a module element. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt b/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt index 80f516a2f66..ad8d457670a 100644 --- a/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt +++ b/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt @@ -1,40 +1,48 @@ +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts(4,5): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts(8,5): error TS1044: 'public' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts(12,5): error TS1044: 'static' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts(16,5): error TS1044: 'static' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts(20,5): error TS1044: 'private' modifier cannot appear on a module element. +tests/cases/conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts(25,5): error TS1044: 'private' modifier cannot appear on a module element. + + ==== tests/cases/conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts (6 errors) ==== // All of these should be an error module Y { public var x: number = 0; ~~~~~~ -!!! 'public' modifier cannot appear on a module element. +!!! error TS1044: 'public' modifier cannot appear on a module element. } module Y2 { public function fn(x: string) { } ~~~~~~ -!!! 'public' modifier cannot appear on a module element. +!!! error TS1044: 'public' modifier cannot appear on a module element. } module Y4 { static var x: number = 0; ~~~~~~ -!!! 'static' modifier cannot appear on a module element. +!!! error TS1044: 'static' modifier cannot appear on a module element. } module YY { static function fn(x: string) { } ~~~~~~ -!!! 'static' modifier cannot appear on a module element. +!!! error TS1044: 'static' modifier cannot appear on a module element. } module YY2 { private var x: number = 0; ~~~~~~~ -!!! 'private' modifier cannot appear on a module element. +!!! error TS1044: 'private' modifier cannot appear on a module element. } module YY3 { private function fn(x: string) { } ~~~~~~~ -!!! 'private' modifier cannot appear on a module element. +!!! error TS1044: 'private' modifier cannot appear on a module element. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt b/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt index b09865a2f25..3ec718f3b25 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt @@ -1,3 +1,17 @@ +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(34,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(35,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(40,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(46,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(47,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D)[]'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(50,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. +tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(53,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. + + ==== tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts (12 errors) ==== interface I { id: number; @@ -32,47 +46,47 @@ var a: any; var a = 1; ~ -!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. var a = 'a string'; ~ -!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. var a = new C(); ~ -!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. var a = new D(); ~ -!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. var a = M; ~ -!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. var b: I; var b = new C(); ~ -!!! Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. var b = new C2(); ~ -!!! Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. var f = F; var f = (x: number) => ''; ~ -!!! Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. var arr: string[]; var arr = [1, 2, 3, 4]; ~~~ -!!! Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. var arr = [new C(), new C2(), new D()]; ~~~ -!!! Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '{}[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D)[]'. var arr2 = [new D()]; var arr2 = new Array>(); ~~~~ -!!! Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. var m: typeof M; var m = M.A; ~ -!!! Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidNestedModules.errors.txt b/tests/baselines/reference/invalidNestedModules.errors.txt index 31e8ad29177..972c177fc0e 100644 --- a/tests/baselines/reference/invalidNestedModules.errors.txt +++ b/tests/baselines/reference/invalidNestedModules.errors.txt @@ -1,7 +1,12 @@ -==== tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts (2 errors) ==== +tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts(1,12): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts(17,18): error TS2300: Duplicate identifier 'Point'. +tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts(24,20): error TS2300: Duplicate identifier 'Point'. + + +==== tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts (3 errors) ==== module A.B.C { ~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged export class Point { x: number; y: number; @@ -18,6 +23,8 @@ module M2.X { export class Point { + ~~~~~ +!!! error TS2300: Duplicate identifier 'Point'. x: number; y: number; } } @@ -26,7 +33,7 @@ export module X { export var Point: number; // Error ~~~~~ -!!! Duplicate identifier 'Point'. +!!! error TS2300: Duplicate identifier 'Point'. } } diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt index 4bba247a5b8..7eb5e6cb897 100644 --- a/tests/baselines/reference/invalidNumberAssignments.errors.txt +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -1,48 +1,64 @@ +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(3,5): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(4,5): error TS2322: Type 'number' is not assignable to type 'string'. +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'. + Property 'foo' is missing in type 'Number'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I'. + Property 'bar' is missing in type 'Number'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. + Property 'baz' is missing in type 'Number'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. + Property '0' is missing in type '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. + + ==== tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts (10 errors) ==== var x = 1; var a: boolean = x; ~ -!!! Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. var b: string = x; ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var c: void = x; ~ -!!! Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. var d: typeof undefined = x; class C { foo: string; } var e: C = x; ~ -!!! Type 'number' is not assignable to type 'C': -!!! Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'C'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. interface I { bar: string; } var f: I = x; ~ -!!! Type 'number' is not assignable to type 'I': -!!! Property 'bar' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'I'. +!!! error TS2322: Property 'bar' is missing in type 'Number'. var g: { baz: string } = 1; ~ -!!! Type 'number' is not assignable to type '{ baz: string; }': -!!! Property 'baz' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ -!!! Type 'number' is not assignable to type '{ 0: number; }': -!!! Property '0' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; ~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. function i(a: T) { a = x; ~ -!!! Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type 'number' is not assignable to type 'T'. } i = x; ~ -!!! Invalid left-hand side of assignment expression. \ No newline at end of file +!!! error TS2364: Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/invalidReferenceSyntax1.errors.txt b/tests/baselines/reference/invalidReferenceSyntax1.errors.txt index cad7a35eb02..e7599c7a146 100644 --- a/tests/baselines/reference/invalidReferenceSyntax1.errors.txt +++ b/tests/baselines/reference/invalidReferenceSyntax1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/invalidReferenceSyntax1.ts(1,1): error TS1084: Invalid 'reference' directive syntax. + + ==== tests/cases/compiler/invalidReferenceSyntax1.ts (1 errors) ==== /// { + let l = 0; + n = l; + }; + + var F3 = function () { + let l = 0; + n = l; + }; + + // modules + module m { + let l = 0; + n = l; + + { + let l = false; + var b2: boolean = l; + } + + lable: let l2 = 0; + } + + // methods + class C { + constructor() { + let l = 0; + n = l; + } + + method() { + let l = 0; + n = l; + } + + get v() { + let l = 0; + n = l; + return n; + } + + set v(value) { + let l = 0; + n = l; + } + } + + // object literals + var o = { + f() { + let l = 0; + n = l; + }, + f2: () => { + let l = 0; + n = l; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/letDeclarations-scopes.js b/tests/baselines/reference/letDeclarations-scopes.js new file mode 100644 index 00000000000..fb16a03f569 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-scopes.js @@ -0,0 +1,293 @@ +//// [letDeclarations-scopes.ts] + +// global +let l = "string"; + +var n: number; + +// Control flow statements with blocks +if (true) { + let l = 0; + n = l; +} +else { + let l = 0; + n = l; +} + +while (true) { + let l = 0; + n = l; +} + +do { + let l = 0; + n = l; +} while (true); + +var obj; +with (obj) { + let l = 0; + n = l; +} + +for (var i = 0; i < 10; i++) { + let l = 0; + n = l; +} + +for (var i2 in {}) { + let l = 0; + n = l; +} + +if (true) { + label: let l = 0; + n = l; +} + +while (false) { + label2: label3: label4: let l = 0; + n = l; +} + +for (let l = 0; n = l; l++) { + let l = true; + var b3: boolean = l; +} + +for (let l in {}) { + +} + +// Try/catch/finally +try { + let l = 0; + n = l; +} +catch (e) { + let l = 0; + n = l; +} +finally { + let l = 0; + n = l; +} + +// Switch +switch (0) { + case 0: + let l = 0; + n = l; + break; +} + +// blocks +{ + let l = 0; + n = l; + { + let l = false; + var b: boolean = l; + } +} + +// functions +function F() { + let l = 0; + n = l; +} + +var F2 = () => { + let l = 0; + n = l; +}; + +var F3 = function () { + let l = 0; + n = l; +}; + +// modules +module m { + let l = 0; + n = l; + + { + let l = false; + var b2: boolean = l; + } + + lable: let l2 = 0; +} + +// methods +class C { + constructor() { + let l = 0; + n = l; + } + + method() { + let l = 0; + n = l; + } + + get v() { + let l = 0; + n = l; + return n; + } + + set v(value) { + let l = 0; + n = l; + } +} + +// object literals +var o = { + f() { + let l = 0; + n = l; + }, + f2: () => { + let l = 0; + n = l; + } +} + +//// [letDeclarations-scopes.js] +// global +let l = "string"; +var n; +// Control flow statements with blocks +if (true) { + let l = 0; + n = l; +} +else { + let l = 0; + n = l; +} +while (true) { + let l = 0; + n = l; +} +do { + let l = 0; + n = l; +} while (true); +var obj; +with (obj) { + let l = 0; + n = l; +} +for (var i = 0; i < 10; i++) { + let l = 0; + n = l; +} +for (var i2 in {}) { + let l = 0; + n = l; +} +if (true) { + label: let l = 0; + n = l; +} +while (false) { + label2: label3: label4: let l = 0; + n = l; +} +for (let l = 0; n = l; l++) { + let l = true; + var b3 = l; +} +for (let l in {}) { +} +try { + let l = 0; + n = l; +} +catch (e) { + let l = 0; + n = l; +} +finally { + let l = 0; + n = l; +} +switch (0) { + case 0: + let l = 0; + n = l; + break; +} +{ + let l = 0; + n = l; + { + let l = false; + var b = l; + } +} +// functions +function F() { + let l = 0; + n = l; +} +var F2 = function () { + let l = 0; + n = l; +}; +var F3 = function () { + let l = 0; + n = l; +}; +// modules +var m; +(function (m) { + let l = 0; + n = l; + { + let l = false; + var b2 = l; + } + lable: let l2 = 0; +})(m || (m = {})); +// methods +var C = (function () { + function C() { + let l = 0; + n = l; + } + C.prototype.method = function () { + let l = 0; + n = l; + }; + Object.defineProperty(C.prototype, "v", { + get: function () { + let l = 0; + n = l; + return n; + }, + set: function (value) { + let l = 0; + n = l; + }, + enumerable: true, + configurable: true + }); + return C; +})(); +// object literals +var o = { + f: function () { + let l = 0; + n = l; + }, + f2: function () { + let l = 0; + n = l; + } +}; diff --git a/tests/baselines/reference/letDeclarations-scopes2.errors.txt b/tests/baselines/reference/letDeclarations-scopes2.errors.txt new file mode 100644 index 00000000000..a786db1104b --- /dev/null +++ b/tests/baselines/reference/letDeclarations-scopes2.errors.txt @@ -0,0 +1,42 @@ +tests/cases/compiler/letDeclarations-scopes2.ts(9,5): error TS2304: Cannot find name 'local2'. +tests/cases/compiler/letDeclarations-scopes2.ts(21,5): error TS2304: Cannot find name 'local2'. +tests/cases/compiler/letDeclarations-scopes2.ts(24,1): error TS2304: Cannot find name 'local'. +tests/cases/compiler/letDeclarations-scopes2.ts(26,1): error TS2304: Cannot find name 'local2'. + + +==== tests/cases/compiler/letDeclarations-scopes2.ts (4 errors) ==== + + let global = 0; + + { + let local = 0; + + local; // OK + global; // OK + local2; // Error + ~~~~~~ +!!! error TS2304: Cannot find name 'local2'. + + { + let local2 = 0; + + local; // OK + global; // OK + local2; // OK + } + + local; // OK + global; // OK + local2; // Error + ~~~~~~ +!!! error TS2304: Cannot find name 'local2'. + } + + local; // Error + ~~~~~ +!!! error TS2304: Cannot find name 'local'. + global; // OK + local2; // Error + ~~~~~~ +!!! error TS2304: Cannot find name 'local2'. + \ No newline at end of file diff --git a/tests/baselines/reference/letDeclarations-scopes2.js b/tests/baselines/reference/letDeclarations-scopes2.js new file mode 100644 index 00000000000..98d0e791832 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-scopes2.js @@ -0,0 +1,49 @@ +//// [letDeclarations-scopes2.ts] + +let global = 0; + +{ + let local = 0; + + local; // OK + global; // OK + local2; // Error + + { + let local2 = 0; + + local; // OK + global; // OK + local2; // OK + } + + local; // OK + global; // OK + local2; // Error +} + +local; // Error +global; // OK +local2; // Error + + +//// [letDeclarations-scopes2.js] +let global = 0; +{ + let local = 0; + local; // OK + global; // OK + local2; // Error + { + let local2 = 0; + local; // OK + global; // OK + local2; // OK + } + local; // OK + global; // OK + local2; // Error +} +local; // Error +global; // OK +local2; // Error diff --git a/tests/baselines/reference/letDeclarations-useBeforeDefinition.errors.txt b/tests/baselines/reference/letDeclarations-useBeforeDefinition.errors.txt new file mode 100644 index 00000000000..74c354f4ff2 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-useBeforeDefinition.errors.txt @@ -0,0 +1,21 @@ +tests/cases/compiler/letDeclarations-useBeforeDefinition.ts(3,5): error TS2448: Block-scoped variable 'l1' used before its declaration. +tests/cases/compiler/letDeclarations-useBeforeDefinition.ts(9,5): error TS2448: Block-scoped variable 'v1' used before its declaration. + + +==== tests/cases/compiler/letDeclarations-useBeforeDefinition.ts (2 errors) ==== + + { + l1; + ~~ +!!! error TS2448: Block-scoped variable 'l1' used before its declaration. + let l1; + } + + var v1; + { + v1; + ~~ +!!! error TS2448: Block-scoped variable 'v1' used before its declaration. + let v1 = 0; + } + \ No newline at end of file diff --git a/tests/baselines/reference/letDeclarations-useBeforeDefinition2.errors.txt b/tests/baselines/reference/letDeclarations-useBeforeDefinition2.errors.txt new file mode 100644 index 00000000000..5b8633312d9 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-useBeforeDefinition2.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/file1.ts(2,1): error TS2448: Block-scoped variable 'l' used before its declaration. + + +==== tests/cases/compiler/file1.ts (1 errors) ==== + + l; + ~ +!!! error TS2448: Block-scoped variable 'l' used before its declaration. + +==== tests/cases/compiler/file2.ts (0 errors) ==== + const l = 0; \ No newline at end of file diff --git a/tests/baselines/reference/letDeclarations-validContexts.errors.txt b/tests/baselines/reference/letDeclarations-validContexts.errors.txt new file mode 100644 index 00000000000..3f3b7a2634f --- /dev/null +++ b/tests/baselines/reference/letDeclarations-validContexts.errors.txt @@ -0,0 +1,149 @@ +tests/cases/compiler/letDeclarations-validContexts.ts(20,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. + + +==== tests/cases/compiler/letDeclarations-validContexts.ts (1 errors) ==== + + + // Control flow statements with blocks + if (true) { + let l1 = 0; + } + else { + let l2 = 0; + } + + while (true) { + let l3 = 0; + } + + do { + let l4 = 0; + } while (true); + + var obj; + with (obj) { + ~~~ +!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'. + let l5 = 0; + } + + for (var i = 0; i < 10; i++) { + let l6 = 0; + } + + for (var i2 in {}) { + let l7 = 0; + } + + if (true) { + label: let l8 = 0; + } + + while (false) { + label2: label3: label4: let l9 = 0; + } + + // Try/catch/finally + try { + let l10 = 0; + } + catch (e) { + let l11 = 0; + } + finally { + let l12 = 0; + } + + // Switch + switch (0) { + case 0: + let l13 = 0; + break; + default: + let l14 = 0; + break; + } + + // blocks + { + let l15 = 0; + { + let l16 = 0 + label17: let l17 = 0; + } + } + + // global + let l18 = 0; + + // functions + function F() { + let l19 = 0; + } + + var F2 = () => { + let l20 = 0; + }; + + var F3 = function () { + let l21 = 0; + }; + + // modules + module m { + let l22 = 0; + + { + let l23 = 0; + } + } + + // methods + class C { + constructor() { + let l24 = 0; + } + + method() { + let l25 = 0; + } + + get v() { + let l26 = 0; + return l26; + } + + set v(value) { + let l27 = value; + } + } + + // object literals + var o = { + f() { + let l28 = 0; + }, + f2: () => { + let l29 = 0; + } + } + + // labels + label: let l30 = 0; + { + label2: let l31 = 0; + } + + function f3() { + label: let l32 = 0; + { + label2: let l33 = 0; + } + } + + module m3 { + label: let l34 = 0; + { + label2: let l35 = 0; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/letDeclarations-validContexts.js b/tests/baselines/reference/letDeclarations-validContexts.js new file mode 100644 index 00000000000..13eaafb0712 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-validContexts.js @@ -0,0 +1,266 @@ +//// [letDeclarations-validContexts.ts] + + +// Control flow statements with blocks +if (true) { + let l1 = 0; +} +else { + let l2 = 0; +} + +while (true) { + let l3 = 0; +} + +do { + let l4 = 0; +} while (true); + +var obj; +with (obj) { + let l5 = 0; +} + +for (var i = 0; i < 10; i++) { + let l6 = 0; +} + +for (var i2 in {}) { + let l7 = 0; +} + +if (true) { + label: let l8 = 0; +} + +while (false) { + label2: label3: label4: let l9 = 0; +} + +// Try/catch/finally +try { + let l10 = 0; +} +catch (e) { + let l11 = 0; +} +finally { + let l12 = 0; +} + +// Switch +switch (0) { + case 0: + let l13 = 0; + break; + default: + let l14 = 0; + break; +} + +// blocks +{ + let l15 = 0; + { + let l16 = 0 + label17: let l17 = 0; + } +} + +// global +let l18 = 0; + +// functions +function F() { + let l19 = 0; +} + +var F2 = () => { + let l20 = 0; +}; + +var F3 = function () { + let l21 = 0; +}; + +// modules +module m { + let l22 = 0; + + { + let l23 = 0; + } +} + +// methods +class C { + constructor() { + let l24 = 0; + } + + method() { + let l25 = 0; + } + + get v() { + let l26 = 0; + return l26; + } + + set v(value) { + let l27 = value; + } +} + +// object literals +var o = { + f() { + let l28 = 0; + }, + f2: () => { + let l29 = 0; + } +} + +// labels +label: let l30 = 0; +{ + label2: let l31 = 0; +} + +function f3() { + label: let l32 = 0; + { + label2: let l33 = 0; + } +} + +module m3 { + label: let l34 = 0; + { + label2: let l35 = 0; + } +} + +//// [letDeclarations-validContexts.js] +// Control flow statements with blocks +if (true) { + let l1 = 0; +} +else { + let l2 = 0; +} +while (true) { + let l3 = 0; +} +do { + let l4 = 0; +} while (true); +var obj; +with (obj) { + let l5 = 0; +} +for (var i = 0; i < 10; i++) { + let l6 = 0; +} +for (var i2 in {}) { + let l7 = 0; +} +if (true) { + label: let l8 = 0; +} +while (false) { + label2: label3: label4: let l9 = 0; +} +try { + let l10 = 0; +} +catch (e) { + let l11 = 0; +} +finally { + let l12 = 0; +} +switch (0) { + case 0: + let l13 = 0; + break; + default: + let l14 = 0; + break; +} +{ + let l15 = 0; + { + let l16 = 0; + label17: let l17 = 0; + } +} +// global +let l18 = 0; +// functions +function F() { + let l19 = 0; +} +var F2 = function () { + let l20 = 0; +}; +var F3 = function () { + let l21 = 0; +}; +// modules +var m; +(function (m) { + let l22 = 0; + { + let l23 = 0; + } +})(m || (m = {})); +// methods +var C = (function () { + function C() { + let l24 = 0; + } + C.prototype.method = function () { + let l25 = 0; + }; + Object.defineProperty(C.prototype, "v", { + get: function () { + let l26 = 0; + return l26; + }, + set: function (value) { + let l27 = value; + }, + enumerable: true, + configurable: true + }); + return C; +})(); +// object literals +var o = { + f: function () { + let l28 = 0; + }, + f2: function () { + let l29 = 0; + } +}; +label: let l30 = 0; +{ + label2: let l31 = 0; +} +function f3() { + label: let l32 = 0; + { + label2: let l33 = 0; + } +} +var m3; +(function (m3) { + label: let l34 = 0; + { + label2: let l35 = 0; + } +})(m3 || (m3 = {})); diff --git a/tests/baselines/reference/letDeclarations.js b/tests/baselines/reference/letDeclarations.js new file mode 100644 index 00000000000..bc186b732f5 --- /dev/null +++ b/tests/baselines/reference/letDeclarations.js @@ -0,0 +1,35 @@ +//// [letDeclarations.ts] + +let l1; +let l2: number; +let l3, l4, l5 :string, l6; + +let l7 = false; +let l8: number = 23; +let l9 = 0, l10 :string = "", l11 = null; + +for(let l11 in {}) { } + +for(let l12 = 0; l12 < 9; l12++) { } + + +//// [letDeclarations.js] +let l1; +let l2; +let l3, l4, l5, l6; +let l7 = false; +let l8 = 23; +let l9 = 0, l10 = "", l11 = null; +for (let l11 in {}) { +} +for (let l12 = 0; l12 < 9; l12++) { +} + + +//// [letDeclarations.d.ts] +declare let l1: any; +declare let l2: number; +declare let l3: any, l4: any, l5: string, l6: any; +declare let l7: boolean; +declare let l8: number; +declare let l9: number, l10: string, l11: any; diff --git a/tests/baselines/reference/letDeclarations.types b/tests/baselines/reference/letDeclarations.types new file mode 100644 index 00000000000..aa47a7f0006 --- /dev/null +++ b/tests/baselines/reference/letDeclarations.types @@ -0,0 +1,36 @@ +=== tests/cases/compiler/letDeclarations.ts === + +let l1; +>l1 : any + +let l2: number; +>l2 : number + +let l3, l4, l5 :string, l6; +>l3 : any +>l4 : any +>l5 : string +>l6 : any + +let l7 = false; +>l7 : boolean + +let l8: number = 23; +>l8 : number + +let l9 = 0, l10 :string = "", l11 = null; +>l9 : number +>l10 : string +>l11 : any + +for(let l11 in {}) { } +>l11 : any +>{} : {} + +for(let l12 = 0; l12 < 9; l12++) { } +>l12 : number +>l12 < 9 : boolean +>l12 : number +>l12++ : number +>l12 : number + diff --git a/tests/baselines/reference/letDeclarations2.js b/tests/baselines/reference/letDeclarations2.js new file mode 100644 index 00000000000..8a6f039f2ca --- /dev/null +++ b/tests/baselines/reference/letDeclarations2.js @@ -0,0 +1,19 @@ +//// [letDeclarations2.ts] + +module M { + let l1 = "s"; + export let l2 = 0; +} + +//// [letDeclarations2.js] +var M; +(function (M) { + let l1 = "s"; + M.l2 = 0; +})(M || (M = {})); + + +//// [letDeclarations2.d.ts] +declare module M { + let l2: number; +} diff --git a/tests/baselines/reference/letDeclarations2.types b/tests/baselines/reference/letDeclarations2.types new file mode 100644 index 00000000000..2fa08b6d940 --- /dev/null +++ b/tests/baselines/reference/letDeclarations2.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/letDeclarations2.ts === + +module M { +>M : typeof M + + let l1 = "s"; +>l1 : string + + export let l2 = 0; +>l2 : number +} diff --git a/tests/baselines/reference/libMembers.errors.txt b/tests/baselines/reference/libMembers.errors.txt index 6212466b1ef..73f5c945f70 100644 --- a/tests/baselines/reference/libMembers.errors.txt +++ b/tests/baselines/reference/libMembers.errors.txt @@ -1,22 +1,27 @@ +tests/cases/compiler/libMembers.ts(9,11): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/libMembers.ts(4,3): error TS2339: Property 'subby' does not exist on type 'string'. +tests/cases/compiler/libMembers.ts(12,15): error TS2339: Property 'prototype' does not exist on type 'C'. + + ==== tests/cases/compiler/libMembers.ts (3 errors) ==== var s="hello"; s.substring(0); s.substring(3,4); s.subby(12); // error unresolved ~~~~~ -!!! Property 'subby' does not exist on type 'string'. +!!! error TS2339: Property 'subby' does not exist on type 'string'. String.fromCharCode(12); module M { export class C { } var a=new C[]; - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. a.length; a.push(new C()); (new C()).prototype; ~~~~~~~~~ -!!! Property 'prototype' does not exist on type 'C'. +!!! error TS2339: Property 'prototype' does not exist on type 'C'. } \ No newline at end of file diff --git a/tests/baselines/reference/lift.errors.txt b/tests/baselines/reference/lift.errors.txt index 56f8a860211..ef8bddbf787 100644 --- a/tests/baselines/reference/lift.errors.txt +++ b/tests/baselines/reference/lift.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/lift.ts(14,32): error TS2304: Cannot find name 'x'. +tests/cases/compiler/lift.ts(14,34): error TS2304: Cannot find name 'z'. +tests/cases/compiler/lift.ts(15,37): error TS2304: Cannot find name 'x'. +tests/cases/compiler/lift.ts(15,39): error TS2304: Cannot find name 'z'. + + ==== tests/cases/compiler/lift.ts (4 errors) ==== class B { constructor(public y:number) { @@ -14,13 +20,13 @@ public liftxyz () { return x+z+this.y; } ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. ~ -!!! Cannot find name 'z'. +!!! error TS2304: Cannot find name 'z'. public liftxylocllz () { return x+z+this.y+this.ll; } ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. ~ -!!! Cannot find name 'z'. +!!! error TS2304: Cannot find name 'z'. } \ No newline at end of file diff --git a/tests/baselines/reference/literals-negative.errors.txt b/tests/baselines/reference/literals-negative.errors.txt index 276afb5a81d..d783e5dfa02 100644 --- a/tests/baselines/reference/literals-negative.errors.txt +++ b/tests/baselines/reference/literals-negative.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/literals-negative.ts(5,9): error TS2352: Neither type 'number' nor type 'boolean' is assignable to the other. + + ==== tests/cases/compiler/literals-negative.ts (1 errors) ==== // Type type of the null literal is the Null type. // Null can be converted to anything except Void @@ -5,7 +8,7 @@ var s = (null); var b = (n); ~~~~~~~~~~~~ -!!! Neither type 'number' nor type 'boolean' is assignable to the other. +!!! error TS2352: Neither type 'number' nor type 'boolean' is assignable to the other. function isVoid() : void { } diff --git a/tests/baselines/reference/literals.errors.txt b/tests/baselines/reference/literals.errors.txt index 3361dfd5c67..f33d26af7a4 100644 --- a/tests/baselines/reference/literals.errors.txt +++ b/tests/baselines/reference/literals.errors.txt @@ -1,3 +1,11 @@ +tests/cases/conformance/expressions/literals/literals.ts(20,9): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/literals/literals.ts(25,10): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/literals/literals.ts(9,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/literals/literals.ts(9,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/literals/literals.ts(10,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/literals/literals.ts(10,21): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + ==== tests/cases/conformance/expressions/literals/literals.ts (6 errors) ==== //typeof null is Null @@ -9,14 +17,14 @@ var nu = null / null; ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var u = undefined / undefined; ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var b: boolean; var b = true; @@ -28,14 +36,14 @@ var n = 1e4; var n = 001; // Error in ES5 ~~~ -!!! Octal literals are not available when targeting ECMAScript 5 and higher. +!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. var n = 0x1; var n = -1; var n = -1.0; var n = -1e-4; var n = -003; // Error in ES5 ~~~ -!!! Octal literals are not available when targeting ECMAScript 5 and higher. +!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. var n = -0x1; var s: string; diff --git a/tests/baselines/reference/logicalNotExpression1.errors.txt b/tests/baselines/reference/logicalNotExpression1.errors.txt index b38a05bb31f..cd2a3a0941d 100644 --- a/tests/baselines/reference/logicalNotExpression1.errors.txt +++ b/tests/baselines/reference/logicalNotExpression1.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/logicalNotExpression1.ts(1,2): error TS2304: Cannot find name 'foo'. + + ==== tests/cases/compiler/logicalNotExpression1.ts (1 errors) ==== !foo; ~~~ -!!! Cannot find name 'foo'. \ No newline at end of file +!!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt b/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt index 7b8e7de7d4e..3267d60a13a 100644 --- a/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts(5,17): error TS1005: ',' expected. +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts(5,18): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts(11,16): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts(8,16): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. + + ==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts (4 errors) ==== // Unary operator ! var b: number; @@ -5,16 +11,16 @@ // operand before ! var BOOLEAN1 = b!; //expect error ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~ -!!! Expression expected. +!!! error TS1109: Expression expected. // miss parentheses var BOOLEAN2 = !b + b; ~~~~~~ -!!! Operator '+' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. // miss an operand var BOOLEAN3 =!; ~ -!!! Expression expected. \ No newline at end of file +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt index 07aa1630e9f..883f2ee5861 100644 --- a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt @@ -1,3 +1,8 @@ +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 (3 errors) ==== // ! operator on any type @@ -45,13 +50,13 @@ var ResultIsBoolean16 = !(ANY + ANY1); var ResultIsBoolean17 = !(null + undefined); ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var ResultIsBoolean18 = !(null + null); ~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var ResultIsBoolean19 = !(undefined + undefined); ~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. // multiple ! operators var ResultIsBoolean20 = !!ANY; diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.js b/tests/baselines/reference/logicalNotOperatorWithEnumType.js index 19efcc979ad..89ee1a14833 100644 --- a/tests/baselines/reference/logicalNotOperatorWithEnumType.js +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.js @@ -1,33 +1,33 @@ //// [logicalNotOperatorWithEnumType.ts] // ! operator on enum type -enum ENUM { 1, 2, 3 }; +enum ENUM { A, B, C }; enum ENUM1 { }; // enum type var var ResultIsBoolean1 = !ENUM; // enum type expressions -var ResultIsBoolean2 = !ENUM[1]; -var ResultIsBoolean3 = !(ENUM[1] + ENUM[2]); +var ResultIsBoolean2 = !ENUM["B"]; +var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); // multiple ! operators var ResultIsBoolean4 = !!ENUM; -var ResultIsBoolean5 = !!!(ENUM[1] + ENUM[2]); +var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); // miss assignment operators !ENUM; !ENUM1; -!ENUM[1]; +!ENUM.B; !ENUM, ENUM1; //// [logicalNotOperatorWithEnumType.js] // ! operator on enum type var ENUM; (function (ENUM) { - ENUM[ENUM["1"] = 0] = "1"; - ENUM[ENUM["2"] = 1] = "2"; - ENUM[ENUM["3"] = 2] = "3"; + ENUM[ENUM["A"] = 0] = "A"; + ENUM[ENUM["B"] = 1] = "B"; + ENUM[ENUM["C"] = 2] = "C"; })(ENUM || (ENUM = {})); ; var ENUM1; @@ -37,13 +37,13 @@ var ENUM1; // enum type var var ResultIsBoolean1 = !ENUM; // enum type expressions -var ResultIsBoolean2 = !ENUM[1]; -var ResultIsBoolean3 = !(ENUM[1] + ENUM[2]); +var ResultIsBoolean2 = !1 /* "B" */; +var ResultIsBoolean3 = !(1 /* B */ + 2 /* "C" */); // multiple ! operators var ResultIsBoolean4 = !!ENUM; -var ResultIsBoolean5 = !!!(ENUM[1] + ENUM[2]); +var ResultIsBoolean5 = !!!(1 /* "B" */ + 2 /* C */); // miss assignment operators !ENUM; !ENUM1; -!ENUM[1]; +!1 /* B */; !ENUM, ENUM1; diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.types b/tests/baselines/reference/logicalNotOperatorWithEnumType.types index 27cbb24d3bb..f3c9d98c95b 100644 --- a/tests/baselines/reference/logicalNotOperatorWithEnumType.types +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.types @@ -1,8 +1,11 @@ === tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts === // ! operator on enum type -enum ENUM { 1, 2, 3 }; +enum ENUM { A, B, C }; >ENUM : ENUM +>A : ENUM +>B : ENUM +>C : ENUM enum ENUM1 { }; >ENUM1 : ENUM1 @@ -14,20 +17,21 @@ var ResultIsBoolean1 = !ENUM; >ENUM : typeof ENUM // enum type expressions -var ResultIsBoolean2 = !ENUM[1]; +var ResultIsBoolean2 = !ENUM["B"]; >ResultIsBoolean2 : boolean ->!ENUM[1] : boolean ->ENUM[1] : ENUM +>!ENUM["B"] : boolean +>ENUM["B"] : ENUM >ENUM : typeof ENUM -var ResultIsBoolean3 = !(ENUM[1] + ENUM[2]); +var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); >ResultIsBoolean3 : boolean ->!(ENUM[1] + ENUM[2]) : boolean ->(ENUM[1] + ENUM[2]) : number ->ENUM[1] + ENUM[2] : number ->ENUM[1] : ENUM +>!(ENUM.B + ENUM["C"]) : boolean +>(ENUM.B + ENUM["C"]) : number +>ENUM.B + ENUM["C"] : number +>ENUM.B : ENUM >ENUM : typeof ENUM ->ENUM[2] : ENUM +>B : ENUM +>ENUM["C"] : ENUM >ENUM : typeof ENUM // multiple ! operators @@ -37,17 +41,18 @@ var ResultIsBoolean4 = !!ENUM; >!ENUM : boolean >ENUM : typeof ENUM -var ResultIsBoolean5 = !!!(ENUM[1] + ENUM[2]); +var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); >ResultIsBoolean5 : boolean ->!!!(ENUM[1] + ENUM[2]) : boolean ->!!(ENUM[1] + ENUM[2]) : boolean ->!(ENUM[1] + ENUM[2]) : boolean ->(ENUM[1] + ENUM[2]) : number ->ENUM[1] + ENUM[2] : number ->ENUM[1] : ENUM +>!!!(ENUM["B"] + ENUM.C) : boolean +>!!(ENUM["B"] + ENUM.C) : boolean +>!(ENUM["B"] + ENUM.C) : boolean +>(ENUM["B"] + ENUM.C) : number +>ENUM["B"] + ENUM.C : number +>ENUM["B"] : ENUM >ENUM : typeof ENUM ->ENUM[2] : ENUM +>ENUM.C : ENUM >ENUM : typeof ENUM +>C : ENUM // miss assignment operators !ENUM; @@ -58,10 +63,11 @@ var ResultIsBoolean5 = !!!(ENUM[1] + ENUM[2]); >!ENUM1 : boolean >ENUM1 : typeof ENUM1 -!ENUM[1]; ->!ENUM[1] : boolean ->ENUM[1] : ENUM +!ENUM.B; +>!ENUM.B : boolean +>ENUM.B : ENUM >ENUM : typeof ENUM +>B : ENUM !ENUM, ENUM1; >!ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types index d44b220e818..95c9643c29a 100644 --- a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types +++ b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types @@ -7,7 +7,7 @@ var r: { a: string } = { a: '', b: 123 } || { a: '', b: true }; >r : { a: string; } >a : string ->{ a: '', b: 123 } || { a: '', b: true } : { a: string; } +>{ a: '', b: 123 } || { a: '', b: true } : { a: string; b: number; } | { a: string; b: boolean; } >{ a: '', b: 123 } : { a: string; b: number; } >a : string >b : number diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.types b/tests/baselines/reference/logicalOrOperatorWithEveryType.types index 3cf0399f437..3e3b0dcf37f 100644 --- a/tests/baselines/reference/logicalOrOperatorWithEveryType.types +++ b/tests/baselines/reference/logicalOrOperatorWithEveryType.types @@ -108,38 +108,38 @@ var rb2 = a2 || a2; // boolean || boolean is boolean >a2 : boolean var rb3 = a3 || a2; // number || boolean is {} ->rb3 : {} ->a3 || a2 : {} +>rb3 : number | boolean +>a3 || a2 : number | boolean >a3 : number >a2 : boolean var rb4 = a4 || a2; // string || boolean is {} ->rb4 : {} ->a4 || a2 : {} +>rb4 : string | boolean +>a4 || a2 : string | boolean >a4 : string >a2 : boolean var rb5 = a5 || a2; // void || boolean is {} ->rb5 : {} ->a5 || a2 : {} +>rb5 : boolean | void +>a5 || a2 : boolean | void >a5 : void >a2 : boolean var rb6 = a6 || a2; // enum || boolean is {} ->rb6 : {} ->a6 || a2 : {} +>rb6 : boolean | E +>a6 || a2 : boolean | E >a6 : E >a2 : boolean var rb7 = a7 || a2; // object || boolean is {} ->rb7 : {} ->a7 || a2 : {} +>rb7 : boolean | { a: string; } +>a7 || a2 : boolean | { a: string; } >a7 : { a: string; } >a2 : boolean var rb8 = a8 || a2; // array || boolean is {} ->rb8 : {} ->a8 || a2 : {} +>rb8 : boolean | string[] +>a8 || a2 : boolean | string[] >a8 : string[] >a2 : boolean @@ -161,8 +161,8 @@ var rc1 = a1 || a3; // any || number is any >a3 : number var rc2 = a2 || a3; // boolean || number is {} ->rc2 : {} ->a2 || a3 : {} +>rc2 : number | boolean +>a2 || a3 : number | boolean >a2 : boolean >a3 : number @@ -173,14 +173,14 @@ var rc3 = a3 || a3; // number || number is number >a3 : number var rc4 = a4 || a3; // string || number is {} ->rc4 : {} ->a4 || a3 : {} +>rc4 : string | number +>a4 || a3 : string | number >a4 : string >a3 : number var rc5 = a5 || a3; // void || number is {} ->rc5 : {} ->a5 || a3 : {} +>rc5 : number | void +>a5 || a3 : number | void >a5 : void >a3 : number @@ -191,14 +191,14 @@ var rc6 = a6 || a3; // enum || number is number >a3 : number var rc7 = a7 || a3; // object || number is {} ->rc7 : {} ->a7 || a3 : {} +>rc7 : number | { a: string; } +>a7 || a3 : number | { a: string; } >a7 : { a: string; } >a3 : number var rc8 = a8 || a3; // array || number is {} ->rc8 : {} ->a8 || a3 : {} +>rc8 : number | string[] +>a8 || a3 : number | string[] >a8 : string[] >a3 : number @@ -220,14 +220,14 @@ var rd1 = a1 || a4; // any || string is any >a4 : string var rd2 = a2 || a4; // boolean || string is {} ->rd2 : {} ->a2 || a4 : {} +>rd2 : string | boolean +>a2 || a4 : string | boolean >a2 : boolean >a4 : string var rd3 = a3 || a4; // number || string is {} ->rd3 : {} ->a3 || a4 : {} +>rd3 : string | number +>a3 || a4 : string | number >a3 : number >a4 : string @@ -238,26 +238,26 @@ var rd4 = a4 || a4; // string || string is string >a4 : string var rd5 = a5 || a4; // void || string is {} ->rd5 : {} ->a5 || a4 : {} +>rd5 : string | void +>a5 || a4 : string | void >a5 : void >a4 : string var rd6 = a6 || a4; // enum || string is {} ->rd6 : {} ->a6 || a4 : {} +>rd6 : string | E +>a6 || a4 : string | E >a6 : E >a4 : string var rd7 = a7 || a4; // object || string is {} ->rd7 : {} ->a7 || a4 : {} +>rd7 : string | { a: string; } +>a7 || a4 : string | { a: string; } >a7 : { a: string; } >a4 : string var rd8 = a8 || a4; // array || string is {} ->rd8 : {} ->a8 || a4 : {} +>rd8 : string | string[] +>a8 || a4 : string | string[] >a8 : string[] >a4 : string @@ -279,20 +279,20 @@ var re1 = a1 || a5; // any || void is any >a5 : void var re2 = a2 || a5; // boolean || void is {} ->re2 : {} ->a2 || a5 : {} +>re2 : boolean | void +>a2 || a5 : boolean | void >a2 : boolean >a5 : void var re3 = a3 || a5; // number || void is {} ->re3 : {} ->a3 || a5 : {} +>re3 : number | void +>a3 || a5 : number | void >a3 : number >a5 : void var re4 = a4 || a5; // string || void is {} ->re4 : {} ->a4 || a5 : {} +>re4 : string | void +>a4 || a5 : string | void >a4 : string >a5 : void @@ -303,20 +303,20 @@ var re5 = a5 || a5; // void || void is void >a5 : void var re6 = a6 || a5; // enum || void is {} ->re6 : {} ->a6 || a5 : {} +>re6 : void | E +>a6 || a5 : void | E >a6 : E >a5 : void var re7 = a7 || a5; // object || void is {} ->re7 : {} ->a7 || a5 : {} +>re7 : void | { a: string; } +>a7 || a5 : void | { a: string; } >a7 : { a: string; } >a5 : void var re8 = a8 || a5; // array || void is {} ->re8 : {} ->a8 || a5 : {} +>re8 : void | string[] +>a8 || a5 : void | string[] >a8 : string[] >a5 : void @@ -338,8 +338,8 @@ var rg1 = a1 || a6; // any || enum is any >a6 : E var rg2 = a2 || a6; // boolean || enum is {} ->rg2 : {} ->a2 || a6 : {} +>rg2 : boolean | E +>a2 || a6 : boolean | E >a2 : boolean >a6 : E @@ -350,14 +350,14 @@ var rg3 = a3 || a6; // number || enum is number >a6 : E var rg4 = a4 || a6; // string || enum is {} ->rg4 : {} ->a4 || a6 : {} +>rg4 : string | E +>a4 || a6 : string | E >a4 : string >a6 : E var rg5 = a5 || a6; // void || enum is {} ->rg5 : {} ->a5 || a6 : {} +>rg5 : void | E +>a5 || a6 : void | E >a5 : void >a6 : E @@ -368,14 +368,14 @@ var rg6 = a6 || a6; // enum || enum is E >a6 : E var rg7 = a7 || a6; // object || enum is {} ->rg7 : {} ->a7 || a6 : {} +>rg7 : E | { a: string; } +>a7 || a6 : E | { a: string; } >a7 : { a: string; } >a6 : E var rg8 = a8 || a6; // array || enum is {} ->rg8 : {} ->a8 || a6 : {} +>rg8 : string[] | E +>a8 || a6 : string[] | E >a8 : string[] >a6 : E @@ -397,32 +397,32 @@ var rh1 = a1 || a7; // any || object is any >a7 : { a: string; } var rh2 = a2 || a7; // boolean || object is {} ->rh2 : {} ->a2 || a7 : {} +>rh2 : boolean | { a: string; } +>a2 || a7 : boolean | { a: string; } >a2 : boolean >a7 : { a: string; } var rh3 = a3 || a7; // number || object is {} ->rh3 : {} ->a3 || a7 : {} +>rh3 : number | { a: string; } +>a3 || a7 : number | { a: string; } >a3 : number >a7 : { a: string; } var rh4 = a4 || a7; // string || object is {} ->rh4 : {} ->a4 || a7 : {} +>rh4 : string | { a: string; } +>a4 || a7 : string | { a: string; } >a4 : string >a7 : { a: string; } var rh5 = a5 || a7; // void || object is {} ->rh5 : {} ->a5 || a7 : {} +>rh5 : void | { a: string; } +>a5 || a7 : void | { a: string; } >a5 : void >a7 : { a: string; } var rh6 = a6 || a7; // enum || object is {} ->rh6 : {} ->a6 || a7 : {} +>rh6 : E | { a: string; } +>a6 || a7 : E | { a: string; } >a6 : E >a7 : { a: string; } @@ -433,8 +433,8 @@ var rh7 = a7 || a7; // object || object is object >a7 : { a: string; } var rh8 = a8 || a7; // array || object is {} ->rh8 : {} ->a8 || a7 : {} +>rh8 : string[] | { a: string; } +>a8 || a7 : string[] | { a: string; } >a8 : string[] >a7 : { a: string; } @@ -456,38 +456,38 @@ var ri1 = a1 || a8; // any || array is any >a8 : string[] var ri2 = a2 || a8; // boolean || array is {} ->ri2 : {} ->a2 || a8 : {} +>ri2 : boolean | string[] +>a2 || a8 : boolean | string[] >a2 : boolean >a8 : string[] var ri3 = a3 || a8; // number || array is {} ->ri3 : {} ->a3 || a8 : {} +>ri3 : number | string[] +>a3 || a8 : number | string[] >a3 : number >a8 : string[] var ri4 = a4 || a8; // string || array is {} ->ri4 : {} ->a4 || a8 : {} +>ri4 : string | string[] +>a4 || a8 : string | string[] >a4 : string >a8 : string[] var ri5 = a5 || a8; // void || array is {} ->ri5 : {} ->a5 || a8 : {} +>ri5 : void | string[] +>a5 || a8 : void | string[] >a5 : void >a8 : string[] var ri6 = a6 || a8; // enum || array is {} ->ri6 : {} ->a6 || a8 : {} +>ri6 : string[] | E +>a6 || a8 : string[] | E >a6 : E >a8 : string[] var ri7 = a7 || a8; // object || array is {} ->ri7 : {} ->a7 || a8 : {} +>ri7 : string[] | { a: string; } +>a7 || a8 : string[] | { a: string; } >a7 : { a: string; } >a8 : string[] diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types index ff0e0ce568a..4008fbbff50 100644 --- a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types @@ -22,14 +22,14 @@ function fn1(t: T, u: U) { >t : T var r3 = t || u; ->r3 : {} ->t || u : {} +>r3 : T | U +>t || u : T | U >t : T >u : U var r4: {} = t || u; >r4 : {} ->t || u : {} +>t || u : T | U >t : T >u : U } @@ -47,8 +47,8 @@ function fn2(t: T, u: U, v: V) { >V : V var r1 = t || u; ->r1 : {} ->t || u : {} +>r1 : T | U +>t || u : T | U >t : T >u : U @@ -67,14 +67,14 @@ function fn2(t: T, u: U, v: V) { >u : U var r5 = u || v; ->r5 : {} ->u || v : {} +>r5 : U | V +>u || v : U | V >u : U >v : V var r6: {} = u || v; >r6 : {} ->u || v : {} +>u || v : U | V >u : U >v : V @@ -95,14 +95,14 @@ function fn3U : U var r1 = t || u; ->r1 : {} ->t || u : {} +>r1 : T | U +>t || u : T | U >t : T >u : U var r2: {} = t || u; >r2 : {} ->t || u : {} +>t || u : T | U >t : T >u : U @@ -116,7 +116,7 @@ function fn3r4 : { a: string; } >a : string ->t || u : { a: string; } +>t || u : T | U >t : T >u : U } diff --git a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt index 0daf93e9391..744ebed7d08 100644 --- a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt +++ b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2322: Type 'number' is not assignable to type 'boolean'. + + ==== tests/cases/compiler/matchReturnTypeInAllBranches.ts (1 errors) ==== // Represents a monster who enjoys ice cream class IceCreamMonster { @@ -30,7 +33,7 @@ { return 12345; ~~~~~ -!!! Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. } } } diff --git a/tests/baselines/reference/matchingOfObjectLiteralConstraints.errors.txt b/tests/baselines/reference/matchingOfObjectLiteralConstraints.errors.txt index 6c9c0f65d19..edd917a4602 100644 --- a/tests/baselines/reference/matchingOfObjectLiteralConstraints.errors.txt +++ b/tests/baselines/reference/matchingOfObjectLiteralConstraints.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/matchingOfObjectLiteralConstraints.ts(1,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/compiler/matchingOfObjectLiteralConstraints.ts (1 errors) ==== function foo2(x: U, z: T) { } ~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo2({ y: "foo" }, "foo"); \ No newline at end of file diff --git a/tests/baselines/reference/maxConstraints.errors.txt b/tests/baselines/reference/maxConstraints.errors.txt index 8a525d1a673..1c3844d6974 100644 --- a/tests/baselines/reference/maxConstraints.errors.txt +++ b/tests/baselines/reference/maxConstraints.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/maxConstraints.ts(5,6): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +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 (2 errors) ==== interface Comparable { compareTo(other: T): number; @@ -5,9 +9,9 @@ interface Comparer { >(x: T, y: T): T; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; var maxResult = max2(1, 2); ~ -!!! Argument of type 'number' is not assignable to parameter of type 'Comparable'. \ No newline at end of file +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. \ No newline at end of file diff --git a/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt index d0b707c9ff1..624438cf054 100644 --- a/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt +++ b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt @@ -1,36 +1,46 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts(3,12): error TS2388: Function overload must not be static. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts(3,12): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts(8,5): error TS2387: Function overload must be static. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts(8,5): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts(13,12): error TS2388: Function overload must not be static. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts(13,12): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts(18,5): error TS2387: Function overload must be static. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts(18,5): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts (8 errors) ==== class C { foo(); static foo(); // error ~~~ -!!! Function overload must not be static. +!!! error TS2388: Function overload must not be static. ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } class D { static foo(); foo(); // error ~~~ -!!! Function overload must be static. +!!! error TS2387: Function overload must be static. ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } class E { foo(x: T); static foo(x: number); // error ~~~ -!!! Function overload must not be static. +!!! error TS2388: Function overload must not be static. ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } class F { static foo(x: number); foo(x: T); // error ~~~ -!!! Function overload must be static. +!!! error TS2387: Function overload must be static. ~~~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/memberFunctionsWithPrivateOverloads.errors.txt b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.errors.txt index 0a84fc1a751..d6c3d4a659c 100644 --- a/tests/baselines/reference/memberFunctionsWithPrivateOverloads.errors.txt +++ b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(43,9): error TS2341: Property 'foo' is private and only accessible within class 'C'. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(46,10): error TS2341: Property 'foo' is private and only accessible within class 'D'. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(48,10): error TS2341: Property 'foo' is private and only accessible within class 'C'. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts(49,10): error TS2341: Property 'bar' is private and only accessible within class 'D'. + + ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts (4 errors) ==== class C { private foo(x: number); @@ -43,16 +49,16 @@ var c: C; var r = c.foo(1); // error ~~~~~ -!!! Property 'C.foo' is inaccessible. +!!! error TS2341: Property 'foo' is private and only accessible within class 'C'. var d: D; var r2 = d.foo(2); // error ~~~~~ -!!! Property 'D.foo' is inaccessible. +!!! error TS2341: Property 'foo' is private and only accessible within class 'D'. var r3 = C.foo(1); // error ~~~~~ -!!! Property 'C.foo' is inaccessible. +!!! error TS2341: Property 'foo' is private and only accessible within class 'C'. var r4 = D.bar(''); // error ~~~~~ -!!! Property 'D.bar' is inaccessible. \ No newline at end of file +!!! error TS2341: Property 'bar' is private and only accessible within class 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.errors.txt b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.errors.txt index 962a00d9534..64d2f3d3059 100644 --- a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.errors.txt +++ b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.errors.txt @@ -1,66 +1,110 @@ -==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts (10 errors) ==== +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(3,12): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(7,12): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(12,19): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(15,15): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(16,15): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(20,19): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(25,19): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(32,12): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(36,12): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(41,15): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(45,19): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(49,19): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(53,19): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(59,9): error TS2341: Property 'foo' is private and only accessible within class 'C'. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts(62,10): error TS2341: Property 'foo' is private and only accessible within class 'D'. + + +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts (15 errors) ==== class C { private foo(x: number); public foo(x: number, y: string); // error ~~~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. private foo(x: any, y?: any) { } private bar(x: 'hi'); public bar(x: string); // error ~~~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. private bar(x: number, y: string); private bar(x: any, y?: any) { } private static foo(x: number); public static foo(x: number, y: string); // error ~~~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. private static foo(x: any, y?: any) { } + protected baz(x: string); // error + ~~~ +!!! error TS2385: Overload signatures must all be public, private or protected. + protected baz(x: number, y: string); // error + ~~~ +!!! error TS2385: Overload signatures must all be public, private or protected. + private baz(x: any, y?: any) { } + private static bar(x: 'hi'); public static bar(x: string); // error ~~~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. private static bar(x: number, y: string); private static bar(x: any, y?: any) { } + + protected static baz(x: 'hi'); + public static baz(x: string); // error + ~~~ +!!! error TS2385: Overload signatures must all be public, private or protected. + protected static baz(x: number, y: string); + protected static baz(x: any, y?: any) { } } class D { private foo(x: number); public foo(x: T, y: T); // error ~~~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. private foo(x: any, y?: any) { } private bar(x: 'hi'); public bar(x: string); // error ~~~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. private bar(x: T, y: T); private bar(x: any, y?: any) { } + private baz(x: string); + protected baz(x: number, y: string); // error + ~~~ +!!! error TS2385: Overload signatures must all be public, private or protected. + private baz(x: any, y?: any) { } + private static foo(x: number); public static foo(x: number, y: string); // error ~~~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. private static foo(x: any, y?: any) { } private static bar(x: 'hi'); public static bar(x: string); // error ~~~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. private static bar(x: number, y: string); private static bar(x: any, y?: any) { } + + public static baz(x: string); // error + ~~~ +!!! error TS2385: Overload signatures must all be public, private or protected. + protected static baz(x: number, y: string); + protected static baz(x: any, y?: any) { } } var c: C; var r = c.foo(1); // error ~~~~~ -!!! Property 'C.foo' is inaccessible. +!!! error TS2341: Property 'foo' is private and only accessible within class 'C'. var d: D; var r2 = d.foo(2); // error ~~~~~ -!!! Property 'D.foo' is inaccessible. \ No newline at end of file +!!! error TS2341: Property 'foo' is private and only accessible within class 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js index 27e3bb5e85d..2726756c803 100644 --- a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js +++ b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js @@ -13,10 +13,19 @@ class C { public static foo(x: number, y: string); // error private static foo(x: any, y?: any) { } + protected baz(x: string); // error + protected baz(x: number, y: string); // error + private baz(x: any, y?: any) { } + private static bar(x: 'hi'); public static bar(x: string); // error private static bar(x: number, y: string); private static bar(x: any, y?: any) { } + + protected static baz(x: 'hi'); + public static baz(x: string); // error + protected static baz(x: number, y: string); + protected static baz(x: any, y?: any) { } } class D { @@ -29,6 +38,10 @@ class D { private bar(x: T, y: T); private bar(x: any, y?: any) { } + private baz(x: string); + protected baz(x: number, y: string); // error + private baz(x: any, y?: any) { } + private static foo(x: number); public static foo(x: number, y: string); // error private static foo(x: any, y?: any) { } @@ -37,6 +50,10 @@ class D { public static bar(x: string); // error private static bar(x: number, y: string); private static bar(x: any, y?: any) { } + + public static baz(x: string); // error + protected static baz(x: number, y: string); + protected static baz(x: any, y?: any) { } } var c: C; @@ -55,8 +72,12 @@ var C = (function () { }; C.foo = function (x, y) { }; + C.prototype.baz = function (x, y) { + }; C.bar = function (x, y) { }; + C.baz = function (x, y) { + }; return C; })(); var D = (function () { @@ -66,10 +87,14 @@ var D = (function () { }; D.prototype.bar = function (x, y) { }; + D.prototype.baz = function (x, y) { + }; D.foo = function (x, y) { }; D.bar = function (x, y) { }; + D.baz = function (x, y) { + }; return D; })(); var c; diff --git a/tests/baselines/reference/memberOverride.errors.txt b/tests/baselines/reference/memberOverride.errors.txt index 4b0b385829e..0fd0fb57e67 100644 --- a/tests/baselines/reference/memberOverride.errors.txt +++ b/tests/baselines/reference/memberOverride.errors.txt @@ -1,13 +1,20 @@ -==== tests/cases/compiler/memberOverride.ts (2 errors) ==== +tests/cases/compiler/memberOverride.ts(4,5): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/memberOverride.ts(5,5): error TS2300: Duplicate identifier 'a'. +tests/cases/compiler/memberOverride.ts(8,5): error TS2322: Type 'string' is not assignable to type 'number'. + + +==== tests/cases/compiler/memberOverride.ts (3 errors) ==== // An object initialiser accepts the first definition for the same property with a different type signature // Should compile, since the second declaration of a overrides the first var x = { a: "", + ~ +!!! error TS2300: Duplicate identifier 'a'. a: 5 ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. } var n: number = x.a; ~ -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/memberScope.errors.txt b/tests/baselines/reference/memberScope.errors.txt index 8c059a077fb..017a28d5f71 100644 --- a/tests/baselines/reference/memberScope.errors.txt +++ b/tests/baselines/reference/memberScope.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/memberScope.ts(4,11): error TS2304: Cannot find name 'Basil'. + + ==== tests/cases/compiler/memberScope.ts (1 errors) ==== module Salt { export class Pepper {} export module Basil { } var z = Basil.Pepper; ~~~~~ -!!! Cannot find name 'Basil'. +!!! error TS2304: Cannot find name 'Basil'. } \ No newline at end of file diff --git a/tests/baselines/reference/memberVariableDeclarations1.types b/tests/baselines/reference/memberVariableDeclarations1.types index 10ec78d69dc..4dd68cdeb35 100644 --- a/tests/baselines/reference/memberVariableDeclarations1.types +++ b/tests/baselines/reference/memberVariableDeclarations1.types @@ -20,7 +20,7 @@ class Employee { public reports: Employee[] = []; >reports : Employee[] >Employee : Employee ->[] : Employee[] +>[] : undefined[] } class Employee2 { @@ -57,11 +57,11 @@ class Employee2 { >manager : Employee this.reports = []; ->this.reports = [] : Employee[] +>this.reports = [] : undefined[] >this.reports : Employee[] >this : Employee2 >reports : Employee[] ->[] : Employee[] +>[] : undefined[] } } diff --git a/tests/baselines/reference/mergedDeclarations2.errors.txt b/tests/baselines/reference/mergedDeclarations2.errors.txt index a7aad4319ea..0b3801872af 100644 --- a/tests/baselines/reference/mergedDeclarations2.errors.txt +++ b/tests/baselines/reference/mergedDeclarations2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/mergedDeclarations2.ts(9,20): error TS2304: Cannot find name 'b'. + + ==== tests/cases/compiler/mergedDeclarations2.ts (1 errors) ==== enum Foo { b @@ -9,5 +12,5 @@ module Foo { export var x = b ~ -!!! Cannot find name 'b'. +!!! error TS2304: Cannot find name 'b'. } \ No newline at end of file diff --git a/tests/baselines/reference/mergedDeclarations3.errors.txt b/tests/baselines/reference/mergedDeclarations3.errors.txt index 38922ad62f7..8478027913b 100644 --- a/tests/baselines/reference/mergedDeclarations3.errors.txt +++ b/tests/baselines/reference/mergedDeclarations3.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/mergedDeclarations3.ts(37,7): error TS2339: Property 'x' does not exist on type 'typeof foo'. +tests/cases/compiler/mergedDeclarations3.ts(39,7): error TS2339: Property 'z' does not exist on type 'typeof foo'. + + ==== tests/cases/compiler/mergedDeclarations3.ts (2 errors) ==== module M { export enum Color { @@ -37,8 +41,8 @@ M.foo() // ok M.foo.x // error ~ -!!! Property 'x' does not exist on type 'typeof foo'. +!!! error TS2339: Property 'x' does not exist on type 'typeof foo'. M.foo.y // ok M.foo.z // error ~ -!!! Property 'z' does not exist on type 'typeof foo'. \ No newline at end of file +!!! error TS2339: Property 'z' does not exist on type 'typeof foo'. \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt index cae2b5a7053..0b5984dcc6d 100644 --- a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt @@ -1,23 +1,35 @@ -==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts (3 errors) ==== +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(2,5): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(11,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(33,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2300: Duplicate identifier 'x'. + + +==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts (6 errors) ==== interface A { x: string; // error + ~ +!!! error TS2300: Duplicate identifier 'x'. } interface A { x: number; ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } module M { interface A { x: T; + ~ +!!! error TS2300: Duplicate identifier 'x'. } interface A { x: number; // error ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } } @@ -36,6 +48,8 @@ module M3 { export interface A { x: T; + ~ +!!! error TS2300: Duplicate identifier 'x'. } } @@ -43,6 +57,6 @@ export interface A { x: number; // error ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } } \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.errors.txt b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.errors.txt index 6c2dd7b657e..d0a50f4ae69 100644 --- a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.errors.txt @@ -1,23 +1,35 @@ -==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts (3 errors) ==== +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(2,5): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(6,5): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(11,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(15,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(33,9): error TS2300: Duplicate identifier 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts(39,9): error TS2300: Duplicate identifier 'x'. + + +==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts (6 errors) ==== interface A { x: string; // error + ~ +!!! error TS2300: Duplicate identifier 'x'. } interface A { x: string; // error ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } module M { interface A { x: T; + ~ +!!! error TS2300: Duplicate identifier 'x'. } interface A { x: T; // error ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } } @@ -36,6 +48,8 @@ module M3 { export interface A { x: T; + ~ +!!! error TS2300: Duplicate identifier 'x'. } } @@ -43,6 +57,6 @@ export interface A { x: T; // error ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. } } \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithIndexers2.errors.txt b/tests/baselines/reference/mergedInterfacesWithIndexers2.errors.txt index 89209f1a4dd..768abc0f9c0 100644 --- a/tests/baselines/reference/mergedInterfacesWithIndexers2.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithIndexers2.errors.txt @@ -1,10 +1,15 @@ +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithIndexers2.ts(4,5): error TS2413: Numeric index type 'string' is not assignable to string index type '{ length: string; }'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithIndexers2.ts(14,5): error TS2411: Property ''a'' of type 'number' is not assignable to string index type '{ length: number; }'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithIndexers2.ts(20,5): error TS2412: Property '1' of type '{ length: number; }' is not assignable to numeric index type 'string'. + + ==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithIndexers2.ts (3 errors) ==== // indexers should behave like other members when merging interface declarations interface A { [x: number]: string; // error ~~~~~~~~~~~~~~~~~~~~ -!!! Numeric index type 'string' is not assignable to string index type '{ length: string; }'. +!!! error TS2413: Numeric index type 'string' is not assignable to string index type '{ length: string; }'. } @@ -16,7 +21,7 @@ [x: number]: string; 'a': number; //error ~~~~~~~~~~~~ -!!! Property ''a'' of type 'number' is not assignable to string index type '{ length: number; }'. +!!! error TS2411: Property ''a'' of type 'number' is not assignable to string index type '{ length: number; }'. } @@ -24,6 +29,6 @@ [x: string]: { length: number }; 1: { length: number }; // error ~~~~~~~~~~~~~~~~~~~~~~ -!!! Property '1' of type '{ length: number; }' is not assignable to numeric index type 'string'. +!!! error TS2412: Property '1' of type '{ length: number; }' is not assignable to numeric index type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt index 3ad843c7f17..92d4cb17e72 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt @@ -1,3 +1,10 @@ +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(13,7): error TS2420: Class 'D' incorrectly implements interface 'A'. + Types have separate declarations of a private property 'x'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(19,7): error TS2420: Class 'E' incorrectly implements interface 'A'. + Property 'x' is private in type 'A' but not in type 'E'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(26,9): error TS2341: Property 'x' is private and only accessible within class 'C'. + + ==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts (3 errors) ==== class C { private x: number; @@ -13,8 +20,8 @@ class D implements A { // error ~ -!!! Class 'D' incorrectly implements interface 'A': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'D' incorrectly implements interface 'A'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x: number; y: string; z: string; @@ -22,8 +29,8 @@ class E implements A { // error ~ -!!! Class 'E' incorrectly implements interface 'A': -!!! Private property 'x' cannot be reimplemented. +!!! error TS2420: Class 'E' incorrectly implements interface 'A'. +!!! error TS2420: Property 'x' is private in type 'A' but not in type 'E'. x: number; y: string; z: string; @@ -32,4 +39,4 @@ var a: A; var r = a.x; // error ~~~ -!!! Property 'C.x' is inaccessible. \ No newline at end of file +!!! error TS2341: Property 'x' is private and only accessible within class 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt index 7ab40587207..8fc1f0fe819 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(17,7): error TS2420: Class 'D' incorrectly implements interface 'A'. + Types have separate declarations of a private property 'w'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2415: Class 'E' incorrectly extends base class 'C2'. + Property 'w' is private in type 'C2' but not in type 'E'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2420: Class 'E' incorrectly implements interface 'A'. + Property 'x' is missing in type 'E'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(30,9): error TS2341: Property 'x' is private and only accessible within class 'C'. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(31,10): error TS2341: Property 'w' is private and only accessible within class 'C2'. + + ==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts (5 errors) ==== class C { private x: number; @@ -17,8 +27,8 @@ class D extends C implements A { // error ~ -!!! Class 'D' incorrectly implements interface 'A': -!!! Private property 'w' cannot be reimplemented. +!!! error TS2420: Class 'D' incorrectly implements interface 'A'. +!!! error TS2420: Types have separate declarations of a private property 'w'. private w: number; y: string; z: string; @@ -26,11 +36,11 @@ class E extends C2 implements A { // error ~ -!!! Class 'E' incorrectly extends base class 'C2': -!!! Private property 'w' cannot be reimplemented. +!!! error TS2415: Class 'E' incorrectly extends base class 'C2'. +!!! error TS2415: Property 'w' is private in type 'C2' but not in type 'E'. ~ -!!! Class 'E' incorrectly implements interface 'A': -!!! Property 'x' is missing in type 'E'. +!!! error TS2420: Class 'E' incorrectly implements interface 'A'. +!!! error TS2420: Property 'x' is missing in type 'E'. w: number; y: string; z: string; @@ -39,7 +49,7 @@ var a: A; var r = a.x; // error ~~~ -!!! Property 'C.x' is inaccessible. +!!! error TS2341: Property 'x' is private and only accessible within class 'C'. var r2 = a.w; // error ~~~ -!!! Property 'C2.w' is inaccessible. \ No newline at end of file +!!! error TS2341: Property 'w' is private and only accessible within class 'C2'. \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt index 9956bb45dc8..4c49e6beb0c 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. + Named properties 'x' of types 'C' and 'C2' are not identical. +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(31,15): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. + Named properties 'x' of types 'C' and 'C2' are not identical. + + ==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts (2 errors) ==== class C { private x: number; @@ -9,8 +15,8 @@ interface A extends C { // error ~ -!!! Interface 'A' cannot simultaneously extend types 'C' and 'C2': -!!! Named properties 'x' of types 'C' and 'C2' are not identical. +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. +!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } @@ -34,8 +40,8 @@ interface A extends C { // error, privates conflict ~ -!!! Interface 'A' cannot simultaneously extend types 'C' and 'C2': -!!! Named properties 'x' of types 'C' and 'C2' are not identical. +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. +!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt index 76f837f8369..1e11dc792f1 100644 --- a/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts(19,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C'. + Named properties 'a' of types 'C' and 'C' are not identical. + + ==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts (1 errors) ==== // merged interfaces behave as if all extends clauses from each declaration are merged together @@ -19,8 +23,8 @@ interface A extends C, C3 { // error ~ -!!! Interface 'A' cannot simultaneously extend types 'C' and 'C': -!!! Named properties 'a' of types 'C' and 'C' are not identical. +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C'. +!!! error TS2320: Named properties 'a' of types 'C' and 'C' are not identical. y: T; } diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt b/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt index 3cf329d427c..25000ce2f5c 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/mergedModuleDeclarationCodeGen.ts(1,15): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/compiler/mergedModuleDeclarationCodeGen.ts (1 errors) ==== export module X { ~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. export module Y { class A { constructor(Y: any) { diff --git a/tests/baselines/reference/methodInAmbientClass1.errors.txt b/tests/baselines/reference/methodInAmbientClass1.errors.txt new file mode 100644 index 00000000000..3bf8f8af12a --- /dev/null +++ b/tests/baselines/reference/methodInAmbientClass1.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/methodInAmbientClass1.ts(2,12): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + + +==== tests/cases/compiler/methodInAmbientClass1.ts (2 errors) ==== + declare class Foo { + fn(): boolean { + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~~~~~ +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/methodSignaturesWithOverloads.errors.txt b/tests/baselines/reference/methodSignaturesWithOverloads.errors.txt index f41e12db995..57b70489415 100644 --- a/tests/baselines/reference/methodSignaturesWithOverloads.errors.txt +++ b/tests/baselines/reference/methodSignaturesWithOverloads.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads.ts(5,5): error TS2386: Overload signatures must all be optional or required. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads.ts(14,5): error TS2386: Overload signatures must all be optional or required. + + ==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads.ts (2 errors) ==== // Object type literals permit overloads with optionality but they must match @@ -5,7 +9,7 @@ func4?(x: number): number; func4(s: string): string; // error, mismatched optionality ~~~~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. func5?: { (x: number): number; (s: string): string; @@ -16,7 +20,7 @@ func4(x: T): number; func4? (s: T): string; // error, mismatched optionality ~~~~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. func5?: { (x: T): number; (s: T): string; diff --git a/tests/baselines/reference/mismatchedClassConstructorVariable.errors.txt b/tests/baselines/reference/mismatchedClassConstructorVariable.errors.txt index 450717d5124..8c81f7e34c8 100644 --- a/tests/baselines/reference/mismatchedClassConstructorVariable.errors.txt +++ b/tests/baselines/reference/mismatchedClassConstructorVariable.errors.txt @@ -1,6 +1,12 @@ -==== tests/cases/compiler/mismatchedClassConstructorVariable.ts (1 errors) ==== +tests/cases/compiler/mismatchedClassConstructorVariable.ts(1,5): error TS2300: Duplicate identifier 'baz'. +tests/cases/compiler/mismatchedClassConstructorVariable.ts(2,7): error TS2300: Duplicate identifier 'baz'. + + +==== tests/cases/compiler/mismatchedClassConstructorVariable.ts (2 errors) ==== var baz: foo; + ~~~ +!!! error TS2300: Duplicate identifier 'baz'. class baz { } ~~~ -!!! Duplicate identifier 'baz'. +!!! error TS2300: Duplicate identifier 'baz'. class foo { } \ No newline at end of file diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt index 6e2647bc45d..2fb7bd1bfbb 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(10,30): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,11): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts (2 errors) ==== function map(xs: T[], f: (x: T) => U) { var ys: U[] = []; @@ -10,9 +16,10 @@ var r6 = map([1, ""], (x) => x.toString()); var r7 = map([1, ""], (x) => x.toString()); // error ~~~~~~~ -!!! Argument of type '{}[]' is not assignable to parameter of type 'number[]'. -!!! Type '{}' is not assignable to type 'number'. +!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. +!!! error TS2345: Type 'string' is not assignable to type 'number'. var r7b = map([1, ""], (x) => x.toString()); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. var r8 = map([1, ""], (x) => x.toString()); \ No newline at end of file diff --git a/tests/baselines/reference/missingArgument1.errors.txt b/tests/baselines/reference/missingArgument1.errors.txt new file mode 100644 index 00000000000..02911e3c9b5 --- /dev/null +++ b/tests/baselines/reference/missingArgument1.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/missingArgument1.ts(1,7): error TS1135: Argument expression expected. +tests/cases/compiler/missingArgument1.ts(1,1): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/missingArgument1.ts(1,5): error TS2304: Cannot find name 'a'. +tests/cases/compiler/missingArgument1.ts(1,8): error TS2304: Cannot find name 'b'. + + +==== tests/cases/compiler/missingArgument1.ts (4 errors) ==== + foo(a,,b); + +!!! error TS1135: Argument expression expected. + ~~~ +!!! error TS2304: Cannot find name 'foo'. + ~ +!!! error TS2304: Cannot find name 'a'. + ~ +!!! error TS2304: Cannot find name 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/missingRequiredDeclare.d.errors.txt b/tests/baselines/reference/missingRequiredDeclare.d.errors.txt index 932512ba8d8..1e52fa92fe5 100644 --- a/tests/baselines/reference/missingRequiredDeclare.d.errors.txt +++ b/tests/baselines/reference/missingRequiredDeclare.d.errors.txt @@ -1,6 +1,7 @@ -==== tests/cases/compiler/missingRequiredDeclare.d.ts (2 errors) ==== +tests/cases/compiler/missingRequiredDeclare.d.ts(1,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. + + +==== tests/cases/compiler/missingRequiredDeclare.d.ts (1 errors) ==== var x = 1; ~~~ -!!! A 'declare' modifier is required for a top level declaration in a .d.ts file. - ~ -!!! Initializers are not allowed in ambient contexts. \ No newline at end of file +!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. \ No newline at end of file diff --git a/tests/baselines/reference/missingReturnStatement.errors.txt b/tests/baselines/reference/missingReturnStatement.errors.txt index 9a92adf4c03..c7cedd793de 100644 --- a/tests/baselines/reference/missingReturnStatement.errors.txt +++ b/tests/baselines/reference/missingReturnStatement.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/missingReturnStatement.ts(3,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + + ==== tests/cases/compiler/missingReturnStatement.ts (1 errors) ==== module Test { export class Bug { public foo():string { ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. } } } diff --git a/tests/baselines/reference/missingReturnStatement1.errors.txt b/tests/baselines/reference/missingReturnStatement1.errors.txt index d1d47368bb1..de471f90ac4 100644 --- a/tests/baselines/reference/missingReturnStatement1.errors.txt +++ b/tests/baselines/reference/missingReturnStatement1.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/missingReturnStatement1.ts(2,12): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + + ==== tests/cases/compiler/missingReturnStatement1.ts (1 errors) ==== class Foo { foo(): number { ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. //return 4; } } diff --git a/tests/baselines/reference/missingTypeArguments1.errors.txt b/tests/baselines/reference/missingTypeArguments1.errors.txt index 87bb648a751..c0e0f3e18bb 100644 --- a/tests/baselines/reference/missingTypeArguments1.errors.txt +++ b/tests/baselines/reference/missingTypeArguments1.errors.txt @@ -1,73 +1,85 @@ +tests/cases/compiler/missingTypeArguments1.ts(4,15): error TS2314: Generic type 'X' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments1.ts(9,26): error TS2314: Generic type 'X2' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments1.ts(14,9): error TS2314: Generic type 'X3' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments1.ts(19,11): error TS2314: Generic type 'X4' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments1.ts(24,9): error TS2314: Generic type 'X5' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments1.ts(29,15): error TS2314: Generic type 'Y' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments1.ts(34,26): error TS2314: Generic type 'Y' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments1.ts(39,9): error TS2314: Generic type 'Y' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments1.ts(44,11): error TS2314: Generic type 'Y' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments1.ts(49,9): error TS2314: Generic type 'Y' requires 1 type argument(s). + + ==== tests/cases/compiler/missingTypeArguments1.ts (10 errors) ==== interface I { } class Y {} class X { p1: () => X; ~ -!!! Generic type 'X' requires 1 type argument(s). +!!! error TS2314: Generic type 'X' requires 1 type argument(s). } var a: X; class X2 { p2: { [idx: number]: X2 } ~~ -!!! Generic type 'X2' requires 1 type argument(s). +!!! error TS2314: Generic type 'X2' requires 1 type argument(s). } var a2: X2; class X3 { p3: X3[] ~~ -!!! Generic type 'X3' requires 1 type argument(s). +!!! error TS2314: Generic type 'X3' requires 1 type argument(s). } var a3: X3; class X4 { p4: I ~~ -!!! Generic type 'X4' requires 1 type argument(s). +!!! error TS2314: Generic type 'X4' requires 1 type argument(s). } var a4: X4; class X5 { p5: X5 ~~ -!!! Generic type 'X5' requires 1 type argument(s). +!!! error TS2314: Generic type 'X5' requires 1 type argument(s). } var a5: X5; class X6 { p6: () => Y; ~ -!!! Generic type 'Y' requires 1 type argument(s). +!!! error TS2314: Generic type 'Y' requires 1 type argument(s). } var a6: X6; class X7 { p7: { [idx: number]: Y } ~ -!!! Generic type 'Y' requires 1 type argument(s). +!!! error TS2314: Generic type 'Y' requires 1 type argument(s). } var a7: X7; class X8 { p8: Y[] ~ -!!! Generic type 'Y' requires 1 type argument(s). +!!! error TS2314: Generic type 'Y' requires 1 type argument(s). } var a8: X8; class X9 { p9: I ~ -!!! Generic type 'Y' requires 1 type argument(s). +!!! error TS2314: Generic type 'Y' requires 1 type argument(s). } var a9: X9; class X10 { pa: Y ~ -!!! Generic type 'Y' requires 1 type argument(s). +!!! error TS2314: Generic type 'Y' requires 1 type argument(s). } var a10: X10; diff --git a/tests/baselines/reference/missingTypeArguments2.errors.txt b/tests/baselines/reference/missingTypeArguments2.errors.txt index 34daf27e841..0b51f40c1ed 100644 --- a/tests/baselines/reference/missingTypeArguments2.errors.txt +++ b/tests/baselines/reference/missingTypeArguments2.errors.txt @@ -1,15 +1,21 @@ +tests/cases/compiler/missingTypeArguments2.ts(3,14): error TS2314: Generic type 'A' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments2.ts(4,5): error TS2314: Generic type 'A' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments2.ts(5,10): error TS2314: Generic type 'A' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments2.ts(6,5): error TS2314: Generic type 'A' requires 1 type argument(s). + + ==== tests/cases/compiler/missingTypeArguments2.ts (4 errors) ==== class A { } var x: () => A; ~ -!!! Generic type 'A' requires 1 type argument(s). +!!! error TS2314: Generic type 'A' requires 1 type argument(s). (a: A) => { }; ~ -!!! Generic type 'A' requires 1 type argument(s). +!!! error TS2314: Generic type 'A' requires 1 type argument(s). var y: A; ~ -!!! Generic type 'A' requires 1 type argument(s). +!!! error TS2314: Generic type 'A' requires 1 type argument(s). (): A => null; ~ -!!! Generic type 'A' requires 1 type argument(s). \ No newline at end of file +!!! error TS2314: Generic type 'A' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt b/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt index 300d9d0309f..96000c73536 100644 --- a/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt +++ b/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/mixingStaticAndInstanceOverloads.ts(5,12): error TS2388: Function overload must not be static. +tests/cases/compiler/mixingStaticAndInstanceOverloads.ts(11,5): error TS2387: Function overload must be static. +tests/cases/compiler/mixingStaticAndInstanceOverloads.ts(16,12): error TS2388: Function overload must not be static. +tests/cases/compiler/mixingStaticAndInstanceOverloads.ts(17,5): error TS2387: Function overload must be static. +tests/cases/compiler/mixingStaticAndInstanceOverloads.ts(22,5): error TS2387: Function overload must be static. +tests/cases/compiler/mixingStaticAndInstanceOverloads.ts(23,12): error TS2388: Function overload must not be static. + + ==== tests/cases/compiler/mixingStaticAndInstanceOverloads.ts (6 errors) ==== class C1 { // ERROR @@ -5,7 +13,7 @@ foo1(s: string); static foo1(a) { } ~~~~ -!!! Function overload must not be static. +!!! error TS2388: Function overload must not be static. } class C2 { // ERROR @@ -13,27 +21,27 @@ static foo2(s: string); foo2(a) { } ~~~~ -!!! Function overload must be static. +!!! error TS2387: Function overload must be static. } class C3 { // ERROR foo3(n: number); static foo3(s: string); ~~~~ -!!! Function overload must not be static. +!!! error TS2388: Function overload must not be static. foo3(a) { } ~~~~ -!!! Function overload must be static. +!!! error TS2387: Function overload must be static. } class C4 { // ERROR static foo4(n: number); foo4(s: string); ~~~~ -!!! Function overload must be static. +!!! error TS2387: Function overload must be static. static foo4(a) { } ~~~~ -!!! Function overload must not be static. +!!! error TS2388: Function overload must not be static. } class C5 { // OK diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt b/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt index 32368edf110..f69ff4d5cca 100644 --- a/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt +++ b/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/moduleAndInterfaceSharingName2.ts(8,9): error TS2315: Type 'Y' is not generic. + + ==== tests/cases/compiler/moduleAndInterfaceSharingName2.ts (1 errors) ==== module X { export module Y { @@ -8,4 +11,4 @@ var z: X.Y.Z = null; var z2: X.Y; ~~~~~~~~~~~ -!!! Type 'Y' is not generic. \ No newline at end of file +!!! error TS2315: Type 'Y' is not generic. \ No newline at end of file diff --git a/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt b/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt index 7f8ffb11a01..60f36b92093 100644 --- a/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt +++ b/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/moduleAndInterfaceWithSameName.ts(21,15): error TS2339: Property 'Bar' does not exist on type 'typeof Foo2'. + + ==== tests/cases/compiler/moduleAndInterfaceWithSameName.ts (1 errors) ==== module Foo1 { export module Bar { @@ -21,7 +24,7 @@ var z2 = Foo2.Bar.y; // Error for using interface name as a value. ~~~ -!!! Property 'Bar' does not exist on type 'typeof Foo2'. +!!! error TS2339: Property 'Bar' does not exist on type 'typeof Foo2'. module Foo3 { export module Bar { diff --git a/tests/baselines/reference/moduleAsBaseType.errors.txt b/tests/baselines/reference/moduleAsBaseType.errors.txt index 942efd23811..ffa30ad0ab3 100644 --- a/tests/baselines/reference/moduleAsBaseType.errors.txt +++ b/tests/baselines/reference/moduleAsBaseType.errors.txt @@ -1,11 +1,16 @@ +tests/cases/compiler/moduleAsBaseType.ts(2,17): error TS2304: Cannot find name 'M'. +tests/cases/compiler/moduleAsBaseType.ts(3,21): error TS2304: Cannot find name 'M'. +tests/cases/compiler/moduleAsBaseType.ts(4,21): error TS2304: Cannot find name 'M'. + + ==== tests/cases/compiler/moduleAsBaseType.ts (3 errors) ==== module M {} class C extends M {} ~ -!!! Cannot find name 'M'. +!!! error TS2304: Cannot find name 'M'. interface I extends M { } ~ -!!! Cannot find name 'M'. +!!! error TS2304: Cannot find name 'M'. class C2 implements M { } ~ -!!! Cannot find name 'M'. \ No newline at end of file +!!! error TS2304: Cannot find name 'M'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleAssignmentCompat1.errors.txt b/tests/baselines/reference/moduleAssignmentCompat1.errors.txt index b23e908c086..5b4fe8d3c7c 100644 --- a/tests/baselines/reference/moduleAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/moduleAssignmentCompat1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/moduleAssignmentCompat1.ts(9,8): error TS2304: Cannot find name 'A'. +tests/cases/compiler/moduleAssignmentCompat1.ts(10,8): error TS2304: Cannot find name 'B'. + + ==== tests/cases/compiler/moduleAssignmentCompat1.ts (2 errors) ==== module A { export class C { } @@ -9,10 +13,10 @@ var a: A; ~ -!!! Cannot find name 'A'. +!!! error TS2304: Cannot find name 'A'. var b: B; ~ -!!! Cannot find name 'B'. +!!! error TS2304: Cannot find name 'B'. // no error a = b; diff --git a/tests/baselines/reference/moduleAssignmentCompat2.errors.txt b/tests/baselines/reference/moduleAssignmentCompat2.errors.txt index 9e6e1421685..5a14ff03ead 100644 --- a/tests/baselines/reference/moduleAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/moduleAssignmentCompat2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/moduleAssignmentCompat2.ts(9,8): error TS2304: Cannot find name 'A'. +tests/cases/compiler/moduleAssignmentCompat2.ts(10,8): error TS2304: Cannot find name 'B'. + + ==== tests/cases/compiler/moduleAssignmentCompat2.ts (2 errors) ==== module A { export class C { } @@ -9,10 +13,10 @@ var a: A; ~ -!!! Cannot find name 'A'. +!!! error TS2304: Cannot find name 'A'. var b: B; ~ -!!! Cannot find name 'B'. +!!! error TS2304: Cannot find name 'B'. a = b; b = a; // error \ No newline at end of file diff --git a/tests/baselines/reference/moduleAssignmentCompat3.errors.txt b/tests/baselines/reference/moduleAssignmentCompat3.errors.txt index c7f5b293da9..656fad20a7e 100644 --- a/tests/baselines/reference/moduleAssignmentCompat3.errors.txt +++ b/tests/baselines/reference/moduleAssignmentCompat3.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/moduleAssignmentCompat3.ts(8,8): error TS2304: Cannot find name 'A'. +tests/cases/compiler/moduleAssignmentCompat3.ts(9,8): error TS2304: Cannot find name 'B'. + + ==== tests/cases/compiler/moduleAssignmentCompat3.ts (2 errors) ==== module A { export var x = 1; @@ -8,10 +12,10 @@ var a: A; ~ -!!! Cannot find name 'A'. +!!! error TS2304: Cannot find name 'A'. var b: B; ~ -!!! Cannot find name 'B'. +!!! error TS2304: Cannot find name 'B'. // both errors a = b; diff --git a/tests/baselines/reference/moduleAssignmentCompat4.errors.txt b/tests/baselines/reference/moduleAssignmentCompat4.errors.txt index 02b7b9531c8..7d6204b53e1 100644 --- a/tests/baselines/reference/moduleAssignmentCompat4.errors.txt +++ b/tests/baselines/reference/moduleAssignmentCompat4.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/moduleAssignmentCompat4.ts(12,8): error TS2304: Cannot find name 'A'. +tests/cases/compiler/moduleAssignmentCompat4.ts(13,8): error TS2304: Cannot find name 'B'. + + ==== tests/cases/compiler/moduleAssignmentCompat4.ts (2 errors) ==== module A { export module M { @@ -12,10 +16,10 @@ var a: A; ~ -!!! Cannot find name 'A'. +!!! error TS2304: Cannot find name 'A'. var b: B; ~ -!!! Cannot find name 'B'. +!!! error TS2304: Cannot find name 'B'. a = b; b = a; // error \ No newline at end of file diff --git a/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt b/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt index 583d88c0b8b..3e52f51445d 100644 --- a/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt +++ b/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/moduleClassArrayCodeGenTest.ts(10,9): error TS2305: Module 'M' has no exported member 'B'. + + ==== tests/cases/compiler/moduleClassArrayCodeGenTest.ts (1 errors) ==== // Invalid code gen for Array of Module class @@ -10,4 +13,4 @@ var t: M.A[] = []; var t2: M.B[] = []; ~~~ -!!! Module 'M' has no exported member 'B'. \ No newline at end of file +!!! error TS2305: Module 'M' has no exported member 'B'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleCrashBug1.errors.txt b/tests/baselines/reference/moduleCrashBug1.errors.txt index 8f25fce0c20..e50e2a1c3e6 100644 --- a/tests/baselines/reference/moduleCrashBug1.errors.txt +++ b/tests/baselines/reference/moduleCrashBug1.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/moduleCrashBug1.ts(18,9): error TS2304: Cannot find name '_modes'. + + ==== tests/cases/compiler/moduleCrashBug1.ts (1 errors) ==== module _modes { export interface IMode { @@ -18,7 +21,7 @@ var m : _modes; ~~~~~~ -!!! Cannot find name '_modes'. +!!! error TS2304: Cannot find name '_modes'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleExports1.errors.txt b/tests/baselines/reference/moduleExports1.errors.txt index e890f149c7f..18b65654cea 100644 --- a/tests/baselines/reference/moduleExports1.errors.txt +++ b/tests/baselines/reference/moduleExports1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/moduleExports1.ts(13,6): error TS2304: Cannot find name 'module'. +tests/cases/compiler/moduleExports1.ts(13,22): error TS2304: Cannot find name 'module'. + + ==== tests/cases/compiler/moduleExports1.ts (2 errors) ==== export module TypeScript.Strasse.Street { export class Rue { @@ -13,6 +17,6 @@ if (!module.exports) module.exports = ""; ~~~~~~ -!!! Cannot find name 'module'. +!!! error TS2304: Cannot find name 'module'. ~~~~~~ -!!! Cannot find name 'module'. \ No newline at end of file +!!! error TS2304: Cannot find name 'module'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleImport.errors.txt b/tests/baselines/reference/moduleImport.errors.txt index 9a4e57bdc06..95163ef119f 100644 --- a/tests/baselines/reference/moduleImport.errors.txt +++ b/tests/baselines/reference/moduleImport.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/moduleImport.ts(2,2): error TS2305: Module 'X' has no exported member 'Y'. + + ==== tests/cases/compiler/moduleImport.ts (1 errors) ==== module A.B.C { import XYZ = X.Y.Z; ~~~~~~~~~~~~~~~~~~~ -!!! Module 'X' has no exported member 'Y'. +!!! error TS2305: Module 'X' has no exported member 'Y'. export function ping(x: number) { if (x>0) XYZ.pong (x-1); } diff --git a/tests/baselines/reference/moduleInTypePosition1.errors.txt b/tests/baselines/reference/moduleInTypePosition1.errors.txt index 7941093c10c..a5b5076e172 100644 --- a/tests/baselines/reference/moduleInTypePosition1.errors.txt +++ b/tests/baselines/reference/moduleInTypePosition1.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/moduleInTypePosition1_1.ts(3,14): error TS2304: Cannot find name 'WinJS'. + + ==== tests/cases/compiler/moduleInTypePosition1_1.ts (1 errors) ==== /// import WinJS = require('moduleInTypePosition1_0'); var x = (w1: WinJS) => { }; ~~~~~ -!!! Cannot find name 'WinJS'. +!!! error TS2304: Cannot find name 'WinJS'. ==== tests/cases/compiler/moduleInTypePosition1_0.ts (0 errors) ==== export class Promise { diff --git a/tests/baselines/reference/moduleKeywordRepeatError.errors.txt b/tests/baselines/reference/moduleKeywordRepeatError.errors.txt index 33bb480291f..d3f5924e193 100644 --- a/tests/baselines/reference/moduleKeywordRepeatError.errors.txt +++ b/tests/baselines/reference/moduleKeywordRepeatError.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/moduleKeywordRepeatError.ts(3,15): error TS1005: ';' expected. +tests/cases/compiler/moduleKeywordRepeatError.ts(3,1): error TS2304: Cannot find name 'module'. + + ==== tests/cases/compiler/moduleKeywordRepeatError.ts (2 errors) ==== // "module.module { }" should raise a syntax error module.module { } ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~ -!!! Cannot find name 'module'. \ No newline at end of file +!!! error TS2304: Cannot find name 'module'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleNewExportBug.errors.txt b/tests/baselines/reference/moduleNewExportBug.errors.txt index dd89b135bdd..829fe83ae7b 100644 --- a/tests/baselines/reference/moduleNewExportBug.errors.txt +++ b/tests/baselines/reference/moduleNewExportBug.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/moduleNewExportBug.ts(10,9): error TS2305: Module 'mod1' has no exported member 'C'. + + ==== tests/cases/compiler/moduleNewExportBug.ts (1 errors) ==== module mod1 { interface mInt { @@ -10,7 +13,7 @@ var c : mod1.C; // ERROR: C should not be visible ~~~~~~ -!!! Module 'mod1' has no exported member 'C'. +!!! error TS2305: Module 'mod1' has no exported member 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleProperty1.errors.txt b/tests/baselines/reference/moduleProperty1.errors.txt index 00ff0248b3f..65180c1d64b 100644 --- a/tests/baselines/reference/moduleProperty1.errors.txt +++ b/tests/baselines/reference/moduleProperty1.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/moduleProperty1.ts(9,5): error TS1128: Declaration or statement expected. +tests/cases/compiler/moduleProperty1.ts(9,13): error TS2304: Cannot find name 'y'. +tests/cases/compiler/moduleProperty1.ts(10,20): error TS2304: Cannot find name 'y'. + + ==== tests/cases/compiler/moduleProperty1.ts (3 errors) ==== module M { var x=10; // variable local to this module body @@ -9,10 +14,10 @@ var x = 10; // variable local to this module body private y = x; // can't use private in modules ~~~~~~~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. ~ -!!! Cannot find name 'y'. +!!! error TS2304: Cannot find name 'y'. export var z = y; // property visible to any code ~ -!!! Cannot find name 'y'. +!!! error TS2304: Cannot find name 'y'. } \ No newline at end of file diff --git a/tests/baselines/reference/moduleProperty2.errors.txt b/tests/baselines/reference/moduleProperty2.errors.txt index 8b658f7692a..7bb1cce608b 100644 --- a/tests/baselines/reference/moduleProperty2.errors.txt +++ b/tests/baselines/reference/moduleProperty2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/moduleProperty2.ts(7,15): error TS2304: Cannot find name 'x'. +tests/cases/compiler/moduleProperty2.ts(12,17): error TS2339: Property 'y' does not exist on type 'typeof M'. + + ==== tests/cases/compiler/moduleProperty2.ts (2 errors) ==== module M { function f() { @@ -7,13 +11,13 @@ export var z; var test1=x; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. var test2=y; // y visible because same module } module N { var test3=M.y; // nope y private property of M ~ -!!! Property 'y' does not exist on type 'typeof M'. +!!! error TS2339: Property 'y' does not exist on type 'typeof M'. var test4=M.z; // ok public property of M } \ No newline at end of file diff --git a/tests/baselines/reference/moduleScoping.errors.txt b/tests/baselines/reference/moduleScoping.errors.txt index d80f82e9443..1468d3e33bf 100644 --- a/tests/baselines/reference/moduleScoping.errors.txt +++ b/tests/baselines/reference/moduleScoping.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/externalModules/file3.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/conformance/externalModules/file1.ts (0 errors) ==== var v1 = "sausages"; // Global scope @@ -8,7 +11,7 @@ ==== tests/cases/conformance/externalModules/file3.ts (1 errors) ==== export var v3 = true; ~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. var v2 = [1,2,3]; // Module scope. Should not appear in global scope ==== tests/cases/conformance/externalModules/file4.ts (0 errors) ==== diff --git a/tests/baselines/reference/moduleVisibilityTest2.errors.txt b/tests/baselines/reference/moduleVisibilityTest2.errors.txt index bed0b43505b..9620b48cdfb 100644 --- a/tests/baselines/reference/moduleVisibilityTest2.errors.txt +++ b/tests/baselines/reference/moduleVisibilityTest2.errors.txt @@ -1,3 +1,11 @@ +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,14): error TS2305: Module 'M' has no exported member 'I'. +tests/cases/compiler/moduleVisibilityTest2.ts(61,21): error TS2305: Module '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'. + + ==== tests/cases/compiler/moduleVisibilityTest2.ts (6 errors) ==== @@ -57,25 +65,25 @@ module M { export var c = x; ~ -!!! Cannot find name 'x'. +!!! error TS2304: Cannot find name 'x'. export var meb = M.E.B; ~ -!!! Property 'E' does not exist on type 'typeof M'. +!!! error TS2339: Property 'E' does not exist on type 'typeof M'. } var cprime : M.I = null; ~~~ -!!! Module 'M' has no exported member 'I'. +!!! error TS2305: Module 'M' has no exported member 'I'. ~~~ -!!! Module 'M' has no exported member 'I'. +!!! error TS2305: Module 'M' has no exported member 'I'. var c = new M.C(); var z = M.x; ~ -!!! Property 'x' does not exist on type 'typeof M'. +!!! error TS2339: Property 'x' does not exist on type 'typeof M'. var alpha = M.E.A; ~ -!!! Property 'E' does not exist on type 'typeof M'. +!!! error TS2339: Property 'E' does not exist on type 'typeof M'. var omega = M.exported_var; c.someMethodThatCallsAnOuterMethod(); \ No newline at end of file diff --git a/tests/baselines/reference/moduleVisibilityTest3.errors.txt b/tests/baselines/reference/moduleVisibilityTest3.errors.txt index d13c597d6ce..581d96fc1df 100644 --- a/tests/baselines/reference/moduleVisibilityTest3.errors.txt +++ b/tests/baselines/reference/moduleVisibilityTest3.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/moduleVisibilityTest3.ts(20,22): error TS2304: Cannot find name 'modes'. +tests/cases/compiler/moduleVisibilityTest3.ts(20,33): error TS2305: Module '_modes' has no exported member 'Mode'. +tests/cases/compiler/moduleVisibilityTest3.ts(21,16): error TS2305: Module '_modes' has no exported member 'Mode'. + + ==== tests/cases/compiler/moduleVisibilityTest3.ts (3 errors) ==== module _modes { export interface IMode { @@ -20,12 +25,12 @@ class Bug { constructor(p1: modes, p2: modes.Mode) {// should be an error on p2 - it's not exported ~~~~~ -!!! Cannot find name 'modes'. +!!! error TS2304: Cannot find name 'modes'. ~~~~~~~~~~ -!!! Module '_modes' has no exported member 'Mode'. +!!! error TS2305: Module '_modes' has no exported member 'Mode'. var x:modes.Mode; ~~~~~~~~~~ -!!! Module '_modes' has no exported member 'Mode'. +!!! error TS2305: Module '_modes' has no exported member 'Mode'. } } diff --git a/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt b/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt index e22bdb1c7f2..c387f5d62f4 100644 --- a/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt +++ b/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt @@ -1,15 +1,20 @@ +tests/cases/compiler/moduleWithNoValuesAsType.ts(2,8): error TS2304: Cannot find name 'A'. +tests/cases/compiler/moduleWithNoValuesAsType.ts(7,8): error TS2304: Cannot find name 'B'. +tests/cases/compiler/moduleWithNoValuesAsType.ts(15,8): error TS2304: Cannot find name 'C'. + + ==== tests/cases/compiler/moduleWithNoValuesAsType.ts (3 errors) ==== module A { } var a: A; // error ~ -!!! Cannot find name 'A'. +!!! error TS2304: Cannot find name 'A'. module B { interface I {} } var b: B; // error ~ -!!! Cannot find name 'B'. +!!! error TS2304: Cannot find name 'B'. module C { module M { @@ -19,4 +24,4 @@ var c: C; // error ~ -!!! Cannot find name 'C'. \ No newline at end of file +!!! error TS2304: Cannot find name 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleWithValuesAsType.errors.txt b/tests/baselines/reference/moduleWithValuesAsType.errors.txt index cf496f76627..2bbb94f5076 100644 --- a/tests/baselines/reference/moduleWithValuesAsType.errors.txt +++ b/tests/baselines/reference/moduleWithValuesAsType.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/moduleWithValuesAsType.ts(5,8): error TS2304: Cannot find name 'A'. + + ==== tests/cases/compiler/moduleWithValuesAsType.ts (1 errors) ==== module A { var b = 1; @@ -5,4 +8,4 @@ var a: A; // no error ~ -!!! Cannot find name 'A'. \ No newline at end of file +!!! error TS2304: Cannot find name 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt b/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt index c2abe8fc6b9..564da071648 100644 --- a/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt +++ b/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt @@ -1,8 +1,14 @@ -==== tests/cases/compiler/module_augmentExistingAmbientVariable.ts (1 errors) ==== +tests/cases/compiler/module_augmentExistingAmbientVariable.ts(1,13): error TS2300: Duplicate identifier 'console'. +tests/cases/compiler/module_augmentExistingAmbientVariable.ts(3,8): error TS2300: Duplicate identifier 'console'. + + +==== tests/cases/compiler/module_augmentExistingAmbientVariable.ts (2 errors) ==== declare var console: any; + ~~~~~~~ +!!! error TS2300: Duplicate identifier 'console'. module console { ~~~~~~~ -!!! Duplicate identifier 'console'. +!!! error TS2300: Duplicate identifier 'console'. export var x = 2; } \ No newline at end of file diff --git a/tests/baselines/reference/module_augmentExistingVariable.errors.txt b/tests/baselines/reference/module_augmentExistingVariable.errors.txt index 25bd8b843fa..f1d17894077 100644 --- a/tests/baselines/reference/module_augmentExistingVariable.errors.txt +++ b/tests/baselines/reference/module_augmentExistingVariable.errors.txt @@ -1,8 +1,14 @@ -==== tests/cases/compiler/module_augmentExistingVariable.ts (1 errors) ==== +tests/cases/compiler/module_augmentExistingVariable.ts(1,5): error TS2300: Duplicate identifier 'console'. +tests/cases/compiler/module_augmentExistingVariable.ts(3,8): error TS2300: Duplicate identifier 'console'. + + +==== tests/cases/compiler/module_augmentExistingVariable.ts (2 errors) ==== var console: any; + ~~~~~~~ +!!! error TS2300: Duplicate identifier 'console'. module console { ~~~~~~~ -!!! Duplicate identifier 'console'. +!!! error TS2300: Duplicate identifier 'console'. export var x = 2; } \ No newline at end of file diff --git a/tests/baselines/reference/moduledecl.errors.txt b/tests/baselines/reference/moduledecl.errors.txt index 927f143183e..2ef60f058c2 100644 --- a/tests/baselines/reference/moduledecl.errors.txt +++ b/tests/baselines/reference/moduledecl.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/moduledecl.ts(164,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/moduledecl.ts(172,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/moduledecl.ts (2 errors) ==== module a { } @@ -164,7 +168,7 @@ } private get c2() { ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return new C2_private(); } public getC1_public() { @@ -174,7 +178,7 @@ } public get c1() { ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return new C1_public(); } } diff --git a/tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt b/tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt index b412d2ea448..bc7f41ad0c7 100644 --- a/tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt +++ b/tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/multiExtendsSplitInterfaces1.ts(1,1): error TS2304: Cannot find name 'self'. + + ==== tests/cases/compiler/multiExtendsSplitInterfaces1.ts (1 errors) ==== self.cancelAnimationFrame(0); ~~~~ -!!! Cannot find name 'self'. \ No newline at end of file +!!! error TS2304: Cannot find name 'self'. \ No newline at end of file diff --git a/tests/baselines/reference/multiLineErrors.errors.txt b/tests/baselines/reference/multiLineErrors.errors.txt index 911c07731e3..23a6278b4fb 100644 --- a/tests/baselines/reference/multiLineErrors.errors.txt +++ b/tests/baselines/reference/multiLineErrors.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/multiLineErrors.ts(3,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +tests/cases/compiler/multiLineErrors.ts(21,1): error TS2322: Type 'A2' is not assignable to type 'A1'. + Types of property 'x' are incompatible. + Type '{ y: string; }' is not assignable to type '{ y: number; }'. + Types of property 'y' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/multiLineErrors.ts (2 errors) ==== var t = 32; @@ -9,7 +17,7 @@ ~~~~~~~~~~~~~~ } ~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. { var x = 4; var y = 10; @@ -26,9 +34,9 @@ var t2: A2; t1 = t2; ~~ -!!! Type 'A2' is not assignable to type 'A1': -!!! Types of property 'x' are incompatible: -!!! Type '{ y: string; }' is not assignable to type '{ y: number; }': -!!! Types of property 'y' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'A2' is not assignable to type 'A1'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type '{ y: string; }' is not assignable to type '{ y: number; }'. +!!! error TS2322: Types of property 'y' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt b/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt index 533cb8f2da6..633f544a67b 100644 --- a/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt +++ b/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts(6,11): error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'A'. + Named properties 'x' of types 'A' and 'A' are not identical. + + ==== tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts (1 errors) ==== interface A { @@ -6,6 +10,6 @@ interface C extends A, A { } ~ -!!! Interface 'C' cannot simultaneously extend types 'A' and 'A': -!!! Named properties 'x' of types 'A' and 'A' are not identical. +!!! error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'A'. +!!! error TS2320: Named properties 'x' of types 'A' and 'A' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/multipleClassPropertyModifiers.errors.txt b/tests/baselines/reference/multipleClassPropertyModifiers.errors.txt index 09c39bdbcca..95a4d0c16c8 100644 --- a/tests/baselines/reference/multipleClassPropertyModifiers.errors.txt +++ b/tests/baselines/reference/multipleClassPropertyModifiers.errors.txt @@ -1,11 +1,15 @@ +tests/cases/compiler/multipleClassPropertyModifiers.ts(3,12): error TS1029: 'public' modifier must precede 'static' modifier. +tests/cases/compiler/multipleClassPropertyModifiers.ts(5,12): error TS1029: 'private' modifier must precede 'static' modifier. + + ==== tests/cases/compiler/multipleClassPropertyModifiers.ts (2 errors) ==== class C { public static p1; static public p2; ~~~~~~ -!!! 'public' modifier must precede 'static' modifier. +!!! error TS1029: 'public' modifier must precede 'static' modifier. private static p3; static private p4; ~~~~~~~ -!!! 'private' modifier must precede 'static' modifier. +!!! error TS1029: 'private' modifier must precede 'static' modifier. } \ No newline at end of file diff --git a/tests/baselines/reference/multipleClassPropertyModifiersErrors.errors.txt b/tests/baselines/reference/multipleClassPropertyModifiersErrors.errors.txt index dd5e4af8031..7705d40e1c8 100644 --- a/tests/baselines/reference/multipleClassPropertyModifiersErrors.errors.txt +++ b/tests/baselines/reference/multipleClassPropertyModifiersErrors.errors.txt @@ -1,20 +1,27 @@ +tests/cases/compiler/multipleClassPropertyModifiersErrors.ts(2,9): error TS1028: Accessibility modifier already seen. +tests/cases/compiler/multipleClassPropertyModifiersErrors.ts(3,10): error TS1028: Accessibility modifier already seen. +tests/cases/compiler/multipleClassPropertyModifiersErrors.ts(4,9): error TS1030: 'static' modifier already seen. +tests/cases/compiler/multipleClassPropertyModifiersErrors.ts(5,9): error TS1028: Accessibility modifier already seen. +tests/cases/compiler/multipleClassPropertyModifiersErrors.ts(6,10): error TS1028: Accessibility modifier already seen. + + ==== tests/cases/compiler/multipleClassPropertyModifiersErrors.ts (5 errors) ==== class C { public public p1; ~~~~~~ -!!! Accessibility modifier already seen. +!!! error TS1028: Accessibility modifier already seen. private private p2; ~~~~~~~ -!!! Accessibility modifier already seen. +!!! error TS1028: Accessibility modifier already seen. static static p3; ~~~~~~ -!!! 'static' modifier already seen. +!!! error TS1030: 'static' modifier already seen. public private p4; ~~~~~~~ -!!! Accessibility modifier already seen. +!!! error TS1028: Accessibility modifier already seen. private public p5; ~~~~~~ -!!! Accessibility modifier already seen. +!!! error TS1028: Accessibility modifier already seen. public static p6; private static p7; } \ No newline at end of file diff --git a/tests/baselines/reference/multipleExportAssignments.errors.txt b/tests/baselines/reference/multipleExportAssignments.errors.txt index 5f23f30c3e7..d5af20073c7 100644 --- a/tests/baselines/reference/multipleExportAssignments.errors.txt +++ b/tests/baselines/reference/multipleExportAssignments.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/multipleExportAssignments.ts(13,1): error TS2308: A module cannot have more than one export assignment. +tests/cases/compiler/multipleExportAssignments.ts(14,1): error TS2308: A module cannot have more than one export assignment. + + ==== tests/cases/compiler/multipleExportAssignments.ts (2 errors) ==== interface connectModule { (res, req, next): void; @@ -13,9 +17,9 @@ }; export = server; ~~~~~~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. export = connectExport; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. \ No newline at end of file diff --git a/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt b/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt index 8ec47acbc68..c2475f0ff14 100644 --- a/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt +++ b/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt @@ -1,11 +1,15 @@ +tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(4,5): error TS2308: A module cannot have more than one export assignment. +tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(5,5): error TS2308: A module cannot have more than one export assignment. + + ==== tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts (2 errors) ==== declare module "m1" { var a: number var b: number; export = a; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. export = b; ~~~~~~~~~~~ -!!! A module cannot have more than one export assignment. +!!! error TS2308: A module cannot have more than one export assignment. } \ No newline at end of file diff --git a/tests/baselines/reference/multipleInheritance.errors.txt b/tests/baselines/reference/multipleInheritance.errors.txt index cb3e360fcc6..b15a6978ef5 100644 --- a/tests/baselines/reference/multipleInheritance.errors.txt +++ b/tests/baselines/reference/multipleInheritance.errors.txt @@ -1,3 +1,13 @@ +tests/cases/compiler/multipleInheritance.ts(9,19): error TS1005: '{' expected. +tests/cases/compiler/multipleInheritance.ts(9,24): error TS1005: ';' expected. +tests/cases/compiler/multipleInheritance.ts(18,19): error TS1005: '{' expected. +tests/cases/compiler/multipleInheritance.ts(18,24): error TS1005: ';' expected. +tests/cases/compiler/multipleInheritance.ts(34,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'. + Types of property 'g' are incompatible. + Type '(n: number) => number' is not assignable to type '() => number'. +tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. + + ==== tests/cases/compiler/multipleInheritance.ts (6 errors) ==== class B1 { public x; @@ -9,9 +19,9 @@ class C extends B1, B2 { // duplicate member ~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. } class D1 extends B1 { @@ -22,9 +32,9 @@ class E extends D1, D2 { // nope, duplicate member ~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. } class N { @@ -42,12 +52,12 @@ class Baad extends Good { ~~~~ -!!! Class 'Baad' incorrectly extends base class 'Good': -!!! Types of property 'g' are incompatible: -!!! Type '(n: number) => number' is not assignable to type '() => number'. +!!! error TS2415: Class 'Baad' incorrectly extends base class 'Good'. +!!! error TS2415: Types of property 'g' are incompatible. +!!! error TS2415: Type '(n: number) => number' is not assignable to type '() => number'. public f(): number { return 0; } ~ -!!! Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. +!!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. public g(n:number) { return 0; } } \ No newline at end of file diff --git a/tests/baselines/reference/multipleNumericIndexers.errors.txt b/tests/baselines/reference/multipleNumericIndexers.errors.txt index 5ee665a4703..856fdbe47ff 100644 --- a/tests/baselines/reference/multipleNumericIndexers.errors.txt +++ b/tests/baselines/reference/multipleNumericIndexers.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(5,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(10,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(15,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(20,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(25,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(28,11): error TS2428: All declarations of an interface must have identical type parameters. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(29,5): error TS2375: Duplicate number index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(30,5): error TS2375: Duplicate number index signature. + + ==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts (8 errors) ==== // Multiple indexers of the same type are an error @@ -5,45 +15,45 @@ [x: number]: string; [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } interface I { [x: number]: string; [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } var a: { [x: number]: string; [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } var b: { [x: number]: string; [x: number]: string ~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } = { 1: '', "2": '' } class C2 { [x: number]: string; [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } interface I { ~ -!!! All declarations of an interface must have identical type parameters. +!!! error TS2428: All declarations of an interface must have identical type parameters. [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. [x: number]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } \ No newline at end of file diff --git a/tests/baselines/reference/multipleStringIndexers.errors.txt b/tests/baselines/reference/multipleStringIndexers.errors.txt index b6328f2edca..6aa4172476b 100644 --- a/tests/baselines/reference/multipleStringIndexers.errors.txt +++ b/tests/baselines/reference/multipleStringIndexers.errors.txt @@ -1,3 +1,11 @@ +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(5,5): error TS2374: Duplicate string index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(10,5): error TS2374: Duplicate string index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(15,5): error TS2374: Duplicate string index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(20,5): error TS2374: Duplicate string index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(25,5): error TS2374: Duplicate string index signature. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(30,5): error TS2374: Duplicate string index signature. + + ==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts (6 errors) ==== // Multiple indexers of the same type are an error @@ -5,40 +13,40 @@ [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } interface I { [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } var a: { [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } var b: { [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } = { y: '' } class C2 { [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } interface I2 { [x: string]: string; [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. +!!! error TS2374: Duplicate string index signature. } \ No newline at end of file diff --git a/tests/baselines/reference/multivar.errors.txt b/tests/baselines/reference/multivar.errors.txt index 655a5f42e6d..931e61de5ae 100644 --- a/tests/baselines/reference/multivar.errors.txt +++ b/tests/baselines/reference/multivar.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/multivar.ts(6,19): error TS2395: Individual declarations in merged declaration b2 must be all exported or all local. +tests/cases/compiler/multivar.ts(22,9): error TS2395: Individual declarations in merged declaration b2 must be all exported or all local. + + ==== tests/cases/compiler/multivar.ts (2 errors) ==== var a,b,c; var x=1,y=2,z=3; @@ -6,7 +10,7 @@ export var a, b2: number = 10, b; ~~ -!!! Individual declarations in merged declaration b2 must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration b2 must be all exported or all local. var m1; var a2, b22: number = 10, b222; var m3; @@ -24,7 +28,7 @@ declare var d1, d2; var b2; ~~ -!!! Individual declarations in merged declaration b2 must be all exported or all local. +!!! error TS2395: Individual declarations in merged declaration b2 must be all exported or all local. declare var v1; } diff --git a/tests/baselines/reference/nameCollisions.errors.txt b/tests/baselines/reference/nameCollisions.errors.txt index f6ac8c0bd67..baa7c6cbfd5 100644 --- a/tests/baselines/reference/nameCollisions.errors.txt +++ b/tests/baselines/reference/nameCollisions.errors.txt @@ -1,25 +1,48 @@ -==== tests/cases/compiler/nameCollisions.ts (9 errors) ==== +tests/cases/compiler/nameCollisions.ts(2,9): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/nameCollisions.ts(4,12): error TS2300: Duplicate identifier 'x'. +tests/cases/compiler/nameCollisions.ts(10,12): error TS2300: Duplicate identifier 'z'. +tests/cases/compiler/nameCollisions.ts(13,9): error TS2300: Duplicate identifier 'z'. +tests/cases/compiler/nameCollisions.ts(15,12): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged +tests/cases/compiler/nameCollisions.ts(24,9): error TS2300: Duplicate identifier 'f'. +tests/cases/compiler/nameCollisions.ts(25,14): error TS2300: Duplicate identifier 'f'. +tests/cases/compiler/nameCollisions.ts(27,14): error TS2300: Duplicate identifier 'f2'. +tests/cases/compiler/nameCollisions.ts(28,9): error TS2300: Duplicate identifier 'f2'. +tests/cases/compiler/nameCollisions.ts(33,11): error TS2300: Duplicate identifier 'C'. +tests/cases/compiler/nameCollisions.ts(34,14): error TS2300: Duplicate identifier 'C'. +tests/cases/compiler/nameCollisions.ts(36,14): error TS2300: Duplicate identifier 'C2'. +tests/cases/compiler/nameCollisions.ts(37,11): error TS2300: Duplicate identifier 'C2'. +tests/cases/compiler/nameCollisions.ts(42,11): error TS2300: Duplicate identifier 'cli'. +tests/cases/compiler/nameCollisions.ts(43,15): error TS2300: Duplicate identifier 'cli'. +tests/cases/compiler/nameCollisions.ts(45,15): error TS2300: Duplicate identifier 'cli2'. +tests/cases/compiler/nameCollisions.ts(46,11): error TS2300: Duplicate identifier 'cli2'. + + +==== tests/cases/compiler/nameCollisions.ts (17 errors) ==== module T { var x = 2; + ~ +!!! error TS2300: Duplicate identifier 'x'. module x { // error ~ -!!! Duplicate identifier 'x'. +!!! error TS2300: Duplicate identifier 'x'. export class Bar { test: number; } } module z { + ~ +!!! error TS2300: Duplicate identifier 'z'. var t; } var z; // error ~ -!!! Duplicate identifier 'z'. +!!! error TS2300: Duplicate identifier 'z'. module y { ~ -!!! A module declaration cannot be located prior to a class or function with which it is merged +!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged var b; } @@ -29,38 +52,50 @@ module w { } //ok var f; + ~ +!!! error TS2300: Duplicate identifier 'f'. function f() { } //error ~ -!!! Duplicate identifier 'f'. +!!! error TS2300: Duplicate identifier 'f'. function f2() { } + ~~ +!!! error TS2300: Duplicate identifier 'f2'. var f2; // error ~~ -!!! Duplicate identifier 'f2'. +!!! error TS2300: Duplicate identifier 'f2'. var i; interface i { } //ok class C { } + ~ +!!! error TS2300: Duplicate identifier 'C'. function C() { } // error ~ -!!! Duplicate identifier 'C'. +!!! error TS2300: Duplicate identifier 'C'. function C2() { } + ~~ +!!! error TS2300: Duplicate identifier 'C2'. class C2 { } // error ~~ -!!! Duplicate identifier 'C2'. +!!! error TS2300: Duplicate identifier 'C2'. function fi() { } interface fi { } // ok class cli { } + ~~~ +!!! error TS2300: Duplicate identifier 'cli'. interface cli { } // error ~~~ -!!! Duplicate identifier 'cli'. +!!! error TS2300: Duplicate identifier 'cli'. interface cli2 { } + ~~~~ +!!! error TS2300: Duplicate identifier 'cli2'. class cli2 { } // error ~~~~ -!!! Duplicate identifier 'cli2'. +!!! error TS2300: Duplicate identifier 'cli2'. } \ No newline at end of file diff --git a/tests/baselines/reference/nameOrDottedSpan_classes.baseline b/tests/baselines/reference/nameOrDottedSpan_classes.baseline new file mode 100644 index 00000000000..88383c638a8 --- /dev/null +++ b/tests/baselines/reference/nameOrDottedSpan_classes.baseline @@ -0,0 +1,522 @@ + +1 >module Foo.Bar { + + ~~~~~~~ => Pos: (0 to 6) SpanInfo: undefined +1 >module Foo.Bar { + + ~~~~ => Pos: (7 to 10) SpanInfo: {"start":7,"length":3} + >Foo + >:=> (line 1, col 7) to (line 1, col 10) +1 >module Foo.Bar { + + ~~~~ => Pos: (11 to 14) SpanInfo: {"start":7,"length":7} + >Foo.Bar + >:=> (line 1, col 7) to (line 1, col 14) +1 >module Foo.Bar { + + ~~ => Pos: (15 to 16) SpanInfo: undefined +-------------------------------- +2 > "use strict"; + + ~~~~ => Pos: (17 to 20) SpanInfo: undefined +2 > "use strict"; + + ~~~~~~~~~~~~~ => Pos: (21 to 33) SpanInfo: {"start":21,"length":12} + >"use strict" + >:=> (line 2, col 4) to (line 2, col 16) +2 > "use strict"; + + ~ => Pos: (34 to 34) SpanInfo: undefined +-------------------------------- +3 > + + ~ => Pos: (35 to 35) SpanInfo: undefined +-------------------------------- +4 > class Greeter { + + ~~~~~~~~~~ => Pos: (36 to 45) SpanInfo: undefined +4 > class Greeter { + + ~~~~~~~~ => Pos: (46 to 53) SpanInfo: {"start":46,"length":7} + >Greeter + >:=> (line 4, col 10) to (line 4, col 17) +4 > class Greeter { + + ~~ => Pos: (54 to 55) SpanInfo: undefined +-------------------------------- +5 > constructor(public greeting: string) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (56 to 82) SpanInfo: undefined +5 > constructor(public greeting: string) { + + ~~~~~~~~~ => Pos: (83 to 91) SpanInfo: {"start":83,"length":8} + >greeting + >:=> (line 5, col 27) to (line 5, col 35) +5 > constructor(public greeting: string) { + + ~~~~~~~~~~~=> Pos: (92 to 102) SpanInfo: undefined +-------------------------------- +6 > } + + ~~~~~~~~~~ => Pos: (103 to 112) SpanInfo: undefined +-------------------------------- +7 > + + ~ => Pos: (113 to 113) SpanInfo: undefined +-------------------------------- +8 > greet() { + + ~~~~~~~~ => Pos: (114 to 121) SpanInfo: undefined +8 > greet() { + + ~~~~~~ => Pos: (122 to 127) SpanInfo: {"start":122,"length":5} + >greet + >:=> (line 8, col 8) to (line 8, col 13) +8 > greet() { + + ~~~~ => Pos: (128 to 131) SpanInfo: undefined +-------------------------------- +9 > return "

" + this.greeting + "

"; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (132 to 150) SpanInfo: undefined +9 > return "

" + this.greeting + "

"; + + ~~~~~~~ => Pos: (151 to 157) SpanInfo: {"start":151,"length":6} + >"

" + >:=> (line 9, col 19) to (line 9, col 25) +9 > return "

" + this.greeting + "

"; + + ~~ => Pos: (158 to 159) SpanInfo: undefined +9 > return "

" + this.greeting + "

"; + + ~~~~~ => Pos: (160 to 164) SpanInfo: {"start":160,"length":4} + >this + >:=> (line 9, col 28) to (line 9, col 32) +9 > return "

" + this.greeting + "

"; + + ~~~~~~~~~ => Pos: (165 to 173) SpanInfo: {"start":160,"length":13} + >this.greeting + >:=> (line 9, col 28) to (line 9, col 41) +9 > return "

" + this.greeting + "

"; + + ~~ => Pos: (174 to 175) SpanInfo: undefined +9 > return "

" + this.greeting + "

"; + + ~~~~~~~~=> Pos: (176 to 183) SpanInfo: {"start":176,"length":7} + >"" + >:=> (line 9, col 44) to (line 9, col 51) +9 > return "

" + this.greeting + "

"; + + ~=> Pos: (184 to 184) SpanInfo: undefined +-------------------------------- +10 > } + + ~~~~~~~~~~ => Pos: (185 to 194) SpanInfo: undefined +-------------------------------- +11 > } + + ~~~~~~ => Pos: (195 to 200) SpanInfo: undefined +-------------------------------- +12 > + + ~ => Pos: (201 to 201) SpanInfo: undefined +-------------------------------- +13 > + + ~ => Pos: (202 to 202) SpanInfo: undefined +-------------------------------- +14 > function foo(greeting: string): Greeter { + + ~~~~~~~~~~~~~ => Pos: (203 to 215) SpanInfo: undefined +14 > function foo(greeting: string): Greeter { + + ~~~~ => Pos: (216 to 219) SpanInfo: {"start":216,"length":3} + >foo + >:=> (line 14, col 13) to (line 14, col 16) +14 > function foo(greeting: string): Greeter { + + ~~~~~~~~~ => Pos: (220 to 228) SpanInfo: {"start":220,"length":8} + >greeting + >:=> (line 14, col 17) to (line 14, col 25) +14 > function foo(greeting: string): Greeter { + + ~~~~~~~~~~ => Pos: (229 to 238) SpanInfo: undefined +14 > function foo(greeting: string): Greeter { + + ~~~~~~~~ => Pos: (239 to 246) SpanInfo: {"start":239,"length":7} + >Greeter + >:=> (line 14, col 36) to (line 14, col 43) +14 > function foo(greeting: string): Greeter { + + ~~=> Pos: (247 to 248) SpanInfo: undefined +-------------------------------- +15 > return new Greeter(greeting); + + ~~~~~~~~~~~~~~~~~~~ => Pos: (249 to 267) SpanInfo: undefined +15 > return new Greeter(greeting); + + ~~~~~~~~ => Pos: (268 to 275) SpanInfo: {"start":268,"length":7} + >Greeter + >:=> (line 15, col 19) to (line 15, col 26) +15 > return new Greeter(greeting); + + ~~~~~~~~~ => Pos: (276 to 284) SpanInfo: {"start":276,"length":8} + >greeting + >:=> (line 15, col 27) to (line 15, col 35) +15 > return new Greeter(greeting); + + ~~ => Pos: (285 to 286) SpanInfo: undefined +-------------------------------- +16 > } + + ~~~~~~ => Pos: (287 to 292) SpanInfo: undefined +-------------------------------- +17 > + + ~ => Pos: (293 to 293) SpanInfo: undefined +-------------------------------- +18 > var greeter = new Greeter("Hello, world!"); + + ~~~~~~~~ => Pos: (294 to 301) SpanInfo: undefined +18 > var greeter = new Greeter("Hello, world!"); + + ~~~~~~~~ => Pos: (302 to 309) SpanInfo: {"start":302,"length":7} + >greeter + >:=> (line 18, col 8) to (line 18, col 15) +18 > var greeter = new Greeter("Hello, world!"); + + ~~~~~~ => Pos: (310 to 315) SpanInfo: undefined +18 > var greeter = new Greeter("Hello, world!"); + + ~~~~~~~~ => Pos: (316 to 323) SpanInfo: {"start":316,"length":7} + >Greeter + >:=> (line 18, col 22) to (line 18, col 29) +18 > var greeter = new Greeter("Hello, world!"); + + ~~~~~~~~~~~~~~~~=> Pos: (324 to 339) SpanInfo: {"start":324,"length":15} + >"Hello, world!" + >:=> (line 18, col 30) to (line 18, col 45) +18 > var greeter = new Greeter("Hello, world!"); + + ~~=> Pos: (340 to 341) SpanInfo: undefined +-------------------------------- +19 > var str = greeter.greet(); + + ~~~~~~~~ => Pos: (342 to 349) SpanInfo: undefined +19 > var str = greeter.greet(); + + ~~~~ => Pos: (350 to 353) SpanInfo: {"start":350,"length":3} + >str + >:=> (line 19, col 8) to (line 19, col 11) +19 > var str = greeter.greet(); + + ~~ => Pos: (354 to 355) SpanInfo: undefined +19 > var str = greeter.greet(); + + ~~~~~~~~ => Pos: (356 to 363) SpanInfo: {"start":356,"length":7} + >greeter + >:=> (line 19, col 14) to (line 19, col 21) +19 > var str = greeter.greet(); + + ~~~~~~ => Pos: (364 to 369) SpanInfo: {"start":356,"length":13} + >greeter.greet + >:=> (line 19, col 14) to (line 19, col 27) +19 > var str = greeter.greet(); + + ~~~ => Pos: (370 to 372) SpanInfo: undefined +-------------------------------- +20 > + + ~ => Pos: (373 to 373) SpanInfo: undefined +-------------------------------- +21 > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + + ~~~~~~~~~~~~~ => Pos: (374 to 386) SpanInfo: undefined +21 > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + + ~~~~~ => Pos: (387 to 391) SpanInfo: {"start":387,"length":4} + >foo2 + >:=> (line 21, col 13) to (line 21, col 17) +21 > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + + ~~~~~~~~~ => Pos: (392 to 400) SpanInfo: {"start":392,"length":8} + >greeting + >:=> (line 21, col 18) to (line 21, col 26) +21 > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + + ~~~~~~~~~~~~ => Pos: (401 to 412) SpanInfo: undefined +21 > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + + ~~~~~~~~~~~~~~=> Pos: (413 to 426) SpanInfo: {"start":413,"length":13} + >restGreetings + >:=> (line 21, col 39) to (line 21, col 52) +21 > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (427 to 459) SpanInfo: undefined +-------------------------------- +22 > var greeters: Greeter[] = []; /* inline block comment */ + + ~~~~~~~~~~~~ => Pos: (460 to 471) SpanInfo: undefined +22 > var greeters: Greeter[] = []; /* inline block comment */ + + ~~~~~~~~~ => Pos: (472 to 480) SpanInfo: {"start":472,"length":8} + >greeters + >:=> (line 22, col 12) to (line 22, col 20) +22 > var greeters: Greeter[] = []; /* inline block comment */ + + ~ => Pos: (481 to 481) SpanInfo: undefined +22 > var greeters: Greeter[] = []; /* inline block comment */ + + ~~~~~~~~ => Pos: (482 to 489) SpanInfo: {"start":482,"length":7} + >Greeter + >:=> (line 22, col 22) to (line 22, col 29) +22 > var greeters: Greeter[] = []; /* inline block comment */ + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (490 to 524) SpanInfo: undefined +-------------------------------- +23 > greeters[0] = new Greeter(greeting); + + ~~~~~~~~ => Pos: (525 to 532) SpanInfo: undefined +23 > greeters[0] = new Greeter(greeting); + + ~~~~~~~~~ => Pos: (533 to 541) SpanInfo: {"start":533,"length":8} + >greeters + >:=> (line 23, col 8) to (line 23, col 16) +23 > greeters[0] = new Greeter(greeting); + + ~~~~~~~~~ => Pos: (542 to 550) SpanInfo: undefined +23 > greeters[0] = new Greeter(greeting); + + ~~~~~~~~ => Pos: (551 to 558) SpanInfo: {"start":551,"length":7} + >Greeter + >:=> (line 23, col 26) to (line 23, col 33) +23 > greeters[0] = new Greeter(greeting); + + ~~~~~~~~~ => Pos: (559 to 567) SpanInfo: {"start":559,"length":8} + >greeting + >:=> (line 23, col 34) to (line 23, col 42) +23 > greeters[0] = new Greeter(greeting); + + ~~ => Pos: (568 to 569) SpanInfo: undefined +-------------------------------- +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (570 to 586) SpanInfo: undefined +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~ => Pos: (587 to 588) SpanInfo: {"start":587,"length":1} + >i + >:=> (line 24, col 17) to (line 24, col 18) +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~~~~ => Pos: (589 to 593) SpanInfo: undefined +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~ => Pos: (594 to 595) SpanInfo: {"start":594,"length":1} + >i + >:=> (line 24, col 24) to (line 24, col 25) +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~ => Pos: (596 to 597) SpanInfo: undefined +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~~~~~~~~~~~~~ => Pos: (598 to 611) SpanInfo: {"start":598,"length":13} + >restGreetings + >:=> (line 24, col 28) to (line 24, col 41) +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~~~~~~=> Pos: (612 to 618) SpanInfo: {"start":598,"length":20} + >restGreetings.length + >:=> (line 24, col 28) to (line 24, col 48) +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~=> Pos: (619 to 619) SpanInfo: undefined +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~=> Pos: (620 to 621) SpanInfo: {"start":620,"length":1} + >i + >:=> (line 24, col 50) to (line 24, col 51) +24 > for (var i = 0; i < restGreetings.length; i++) { + + ~~~~~=> Pos: (622 to 626) SpanInfo: undefined +-------------------------------- +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~~~~~~~~~~~ => Pos: (627 to 638) SpanInfo: undefined +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~~~~~~~~ => Pos: (639 to 647) SpanInfo: {"start":639,"length":8} + >greeters + >:=> (line 25, col 12) to (line 25, col 20) +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~~~~ => Pos: (648 to 652) SpanInfo: {"start":639,"length":13} + >greeters.push + >:=> (line 25, col 12) to (line 25, col 25) +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~~~ => Pos: (653 to 656) SpanInfo: undefined +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~~~~~~~ => Pos: (657 to 664) SpanInfo: {"start":657,"length":7} + >Greeter + >:=> (line 25, col 30) to (line 25, col 37) +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~~~~~~~~~~~~~=> Pos: (665 to 678) SpanInfo: {"start":665,"length":13} + >restGreetings + >:=> (line 25, col 38) to (line 25, col 51) +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~=> Pos: (679 to 680) SpanInfo: {"start":679,"length":1} + >i + >:=> (line 25, col 52) to (line 25, col 53) +25 > greeters.push(new Greeter(restGreetings[i])); + + ~~~~=> Pos: (681 to 684) SpanInfo: undefined +-------------------------------- +26 > } + + ~~~~~~~~~~ => Pos: (685 to 694) SpanInfo: undefined +-------------------------------- +27 > + + ~ => Pos: (695 to 695) SpanInfo: undefined +-------------------------------- +28 > return greeters; + + ~~~~~~~~~~~~~~~ => Pos: (696 to 710) SpanInfo: undefined +28 > return greeters; + + ~~~~~~~~~ => Pos: (711 to 719) SpanInfo: {"start":711,"length":8} + >greeters + >:=> (line 28, col 15) to (line 28, col 23) +28 > return greeters; + + ~ => Pos: (720 to 720) SpanInfo: undefined +-------------------------------- +29 > } + + ~~~~~~ => Pos: (721 to 726) SpanInfo: undefined +-------------------------------- +30 > + + ~ => Pos: (727 to 727) SpanInfo: undefined +-------------------------------- +31 > var b = foo2("Hello", "World", "!"); + + ~~~~~~~~ => Pos: (728 to 735) SpanInfo: undefined +31 > var b = foo2("Hello", "World", "!"); + + ~~ => Pos: (736 to 737) SpanInfo: {"start":736,"length":1} + >b + >:=> (line 31, col 8) to (line 31, col 9) +31 > var b = foo2("Hello", "World", "!"); + + ~~ => Pos: (738 to 739) SpanInfo: undefined +31 > var b = foo2("Hello", "World", "!"); + + ~~~~~ => Pos: (740 to 744) SpanInfo: {"start":740,"length":4} + >foo2 + >:=> (line 31, col 12) to (line 31, col 16) +31 > var b = foo2("Hello", "World", "!"); + + ~~~~~~~~ => Pos: (745 to 752) SpanInfo: {"start":745,"length":7} + >"Hello" + >:=> (line 31, col 17) to (line 31, col 24) +31 > var b = foo2("Hello", "World", "!"); + + ~ => Pos: (753 to 753) SpanInfo: undefined +31 > var b = foo2("Hello", "World", "!"); + + ~~~~~~~~ => Pos: (754 to 761) SpanInfo: {"start":754,"length":7} + >"World" + >:=> (line 31, col 26) to (line 31, col 33) +31 > var b = foo2("Hello", "World", "!"); + + ~ => Pos: (762 to 762) SpanInfo: undefined +31 > var b = foo2("Hello", "World", "!"); + + ~~~~ => Pos: (763 to 766) SpanInfo: {"start":763,"length":3} + >"!" + >:=> (line 31, col 35) to (line 31, col 38) +31 > var b = foo2("Hello", "World", "!"); + + ~~ => Pos: (767 to 768) SpanInfo: undefined +-------------------------------- +32 > // This is simple signle line comment + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (769 to 810) SpanInfo: undefined +-------------------------------- +33 > for (var j = 0; j < b.length; j++) { + + ~~~~~~~~~~~~~ => Pos: (811 to 823) SpanInfo: undefined +33 > for (var j = 0; j < b.length; j++) { + + ~~ => Pos: (824 to 825) SpanInfo: {"start":824,"length":1} + >j + >:=> (line 33, col 13) to (line 33, col 14) +33 > for (var j = 0; j < b.length; j++) { + + ~~~~~ => Pos: (826 to 830) SpanInfo: undefined +33 > for (var j = 0; j < b.length; j++) { + + ~~ => Pos: (831 to 832) SpanInfo: {"start":831,"length":1} + >j + >:=> (line 33, col 20) to (line 33, col 21) +33 > for (var j = 0; j < b.length; j++) { + + ~~ => Pos: (833 to 834) SpanInfo: undefined +33 > for (var j = 0; j < b.length; j++) { + + ~~ => Pos: (835 to 836) SpanInfo: {"start":835,"length":1} + >b + >:=> (line 33, col 24) to (line 33, col 25) +33 > for (var j = 0; j < b.length; j++) { + + ~~~~~~~ => Pos: (837 to 843) SpanInfo: {"start":835,"length":8} + >b.length + >:=> (line 33, col 24) to (line 33, col 32) +33 > for (var j = 0; j < b.length; j++) { + + ~ => Pos: (844 to 844) SpanInfo: undefined +33 > for (var j = 0; j < b.length; j++) { + + ~~ => Pos: (845 to 846) SpanInfo: {"start":845,"length":1} + >j + >:=> (line 33, col 34) to (line 33, col 35) +33 > for (var j = 0; j < b.length; j++) { + + ~~~~~ => Pos: (847 to 851) SpanInfo: undefined +-------------------------------- +34 > b[j].greet(); + + ~~~~~~~~ => Pos: (852 to 859) SpanInfo: undefined +34 > b[j].greet(); + + ~~ => Pos: (860 to 861) SpanInfo: {"start":860,"length":1} + >b + >:=> (line 34, col 8) to (line 34, col 9) +34 > b[j].greet(); + + ~~ => Pos: (862 to 863) SpanInfo: {"start":862,"length":1} + >j + >:=> (line 34, col 10) to (line 34, col 11) +34 > b[j].greet(); + + ~ => Pos: (864 to 864) SpanInfo: undefined +34 > b[j].greet(); + + ~~~~~~ => Pos: (865 to 870) SpanInfo: {"start":860,"length":10} + >b[j].greet + >:=> (line 34, col 8) to (line 34, col 18) +34 > b[j].greet(); + + ~~~ => Pos: (871 to 873) SpanInfo: undefined +-------------------------------- +35 > } + + ~~~~~~ => Pos: (874 to 879) SpanInfo: undefined +-------------------------------- +36 >} + ~ => Pos: (880 to 880) SpanInfo: undefined \ No newline at end of file diff --git a/tests/baselines/reference/nameOrDottedSpan_stmts.baseline b/tests/baselines/reference/nameOrDottedSpan_stmts.baseline new file mode 100644 index 00000000000..d0d35199e81 --- /dev/null +++ b/tests/baselines/reference/nameOrDottedSpan_stmts.baseline @@ -0,0 +1,884 @@ + +1 >function f() { + + ~~~~~~~~~ => Pos: (0 to 8) SpanInfo: undefined +1 >function f() { + + ~~ => Pos: (9 to 10) SpanInfo: {"start":9,"length":1} + >f + >:=> (line 1, col 9) to (line 1, col 10) +1 >function f() { + + ~~~~ => Pos: (11 to 14) SpanInfo: undefined +-------------------------------- +2 > var y; + + ~~~~~~~~ => Pos: (15 to 22) SpanInfo: undefined +2 > var y; + + ~~ => Pos: (23 to 24) SpanInfo: {"start":23,"length":1} + >y + >:=> (line 2, col 8) to (line 2, col 9) +2 > var y; + + ~ => Pos: (25 to 25) SpanInfo: undefined +-------------------------------- +3 > var x = 0; + + ~~~~~~~~ => Pos: (26 to 33) SpanInfo: undefined +3 > var x = 0; + + ~~ => Pos: (34 to 35) SpanInfo: {"start":34,"length":1} + >x + >:=> (line 3, col 8) to (line 3, col 9) +3 > var x = 0; + + ~~~~~ => Pos: (36 to 40) SpanInfo: undefined +-------------------------------- +4 > for (var i = 0; i < 10; i++) { + + ~~~~~~~~~~~~~ => Pos: (41 to 53) SpanInfo: undefined +4 > for (var i = 0; i < 10; i++) { + + ~~ => Pos: (54 to 55) SpanInfo: {"start":54,"length":1} + >i + >:=> (line 4, col 13) to (line 4, col 14) +4 > for (var i = 0; i < 10; i++) { + + ~~~~~ => Pos: (56 to 60) SpanInfo: undefined +4 > for (var i = 0; i < 10; i++) { + + ~~ => Pos: (61 to 62) SpanInfo: {"start":61,"length":1} + >i + >:=> (line 4, col 20) to (line 4, col 21) +4 > for (var i = 0; i < 10; i++) { + + ~~~~~~ => Pos: (63 to 68) SpanInfo: undefined +4 > for (var i = 0; i < 10; i++) { + + ~~ => Pos: (69 to 70) SpanInfo: {"start":69,"length":1} + >i + >:=> (line 4, col 28) to (line 4, col 29) +4 > for (var i = 0; i < 10; i++) { + + ~~~~~ => Pos: (71 to 75) SpanInfo: undefined +-------------------------------- +5 > x += i; + + ~~~~~~~~ => Pos: (76 to 83) SpanInfo: undefined +5 > x += i; + + ~~ => Pos: (84 to 85) SpanInfo: {"start":84,"length":1} + >x + >:=> (line 5, col 8) to (line 5, col 9) +5 > x += i; + + ~~~ => Pos: (86 to 88) SpanInfo: undefined +5 > x += i; + + ~~ => Pos: (89 to 90) SpanInfo: {"start":89,"length":1} + >i + >:=> (line 5, col 13) to (line 5, col 14) +5 > x += i; + + ~ => Pos: (91 to 91) SpanInfo: undefined +-------------------------------- +6 > x *= 0; + + ~~~~~~~~ => Pos: (92 to 99) SpanInfo: undefined +6 > x *= 0; + + ~~ => Pos: (100 to 101) SpanInfo: {"start":100,"length":1} + >x + >:=> (line 6, col 8) to (line 6, col 9) +6 > x *= 0; + + ~~~~~~ => Pos: (102 to 107) SpanInfo: undefined +-------------------------------- +7 > } + + ~~~~~~ => Pos: (108 to 113) SpanInfo: undefined +-------------------------------- +8 > if (x > 17) { + + ~~~~~~~~ => Pos: (114 to 121) SpanInfo: undefined +8 > if (x > 17) { + + ~~ => Pos: (122 to 123) SpanInfo: {"start":122,"length":1} + >x + >:=> (line 8, col 8) to (line 8, col 9) +8 > if (x > 17) { + + ~~~~~~~~ => Pos: (124 to 131) SpanInfo: undefined +-------------------------------- +9 > x /= 9; + + ~~~~~~~~ => Pos: (132 to 139) SpanInfo: undefined +9 > x /= 9; + + ~~ => Pos: (140 to 141) SpanInfo: {"start":140,"length":1} + >x + >:=> (line 9, col 8) to (line 9, col 9) +9 > x /= 9; + + ~~~~~~ => Pos: (142 to 147) SpanInfo: undefined +-------------------------------- +10 > } else { + + ~~~~~~~~~~~~~ => Pos: (148 to 160) SpanInfo: undefined +-------------------------------- +11 > x += 10; + + ~~~~~~~~ => Pos: (161 to 168) SpanInfo: undefined +11 > x += 10; + + ~~ => Pos: (169 to 170) SpanInfo: {"start":169,"length":1} + >x + >:=> (line 11, col 8) to (line 11, col 9) +11 > x += 10; + + ~~~~~~~ => Pos: (171 to 177) SpanInfo: undefined +-------------------------------- +12 > x++; + + ~~~~~~~~ => Pos: (178 to 185) SpanInfo: undefined +12 > x++; + + ~~ => Pos: (186 to 187) SpanInfo: {"start":186,"length":1} + >x + >:=> (line 12, col 8) to (line 12, col 9) +12 > x++; + + ~~~ => Pos: (188 to 190) SpanInfo: undefined +-------------------------------- +13 > } + + ~~~~~~ => Pos: (191 to 196) SpanInfo: undefined +-------------------------------- +14 > var a = [ + + ~~~~~~~~ => Pos: (197 to 204) SpanInfo: undefined +14 > var a = [ + + ~~ => Pos: (205 to 206) SpanInfo: {"start":205,"length":1} + >a + >:=> (line 14, col 8) to (line 14, col 9) +14 > var a = [ + + ~~~~ => Pos: (207 to 210) SpanInfo: undefined +-------------------------------- +15 > 1, + + ~~~~~~~~~~~ => Pos: (211 to 221) SpanInfo: undefined +-------------------------------- +16 > 2, + + ~~~~~~~~~~~ => Pos: (222 to 232) SpanInfo: undefined +-------------------------------- +17 > 3 + + ~~~~~~~~~~ => Pos: (233 to 242) SpanInfo: undefined +-------------------------------- +18 > ]; + + ~~~~~~~ => Pos: (243 to 249) SpanInfo: undefined +-------------------------------- +19 > var obj = { + + ~~~~~~~~ => Pos: (250 to 257) SpanInfo: undefined +19 > var obj = { + + ~~~~ => Pos: (258 to 261) SpanInfo: {"start":258,"length":3} + >obj + >:=> (line 19, col 8) to (line 19, col 11) +19 > var obj = { + + ~~~~ => Pos: (262 to 265) SpanInfo: undefined +-------------------------------- +20 > z: 1, + + ~~~~~~~~ => Pos: (266 to 273) SpanInfo: undefined +20 > z: 1, + + ~~ => Pos: (274 to 275) SpanInfo: {"start":274,"length":1} + >z + >:=> (line 20, col 8) to (line 20, col 9) +20 > z: 1, + + ~~~~ => Pos: (276 to 279) SpanInfo: undefined +-------------------------------- +21 > q: "hello" + + ~~~~~~~~ => Pos: (280 to 287) SpanInfo: undefined +21 > q: "hello" + + ~~ => Pos: (288 to 289) SpanInfo: {"start":288,"length":1} + >q + >:=> (line 21, col 8) to (line 21, col 9) +21 > q: "hello" + + ~ => Pos: (290 to 290) SpanInfo: undefined +21 > q: "hello" + + ~~~~~~~~ => Pos: (291 to 298) SpanInfo: {"start":291,"length":7} + >"hello" + >:=> (line 21, col 11) to (line 21, col 18) +-------------------------------- +22 > }; + + ~~~~~~~ => Pos: (299 to 305) SpanInfo: undefined +-------------------------------- +23 > for (var j in a) { + + ~~~~~~~~~~~~~ => Pos: (306 to 318) SpanInfo: undefined +23 > for (var j in a) { + + ~~ => Pos: (319 to 320) SpanInfo: {"start":319,"length":1} + >j + >:=> (line 23, col 13) to (line 23, col 14) +23 > for (var j in a) { + + ~~~ => Pos: (321 to 323) SpanInfo: undefined +23 > for (var j in a) { + + ~~ => Pos: (324 to 325) SpanInfo: {"start":324,"length":1} + >a + >:=> (line 23, col 18) to (line 23, col 19) +23 > for (var j in a) { + + ~~~ => Pos: (326 to 328) SpanInfo: undefined +-------------------------------- +24 > obj.z = a[j]; + + ~~~~~~~~ => Pos: (329 to 336) SpanInfo: undefined +24 > obj.z = a[j]; + + ~~~~ => Pos: (337 to 340) SpanInfo: {"start":337,"length":3} + >obj + >:=> (line 24, col 8) to (line 24, col 11) +24 > obj.z = a[j]; + + ~~ => Pos: (341 to 342) SpanInfo: {"start":337,"length":5} + >obj.z + >:=> (line 24, col 8) to (line 24, col 13) +24 > obj.z = a[j]; + + ~~ => Pos: (343 to 344) SpanInfo: undefined +24 > obj.z = a[j]; + + ~~ => Pos: (345 to 346) SpanInfo: {"start":345,"length":1} + >a + >:=> (line 24, col 16) to (line 24, col 17) +24 > obj.z = a[j]; + + ~~ => Pos: (347 to 348) SpanInfo: {"start":347,"length":1} + >j + >:=> (line 24, col 18) to (line 24, col 19) +24 > obj.z = a[j]; + + ~~ => Pos: (349 to 350) SpanInfo: undefined +-------------------------------- +25 > var v = 10; + + ~~~~~~~~~~~~ => Pos: (351 to 362) SpanInfo: undefined +25 > var v = 10; + + ~~ => Pos: (363 to 364) SpanInfo: {"start":363,"length":1} + >v + >:=> (line 25, col 12) to (line 25, col 13) +25 > var v = 10; + + ~~~~~~ => Pos: (365 to 370) SpanInfo: undefined +-------------------------------- +26 > } + + ~~~~~~ => Pos: (371 to 376) SpanInfo: undefined +-------------------------------- +27 > try { + + ~~~~~~~~~~ => Pos: (377 to 386) SpanInfo: undefined +-------------------------------- +28 > obj.q = "ohhh"; + + ~~~~~~~~ => Pos: (387 to 394) SpanInfo: undefined +28 > obj.q = "ohhh"; + + ~~~~ => Pos: (395 to 398) SpanInfo: {"start":395,"length":3} + >obj + >:=> (line 28, col 8) to (line 28, col 11) +28 > obj.q = "ohhh"; + + ~~ => Pos: (399 to 400) SpanInfo: {"start":395,"length":5} + >obj.q + >:=> (line 28, col 8) to (line 28, col 13) +28 > obj.q = "ohhh"; + + ~~ => Pos: (401 to 402) SpanInfo: undefined +28 > obj.q = "ohhh"; + + ~~~~~~~ => Pos: (403 to 409) SpanInfo: {"start":403,"length":6} + >"ohhh" + >:=> (line 28, col 16) to (line 28, col 22) +28 > obj.q = "ohhh"; + + ~ => Pos: (410 to 410) SpanInfo: undefined +-------------------------------- +29 > } catch (e) { + + ~~~~~~~~~~~~~ => Pos: (411 to 423) SpanInfo: undefined +29 > } catch (e) { + + ~~ => Pos: (424 to 425) SpanInfo: {"start":424,"length":1} + >e + >:=> (line 29, col 13) to (line 29, col 14) +29 > } catch (e) { + + ~~~ => Pos: (426 to 428) SpanInfo: undefined +-------------------------------- +30 > if (obj.z < 10) { + + ~~~~~~~~~~~~ => Pos: (429 to 440) SpanInfo: undefined +30 > if (obj.z < 10) { + + ~~~~ => Pos: (441 to 444) SpanInfo: {"start":441,"length":3} + >obj + >:=> (line 30, col 12) to (line 30, col 15) +30 > if (obj.z < 10) { + + ~~ => Pos: (445 to 446) SpanInfo: {"start":441,"length":5} + >obj.z + >:=> (line 30, col 12) to (line 30, col 17) +30 > if (obj.z < 10) { + + ~~~~~~~~ => Pos: (447 to 454) SpanInfo: undefined +-------------------------------- +31 > obj.z = 12; + + ~~~~~~~~~~~~ => Pos: (455 to 466) SpanInfo: undefined +31 > obj.z = 12; + + ~~~~ => Pos: (467 to 470) SpanInfo: {"start":467,"length":3} + >obj + >:=> (line 31, col 12) to (line 31, col 15) +31 > obj.z = 12; + + ~~ => Pos: (471 to 472) SpanInfo: {"start":467,"length":5} + >obj.z + >:=> (line 31, col 12) to (line 31, col 17) +31 > obj.z = 12; + + ~~~~~~ => Pos: (473 to 478) SpanInfo: undefined +-------------------------------- +32 > } else { + + ~~~~~~~~~~~~~~~~~ => Pos: (479 to 495) SpanInfo: undefined +-------------------------------- +33 > obj.q = "hmm"; + + ~~~~~~~~~~~~ => Pos: (496 to 507) SpanInfo: undefined +33 > obj.q = "hmm"; + + ~~~~ => Pos: (508 to 511) SpanInfo: {"start":508,"length":3} + >obj + >:=> (line 33, col 12) to (line 33, col 15) +33 > obj.q = "hmm"; + + ~~ => Pos: (512 to 513) SpanInfo: {"start":508,"length":5} + >obj.q + >:=> (line 33, col 12) to (line 33, col 17) +33 > obj.q = "hmm"; + + ~~ => Pos: (514 to 515) SpanInfo: undefined +33 > obj.q = "hmm"; + + ~~~~~~ => Pos: (516 to 521) SpanInfo: {"start":516,"length":5} + >"hmm" + >:=> (line 33, col 20) to (line 33, col 25) +33 > obj.q = "hmm"; + + ~ => Pos: (522 to 522) SpanInfo: undefined +-------------------------------- +34 > } + + ~~~~~~~~~~ => Pos: (523 to 532) SpanInfo: undefined +-------------------------------- +35 > } + + ~~~~~~ => Pos: (533 to 538) SpanInfo: undefined +-------------------------------- +36 > try { + + ~~~~~~~~~~ => Pos: (539 to 548) SpanInfo: undefined +-------------------------------- +37 > throw new Error(); + + ~~~~~~~~~~~~~~~~~~ => Pos: (549 to 566) SpanInfo: undefined +37 > throw new Error(); + + ~~~~~~ => Pos: (567 to 572) SpanInfo: {"start":567,"length":5} + >Error + >:=> (line 37, col 18) to (line 37, col 23) +37 > throw new Error(); + + ~~~ => Pos: (573 to 575) SpanInfo: undefined +-------------------------------- +38 > } catch (e1) { + + ~~~~~~~~~~~~~ => Pos: (576 to 588) SpanInfo: undefined +38 > } catch (e1) { + + ~~~ => Pos: (589 to 591) SpanInfo: {"start":589,"length":2} + >e1 + >:=> (line 38, col 13) to (line 38, col 15) +38 > } catch (e1) { + + ~~~ => Pos: (592 to 594) SpanInfo: undefined +-------------------------------- +39 > var b = e1; + + ~~~~~~~~~~~~ => Pos: (595 to 606) SpanInfo: undefined +39 > var b = e1; + + ~~ => Pos: (607 to 608) SpanInfo: {"start":607,"length":1} + >b + >:=> (line 39, col 12) to (line 39, col 13) +39 > var b = e1; + + ~~ => Pos: (609 to 610) SpanInfo: undefined +39 > var b = e1; + + ~~~ => Pos: (611 to 613) SpanInfo: {"start":611,"length":2} + >e1 + >:=> (line 39, col 16) to (line 39, col 18) +39 > var b = e1; + + ~ => Pos: (614 to 614) SpanInfo: undefined +-------------------------------- +40 > } finally { + + ~~~~~~~~~~~~~~~~ => Pos: (615 to 630) SpanInfo: undefined +-------------------------------- +41 > y = 70; + + ~~~~~~~~ => Pos: (631 to 638) SpanInfo: undefined +41 > y = 70; + + ~~ => Pos: (639 to 640) SpanInfo: {"start":639,"length":1} + >y + >:=> (line 41, col 8) to (line 41, col 9) +41 > y = 70; + + ~~~~~~ => Pos: (641 to 646) SpanInfo: undefined +-------------------------------- +42 > } + + ~~~~~~ => Pos: (647 to 652) SpanInfo: undefined +-------------------------------- +43 > with (obj) { + + ~~~~~~~~~~ => Pos: (653 to 662) SpanInfo: undefined +43 > with (obj) { + + ~~~~ => Pos: (663 to 666) SpanInfo: {"start":663,"length":3} + >obj + >:=> (line 43, col 10) to (line 43, col 13) +43 > with (obj) { + + ~~~ => Pos: (667 to 669) SpanInfo: undefined +-------------------------------- +44 > i = 2; + + ~~~~~~~~ => Pos: (670 to 677) SpanInfo: undefined +44 > i = 2; + + ~~ => Pos: (678 to 679) SpanInfo: {"start":678,"length":1} + >i + >:=> (line 44, col 8) to (line 44, col 9) +44 > i = 2; + + ~~~~~ => Pos: (680 to 684) SpanInfo: undefined +-------------------------------- +45 > z = 10; + + ~~~~~~~~ => Pos: (685 to 692) SpanInfo: undefined +45 > z = 10; + + ~~ => Pos: (693 to 694) SpanInfo: {"start":693,"length":1} + >z + >:=> (line 45, col 8) to (line 45, col 9) +45 > z = 10; + + ~~~~~~ => Pos: (695 to 700) SpanInfo: undefined +-------------------------------- +46 > } + + ~~~~~~ => Pos: (701 to 706) SpanInfo: undefined +-------------------------------- +47 > switch (obj.z) { + + ~~~~~~~~~~~~ => Pos: (707 to 718) SpanInfo: undefined +47 > switch (obj.z) { + + ~~~~ => Pos: (719 to 722) SpanInfo: {"start":719,"length":3} + >obj + >:=> (line 47, col 12) to (line 47, col 15) +47 > switch (obj.z) { + + ~~ => Pos: (723 to 724) SpanInfo: {"start":719,"length":5} + >obj.z + >:=> (line 47, col 12) to (line 47, col 17) +47 > switch (obj.z) { + + ~~~ => Pos: (725 to 727) SpanInfo: undefined +-------------------------------- +48 > case 0: { + + ~~~~~~~~~~~~~~~~~~ => Pos: (728 to 745) SpanInfo: undefined +-------------------------------- +49 > x++; + + ~~~~~~~~~~~~ => Pos: (746 to 757) SpanInfo: undefined +49 > x++; + + ~~ => Pos: (758 to 759) SpanInfo: {"start":758,"length":1} + >x + >:=> (line 49, col 12) to (line 49, col 13) +49 > x++; + + ~~~ => Pos: (760 to 762) SpanInfo: undefined +-------------------------------- +50 > break; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (763 to 781) SpanInfo: undefined +-------------------------------- +51 > + + ~ => Pos: (782 to 782) SpanInfo: undefined +-------------------------------- +52 > } + + ~~~~~~~~~~ => Pos: (783 to 792) SpanInfo: undefined +-------------------------------- +53 > case 1: { + + ~~~~~~~~~~~~~~~~~~ => Pos: (793 to 810) SpanInfo: undefined +-------------------------------- +54 > x--; + + ~~~~~~~~~~~~ => Pos: (811 to 822) SpanInfo: undefined +54 > x--; + + ~~ => Pos: (823 to 824) SpanInfo: {"start":823,"length":1} + >x + >:=> (line 54, col 12) to (line 54, col 13) +54 > x--; + + ~~~ => Pos: (825 to 827) SpanInfo: undefined +-------------------------------- +55 > break; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (828 to 846) SpanInfo: undefined +-------------------------------- +56 > + + ~ => Pos: (847 to 847) SpanInfo: undefined +-------------------------------- +57 > } + + ~~~~~~~~~~ => Pos: (848 to 857) SpanInfo: undefined +-------------------------------- +58 > default: { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (858 to 876) SpanInfo: undefined +-------------------------------- +59 > x *= 2; + + ~~~~~~~~~~~~ => Pos: (877 to 888) SpanInfo: undefined +59 > x *= 2; + + ~~ => Pos: (889 to 890) SpanInfo: {"start":889,"length":1} + >x + >:=> (line 59, col 12) to (line 59, col 13) +59 > x *= 2; + + ~~~~~~ => Pos: (891 to 896) SpanInfo: undefined +-------------------------------- +60 > x = 50; + + ~~~~~~~~~~~~ => Pos: (897 to 908) SpanInfo: undefined +60 > x = 50; + + ~~ => Pos: (909 to 910) SpanInfo: {"start":909,"length":1} + >x + >:=> (line 60, col 12) to (line 60, col 13) +60 > x = 50; + + ~~~~~~ => Pos: (911 to 916) SpanInfo: undefined +-------------------------------- +61 > break; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (917 to 935) SpanInfo: undefined +-------------------------------- +62 > + + ~ => Pos: (936 to 936) SpanInfo: undefined +-------------------------------- +63 > } + + ~~~~~~~~~~ => Pos: (937 to 946) SpanInfo: undefined +-------------------------------- +64 > } + + ~~~~~~ => Pos: (947 to 952) SpanInfo: undefined +-------------------------------- +65 > while (x < 10) { + + ~~~~~~~~~~~ => Pos: (953 to 963) SpanInfo: undefined +65 > while (x < 10) { + + ~~ => Pos: (964 to 965) SpanInfo: {"start":964,"length":1} + >x + >:=> (line 65, col 11) to (line 65, col 12) +65 > while (x < 10) { + + ~~~~~~~~ => Pos: (966 to 973) SpanInfo: undefined +-------------------------------- +66 > x++; + + ~~~~~~~~ => Pos: (974 to 981) SpanInfo: undefined +66 > x++; + + ~~ => Pos: (982 to 983) SpanInfo: {"start":982,"length":1} + >x + >:=> (line 66, col 8) to (line 66, col 9) +66 > x++; + + ~~~ => Pos: (984 to 986) SpanInfo: undefined +-------------------------------- +67 > } + + ~~~~~~ => Pos: (987 to 992) SpanInfo: undefined +-------------------------------- +68 > do { + + ~~~~~~~~~ => Pos: (993 to 1001) SpanInfo: undefined +-------------------------------- +69 > x--; + + ~~~~~~~~ => Pos: (1002 to 1009) SpanInfo: undefined +69 > x--; + + ~~ => Pos: (1010 to 1011) SpanInfo: {"start":1010,"length":1} + >x + >:=> (line 69, col 8) to (line 69, col 9) +69 > x--; + + ~~~ => Pos: (1012 to 1014) SpanInfo: undefined +-------------------------------- +70 > } while (x > 4) + + ~~~~~~~~~~~~~ => Pos: (1015 to 1027) SpanInfo: undefined +70 > } while (x > 4) + + ~~ => Pos: (1028 to 1029) SpanInfo: {"start":1028,"length":1} + >x + >:=> (line 70, col 13) to (line 70, col 14) +70 > } while (x > 4) + + ~~~~~ => Pos: (1030 to 1034) SpanInfo: undefined +-------------------------------- +71 > x = y; + + ~~~~ => Pos: (1035 to 1038) SpanInfo: undefined +71 > x = y; + + ~~ => Pos: (1039 to 1040) SpanInfo: {"start":1039,"length":1} + >x + >:=> (line 71, col 4) to (line 71, col 5) +71 > x = y; + + ~~ => Pos: (1041 to 1042) SpanInfo: undefined +71 > x = y; + + ~~ => Pos: (1043 to 1044) SpanInfo: {"start":1043,"length":1} + >y + >:=> (line 71, col 8) to (line 71, col 9) +71 > x = y; + + ~ => Pos: (1045 to 1045) SpanInfo: undefined +-------------------------------- +72 > var z = (x == 1) ? x + 1 : x - 1; + + ~~~~~~~~ => Pos: (1046 to 1053) SpanInfo: undefined +72 > var z = (x == 1) ? x + 1 : x - 1; + + ~~ => Pos: (1054 to 1055) SpanInfo: {"start":1054,"length":1} + >z + >:=> (line 72, col 8) to (line 72, col 9) +72 > var z = (x == 1) ? x + 1 : x - 1; + + ~~~ => Pos: (1056 to 1058) SpanInfo: undefined +72 > var z = (x == 1) ? x + 1 : x - 1; + + ~~ => Pos: (1059 to 1060) SpanInfo: {"start":1059,"length":1} + >x + >:=> (line 72, col 13) to (line 72, col 14) +72 > var z = (x == 1) ? x + 1 : x - 1; + + ~~~~~~~~ => Pos: (1061 to 1068) SpanInfo: undefined +72 > var z = (x == 1) ? x + 1 : x - 1; + + ~~ => Pos: (1069 to 1070) SpanInfo: {"start":1069,"length":1} + >x + >:=> (line 72, col 23) to (line 72, col 24) +72 > var z = (x == 1) ? x + 1 : x - 1; + + ~~~~~~ => Pos: (1071 to 1076) SpanInfo: undefined +72 > var z = (x == 1) ? x + 1 : x - 1; + + ~~ => Pos: (1077 to 1078) SpanInfo: {"start":1077,"length":1} + >x + >:=> (line 72, col 31) to (line 72, col 32) +72 > var z = (x == 1) ? x + 1 : x - 1; + + ~~~~~ => Pos: (1079 to 1083) SpanInfo: undefined +-------------------------------- +73 > (x == 1) ? x + 1 : x - 1; + + ~~~~~ => Pos: (1084 to 1088) SpanInfo: undefined +73 > (x == 1) ? x + 1 : x - 1; + + ~~ => Pos: (1089 to 1090) SpanInfo: {"start":1089,"length":1} + >x + >:=> (line 73, col 5) to (line 73, col 6) +73 > (x == 1) ? x + 1 : x - 1; + + ~~~~~~~~ => Pos: (1091 to 1098) SpanInfo: undefined +73 > (x == 1) ? x + 1 : x - 1; + + ~~ => Pos: (1099 to 1100) SpanInfo: {"start":1099,"length":1} + >x + >:=> (line 73, col 15) to (line 73, col 16) +73 > (x == 1) ? x + 1 : x - 1; + + ~~~~~~ => Pos: (1101 to 1106) SpanInfo: undefined +73 > (x == 1) ? x + 1 : x - 1; + + ~~ => Pos: (1107 to 1108) SpanInfo: {"start":1107,"length":1} + >x + >:=> (line 73, col 23) to (line 73, col 24) +73 > (x == 1) ? x + 1 : x - 1; + + ~~~~~ => Pos: (1109 to 1113) SpanInfo: undefined +-------------------------------- +74 > x === 1; + + ~~~~ => Pos: (1114 to 1117) SpanInfo: undefined +74 > x === 1; + + ~~ => Pos: (1118 to 1119) SpanInfo: {"start":1118,"length":1} + >x + >:=> (line 74, col 4) to (line 74, col 5) +74 > x === 1; + + ~~~~~~~ => Pos: (1120 to 1126) SpanInfo: undefined +-------------------------------- +75 > x = z = 40; + + ~~~~ => Pos: (1127 to 1130) SpanInfo: undefined +75 > x = z = 40; + + ~~ => Pos: (1131 to 1132) SpanInfo: {"start":1131,"length":1} + >x + >:=> (line 75, col 4) to (line 75, col 5) +75 > x = z = 40; + + ~~ => Pos: (1133 to 1134) SpanInfo: undefined +75 > x = z = 40; + + ~~ => Pos: (1135 to 1136) SpanInfo: {"start":1135,"length":1} + >z + >:=> (line 75, col 8) to (line 75, col 9) +75 > x = z = 40; + + ~~~~~~ => Pos: (1137 to 1142) SpanInfo: undefined +-------------------------------- +76 > eval("y"); + + ~~~~ => Pos: (1143 to 1146) SpanInfo: undefined +76 > eval("y"); + + ~~~~~ => Pos: (1147 to 1151) SpanInfo: {"start":1147,"length":4} + >eval + >:=> (line 76, col 4) to (line 76, col 8) +76 > eval("y"); + + ~~~~ => Pos: (1152 to 1155) SpanInfo: {"start":1152,"length":3} + >"y" + >:=> (line 76, col 9) to (line 76, col 12) +76 > eval("y"); + + ~~ => Pos: (1156 to 1157) SpanInfo: undefined +-------------------------------- +77 > return; + + ~~~~~~~~~~~~ => Pos: (1158 to 1169) SpanInfo: undefined +-------------------------------- +78 >} + + ~~ => Pos: (1170 to 1171) SpanInfo: undefined +-------------------------------- +79 >var b = function () { + + ~~~~ => Pos: (1172 to 1175) SpanInfo: undefined +79 >var b = function () { + + ~~ => Pos: (1176 to 1177) SpanInfo: {"start":1176,"length":1} + >b + >:=> (line 79, col 4) to (line 79, col 5) +79 >var b = function () { + + ~~~~~~~~~~~~~~~~ => Pos: (1178 to 1193) SpanInfo: undefined +-------------------------------- +80 > var x = 10; + + ~~~~~~~~ => Pos: (1194 to 1201) SpanInfo: undefined +80 > var x = 10; + + ~~ => Pos: (1202 to 1203) SpanInfo: {"start":1202,"length":1} + >x + >:=> (line 80, col 8) to (line 80, col 9) +80 > var x = 10; + + ~~~~~~ => Pos: (1204 to 1209) SpanInfo: undefined +-------------------------------- +81 > x = x + 1; + + ~~~~ => Pos: (1210 to 1213) SpanInfo: undefined +81 > x = x + 1; + + ~~ => Pos: (1214 to 1215) SpanInfo: {"start":1214,"length":1} + >x + >:=> (line 81, col 4) to (line 81, col 5) +81 > x = x + 1; + + ~~ => Pos: (1216 to 1217) SpanInfo: undefined +81 > x = x + 1; + + ~~ => Pos: (1218 to 1219) SpanInfo: {"start":1218,"length":1} + >x + >:=> (line 81, col 8) to (line 81, col 9) +81 > x = x + 1; + + ~~~~~ => Pos: (1220 to 1224) SpanInfo: undefined +-------------------------------- +82 >}; + + ~~~ => Pos: (1225 to 1227) SpanInfo: undefined +-------------------------------- +83 >f(); + ~~ => Pos: (1228 to 1229) SpanInfo: {"start":1228,"length":1} + >f + >:=> (line 83, col 0) to (line 83, col 1) +83 >f(); + ~~ => Pos: (1230 to 1231) SpanInfo: undefined \ No newline at end of file diff --git a/tests/baselines/reference/nameWithFileExtension.errors.txt b/tests/baselines/reference/nameWithFileExtension.errors.txt index 154ed8047ff..ed4a1165e7e 100644 --- a/tests/baselines/reference/nameWithFileExtension.errors.txt +++ b/tests/baselines/reference/nameWithFileExtension.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/externalModules/foo_1.ts(1,22): error TS2307: Cannot find external module './foo_0.js'. + + ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require('./foo_0.js'); ~~~~~~~~~~~~ -!!! Cannot find external module './foo_0.js'. +!!! error TS2307: Cannot find external module './foo_0.js'. var x = foo.foo + 42; ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/namedFunctionExpressionCallErrors.errors.txt b/tests/baselines/reference/namedFunctionExpressionCallErrors.errors.txt index 22be4433c13..c928b002a1f 100644 --- a/tests/baselines/reference/namedFunctionExpressionCallErrors.errors.txt +++ b/tests/baselines/reference/namedFunctionExpressionCallErrors.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/namedFunctionExpressionCallErrors.ts(5,1): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/namedFunctionExpressionCallErrors.ts(12,5): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/namedFunctionExpressionCallErrors.ts(16,1): error TS2304: Cannot find name 'bar'. + + ==== tests/cases/compiler/namedFunctionExpressionCallErrors.ts (3 errors) ==== var recurser = function foo() { }; @@ -5,7 +10,7 @@ // Error: foo should not be visible here foo(); ~~~ -!!! Cannot find name 'foo'. +!!! error TS2304: Cannot find name 'foo'. // recurser should be recurser(); @@ -14,10 +19,10 @@ // Error: foo should not be visible here either foo(); ~~~ -!!! Cannot find name 'foo'. +!!! error TS2304: Cannot find name 'foo'. }); // Error: bar should not be visible bar(); ~~~ -!!! Cannot find name 'bar'. \ No newline at end of file +!!! error TS2304: Cannot find name 'bar'. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt b/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt index f8dc0aeb6d8..ac59b71bbc3 100644 --- a/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt +++ b/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt @@ -1,33 +1,45 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(4,15): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(4,25): error TS1005: '=' expected. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(4,26): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(12,14): error TS1109: Expression expected. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(7,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(7,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(8,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(8,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(9,17): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts(9,29): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + ==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts (10 errors) ==== // Unary operator - // operand before - var NUMBER1 = var NUMBER-; //expect error ~~~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~ -!!! '=' expected. +!!! error TS1005: '=' expected. ~ -!!! Expression expected. +!!! error TS1109: Expression expected. // invalid expressions var NUMBER2 = -(null - undefined); ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var NUMBER3 = -(null - null); ~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. var NUMBER4 = -(undefined - undefined); ~~~~~~~~~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~~~~~~~~~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. // miss operand var NUMBER =-; ~ -!!! Expression expected. \ No newline at end of file +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.types b/tests/baselines/reference/negateOperatorWithAnyOtherType.types index 8785ab073b2..85a2d9c9233 100644 --- a/tests/baselines/reference/negateOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.types @@ -9,7 +9,7 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] ->["", ""] : any[] +>["", ""] : string[] var obj: () => {} >obj : () => {} diff --git a/tests/baselines/reference/negateOperatorWithEnumType.js b/tests/baselines/reference/negateOperatorWithEnumType.js index a3235a3ccc0..77458f442df 100644 --- a/tests/baselines/reference/negateOperatorWithEnumType.js +++ b/tests/baselines/reference/negateOperatorWithEnumType.js @@ -2,19 +2,19 @@ // - operator on enum type enum ENUM { }; -enum ENUM1 { 1, 2, "" }; +enum ENUM1 { A, B, "" }; // enum type var var ResultIsNumber1 = -ENUM; // expressions -var ResultIsNumber2 = -ENUM1[1]; -var ResultIsNumber3 = -(ENUM1[1] + ENUM1[2]); +var ResultIsNumber2 = -ENUM1["B"]; +var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); // miss assignment operators -ENUM; -ENUM1; --ENUM1[1]; +-ENUM1["B"]; -ENUM, ENUM1; //// [negateOperatorWithEnumType.js] @@ -25,18 +25,18 @@ var ENUM; ; var ENUM1; (function (ENUM1) { - ENUM1[ENUM1["1"] = 0] = "1"; - ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1["A"] = 0] = "A"; + ENUM1[ENUM1["B"] = 1] = "B"; ENUM1[ENUM1[""] = 2] = ""; })(ENUM1 || (ENUM1 = {})); ; // enum type var var ResultIsNumber1 = -ENUM; // expressions -var ResultIsNumber2 = -ENUM1[1]; -var ResultIsNumber3 = -(ENUM1[1] + ENUM1[2]); +var ResultIsNumber2 = -1 /* "B" */; +var ResultIsNumber3 = -(1 /* B */ + 2 /* "" */); // miss assignment operators -ENUM; -ENUM1; --ENUM1[1]; +-1 /* "B" */; -ENUM, ENUM1; diff --git a/tests/baselines/reference/negateOperatorWithEnumType.types b/tests/baselines/reference/negateOperatorWithEnumType.types index b2e0cb91c51..96a33ff4c6e 100644 --- a/tests/baselines/reference/negateOperatorWithEnumType.types +++ b/tests/baselines/reference/negateOperatorWithEnumType.types @@ -4,8 +4,10 @@ enum ENUM { }; >ENUM : ENUM -enum ENUM1 { 1, 2, "" }; +enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 +>A : ENUM1 +>B : ENUM1 // enum type var var ResultIsNumber1 = -ENUM; @@ -14,20 +16,21 @@ var ResultIsNumber1 = -ENUM; >ENUM : typeof ENUM // expressions -var ResultIsNumber2 = -ENUM1[1]; +var ResultIsNumber2 = -ENUM1["B"]; >ResultIsNumber2 : number ->-ENUM1[1] : number ->ENUM1[1] : ENUM1 +>-ENUM1["B"] : number +>ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 -var ResultIsNumber3 = -(ENUM1[1] + ENUM1[2]); +var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); >ResultIsNumber3 : number ->-(ENUM1[1] + ENUM1[2]) : number ->(ENUM1[1] + ENUM1[2]) : number ->ENUM1[1] + ENUM1[2] : number ->ENUM1[1] : ENUM1 +>-(ENUM1.B + ENUM1[""]) : number +>(ENUM1.B + ENUM1[""]) : number +>ENUM1.B + ENUM1[""] : number +>ENUM1.B : ENUM1 >ENUM1 : typeof ENUM1 ->ENUM1[2] : ENUM1 +>B : ENUM1 +>ENUM1[""] : ENUM1 >ENUM1 : typeof ENUM1 // miss assignment operators @@ -39,9 +42,9 @@ var ResultIsNumber3 = -(ENUM1[1] + ENUM1[2]); >-ENUM1 : number >ENUM1 : typeof ENUM1 --ENUM1[1]; ->-ENUM1[1] : number ->ENUM1[1] : ENUM1 +-ENUM1["B"]; +>-ENUM1["B"] : number +>ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 -ENUM, ENUM1; diff --git a/tests/baselines/reference/nestedClassDeclaration.errors.txt b/tests/baselines/reference/nestedClassDeclaration.errors.txt index 1e64dad4968..f3145467231 100644 --- a/tests/baselines/reference/nestedClassDeclaration.errors.txt +++ b/tests/baselines/reference/nestedClassDeclaration.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/classes/nestedClassDeclaration.ts(5,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/classes/nestedClassDeclaration.ts(7,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/classes/nestedClassDeclaration.ts(10,5): error TS1129: Statement expected. +tests/cases/conformance/classes/nestedClassDeclaration.ts(12,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/classes/nestedClassDeclaration.ts(15,11): error TS1005: ':' expected. +tests/cases/conformance/classes/nestedClassDeclaration.ts(15,14): error TS1005: ',' expected. +tests/cases/conformance/classes/nestedClassDeclaration.ts(17,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/classes/nestedClassDeclaration.ts(15,11): error TS2304: Cannot find name 'C4'. + + ==== tests/cases/conformance/classes/nestedClassDeclaration.ts (8 errors) ==== // nested classes are not allowed @@ -5,31 +15,31 @@ x: string; class C2 { ~~~~~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. } } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. function foo() { class C3 { ~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. } } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. var x = { class C4 { ~~ -!!! ':' expected. +!!! error TS1005: ':' expected. ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~~ -!!! Cannot find name 'C4'. +!!! error TS2304: Cannot find name 'C4'. } } ~ -!!! Declaration or statement expected. +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/nestedRecursiveLambda.types b/tests/baselines/reference/nestedRecursiveLambda.types index 358ebda8abf..864daea3e1f 100644 --- a/tests/baselines/reference/nestedRecursiveLambda.types +++ b/tests/baselines/reference/nestedRecursiveLambda.types @@ -35,7 +35,7 @@ void(r =>(r => r)); >r : any [(r =>(r => r))] ->[(r =>(r => r))] : { (r: any): (r: any) => any; }[] +>[(r =>(r => r))] : ((r: any) => (r: any) => any)[] >(r =>(r => r)) : (r: any) => (r: any) => any >r =>(r => r) : (r: any) => (r: any) => any >r : any diff --git a/tests/baselines/reference/newExpressionWithCast.errors.txt b/tests/baselines/reference/newExpressionWithCast.errors.txt index a7e9ef10d50..858fd81f0ee 100644 --- a/tests/baselines/reference/newExpressionWithCast.errors.txt +++ b/tests/baselines/reference/newExpressionWithCast.errors.txt @@ -1,20 +1,26 @@ +tests/cases/compiler/newExpressionWithCast.ts(8,17): error TS1109: Expression expected. +tests/cases/compiler/newExpressionWithCast.ts(4,12): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. +tests/cases/compiler/newExpressionWithCast.ts(8,13): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'void'. +tests/cases/compiler/newExpressionWithCast.ts(8,18): error TS2304: Cannot find name 'any'. + + ==== tests/cases/compiler/newExpressionWithCast.ts (4 errors) ==== function Test() { } // valid but error with noImplicitAny var test = new Test(); ~~~~~~~~~~ -!!! 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. function Test2() { } // parse error var test2 = new Test2(); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~~~~~~~~~~~~ -!!! Operator '>' cannot be applied to types 'boolean' and 'void'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'void'. ~~~ -!!! Cannot find name 'any'. +!!! error TS2304: Cannot find name 'any'. function Test3() { } // valid with noImplicitAny diff --git a/tests/baselines/reference/newFunctionImplicitAny.errors.txt b/tests/baselines/reference/newFunctionImplicitAny.errors.txt index 2f507f61557..7aa6c150594 100644 --- a/tests/baselines/reference/newFunctionImplicitAny.errors.txt +++ b/tests/baselines/reference/newFunctionImplicitAny.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/newFunctionImplicitAny.ts(4,12): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + + ==== tests/cases/compiler/newFunctionImplicitAny.ts (1 errors) ==== // No implicit any error given when newing a function (up for debate) function Test() { } var test = new Test(); ~~~~~~~~~~ -!!! 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. \ No newline at end of file +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/newMissingIdentifier.errors.txt b/tests/baselines/reference/newMissingIdentifier.errors.txt index 673129e5b09..fec97eb3d88 100644 --- a/tests/baselines/reference/newMissingIdentifier.errors.txt +++ b/tests/baselines/reference/newMissingIdentifier.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/newMissingIdentifier.ts(1,14): error TS1109: Expression expected. + + ==== tests/cases/compiler/newMissingIdentifier.ts (1 errors) ==== var x = new (); ~ -!!! Expression expected. +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/newNonReferenceType.errors.txt b/tests/baselines/reference/newNonReferenceType.errors.txt index 68761488aa7..a68eba9b9e7 100644 --- a/tests/baselines/reference/newNonReferenceType.errors.txt +++ b/tests/baselines/reference/newNonReferenceType.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/newNonReferenceType.ts(1,13): error TS2304: Cannot find name 'any'. +tests/cases/compiler/newNonReferenceType.ts(2,13): error TS2304: Cannot find name 'boolean'. + + ==== tests/cases/compiler/newNonReferenceType.ts (2 errors) ==== var a = new any(); ~~~ -!!! Cannot find name 'any'. +!!! error TS2304: Cannot find name 'any'. var b = new boolean(); // error ~~~~~~~ -!!! Cannot find name 'boolean'. +!!! error TS2304: Cannot find name 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/newOnInstanceSymbol.errors.txt b/tests/baselines/reference/newOnInstanceSymbol.errors.txt index 11f9e589db4..99af44524cd 100644 --- a/tests/baselines/reference/newOnInstanceSymbol.errors.txt +++ b/tests/baselines/reference/newOnInstanceSymbol.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/newOnInstanceSymbol.ts(3,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + + ==== tests/cases/compiler/newOnInstanceSymbol.ts (1 errors) ==== class C {} var x = new C(); // should be ok new x(); // should error ~~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. \ No newline at end of file +!!! 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/newOperator.errors.txt b/tests/baselines/reference/newOperator.errors.txt index f522ce63f85..9232b865648 100644 --- a/tests/baselines/reference/newOperator.errors.txt +++ b/tests/baselines/reference/newOperator.errors.txt @@ -1,9 +1,22 @@ +tests/cases/compiler/newOperator.ts(18,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/newOperator.ts(20,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/newOperator.ts(44,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/newOperator.ts(3,13): error TS2304: Cannot find name 'ifc'. +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'. +tests/cases/compiler/newOperator.ts(18,14): error TS2304: Cannot find name 'string'. +tests/cases/compiler/newOperator.ts(21,1): error TS2304: Cannot find name 'string'. +tests/cases/compiler/newOperator.ts(28,13): error TS2304: Cannot find name 'q'. +tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + + ==== tests/cases/compiler/newOperator.ts (11 errors) ==== interface ifc { } // Attempting to 'new' an interface yields poor error var i = new ifc(); ~~~ -!!! Cannot find name 'ifc'. +!!! error TS2304: Cannot find name 'ifc'. // Parens are optional var x = new Date; @@ -12,45 +25,47 @@ // Target is not a class or var, good error var t1 = new 53(); ~~~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var t2 = new ''(); ~~~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. new string; ~~~~~~ -!!! Cannot find name 'string'. +!!! error TS2304: Cannot find name 'string'. // Use in LHS of expression? (new Date()).toString(); // Various spacing var t3 = new string[]( ); - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~~~~~~ +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ -!!! Cannot find name 'string'. +!!! error TS2304: Cannot find name 'string'. var t4 = new + ~~~ string ~~~~~~ -!!! Cannot find name 'string'. + ~~~~~~ +!!! error TS2304: Cannot find name 'string'. [ ~ ] ~~~~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ( ); // Unresolved symbol var f = new q(); ~ -!!! Cannot find name 'q'. +!!! error TS2304: Cannot find name 'q'. // not legal var t5 = new new Date; ~~~~~~~~~~~~ -!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. // Can be an expression new String; @@ -64,9 +79,9 @@ class S { public get xs(): M.T[] { + ~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return new M.T[]; - ~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. } } \ No newline at end of file diff --git a/tests/baselines/reference/newOperatorErrorCases.errors.txt b/tests/baselines/reference/newOperatorErrorCases.errors.txt index 17dd55d0ebb..8b94c902e50 100644 --- a/tests/baselines/reference/newOperatorErrorCases.errors.txt +++ b/tests/baselines/reference/newOperatorErrorCases.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS1005: ',' expected. +tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(32,23): error TS1109: Expression expected. +tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(32,16): error TS2304: Cannot find name 'string'. +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 (4 errors) ==== class C0 { @@ -27,21 +33,21 @@ // Construct expression with no parentheses for construct signature with > 0 parameters var b = new C0 32, ''; // Parse error ~~ -!!! ',' expected. +!!! error TS1005: ',' expected. // Generic construct expression with no parentheses var c1 = new T; var c1: T<{}>; var c2 = new T; // Parse error ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~~~~~~ -!!! Cannot find name 'string'. +!!! error TS2304: Cannot find name 'string'. // Construct expression of non-void returning function function fnNumber(): number { return 32; } var s = new fnNumber(); // Error ~~~~~~~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. +!!! error TS2350: Only a void function can be called with the 'new' keyword. \ No newline at end of file diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.errors.txt b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.errors.txt index 04b5ae07b64..2d322853cfe 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.errors.txt +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.errors.txt @@ -1,8 +1,14 @@ +tests/cases/compiler/noCollisionThisExpressionAndLocalVarInAccessors.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/noCollisionThisExpressionAndLocalVarInAccessors.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/noCollisionThisExpressionAndLocalVarInAccessors.ts(24,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/noCollisionThisExpressionAndLocalVarInAccessors.ts(34,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInAccessors.ts (4 errors) ==== class class1 { get a(): number { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x2 = { doStuff: (callback) => () => { var _this = 2; @@ -14,7 +20,7 @@ } set a(val: number) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var x2 = { doStuff: (callback) => () => { var _this = 2; @@ -28,7 +34,7 @@ class class2 { get a(): number { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var _this = 2; var x2 = { doStuff: (callback) => () => { @@ -40,7 +46,7 @@ } set a(val: number) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var _this = 2; var x2 = { doStuff: (callback) => () => { diff --git a/tests/baselines/reference/noDefaultLib.errors.txt b/tests/baselines/reference/noDefaultLib.errors.txt index 2f411affd56..02098950055 100644 --- a/tests/baselines/reference/noDefaultLib.errors.txt +++ b/tests/baselines/reference/noDefaultLib.errors.txt @@ -1,12 +1,17 @@ -!!! Cannot find global type 'Boolean'. -!!! Cannot find global type 'IArguments'. +error TS2318: Cannot find global type 'Boolean'. +error TS2318: Cannot find global type 'IArguments'. +tests/cases/compiler/noDefaultLib.ts(4,11): error TS2317: Global type 'Array' must have 1 type parameter(s). + + +!!! error TS2318: Cannot find global type 'Boolean'. +!!! error TS2318: Cannot find global type 'IArguments'. ==== tests/cases/compiler/noDefaultLib.ts (1 errors) ==== /// var x; interface Array {} ~~~~~ -!!! Global type 'Array' must have 1 type parameter(s). +!!! error TS2317: Global type 'Array' must have 1 type parameter(s). interface String {} interface Number {} interface Object {} diff --git a/tests/baselines/reference/noEmitOnError.errors.txt b/tests/baselines/reference/noEmitOnError.errors.txt new file mode 100644 index 00000000000..e03e5948092 --- /dev/null +++ b/tests/baselines/reference/noEmitOnError.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/noEmitOnError.ts(2,5): error TS2322: Type 'string' 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'. + \ No newline at end of file diff --git a/tests/baselines/reference/noErrorsInCallback.errors.txt b/tests/baselines/reference/noErrorsInCallback.errors.txt index cd7c4beb645..f0bfe00199e 100644 --- a/tests/baselines/reference/noErrorsInCallback.errors.txt +++ b/tests/baselines/reference/noErrorsInCallback.errors.txt @@ -1,13 +1,17 @@ +tests/cases/compiler/noErrorsInCallback.ts(4,19): error TS2345: Argument of type '{}' is not assignable to parameter of type 'string'. +tests/cases/compiler/noErrorsInCallback.ts(6,23): error TS2345: Argument of type '{}' is not assignable to parameter of type 'string'. + + ==== tests/cases/compiler/noErrorsInCallback.ts (2 errors) ==== class Bar { constructor(public foo: string) { } } var one = new Bar({}); // Error ~~ -!!! Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'string'. [].forEach(() => { var two = new Bar({}); // No error? ~~ -!!! Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'string'. }); \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyForIn.errors.txt b/tests/baselines/reference/noImplicitAnyForIn.errors.txt index 7e4122a8f26..2fb8e5a4103 100644 --- a/tests/baselines/reference/noImplicitAnyForIn.errors.txt +++ b/tests/baselines/reference/noImplicitAnyForIn.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/noImplicitAnyForIn.ts(8,18): error TS7017: Index signature of object type implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyForIn.ts(15,18): error TS7017: Index signature of object type implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyForIn.ts(21,9): error TS7005: Variable 'b' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyForIn.ts(29,5): error TS7005: Variable 'n' implicitly has an 'any[][]' type. +tests/cases/compiler/noImplicitAnyForIn.ts(31,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. + + ==== tests/cases/compiler/noImplicitAnyForIn.ts (5 errors) ==== var x: {}[] = [[1, 2, 3], ["hello"]]; @@ -8,7 +15,7 @@ //Should yield an implicit 'any' error var _j = x[i][j]; ~~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. +!!! error TS7017: Index signature of object type implicitly has an 'any' type. } for (var k in x[0]) { @@ -17,7 +24,7 @@ //Should yield an implicit 'any' error var k2 = k1[k]; ~~~~~ -!!! Index signature of object type implicitly has an 'any' type. +!!! error TS7017: Index signature of object type implicitly has an 'any' type. } } @@ -25,7 +32,7 @@ // Should yield an implicit 'any' error. var b; ~ -!!! Variable 'b' implicitly has an 'any' type. +!!! error TS7005: Variable 'b' implicitly has an 'any' type. var c = a || b; } @@ -35,8 +42,8 @@ // Should yield an implicit 'any' error. var n = [[]] || []; ~ -!!! Variable 'n' implicitly has an 'any[][]' type. +!!! error TS7005: Variable 'n' implicitly has an 'any[][]' type. for (n[idx++] in m); ~~~~~~~~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. \ No newline at end of file +!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyForMethodParameters.errors.txt b/tests/baselines/reference/noImplicitAnyForMethodParameters.errors.txt index 622914ea419..176f40f16f3 100644 --- a/tests/baselines/reference/noImplicitAnyForMethodParameters.errors.txt +++ b/tests/baselines/reference/noImplicitAnyForMethodParameters.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/noImplicitAnyForMethodParameters.ts(6,5): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyForMethodParameters.ts(6,16): error TS7006: Parameter 'a' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyForMethodParameters.ts(10,17): error TS7006: Parameter 'a' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyForMethodParameters.ts(13,16): error TS7006: Parameter 'a' implicitly has an 'any' type. + + ==== tests/cases/compiler/noImplicitAnyForMethodParameters.ts (4 errors) ==== declare class A { private foo(a); // OK - ambient class and private method - no error @@ -6,18 +12,18 @@ declare class B { public foo(a); // OK - ambient class and public method - error ~~~~~~~~~~~~~~ -!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. ~ -!!! Parameter 'a' implicitly has an 'any' type. +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. } class C { private foo(a) { } // OK - non-ambient class and private method - error ~ -!!! Parameter 'a' implicitly has an 'any' type. +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. } class D { public foo(a) { } // OK - non-ambient class and public method - error ~ -!!! Parameter 'a' implicitly has an 'any' type. +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyForwardReferencedInterface.errors.txt b/tests/baselines/reference/noImplicitAnyForwardReferencedInterface.errors.txt index 7d02a125569..177d2d66bfe 100644 --- a/tests/baselines/reference/noImplicitAnyForwardReferencedInterface.errors.txt +++ b/tests/baselines/reference/noImplicitAnyForwardReferencedInterface.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/noImplicitAnyForwardReferencedInterface.ts(5,5): error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. + + ==== tests/cases/compiler/noImplicitAnyForwardReferencedInterface.ts (1 errors) ==== declare var x: Entry; @@ -5,5 +8,5 @@ // Should return error for implicit any. new (); ~~~~~~~ -!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.errors.txt b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.errors.txt deleted file mode 100644 index 89c4ffe6ac7..00000000000 --- a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -==== tests/cases/compiler/noImplicitAnyFunctionExpressionAssignment.ts (2 errors) ==== - - var x: (a: any) => void = function (x: T) { - ~~~~~~~~~~~~~~~~~~~~ - return null; - ~~~~~~~~~~~~~~~~ - }; - ~ -!!! Function expression, which lacks return-type annotation, implicitly has an 'any' return type. - - var x2: (a: any) => void = function f(x: T) { - ~~~~~~~~~~~~~~~~~~~~~ - return null; - ~~~~~~~~~~~~~~~~ - }; - ~ -!!! 'f', which lacks return-type annotation, implicitly has an 'any' return type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types new file mode 100644 index 00000000000..b07252dac6d --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types @@ -0,0 +1,24 @@ +=== tests/cases/compiler/noImplicitAnyFunctionExpressionAssignment.ts === + +var x: (a: any) => void = function (x: T) { +>x : (a: any) => void +>a : any +>function (x: T) { return null;} : (x: T) => any +>T : T +>x : T +>T : T + + return null; +}; + +var x2: (a: any) => void = function f(x: T) { +>x2 : (a: any) => void +>a : any +>function f(x: T) { return null;} : (x: T) => any +>f : (x: T) => any +>T : T +>x : T +>T : T + + return null; +}; diff --git a/tests/baselines/reference/noImplicitAnyFunctions.errors.txt b/tests/baselines/reference/noImplicitAnyFunctions.errors.txt index a3768a1c7a5..622dd953150 100644 --- a/tests/baselines/reference/noImplicitAnyFunctions.errors.txt +++ b/tests/baselines/reference/noImplicitAnyFunctions.errors.txt @@ -1,14 +1,21 @@ +tests/cases/compiler/noImplicitAnyFunctions.ts(2,1): error TS7010: 'f1', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyFunctions.ts(6,13): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyFunctions.ts(17,1): error TS7010: 'f6', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyFunctions.ts(19,1): error TS7010: 'f6', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyFunctions.ts(19,24): error TS7006: Parameter 'y' implicitly has an 'any' type. + + ==== tests/cases/compiler/noImplicitAnyFunctions.ts (5 errors) ==== declare function f1(); ~~~~~~~~~~~~~~~~~~~~~~ -!!! 'f1', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'f1', which lacks return-type annotation, implicitly has an 'any' return type. declare function f2(): any; function f3(x) { ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. } function f4(x: any) { @@ -21,14 +28,14 @@ function f6(x: string, y: number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'f6', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'f6', which lacks return-type annotation, implicitly has an 'any' return type. function f6(x: string, y: string): any; function f6(x: string, y) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. return null; ~~~~~~~~~~~~~~~~ } ~ -!!! 'f6', which lacks return-type annotation, implicitly has an 'any' return type. \ No newline at end of file +!!! error TS7010: 'f6', which lacks return-type annotation, implicitly has an 'any' return type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyInBareInterface.errors.txt b/tests/baselines/reference/noImplicitAnyInBareInterface.errors.txt index f96c1b98827..eb379c67026 100644 --- a/tests/baselines/reference/noImplicitAnyInBareInterface.errors.txt +++ b/tests/baselines/reference/noImplicitAnyInBareInterface.errors.txt @@ -1,12 +1,16 @@ +tests/cases/compiler/noImplicitAnyInBareInterface.ts(4,5): error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyInBareInterface.ts(6,5): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. + + ==== tests/cases/compiler/noImplicitAnyInBareInterface.ts (2 errors) ==== interface Entry { // Should return error for implicit any on `new` and `foo`. new (); ~~~~~~~ -!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. few() : any; foo(); ~~~~~~ -!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt b/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt new file mode 100644 index 00000000000..66a7773ab49 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt @@ -0,0 +1,24 @@ +tests/cases/compiler/noImplicitAnyInCastExpression.ts(16,2): error TS2352: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other. + Property 'a' is missing in type '{ c: null; }'. + + +==== tests/cases/compiler/noImplicitAnyInCastExpression.ts (1 errors) ==== + + // verify no noImplictAny errors reported with cast expression + + interface IFoo { + a: number; + b: string; + } + + // Expr type not assignable to target type + ({ a: null }); + + // Expr type assignable to target type + ({ a: 2, b: undefined }); + + // Neither types is assignable to each other + ({ c: null }); + ~~~~~~~~~~~~~~~~~ +!!! error TS2352: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other. +!!! error TS2352: Property 'a' is missing in type '{ c: null; }'. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyInCastExpression.js b/tests/baselines/reference/noImplicitAnyInCastExpression.js new file mode 100644 index 00000000000..1b7cc59c7c0 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyInCastExpression.js @@ -0,0 +1,26 @@ +//// [noImplicitAnyInCastExpression.ts] + +// verify no noImplictAny errors reported with cast expression + +interface IFoo { + a: number; + b: string; +} + +// Expr type not assignable to target type +({ a: null }); + +// Expr type assignable to target type +({ a: 2, b: undefined }); + +// Neither types is assignable to each other +({ c: null }); + +//// [noImplicitAnyInCastExpression.js] +// verify no noImplictAny errors reported with cast expression +// Expr type not assignable to target type +{ a: null }; +// Expr type assignable to target type +{ a: 2, b: undefined }; +// Neither types is assignable to each other +{ c: null }; diff --git a/tests/baselines/reference/noImplicitAnyIndexing.errors.txt b/tests/baselines/reference/noImplicitAnyIndexing.errors.txt index 857809c3e84..8b75459ebd0 100644 --- a/tests/baselines/reference/noImplicitAnyIndexing.errors.txt +++ b/tests/baselines/reference/noImplicitAnyIndexing.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/noImplicitAnyIndexing.ts(13,26): error TS7017: Index signature of object type implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyIndexing.ts(20,9): error TS7017: Index signature of object type implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyIndexing.ts(23,9): error TS7017: Index signature of object type implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyIndexing.ts(31,10): error TS7017: Index signature of object type implicitly has an 'any' type. + + ==== tests/cases/compiler/noImplicitAnyIndexing.ts (4 errors) ==== enum MyEmusEnum { @@ -13,7 +19,7 @@ // Should be implicit 'any' ; property access fails, no string indexer. var strRepresentation3 = MyEmusEnum["monehh"]; ~~~~~~~~~~~~~~~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. +!!! error TS7017: Index signature of object type implicitly has an 'any' type. // Should be okay; should be a MyEmusEnum var strRepresentation4 = MyEmusEnum["emu"]; @@ -22,12 +28,12 @@ // Should report an implicit 'any'. var x = {}["hi"]; ~~~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. +!!! error TS7017: Index signature of object type implicitly has an 'any' type. // Should report an implicit 'any'. var y = {}[10]; ~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. +!!! error TS7017: Index signature of object type implicitly has an 'any' type. var hi: any = "hi"; @@ -37,7 +43,7 @@ // Should report an implicit 'any'. var z1 = emptyObj[hi]; ~~~~~~~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. +!!! error TS7017: Index signature of object type implicitly has an 'any' type. var z2 = (emptyObj)[hi]; interface MyMap { diff --git a/tests/baselines/reference/noImplicitAnyIndexing.js b/tests/baselines/reference/noImplicitAnyIndexing.js index ebadbd9a121..91dbcae730c 100644 --- a/tests/baselines/reference/noImplicitAnyIndexing.js +++ b/tests/baselines/reference/noImplicitAnyIndexing.js @@ -61,7 +61,7 @@ var strRepresentation2 = MyEmusEnum[0 /* emu */]; // Should be implicit 'any' ; property access fails, no string indexer. var strRepresentation3 = MyEmusEnum["monehh"]; // Should be okay; should be a MyEmusEnum -var strRepresentation4 = MyEmusEnum["emu"]; +var strRepresentation4 = 0 /* "emu" */; // Should report an implicit 'any'. var x = {}["hi"]; // Should report an implicit 'any'. diff --git a/tests/baselines/reference/noImplicitAnyModule.errors.txt b/tests/baselines/reference/noImplicitAnyModule.errors.txt index 81e07fad9cb..ec1af2346cc 100644 --- a/tests/baselines/reference/noImplicitAnyModule.errors.txt +++ b/tests/baselines/reference/noImplicitAnyModule.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/noImplicitAnyModule.ts(5,9): error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyModule.ts(10,18): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyModule.ts(11,9): error TS7010: 'g', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyModule.ts(18,5): error TS7010: 'f', which lacks return-type annotation, implicitly has an 'any' return type. + + ==== tests/cases/compiler/noImplicitAnyModule.ts (4 errors) ==== declare module Module { @@ -5,17 +11,17 @@ // Should return error for implicit any on return type. new (); ~~~~~~~ -!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. } class Class { // Should return error for implicit `any` on parameter. public f(x): any; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. public g(x: any); ~~~~~~~~~~~~~~~~~ -!!! 'g', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'g', which lacks return-type annotation, implicitly has an 'any' return type. // Should not return error at all. private h(x); @@ -24,6 +30,6 @@ // Should return error for implicit any on return type. function f(x: number); ~~~~~~~~~~~~~~~~~~~~~~ -!!! 'f', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'f', which lacks return-type annotation, implicitly has an 'any' return type. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt index d81e3e38404..a2ac9467856 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt +++ b/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt @@ -1,3 +1,36 @@ +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(7,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(13,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(13,22): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(13,25): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(16,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(16,30): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(19,19): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(22,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(22,22): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(25,19): error TS7006: Parameter 'x1' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(26,31): error TS7006: Parameter 'y2' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(27,19): error TS7006: Parameter 'x3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(27,23): error TS7006: Parameter 'y3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(33,22): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(36,22): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(36,25): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(36,28): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(39,22): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(39,33): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(42,22): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(45,22): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(45,25): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(79,24): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(82,24): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(82,27): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(82,30): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(85,24): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(85,35): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(88,24): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(91,24): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts(91,27): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. + + ==== tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts (31 errors) ==== declare class D_C { @@ -7,7 +40,7 @@ // Implicit-'any' errors for x. public pub_f2(x): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // No implicit-'any' errors. public pub_f3(x: any): void; @@ -15,43 +48,43 @@ // Implicit-'any' errors for x, y, and z. public pub_f4(x, y, z): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x, and z. public pub_f5(x, y: any, z): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' errors for r. public pub_f6(...r): void; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. public pub_f7(x, ...r): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any' errors for x1, y2, x3, and y3. public pub_f8(x1, y1: number): any; ~~ -!!! Parameter 'x1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x1' implicitly has an 'any' type. public pub_f8(x2: string, y2): any; ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. public pub_f8(x3, y3): any; ~~ -!!! Parameter 'x3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x3' implicitly has an 'any' type. ~~ -!!! Parameter 'y3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y3' implicitly has an 'any' type. // No implicit-'any' errors. public pub_f9: () => string; @@ -59,35 +92,35 @@ // Implicit-'any' error for x. public pub_f10: (x) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // Implicit-'any' errors for x, y, and z. public pub_f11: (x, y, z) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x and z. public pub_f12: (x, y: any, z) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' error for r. public pub_f13: (...r) => string; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. public pub_f14: (x, ...r) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. /////////////////////////////////////////// @@ -123,33 +156,33 @@ // Implicit-'any' error for x. private priv_f10: (x) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // Implicit-'any' errors for x, y, and z. private priv_f11: (x, y, z) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x and z. private priv_f12: (x, y: any, z) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' error for r. private priv_f13: (...r) => string; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. private priv_f14: (x, ...r) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt index 905ea1ac9f0..37af83d7891 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt +++ b/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt @@ -1,3 +1,27 @@ +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(6,23): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(12,23): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(12,26): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(12,29): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(15,23): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(15,34): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(18,23): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(21,23): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(21,26): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(24,23): error TS7006: Parameter 'x1' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(25,35): error TS7006: Parameter 'y2' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(26,23): error TS7006: Parameter 'x3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(26,27): error TS7006: Parameter 'y3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(32,21): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(35,21): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(35,24): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(35,27): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(38,21): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(38,32): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(41,21): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(44,21): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts(44,24): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. + + ==== tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts (22 errors) ==== // No implicit-'any' errors. @@ -6,7 +30,7 @@ // Implicit-'any' errors for x. declare function d_f2(x): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // No implicit-'any' errors. declare function d_f3(x: any): void; @@ -14,43 +38,43 @@ // Implicit-'any' errors for x, y, and z. declare function d_f4(x, y, z): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x, and z. declare function d_f5(x, y: any, z): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' errors for r. declare function d_f6(...r): void; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. declare function d_f7(x, ...r): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any' errors for x1, y2, x3, and y3. declare function d_f8(x1, y1: number): any; ~~ -!!! Parameter 'x1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x1' implicitly has an 'any' type. declare function d_f8(x2: string, y2): any; ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. declare function d_f8(x3, y3): any; ~~ -!!! Parameter 'x3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x3' implicitly has an 'any' type. ~~ -!!! Parameter 'y3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y3' implicitly has an 'any' type. // No implicit-'any' errors. declare var d_f9: () => string; @@ -58,32 +82,32 @@ // Implicit-'any' error for x. declare var d_f10: (x) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // Implicit-'any' errors for x, y, and z. declare var d_f11: (x, y, z) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x and z. declare var d_f12: (x, y: any, z) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' error for r. declare var d_f13: (...r) => string; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. declare var d_f14: (x, ...r) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. \ No newline at end of file +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt index 99779ab7697..7bdfbcaae88 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt +++ b/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt @@ -1,3 +1,27 @@ +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(7,20): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(13,20): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(13,23): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(13,26): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(16,20): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(16,31): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(19,20): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(22,20): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(22,23): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(25,20): error TS7006: Parameter 'x1' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(26,32): error TS7006: Parameter 'y2' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(27,20): error TS7006: Parameter 'x3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(27,24): error TS7006: Parameter 'y3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(33,18): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(36,18): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(36,21): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(36,24): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(39,18): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(39,29): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(42,18): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(45,18): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts(45,21): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. + + ==== tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts (22 errors) ==== declare module D_M { @@ -7,7 +31,7 @@ // No implicit-'any' errors. function dm_f2(x): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // No implicit-'any' errors. function dm_f3(x: any): void; @@ -15,43 +39,43 @@ // No implicit-'any' errors. function dm_f4(x, y, z): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // No implicit-'any' errors. function dm_f5(x, y: any, z): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // No implicit-'any' errors. function dm_f6(...r): void; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // No implicit-'any' errors. function dm_f7(x, ...r): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // No implicit-'any' errors. function dm_f8(x1, y1: number): any; ~~ -!!! Parameter 'x1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x1' implicitly has an 'any' type. function dm_f8(x2: string, y2): any; ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. function dm_f8(x3, y3): any; ~~ -!!! Parameter 'x3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x3' implicitly has an 'any' type. ~~ -!!! Parameter 'y3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y3' implicitly has an 'any' type. // No implicit-'any' errors. var dm_f9: () => string; @@ -59,33 +83,33 @@ // No implicit-'any' errors. var dm_f10: (x) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // No implicit-'any' errors. var dm_f11: (x, y, z) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // No implicit-'any' errors. var dm_f12: (x, y: any, z) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // No implicit-'any' errors. var dm_f13: (...r) => string; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // No implicit-'any' errors. var dm_f14: (x, ...r) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt index ed49e1dbd11..3d3cc1aa5ea 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt +++ b/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt @@ -1,3 +1,27 @@ +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(6,13): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(12,13): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(12,16): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(12,19): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(15,13): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(15,24): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(18,13): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(21,13): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(21,16): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(24,13): error TS7006: Parameter 'x1' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(25,25): error TS7006: Parameter 'y2' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(26,13): error TS7006: Parameter 'x3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(26,17): error TS7006: Parameter 'y3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(32,12): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(35,12): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(35,15): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(35,18): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(38,12): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(38,23): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(41,12): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(44,12): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts(44,15): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. + + ==== tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts (22 errors) ==== // No implicit-'any' errors. @@ -6,7 +30,7 @@ // Implicit-'any' error for x. function f2(x): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // No implicit-'any' errors. function f3(x: any): void { } @@ -14,43 +38,43 @@ // Implicit-'any' errors for x, y, and z. function f4(x, y, z): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x, and z. function f5(x, y: any, z): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' error for r. function f6(...r): void { } ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. function f7(x, ...r): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any' errors for x1, y2, x3, and y3. function f8(x1, y1: number): any; ~~ -!!! Parameter 'x1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x1' implicitly has an 'any' type. function f8(x2: string, y2): any; ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. function f8(x3, y3): any { } ~~ -!!! Parameter 'x3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x3' implicitly has an 'any' type. ~~ -!!! Parameter 'y3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y3' implicitly has an 'any' type. // No implicit-'any' errors. var f9 = () => ""; @@ -58,32 +82,32 @@ // Implicit-'any' errors for x. var f10 = (x) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // Implicit-'any' errors for x, y, and z. var f11 = (x, y, z) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x and z. var f12 = (x, y: any, z) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' error for r. var f13 = (...r) => ""; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. var f14 = (x, ...r) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. \ No newline at end of file +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt index 785ebe83b87..98d743a21aa 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt +++ b/tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt @@ -1,3 +1,49 @@ +tests/cases/compiler/noImplicitAnyParametersInClass.ts(7,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(13,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(13,22): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(13,25): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(16,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(16,30): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(19,19): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(22,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(22,22): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(25,19): error TS7006: Parameter 'x1' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(26,31): error TS7006: Parameter 'y2' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(27,19): error TS7006: Parameter 'x3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(27,23): error TS7006: Parameter 'y3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(33,23): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(36,23): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(36,26): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(36,29): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(39,23): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(39,34): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(42,23): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(45,23): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(45,26): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(53,21): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(59,21): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(59,24): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(59,27): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(62,21): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(62,32): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(65,21): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(68,21): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(68,24): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(71,21): error TS7006: Parameter 'x1' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(72,33): error TS7006: Parameter 'y2' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(73,21): error TS7006: Parameter 'x3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(73,25): error TS7006: Parameter 'y3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(79,25): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(82,25): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(82,28): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(82,31): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(85,25): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(85,36): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(88,25): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(91,25): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInClass.ts(91,28): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. + + ==== tests/cases/compiler/noImplicitAnyParametersInClass.ts (44 errors) ==== class C { @@ -7,7 +53,7 @@ // Implicit-'any' errors for x. public pub_f2(x): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // No implicit-'any' errors. public pub_f3(x: any): void { } @@ -15,43 +61,43 @@ // Implicit-'any' errors for x, y, and z. public pub_f4(x, y, z): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x, and z. public pub_f5(x, y: any, z): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' errors for r. public pub_f6(...r): void { } ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. public pub_f7(x, ...r): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any' errors for x1, y2, x3, and y3. public pub_f8(x1, y1: number): any; ~~ -!!! Parameter 'x1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x1' implicitly has an 'any' type. public pub_f8(x2: string, y2): any; ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. public pub_f8(x3, y3): any { } ~~ -!!! Parameter 'x3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x3' implicitly has an 'any' type. ~~ -!!! Parameter 'y3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y3' implicitly has an 'any' type. // No implicit-'any' errors. public pub_f9 = () => ""; @@ -59,35 +105,35 @@ // Implicit-'any' errors for x. public pub_f10 = (x) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // Implicit-'any' errors for x, y, and z. public pub_f11 = (x, y, z) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x and z. public pub_f12 = (x, y: any, z) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' error for r. public pub_f13 = (...r) => ""; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. public pub_f14 = (x, ...r) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. /////////////////////////////////////////// @@ -97,7 +143,7 @@ // Implicit-'any' errors for x. private priv_f2(x): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // No implicit-'any' errors. private priv_f3(x: any): void { } @@ -105,43 +151,43 @@ // Implicit-'any' errors for x, y, and z. private priv_f4(x, y, z): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x, and z. private priv_f5(x, y: any, z): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' errors for r. private priv_f6(...r): void { } ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. private priv_f7(x, ...r): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any' errors for x1, y2, x3, and y3. private priv_f8(x1, y1: number): any; ~~ -!!! Parameter 'x1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x1' implicitly has an 'any' type. private priv_f8(x2: string, y2): any; ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. private priv_f8(x3, y3): any { } ~~ -!!! Parameter 'x3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x3' implicitly has an 'any' type. ~~ -!!! Parameter 'y3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y3' implicitly has an 'any' type. // No implicit-'any' errors. private priv_f9 = () => ""; @@ -149,33 +195,33 @@ // Implicit-'any' errors for x. private priv_f10 = (x) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // Implicit-'any' errors for x, y, and z. private priv_f11 = (x, y, z) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x and z. private priv_f12 = (x, y: any, z) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' error for r. private priv_f13 = (...r) => ""; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. private priv_f14 = (x, ...r) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt index c9bece57671..f0b9fad3b33 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt +++ b/tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt @@ -1,20 +1,49 @@ +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(4,5): error TS7020: Call signature, which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(5,5): error TS7020: Call signature, which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(5,6): error TS7006: Parameter 'x1' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(6,6): error TS7006: Parameter 'x2' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(6,22): error TS7006: Parameter 'z2' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(12,8): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(18,8): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(18,11): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(18,14): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(21,8): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(21,19): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(24,8): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(27,8): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(27,11): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(30,8): error TS7006: Parameter 'x1' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(31,20): error TS7006: Parameter 'y2' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(32,8): error TS7006: Parameter 'x3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(32,12): error TS7006: Parameter 'y3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(38,11): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(41,11): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(41,14): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(41,17): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(44,11): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(44,22): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(47,11): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(50,11): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInInterface.ts(50,14): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. + + ==== tests/cases/compiler/noImplicitAnyParametersInInterface.ts (27 errors) ==== interface I { // Implicit-'any' errors for first two call signatures, x1, x2, z2. (); ~~~ -!!! Call signature, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7020: Call signature, which lacks return-type annotation, implicitly has an 'any' return type. (x1); ~~~~~ -!!! Call signature, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7020: Call signature, which lacks return-type annotation, implicitly has an 'any' return type. ~~ -!!! Parameter 'x1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x1' implicitly has an 'any' type. (x2, y2: string, z2): any; ~~ -!!! Parameter 'x2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x2' implicitly has an 'any' type. ~~ -!!! Parameter 'z2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z2' implicitly has an 'any' type. // No implicit-'any' errors. f1(): void; @@ -22,7 +51,7 @@ // Implicit-'any' errors for x. f2(x): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // No implicit-'any' errors. f3(x: any): void; @@ -30,43 +59,43 @@ // Implicit-'any' errors for x, y, and z. f4(x, y, z): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x, and z. f5(x, y: any, z): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' errors for r. f6(...r): void; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. f7(x, ...r): void; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any' errors for x1, y2, x3, and y3. f8(x1, y1: number): any; ~~ -!!! Parameter 'x1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x1' implicitly has an 'any' type. f8(x2: string, y2): any; ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. f8(x3, y3): any; ~~ -!!! Parameter 'x3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x3' implicitly has an 'any' type. ~~ -!!! Parameter 'y3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y3' implicitly has an 'any' type. // No implicit-'any' errors. f9: () => string; @@ -74,33 +103,33 @@ // Implicit-'any' errors for x. f10: (x) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // Implicit-'any' errors for x, y, and z. f11: (x, y, z) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x and z. f12: (x, y: any, z) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' error for r. f13: (...r) => string; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x, r. f14: (x, ...r) => string; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt index 87912f0dcfa..8bddee624c5 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt +++ b/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt @@ -1,3 +1,27 @@ +tests/cases/compiler/noImplicitAnyParametersInModule.ts(7,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(13,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(13,22): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(13,25): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(16,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(16,30): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(19,19): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(22,19): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(22,22): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(25,19): error TS7006: Parameter 'x1' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(26,31): error TS7006: Parameter 'y2' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(27,19): error TS7006: Parameter 'x3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(27,23): error TS7006: Parameter 'y3' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(33,18): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(36,18): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(36,21): error TS7006: Parameter 'y' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(36,24): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(39,18): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(39,29): error TS7006: Parameter 'z' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(42,18): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(45,18): error TS7006: Parameter 'x' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyParametersInModule.ts(45,21): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. + + ==== tests/cases/compiler/noImplicitAnyParametersInModule.ts (22 errors) ==== module M { @@ -7,7 +31,7 @@ // Implicit-'any' error for x. function m_f2(x): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // No implicit-'any' errors. function m_f3(x: any): void { } @@ -15,43 +39,43 @@ // Implicit-'any' errors for x, y, and z. function m_f4(x, y, z): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x and z. function m_f5(x, y: any, z): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' error for r. function m_f6(...r): void { } ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x and r. function m_f7(x, ...r): void { } ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any' errors for x1, y2, x3, and y3. function m_f8(x1, y1: number): any; ~~ -!!! Parameter 'x1' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x1' implicitly has an 'any' type. function m_f8(x2: string, y2): any; ~~ -!!! Parameter 'y2' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y2' implicitly has an 'any' type. function m_f8(x3, y3): any { } ~~ -!!! Parameter 'x3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x3' implicitly has an 'any' type. ~~ -!!! Parameter 'y3' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y3' implicitly has an 'any' type. // No implicit-'any' errors. var m_f9 = () => ""; @@ -59,33 +83,33 @@ // Implicit-'any' error for x. var m_f10 = (x) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. // Implicit-'any' errors for x, y, and z. var m_f11 = (x, y, z) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'y' implicitly has an 'any' type. +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any' errors for x and z. var m_f12 = (x, y: any, z) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ -!!! Parameter 'z' implicitly has an 'any' type. +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. // Implicit-'any[]' errors for r. var m_f13 = (...r) => ""; ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. // Implicit-'any'/'any[]' errors for x and r. var m_f14 = (x, ...r) => ""; ~ -!!! Parameter 'x' implicitly has an 'any' type. +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. +!!! error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyReferencingDeclaredInterface.errors.txt b/tests/baselines/reference/noImplicitAnyReferencingDeclaredInterface.errors.txt index b3dce9b2f77..d782e05ca61 100644 --- a/tests/baselines/reference/noImplicitAnyReferencingDeclaredInterface.errors.txt +++ b/tests/baselines/reference/noImplicitAnyReferencingDeclaredInterface.errors.txt @@ -1,10 +1,13 @@ +tests/cases/compiler/noImplicitAnyReferencingDeclaredInterface.ts(4,5): error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. + + ==== tests/cases/compiler/noImplicitAnyReferencingDeclaredInterface.ts (1 errors) ==== interface Entry { // Should return error for implicit any. new (); ~~~~~~~ -!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. } declare var x: Entry; \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyStringIndexerOnObject.errors.txt b/tests/baselines/reference/noImplicitAnyStringIndexerOnObject.errors.txt index c19ff9f396e..5c0878f8ab9 100644 --- a/tests/baselines/reference/noImplicitAnyStringIndexerOnObject.errors.txt +++ b/tests/baselines/reference/noImplicitAnyStringIndexerOnObject.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/noImplicitAnyStringIndexerOnObject.ts(2,9): error TS7017: Index signature of object type implicitly has an 'any' type. + + ==== tests/cases/compiler/noImplicitAnyStringIndexerOnObject.ts (1 errors) ==== var x = {}["hello"]; ~~~~~~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. \ No newline at end of file +!!! error TS7017: Index signature of object type implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyWithOverloads.errors.txt b/tests/baselines/reference/noImplicitAnyWithOverloads.errors.txt index 490d3e41cfb..21845261f35 100644 --- a/tests/baselines/reference/noImplicitAnyWithOverloads.errors.txt +++ b/tests/baselines/reference/noImplicitAnyWithOverloads.errors.txt @@ -1,18 +1,24 @@ +tests/cases/compiler/noImplicitAnyWithOverloads.ts(2,5): error TS7008: Member 'foo' implicitly has an 'any' type. +tests/cases/compiler/noImplicitAnyWithOverloads.ts(6,1): error TS7010: 'callb', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyWithOverloads.ts(7,1): error TS7010: 'callb', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/noImplicitAnyWithOverloads.ts(8,16): error TS7006: Parameter 'a' implicitly has an 'any' type. + + ==== tests/cases/compiler/noImplicitAnyWithOverloads.ts (4 errors) ==== interface A { foo; ~~~~ -!!! Member 'foo' implicitly has an 'any' type. +!!! error TS7008: Member 'foo' implicitly has an 'any' type. } interface B { } function callb(lam: (l: A) => void); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'callb', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'callb', which lacks return-type annotation, implicitly has an 'any' return type. function callb(lam: (n: B) => void); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'callb', which lacks return-type annotation, implicitly has an 'any' return type. +!!! error TS7010: 'callb', which lacks return-type annotation, implicitly has an 'any' return type. function callb(a) { } ~ -!!! Parameter 'a' implicitly has an 'any' type. +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. callb((a) => { a.foo; }); // error, chose first overload \ No newline at end of file diff --git a/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt b/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt index 949364d138b..4800ccf3c17 100644 --- a/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt +++ b/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/noTypeArgumentOnReturnType1.ts(3,9): error TS2314: Generic type 'A' requires 1 type argument(s). + + ==== tests/cases/compiler/noTypeArgumentOnReturnType1.ts (1 errors) ==== class A{ foo(): A{ ~ -!!! Generic type 'A' requires 1 type argument(s). +!!! error TS2314: Generic type 'A' requires 1 type argument(s). return null; } } \ No newline at end of file diff --git a/tests/baselines/reference/nonArrayRestArgs.errors.txt b/tests/baselines/reference/nonArrayRestArgs.errors.txt index 7262e0a92a7..b25b5296b35 100644 --- a/tests/baselines/reference/nonArrayRestArgs.errors.txt +++ b/tests/baselines/reference/nonArrayRestArgs.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/nonArrayRestArgs.ts(1,14): error TS2370: A rest parameter must be of an array type. + + ==== tests/cases/compiler/nonArrayRestArgs.ts (1 errors) ==== function foo(...rest: number) { // error ~~~~~~~~~~~~~~~ -!!! A rest parameter must be of an array type. +!!! error TS2370: A rest parameter must be of an array type. var x: string = rest[0]; return x; } \ No newline at end of file diff --git a/tests/baselines/reference/nonContextuallyTypedLogicalOr.errors.txt b/tests/baselines/reference/nonContextuallyTypedLogicalOr.errors.txt deleted file mode 100644 index e7d301b6edc..00000000000 --- a/tests/baselines/reference/nonContextuallyTypedLogicalOr.errors.txt +++ /dev/null @@ -1,19 +0,0 @@ -==== tests/cases/compiler/nonContextuallyTypedLogicalOr.ts (1 errors) ==== - interface Contextual { - dummy; - p?: number; - } - - interface Ellement { - dummy; - p: any; - } - - var c: Contextual; - var e: Ellement; - - // This should error. Even though we are contextually typing e with Contextual, the RHS still - // needs to be a supertype of the LHS to win as the best common type. - (c || e).dummy; - ~~~~~ -!!! Property 'dummy' does not exist on type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/nonContextuallyTypedLogicalOr.js b/tests/baselines/reference/nonContextuallyTypedLogicalOr.js index a29390bcf7f..e3ec95533fd 100644 --- a/tests/baselines/reference/nonContextuallyTypedLogicalOr.js +++ b/tests/baselines/reference/nonContextuallyTypedLogicalOr.js @@ -12,13 +12,9 @@ interface Ellement { var c: Contextual; var e: Ellement; -// This should error. Even though we are contextually typing e with Contextual, the RHS still -// needs to be a supertype of the LHS to win as the best common type. (c || e).dummy; //// [nonContextuallyTypedLogicalOr.js] var c; var e; -// This should error. Even though we are contextually typing e with Contextual, the RHS still -// needs to be a supertype of the LHS to win as the best common type. (c || e).dummy; diff --git a/tests/baselines/reference/nonContextuallyTypedLogicalOr.types b/tests/baselines/reference/nonContextuallyTypedLogicalOr.types new file mode 100644 index 00000000000..aeb9d1409c6 --- /dev/null +++ b/tests/baselines/reference/nonContextuallyTypedLogicalOr.types @@ -0,0 +1,37 @@ +=== tests/cases/compiler/nonContextuallyTypedLogicalOr.ts === +interface Contextual { +>Contextual : Contextual + + dummy; +>dummy : any + + p?: number; +>p : number +} + +interface Ellement { +>Ellement : Ellement + + dummy; +>dummy : any + + p: any; +>p : any +} + +var c: Contextual; +>c : Contextual +>Contextual : Contextual + +var e: Ellement; +>e : Ellement +>Ellement : Ellement + +(c || e).dummy; +>(c || e).dummy : any +>(c || e) : Contextual | Ellement +>c || e : Contextual | Ellement +>c : Contextual +>e : Ellement +>dummy : any + diff --git a/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt b/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt index f4f1fe043e7..18f9f3bc8d4 100644 --- a/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt +++ b/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/nonExportedElementsOfMergedModules.ts(13,7): error TS2339: Property 'x' does not exist on type 'typeof B'. + + ==== tests/cases/compiler/nonExportedElementsOfMergedModules.ts (1 errors) ==== module One { enum A { X } @@ -13,7 +16,7 @@ } B.x; ~ -!!! Property 'x' does not exist on type 'typeof B'. +!!! error TS2339: Property 'x' does not exist on type 'typeof B'. B.y; } \ No newline at end of file diff --git a/tests/baselines/reference/null.types b/tests/baselines/reference/null.types index 0614b5efec4..7a5232efb0b 100644 --- a/tests/baselines/reference/null.types +++ b/tests/baselines/reference/null.types @@ -41,7 +41,7 @@ var w:I={x:null,y:3}; >w : I >I : I >{x:null,y:3} : { x: null; y: number; } ->x : any +>x : null >y : number diff --git a/tests/baselines/reference/nullAssignedToUndefined.errors.txt b/tests/baselines/reference/nullAssignedToUndefined.errors.txt index 964fec0d3bf..5f9921b5809 100644 --- a/tests/baselines/reference/nullAssignedToUndefined.errors.txt +++ b/tests/baselines/reference/nullAssignedToUndefined.errors.txt @@ -1,5 +1,8 @@ +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/nullAssignedToUndefined.ts(1,9): error TS2364: Invalid left-hand side of assignment expression. + + ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/nullAssignedToUndefined.ts (1 errors) ==== var x = undefined = null; // error ~~~~~~~~~ -!!! Invalid left-hand side of assignment expression. +!!! error TS2364: Invalid left-hand side of assignment expression. var y: typeof undefined = null; // ok, widened \ No newline at end of file diff --git a/tests/baselines/reference/nullKeyword.errors.txt b/tests/baselines/reference/nullKeyword.errors.txt index ab3616d7772..a140fce0b0f 100644 --- a/tests/baselines/reference/nullKeyword.errors.txt +++ b/tests/baselines/reference/nullKeyword.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/nullKeyword.ts(1,6): error TS2339: Property 'foo' does not exist on type 'null'. + + ==== tests/cases/compiler/nullKeyword.ts (1 errors) ==== null.foo; ~~~ -!!! Property 'foo' does not exist on type 'null'. \ No newline at end of file +!!! error TS2339: Property 'foo' does not exist on type 'null'. \ No newline at end of file diff --git a/tests/baselines/reference/numLit.errors.txt b/tests/baselines/reference/numLit.errors.txt index 97c80e65677..98b84791e35 100644 --- a/tests/baselines/reference/numLit.errors.txt +++ b/tests/baselines/reference/numLit.errors.txt @@ -1,9 +1,13 @@ +tests/cases/compiler/numLit.ts(3,3): error TS1005: ';' expected. +tests/cases/compiler/numLit.ts(3,3): error TS2304: Cannot find name 'toString'. + + ==== tests/cases/compiler/numLit.ts (2 errors) ==== 1..toString(); 1.0.toString(); 1.toString(); ~~~~~~~~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~~~~~ -!!! Cannot find name 'toString'. +!!! error TS2304: Cannot find name 'toString'. 1.+2.0 + 3. ; \ No newline at end of file diff --git a/tests/baselines/reference/numberToString.errors.txt b/tests/baselines/reference/numberToString.errors.txt index 5d7a636f5f1..07cc9009a67 100644 --- a/tests/baselines/reference/numberToString.errors.txt +++ b/tests/baselines/reference/numberToString.errors.txt @@ -1,8 +1,12 @@ +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 (2 errors) ==== function f1(n:number):string { return n; // error return type mismatch ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } function f2(s:string):void { @@ -11,6 +15,6 @@ f1(3); f2(3); // error no coercion to string ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' 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/numericClassMembers1.errors.txt b/tests/baselines/reference/numericClassMembers1.errors.txt index 160c6e88207..eb99f26bb4c 100644 --- a/tests/baselines/reference/numericClassMembers1.errors.txt +++ b/tests/baselines/reference/numericClassMembers1.errors.txt @@ -1,16 +1,26 @@ -==== tests/cases/compiler/numericClassMembers1.ts (2 errors) ==== +tests/cases/compiler/numericClassMembers1.ts(2,3): error TS2300: Duplicate identifier '0'. +tests/cases/compiler/numericClassMembers1.ts(3,3): error TS2300: Duplicate identifier '0.0'. +tests/cases/compiler/numericClassMembers1.ts(7,3): error TS2300: Duplicate identifier '0.0'. +tests/cases/compiler/numericClassMembers1.ts(8,2): error TS2300: Duplicate identifier ''0''. + + +==== tests/cases/compiler/numericClassMembers1.ts (4 errors) ==== class C234 { 0 = 1; + ~ +!!! error TS2300: Duplicate identifier '0'. 0.0 = 2; ~~~ -!!! Duplicate identifier '0.0'. +!!! error TS2300: Duplicate identifier '0.0'. } class C235 { 0.0 = 1; + ~~~ +!!! error TS2300: Duplicate identifier '0.0'. '0' = 2; ~~~ -!!! Duplicate identifier ''0''. +!!! error TS2300: Duplicate identifier ''0''. } class C236 { diff --git a/tests/baselines/reference/numericIndexExpressions.errors.txt b/tests/baselines/reference/numericIndexExpressions.errors.txt index b471b45c7dd..2c3b8d76796 100644 --- a/tests/baselines/reference/numericIndexExpressions.errors.txt +++ b/tests/baselines/reference/numericIndexExpressions.errors.txt @@ -1,3 +1,9 @@ +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 (4 errors) ==== interface Numbers1 { 1: string; @@ -10,15 +16,15 @@ var x: Numbers1; x[1] = 4; // error ~~~~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. x['1'] = 4; // error ~~~~~~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var y: Strings1; y['1'] = 4; // should be error ~~~~~~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. y[1] = 4; // should be error ~~~~ -!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt index 1a74ee37809..19f2c700ccf 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt @@ -1,4 +1,20 @@ -==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts (14 errors) ==== +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(23,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(90,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(93,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(18,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(21,5): error TS2412: Property '3.0' of type 'MyNumber' is not assignable to numeric index type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(50,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(68,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. + Index signatures are incompatible. + Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(88,9): error TS2304: Cannot find name 'Myn'. + + +==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts (11 errors) ==== // String indexer types constrain the types of named properties in their containing type interface MyNumber extends Number { @@ -18,23 +34,21 @@ 1.0: string; // ok 2.0: number; // error ~~~~~~~~~~~~ -!!! Property '2.0' of type 'number' is not assignable to numeric index type 'string'. +!!! error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. "3.0": string; // ok "4.0": number; // error - ~~~~~~~~~~~~~~ -!!! Property '"4.0"' of type 'number' is not assignable to numeric index type 'string'. 3.0: MyNumber // error ~~~~~~~~~~~~~ -!!! Property '3.0' of type 'MyNumber' is not assignable to numeric index type 'string'. +!!! error TS2412: Property '3.0' of type 'MyNumber' is not assignable to numeric index type 'string'. get X() { // ok ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return ''; } set X(v) { } // ok ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. foo() { return ''; @@ -46,7 +60,7 @@ static foo() { } // ok static get X() { // ok ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 1; } } @@ -62,14 +76,12 @@ 1.0: string; // ok 2.0: number; // error ~~~~~~~~~~~~ -!!! Property '2.0' of type 'number' is not assignable to numeric index type 'string'. +!!! error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. (): string; // ok (x): number // ok foo(): string; // ok "3.0": string; // ok "4.0": number; // error - ~~~~~~~~~~~~~~ -!!! Property '"4.0"' of type 'number' is not assignable to numeric index type 'string'. f: MyNumber; // error } @@ -84,23 +96,22 @@ 1.0: string; // ok 2.0: number; // error ~~~~~~~~~~~~ -!!! Property '2.0' of type 'number' is not assignable to numeric index type 'string'. +!!! error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. (): string; // ok (x): number // ok foo(): string; // ok "3.0": string; // ok "4.0": number; // error - ~~~~~~~~~~~~~~ -!!! Property '"4.0"' of type 'number' is not assignable to numeric index type 'string'. f: MyNumber; // error } // error var b: { [x: number]: string; } = { ~ -!!! Type '{ [x: number]: {}; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: unknown; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }': -!!! Index signatures are incompatible: -!!! Type '{}' is not assignable to type 'string'. +!!! error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a: '', b: 1, c: () => { }, @@ -112,16 +123,16 @@ "4.0": 1, f: null, ~~~ -!!! Cannot find name 'Myn'. +!!! error TS2304: Cannot find name 'Myn'. get X() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return ''; }, set X(v) { }, ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. foo() { return ''; } diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt index 3c211326180..7f73ac6da0a 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt @@ -1,4 +1,13 @@ -==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts (7 errors) ==== +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(16,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(25,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(34,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(39,5): error TS2322: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. + Index signatures are incompatible. + Type 'number | A' is not assignable to type 'A'. + Type 'number' is not assignable to type 'A'. + + +==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts (4 errors) ==== // String indexer providing a constraint of a user defined type class A { @@ -16,10 +25,8 @@ "2.5": B // ok 3.0: number; // error ~~~~~~~~~~~~ -!!! Property '3.0' of type 'number' is not assignable to numeric index type 'A'. +!!! error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. "4.0": string; // error - ~~~~~~~~~~~~~~ -!!! Property '"4.0"' of type 'string' is not assignable to numeric index type 'A'. } interface Foo2 { @@ -29,10 +36,8 @@ "2.5": B // ok 3.0: number; // error ~~~~~~~~~~~~ -!!! Property '3.0' of type 'number' is not assignable to numeric index type 'A'. +!!! error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. "4.0": string; // error - ~~~~~~~~~~~~~~ -!!! Property '"4.0"' of type 'string' is not assignable to numeric index type 'A'. } var a: { @@ -42,19 +47,17 @@ "2.5": B // ok 3.0: number; // error ~~~~~~~~~~~~ -!!! Property '3.0' of type 'number' is not assignable to numeric index type 'A'. +!!! error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. "4.0": string; // error - ~~~~~~~~~~~~~~ -!!! Property '"4.0"' of type 'string' is not assignable to numeric index type 'A'. }; // error var b: { [x: number]: A } = { ~ -!!! Type '{ [x: number]: {}; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }': -!!! Index signatures are incompatible: -!!! Type '{}' is not assignable to type 'A': -!!! Property 'foo' is missing in type '{}'. +!!! error TS2322: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'number | A' is not assignable to type 'A'. +!!! error TS2322: Type 'number' is not assignable to type 'A'. 1.0: new A(), 2.0: new B(), "2.5": new B(), diff --git a/tests/baselines/reference/numericIndexerConstraint.errors.txt b/tests/baselines/reference/numericIndexerConstraint.errors.txt index 4ff9b00897e..af24643310a 100644 --- a/tests/baselines/reference/numericIndexerConstraint.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/numericIndexerConstraint.ts(2,5): error TS2412: Property '0' of type 'number' is not assignable to numeric index type 'RegExp'. + + ==== tests/cases/compiler/numericIndexerConstraint.ts (1 errors) ==== class C { 0: number; ~~~~~~~~~~ -!!! Property '0' of type 'number' is not assignable to numeric index type 'RegExp'. +!!! error TS2412: Property '0' of type 'number' is not assignable to numeric index type 'RegExp'. [x: number]: RegExp; } \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint1.errors.txt b/tests/baselines/reference/numericIndexerConstraint1.errors.txt index 8d615874e4d..42cf293fe60 100644 --- a/tests/baselines/reference/numericIndexerConstraint1.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint1.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'number' is not assignable to type 'Foo'. + Property 'foo' is missing in type 'Number'. + + ==== tests/cases/compiler/numericIndexerConstraint1.ts (1 errors) ==== class Foo { foo() { } } var x: { [index: string]: number; }; var result: Foo = x["one"]; // error ~~~~~~ -!!! Type 'number' is not assignable to type 'Foo': -!!! Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'Foo'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint2.errors.txt b/tests/baselines/reference/numericIndexerConstraint2.errors.txt index 1bd9aea28d1..4260f60becf 100644 --- a/tests/baselines/reference/numericIndexerConstraint2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint2.errors.txt @@ -1,8 +1,12 @@ +tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }'. + Index signature is missing in type '{ one: number; }'. + + ==== tests/cases/compiler/numericIndexerConstraint2.ts (1 errors) ==== class Foo { foo() { } } var x: { [index: string]: Foo; }; var a: { one: number; }; x = a; ~ -!!! Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }': -!!! Index signature is missing in type '{ one: number; }'. \ No newline at end of file +!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }'. +!!! error TS2322: Index signature is missing in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint4.types b/tests/baselines/reference/numericIndexerConstraint4.types index f0004e52b45..78b57d4179e 100644 --- a/tests/baselines/reference/numericIndexerConstraint4.types +++ b/tests/baselines/reference/numericIndexerConstraint4.types @@ -22,7 +22,7 @@ var x: { >A : A } = { data: new B() } ->{ data: new B() } : { [x: number]: A; data: B; } +>{ data: new B() } : { [x: number]: undefined; data: B; } >data : B >new B() : B >B : typeof B diff --git a/tests/baselines/reference/numericIndexerConstraint5.errors.txt b/tests/baselines/reference/numericIndexerConstraint5.errors.txt index 9127b58360e..445fc771218 100644 --- a/tests/baselines/reference/numericIndexerConstraint5.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint5.errors.txt @@ -1,6 +1,10 @@ +tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }'. + Index signature is missing in type '{ 0: Date; name: string; }'. + + ==== tests/cases/compiler/numericIndexerConstraint5.ts (1 errors) ==== var x = { name: "x", 0: new Date() }; var z: { [name: number]: string } = x; ~ -!!! Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }': -!!! Index signature is missing in type '{ 0: Date; name: string; }'. \ No newline at end of file +!!! error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2322: Index signature is missing in type '{ 0: Date; name: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerTyping1.errors.txt b/tests/baselines/reference/numericIndexerTyping1.errors.txt index 5aa0c794357..3717a79a0ad 100644 --- a/tests/baselines/reference/numericIndexerTyping1.errors.txt +++ b/tests/baselines/reference/numericIndexerTyping1.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/numericIndexerTyping1.ts(9,5): error TS2322: Type 'Date' is not assignable to type 'string'. +tests/cases/compiler/numericIndexerTyping1.ts(12,5): error TS2322: Type 'Date' is not assignable to type 'string'. + + ==== tests/cases/compiler/numericIndexerTyping1.ts (2 errors) ==== interface I { [x: string]: Date; @@ -9,9 +13,9 @@ var i: I; var r: string = i[1]; // error: numeric indexer returns the type of the string indexer ~ -!!! Type 'Date' is not assignable to type 'string'. +!!! error TS2322: Type 'Date' is not assignable to type 'string'. var i2: I2; var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexer ~~ -!!! Type 'Date' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'Date' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerTyping2.errors.txt b/tests/baselines/reference/numericIndexerTyping2.errors.txt index 5d7165dfeec..5f2278c6ac1 100644 --- a/tests/baselines/reference/numericIndexerTyping2.errors.txt +++ b/tests/baselines/reference/numericIndexerTyping2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/numericIndexerTyping2.ts(9,5): error TS2322: Type 'Date' is not assignable to type 'string'. +tests/cases/compiler/numericIndexerTyping2.ts(12,5): error TS2322: Type 'Date' is not assignable to type 'string'. + + ==== tests/cases/compiler/numericIndexerTyping2.ts (2 errors) ==== class I { [x: string]: Date @@ -9,9 +13,9 @@ var i: I; var r: string = i[1]; // error: numeric indexer returns the type of the string indexer ~ -!!! Type 'Date' is not assignable to type 'string'. +!!! error TS2322: Type 'Date' is not assignable to type 'string'. var i2: I2; var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexere ~~ -!!! Type 'Date' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'Date' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt b/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt index 7ecf5f15824..c5890d7c98c 100644 --- a/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt +++ b/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt @@ -1,34 +1,57 @@ -==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts (6 errors) ==== +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(20,5): error TS1005: ',' expected. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(2,5): error TS2300: Duplicate identifier '1'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(3,5): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(4,12): error TS2300: Duplicate identifier '2'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(5,12): error TS2300: Duplicate identifier '2'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(9,5): error TS2300: Duplicate identifier '2'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(10,5): error TS2300: Duplicate identifier '2.'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(14,5): error TS2300: Duplicate identifier '1'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(15,5): error TS2300: Duplicate identifier '1'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(19,5): error TS2300: Duplicate identifier '2'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts(20,5): error TS2300: Duplicate identifier '2'. + + +==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts (11 errors) ==== class C { 1: number; + ~ +!!! error TS2300: Duplicate identifier '1'. 1.0: number; ~~~ -!!! Duplicate identifier '1.0'. - static 2: number; +!!! error TS2300: Duplicate identifier '1.0'. static 2: number; ~ -!!! Duplicate identifier '2'. +!!! error TS2300: Duplicate identifier '2'. + static 2: number; + ~ +!!! error TS2300: Duplicate identifier '2'. } interface I { 2: number; + ~ +!!! error TS2300: Duplicate identifier '2'. 2.: number; ~~ -!!! Duplicate identifier '2.'. +!!! error TS2300: Duplicate identifier '2.'. } var a: { 1: number; + ~ +!!! error TS2300: Duplicate identifier '1'. 1: number; ~ -!!! Duplicate identifier '1'. +!!! error TS2300: Duplicate identifier '1'. } var b = { 2: 1 + ~ +!!! error TS2300: Duplicate identifier '2'. 2: 1 ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~ -!!! Duplicate identifier '2'. +!!! error TS2300: Duplicate identifier '2'. } \ No newline at end of file diff --git a/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt b/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt index ddde515f498..4ebef99bd07 100644 --- a/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt +++ b/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt @@ -1,32 +1,50 @@ -==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts (4 errors) ==== +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(4,5): error TS2300: Duplicate identifier '"1"'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(6,5): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(10,5): error TS2300: Duplicate identifier '"1"'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(12,5): error TS2300: Duplicate identifier '1'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(16,5): error TS2300: Duplicate identifier '"1"'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(21,5): error TS2300: Duplicate identifier '"0"'. +tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(22,5): error TS2300: Duplicate identifier '0'. + + +==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts (8 errors) ==== // Each of these types has an error in it. // String named and numeric named properties conflict if they would be equivalent after ToNumber on the property name. class C { "1": number; + ~~~ +!!! error TS2300: Duplicate identifier '"1"'. "1.0": number; // not a duplicate 1.0: number; ~~~ -!!! Duplicate identifier '1.0'. +!!! error TS2300: Duplicate identifier '1.0'. } interface I { "1": number; + ~~~ +!!! error TS2300: Duplicate identifier '"1"'. "1.": number; // not a duplicate 1: number; ~ -!!! Duplicate identifier '1'. +!!! error TS2300: Duplicate identifier '1'. } var a: { "1": number; + ~~~ +!!! error TS2300: Duplicate identifier '"1"'. 1.0: string; ~~~ -!!! Duplicate identifier '1.0'. +!!! error TS2300: Duplicate identifier '1.0'. } var b = { "0": '', + ~~~ +!!! error TS2300: Duplicate identifier '"0"'. 0: '' ~ -!!! Duplicate identifier '0'. +!!! error TS2300: Duplicate identifier '0'. } \ No newline at end of file diff --git a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt index 6b3788ff53e..89693f4bced 100644 --- a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt +++ b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(6,2): error TS1128: Declaration or statement expected. +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 (2 errors) ==== class A { constructor(public a1: string) { @@ -5,7 +9,7 @@ } function foo(x = new A(123)) { //should error, 123 is not string ~~~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. }} ~ -!!! Declaration or statement expected. \ No newline at end of file +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt b/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt index d4bafcbc9cd..73332ff8926 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/objectCreationOfElementAccessExpression.ts(53,17): error TS2342: An index expression argument must be of type 'string', 'number', or 'any'. +tests/cases/compiler/objectCreationOfElementAccessExpression.ts(53,63): error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? +tests/cases/compiler/objectCreationOfElementAccessExpression.ts(54,33): error TS2342: An index expression argument must be of type 'string', 'number', or 'any'. +tests/cases/compiler/objectCreationOfElementAccessExpression.ts(54,79): error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? + + ==== tests/cases/compiler/objectCreationOfElementAccessExpression.ts (4 errors) ==== class Food { private amount: number; @@ -53,12 +59,12 @@ // ElementAccessExpressions can only contain one expression. There should be a parse error here. var foods = new PetFood[new IceCream('Mint chocolate chip') , Cookie('Chocolate chip', false) , new Cookie('Peanut butter', true)]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An index expression argument must be of type 'string', 'number', or 'any'. +!!! error TS2342: An index expression argument must be of type 'string', 'number', or 'any'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? +!!! error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? var foods2: MonsterFood[] = new PetFood[new IceCream('Mint chocolate chip') , Cookie('Chocolate chip', false) , new Cookie('Peanut butter', true)]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! An index expression argument must be of type 'string', 'number', or 'any'. +!!! error TS2342: An index expression argument must be of type 'string', 'number', or 'any'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? +!!! error TS2348: Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/objectIndexer.types b/tests/baselines/reference/objectIndexer.types index a2a7f99cf5d..7b42ea51b56 100644 --- a/tests/baselines/reference/objectIndexer.types +++ b/tests/baselines/reference/objectIndexer.types @@ -23,11 +23,11 @@ class Emitter { constructor () { this.listeners = {}; ->this.listeners = {} : { [x: string]: Callback; } +>this.listeners = {} : { [x: string]: undefined; } >this.listeners : IMap >this : Emitter >listeners : IMap ->{} : { [x: string]: Callback; } +>{} : { [x: string]: undefined; } } } diff --git a/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt b/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt index b7d5ae0f616..01c0fea7a26 100644 --- a/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt +++ b/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/objectLitArrayDeclNoNew.ts(22,20): error TS1109: Expression expected. +tests/cases/compiler/objectLitArrayDeclNoNew.ts(27,1): error TS1128: Declaration or statement expected. + + ==== tests/cases/compiler/objectLitArrayDeclNoNew.ts (2 errors) ==== declare var console; "use strict"; @@ -22,11 +26,11 @@ return { tokens: Gar[],//IToken[], // Missing new. Correct syntax is: tokens: new IToken[] ~ -!!! Expression expected. +!!! error TS1109: Expression expected. endState: state }; } } } ~ -!!! Declaration or statement expected. \ No newline at end of file +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitIndexerContextualType.errors.txt b/tests/baselines/reference/objectLitIndexerContextualType.errors.txt index b9d92a78385..ca65ee5a5be 100644 --- a/tests/baselines/reference/objectLitIndexerContextualType.errors.txt +++ b/tests/baselines/reference/objectLitIndexerContextualType.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/objectLitIndexerContextualType.ts(12,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/objectLitIndexerContextualType.ts(12,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/objectLitIndexerContextualType.ts(15,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/objectLitIndexerContextualType.ts(15,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/objectLitIndexerContextualType.ts(21,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +tests/cases/compiler/objectLitIndexerContextualType.ts(21,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + ==== tests/cases/compiler/objectLitIndexerContextualType.ts (6 errors) ==== interface I { [s: string]: (s: string) => number; @@ -12,16 +20,16 @@ x = { s: t => t * t, // Should error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. }; x = { 0: t => t * t, // Should error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. }; y = { s: t => t * t, // Should not error @@ -29,7 +37,7 @@ y = { 0: t => t * t, // Should error ~ -!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ~ -!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. +!!! 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/objectLitPropertyScoping.errors.txt b/tests/baselines/reference/objectLitPropertyScoping.errors.txt index f317de68e75..420f8a5f192 100644 --- a/tests/baselines/reference/objectLitPropertyScoping.errors.txt +++ b/tests/baselines/reference/objectLitPropertyScoping.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/objectLitPropertyScoping.ts(5,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/objectLitPropertyScoping.ts(8,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/objectLitPropertyScoping.ts (2 errors) ==== // Should compile, x and y should not be picked up from the properties @@ -5,12 +9,12 @@ return { get x() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return x; }, get y() { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return y; }, dist: function () { diff --git a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt index 2a3c8d43630..0b218d3227b 100644 --- a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt +++ b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt @@ -1,6 +1,10 @@ +tests/cases/compiler/objectLitStructuralTypeMismatch.ts(2,5): error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }'. + Property 'a' is missing in type '{ b: number; }'. + + ==== tests/cases/compiler/objectLitStructuralTypeMismatch.ts (1 errors) ==== // Shouldn't compile var x: { a: number; } = { b: 5 }; ~ -!!! Type '{ b: number; }' is not assignable to type '{ a: number; }': -!!! Property 'a' is missing in type '{ b: number; }'. \ No newline at end of file +!!! error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }'. +!!! error TS2322: Property 'a' is missing in type '{ b: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt index 2d12916ab24..0d064af3935 100644 --- a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt +++ b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/objectLitTargetTypeCallSite.ts(5,9): error TS2345: Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'. + Types of property 'a' are incompatible. + Type 'boolean' is not assignable to type 'number'. + + ==== tests/cases/compiler/objectLitTargetTypeCallSite.ts (1 errors) ==== function process( x: {a:number; b:string;}) { return x.a; @@ -5,6 +10,6 @@ process({a:true,b:"y"}); ~~~~~~~~~~~~~~ -!!! Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'. -!!! Types of property 'a' are incompatible: -!!! Type 'boolean' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2345: Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'. +!!! error TS2345: Types of property 'a' are incompatible. +!!! error TS2345: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 6a36b93edbb..97cbdc32266 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -1,169 +1,337 @@ -==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (61 errors) ==== +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,19): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,22): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,23): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,22): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,25): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,23): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,22): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,24): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,25): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,27): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,26): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(3,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(3,18): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(4,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(4,19): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(5,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(5,18): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(6,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(6,21): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(7,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(7,19): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(8,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(8,18): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(9,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(9,20): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(10,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(10,20): error TS2300: Duplicate identifier '"a"'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(11,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(11,20): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(12,13): error TS2300: Duplicate identifier '"a"'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(12,21): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(13,13): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(13,21): error TS2300: Duplicate identifier ''1''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(14,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(14,19): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(15,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(15,19): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,19): error TS2300: Duplicate identifier '0x0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,19): error TS2300: Duplicate identifier '000'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(18,13): error TS2300: Duplicate identifier '"100"'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(18,23): error TS2300: Duplicate identifier '1e2'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(19,13): error TS2300: Duplicate identifier '0x20'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(19,22): error TS2300: Duplicate identifier '3.2e1'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(20,13): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(20,25): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,22): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,23): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,22): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,25): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,23): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,22): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS2300: Duplicate identifier '"a"'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,24): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,13): error TS2300: Duplicate identifier '"a"'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,13): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,25): error TS2300: Duplicate identifier ''1''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS2300: Duplicate identifier '0x0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS2300: Duplicate identifier '000'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,13): error TS2300: Duplicate identifier '"100"'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,27): error TS2300: Duplicate identifier '1e2'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,13): error TS2300: Duplicate identifier '0x20'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,26): error TS2300: Duplicate identifier '3.2e1'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,13): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,12): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,43): 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(45,12): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51): error TS2380: 'get' and 'set' accessor must have the same type. + + +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (96 errors) ==== // Multiple properties with the same name var e1 = { a: 0, a: 0 }; + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var e2 = { a: '', a: '' }; + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var e3 = { a: 0, a: '' }; + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var e4 = { a: true, a: false }; + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var e5 = { a: {}, a: {} }; + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var e6 = { a: 0, 'a': 0 }; + ~ +!!! error TS2300: Duplicate identifier 'a'. ~~~ -!!! Duplicate identifier ''a''. +!!! error TS2300: Duplicate identifier ''a''. var e7 = { 'a': 0, a: 0 }; + ~~~ +!!! error TS2300: Duplicate identifier ''a''. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var e8 = { 'a': 0, "a": 0 }; + ~~~ +!!! error TS2300: Duplicate identifier ''a''. ~~~ -!!! Duplicate identifier '"a"'. +!!! error TS2300: Duplicate identifier '"a"'. var e9 = { 'a': 0, 'a': 0 }; + ~~~ +!!! error TS2300: Duplicate identifier ''a''. ~~~ -!!! Duplicate identifier ''a''. +!!! error TS2300: Duplicate identifier ''a''. var e10 = { "a": 0, 'a': 0 }; + ~~~ +!!! error TS2300: Duplicate identifier '"a"'. ~~~ -!!! Duplicate identifier ''a''. +!!! error TS2300: Duplicate identifier ''a''. var e11 = { 1.0: 0, '1': 0 }; + ~~~ +!!! error TS2300: Duplicate identifier '1.0'. ~~~ -!!! Duplicate identifier ''1''. +!!! error TS2300: Duplicate identifier ''1''. var e12 = { 0: 0, 0: 0 }; + ~ +!!! error TS2300: Duplicate identifier '0'. ~ -!!! Duplicate identifier '0'. +!!! error TS2300: Duplicate identifier '0'. var e13 = { 0: 0, 0: 0 }; + ~ +!!! error TS2300: Duplicate identifier '0'. ~ -!!! Duplicate identifier '0'. +!!! error TS2300: Duplicate identifier '0'. var e14 = { 0: 0, 0x0: 0 }; + ~ +!!! error TS2300: Duplicate identifier '0'. ~~~ -!!! Duplicate identifier '0x0'. +!!! error TS2300: Duplicate identifier '0x0'. var e14 = { 0: 0, 000: 0 }; ~~~ -!!! Octal literals are not available when targeting ECMAScript 5 and higher. +!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. + ~ +!!! error TS2300: Duplicate identifier '0'. ~~~ -!!! Duplicate identifier '000'. +!!! error TS2300: Duplicate identifier '000'. var e15 = { "100": 0, 1e2: 0 }; + ~~~~~ +!!! error TS2300: Duplicate identifier '"100"'. ~~~ -!!! Duplicate identifier '1e2'. +!!! error TS2300: Duplicate identifier '1e2'. var e16 = { 0x20: 0, 3.2e1: 0 }; + ~~~~ +!!! error TS2300: Duplicate identifier '0x20'. ~~~~~ -!!! Duplicate identifier '3.2e1'. +!!! error TS2300: Duplicate identifier '3.2e1'. var e17 = { a: 0, b: 1, a: 0 }; + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. // Accessor and property with the same name var f1 = { a: 0, get a() { return 0; } }; ~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var f2 = { a: '', get a() { return ''; } }; ~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var f3 = { a: 0, get a() { return ''; } }; ~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var f4 = { a: true, get a() { return false; } }; ~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var f5 = { a: {}, get a() { return {}; } }; ~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var f6 = { a: 0, get 'a'() { return 0; } }; ~~~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier 'a'. ~~~ -!!! Duplicate identifier ''a''. +!!! error TS2300: Duplicate identifier ''a''. var f7 = { 'a': 0, get a() { return 0; } }; ~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ +!!! error TS2300: Duplicate identifier ''a''. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. var f8 = { 'a': 0, get "a"() { return 0; } }; ~~~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ +!!! error TS2300: Duplicate identifier ''a''. ~~~ -!!! Duplicate identifier '"a"'. +!!! error TS2300: Duplicate identifier '"a"'. var f9 = { 'a': 0, get 'a'() { return 0; } }; ~~~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ +!!! error TS2300: Duplicate identifier ''a''. ~~~ -!!! Duplicate identifier ''a''. +!!! error TS2300: Duplicate identifier ''a''. var f10 = { "a": 0, get 'a'() { return 0; } }; ~~~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ +!!! error TS2300: Duplicate identifier '"a"'. ~~~ -!!! Duplicate identifier ''a''. +!!! error TS2300: Duplicate identifier ''a''. var f11 = { 1.0: 0, get '1'() { return 0; } }; ~~~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ +!!! error TS2300: Duplicate identifier '1.0'. ~~~ -!!! Duplicate identifier ''1''. +!!! error TS2300: Duplicate identifier ''1''. var f12 = { 0: 0, get 0() { return 0; } }; ~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier '0'. ~ -!!! Duplicate identifier '0'. +!!! error TS2300: Duplicate identifier '0'. var f13 = { 0: 0, get 0() { return 0; } }; ~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier '0'. ~ -!!! Duplicate identifier '0'. +!!! error TS2300: Duplicate identifier '0'. var f14 = { 0: 0, get 0x0() { return 0; } }; ~~~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier '0'. ~~~ -!!! Duplicate identifier '0x0'. +!!! error TS2300: Duplicate identifier '0x0'. var f14 = { 0: 0, get 000() { return 0; } }; ~~~ -!!! Octal literals are not available when targeting ECMAScript 5 and higher. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier '0'. ~~~ -!!! An object literal cannot have property and accessor with the same name. - ~~~ -!!! Duplicate identifier '000'. +!!! error TS2300: Duplicate identifier '000'. var f15 = { "100": 0, get 1e2() { return 0; } }; ~~~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~~~ +!!! error TS2300: Duplicate identifier '"100"'. ~~~ -!!! Duplicate identifier '1e2'. +!!! error TS2300: Duplicate identifier '1e2'. var f16 = { 0x20: 0, get 3.2e1() { return 0; } }; ~~~~~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~~ +!!! error TS2300: Duplicate identifier '0x20'. ~~~~~ -!!! Duplicate identifier '3.2e1'. +!!! error TS2300: Duplicate identifier '3.2e1'. var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } }; ~ -!!! An object literal cannot have property and accessor with the same name. +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ +!!! error TS2300: Duplicate identifier 'a'. ~ -!!! Duplicate identifier 'a'. +!!! error TS2300: Duplicate identifier 'a'. // Get and set accessor with mismatched type annotations var g1 = { get a(): number { return 4; }, set a(n: string) { } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'get' and 'set' accessor must have the same type. +!!! error TS2380: 'get' and 'set' accessor must have the same type. ~~~~~~~~~~~~~~~~~~~~ -!!! 'get' and 'set' accessor must have the same type. +!!! error TS2380: 'get' and 'set' accessor must have the same type. var g2 = { get a() { return 4; }, set a(n: string) { } }; ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var g3 = { get a(): number { return undefined; }, set a(n: string) { } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! 'get' and 'set' accessor must have the same type. +!!! error TS2380: 'get' and 'set' accessor must have the same type. ~~~~~~~~~~~~~~~~~~~~ -!!! 'get' and 'set' accessor must have the same type. +!!! error TS2380: 'get' and 'set' accessor must have the same type. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrorsES3.errors.txt b/tests/baselines/reference/objectLiteralErrorsES3.errors.txt index b928d9546a4..2788c23a278 100644 --- a/tests/baselines/reference/objectLiteralErrorsES3.errors.txt +++ b/tests/baselines/reference/objectLiteralErrorsES3.errors.txt @@ -1,15 +1,21 @@ +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(4,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts(4,40): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts (4 errors) ==== var e1 = { get a() { return 4; } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var e2 = { set a(n) { } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var e3 = { get a() { return ''; }, set a(n) { } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt index f4eef960bb9..f031031b0a8 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt @@ -1,3 +1,12 @@ +tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts(8,4): error TS2345: Argument of type '{ hello: number; }' is not assignable to parameter of type 'I'. + Property 'value' is missing in type '{ hello: number; }'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts(11,4): error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. + Property 'value' is missing in type '{ toString: (s: string) => string; }'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts(12,4): error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. + Property 'value' is missing in type '{ toString: (s: string) => string; }'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts(13,36): error TS2339: Property 'uhhh' does not exist on type 'string'. + + ==== tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts (4 errors) ==== interface I { value: string; @@ -8,18 +17,18 @@ f2({ hello: 1 }) // error ~~~~~~~~~~~~ -!!! Argument of type '{ hello: number; }' is not assignable to parameter of type 'I'. -!!! Property 'value' is missing in type '{ hello: number; }'. +!!! error TS2345: Argument of type '{ hello: number; }' is not assignable to parameter of type 'I'. +!!! error TS2345: Property 'value' is missing in type '{ hello: number; }'. f2({ value: '' }) // missing toString satisfied by Object's member f2({ value: '', what: 1 }) // missing toString satisfied by Object's member f2({ toString: (s) => s }) // error, missing property value from ArgsString ~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. -!!! Property 'value' is missing in type '{ toString: (s: string) => string; }'. +!!! error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. +!!! error TS2345: Property 'value' is missing in type '{ toString: (s: string) => string; }'. f2({ toString: (s: string) => s }) // error, missing property value from ArgsString ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. -!!! Property 'value' is missing in type '{ toString: (s: string) => string; }'. +!!! error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. +!!! error TS2345: Property 'value' is missing in type '{ toString: (s: string) => string; }'. f2({ value: '', toString: (s) => s.uhhh }) // error ~~~~ -!!! Property 'uhhh' does not exist on type 'string'. \ No newline at end of file +!!! error TS2339: Property 'uhhh' does not exist on type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt index 3b6995e0623..7cb3304aa2f 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt @@ -1,3 +1,17 @@ +tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(8,4): error TS2345: Argument of type '{ hello: number; }' is not assignable to parameter of type 'I2'. + Property 'value' is missing in type '{ hello: number; }'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(9,4): error TS2345: Argument of type '{ value: string; }' is not assignable to parameter of type 'I2'. + Property 'doStuff' is missing in type '{ value: string; }'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(10,4): error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. + Property 'doStuff' is missing in type '{ value: string; what: number; }'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(11,4): error TS2345: Argument of type '{ toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. + Property 'value' is missing in type '{ toString: (s: any) => any; }'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(12,4): error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I2'. + Property 'value' is missing in type '{ toString: (s: string) => string; }'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,4): error TS2345: Argument of type '{ value: string; toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. + Property 'doStuff' is missing in type '{ value: string; toString: (s: any) => any; }'. + + ==== tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts (6 errors) ==== interface I2 { value: string; @@ -8,25 +22,25 @@ f2({ hello: 1 }) ~~~~~~~~~~~~ -!!! Argument of type '{ hello: number; }' is not assignable to parameter of type 'I2'. -!!! Property 'value' is missing in type '{ hello: number; }'. +!!! error TS2345: Argument of type '{ hello: number; }' is not assignable to parameter of type 'I2'. +!!! error TS2345: Property 'value' is missing in type '{ hello: number; }'. f2({ value: '' }) ~~~~~~~~~~~~~ -!!! Argument of type '{ value: string; }' is not assignable to parameter of type 'I2'. -!!! Property 'doStuff' is missing in type '{ value: string; }'. +!!! error TS2345: Argument of type '{ value: string; }' is not assignable to parameter of type 'I2'. +!!! error TS2345: Property 'doStuff' is missing in type '{ value: string; }'. f2({ value: '', what: 1 }) ~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. -!!! Property 'doStuff' is missing in type '{ value: string; what: number; }'. +!!! error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. +!!! error TS2345: Property 'doStuff' is missing in type '{ value: string; what: number; }'. f2({ toString: (s) => s }) ~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '{ toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. -!!! Property 'value' is missing in type '{ toString: (s: any) => any; }'. +!!! error TS2345: Argument of type '{ toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. +!!! error TS2345: Property 'value' is missing in type '{ toString: (s: any) => any; }'. f2({ toString: (s: string) => s }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I2'. -!!! Property 'value' is missing in type '{ toString: (s: string) => string; }'. +!!! error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I2'. +!!! error TS2345: Property 'value' is missing in type '{ toString: (s: string) => string; }'. f2({ value: '', toString: (s) => s.uhhh }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '{ value: string; toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. -!!! Property 'doStuff' is missing in type '{ value: string; toString: (s: any) => any; }'. \ No newline at end of file +!!! error TS2345: Argument of type '{ value: string; toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. +!!! error TS2345: Property 'doStuff' is missing in type '{ value: string; toString: (s: any) => any; }'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt b/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt index 9019cd7246a..4e04b856d8c 100644 --- a/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt +++ b/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt @@ -1,35 +1,71 @@ +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(2,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(2,50): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(3,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(3,50): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(4,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(4,51): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(5,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(5,49): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(6,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(6,51): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(7,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(7,50): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(18,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(22,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(26,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(30,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(35,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(35,62): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(36,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(36,69): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(37,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(37,59): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(38,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(38,60): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(42,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(43,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(50,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(55,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(60,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(64,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(67,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(68,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(76,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts(77,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts (34 errors) ==== // Get and set accessor with the same name var sameName1a = { get 'a'() { return ''; }, set a(n) { var p = n; var p: string; } }; ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var sameName2a = { get 0.0() { return ''; }, set 0(n) { var p = n; var p: string; } }; ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var sameName3a = { get 0x20() { return ''; }, set 3.2e1(n) { var p = n; var p: string; } }; ~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var sameName4a = { get ''() { return ''; }, set ""(n) { var p = n; var p: string; } }; ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var sameName5a = { get '\t'() { return ''; }, set '\t'(n) { var p = n; var p: string; } }; ~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var sameName6a = { get 'a'() { return ''; }, set a(n) { var p = n; var p: string; } }; ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. // PropertyName CallSignature{FunctionBody} is equivalent to PropertyName:function CallSignature{FunctionBody} var callSig1 = { num(n: number) { return '' } }; @@ -42,58 +78,58 @@ // Get accessor only, type of the property is the annotated return type of the get accessor var getter1 = { get x(): string { return undefined; } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var getter1: { x: string; } // Get accessor only, type of the property is the inferred return type of the get accessor var getter2 = { get x() { return ''; } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var getter2: { x: string; } // Set accessor only, type of the property is the param type of the set accessor var setter1 = { set x(n: number) { } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var setter1: { x: number }; // Set accessor only, type of the property is Any for an unannotated set accessor var setter2 = { set x(n) { } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var setter2: { x: any }; var anyVar: any; // Get and set accessor with matching type annotations var sameType1 = { get x(): string { return undefined; }, set x(n: string) { } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var sameType2 = { get x(): Array { return undefined; }, set x(n: number[]) { } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var sameType3 = { get x(): any { return undefined; }, set x(n: typeof anyVar) { } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var sameType4 = { get x(): Date { return undefined; }, set x(n: Date) { } }; ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. // Type of unannotated get accessor return type is the type annotation of the set accessor param var setParamType1 = { set n(x: (t: string) => void) { }, ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. get n() { return (t) => { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var p: string; var p = t; } @@ -102,35 +138,35 @@ var setParamType2 = { get n() { return (t) => { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var p: string; var p = t; } }, set n(x: (t: string) => void) { } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. }; // Type of unannotated set accessor parameter is the return type annotation of the get accessor var getParamType1 = { set n(x) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var y = x; var y: string; }, get n() { return ''; } ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. }; var getParamType2 = { get n() { return ''; }, ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. set n(x) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var y = x; var y: string; } @@ -140,10 +176,10 @@ var getParamType3 = { get n() { return ''; }, ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. set n(x) { ~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var y = x; var y: string; } diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt index 019d5c2733a..ef084477f6d 100644 --- a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'. + Index signatures are incompatible. + Type 'A' is not assignable to type 'B'. + + ==== tests/cases/compiler/objectLiteralIndexerErrors.ts (1 errors) ==== interface A { x: number; @@ -13,8 +18,7 @@ var o1: { [s: string]: A;[n: number]: B; } = { x: b, 0: a }; // both indexers are A ~~ -!!! Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }': -!!! Index signatures are incompatible: -!!! Type 'A' is not assignable to type 'B': -!!! Property 'y' is missing in type 'A'. +!!! error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'B'. o1 = { x: c, 0: a }; // string indexer is any, number indexer is A \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralParameterResolution.errors.txt b/tests/baselines/reference/objectLiteralParameterResolution.errors.txt index 4380a976380..415b4677cd8 100644 --- a/tests/baselines/reference/objectLiteralParameterResolution.errors.txt +++ b/tests/baselines/reference/objectLiteralParameterResolution.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/objectLiteralParameterResolution.ts(9,14): error TS2304: Cannot find name 'wrapSuccessCallback'. +tests/cases/compiler/objectLiteralParameterResolution.ts(9,34): error TS2304: Cannot find name 'requestContext'. +tests/cases/compiler/objectLiteralParameterResolution.ts(9,50): error TS2304: Cannot find name 'callback'. +tests/cases/compiler/objectLiteralParameterResolution.ts(10,12): error TS2304: Cannot find name 'wrapErrorCallback'. +tests/cases/compiler/objectLiteralParameterResolution.ts(10,30): error TS2304: Cannot find name 'requestContext'. +tests/cases/compiler/objectLiteralParameterResolution.ts(10,46): error TS2304: Cannot find name 'errorCallback'. + + ==== tests/cases/compiler/objectLiteralParameterResolution.ts (6 errors) ==== interface Foo{ extend(target: T, ...objs: any[]): T; @@ -9,18 +17,18 @@ data: "data" , success: wrapSuccessCallback(requestContext, callback) , ~~~~~~~~~~~~~~~~~~~ -!!! Cannot find name 'wrapSuccessCallback'. +!!! error TS2304: Cannot find name 'wrapSuccessCallback'. ~~~~~~~~~~~~~~ -!!! Cannot find name 'requestContext'. +!!! error TS2304: Cannot find name 'requestContext'. ~~~~~~~~ -!!! Cannot find name 'callback'. +!!! error TS2304: Cannot find name 'callback'. error: wrapErrorCallback(requestContext, errorCallback) , ~~~~~~~~~~~~~~~~~ -!!! Cannot find name 'wrapErrorCallback'. +!!! error TS2304: Cannot find name 'wrapErrorCallback'. ~~~~~~~~~~~~~~ -!!! Cannot find name 'requestContext'. +!!! error TS2304: Cannot find name 'requestContext'. ~~~~~~~~~~~~~ -!!! Cannot find name 'errorCallback'. +!!! error TS2304: Cannot find name 'errorCallback'. dataType: "json" , converters: { "text json": "" }, traditional: true , diff --git a/tests/baselines/reference/objectLiteralReferencingInternalProperties.errors.txt b/tests/baselines/reference/objectLiteralReferencingInternalProperties.errors.txt index c5bffb34662..d9785df1467 100644 --- a/tests/baselines/reference/objectLiteralReferencingInternalProperties.errors.txt +++ b/tests/baselines/reference/objectLiteralReferencingInternalProperties.errors.txt @@ -1,4 +1,7 @@ +tests/cases/compiler/objectLiteralReferencingInternalProperties.ts(1,21): error TS2304: Cannot find name 'b'. + + ==== tests/cases/compiler/objectLiteralReferencingInternalProperties.ts (1 errors) ==== var a = { b: 10, c: b }; // Should give error for attempting to reference b. ~ -!!! Cannot find name 'b'. \ No newline at end of file +!!! error TS2304: Cannot find name 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.js b/tests/baselines/reference/objectLiteralShorthandProperties.js new file mode 100644 index 00000000000..776b2bbe454 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandProperties.js @@ -0,0 +1,39 @@ +//// [objectLiteralShorthandProperties.ts] +var a, b, c; + +var x1 = { + a +}; + +var x2 = { + a, +} + +var x3 = { + a: 0, + b, + c, + d() { }, + x3, + parent: x3 +}; + + + +//// [objectLiteralShorthandProperties.js] +var a, b, c; +var x1 = { + a: a +}; +var x2 = { + a: a, +}; +var x3 = { + a: 0, + b: b, + c: c, + d: function () { + }, + x3: x3, + parent: x3 +}; diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.types b/tests/baselines/reference/objectLiteralShorthandProperties.types new file mode 100644 index 00000000000..f28f25e815c --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandProperties.types @@ -0,0 +1,50 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandProperties.ts === +var a, b, c; +>a : any +>b : any +>c : any + +var x1 = { +>x1 : { a: any; } +>{ a} : { a: any; } + + a +>a : any + +}; + +var x2 = { +>x2 : { a: any; } +>{ a,} : { a: any; } + + a, +>a : any +} + +var x3 = { +>x3 : any +>{ a: 0, b, c, d() { }, x3, parent: x3} : { a: number; b: any; c: any; d: () => void; x3: any; parent: any; } + + a: 0, +>a : number + + b, +>b : any + + c, +>c : any + + d() { }, +>d : () => void +>d() { } : () => void + + x3, +>x3 : any + + parent: x3 +>parent : any +>x3 : any + +}; + + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.js b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.js new file mode 100644 index 00000000000..2ef29a37084 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.js @@ -0,0 +1,36 @@ +//// [objectLiteralShorthandPropertiesAssignment.ts] +var id: number = 10000; +var name: string = "my name"; + +var person: { name: string; id: number } = { name, id }; +function foo( obj:{ name: string }): void { }; +function bar(name: string, id: number) { return { name, id }; } +function bar1(name: string, id: number) { return { name }; } +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } + +foo(person); +var person1 = bar("Hello", 5); +var person2: { name: string } = bar("Hello", 5); +var person3: { name: string; id:number } = bar("Hello", 5); + + +//// [objectLiteralShorthandPropertiesAssignment.js] +var id = 10000; +var name = "my name"; +var person = { name: name, id: id }; +function foo(obj) { +} +; +function bar(name, id) { + return { name: name, id: id }; +} +function bar1(name, id) { + return { name: name }; +} +function baz(name, id) { + return { name: name, id: id }; +} +foo(person); +var person1 = bar("Hello", 5); +var person2 = bar("Hello", 5); +var person3 = bar("Hello", 5); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types new file mode 100644 index 00000000000..91d9e528d63 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types @@ -0,0 +1,68 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts === +var id: number = 10000; +>id : number + +var name: string = "my name"; +>name : string + +var person: { name: string; id: number } = { name, id }; +>person : { name: string; id: number; } +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +function foo( obj:{ name: string }): void { }; +>foo : (obj: { name: string; }) => void +>obj : { name: string; } +>name : string + +function bar(name: string, id: number) { return { name, id }; } +>bar : (name: string, id: number) => { name: string; id: number; } +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +function bar1(name: string, id: number) { return { name }; } +>bar1 : (name: string, id: number) => { name: string; } +>name : string +>id : number +>{ name } : { name: string; } +>name : string + +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } +>baz : (name: string, id: number) => { name: string; id: number; } +>name : string +>id : number +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +foo(person); +>foo(person) : void +>foo : (obj: { name: string; }) => void +>person : { name: string; id: number; } + +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; } + +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; } + +var person3: { name: string; id:number } = bar("Hello", 5); +>person3 : { name: string; id: number; } +>name : string +>id : number +>bar("Hello", 5) : { name: string; id: number; } +>bar : (name: string, id: number) => { name: string; id: number; } + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.js b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.js new file mode 100644 index 00000000000..b2f9004b076 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.js @@ -0,0 +1,36 @@ +//// [objectLiteralShorthandPropertiesAssignmentES6.ts] +var id: number = 10000; +var name: string = "my name"; + +var person: { name: string; id: number } = { name, id }; +function foo(obj: { name: string }): void { }; +function bar(name: string, id: number) { return { name, id }; } +function bar1(name: string, id: number) { return { name }; } +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } + +foo(person); +var person1 = bar("Hello", 5); +var person2: { name: string } = bar("Hello", 5); +var person3: { name: string; id: number } = bar("Hello", 5); + + +//// [objectLiteralShorthandPropertiesAssignmentES6.js] +var id = 10000; +var name = "my name"; +var person = { name, id }; +function foo(obj) { +} +; +function bar(name, id) { + return { name, id }; +} +function bar1(name, id) { + return { name }; +} +function baz(name, id) { + return { name, id }; +} +foo(person); +var person1 = bar("Hello", 5); +var person2 = bar("Hello", 5); +var person3 = bar("Hello", 5); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types new file mode 100644 index 00000000000..38791fc1beb --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types @@ -0,0 +1,68 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts === +var id: number = 10000; +>id : number + +var name: string = "my name"; +>name : string + +var person: { name: string; id: number } = { name, id }; +>person : { name: string; id: number; } +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +function foo(obj: { name: string }): void { }; +>foo : (obj: { name: string; }) => void +>obj : { name: string; } +>name : string + +function bar(name: string, id: number) { return { name, id }; } +>bar : (name: string, id: number) => { name: string; id: number; } +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +function bar1(name: string, id: number) { return { name }; } +>bar1 : (name: string, id: number) => { name: string; } +>name : string +>id : number +>{ name } : { name: string; } +>name : string + +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } +>baz : (name: string, id: number) => { name: string; id: number; } +>name : string +>id : number +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +foo(person); +>foo(person) : void +>foo : (obj: { name: string; }) => void +>person : { name: string; id: number; } + +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; } + +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; } + +var person3: { name: string; id: number } = bar("Hello", 5); +>person3 : { name: string; id: number; } +>name : string +>id : number +>bar("Hello", 5) : { name: string; id: number; } +>bar : (name: string, id: number) => { name: string; id: number; } + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt new file mode 100644 index 00000000000..2db47d0f7ae --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,16): error TS1131: Property or signature expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,25): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,53): error TS1005: ';' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(4,5): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. + Property 'b' is missing in type '{ name: string; id: number; }'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,79): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'. + Types of property 'id' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(8,5): error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ name: string; id: boolean; }'. + Types of property 'id' are incompatible. + Type 'number' is not assignable to type 'boolean'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts (7 errors) ==== + var id: number = 10000; + var name: string = "my name"; + + var person: { b: string; id: number } = { name, id }; // error + ~~~~~~ +!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. +!!! error TS2322: Property 'b' is missing in type '{ name: string; id: number; }'. + var person1: { name, id }; // error: can't use short-hand property assignment in type position + ~~~~ +!!! error TS1131: Property or signature expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. + function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error + ~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'. +!!! error TS2322: Types of property 'id' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. + function bar(obj: { name: string; id: boolean }) { } + bar({ name, id }); // error + ~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ name: string; id: boolean; }'. +!!! error TS2345: Types of property 'id' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'boolean'. + + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt new file mode 100644 index 00000000000..708bbb0935f --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt @@ -0,0 +1,48 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,55): error TS1005: ';' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(6,55): error TS1005: ';' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,16): error TS1131: Property or signature expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,25): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,28): error TS1005: ';' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(4,5): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. + Property 'b' is missing in type '{ name: string; id: number; }'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,79): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ name: number; id: string; }'. + Types of property 'name' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,5): error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'. + Types of property 'name' are incompatible. + Type 'number' is not assignable to type 'string'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts (9 errors) ==== + var id: number = 10000; + var name: string = "my name"; + + var person: { b: string; id: number } = { name, id }; // error + ~~~~~~ +!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. +!!! error TS2322: Property 'b' is missing in type '{ name: string; id: number; }'. + function bar(name: string, id: number): { name: number, id: string } { return { name, id }; } // error + ~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ name: number; id: string; }'. +!!! error TS2322: Types of property 'name' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + function foo(name: string, id: number): { name: string, id: number } { return { name, id }; } // error + ~ +!!! error TS1005: ';' expected. + var person1: { name, id }; // error : Can't use shorthand in the type position + ~~~~ +!!! error TS1131: Property or signature expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. + var person2: { name: string, id: number } = bar("hello", 5); + ~ +!!! error TS1005: ';' expected. + ~~~~~~~ +!!! error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'. +!!! error TS2322: Types of property 'name' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.js b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.js new file mode 100644 index 00000000000..b398a231351 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.js @@ -0,0 +1,39 @@ +//// [objectLiteralShorthandPropertiesES6.ts] +var a, b, c; + +var x1 = { + a +}; + +var x2 = { + a, +} + +var x3 = { + a: 0, + b, + c, + d() { }, + x3, + parent: x3 +}; + + + +//// [objectLiteralShorthandPropertiesES6.js] +var a, b, c; +var x1 = { + a +}; +var x2 = { + a, +}; +var x3 = { + a: 0, + b, + c, + d: function () { + }, + x3, + parent: x3 +}; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types new file mode 100644 index 00000000000..0383a3f5d2e --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types @@ -0,0 +1,50 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesES6.ts === +var a, b, c; +>a : any +>b : any +>c : any + +var x1 = { +>x1 : { a: any; } +>{ a} : { a: any; } + + a +>a : any + +}; + +var x2 = { +>x2 : { a: any; } +>{ a,} : { a: any; } + + a, +>a : any +} + +var x3 = { +>x3 : any +>{ a: 0, b, c, d() { }, x3, parent: x3} : { a: number; b: any; c: any; d: () => void; x3: any; parent: any; } + + a: 0, +>a : number + + b, +>b : any + + c, +>c : any + + d() { }, +>d : () => void +>d() { } : () => void + + x3, +>x3 : any + + parent: x3 +>parent : any +>x3 : any + +}; + + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.errors.txt new file mode 100644 index 00000000000..fcd04b27754 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts(3,5): error TS2304: Cannot find name 'undefinedVariable'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts (1 errors) ==== + var x = { + x, // OK + undefinedVariable // Error + ~~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'undefinedVariable'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.js b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.js new file mode 100644 index 00000000000..6050e5b756f --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.js @@ -0,0 +1,12 @@ +//// [objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts] +var x = { + x, // OK + undefinedVariable // Error +} + + +//// [objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.js] +var x = { + x: x, + undefinedVariable: undefinedVariable // Error +}; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt new file mode 100644 index 00000000000..cc92b9a0381 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt @@ -0,0 +1,71 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(3,20): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(4,7): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(5,10): error TS1005: '(' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(6,10): error TS1005: '(' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(7,9): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(8,10): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(9,8): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(10,10): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(12,1): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(20,17): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,5): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,5): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,5): error TS2300: Duplicate identifier 'a'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (16 errors) ==== + // errors + var y = { + "stringLiteral", + ~ +!!! error TS1005: ':' expected. + 42, + ~ +!!! error TS1005: ':' expected. + get e, + ~ +!!! error TS1005: '(' expected. + set f, + ~ +!!! error TS1005: '(' expected. + this, + ~ +!!! error TS1005: ':' expected. + super, + ~ +!!! error TS1005: ':' expected. + var, + ~ +!!! error TS1005: ':' expected. + class, + ~ +!!! error TS1005: ':' expected. + typeof + }; + ~ +!!! error TS1005: ':' expected. + + var x = { + a.b, + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS2300: Duplicate identifier 'a'. + a["ss"], + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS2300: Duplicate identifier 'a'. + a[1], + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS2300: Duplicate identifier 'a'. + }; + + var v = { class }; // error + ~ +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt new file mode 100644 index 00000000000..15bac99436f --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts(10,10): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts(14,3): error TS2339: Property 'y' does not exist on type 'typeof m'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts (2 errors) ==== + // module export + var x = "Foo"; + module m { + export var x; + } + + module n { + var z = 10000; + export var y = { + m.x // error + ~ +!!! error TS1005: ':' expected. + }; + } + + m.y.x; + ~ +!!! error TS2339: Property 'y' does not exist on type 'typeof m'. + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.js b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.js new file mode 100644 index 00000000000..f6e20b605b6 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.js @@ -0,0 +1,20 @@ +//// [objectLiteralShorthandPropertiesFunctionArgument.ts] +var id: number = 10000; +var name: string = "my name"; + +var person = { name, id }; + +function foo(p: { name: string; id: number }) { } +foo(person); + + +var obj = { name: name, id: id }; + +//// [objectLiteralShorthandPropertiesFunctionArgument.js] +var id = 10000; +var name = "my name"; +var person = { name: name, id: id }; +function foo(p) { +} +foo(person); +var obj = { name: name, id: id }; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types new file mode 100644 index 00000000000..9b4261a74be --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types @@ -0,0 +1,33 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts === +var id: number = 10000; +>id : number + +var name: string = "my name"; +>name : string + +var person = { name, id }; +>person : { name: string; id: number; } +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +function foo(p: { name: string; id: number }) { } +>foo : (p: { name: string; id: number; }) => void +>p : { name: string; id: number; } +>name : string +>id : number + +foo(person); +>foo(person) : void +>foo : (p: { name: string; id: number; }) => void +>person : { name: string; id: number; } + + +var obj = { name: name, id: id }; +>obj : { name: string; id: number; } +>{ name: name, id: id } : { name: string; id: number; } +>name : string +>name : string +>id : number +>id : number + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.errors.txt new file mode 100644 index 00000000000..44426a8afb0 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts(7,5): error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ a: string; id: number; }'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts (1 errors) ==== + var id: number = 10000; + var name: string = "my name"; + + var person = { name, id }; + + function foo(p: { a: string; id: number }) { } + foo(person); // error + ~~~~~~ +!!! error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ a: string; id: number; }'. + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.js b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.js new file mode 100644 index 00000000000..2f3535ef78a --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.js @@ -0,0 +1,17 @@ +//// [objectLiteralShorthandPropertiesFunctionArgument2.ts] +var id: number = 10000; +var name: string = "my name"; + +var person = { name, id }; + +function foo(p: { a: string; id: number }) { } +foo(person); // error + + +//// [objectLiteralShorthandPropertiesFunctionArgument2.js] +var id = 10000; +var name = "my name"; +var person = { name: name, id: id }; +function foo(p) { +} +foo(person); // error diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.js b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.js new file mode 100644 index 00000000000..e2eb1fc128c --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.js @@ -0,0 +1,30 @@ +//// [objectLiteralShorthandPropertiesWithModule.ts] +// module export + +module m { + export var x; +} + +module m { + var z = x; + var y = { + a: x, + x + }; +} + + +//// [objectLiteralShorthandPropertiesWithModule.js] +// module export +var m; +(function (m) { + m.x; +})(m || (m = {})); +var m; +(function (m) { + var z = m.x; + var y = { + a: m.x, + x: m.x + }; +})(m || (m = {})); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.types b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.types new file mode 100644 index 00000000000..77e139a3426 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.types @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModule.ts === +// module export + +module m { +>m : typeof m + + export var x; +>x : any +} + +module m { +>m : typeof m + + var z = x; +>z : any +>x : any + + var y = { +>y : { a: any; x: any; } +>{ a: x, x } : { a: any; x: any; } + + a: x, +>a : any +>x : any + + x +>x : any + + }; +} + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.js b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.js new file mode 100644 index 00000000000..edb4e6c2953 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.js @@ -0,0 +1,28 @@ +//// [objectLiteralShorthandPropertiesWithModuleES6.ts] + +module m { + export var x; +} + +module m { + var z = x; + var y = { + a: x, + x + }; +} + + +//// [objectLiteralShorthandPropertiesWithModuleES6.js] +var m; +(function (m) { + m.x; +})(m || (m = {})); +var m; +(function (m) { + var z = m.x; + var y = { + a: m.x, + x: m.x + }; +})(m || (m = {})); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.types new file mode 100644 index 00000000000..1030010d6c6 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.types @@ -0,0 +1,30 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModuleES6.ts === + +module m { +>m : typeof m + + export var x; +>x : any +} + +module m { +>m : typeof m + + var z = x; +>z : any +>x : any + + var y = { +>y : { a: any; x: any; } +>{ a: x, x } : { a: any; x: any; } + + a: x, +>a : any +>x : any + + x +>x : any + + }; +} + diff --git a/tests/baselines/reference/objectLiteralWidened.types b/tests/baselines/reference/objectLiteralWidened.types index e8dc707a489..3f9163e77ef 100644 --- a/tests/baselines/reference/objectLiteralWidened.types +++ b/tests/baselines/reference/objectLiteralWidened.types @@ -6,10 +6,10 @@ var x = { >{ foo: null, bar: undefined} : { foo: null; bar: undefined; } foo: null, ->foo : any +>foo : null bar: undefined ->bar : any +>bar : undefined >undefined : undefined } @@ -18,17 +18,17 @@ var y = { >{ foo: null, bar: { baz: null, boo: undefined }} : { foo: null; bar: { baz: null; boo: undefined; }; } foo: null, ->foo : any +>foo : null bar: { ->bar : { baz: any; boo: any; } +>bar : { baz: null; boo: undefined; } >{ baz: null, boo: undefined } : { baz: null; boo: undefined; } baz: null, ->baz : any +>baz : null boo: undefined ->boo : any +>boo : undefined >undefined : undefined } } diff --git a/tests/baselines/reference/objectLiteralWithGetAccessorInsideFunction.errors.txt b/tests/baselines/reference/objectLiteralWithGetAccessorInsideFunction.errors.txt index 7c3f272c683..1b1426e28b2 100644 --- a/tests/baselines/reference/objectLiteralWithGetAccessorInsideFunction.errors.txt +++ b/tests/baselines/reference/objectLiteralWithGetAccessorInsideFunction.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/objectLiteralWithGetAccessorInsideFunction.ts(3,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/objectLiteralWithGetAccessorInsideFunction.ts (1 errors) ==== function bar() { var x = { get _extraOccluded() { ~~~~~~~~~~~~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. var occluded = 0; return occluded; }, diff --git a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt index cea10abde8d..3f499b0a580 100644 --- a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt +++ b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt @@ -1,12 +1,17 @@ +tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2322: Type '{ 0: number; }' is not assignable to type 'A'. + Types of property '0' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/objectLiteralWithNumericPropertyName.ts (1 errors) ==== interface A { 0: string; } var x: A = { ~ -!!! Type '{ 0: number; }' is not assignable to type 'A': -!!! Types of property '0' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ 0: number; }' is not assignable to type 'A'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. 0: 3 }; \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt index 65b100d9b8b..19c12ebf62f 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'data' of type 'A' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'hasOwnProperty' of type '(v: string) => boolean' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'propertyIsEnumerable' of type '(v: string) => boolean' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'toString' of type '() => string' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts(11,5): error TS2411: Property 'valueOf' of type '() => Object' is not assignable to string index type 'Object'. + + ==== tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts (8 errors) ==== class A { foo: string; @@ -11,21 +21,21 @@ data: A; [x: string]: Object; ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'data' of type 'A' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'data' of type 'A' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'hasOwnProperty' of type '(v: string) => boolean' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'hasOwnProperty' of type '(v: string) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'propertyIsEnumerable' of type '(v: string) => boolean' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'propertyIsEnumerable' of type '(v: string) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'toString' of type '() => string' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'toString' of type '() => string' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'valueOf' of type '() => Object' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'valueOf' of type '() => Object' is not assignable to string index type 'Object'. } class C { diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt index a592cca8f5f..c4ee3ea17b2 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt @@ -1,3 +1,17 @@ +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. + Type 'void' is not assignable to type 'string'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. + Type 'void' is not assignable to type 'string'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. + Type 'void' is not assignable to type 'string'. + + ==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts (3 errors) ==== interface I { toString(): void; @@ -7,10 +21,10 @@ var o: Object; o = i; // error ~ -!!! Type 'I' is not assignable to type 'Object': -!!! Types of property 'toString' are incompatible: -!!! Type '() => void' is not assignable to type '() => string': -!!! Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'I' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. i = o; // ok class C { @@ -19,10 +33,10 @@ var c: C; o = c; // error ~ -!!! Type 'C' is not assignable to type 'Object': -!!! Types of property 'toString' are incompatible: -!!! Type '() => void' is not assignable to type '() => string': -!!! Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. c = o; // ok var a = { @@ -30,8 +44,8 @@ } o = a; // error ~ -!!! Type '{ toString: () => void; }' is not assignable to type 'Object': -!!! Types of property 'toString' are incompatible: -!!! Type '() => void' is not assignable to type '() => string': -!!! Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt index 7bfc0894d3a..a88796b390e 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt @@ -1,3 +1,25 @@ +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => number' is not assignable to type '() => string'. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. + Types of property 'toString' are incompatible. + Type '() => string' is not assignable to type '() => number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => number' is not assignable to type '() => string'. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(15,1): error TS2322: Type 'Object' is not assignable to type 'C'. + Types of property 'toString' are incompatible. + Type '() => string' is not assignable to type '() => number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. + Type 'void' is not assignable to type 'string'. + + ==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts (5 errors) ==== interface I { toString(): number; @@ -7,16 +29,16 @@ var o: Object; o = i; // error ~ -!!! Type 'I' is not assignable to type 'Object': -!!! Types of property 'toString' are incompatible: -!!! Type '() => number' is not assignable to type '() => string': -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'I' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => number' is not assignable to type '() => string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. i = o; // error ~ -!!! Type 'Object' is not assignable to type 'I': -!!! Types of property 'toString' are incompatible: -!!! Type '() => string' is not assignable to type '() => number': -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => string' is not assignable to type '() => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. class C { toString(): number { return 1; } @@ -24,24 +46,24 @@ var c: C; o = c; // error ~ -!!! Type 'C' is not assignable to type 'Object': -!!! Types of property 'toString' are incompatible: -!!! Type '() => number' is not assignable to type '() => string': -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => number' is not assignable to type '() => string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. c = o; // error ~ -!!! Type 'Object' is not assignable to type 'C': -!!! Types of property 'toString' are incompatible: -!!! Type '() => string' is not assignable to type '() => number': -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'Object' is not assignable to type 'C'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => string' is not assignable to type '() => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a = { toString: () => { } } o = a; // error ~ -!!! Type '{ toString: () => void; }' is not assignable to type 'Object': -!!! Types of property 'toString' are incompatible: -!!! Type '() => void' is not assignable to type '() => string': -!!! Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeLiteralSyntax2.errors.txt b/tests/baselines/reference/objectTypeLiteralSyntax2.errors.txt index 9608cf84421..a774115e350 100644 --- a/tests/baselines/reference/objectTypeLiteralSyntax2.errors.txt +++ b/tests/baselines/reference/objectTypeLiteralSyntax2.errors.txt @@ -1,8 +1,12 @@ +tests/cases/conformance/types/objectTypeLiteral/objectTypeLiteralSyntax2.ts(2,16): error TS1005: ';' expected. +tests/cases/conformance/types/objectTypeLiteral/objectTypeLiteralSyntax2.ts(12,22): error TS1005: ';' expected. + + ==== tests/cases/conformance/types/objectTypeLiteral/objectTypeLiteralSyntax2.ts (2 errors) ==== var x: { foo: string, ~ -!!! ';' expected. +!!! error TS1005: ';' expected. bar: string } @@ -14,4 +18,4 @@ var z: { foo: string bar: string } ~~~ -!!! ';' expected. \ No newline at end of file +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt index 8fbbcddff0b..30b40f431a7 100644 --- a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. +tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'. + + ==== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ==== interface I { (): void; @@ -8,7 +12,7 @@ f = i; i = f; ~ -!!! Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Type 'Object' is not assignable to type 'I'. var a: { (): void @@ -16,4 +20,4 @@ f = a; a = f; ~ -!!! Type 'Object' is not assignable to type '() => void'. \ No newline at end of file +!!! error TS2322: Type 'Object' is not assignable to type '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureAppearsToBeFunctionType.errors.txt b/tests/baselines/reference/objectTypeWithConstructSignatureAppearsToBeFunctionType.errors.txt index cb6bedb2179..1ae1e2d22a1 100644 --- a/tests/baselines/reference/objectTypeWithConstructSignatureAppearsToBeFunctionType.errors.txt +++ b/tests/baselines/reference/objectTypeWithConstructSignatureAppearsToBeFunctionType.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/members/objectTypeWithConstructSignatureAppearsToBeFunctionType.ts(8,18): error TS2348: Value of type 'I' is not callable. Did you mean to include 'new'? +tests/cases/conformance/types/members/objectTypeWithConstructSignatureAppearsToBeFunctionType.ts(16,18): error TS2348: Value of type 'new () => number' is not callable. Did you mean to include 'new'? + + ==== tests/cases/conformance/types/members/objectTypeWithConstructSignatureAppearsToBeFunctionType.ts (2 errors) ==== // no errors expected below @@ -8,7 +12,7 @@ var i: I; var r2: number = i(); ~~~ -!!! Value of type 'I' is not callable. Did you mean to include 'new'? +!!! error TS2348: Value of type 'I' is not callable. Did you mean to include 'new'? var r2b: number = new i(); var r2c: (x: any, y?: any) => any = i.apply; @@ -18,6 +22,6 @@ var r4: number = b(); ~~~ -!!! Value of type 'new () => number' is not callable. Did you mean to include 'new'? +!!! error TS2348: Value of type 'new () => number' is not callable. Did you mean to include 'new'? var r4b: number = new b(); var r4c: (x: any, y?: any) => any = b.apply; \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt index 9696c68769d..0faba936715 100644 --- a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. +tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type 'new () => any'. + + ==== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ==== interface I { new(): any; @@ -8,7 +12,7 @@ f = i; i = f; ~ -!!! Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Type 'Object' is not assignable to type 'I'. var a: { new(): any @@ -16,4 +20,4 @@ f = a; a = f; ~ -!!! Type 'Object' is not assignable to type 'new () => any'. \ No newline at end of file +!!! error TS2322: Type 'Object' is not assignable to type 'new () => any'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.errors.txt b/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.errors.txt index 2049e3c9607..c89cd04d1ee 100644 --- a/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.errors.txt +++ b/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.errors.txt @@ -1,57 +1,83 @@ -==== tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts (12 errors) ==== +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(5,5): error TS2300: Duplicate identifier '1'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(6,5): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(7,5): error TS2300: Duplicate identifier '1.'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(8,5): error TS2300: Duplicate identifier '1.00'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(12,5): error TS2300: Duplicate identifier '1'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(13,5): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(14,5): error TS2300: Duplicate identifier '1.'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(15,5): error TS2300: Duplicate identifier '1.00'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(19,5): error TS2300: Duplicate identifier '1'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(20,5): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(21,5): error TS2300: Duplicate identifier '1.'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(22,5): error TS2300: Duplicate identifier '1.00'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(26,5): error TS2300: Duplicate identifier '1'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(27,5): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(28,5): error TS2300: Duplicate identifier '1.'. +tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(29,5): error TS2300: Duplicate identifier '1.00'. + + +==== tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts (16 errors) ==== // numeric properties must be distinct after a ToNumber operation // so the below are all errors class C { 1; + ~ +!!! error TS2300: Duplicate identifier '1'. 1.0; ~~~ -!!! Duplicate identifier '1.0'. +!!! error TS2300: Duplicate identifier '1.0'. 1.; ~~ -!!! Duplicate identifier '1.'. +!!! error TS2300: Duplicate identifier '1.'. 1.00; ~~~~ -!!! Duplicate identifier '1.00'. +!!! error TS2300: Duplicate identifier '1.00'. } interface I { 1; + ~ +!!! error TS2300: Duplicate identifier '1'. 1.0; ~~~ -!!! Duplicate identifier '1.0'. +!!! error TS2300: Duplicate identifier '1.0'. 1.; ~~ -!!! Duplicate identifier '1.'. +!!! error TS2300: Duplicate identifier '1.'. 1.00; ~~~~ -!!! Duplicate identifier '1.00'. +!!! error TS2300: Duplicate identifier '1.00'. } var a: { 1; + ~ +!!! error TS2300: Duplicate identifier '1'. 1.0; ~~~ -!!! Duplicate identifier '1.0'. +!!! error TS2300: Duplicate identifier '1.0'. 1.; ~~ -!!! Duplicate identifier '1.'. +!!! error TS2300: Duplicate identifier '1.'. 1.00; ~~~~ -!!! Duplicate identifier '1.00'. +!!! error TS2300: Duplicate identifier '1.00'. } var b = { 1: 1, + ~ +!!! error TS2300: Duplicate identifier '1'. 1.0: 1, ~~~ -!!! Duplicate identifier '1.0'. +!!! error TS2300: Duplicate identifier '1.0'. 1.: 1, ~~ -!!! Duplicate identifier '1.'. +!!! error TS2300: Duplicate identifier '1.'. 1.00: 1 ~~~~ -!!! Duplicate identifier '1.00'. +!!! error TS2300: Duplicate identifier '1.00'. } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt b/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt new file mode 100644 index 00000000000..e2e1c05ea1e --- /dev/null +++ b/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/objectTypeWithOptionalProperty1.ts(2,10): error TS1162: An object member cannot be declared optional. + + +==== tests/cases/compiler/objectTypeWithOptionalProperty1.ts (1 errors) ==== + var b = { + x?: 1 // error + ~ +!!! error TS1162: An object member cannot be declared optional. + } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt index 21ec31d4085..582d7719a89 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty.ts(13,1): error TS2322: Type 'List' is not assignable to type 'List'. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty.ts (1 errors) ==== // Basic recursive type @@ -13,5 +17,5 @@ list1 = list2; // ok list1 = list3; // error ~~~~~ -!!! Type 'List' is not assignable to type 'List': -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'List' is not assignable to type 'List'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt index 7e209541a00..6349a452821 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty2.ts(13,1): error TS2322: Type 'List' is not assignable to type 'List'. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty2.ts (1 errors) ==== // Basic recursive type @@ -13,5 +17,5 @@ list1 = list2; // ok list1 = list3; // error ~~~~~ -!!! Type 'List' is not assignable to type 'List': -!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'List' is not assignable to type 'List'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt index 123a8289f7f..91a92dbd54c 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt @@ -1,3 +1,18 @@ +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(20,1): error TS2322: Type 'MyList' is not assignable to type 'List'. + Types of property 'data' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(22,1): error TS2322: Type 'MyList' is not assignable to type 'List'. + Types of property 'data' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(30,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(31,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(41,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(42,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(43,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(48,5): error TS2322: Type 'T' is not assignable to type 'List'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(50,5): error TS2322: Type 'T' is not assignable to type 'MyList'. + + ==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts (9 errors) ==== // Types with infinitely expanding recursive types are type checked nominally @@ -20,15 +35,15 @@ list1 = myList1; // error, not nominally equal list1 = myList2; // error, type mismatch ~~~~~ -!!! Type 'MyList' is not assignable to type 'List': -!!! Types of property 'data' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'MyList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. list2 = myList1; // error, not nominally equal ~~~~~ -!!! Type 'MyList' is not assignable to type 'List': -!!! Types of property 'data' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'MyList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. list2 = myList2; // error, type mismatch var rList1 = new List>(); @@ -38,10 +53,10 @@ function foo, U extends MyList>(t: T, u: U) { t = u; // error ~ -!!! Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // error ~ -!!! Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. var a: List; var b: MyList; @@ -53,23 +68,23 @@ function foo2>(t: T, u: U) { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // was error, ok after constraint made illegal, doesn't matter ~ -!!! Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. var a: List; var b: MyList; a = t; // error ~ -!!! Type 'T' is not assignable to type 'List'. +!!! error TS2322: Type 'T' is not assignable to type 'List'. a = u; // error b = t; // ok ~ -!!! Type 'T' is not assignable to type 'MyList'. +!!! error TS2322: Type 'T' is not assignable to type 'MyList'. b = u; // ok } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt index 8d05f4aa45a..d09701c3b06 100644 --- a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt +++ b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt @@ -1,3 +1,12 @@ +tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'hasOwnProperty' of type '(v: string) => boolean' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'propertyIsEnumerable' of type '(v: string) => boolean' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'toString' of type '() => string' is not assignable to string index type 'Object'. +tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts(5,5): error TS2411: Property 'valueOf' of type '() => Object' is not assignable to string index type 'Object'. + + ==== tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts (7 errors) ==== // object types can define string indexers that are more specific than the default 'any' that would be returned // no errors expected below @@ -5,19 +14,19 @@ interface Object { [x: string]: Object; ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'hasOwnProperty' of type '(v: string) => boolean' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'hasOwnProperty' of type '(v: string) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'propertyIsEnumerable' of type '(v: string) => boolean' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'propertyIsEnumerable' of type '(v: string) => boolean' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'toString' of type '() => string' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'toString' of type '() => string' is not assignable to string index type 'Object'. ~~~~~~~~~~~~~~~~~~~~ -!!! Property 'valueOf' of type '() => Object' is not assignable to string index type 'Object'. +!!! error TS2411: Property 'valueOf' of type '() => Object' is not assignable to string index type 'Object'. } var o = {}; var r = o['']; // should be Object diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.errors.txt index 994ce2a1cef..3e7cbacb759 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.errors.txt +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.errors.txt @@ -1,3 +1,7 @@ +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures3.ts(21,25): error TS2304: Cannot find name 'b'. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures3.ts(22,25): error TS2304: Cannot find name 'b'. + + ==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures3.ts (2 errors) ==== // object types are identical structurally @@ -21,10 +25,10 @@ function foo4(x: typeof b); ~ -!!! Cannot find name 'b'. +!!! error TS2304: Cannot find name 'b'. function foo4(x: typeof b); // error ~ -!!! Cannot find name 'b'. +!!! error TS2304: Cannot find name 'b'. function foo4(x: any) { } function foo13(x: I); diff --git a/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.errors.txt b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.errors.txt index c3032d3eac1..dce23ed96e5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.errors.txt +++ b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.errors.txt @@ -1,3 +1,6 @@ +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts(2,8): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts (1 errors) ==== interface A { (x: T, y: T): void ~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } interface B { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.errors.txt index 3dc6c5f5d34..b1221bb21aa 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.errors.txt +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(6,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(9,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(13,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(17,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(21,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(26,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(29,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(30,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts (8 errors) ==== // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, @@ -6,45 +16,45 @@ class A { foo(x: T, y: U): string { return null; } ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } class B> { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo(x: T, y: U): string { return null; } } class C { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo(x: T, y: U): string { return null; } } class D { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo(x: T, y: U): string { return null; } } interface I { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo(x: T, y: U): string; } interface I2 { foo(x: T, y: U): string; ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } var a: { foo>(x: T, y: U): string } ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var b = { foo(x: T, y: U) { return ''; } }; ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function foo1(x: A); function foo1(x: A); // error diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.errors.txt index 8ec2435ba29..42e7f11e939 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.errors.txt +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.errors.txt @@ -1,3 +1,13 @@ +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(15,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(18,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(22,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(26,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(30,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(35,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(38,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(39,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts (8 errors) ==== // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, @@ -15,45 +25,45 @@ class A { foo(x: T, y: U): string { return null; } ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } class B { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo(x: T, y: U): string { return null; } } class C { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo(x: T, y: U): string { return null; } } class D> { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo(x: T, y: U): string { return null; } } interface I> { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo(x: T, y: U): string; } interface I2 { foo>(x: T, y: U): string; ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } var a: { foo(x: T, y: U): string } ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var b = { foo(x: T, y: U) { return ''; } }; ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function foo1(x: A); function foo1(x: A); // error diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.errors.txt index 7f1d923565a..536be73b5cc 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.errors.txt +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.errors.txt @@ -1,3 +1,12 @@ +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(5,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(9,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(13,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(17,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(22,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(25,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(26,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts (7 errors) ==== // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, @@ -5,40 +14,40 @@ class B> { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. constructor(x: T, y: U) { return null; } } class C { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. constructor(x: T, y: U) { return null; } } class D { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. constructor(x: T, y: U) { return null; } } interface I { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. new(x: T, y: U): string; } interface I2 { new(x: T, y: U): string; ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } var a: { new>(x: T, y: U): string } ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function foo1b(x: B, Array>); function foo1b(x: B, Array>); // error diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.errors.txt index 053dec33b4a..33a62356d1c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.errors.txt +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.errors.txt @@ -1,3 +1,12 @@ +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(14,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(18,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(22,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(26,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(31,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(34,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(35,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + ==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts (7 errors) ==== // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, @@ -14,40 +23,40 @@ class B { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. constructor(x: T, y: U) { return null; } } class C { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. constructor(x: T, y: U) { return null; } } class D> { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. constructor(x: T, y: U) { return null; } } interface I> { ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. new(x: T, y: U): string; } interface I2 { new>(x: T, y: U): string; ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } var a: { new(x: T, y: U): string } ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new ~~~~~~~~~~~ -!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function foo1b(x: B); function foo1b(x: B); // error diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types index ab83b0c78f0..a0603ae0777 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types @@ -50,7 +50,7 @@ var a: { var b: { [x: number]: string; } = { foo: '' }; >b : { [x: number]: string; } >x : number ->{ foo: '' } : { [x: number]: string; foo: string; } +>{ foo: '' } : { [x: number]: undefined; foo: string; } >foo : string function foo1(x: A); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types index cd8f19b2b7e..9e4ccb5c43b 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types @@ -64,7 +64,7 @@ var b: { [x: number]: Derived; } = { foo: null }; >b : { [x: number]: Derived; } >x : number >Derived : Derived ->{ foo: null } : { [x: number]: Derived; foo: Derived; } +>{ foo: null } : { [x: number]: undefined; foo: Derived; } >foo : Derived >null : Derived >Derived : Derived diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types index 6a73749fc84..3553f5f7252 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types @@ -50,7 +50,7 @@ var a: { var b: { [x: number]: string; } = { foo: '' }; >b : { [x: number]: string; } >x : number ->{ foo: '' } : { [x: number]: string; foo: string; } +>{ foo: '' } : { [x: number]: undefined; foo: string; } >foo : string function foo1(x: A); diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt new file mode 100644 index 00000000000..9cbaa730022 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt @@ -0,0 +1,33 @@ +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates3.ts(25,1): error TS2352: Neither type 'C3' nor type 'C4' is assignable to the other. + Property 'y' is missing in type 'C3'. + + +==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates3.ts (1 errors) ==== + interface T1 { } + interface T2 { z } + + class C1 { + private x; + } + + class C2 extends C1 { + y; + } + + var c1: C1; + c1; // Should succeed (private x originates in the same declaration) + + + class C3 { + private x: T; // This T is the difference between C3 and C1 + } + + class C4 extends C3 { + y; + } + + var c3: C3; + c3; // Should fail (private x originates in the same declaration, but different types) + ~~~~~~ +!!! error TS2352: Neither type 'C3' nor type 'C4' is assignable to the other. +!!! error TS2352: Property 'y' is missing in type 'C3'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js new file mode 100644 index 00000000000..7c8dac97250 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js @@ -0,0 +1,62 @@ +//// [objectTypesIdentityWithPrivates3.ts] +interface T1 { } +interface T2 { z } + +class C1 { + private x; +} + +class C2 extends C1 { + y; +} + +var c1: C1; +c1; // Should succeed (private x originates in the same declaration) + + +class C3 { + private x: T; // This T is the difference between C3 and C1 +} + +class C4 extends C3 { + y; +} + +var c3: C3; +c3; // Should fail (private x originates in the same declaration, but different types) + +//// [objectTypesIdentityWithPrivates3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C1 = (function () { + function C1() { + } + return C1; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(C1); +var c1; +c1; // Should succeed (private x originates in the same declaration) +var C3 = (function () { + function C3() { + } + return C3; +})(); +var C4 = (function (_super) { + __extends(C4, _super); + function C4() { + _super.apply(this, arguments); + } + return C4; +})(C3); +var c3; +c3; // Should fail (private x originates in the same declaration, but different types) diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt b/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt index 72759fbded2..a2269c29d11 100644 --- a/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt +++ b/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt @@ -1,4 +1,9 @@ -==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts (4 errors) ==== +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(12,6): error TS1112: A class member cannot be declared optional. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(20,6): error TS1112: A class member cannot be declared optional. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(24,6): error TS1162: An object member cannot be declared optional. + + +==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts (3 errors) ==== // Basic uses of optional properties var a: { @@ -12,7 +17,7 @@ class C { x?: number; // error ~ -!!! A class member cannot be declared optional. +!!! error TS1112: A class member cannot be declared optional. } interface I2 { @@ -22,13 +27,11 @@ class C2 { x?: T; // error ~ -!!! A class member cannot be declared optional. +!!! error TS1112: A class member cannot be declared optional. } var b = { x?: 1 // error ~ -!!! ':' expected. - ~ -!!! Expression expected. +!!! error TS1162: An object member cannot be declared optional. } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt b/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt index 75e3b2efc8e..a427681b22e 100644 --- a/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt +++ b/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt @@ -1,57 +1,74 @@ +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(4,8): error TS1005: ';' expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(4,9): error TS1131: Property or signature expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(8,8): error TS1005: ';' expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(8,9): error TS1131: Property or signature expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(12,8): error TS1144: Block or ';' expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(12,9): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(16,8): error TS1005: ';' expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(16,9): error TS1131: Property or signature expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(20,8): error TS1144: Block or ';' expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(20,9): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(25,8): error TS1005: '{' expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(25,9): error TS1136: Property assignment expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(26,1): error TS1005: ':' expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(12,5): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts(20,5): error TS2391: Function implementation is missing or not immediately following the declaration. + + ==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts (15 errors) ==== // Illegal attempts to define optional methods var a: { x()?: number; // error ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. } interface I { x()?: number; // error ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. } class C { x()?: number; // error ~ -!!! Block or ';' expected. +!!! error TS1144: Block or ';' expected. ~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. ~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } interface I2 { x()?: T; // error ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. } class C2 { x()?: T; // error ~ -!!! Block or ';' expected. +!!! error TS1144: Block or ';' expected. ~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. ~ -!!! Function implementation is missing or not immediately following the declaration. +!!! error TS2391: Function implementation is missing or not immediately following the declaration. } var b = { x()?: 1 // error ~ -!!! '{' expected. +!!! error TS1005: '{' expected. ~ -!!! Property assignment expected. +!!! error TS1136: Property assignment expected. } ~ -!!! ':' expected. \ No newline at end of file +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.errors.txt b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.errors.txt index 630f4c2ee7c..d6f2d2bae19 100644 --- a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.errors.txt +++ b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.errors.txt @@ -1,22 +1,28 @@ +tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName.ts(3,7): error TS2414: Class name cannot be 'any' +tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName.ts(5,7): error TS2414: Class name cannot be 'number' +tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName.ts(7,7): error TS2414: Class name cannot be 'boolean' +tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName.ts(10,7): error TS2414: Class name cannot be 'string' + + ==== tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName.ts (4 errors) ==== // it is an error to use a predefined type as a type name class any { } ~~~ -!!! Class name cannot be 'any' +!!! error TS2414: Class name cannot be 'any' class number { } ~~~~~~ -!!! Class name cannot be 'number' +!!! error TS2414: Class name cannot be 'number' class boolean { } ~~~~~~~ -!!! Class name cannot be 'boolean' +!!! error TS2414: Class name cannot be 'boolean' class bool { } // not a predefined type anymore class string { } ~~~~~~ -!!! Class name cannot be 'string' +!!! error TS2414: Class name cannot be 'string' \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt index 0e36e0cdefa..32a693abdcb 100644 --- a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt +++ b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt @@ -1,6 +1,9 @@ +tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName2.ts(3,7): error TS1003: Identifier expected. + + ==== tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName2.ts (1 errors) ==== // it is an error to use a predefined type as a type name class void {} // parse error unlike the others ~~~~ -!!! Identifier expected. \ No newline at end of file +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt b/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt index c282d871aff..a884dbc5005 100644 --- a/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt +++ b/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt @@ -1,5 +1,8 @@ +tests/cases/conformance/parser/ecmascript5/StrictMode/octalLiteralInStrictModeES3.ts(2,1): error TS1121: Octal literals are not allowed in strict mode. + + ==== tests/cases/conformance/parser/ecmascript5/StrictMode/octalLiteralInStrictModeES3.ts (1 errors) ==== "use strict"; 03; ~~ -!!! Octal literals are not allowed in strict mode. \ No newline at end of file +!!! error TS1121: Octal literals are not allowed in strict mode. \ No newline at end of file diff --git a/tests/baselines/reference/operatorAddNullUndefined.errors.txt b/tests/baselines/reference/operatorAddNullUndefined.errors.txt index 5accc58a1cc..269ee0a5166 100644 --- a/tests/baselines/reference/operatorAddNullUndefined.errors.txt +++ b/tests/baselines/reference/operatorAddNullUndefined.errors.txt @@ -1,17 +1,23 @@ +tests/cases/compiler/operatorAddNullUndefined.ts(2,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/compiler/operatorAddNullUndefined.ts(3,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/compiler/operatorAddNullUndefined.ts(4,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/compiler/operatorAddNullUndefined.ts(5,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. + + ==== tests/cases/compiler/operatorAddNullUndefined.ts (4 errors) ==== enum E { x } var x1 = null + null; ~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var x2 = null + undefined; ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var x3 = undefined + null; ~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'null' and 'null'. +!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. var x4 = undefined + undefined; ~~~~~~~~~~~~~~~~~~~~~ -!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. +!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. var x5 = 1 + null; var x6 = 1 + undefined; var x7 = null + 1; diff --git a/tests/baselines/reference/optionalArgsWithDefaultValues.errors.txt b/tests/baselines/reference/optionalArgsWithDefaultValues.errors.txt index def37b39fe4..414e718ac71 100644 --- a/tests/baselines/reference/optionalArgsWithDefaultValues.errors.txt +++ b/tests/baselines/reference/optionalArgsWithDefaultValues.errors.txt @@ -1,20 +1,27 @@ +tests/cases/compiler/optionalArgsWithDefaultValues.ts(1,25): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/optionalArgsWithDefaultValues.ts(4,27): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/optionalArgsWithDefaultValues.ts(5,28): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/optionalArgsWithDefaultValues.ts(8,10): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/optionalArgsWithDefaultValues.ts(9,13): error TS1015: Parameter cannot have question mark and initializer. + + ==== tests/cases/compiler/optionalArgsWithDefaultValues.ts (5 errors) ==== function foo(x: number, y?:boolean=false, z?=0) {} ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. class CCC { public foo(x: number, y?:boolean=false, z?=0) {} ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. static foo2(x: number, y?:boolean=false, z?=0) {} ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. } var a = (x?=0) => { return 1; }; ~ -!!! Parameter cannot have question mark and initializer. +!!! error TS1015: Parameter cannot have question mark and initializer. var b = (x, y?:number = 2) => { x; }; ~ -!!! Parameter cannot have question mark and initializer. \ No newline at end of file +!!! error TS1015: Parameter cannot have question mark and initializer. \ No newline at end of file diff --git a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt index 93ddbfa149b..52fb45e40d2 100644 --- a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt +++ b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. + Types of parameters 'onFulFill' and 'onFulfill' are incompatible. + Type '(value: number) => any' is not assignable to type '(value: string) => any'. + Types of parameters 'value' and 'value' are incompatible. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/optionalFunctionArgAssignability.ts (1 errors) ==== interface Promise { then(onFulfill?: (value: T) => U, onReject?: (reason: any) => U): Promise; @@ -7,9 +14,9 @@ var b = function then(onFulFill?: (value: number) => U, onReject?: (reason: any) => U): Promise { return null }; a = b; // error because number is not assignable to string ~ -!!! Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise': -!!! Types of parameters 'onFulFill' and 'onFulfill' are incompatible: -!!! Type '(value: number) => any' is not assignable to type '(value: string) => any': -!!! Types of parameters 'value' and 'value' are incompatible: -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. +!!! error TS2322: Types of parameters 'onFulFill' and 'onFulfill' are incompatible. +!!! error TS2322: Type '(value: number) => any' is not assignable to type '(value: string) => any'. +!!! error TS2322: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamArgsTest.errors.txt b/tests/baselines/reference/optionalParamArgsTest.errors.txt index b3be75d6daa..a8ce88e494e 100644 --- a/tests/baselines/reference/optionalParamArgsTest.errors.txt +++ b/tests/baselines/reference/optionalParamArgsTest.errors.txt @@ -1,4 +1,29 @@ -==== tests/cases/compiler/optionalParamArgsTest.ts (22 errors) ==== +tests/cases/compiler/optionalParamArgsTest.ts(35,47): error TS1016: A required parameter cannot follow an optional parameter. +tests/cases/compiler/optionalParamArgsTest.ts(31,12): error TS2393: Duplicate function implementation. +tests/cases/compiler/optionalParamArgsTest.ts(35,12): error TS2393: Duplicate function implementation. +tests/cases/compiler/optionalParamArgsTest.ts(99,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(100,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(101,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(102,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(103,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(104,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(105,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(106,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(107,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(108,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(109,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(110,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(111,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(112,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(113,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(114,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(115,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(116,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(117,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/optionalParamArgsTest.ts(118,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/compiler/optionalParamArgsTest.ts (23 errors) ==== // Optional parameter and default argument tests // Key: @@ -30,14 +55,16 @@ public C1M4(C1M4A1:number,C1M4A2?:number) { return C1M4A1 + C1M4A2; } public C1M5(C1M5A1:number,C1M5A2:number=0,C1M5A3?:number) { return C1M5A1 + C1M5A2; } + ~~~~ +!!! error TS2393: Duplicate function implementation. // Negative test // "Optional parameters may only be followed by other optional parameters" public C1M5(C1M5A1:number,C1M5A2:number=0,C1M5A3:number) { return C1M5A1 + C1M5A2; } ~~~~~~ -!!! A required parameter cannot follow an optional parameter. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate function implementation. +!!! error TS1016: A required parameter cannot follow an optional parameter. + ~~~~ +!!! error TS2393: Duplicate function implementation. } class C2 extends C1 { @@ -103,64 +130,64 @@ // Negative tests - we expect these cases to fail c1o1.C1M1(1); ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. i1o1.C1M1(1); ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. F1(1); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. L1(1); ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. c1o1.C1M2(); ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. i1o1.C1M2(); ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. F2(); ~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. L2(); ~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. c1o1.C1M2(1,2); ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. i1o1.C1M2(1,2); ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. F2(1,2); ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. L2(1,2); ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. c1o1.C1M3(1,2,3); ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. i1o1.C1M3(1,2,3); ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. F3(1,2,3); ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. L3(1,2,3); ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. c1o1.C1M4(); ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. i1o1.C1M4(); ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. F4(); ~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. L4(); ~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. function fnOpt1(id: number, children: number[] = [], expectedPath: number[] = [], isRoot?: boolean): void {} function fnOpt2(id: number, children?: number[], expectedPath?: number[], isRoot?: boolean): void {} diff --git a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt index c79360011d2..de02509d124 100644 --- a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt +++ b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1'. + Types of parameters 'p1' and 'p1' are incompatible. + Type 'string' is not assignable to type 'number'. + + ==== tests/cases/compiler/optionalParamAssignmentCompat.ts (1 errors) ==== interface I1 { (p1: number, p2: string): void; @@ -10,7 +15,7 @@ var c: I1 = i2.p1; // should be ok var d: I1 = i2.m1; // should error ~ -!!! Type '(p1?: string) => I1' is not assignable to type 'I1': -!!! Types of parameters 'p1' and 'p1' are incompatible: -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1'. +!!! error TS2322: Types of parameters 'p1' and 'p1' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams2.errors.txt b/tests/baselines/reference/optionalParamReferencingOtherParams2.errors.txt index 51c632bded9..fa89c3ed761 100644 --- a/tests/baselines/reference/optionalParamReferencingOtherParams2.errors.txt +++ b/tests/baselines/reference/optionalParamReferencingOtherParams2.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/optionalParamReferencingOtherParams2.ts(2,29): error TS2373: Initializer of parameter 'y' cannot reference identifier 'b' declared after it. + + ==== tests/cases/compiler/optionalParamReferencingOtherParams2.ts (1 errors) ==== var a = 1; function strange(x = a, y = b) { ~ -!!! Initializer of parameter 'y' cannot reference identifier 'b' declared after it. +!!! error TS2373: Initializer of parameter 'y' cannot reference identifier 'b' declared after it. var b = ""; return y; } \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams3.errors.txt b/tests/baselines/reference/optionalParamReferencingOtherParams3.errors.txt index ab344ba4f8d..f2b8d3d9127 100644 --- a/tests/baselines/reference/optionalParamReferencingOtherParams3.errors.txt +++ b/tests/baselines/reference/optionalParamReferencingOtherParams3.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/optionalParamReferencingOtherParams3.ts(1,20): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + + ==== tests/cases/compiler/optionalParamReferencingOtherParams3.ts (1 errors) ==== function right(a = b, b = a) { ~ -!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. a; b; } \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamTypeComparison.errors.txt b/tests/baselines/reference/optionalParamTypeComparison.errors.txt index f80329a5b1b..98a07570c65 100644 --- a/tests/baselines/reference/optionalParamTypeComparison.errors.txt +++ b/tests/baselines/reference/optionalParamTypeComparison.errors.txt @@ -1,14 +1,22 @@ +tests/cases/compiler/optionalParamTypeComparison.ts(4,1): error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. + Types of parameters 'b' and 'n' are incompatible. + Type 'boolean' is not assignable to type 'number'. +tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. + Types of parameters 'n' and 'b' are incompatible. + Type 'number' is not assignable to type 'boolean'. + + ==== tests/cases/compiler/optionalParamTypeComparison.ts (2 errors) ==== var f: (s: string, n?: number) => void; var g: (s: string, b?: boolean) => void; f = g; ~ -!!! Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void': -!!! Types of parameters 'b' and 'n' are incompatible: -!!! Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. +!!! error TS2322: Types of parameters 'b' and 'n' are incompatible. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. g = f; ~ -!!! Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void': -!!! Types of parameters 'n' and 'b' are incompatible: -!!! Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. +!!! error TS2322: Types of parameters 'n' and 'b' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalPropertiesInClasses.errors.txt b/tests/baselines/reference/optionalPropertiesInClasses.errors.txt index d63270ea0fa..7e27dea4df9 100644 --- a/tests/baselines/reference/optionalPropertiesInClasses.errors.txt +++ b/tests/baselines/reference/optionalPropertiesInClasses.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/optionalPropertiesInClasses.ts(10,7): error TS2420: Class 'C2' incorrectly implements interface 'ifoo'. + Property 'y' is missing in type 'C2'. + + ==== tests/cases/compiler/optionalPropertiesInClasses.ts (1 errors) ==== interface ifoo { x?:number; @@ -10,8 +14,8 @@ class C2 implements ifoo { // ERROR - still need 'y' ~~ -!!! Class 'C2' incorrectly implements interface 'ifoo': -!!! Property 'y' is missing in type 'C2'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'ifoo'. +!!! error TS2420: Property 'y' is missing in type 'C2'. public x:number; } diff --git a/tests/baselines/reference/optionalPropertiesSyntax.errors.txt b/tests/baselines/reference/optionalPropertiesSyntax.errors.txt index 348eed0916b..daeb7c7a268 100644 --- a/tests/baselines/reference/optionalPropertiesSyntax.errors.txt +++ b/tests/baselines/reference/optionalPropertiesSyntax.errors.txt @@ -1,10 +1,26 @@ +tests/cases/compiler/optionalPropertiesSyntax.ts(11,7): error TS1005: ';' expected. +tests/cases/compiler/optionalPropertiesSyntax.ts(11,8): error TS1131: Property or signature expected. +tests/cases/compiler/optionalPropertiesSyntax.ts(12,5): error TS1131: Property or signature expected. +tests/cases/compiler/optionalPropertiesSyntax.ts(18,11): error TS1005: ';' expected. +tests/cases/compiler/optionalPropertiesSyntax.ts(18,12): error TS1131: Property or signature expected. +tests/cases/compiler/optionalPropertiesSyntax.ts(32,18): error TS1005: ';' expected. +tests/cases/compiler/optionalPropertiesSyntax.ts(32,19): error TS1131: Property or signature expected. +tests/cases/compiler/optionalPropertiesSyntax.ts(33,5): error TS1131: Property or signature expected. +tests/cases/compiler/optionalPropertiesSyntax.ts(4,5): error TS2386: Overload signatures must all be optional or required. +tests/cases/compiler/optionalPropertiesSyntax.ts(24,5): error TS2300: Duplicate identifier 'prop'. +tests/cases/compiler/optionalPropertiesSyntax.ts(25,5): error TS2300: Duplicate identifier 'prop'. +tests/cases/compiler/optionalPropertiesSyntax.ts(32,5): error TS2375: Duplicate number index signature. +tests/cases/compiler/optionalPropertiesSyntax.ts(33,7): error TS2375: Duplicate number index signature. +tests/cases/compiler/optionalPropertiesSyntax.ts(34,5): error TS2375: Duplicate number index signature. + + ==== tests/cases/compiler/optionalPropertiesSyntax.ts (14 errors) ==== interface fnSigs { //functions signatures can be optional fn(): void; fn?(): void; //err ~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. fn2?(): void; } @@ -13,12 +29,12 @@ (): any; ()?: any; //err ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. ?(): any; //err ~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. } interface constructSig { @@ -26,18 +42,20 @@ new (): any; new ()?: any; //err ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. new ?(): any; //err } interface propertySig { //Property signatures can be optional prop: any; + ~~~~ +!!! error TS2300: Duplicate identifier 'prop'. prop?: any; ~~~~ -!!! Duplicate identifier 'prop'. +!!! error TS2300: Duplicate identifier 'prop'. prop2?: any; } @@ -46,19 +64,17 @@ [idx: number]: any; [idx: number]?: any; //err ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. ~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. ? [idx: number]: any; //err ~ -!!! Property or signature expected. +!!! error TS1131: Property or signature expected. ~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. [idx?: number]: any; //err - ~~~ -!!! An index signature parameter cannot have a question mark. ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate number index signature. +!!! error TS2375: Duplicate number index signature. } \ No newline at end of file diff --git a/tests/baselines/reference/optionalPropertiesTest.errors.txt b/tests/baselines/reference/optionalPropertiesTest.errors.txt index 8068dd5e061..a4b721e92ef 100644 --- a/tests/baselines/reference/optionalPropertiesTest.errors.txt +++ b/tests/baselines/reference/optionalPropertiesTest.errors.txt @@ -1,3 +1,13 @@ +tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo'. + Property 'id' is missing in type '{ name: string; }'. +tests/cases/compiler/optionalPropertiesTest.ts(25,5): error TS2322: Type '{}' is not assignable to type 'i1'. + Property 'M' is missing in type '{}'. +tests/cases/compiler/optionalPropertiesTest.ts(26,5): error TS2322: Type '{}' is not assignable to type 'i3'. + Property 'M' is missing in type '{}'. +tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is not assignable to type 'i1'. + Property 'M' is optional in type 'i2' but required in type 'i1'. + + ==== tests/cases/compiler/optionalPropertiesTest.ts (4 errors) ==== var x: {p1:number; p2?:string; p3?:{():number;};}; @@ -14,8 +24,8 @@ foo = { id: 1234, name: "test" }; // Ok foo = { name: "test" }; // Error, id missing ~~~ -!!! Type '{ name: string; }' is not assignable to type 'IFoo': -!!! Property 'id' is missing in type '{ name: string; }'. +!!! error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo'. +!!! error TS2322: Property 'id' is missing in type '{ name: string; }'. foo = {id: 1234, print:()=>{}} // Ok var s = foo.name || "default"; @@ -28,12 +38,12 @@ var test1: i1 = {}; ~~~~~ -!!! Type '{}' is not assignable to type 'i1': -!!! Property 'M' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'i1'. +!!! error TS2322: Property 'M' is missing in type '{}'. var test2: i3 = {}; ~~~~~ -!!! Type '{}' is not assignable to type 'i3': -!!! Property 'M' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'i3'. +!!! error TS2322: Property 'M' is missing in type '{}'. var test3: i2 = {}; var test4: i4 = {}; var test5: i1 = { M: function () { } }; @@ -49,5 +59,5 @@ var test10_2: i2; test10_1 = test10_2; ~~~~~~~~ -!!! Type 'i2' is not assignable to type 'i1': -!!! Required property 'M' cannot be reimplemented with optional property in 'i2'. \ No newline at end of file +!!! error TS2322: Type 'i2' is not assignable to type 'i1'. +!!! error TS2322: Property 'M' is optional in type 'i2' but required in type 'i1'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalSetterParam.errors.txt b/tests/baselines/reference/optionalSetterParam.errors.txt index 6f3b39e7138..732351671ce 100644 --- a/tests/baselines/reference/optionalSetterParam.errors.txt +++ b/tests/baselines/reference/optionalSetterParam.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/optionalSetterParam.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + + ==== tests/cases/compiler/optionalSetterParam.ts (1 errors) ==== class foo { public set bar(param?:any) { } ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index 9ff39d72f45..b7b9f437735 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. + + ==== tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts (1 errors) ==== interface A { (x: { s: string }): string @@ -22,6 +25,6 @@ var w: A; var w: C; ~ -!!! Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. w({ s: "", n: 0 }).toLowerCase(); \ No newline at end of file diff --git a/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt b/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt index 82ddd8bcef0..c18a965a6dc 100644 --- a/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt +++ b/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/overEagerReturnTypeSpecialization.ts(8,5): error TS2322: Type 'I1' is not assignable to type 'I1'. + Type 'number' is not assignable to type 'string'. + + ==== tests/cases/compiler/overEagerReturnTypeSpecialization.ts (1 errors) ==== //Note: Below simpler repro @@ -8,8 +12,8 @@ declare var v1: I1; var r1: I1 = v1.func(num => num.toString()) // Correctly returns an I1 ~~ -!!! Type 'I1' is not assignable to type 'I1': -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'I1' is not assignable to type 'I1'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. .func(str => str.length); // should error var r2: I1 = v1.func(num => num.toString()) // Correctly returns an I1 diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index 415a44ebae5..a1d8c5a6232 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/overload1.ts(27,5): error TS2322: Type 'C' is not assignable to type 'string'. +tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assignable to type 'string'. +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 (6 errors) ==== module O { export class A { @@ -27,24 +35,24 @@ var e:string=x.g(new O.A()); // matches overload but bad assignment ~ -!!! Type 'C' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type 'string'. var y:string=x.f(3); // good y=x.f("nope"); // can't assign number to string ~ -!!! Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var z:string=x.g(x.g(3,3)); // good z=x.g(2,2,2); // no match ~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. z=x.g(); // no match ~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. z=x.g(new O.B()); // ambiguous (up and down conversion) ~ -!!! Type 'C' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. z=x.h("hello",0); // good var v=x.g; diff --git a/tests/baselines/reference/overloadAssignmentCompat.errors.txt b/tests/baselines/reference/overloadAssignmentCompat.errors.txt index f5cf4b6a6f6..aa25558203b 100644 --- a/tests/baselines/reference/overloadAssignmentCompat.errors.txt +++ b/tests/baselines/reference/overloadAssignmentCompat.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/overloadAssignmentCompat.ts(35,1): error TS2394: Overload signature is not compatible with function implementation. + + ==== tests/cases/compiler/overloadAssignmentCompat.ts (1 errors) ==== // ok - overload signatures are assignment compatible with their implementation @@ -35,7 +38,7 @@ // error - signatures are not assignment compatible function foo():number; ~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function foo():string { return "a" }; \ No newline at end of file diff --git a/tests/baselines/reference/overloadModifiersMustAgree.errors.txt b/tests/baselines/reference/overloadModifiersMustAgree.errors.txt index f2aa56b8e4d..0efdbcdd1f6 100644 --- a/tests/baselines/reference/overloadModifiersMustAgree.errors.txt +++ b/tests/baselines/reference/overloadModifiersMustAgree.errors.txt @@ -1,24 +1,30 @@ +tests/cases/compiler/overloadModifiersMustAgree.ts(2,12): error TS2385: Overload signatures must all be public, private or protected. +tests/cases/compiler/overloadModifiersMustAgree.ts(6,18): error TS2384: Overload signatures must all be ambient or non-ambient. +tests/cases/compiler/overloadModifiersMustAgree.ts(7,17): error TS2383: Overload signatures must all be exported or not exported. +tests/cases/compiler/overloadModifiersMustAgree.ts(12,5): error TS2386: Overload signatures must all be optional or required. + + ==== tests/cases/compiler/overloadModifiersMustAgree.ts (4 errors) ==== class baz { public foo(); ~~~ -!!! Overload signatures must all be public or private. +!!! error TS2385: Overload signatures must all be public, private or protected. private foo(bar?: any) { } // error - access modifiers do not agree } declare function bar(); ~~~ -!!! Overload signatures must all be ambient or non-ambient. +!!! error TS2384: Overload signatures must all be ambient or non-ambient. export function bar(s: string); ~~~ -!!! Overload signatures must all be exported or not exported. +!!! error TS2383: Overload signatures must all be exported or not exported. function bar(s?: string) { } interface I { foo? (); foo(s: string); ~~~ -!!! Overload signatures must all be optional or required. +!!! error TS2386: Overload signatures must all be optional or required. } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt index 42336209049..70530d409b3 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt @@ -1,8 +1,10 @@ -==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (3 errors) ==== +tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,37): error TS1005: ';' expected. +tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,8): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + +==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (2 errors) ==== var f: (x: 'hi') => number = ('hi') => { return 1; }; ~~ -!!! ';' expected. - ~~~~~~ -!!! A 'return' statement can only be used within a function body. +!!! error TS1005: ';' expected. ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. \ No newline at end of file +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.errors.txt b/tests/baselines/reference/overloadOnConstConstraintChecks4.errors.txt index b64650db422..9ac9e2253f0 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.errors.txt +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/overloadOnConstConstraintChecks4.ts(9,1): error TS2394: Overload signature is not compatible with function implementation. + + ==== tests/cases/compiler/overloadOnConstConstraintChecks4.ts (1 errors) ==== class Z { } class A extends Z { private x = 1 } @@ -9,7 +12,7 @@ function foo(name: 'bye'): C; function foo(name: string): A; // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. function foo(name: any): Z { return null; } diff --git a/tests/baselines/reference/overloadOnConstDuplicateOverloads1.errors.txt b/tests/baselines/reference/overloadOnConstDuplicateOverloads1.errors.txt index 04df57d7fcc..4714c06ee73 100644 --- a/tests/baselines/reference/overloadOnConstDuplicateOverloads1.errors.txt +++ b/tests/baselines/reference/overloadOnConstDuplicateOverloads1.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/overloadOnConstDuplicateOverloads1.ts(1,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstDuplicateOverloads1.ts(2,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/overloadOnConstDuplicateOverloads1.ts (2 errors) ==== function foo(a: 'hi', x: string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(a: 'hi', x: string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(a: any, x: any) { } diff --git a/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.errors.txt b/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.errors.txt index 4124c643554..e040559a054 100644 --- a/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.errors.txt +++ b/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.errors.txt @@ -1,13 +1,17 @@ +tests/cases/compiler/overloadOnConstInBaseWithBadImplementationInDerived.ts(2,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstInBaseWithBadImplementationInDerived.ts(6,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/overloadOnConstInBaseWithBadImplementationInDerived.ts (2 errors) ==== interface I { x1(a: number, callback: (x: 'hi') => number); ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. } class C implements I { x1(a: number, callback: (x: 'hi') => number) { // error ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. } } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInCallback1.errors.txt b/tests/baselines/reference/overloadOnConstInCallback1.errors.txt index 40473b6b6aa..5d594204933 100644 --- a/tests/baselines/reference/overloadOnConstInCallback1.errors.txt +++ b/tests/baselines/reference/overloadOnConstInCallback1.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/overloadOnConstInCallback1.ts(2,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/overloadOnConstInCallback1.ts (1 errors) ==== class C { x1(a: number, callback: (x: 'hi') => number); // error ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. x1(a: number, callback: (x: any) => number) { callback('hi'); callback('bye'); diff --git a/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.errors.txt b/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.errors.txt index 11d35bdedf5..5788a9e6bbe 100644 --- a/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.errors.txt +++ b/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.errors.txt @@ -1,10 +1,14 @@ +tests/cases/compiler/overloadOnConstInObjectLiteralImplementingAnInterface.ts(2,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstInObjectLiteralImplementingAnInterface.ts(5,35): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/overloadOnConstInObjectLiteralImplementingAnInterface.ts (2 errors) ==== interface I { x1(a: number, callback: (x: 'hi') => number); ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. } var i2: I = { x1: (a: number, cb: (x: 'hi') => number) => { } }; // error ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. \ No newline at end of file +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt index ff965b47a18..159af64a13a 100644 --- a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/overloadOnConstInheritance2.ts(5,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. + Types of property 'addEventListener' are incompatible. + Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. +tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/overloadOnConstInheritance2.ts (2 errors) ==== interface Base { addEventListener(x: string): any; @@ -5,11 +11,11 @@ } interface Deriver extends Base { ~~~~~~~ -!!! Interface 'Deriver' incorrectly extends interface 'Base': -!!! Types of property 'addEventListener' are incompatible: -!!! Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. +!!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'addEventListener' are incompatible. +!!! error TS2430: Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. addEventListener(x: 'bar'): string; // shouldn't need to redeclare the string overload ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt index cbfd32b1d6d..e0fff7b1ec7 100644 --- a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt @@ -1,18 +1,25 @@ +tests/cases/compiler/overloadOnConstInheritance3.ts(4,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. + Types of property 'addEventListener' are incompatible. + Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. +tests/cases/compiler/overloadOnConstInheritance3.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/overloadOnConstInheritance3.ts (3 errors) ==== interface Base { addEventListener(x: string): any; } interface Deriver extends Base { ~~~~~~~ -!!! Interface 'Deriver' incorrectly extends interface 'Base': -!!! Types of property 'addEventListener' are incompatible: -!!! Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. +!!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'addEventListener' are incompatible. +!!! error TS2430: Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. // shouldn't need to redeclare the string overload addEventListener(x: 'bar'): string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. addEventListener(x: 'foo'): string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInheritance4.errors.txt b/tests/baselines/reference/overloadOnConstInheritance4.errors.txt index f2debeac4ff..54200023408 100644 --- a/tests/baselines/reference/overloadOnConstInheritance4.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance4.errors.txt @@ -1,16 +1,21 @@ +tests/cases/compiler/overloadOnConstInheritance4.ts(2,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstInheritance4.ts(5,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstInheritance4.ts(6,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/overloadOnConstInheritance4.ts (3 errors) ==== interface I { x1(a: number, callback: (x: 'hi') => number); ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. } class C implements I { x1(a: number, callback: (x: 'hi') => number); ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. x1(a: number, callback: (x: 'hi') => number) { ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. } } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt index ad3dc56a7f9..2827a97ca82 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt @@ -1,10 +1,16 @@ +tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(1,28): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(2,28): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +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(14,7): error TS2381: A signature with an implementation cannot use a string literal type. + + ==== tests/cases/compiler/overloadOnConstNoAnyImplementation.ts (4 errors) ==== function x1(a: number, cb: (x: 'hi') => number); ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function x1(a: number, cb: (x: 'bye') => number); ~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function x1(a: number, cb: (x: string) => number) { cb('hi'); cb('bye'); @@ -13,12 +19,12 @@ cb('uh'); cb(1); // error ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. } var cb: (number) => number = (x: number) => 1; x1(1, cb); x1(1, (x: 'hi') => 1); // error ~~~~~~~~~~~~~~ -!!! A signature with an implementation cannot use a string literal type. +!!! error TS2381: A signature with an implementation cannot use a string literal type. x1(1, (x: string) => 1); \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt index 201165a56ec..aab390c48e8 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt @@ -1,14 +1,21 @@ +tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(2,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(6,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +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(17,9): error TS2381: A signature with an implementation cannot use a string literal type. +tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(18,9): error TS2381: A signature with an implementation cannot use a string literal type. + + ==== tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts (5 errors) ==== interface I { x1(a: number, callback: (x: 'hi') => number); ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. } class C { x1(a: number, callback: (x: 'hi') => number); ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. x1(a: number, callback: (x: string) => number) { callback('hi'); callback('bye'); @@ -16,17 +23,17 @@ callback(hm); callback(1); // error ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. } } var c: C; c.x1(1, (x: 'hi') => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! A signature with an implementation cannot use a string literal type. +!!! error TS2381: A signature with an implementation cannot use a string literal type. c.x1(1, (x: 'bye') => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! A signature with an implementation cannot use a string literal type. +!!! error TS2381: A signature with an implementation cannot use a string literal type. c.x1(1, (x) => { return 1; } ); c.x1(1, (x: number) => { return 1; } ); \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.errors.txt b/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.errors.txt index 73c954ef10c..f897cae121d 100644 --- a/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/overloadOnConstNoNonSpecializedSignature.ts(2,4): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/overloadOnConstNoNonSpecializedSignature.ts (1 errors) ==== class C { x1(a: 'hi'); // error, no non-specialized signature in overload list ~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. x1(a: string) { } } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation.errors.txt b/tests/baselines/reference/overloadOnConstNoStringImplementation.errors.txt index 8ac0806a496..12dcdaf9769 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation.errors.txt @@ -1,10 +1,15 @@ +tests/cases/compiler/overloadOnConstNoStringImplementation.ts(1,28): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstNoStringImplementation.ts(2,28): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstNoStringImplementation.ts(14,7): error TS2381: A signature with an implementation cannot use a string literal type. + + ==== tests/cases/compiler/overloadOnConstNoStringImplementation.ts (3 errors) ==== function x2(a: number, cb: (x: 'hi') => number); ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function x2(a: number, cb: (x: 'bye') => number); ~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function x2(a: number, cb: (x: any) => number) { cb('hi'); cb('bye'); @@ -18,5 +23,5 @@ x2(1, cb); // error x2(1, (x: 'hi') => 1); // error ~~~~~~~~~~~~~~ -!!! A signature with an implementation cannot use a string literal type. +!!! error TS2381: A signature with an implementation cannot use a string literal type. x2(1, (x: string) => 1); \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt index f7fdeed169b..c85b004f160 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt @@ -1,14 +1,20 @@ +tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(2,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(6,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(17,9): error TS2381: A signature with an implementation cannot use a string literal type. +tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(18,9): error TS2381: A signature with an implementation cannot use a string literal type. + + ==== tests/cases/compiler/overloadOnConstNoStringImplementation2.ts (4 errors) ==== interface I { x1(a: number, callback: (x: 'hi') => number); ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. } class C implements I { x1(a: number, callback: (x: 'hi') => number); ~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. x1(a: number, callback: (x: any) => number) { callback('hi'); callback('bye'); @@ -21,9 +27,9 @@ var c: C; c.x1(1, (x: 'hi') => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! A signature with an implementation cannot use a string literal type. +!!! error TS2381: A signature with an implementation cannot use a string literal type. c.x1(1, (x: 'bye') => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! A signature with an implementation cannot use a string literal type. +!!! error TS2381: A signature with an implementation cannot use a string literal type. c.x1(1, (x: string) => { return 1; } ); c.x1(1, (x: number) => { return 1; } ); \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt index 1369843e9b4..bfdb66aa437 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(6,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(7,1): error TS2381: A signature with an implementation cannot use a string literal type. +tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(11,5): error TS2345: Argument of type 'string' is not assignable to parameter of type '"SPAN"'. + + ==== tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts (3 errors) ==== class Base { foo() { } } class Derived1 extends Base { bar() { } } @@ -6,15 +11,15 @@ function foo(name: "SPAN"): Derived1; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(name: "DIV"): Derived2 { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return null; ~~~~~~~~~~~~~~~~ } ~ -!!! A signature with an implementation cannot use a string literal type. +!!! error TS2381: A signature with an implementation cannot use a string literal type. foo("HI"); ~~~~ -!!! Argument of type 'string' is not assignable to parameter of type '"SPAN"'. \ No newline at end of file +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"SPAN"'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index a5d0a02969d..e0a65f7475e 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,4 +1,16 @@ -==== tests/cases/conformance/expressions/functionCalls/overloadResolution.ts (17 errors) ==== +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(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(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(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'. + + +==== tests/cases/conformance/expressions/functionCalls/overloadResolution.ts (10 errors) ==== class SomeBase { private n; @@ -27,7 +39,7 @@ // No candidate overloads found fn1({}); // Error ~~ -!!! Argument of type '{}' 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 generic overload is the only candidate when called with type arguments function fn2(s: string, n: number): number; @@ -43,7 +55,7 @@ // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments fn2('', 0); // Error ~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' 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 @@ -67,7 +79,7 @@ // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. // Generic overloads with constraints called with type arguments that satisfy the constraints function fn4(n: T, m: U); @@ -75,24 +87,12 @@ function fn4() { } fn4('', 3); fn4(3, ''); // Error - ~~~~~~ -!!! Type 'string' does not satisfy the constraint 'number'. - ~~~~~~ -!!! Type 'number' does not satisfy the constraint 'string'. ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. fn4('', 3); // Error - ~~~~~~ -!!! Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! Type 'string' does not satisfy the constraint 'number'. ~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. fn4(3, ''); - ~~~~~~ -!!! Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! Type 'string' does not satisfy the constraint 'number'. // Generic overloads with constraints called without type arguments but with types that satisfy the constraints fn4('', 3); @@ -103,17 +103,15 @@ // Generic overloads with constraints called with type arguments that do not satisfy the constraints fn4(null, null); // Error ~~~~~~~ -!!! Type 'boolean' does not satisfy the constraint 'string'. - ~~~~ -!!! Type 'Date' does not satisfy the constraint 'number'. +!!! error TS2344: Type 'boolean' does not satisfy the constraint 'number'. // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error ~~~~ -!!! Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. fn4(null, true); // Error ~~~~ -!!! Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'boolean' 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; @@ -121,9 +119,9 @@ function fn5() { return undefined; } var n = fn5((n) => n.toFixed()); ~ -!!! Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. ~~~~~~~ -!!! Property 'toFixed' does not exist on type 'string'. +!!! error TS2339: Property 'toFixed' does not exist on type 'string'. var s = fn5((n) => n.substr(0)); \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 389ae265c32..c6737c3d792 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,4 +1,20 @@ -==== tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts (18 errors) ==== +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. +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(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(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(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'. + + +==== tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts (14 errors) ==== class SomeBase { private n; @@ -27,7 +43,7 @@ // No candidate overloads found new fn1({}); // Error ~~ -!!! Argument of type '{}' 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 generic overload is the only candidate when called with type arguments class fn2 { @@ -62,16 +78,16 @@ // Generic overloads with differing arity called with type arguments matching each overload type parameter count new fn3(4); // Error ~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. new fn3('', '', ''); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. // Generic overloads with constraints called with type arguments that satisfy the constraints class fn4 { @@ -81,44 +97,36 @@ new fn4('', 3); new fn4(3, ''); // Error ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. new fn4('', 3); // Error ~~~~~~ -!!! Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! Type 'string' does not satisfy the constraint 'number'. - ~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. new fn4(3, ''); // Error ~~~~~~ -!!! Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! Type 'string' does not satisfy the constraint 'number'. +!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. // Generic overloads with constraints called without type arguments but with types that satisfy the constraints new fn4('', 3); new fn4(3, ''); // Error ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. new fn4(3, undefined); // Error ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' 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 new fn4(null, null); // Error ~~~~~~~ -!!! Type 'boolean' does not satisfy the constraint 'string'. - ~~~~ -!!! Type 'Date' does not satisfy the constraint 'number'. +!!! error TS2344: Type 'boolean' does not satisfy the constraint 'string'. // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error ~~~~ -!!! Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. new fn4(null, true); // Error ~~~~ -!!! Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. // Non - generic overloads where contextual typing of function arguments has errors class fn5 { @@ -128,11 +136,11 @@ } new fn5((n) => n.toFixed()); ~~~~~~~ -!!! Property 'toFixed' does not exist on type 'string'. +!!! error TS2339: Property 'toFixed' does not exist on type 'string'. new fn5((n) => n.substr(0)); new fn5((n) => n.blah); // Error ~~~~ -!!! Property 'blah' does not exist on type 'string'. +!!! error TS2339: Property 'blah' does not exist on type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 96dd65c0710..540e12774c7 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,4 +1,16 @@ -==== tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts (17 errors) ==== +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(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(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(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'. + + +==== tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts (10 errors) ==== class SomeBase { private n; @@ -27,7 +39,7 @@ // No candidate overloads found new fn1({}); // Error ~~ -!!! Argument of type '{}' 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 generic overload is the only candidate when called with type arguments interface fn2 { @@ -45,7 +57,7 @@ // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments new fn2('', 0); // Error ~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' 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 @@ -71,7 +83,7 @@ // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. // Generic overloads with constraints called with type arguments that satisfy the constraints interface fn4 { @@ -82,24 +94,12 @@ new fn4('', 3); new fn4(3, ''); // Error - ~~~~~~ -!!! Type 'string' does not satisfy the constraint 'number'. - ~~~~~~ -!!! Type 'number' does not satisfy the constraint 'string'. ~ -!!! Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. new fn4('', 3); // Error - ~~~~~~ -!!! Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! Type 'string' does not satisfy the constraint 'number'. ~~ -!!! Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. new fn4(3, ''); - ~~~~~~ -!!! Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! Type 'string' does not satisfy the constraint 'number'. // Generic overloads with constraints called without type arguments but with types that satisfy the constraints new fn4('', 3); @@ -110,17 +110,15 @@ // Generic overloads with constraints called with type arguments that do not satisfy the constraints new fn4(null, null); // Error ~~~~~~~ -!!! Type 'boolean' does not satisfy the constraint 'string'. - ~~~~ -!!! Type 'Date' does not satisfy the constraint 'number'. +!!! error TS2344: Type 'boolean' does not satisfy the constraint 'number'. // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error ~~~~ -!!! Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. new fn4(null, true); // Error ~~~~ -!!! Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors interface fn5 { @@ -130,8 +128,8 @@ var fn5: fn5; var n = new fn5((n) => n.toFixed()); ~ -!!! Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. ~~~~~~~ -!!! Property 'toFixed' does not exist on type 'string'. +!!! error TS2339: Property 'toFixed' does not exist on type 'string'. var s = new fn5((n) => n.substr(0)); \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.errors.txt b/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.errors.txt index c9935140818..1922df6852a 100644 --- a/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.errors.txt +++ b/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/overloadResolutionOnDefaultConstructor1.ts(3,16): error TS2346: Supplied parameters do not match any signature of call target. + + ==== tests/cases/compiler/overloadResolutionOnDefaultConstructor1.ts (1 errors) ==== class Bar { public clone() { return new Bar(0); ~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. } } \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt b/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt index bd11102dfdd..03901cf67a4 100644 --- a/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt +++ b/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt @@ -1,5 +1,8 @@ +tests/cases/compiler/overloadResolutionOverCTLambda.ts(2,5): error TS2345: Argument of type '(a: number) => number' is not assignable to parameter of type '(item: number) => boolean'. + + ==== tests/cases/compiler/overloadResolutionOverCTLambda.ts (1 errors) ==== function foo(b: (item: number) => boolean) { } foo(a => a); // can not convert (number)=>bool to (number)=>number ~~~~~~ -!!! Argument of type '(a: number) => number' is not assignable to parameter of type '(item: number) => boolean'. \ No newline at end of file +!!! error TS2345: Argument of type '(a: number) => number' is not assignable to parameter of type '(item: number) => boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types index 6bc491fd157..7ad68cefa4f 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types @@ -37,7 +37,7 @@ module Bugs { var tokens:IToken[]= []; >tokens : IToken[] >IToken : IToken ->[] : IToken[] +>[] : undefined[] tokens.push({ startIndex: 1, type: '', bracket: 3 }); >tokens.push({ startIndex: 1, type: '', bracket: 3 }) : number @@ -61,7 +61,7 @@ module Bugs { >startIndex : number >type : string >bracket : number ->state : any +>state : null >length : number } } diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index c8b65902d26..9f51c0fa10b 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,3 +1,15 @@ +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; }'. + 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; }'. + Types of property 'a' are incompatible. + Type 'string' 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'. + + ==== tests/cases/compiler/overloadResolutionTest1.ts (3 errors) ==== function foo(bar:{a:number;}[]):string; @@ -8,10 +20,10 @@ var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~ -!!! Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! Type '{ a: string; }' is not assignable to type '{ a: boolean; }': -!!! Types of property 'a' are incompatible: -!!! Type 'string' is not assignable to type 'boolean'. +!!! 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: Types of property 'a' are incompatible. +!!! error TS2345: Type 'string' 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 @@ -24,9 +36,9 @@ var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error ~~~~~~~ -!!! Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. -!!! Types of property 'a' are incompatible: -!!! Type 'string' is not assignable to type 'boolean'. +!!! error TS2345: Argument of type '{ a: string; }' 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'. function foo4(bar:{a:number;}):number; @@ -34,6 +46,6 @@ function foo4(bar:{a:any;}):any{ return bar }; var x = foo4({a:true}); // error ~~~~~~~~ -!!! 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'. \ No newline at end of file +!!! error TS2345: Argument of type '{ a: boolean; }' is not assignable to parameter of type '{ a: string; }'. +!!! error TS2345: Types of property 'a' are incompatible. +!!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants1.errors.txt b/tests/baselines/reference/overloadingOnConstants1.errors.txt index f523160803c..f134a146500 100644 --- a/tests/baselines/reference/overloadingOnConstants1.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants1.errors.txt @@ -1,3 +1,13 @@ +tests/cases/compiler/overloadingOnConstants1.ts(22,5): error TS2322: Type 'Base' is not assignable to type 'Derived1'. + Property 'bar' is missing in type 'Base'. +tests/cases/compiler/overloadingOnConstants1.ts(23,5): error TS2322: Type 'Derived1' is not assignable to type 'Derived3'. + Property 'biz' is missing in type 'Derived1'. +tests/cases/compiler/overloadingOnConstants1.ts(24,5): error TS2322: Type 'Derived2' is not assignable to type 'Derived1'. + Property 'bar' is missing in type 'Derived2'. +tests/cases/compiler/overloadingOnConstants1.ts(25,5): error TS2322: Type 'Derived3' is not assignable to type 'Derived1'. + Property 'bar' is missing in type 'Derived3'. + + ==== tests/cases/compiler/overloadingOnConstants1.ts (4 errors) ==== class Base { foo() { } } class Derived1 extends Base { bar() { } } @@ -22,17 +32,17 @@ // these are errors var htmlElement2: Derived1 = d2.createElement("yo") ~~~~~~~~~~~~ -!!! Type 'Base' is not assignable to type 'Derived1': -!!! Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived1'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. var htmlCanvasElement2: Derived3 = d2.createElement("canvas"); ~~~~~~~~~~~~~~~~~~ -!!! Type 'Derived1' is not assignable to type 'Derived3': -!!! Property 'biz' is missing in type 'Derived1'. +!!! error TS2322: Type 'Derived1' is not assignable to type 'Derived3'. +!!! error TS2322: Property 'biz' is missing in type 'Derived1'. var htmlDivElement2: Derived1 = d2.createElement("div"); ~~~~~~~~~~~~~~~ -!!! Type 'Derived2' is not assignable to type 'Derived1': -!!! Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived1'. +!!! error TS2322: Property 'bar' is missing in type 'Derived2'. var htmlSpanElement2: Derived1 = d2.createElement("span"); ~~~~~~~~~~~~~~~~ -!!! Type 'Derived3' is not assignable to type 'Derived1': -!!! Property 'bar' is missing in type 'Derived3'. \ No newline at end of file +!!! error TS2322: Type 'Derived3' is not assignable to type 'Derived1'. +!!! error TS2322: Property 'bar' is missing in type 'Derived3'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index a79428f70b6..1d7d2c8ecab 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/overloadingOnConstants2.ts(8,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadingOnConstants2.ts(9,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadingOnConstants2.ts(15,13): error TS2345: Argument of type 'string' is not assignable to parameter of type '"bye"'. +tests/cases/compiler/overloadingOnConstants2.ts(19,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. + + ==== tests/cases/compiler/overloadingOnConstants2.ts (4 errors) ==== class C { private x = 1; @@ -8,10 +14,10 @@ } function foo(x: "hi", items: string[]): D; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(x: "bye", items: string[]): E; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(x: string, items: string[]): C { return null; } @@ -19,13 +25,13 @@ var b: E = foo("bye", []); // E var c = foo("um", []); // error ~~~~ -!!! Argument of type 'string' is not assignable to parameter of type '"bye"'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"bye"'. //function bar(x: "hi", items: string[]): D; function bar(x: "bye", items: string[]): E; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function bar(x: string, items: string[]): C; function bar(x: string, items: string[]): C { return null; diff --git a/tests/baselines/reference/overloadingOnConstantsInImplementation.errors.txt b/tests/baselines/reference/overloadingOnConstantsInImplementation.errors.txt index 6313010ef8c..e3a8bb08628 100644 --- a/tests/baselines/reference/overloadingOnConstantsInImplementation.errors.txt +++ b/tests/baselines/reference/overloadingOnConstantsInImplementation.errors.txt @@ -1,12 +1,17 @@ +tests/cases/compiler/overloadingOnConstantsInImplementation.ts(1,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadingOnConstantsInImplementation.ts(2,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. +tests/cases/compiler/overloadingOnConstantsInImplementation.ts(3,1): error TS2381: A signature with an implementation cannot use a string literal type. + + ==== tests/cases/compiler/overloadingOnConstantsInImplementation.ts (3 errors) ==== function foo(a: 'hi', x: string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(a: 'hi', x: string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. +!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. function foo(a: 'hi', x: any) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ -!!! A signature with an implementation cannot use a string literal type. \ No newline at end of file +!!! error TS2381: A signature with an implementation cannot use a string literal type. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt b/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt index 2d8832f67da..7d101598129 100644 --- a/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt +++ b/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt @@ -1,34 +1,50 @@ +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(1,14): error TS1005: '(' expected. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(2,3): error TS1129: Statement expected. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,3): error TS1129: Statement expected. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,19): error TS1005: ',' expected. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,3): error TS1129: Statement expected. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,20): error TS1109: Expression expected. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,25): error TS1005: ';' expected. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(2,10): error TS2304: Cannot find name 'test'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,10): error TS2304: Cannot find name 'test'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,15): error TS2304: Cannot find name 'name'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(3,20): error TS2304: Cannot find name 'string'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,10): error TS2304: Cannot find name 'test'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,15): error TS2304: Cannot find name 'name'. +tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts(4,21): error TS2304: Cannot find name 'any'. + + ==== tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts (14 errors) ==== function boo { ~ -!!! '(' expected. +!!! error TS1005: '(' expected. static test() ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. ~~~~ -!!! Cannot find name 'test'. +!!! error TS2304: Cannot find name 'test'. static test(name:string) ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. ~ -!!! ',' expected. +!!! error TS1005: ',' expected. ~~~~ -!!! Cannot find name 'test'. +!!! error TS2304: Cannot find name 'test'. ~~~~ -!!! Cannot find name 'name'. +!!! error TS2304: Cannot find name 'name'. ~~~~~~ -!!! Cannot find name 'string'. +!!! error TS2304: Cannot find name 'string'. static test(name?:any){ } ~~~~~~ -!!! Statement expected. +!!! error TS1129: Statement expected. ~ -!!! Expression expected. +!!! error TS1109: Expression expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~~~~ -!!! Cannot find name 'test'. +!!! error TS2304: Cannot find name 'test'. ~~~~ -!!! Cannot find name 'name'. +!!! error TS2304: Cannot find name 'name'. ~~~ -!!! Cannot find name 'any'. +!!! error TS2304: Cannot find name 'any'. } \ No newline at end of file diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 58472a41414..4a119c5ca22 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -1,3 +1,11 @@ +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): error TS2345: Argument of type 'D' is not assignable to parameter of type 'A'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,12): error TS2344: Type 'D' does not satisfy the constraint 'A'. + + ==== tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts (6 errors) ==== interface A { x } interface B { x; y } @@ -12,27 +20,27 @@ declare function foo(arg: (x: C) => any): string; declare function foo(arg: (x: B) => any): number; - var result: number = foo(x => new G(x)); // No error, returns number + var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. ~~~~~~ -!!! Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. ~ -!!! Argument of type 'D' is not assignable to parameter of type 'A'. +!!! error TS2345: Argument of type 'D' is not assignable to parameter of type 'A'. - var result2: number = foo(x => new G(x)); // No error, returns number - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. + var result2: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. + ~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. ~~~~~~~~ -!!! Type 'D' does not satisfy the constraint 'A'. +!!! error TS2344: Type 'D' does not satisfy the constraint 'A'. - var result3: string = foo(x => { // returns string because the C overload is picked - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - var y: G; // error that C does not satisfy constraint - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var result3: string = foo(x => { // x has type D + ~~~~~~~~~~~~~~~~~~~~~~ + var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ -!!! Type 'D' does not satisfy the constraint 'A'. +!!! error TS2344: Type 'D' does not satisfy the constraint 'A'. return y; ~~~~~~~~~~~~~ }); ~ -!!! Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. +!!! error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js index 0e5f84c8d69..63b4a2b1e93 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js @@ -12,12 +12,12 @@ declare function foo(arg: (x: D) => number): string; declare function foo(arg: (x: C) => any): string; declare function foo(arg: (x: B) => any): number; -var result: number = foo(x => new G(x)); // No error, returns number +var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. -var result2: number = foo(x => new G(x)); // No error, returns number +var result2: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. -var result3: string = foo(x => { // returns string because the C overload is picked - var y: G; // error that C does not satisfy constraint +var result3: string = foo(x => { // x has type D + var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error return y; }); @@ -28,9 +28,9 @@ var G = (function () { } return G; })(); -var result = foo(function (x) { return new G(x); }); // No error, returns number -var result2 = foo(function (x) { return new G(x); }); // No error, returns number +var result = foo(function (x) { return new G(x); }); // x has type D, new G(x) fails, so first overload is picked. +var result2 = foo(function (x) { return new G(x); }); // x has type D, new G(x) fails, so first overload is picked. var result3 = foo(function (x) { - var y; // error that C does not satisfy constraint + var y; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error return y; }); diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt index 3b9543f50cc..64faaf7e8c1 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -1,3 +1,8 @@ +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,1): error TS2350: Only a void function can be called with the 'new' keyword. + + ==== tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts (3 errors) ==== declare function Callbacks(flags?: string): void; declare function Callbacks(flags?: string): void; @@ -5,9 +10,9 @@ Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. new Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. +!!! error TS2346: Supplied parameters do not match any signature of call target. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Only a void function can be called with the 'new' keyword. \ No newline at end of file +!!! error TS2350: Only a void function can be called with the 'new' keyword. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt index 06bd4d0f62d..20da9c71371 100644 --- a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt +++ b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt @@ -1,3 +1,6 @@ +tests/cases/compiler/overloadsInDifferentContainersDisagreeOnAmbient.ts(7,21): error TS2384: Overload signatures must all be ambient or non-ambient. + + ==== tests/cases/compiler/overloadsInDifferentContainersDisagreeOnAmbient.ts (1 errors) ==== declare module M { // Error because body is not ambient and this overload is @@ -7,5 +10,5 @@ module M { export function f() { } ~ -!!! Overload signatures must all be ambient or non-ambient. +!!! error TS2384: Overload signatures must all be ambient or non-ambient. } \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithConstraints.js b/tests/baselines/reference/overloadsWithConstraints.js new file mode 100644 index 00000000000..f9cc87b2260 --- /dev/null +++ b/tests/baselines/reference/overloadsWithConstraints.js @@ -0,0 +1,8 @@ +//// [overloadsWithConstraints.ts] +declare function f(x: T): T; +declare function f(x: T): T + +var v = f(""); + +//// [overloadsWithConstraints.js] +var v = f(""); diff --git a/tests/baselines/reference/overloadsWithConstraints.types b/tests/baselines/reference/overloadsWithConstraints.types new file mode 100644 index 00000000000..1493a0e1a2a --- /dev/null +++ b/tests/baselines/reference/overloadsWithConstraints.types @@ -0,0 +1,22 @@ +=== tests/cases/compiler/overloadsWithConstraints.ts === +declare function f(x: T): T; +>f : { (x: T): T; (x: T): T; } +>T : T +>Number : Number +>x : T +>T : T +>T : T + +declare function f(x: T): T +>f : { (x: T): T; (x: T): T; } +>T : T +>String : String +>x : T +>T : T +>T : T + +var v = f(""); +>v : string +>f("") : string +>f : { (x: T): T; (x: T): T; } + diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index 2e44fc1df69..bd918de55fe 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -1,3 +1,9 @@ +tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,6): error TS2345: Argument of type '(s: string) => {}' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,6): error TS2345: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. +tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. + + ==== tests/cases/compiler/overloadsWithProvisionalErrors.ts (4 errors) ==== var func: { (s: string): number; @@ -6,12 +12,12 @@ func(s => ({})); // Error for no applicable overload (object type is missing a and b) ~~~~~~~~~ -!!! Argument of type '(s: string) => {}' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. +!!! error TS2345: Argument of type '(s: string) => {}' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ -!!! Cannot find name 'blah'. +!!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway ~~~~~~~~~~~~~~~~~~ -!!! Argument of type '(s: string) => { a: unknown; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. +!!! error TS2345: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. ~~~~ -!!! Cannot find name 'blah'. \ No newline at end of file +!!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithinClasses.errors.txt b/tests/baselines/reference/overloadsWithinClasses.errors.txt index c67bba61626..02872861a4b 100644 --- a/tests/baselines/reference/overloadsWithinClasses.errors.txt +++ b/tests/baselines/reference/overloadsWithinClasses.errors.txt @@ -1,11 +1,17 @@ -==== tests/cases/compiler/overloadsWithinClasses.ts (1 errors) ==== +tests/cases/compiler/overloadsWithinClasses.ts(3,12): error TS2393: Duplicate function implementation. +tests/cases/compiler/overloadsWithinClasses.ts(5,12): error TS2393: Duplicate function implementation. + + +==== tests/cases/compiler/overloadsWithinClasses.ts (2 errors) ==== class foo { static fnOverload( ) {} + ~~~~~~~~~~ +!!! error TS2393: Duplicate function implementation. static fnOverload(foo: string){ } // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate function implementation. + ~~~~~~~~~~ +!!! error TS2393: Duplicate function implementation. } diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt b/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt index 0e7200d122d..c63856a9ee1 100644 --- a/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt +++ b/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt @@ -1,3 +1,7 @@ +tests/cases/compiler/overridingPrivateStaticMembers.ts(5,7): error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. + Types have separate declarations of a private property 'y'. + + ==== tests/cases/compiler/overridingPrivateStaticMembers.ts (1 errors) ==== class Base2 { private static y: { foo: string }; @@ -5,7 +9,7 @@ class Derived2 extends Base2 { ~~~~~~~~ -!!! Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': -!!! Private property 'y' cannot be reimplemented. +!!! error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. +!!! error TS2417: Types have separate declarations of a private property 'y'. private static y: { foo: string; bar: string; }; } \ No newline at end of file diff --git a/tests/baselines/reference/paramPropertiesInSignatures.errors.txt b/tests/baselines/reference/paramPropertiesInSignatures.errors.txt index 46ac90581e9..89d2ea67bc3 100644 --- a/tests/baselines/reference/paramPropertiesInSignatures.errors.txt +++ b/tests/baselines/reference/paramPropertiesInSignatures.errors.txt @@ -1,22 +1,29 @@ +tests/cases/compiler/paramPropertiesInSignatures.ts(2,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/paramPropertiesInSignatures.ts(3,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/paramPropertiesInSignatures.ts(8,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/paramPropertiesInSignatures.ts(9,14): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/paramPropertiesInSignatures.ts(10,14): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/paramPropertiesInSignatures.ts (5 errors) ==== class C1 { constructor(public p1:string); // ERROR ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. constructor(private p2:number); // ERROR ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. constructor(public p3:any) {} // OK } declare class C2 { constructor(public p1:string); // ERROR ~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. constructor(private p2:number); // ERROR ~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. constructor(public p3:any); // ERROR ~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/parameterInitializersForwardReferencing.errors.txt b/tests/baselines/reference/parameterInitializersForwardReferencing.errors.txt index c528203fdd1..22fe5ce558d 100644 --- a/tests/baselines/reference/parameterInitializersForwardReferencing.errors.txt +++ b/tests/baselines/reference/parameterInitializersForwardReferencing.errors.txt @@ -1,3 +1,15 @@ +tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts(6,20): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts(11,21): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts(11,28): error TS2373: Initializer of parameter 'b' cannot reference identifier 'c' declared after it. +tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts(17,21): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts(23,25): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts(32,21): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts(33,16): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts(37,14): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts(37,21): error TS2373: Initializer of parameter 'b' cannot reference identifier 'c' declared after it. +tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts(37,28): error TS2373: Initializer of parameter 'c' cannot reference identifier 'd' declared after it. + + ==== tests/cases/conformance/functions/parameterInitializersForwardReferencing.ts (10 errors) ==== function left(a, b = a, c = b) { a; @@ -6,16 +18,16 @@ function right(a = b, b = a) { ~ -!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. a; b; } function right2(a = b, b = c, c = a) { ~ -!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. ~ -!!! Initializer of parameter 'b' cannot reference identifier 'c' declared after it. +!!! error TS2373: Initializer of parameter 'b' cannot reference identifier 'c' declared after it. a; b; c; @@ -23,7 +35,7 @@ function inside(a = b) { ~ -!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. var b; } @@ -31,7 +43,7 @@ var b; function inside(a = b) { // Still an error because b is declared inside the function ~ -!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. var b; } } @@ -42,20 +54,20 @@ class C { constructor(a = b, b = 1) { } ~ -!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. method(a = b, b = 1) { } ~ -!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. } // Function expressions var x = (a = b, b = c, c = d) => { var d; }; ~ -!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. +!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it. ~ -!!! Initializer of parameter 'b' cannot reference identifier 'c' declared after it. +!!! error TS2373: Initializer of parameter 'b' cannot reference identifier 'c' declared after it. ~ -!!! Initializer of parameter 'c' cannot reference identifier 'd' declared after it. +!!! error TS2373: Initializer of parameter 'c' cannot reference identifier 'd' declared after it. // Should not produce errors - can reference later parameters if they occur within a function expression initializer. function f(a, b = function () { return c; }, c = b()) { diff --git a/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt b/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt index 2394b91104e..c191073277f 100644 --- a/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt +++ b/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt @@ -1,9 +1,12 @@ +tests/cases/compiler/parameterPropertyInConstructor1.ts(3,17): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/parameterPropertyInConstructor1.ts (1 errors) ==== declare module mod { class Customers { constructor(public names: string); ~~~~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } } \ No newline at end of file diff --git a/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt b/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt index deb9806812b..5885385a20c 100644 --- a/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt +++ b/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt @@ -1,14 +1,22 @@ -==== tests/cases/compiler/parameterPropertyInConstructor2.ts (3 errors) ==== +tests/cases/compiler/parameterPropertyInConstructor2.ts(3,5): error TS2394: Overload signature is not compatible with function implementation. +tests/cases/compiler/parameterPropertyInConstructor2.ts(3,17): error TS2369: A parameter property is only allowed in a constructor implementation. +tests/cases/compiler/parameterPropertyInConstructor2.ts(3,24): error TS2300: Duplicate identifier 'names'. +tests/cases/compiler/parameterPropertyInConstructor2.ts(4,24): error TS2300: Duplicate identifier 'names'. + + +==== tests/cases/compiler/parameterPropertyInConstructor2.ts (4 errors) ==== module mod { class Customers { constructor(public names: string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. +!!! error TS2394: Overload signature is not compatible with function implementation. ~~~~~~~~~~~~~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~~~~~ +!!! error TS2300: Duplicate identifier 'names'. constructor(public names: string, public ages: number) { ~~~~~ -!!! Duplicate identifier 'names'. +!!! error TS2300: Duplicate identifier 'names'. } } } diff --git a/tests/baselines/reference/parameterPropertyOutsideConstructor.errors.txt b/tests/baselines/reference/parameterPropertyOutsideConstructor.errors.txt index 316a71a37b9..1073cf9164d 100644 --- a/tests/baselines/reference/parameterPropertyOutsideConstructor.errors.txt +++ b/tests/baselines/reference/parameterPropertyOutsideConstructor.errors.txt @@ -1,7 +1,10 @@ +tests/cases/compiler/parameterPropertyOutsideConstructor.ts(2,9): error TS2369: A parameter property is only allowed in a constructor implementation. + + ==== tests/cases/compiler/parameterPropertyOutsideConstructor.ts (1 errors) ==== class C { foo(public x) { ~~~~~~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! error TS2369: A parameter property is only allowed in a constructor implementation. } } \ No newline at end of file diff --git a/tests/baselines/reference/parenthesizedTypes.js b/tests/baselines/reference/parenthesizedTypes.js new file mode 100644 index 00000000000..a80d9d98c31 --- /dev/null +++ b/tests/baselines/reference/parenthesizedTypes.js @@ -0,0 +1,52 @@ +//// [parenthesizedTypes.ts] +var a: string; +var a: (string); +var a: ((string) | string | (((string)))); +var a: ((((((((((((((((((((((((((((((((((((((((string)))))))))))))))))))))))))))))))))))))))); + +var b: (x: string) => string; +var b: ((x: (string)) => (string)); + +var c: string[] | number[]; +var c: (string)[] | (number)[]; +var c: ((string)[]) | ((number)[]); + +var d: (((x: string) => string) | ((x: number) => number))[]; +var d: ({ (x: string): string } | { (x: number): number })[]; +var d: Array<((x: string) => string) | ((x: number) => number)>; +var d: Array<{ (x: string): string } | { (x: number): number }>; +var d: (Array<{ (x: string): string } | { (x: number): number }>); + +var e: typeof a[]; +var e: (typeof a)[]; + +var f: (string) => string; +var f: (string: any) => string; + +var g: [string, string]; +var g: [(string), string]; +var g: [(string), (((typeof a)))]; + + +//// [parenthesizedTypes.js] +var a; +var a; +var a; +var a; +var b; +var b; +var c; +var c; +var c; +var d; +var d; +var d; +var d; +var d; +var e; +var e; +var f; +var f; +var g; +var g; +var g; diff --git a/tests/baselines/reference/parenthesizedTypes.types b/tests/baselines/reference/parenthesizedTypes.types new file mode 100644 index 00000000000..4b7129b3782 --- /dev/null +++ b/tests/baselines/reference/parenthesizedTypes.types @@ -0,0 +1,84 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/parenthesizedTypes.ts === +var a: string; +>a : string + +var a: (string); +>a : string + +var a: ((string) | string | (((string)))); +>a : string + +var a: ((((((((((((((((((((((((((((((((((((((((string)))))))))))))))))))))))))))))))))))))))); +>a : string + +var b: (x: string) => string; +>b : (x: string) => string +>x : string + +var b: ((x: (string)) => (string)); +>b : (x: string) => string +>x : string + +var c: string[] | number[]; +>c : string[] | number[] + +var c: (string)[] | (number)[]; +>c : string[] | number[] + +var c: ((string)[]) | ((number)[]); +>c : string[] | number[] + +var d: (((x: string) => string) | ((x: number) => number))[]; +>d : (((x: string) => string) | ((x: number) => number))[] +>x : string +>x : number + +var d: ({ (x: string): string } | { (x: number): number })[]; +>d : (((x: string) => string) | ((x: number) => number))[] +>x : string +>x : number + +var d: Array<((x: string) => string) | ((x: number) => number)>; +>d : (((x: string) => string) | ((x: number) => number))[] +>Array : T[] +>x : string +>x : number + +var d: Array<{ (x: string): string } | { (x: number): number }>; +>d : (((x: string) => string) | ((x: number) => number))[] +>Array : T[] +>x : string +>x : number + +var d: (Array<{ (x: string): string } | { (x: number): number }>); +>d : (((x: string) => string) | ((x: number) => number))[] +>Array : T[] +>x : string +>x : number + +var e: typeof a[]; +>e : string[] +>a : string + +var e: (typeof a)[]; +>e : string[] +>a : string + +var f: (string) => string; +>f : (string: any) => string +>string : any + +var f: (string: any) => string; +>f : (string: any) => string +>string : any + +var g: [string, string]; +>g : [string, string] + +var g: [(string), string]; +>g : [string, string] + +var g: [(string), (((typeof a)))]; +>g : [string, string] +>a : string + diff --git a/tests/baselines/reference/parse1.errors.txt b/tests/baselines/reference/parse1.errors.txt index b2c9a06efe6..03c35f18633 100644 --- a/tests/baselines/reference/parse1.errors.txt +++ b/tests/baselines/reference/parse1.errors.txt @@ -1,8 +1,11 @@ +tests/cases/compiler/parse1.ts(4,1): error TS1003: Identifier expected. + + ==== tests/cases/compiler/parse1.ts (1 errors) ==== var bar = 42; function foo() { bar. } ~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/parse2.errors.txt b/tests/baselines/reference/parse2.errors.txt index f7d424001ca..cef03437430 100644 --- a/tests/baselines/reference/parse2.errors.txt +++ b/tests/baselines/reference/parse2.errors.txt @@ -1,6 +1,9 @@ +tests/cases/compiler/parse2.ts(3,1): error TS1135: Argument expression expected. + + ==== tests/cases/compiler/parse2.ts (1 errors) ==== function foo() { foo( } ~ -!!! Argument expression expected. \ No newline at end of file +!!! error TS1135: Argument expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parseTypes.errors.txt b/tests/baselines/reference/parseTypes.errors.txt index 49b9218320c..baa5aaff738 100644 --- a/tests/baselines/reference/parseTypes.errors.txt +++ b/tests/baselines/reference/parseTypes.errors.txt @@ -1,3 +1,10 @@ +tests/cases/compiler/parseTypes.ts(9,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. +tests/cases/compiler/parseTypes.ts(10,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. +tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. + Index signature is missing in type '(s: string) => void'. +tests/cases/compiler/parseTypes.ts(12,1): error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. + + ==== tests/cases/compiler/parseTypes.ts (4 errors) ==== var x = <() => number>null; @@ -9,15 +16,15 @@ y=f; y=g; ~ -!!! Type '(s: string) => void' is not assignable to type '() => number'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. x=g; ~ -!!! Type '(s: string) => void' is not assignable to type '() => number'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. w=g; ~ -!!! Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }': -!!! Index signature is missing in type '(s: string) => void'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. +!!! error TS2322: Index signature is missing in type '(s: string) => void'. z=g; ~ -!!! Type '(s: string) => void' is not assignable to type 'new () => number'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. \ No newline at end of file diff --git a/tests/baselines/reference/parser0_004152.errors.txt b/tests/baselines/reference/parser0_004152.errors.txt index 551d6aab5c2..cfd6161a48e 100644 --- a/tests/baselines/reference/parser0_004152.errors.txt +++ b/tests/baselines/reference/parser0_004152.errors.txt @@ -1,73 +1,115 @@ -==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (34 errors) ==== +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,45): error TS1137: Expression or comma expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,46): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,49): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,52): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,55): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,58): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,61): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,64): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,67): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,70): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,73): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,76): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,79): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,82): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,85): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,86): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,94): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,97): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,98): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,28): error TS2304: Cannot find name 'DisplayPosition'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,48): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,51): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,54): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,57): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,60): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,63): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,66): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,69): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,72): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,75): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,78): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,81): error TS2300: Duplicate identifier '3'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,84): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,96): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error TS2304: Cannot find name 'SeedCoords'. + + +==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (36 errors) ==== export class Game { ~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. private position = new DisplayPosition([), 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 0], NoMove, 0); ~ -!!! Expression or comma expected. +!!! error TS1137: Expression or comma expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! ';' expected. +!!! error TS1005: ';' expected. ~ -!!! Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. ~~~~~~~~~~~~~~~ -!!! Cannot find name 'DisplayPosition'. +!!! error TS2304: Cannot find name 'DisplayPosition'. + ~ +!!! error TS2300: Duplicate identifier '3'. ~ -!!! Duplicate identifier '3'. +!!! error TS2300: Duplicate identifier '3'. ~ -!!! Duplicate identifier '3'. +!!! error TS2300: Duplicate identifier '3'. ~ -!!! Duplicate identifier '3'. +!!! error TS2300: Duplicate identifier '3'. ~ -!!! Duplicate identifier '3'. +!!! error TS2300: Duplicate identifier '3'. + ~ +!!! error TS2300: Duplicate identifier '0'. ~ -!!! Duplicate identifier '3'. +!!! error TS2300: Duplicate identifier '3'. ~ -!!! Duplicate identifier '3'. +!!! error TS2300: Duplicate identifier '3'. ~ -!!! Duplicate identifier '3'. +!!! error TS2300: Duplicate identifier '3'. ~ -!!! Duplicate identifier '3'. +!!! error TS2300: Duplicate identifier '3'. ~ -!!! Duplicate identifier '3'. +!!! error TS2300: Duplicate identifier '3'. ~ -!!! Duplicate identifier '3'. +!!! error TS2300: Duplicate identifier '3'. ~ -!!! Duplicate identifier '0'. +!!! error TS2300: Duplicate identifier '0'. ~ -!!! Duplicate identifier '0'. +!!! error TS2300: Duplicate identifier '0'. private prevConfig: SeedCoords[][]; ~~~~~~~~~~ -!!! Cannot find name 'SeedCoords'. +!!! error TS2304: Cannot find name 'SeedCoords'. } \ No newline at end of file diff --git a/tests/baselines/reference/parser10.1.1-8gs.errors.txt b/tests/baselines/reference/parser10.1.1-8gs.errors.txt index 4ed4b8b2635..459ad40ab72 100644 --- a/tests/baselines/reference/parser10.1.1-8gs.errors.txt +++ b/tests/baselines/reference/parser10.1.1-8gs.errors.txt @@ -1,3 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,5): error TS1134: Variable declaration expected. +tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,12): error TS1134: Variable declaration expected. +tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,14): error TS1134: Variable declaration expected. +tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(16,7): error TS2304: Cannot find name 'NotEarlyError'. + + ==== tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts (4 errors) ==== /// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set @@ -16,12 +22,12 @@ "use strict"; throw NotEarlyError; ~~~~~~~~~~~~~ -!!! Cannot find name 'NotEarlyError'. +!!! error TS2304: Cannot find name 'NotEarlyError'. var public = 1; ~~~~~~ -!!! Variable declaration expected. +!!! error TS1134: Variable declaration expected. ~ -!!! Variable declaration expected. +!!! error TS1134: Variable declaration expected. ~ -!!! Variable declaration expected. +!!! error TS1134: Variable declaration expected. \ 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 694dc1ac57a..940083ca93a 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,4 +1,9 @@ -==== tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts (1 errors) ==== +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'. +tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error TS2304: Cannot find name 'runTestCase'. + + +==== tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts (2 errors) ==== /// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the @@ -15,6 +20,9 @@ var one = 1; var _float = -(4/3); 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'. 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 @@ -25,5 +33,5 @@ } runTestCase(testcase); ~~~~~~~~~~~ -!!! Cannot find name 'runTestCase'. +!!! error TS2304: Cannot find name 'runTestCase'. \ No newline at end of file diff --git a/tests/baselines/reference/parser509534.errors.txt b/tests/baselines/reference/parser509534.errors.txt index e40d485cb60..78d56d1413e 100644 --- a/tests/baselines/reference/parser509534.errors.txt +++ b/tests/baselines/reference/parser509534.errors.txt @@ -1,11 +1,15 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509534.ts(2,14): error TS2304: Cannot find name 'require'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509534.ts(3,1): error TS2304: Cannot find name 'module'. + + ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509534.ts (2 errors) ==== "use strict"; var config = require("../config"); ~~~~~~~ -!!! Cannot find name 'require'. +!!! error TS2304: Cannot find name 'require'. module.exports.route = function (server) { ~~~~~~ -!!! Cannot find name 'module'. +!!! error TS2304: Cannot find name 'module'. // General Login Page server.get(config.env.siteRoot + "/auth/login", function (req, res, next) { diff --git a/tests/baselines/reference/parser509546.errors.txt b/tests/baselines/reference/parser509546.errors.txt index e3e361e6c69..ad8bf69dc12 100644 --- a/tests/baselines/reference/parser509546.errors.txt +++ b/tests/baselines/reference/parser509546.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts (1 errors) ==== export class Logger { ~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. public } \ No newline at end of file diff --git a/tests/baselines/reference/parser509546_1.errors.txt b/tests/baselines/reference/parser509546_1.errors.txt index 3bc50baa001..2620036c5b6 100644 --- a/tests/baselines/reference/parser509546_1.errors.txt +++ b/tests/baselines/reference/parser509546_1.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts(1,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts (1 errors) ==== export class Logger { ~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. public } \ No newline at end of file diff --git a/tests/baselines/reference/parser509546_2.errors.txt b/tests/baselines/reference/parser509546_2.errors.txt index 08b4b95260d..f945ccaac00 100644 --- a/tests/baselines/reference/parser509546_2.errors.txt +++ b/tests/baselines/reference/parser509546_2.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts(3,14): error TS1148: Cannot compile external modules unless the '--module' flag is provided. + + ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts (1 errors) ==== "use strict"; export class Logger { ~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. +!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. public } \ No newline at end of file diff --git a/tests/baselines/reference/parser509618.errors.txt b/tests/baselines/reference/parser509618.errors.txt index 84ea778e0ca..fdc66573617 100644 --- a/tests/baselines/reference/parser509618.errors.txt +++ b/tests/baselines/reference/parser509618.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509618.ts(2,20): error TS1036: Statements are not allowed in ambient contexts. + + ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509618.ts (1 errors) ==== declare module ambiModule { interface i1 { }; ~ -!!! Statements are not allowed in ambient contexts. +!!! error TS1036: Statements are not allowed in ambient contexts. } \ No newline at end of file diff --git a/tests/baselines/reference/parser509630.errors.txt b/tests/baselines/reference/parser509630.errors.txt index 72be30146de..29e79f6522a 100644 --- a/tests/baselines/reference/parser509630.errors.txt +++ b/tests/baselines/reference/parser509630.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509630.ts(3,1): error TS1137: Expression or comma expected. + + ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509630.ts (1 errors) ==== class Type { public examples = [ // typing here } ~ -!!! Expression or comma expected. +!!! error TS1137: Expression or comma expected. class Any extends Type { } \ No newline at end of file diff --git a/tests/baselines/reference/parser509667.errors.txt b/tests/baselines/reference/parser509667.errors.txt index 684616da419..86dd7178b0f 100644 --- a/tests/baselines/reference/parser509667.errors.txt +++ b/tests/baselines/reference/parser509667.errors.txt @@ -1,10 +1,13 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509667.ts(4,4): error TS1003: Identifier expected. + + ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509667.ts (1 errors) ==== class Foo { f1() { if (this. } ~ -!!! Identifier expected. +!!! error TS1003: Identifier expected. f2() { } diff --git a/tests/baselines/reference/parser509668.errors.txt b/tests/baselines/reference/parser509668.errors.txt index 36dc0523dd2..5ea380592ef 100644 --- a/tests/baselines/reference/parser509668.errors.txt +++ b/tests/baselines/reference/parser509668.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts(3,23): error TS1005: ',' expected. + + ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts (1 errors) ==== class Foo3 { // Doesn't work, but should constructor (public ...args: string[]) { } ~~~ -!!! ',' expected. +!!! error TS1005: ',' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/parser509669.errors.txt b/tests/baselines/reference/parser509669.errors.txt index 05ce0f609e3..b943c20fcef 100644 --- a/tests/baselines/reference/parser509669.errors.txt +++ b/tests/baselines/reference/parser509669.errors.txt @@ -1,6 +1,9 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509669.ts(2,17): error TS1005: '=>' expected. + + ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509669.ts (1 errors) ==== function foo():any { return ():void {}; ~ -!!! '=>' expected. +!!! error TS1005: '=>' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/parser509693.errors.txt b/tests/baselines/reference/parser509693.errors.txt index dd1aa4b120f..b910af1c2e6 100644 --- a/tests/baselines/reference/parser509693.errors.txt +++ b/tests/baselines/reference/parser509693.errors.txt @@ -1,6 +1,10 @@ +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509693.ts(1,6): error TS2304: Cannot find name 'module'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509693.ts(1,22): error TS2304: Cannot find name 'module'. + + ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509693.ts (2 errors) ==== if (!module.exports) module.exports = ""; ~~~~~~ -!!! Cannot find name 'module'. +!!! error TS2304: Cannot find name 'module'. ~~~~~~ -!!! Cannot find name 'module'. \ No newline at end of file +!!! error TS2304: Cannot find name 'module'. \ No newline at end of file diff --git a/tests/baselines/reference/parser509698.errors.txt b/tests/baselines/reference/parser509698.errors.txt index 8a8b23d44e4..2aaaec18dc2 100644 --- a/tests/baselines/reference/parser509698.errors.txt +++ b/tests/baselines/reference/parser509698.errors.txt @@ -1,11 +1,21 @@ -!!! Cannot find global type 'Array'. -!!! Cannot find global type 'Boolean'. -!!! Cannot find global type 'Function'. -!!! Cannot find global type 'IArguments'. -!!! Cannot find global type 'Number'. -!!! Cannot find global type 'Object'. -!!! Cannot find global type 'RegExp'. -!!! Cannot find global type 'String'. +error TS2318: Cannot find global type 'Array'. +error TS2318: Cannot find global type 'Boolean'. +error TS2318: Cannot find global type 'Function'. +error TS2318: Cannot find global type 'IArguments'. +error TS2318: Cannot find global type 'Number'. +error TS2318: Cannot find global type 'Object'. +error TS2318: Cannot find global type 'RegExp'. +error TS2318: Cannot find global type 'String'. + + +!!! error TS2318: Cannot find global type 'Array'. +!!! error TS2318: Cannot find global type 'Boolean'. +!!! error TS2318: Cannot find global type 'Function'. +!!! error TS2318: Cannot find global type 'IArguments'. +!!! error TS2318: Cannot find global type 'Number'. +!!! error TS2318: Cannot find global type 'Object'. +!!! error TS2318: Cannot find global type 'RegExp'. +!!! error TS2318: Cannot find global type 'String'. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509698.ts (0 errors) ==== ///